Remove 'final' from method signatures across gerrit.

Change-Id: I986a5507aa26ceb28305a7b08991e85238bde0e3
This commit is contained in:
Han-Wen Nienhuys
2017-06-13 18:10:03 +02:00
committed by Edwin Kempin
parent 64e43c24ef
commit b0fb0a7a96
424 changed files with 1381 additions and 1465 deletions

View File

@@ -62,7 +62,7 @@ public class CopyableLabel extends Composite implements HasText {
return flashEnabled;
}
public static void setFlashEnabled(final boolean on) {
public static void setFlashEnabled(boolean on) {
flashEnabled = on;
}
@@ -87,7 +87,7 @@ public class CopyableLabel extends Composite implements HasText {
*
* @param str initial content
*/
public CopyableLabel(final String str) {
public CopyableLabel(String str) {
this(str, true);
}
@@ -98,7 +98,7 @@ public class CopyableLabel extends Composite implements HasText {
* @param showLabel if true, the content is shown, if false it is hidden from view and only the
* copy icon is displayed.
*/
public CopyableLabel(final String str, final boolean showLabel) {
public CopyableLabel(String str, boolean showLabel) {
content = new FlowPanel();
initWidget(content);
@@ -111,7 +111,7 @@ public class CopyableLabel extends Composite implements HasText {
textLabel.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
showTextBox();
}
});
@@ -160,7 +160,7 @@ public class CopyableLabel extends Composite implements HasText {
* @param text the new preview text, should be shorter than the original text which would be
* copied to the clipboard.
*/
public void setPreviewText(final String text) {
public void setPreviewText(String text) {
if (textLabel != null) {
textLabel.setText(text);
}
@@ -206,7 +206,7 @@ public class CopyableLabel extends Composite implements HasText {
}
@Override
public void setText(final String newText) {
public void setText(String newText) {
text = newText;
visibleLen = newText.length();
@@ -229,7 +229,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addKeyPressHandler(
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (event.isControlKeyDown() || event.isMetaKeyDown()) {
switch (event.getCharCode()) {
case 'c':
@@ -237,7 +237,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addKeyUpHandler(
new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
public void onKeyUp(KeyUpEvent event) {
Scheduler.get()
.scheduleDeferred(
new Command() {
@@ -256,7 +256,7 @@ public class CopyableLabel extends Composite implements HasText {
textBox.addBlurHandler(
new BlurHandler() {
@Override
public void onBlur(final BlurEvent event) {
public void onBlur(BlurEvent event) {
hideTextBox();
}
});

View File

@@ -38,19 +38,18 @@ public class CssLinker extends AbstractLinker {
}
@Override
public ArtifactSet link(
final TreeLogger logger, final LinkerContext context, final ArtifactSet artifacts)
public ArtifactSet link(final TreeLogger logger, LinkerContext context, ArtifactSet artifacts)
throws UnableToCompleteException {
final ArtifactSet returnTo = new ArtifactSet();
int index = 0;
final HashMap<String, PublicResource> css = new HashMap<>();
for (final StandardStylesheetReference ssr :
for (StandardStylesheetReference ssr :
artifacts.<StandardStylesheetReference>find(StandardStylesheetReference.class)) {
css.put(ssr.getSrc(), null);
}
for (final PublicResource pr : artifacts.<PublicResource>find(PublicResource.class)) {
for (PublicResource pr : artifacts.<PublicResource>find(PublicResource.class)) {
if (css.containsKey(pr.getPartialPath())) {
css.put(pr.getPartialPath(), new CssPubRsrc(name(logger, pr), pr));
}
@@ -74,8 +73,7 @@ public class CssLinker extends AbstractLinker {
return returnTo;
}
private String name(final TreeLogger logger, final PublicResource r)
throws UnableToCompleteException {
private String name(TreeLogger logger, PublicResource r) throws UnableToCompleteException {
byte[] out;
try (ByteArrayOutputStream tmp = new ByteArrayOutputStream();
InputStream in = r.getContents(logger)) {
@@ -105,13 +103,13 @@ public class CssLinker extends AbstractLinker {
private static final long serialVersionUID = 1L;
private final PublicResource src;
CssPubRsrc(final String partialPath, final PublicResource r) {
CssPubRsrc(String partialPath, PublicResource r) {
super(StandardLinkerContext.class, partialPath);
src = r;
}
@Override
public InputStream getContents(final TreeLogger logger) throws UnableToCompleteException {
public InputStream getContents(TreeLogger logger) throws UnableToCompleteException {
return src.getContents(logger);
}

View File

@@ -34,7 +34,7 @@ public final class CompoundKeyCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
GlobalKey.temporaryWithTimeout(set);
}
}

View File

@@ -30,7 +30,7 @@ public class GlobalKey {
public static final KeyPressHandler STOP_PROPAGATION =
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
event.stopPropagation();
}
};
@@ -50,7 +50,7 @@ public class GlobalKey {
.addKeyPressHandler(
new KeyPressHandler() {
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
final KeyCommandSet s = active.live;
if (s != active.all) {
active.live = active.all;
@@ -78,19 +78,19 @@ public class GlobalKey {
restoreGlobal =
new CloseHandler<PopupPanel>() {
@Override
public void onClose(final CloseEvent<PopupPanel> event) {
public void onClose(CloseEvent<PopupPanel> event) {
active = global;
}
};
}
}
static void temporaryWithTimeout(final KeyCommandSet s) {
static void temporaryWithTimeout(KeyCommandSet s) {
active.live = s;
restoreTimer.schedule(250);
}
public static void dialog(final PopupPanel panel) {
public static void dialog(PopupPanel panel) {
initEvents();
initDialog();
assert panel.isShowing();
@@ -110,7 +110,7 @@ public class GlobalKey {
KeyDownEvent.getType());
}
public static HandlerRegistration addApplication(final Widget widget, final KeyCommand appKey) {
public static HandlerRegistration addApplication(Widget widget, KeyCommand appKey) {
initEvents();
final State state = stateFor(widget);
state.add(appKey);
@@ -122,7 +122,7 @@ public class GlobalKey {
};
}
public static HandlerRegistration add(final Widget widget, final KeyCommandSet cmdSet) {
public static HandlerRegistration add(Widget widget, KeyCommandSet cmdSet) {
initEvents();
final State state = stateFor(widget);
state.add(cmdSet);
@@ -144,7 +144,7 @@ public class GlobalKey {
return global;
}
public static void filter(final KeyCommandFilter filter) {
public static void filter(KeyCommandFilter filter) {
active.filter(filter);
if (active != global) {
global.filter(filter);
@@ -159,7 +159,7 @@ public class GlobalKey {
final KeyCommandSet all;
KeyCommandSet live;
State(final Widget r) {
State(Widget r) {
root = r;
app = new KeyCommandSet(KeyConstants.I.applicationSection());
@@ -171,25 +171,25 @@ public class GlobalKey {
live = all;
}
void add(final KeyCommand k) {
void add(KeyCommand k) {
app.add(k);
all.add(k);
}
void remove(final KeyCommand k) {
void remove(KeyCommand k) {
app.remove(k);
all.remove(k);
}
void add(final KeyCommandSet s) {
void add(KeyCommandSet s) {
all.add(s);
}
void remove(final KeyCommandSet s) {
void remove(KeyCommandSet s) {
all.remove(s);
}
void filter(final KeyCommandFilter f) {
void filter(KeyCommandFilter f) {
all.filter(f);
}
}

View File

@@ -27,7 +27,7 @@ public class HidePopupPanelCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
panel.hide();
}
}

View File

@@ -25,7 +25,7 @@ public abstract class KeyCommand implements KeyPressHandler {
public static final int M_META = 4 << 16;
public static final int M_SHIFT = 8 << 16;
public static boolean same(final KeyCommand a, final KeyCommand b) {
public static boolean same(KeyCommand a, KeyCommand b) {
return a.getClass() == b.getClass() && a.helpText.equals(b.helpText) && a.sibling == b.sibling;
}
@@ -33,11 +33,11 @@ public abstract class KeyCommand implements KeyPressHandler {
private final String helpText;
KeyCommand sibling;
public KeyCommand(final int mask, final int key, final String help) {
public KeyCommand(int mask, int key, String help) {
this(mask, (char) key, help);
}
public KeyCommand(final int mask, final char key, final String help) {
public KeyCommand(int mask, char key, String help) {
assert help != null;
keyMask = mask | key;
helpText = help;
@@ -88,12 +88,12 @@ public abstract class KeyCommand implements KeyPressHandler {
return b;
}
private void modifier(final SafeHtmlBuilder b, final String name) {
private void modifier(SafeHtmlBuilder b, String name) {
namedKey(b, name);
b.append(" + ");
}
private void namedKey(final SafeHtmlBuilder b, final String name) {
private void namedKey(SafeHtmlBuilder b, String name) {
b.append('<');
b.openSpan();
b.setStyleName(KeyResources.I.css().helpKey());

View File

@@ -33,7 +33,7 @@ public class KeyCommandSet implements KeyPressHandler {
this("");
}
public KeyCommandSet(final String setName) {
public KeyCommandSet(String setName) {
map = new HashMap<>();
name = setName;
}
@@ -42,7 +42,7 @@ public class KeyCommandSet implements KeyPressHandler {
return name;
}
public void setName(final String setName) {
public void setName(String setName) {
assert setName != null;
name = setName;
}
@@ -62,7 +62,7 @@ public class KeyCommandSet implements KeyPressHandler {
b.sibling = a;
}
public void add(final KeyCommand k) {
public void add(KeyCommand k) {
assert !map.containsKey(k.keyMask)
: "Key " + k.describeKeyStroke().asString() + " already registered";
if (!map.containsKey(k.keyMask)) {
@@ -70,38 +70,38 @@ public class KeyCommandSet implements KeyPressHandler {
}
}
public void remove(final KeyCommand k) {
public void remove(KeyCommand k) {
assert map.get(k.keyMask) == k;
map.remove(k.keyMask);
}
public void add(final KeyCommandSet set) {
public void add(KeyCommandSet set) {
if (sets == null) {
sets = new ArrayList<>();
}
assert !sets.contains(set);
sets.add(set);
for (final KeyCommand k : set.map.values()) {
for (KeyCommand k : set.map.values()) {
add(k);
}
}
public void remove(final KeyCommandSet set) {
public void remove(KeyCommandSet set) {
assert sets != null;
assert sets.contains(set);
sets.remove(set);
for (final KeyCommand k : set.map.values()) {
for (KeyCommand k : set.map.values()) {
remove(k);
}
}
public void filter(final KeyCommandFilter filter) {
public void filter(KeyCommandFilter filter) {
if (sets != null) {
for (final KeyCommandSet s : sets) {
for (KeyCommandSet s : sets) {
s.filter(filter);
}
}
for (final Iterator<KeyCommand> i = map.values().iterator(); i.hasNext(); ) {
for (Iterator<KeyCommand> i = map.values().iterator(); i.hasNext(); ) {
final KeyCommand kc = i.next();
if (!filter.include(kc)) {
i.remove();
@@ -120,7 +120,7 @@ public class KeyCommandSet implements KeyPressHandler {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
final KeyCommand k = map.get(toMask(event));
if (k != null) {
event.preventDefault();
@@ -129,7 +129,7 @@ public class KeyCommandSet implements KeyPressHandler {
}
}
static int toMask(final KeyPressEvent event) {
static int toMask(KeyPressEvent event) {
int mask = event.getUnicodeCharCode();
if (mask == 0) {
mask = event.getNativeEvent().getKeyCode();

View File

@@ -51,7 +51,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
closer.addClickHandler(
new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
public void onClick(ClickEvent event) {
hide();
}
});
@@ -84,7 +84,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void setVisible(final boolean show) {
public void setVisible(boolean show) {
super.setVisible(show);
if (show) {
focus.setFocus(true);
@@ -92,7 +92,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (KeyCommandSet.toMask(event) == ShowHelpCommand.INSTANCE.keyMask) {
// Block the '?' key from triggering us to show right after
// we just hide ourselves.
@@ -104,16 +104,16 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
}
@Override
public void onKeyDown(final KeyDownEvent event) {
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
hide();
}
}
private void populate(final Grid lists) {
private void populate(Grid lists) {
int[] end = new int[5];
int column = 0;
for (final KeyCommandSet set : combinedSetsByName()) {
for (KeyCommandSet set : combinedSetsByName()) {
int row = end[column];
row = formatGroup(lists, row, column, set);
end[column] = row;
@@ -131,7 +131,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
*/
private static Collection<KeyCommandSet> combinedSetsByName() {
LinkedHashMap<String, KeyCommandSet> byName = new LinkedHashMap<>();
for (final KeyCommandSet set : GlobalKey.active.all.getSets()) {
for (KeyCommandSet set : GlobalKey.active.all.getSets()) {
KeyCommandSet v = byName.get(set.getName());
if (v == null) {
v = new KeyCommandSet(set.getName());
@@ -142,7 +142,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return byName.values();
}
private int formatGroup(final Grid lists, int row, final int col, final KeyCommandSet set) {
private int formatGroup(Grid lists, int row, int col, KeyCommandSet set) {
if (set.isEmpty()) {
return row;
}
@@ -157,8 +157,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return formatKeys(lists, row, col, set, null);
}
private int formatKeys(
final Grid lists, int row, final int col, final KeyCommandSet set, final SafeHtml prefix) {
private int formatKeys(final Grid lists, int row, int col, KeyCommandSet set, SafeHtml prefix) {
final CellFormatter fmt = lists.getCellFormatter();
final List<KeyCommand> keys = sort(set);
if (lists.getRowCount() < row + keys.size()) {
@@ -228,7 +227,7 @@ public class KeyHelpPopup extends PopupPanel implements KeyPressHandler, KeyDown
return row;
}
private List<KeyCommand> sort(final KeyCommandSet set) {
private List<KeyCommand> sort(KeyCommandSet set) {
final List<KeyCommand> keys = new ArrayList<>(set.getKeys());
Collections.sort(
keys,

View File

@@ -22,7 +22,7 @@ public class NpTextBox extends TextBox {
addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
}
public NpTextBox(final Element element) {
public NpTextBox(Element element) {
super(element);
addKeyPressHandler(GlobalKey.STOP_PROPAGATION);
}

View File

@@ -40,7 +40,7 @@ public class ShowHelpCommand extends KeyCommand {
}
@Override
public void onKeyPress(final KeyPressEvent event) {
public void onKeyPress(KeyPressEvent event) {
if (current != null) {
// Already open? Close the dialog.
//
@@ -52,7 +52,7 @@ public class ShowHelpCommand extends KeyCommand {
help.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(final CloseEvent<PopupPanel> event) {
public void onClose(CloseEvent<PopupPanel> event) {
current = null;
BUS.fireEvent(new FocusEvent() {});
}
@@ -61,7 +61,7 @@ public class ShowHelpCommand extends KeyCommand {
help.setPopupPositionAndShow(
new PositionCallback() {
@Override
public void setPosition(final int pWidth, final int pHeight) {
public void setPosition(int pWidth, int pHeight) {
final int left = (Window.getClientWidth() - pWidth) >> 1;
final int wLeft = Window.getScrollLeft();
final int wTop = Window.getScrollTop();

View File

@@ -41,7 +41,7 @@ public class ProgressBar extends Composite {
}
/** Create a bar displaying the specified message. */
public ProgressBar(final String text) {
public ProgressBar(String text) {
if (text == null || text.length() == 0) {
callerText = "";
} else {
@@ -68,7 +68,7 @@ public class ProgressBar extends Composite {
}
/** Update the bar's percent completion. */
public void setValue(final int pComplete) {
public void setValue(int pComplete) {
assert 0 <= pComplete && pComplete <= 100;
value = pComplete;
bar.setWidth(2 * pComplete + "px");

View File

@@ -38,7 +38,7 @@ class AttMap {
private Tag tag = ANY;
private int live;
void reset(final String tagName) {
void reset(String tagName) {
tag = TAGS.get(tagName.toLowerCase());
if (tag == null) {
tag = ANY;
@@ -46,7 +46,7 @@ class AttMap {
live = 0;
}
void onto(final Buffer raw, final SafeHtmlBuilder esc) {
void onto(Buffer raw, SafeHtmlBuilder esc) {
for (int i = 0; i < live; i++) {
final String v = values.get(i);
if (v.length() > 0) {
@@ -70,7 +70,7 @@ class AttMap {
return "";
}
void set(String name, final String value) {
void set(String name, String value) {
name = name.toLowerCase();
tag.assertSafe(name, value);
@@ -91,7 +91,7 @@ class AttMap {
}
}
private static void assertNotJavascriptUrl(final String value) {
private static void assertNotJavascriptUrl(String value) {
if (value.startsWith("#")) {
// common in GWT, and safe, so bypass further checks

View File

@@ -22,37 +22,37 @@ final class BufferDirect implements Buffer {
}
@Override
public void append(final boolean v) {
public void append(boolean v) {
strbuf.append(v);
}
@Override
public void append(final char v) {
public void append(char v) {
strbuf.append(v);
}
@Override
public void append(final int v) {
public void append(int v) {
strbuf.append(v);
}
@Override
public void append(final long v) {
public void append(long v) {
strbuf.append(v);
}
@Override
public void append(final float v) {
public void append(float v) {
strbuf.append(v);
}
@Override
public void append(final double v) {
public void append(double v) {
strbuf.append(v);
}
@Override
public void append(final String v) {
public void append(String v) {
strbuf.append(v);
}

View File

@@ -17,42 +17,42 @@ package com.google.gwtexpui.safehtml.client;
final class BufferSealElement implements Buffer {
private final SafeHtmlBuilder shb;
BufferSealElement(final SafeHtmlBuilder safeHtmlBuilder) {
BufferSealElement(SafeHtmlBuilder safeHtmlBuilder) {
shb = safeHtmlBuilder;
}
@Override
public void append(final boolean v) {
public void append(boolean v) {
shb.sealElement().append(v);
}
@Override
public void append(final char v) {
public void append(char v) {
shb.sealElement().append(v);
}
@Override
public void append(final double v) {
public void append(double v) {
shb.sealElement().append(v);
}
@Override
public void append(final float v) {
public void append(float v) {
shb.sealElement().append(v);
}
@Override
public void append(final int v) {
public void append(int v) {
shb.sealElement().append(v);
}
@Override
public void append(final long v) {
public void append(long v) {
shb.sealElement().append(v);
}
@Override
public void append(final String v) {
public void append(String v) {
shb.sealElement().append(v);
}

View File

@@ -45,11 +45,11 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
request,
new Callback() {
@Override
public void onSuggestionsReady(final Request request, final Response response) {
public void onSuggestionsReady(Request request, Response response) {
final String qpat = getQueryPattern(request.getQuery());
final boolean html = isHTML();
final ArrayList<Suggestion> r = new ArrayList<>();
for (final Suggestion s : response.getSuggestions()) {
for (Suggestion s : response.getSuggestions()) {
r.add(new BoldSuggestion(qpat, s, html));
}
cb.onSuggestionsReady(request, new Response(r));
@@ -57,7 +57,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
});
}
protected String getQueryPattern(final String query) {
protected String getQueryPattern(String query) {
return query;
}
@@ -77,7 +77,7 @@ public abstract class HighlightSuggestOracle extends SuggestOracle {
private final Suggestion suggestion;
private final String displayString;
BoldSuggestion(final String qstr, final Suggestion s, final boolean html) {
BoldSuggestion(String qstr, Suggestion s, boolean html) {
suggestion = s;
String ds = s.getDisplayString();

View File

@@ -79,17 +79,17 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
}
/** @return the existing HTML property of a widget. */
public static SafeHtml get(final HasHTML t) {
public static SafeHtml get(HasHTML t) {
return new SafeHtmlString(t.getHTML());
}
/** @return the existing HTML text, wrapped in a safe buffer. */
public static SafeHtml asis(final String htmlText) {
public static SafeHtml asis(String htmlText) {
return new SafeHtmlString(htmlText);
}
/** Set the HTML property of a widget. */
public static <T extends HasHTML> T set(final T e, final SafeHtml str) {
public static <T extends HasHTML> T set(T e, SafeHtml str) {
e.setHTML(str.asString());
return e;
}
@@ -106,13 +106,12 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
}
/** @return the existing inner HTML of a table cell. */
public static SafeHtml get(final HTMLTable t, final int row, final int col) {
public static SafeHtml get(HTMLTable t, int row, int col) {
return new SafeHtmlString(t.getHTML(row, col));
}
/** Set the inner HTML of a table cell. */
public static <T extends HTMLTable> T set(
final T t, final int row, final int col, final SafeHtml str) {
public static <T extends HTMLTable> T set(final T t, int row, int col, SafeHtml str) {
t.setHTML(row, col, str.asString());
return t;
}
@@ -140,13 +139,13 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
*/
public SafeHtml wikify() {
final SafeHtmlBuilder r = new SafeHtmlBuilder();
for (final String p : linkify().asString().split("\n\n")) {
for (String p : linkify().asString().split("\n\n")) {
if (isQuote(p)) {
wikifyQuote(r, p);
} else if (isPreFormat(p)) {
r.openElement("p");
for (final String line : p.split("\n")) {
for (String line : p.split("\n")) {
r.openSpan();
r.setStyleName(RESOURCES.css().wikiPreFormat());
r.append(asis(line));
@@ -167,7 +166,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
return r.toSafeHtml();
}
private void wikifyList(final SafeHtmlBuilder r, final String p) {
private void wikifyList(SafeHtmlBuilder r, String p) {
boolean in_ul = false;
boolean in_p = false;
for (String line : p.split("\n")) {
@@ -232,11 +231,11 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
return p.startsWith("&gt; ") || p.startsWith(" &gt; ");
}
private static boolean isPreFormat(final String p) {
private static boolean isPreFormat(String p) {
return p.contains("\n ") || p.contains("\n\t") || p.startsWith(" ") || p.startsWith("\t");
}
private static boolean isList(final String p) {
private static boolean isList(String p) {
return p.contains("\n- ") || p.contains("\n* ") || p.startsWith("- ") || p.startsWith("* ");
}
@@ -252,7 +251,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
* {@code $<i>n</i>}.
* @return a new string, after the replacement has been made.
*/
public SafeHtml replaceFirst(final String regex, final String repl) {
public SafeHtml replaceFirst(String regex, String repl) {
return new SafeHtmlString(asString().replaceFirst(regex, repl));
}
@@ -268,7 +267,7 @@ public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtm
* {@code $<i>n</i>}.
* @return a new string, after the replacements have been made.
*/
public SafeHtml replaceAll(final String regex, final String repl) {
public SafeHtml replaceAll(String regex, String repl) {
return new SafeHtmlString(asString().replaceAll(regex, repl));
}

View File

@@ -49,12 +49,12 @@ public class SafeHtmlBuilder extends SafeHtml {
return !isEmpty();
}
public SafeHtmlBuilder append(final boolean in) {
public SafeHtmlBuilder append(boolean in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final char in) {
public SafeHtmlBuilder append(char in) {
switch (in) {
case '&':
cb.append("&amp;");
@@ -83,22 +83,22 @@ public class SafeHtmlBuilder extends SafeHtml {
return this;
}
public SafeHtmlBuilder append(final int in) {
public SafeHtmlBuilder append(int in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final long in) {
public SafeHtmlBuilder append(long in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final float in) {
public SafeHtmlBuilder append(float in) {
cb.append(in);
return this;
}
public SafeHtmlBuilder append(final double in) {
public SafeHtmlBuilder append(double in) {
cb.append(in);
return this;
}
@@ -112,7 +112,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append already safe HTML as-is, avoiding double escaping. */
public SafeHtmlBuilder append(final SafeHtml in) {
public SafeHtmlBuilder append(SafeHtml in) {
if (in != null) {
cb.append(in.asString());
}
@@ -120,7 +120,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final String in) {
public SafeHtmlBuilder append(String in) {
if (in != null) {
impl.escapeStr(this, in);
}
@@ -128,7 +128,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final StringBuilder in) {
public SafeHtmlBuilder append(StringBuilder in) {
if (in != null) {
append(in.toString());
}
@@ -136,7 +136,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final StringBuffer in) {
public SafeHtmlBuilder append(StringBuffer in) {
if (in != null) {
append(in.toString());
}
@@ -144,7 +144,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the result of toString(), escaping unsafe characters. */
public SafeHtmlBuilder append(final Object in) {
public SafeHtmlBuilder append(Object in) {
if (in != null) {
append(in.toString());
}
@@ -152,7 +152,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append the string, escaping unsafe characters. */
public SafeHtmlBuilder append(final CharSequence in) {
public SafeHtmlBuilder append(CharSequence in) {
if (in != null) {
escapeCS(this, in);
}
@@ -167,7 +167,7 @@ public class SafeHtmlBuilder extends SafeHtml {
*
* @param tagName name of the HTML element to open.
*/
public SafeHtmlBuilder openElement(final String tagName) {
public SafeHtmlBuilder openElement(String tagName) {
assert isElementName(tagName);
cb.append("<");
cb.append(tagName);
@@ -187,7 +187,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @return the attribute value, as a string. The empty string if the attribute has not been
* assigned a value. The returned string is the raw (unescaped) value.
*/
public String getAttribute(final String name) {
public String getAttribute(String name) {
assert isAttributeName(name);
assert cb == sBuf;
return att.get(name);
@@ -200,7 +200,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param value value to assign; any existing value is replaced. The value is escaped (if
* necessary) during the assignment.
*/
public SafeHtmlBuilder setAttribute(final String name, final String value) {
public SafeHtmlBuilder setAttribute(String name, String value) {
assert isAttributeName(name);
assert cb == sBuf;
att.set(name, value != null ? value : "");
@@ -213,7 +213,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param name name of the attribute to set.
* @param value value to assign, any existing value is replaced.
*/
public SafeHtmlBuilder setAttribute(final String name, final int value) {
public SafeHtmlBuilder setAttribute(String name, int value) {
return setAttribute(name, String.valueOf(value));
}
@@ -227,7 +227,7 @@ public class SafeHtmlBuilder extends SafeHtml {
* @param name name of the attribute to append onto.
* @param value additional value to append.
*/
public SafeHtmlBuilder appendAttribute(final String name, String value) {
public SafeHtmlBuilder appendAttribute(String name, String value) {
if (value != null && value.length() > 0) {
final String e = getAttribute(name);
return setAttribute(name, e.length() > 0 ? e + " " + value : value);
@@ -236,17 +236,17 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Set the height attribute of the current element. */
public SafeHtmlBuilder setHeight(final int height) {
public SafeHtmlBuilder setHeight(int height) {
return setAttribute("height", height);
}
/** Set the width attribute of the current element. */
public SafeHtmlBuilder setWidth(final int width) {
public SafeHtmlBuilder setWidth(int width) {
return setAttribute("width", width);
}
/** Set the CSS class name for this element. */
public SafeHtmlBuilder setStyleName(final String style) {
public SafeHtmlBuilder setStyleName(String style) {
assert isCssName(style);
return setAttribute("class", style);
}
@@ -256,7 +256,7 @@ public class SafeHtmlBuilder extends SafeHtml {
*
* <p>If no CSS class name has been specified yet, this method initializes it to the single name.
*/
public SafeHtmlBuilder addStyleName(final String style) {
public SafeHtmlBuilder addStyleName(String style) {
assert isCssName(style);
return appendAttribute("class", style);
}
@@ -281,7 +281,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append a closing tag for the named element. */
public SafeHtmlBuilder closeElement(final String name) {
public SafeHtmlBuilder closeElement(String name) {
assert isElementName(name);
cb.append("</");
cb.append(name);
@@ -362,7 +362,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/** Append "&lt;param name=... value=... /&gt;". */
public SafeHtmlBuilder paramElement(final String name, final String value) {
public SafeHtmlBuilder paramElement(String name, String value) {
openElement("param");
setAttribute("name", name);
setAttribute("value", value);
@@ -379,21 +379,21 @@ public class SafeHtmlBuilder extends SafeHtml {
return cb.toString();
}
private static void escapeCS(final SafeHtmlBuilder b, final CharSequence in) {
private static void escapeCS(SafeHtmlBuilder b, CharSequence in) {
for (int i = 0; i < in.length(); i++) {
b.append(in.charAt(i));
}
}
private static boolean isElementName(final String name) {
private static boolean isElementName(String name) {
return name.matches("^[a-zA-Z][a-zA-Z0-9_-]*$");
}
private static boolean isAttributeName(final String name) {
private static boolean isAttributeName(String name) {
return isElementName(name);
}
private static boolean isCssName(final String name) {
private static boolean isCssName(String name) {
return isElementName(name);
}
@@ -403,14 +403,14 @@ public class SafeHtmlBuilder extends SafeHtml {
private static class ServerImpl extends Impl {
@Override
void escapeStr(final SafeHtmlBuilder b, final String in) {
void escapeStr(SafeHtmlBuilder b, String in) {
SafeHtmlBuilder.escapeCS(b, in);
}
}
private static class ClientImpl extends Impl {
@Override
void escapeStr(final SafeHtmlBuilder b, final String in) {
void escapeStr(SafeHtmlBuilder b, String in) {
b.cb.append(escape(in));
}

View File

@@ -18,7 +18,7 @@ package com.google.gwtexpui.safehtml.client;
class SafeHtmlString extends SafeHtml {
private final String html;
SafeHtmlString(final String h) {
SafeHtmlString(String h) {
html = h;
}

View File

@@ -48,14 +48,13 @@ import javax.servlet.http.HttpServletResponse;
*/
public class CacheControlFilter implements Filter {
@Override
public void init(final FilterConfig config) {}
public void init(FilterConfig config) {}
@Override
public void destroy() {}
@Override
public void doFilter(
final ServletRequest sreq, final ServletResponse srsp, final FilterChain chain)
public void doFilter(final ServletRequest sreq, ServletResponse srsp, FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest req = (HttpServletRequest) sreq;
final HttpServletResponse rsp = (HttpServletResponse) srsp;
@@ -70,7 +69,7 @@ public class CacheControlFilter implements Filter {
chain.doFilter(req, rsp);
}
private static boolean cacheForever(final String pathInfo, final HttpServletRequest req) {
private static boolean cacheForever(String pathInfo, HttpServletRequest req) {
if (pathInfo.endsWith(".cache.html")
|| pathInfo.endsWith(".cache.gif")
|| pathInfo.endsWith(".cache.png")
@@ -87,14 +86,14 @@ public class CacheControlFilter implements Filter {
return false;
}
private static boolean nocache(final String pathInfo) {
private static boolean nocache(String pathInfo) {
if (pathInfo.endsWith(".nocache.js")) {
return true;
}
return false;
}
private static String pathInfo(final HttpServletRequest req) {
private static String pathInfo(HttpServletRequest req) {
final String uri = req.getRequestURI();
final String ctx = req.getContextPath();
return uri.startsWith(ctx) ? uri.substring(ctx.length()) : uri;

View File

@@ -28,11 +28,11 @@ public class AutoCenterDialogBox extends DialogBox {
this(false);
}
public AutoCenterDialogBox(final boolean autoHide) {
public AutoCenterDialogBox(boolean autoHide) {
this(autoHide, true);
}
public AutoCenterDialogBox(final boolean autoHide, final boolean modal) {
public AutoCenterDialogBox(boolean autoHide, boolean modal) {
super(autoHide, modal);
}
@@ -43,7 +43,7 @@ public class AutoCenterDialogBox extends DialogBox {
Window.addResizeHandler(
new ResizeHandler() {
@Override
public void onResize(final ResizeEvent event) {
public void onResize(ResizeEvent event) {
final int w = event.getWidth();
final int h = event.getHeight();
AutoCenterDialogBox.this.onResize(w, h);
@@ -71,7 +71,7 @@ public class AutoCenterDialogBox extends DialogBox {
* @param width new browser window width
* @param height new browser window height
*/
protected void onResize(final int width, final int height) {
protected void onResize(int width, int height) {
if (isAttached()) {
center();
}

View File

@@ -51,7 +51,7 @@ public class ViewSite<V extends View> extends Composite {
*
* @param view the next view to display.
*/
public void setView(final V view) {
public void setView(V view) {
if (next != null) {
main.remove(next);
}
@@ -67,10 +67,10 @@ public class ViewSite<V extends View> extends Composite {
*
* @param view the view being displayed.
*/
protected void onShowView(final V view) {}
protected void onShowView(V view) {}
@SuppressWarnings("unchecked")
final void swap(final View v) {
final void swap(View v) {
if (next != null && next.getWidget() == v) {
if (current != null) {
main.remove(current);