Skip to content

Commit 46c3820

Browse files
committed
Bump checkstyle and spotbugs
1 parent 37af1ed commit 46c3820

25 files changed

+80
-73
lines changed

RSyntaxTextArea/src/main/java/org/fife/io/DocumentReader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public boolean markSupported() {
9393
*/
9494
@Override
9595
public int read() {
96-
if(position>=document.getLength()) {
96+
if (position>=document.getLength()) {
9797
return -1; // Read past end of document.
9898
}
9999
try {
@@ -133,14 +133,14 @@ public int read(char[] array) {
133133
@Override
134134
public int read(char[] cbuf, int off, int len) {
135135
int k;
136-
if(position>=document.getLength()) {
136+
if (position>=document.getLength()) {
137137
return -1; // Read past end of document.
138138
}
139139
k = len;
140-
if((position+k)>=document.getLength()) {
140+
if ((position+k)>=document.getLength()) {
141141
k = document.getLength() - (int)position;
142142
}
143-
if(off + k >= cbuf.length) {
143+
if (off + k >= cbuf.length) {
144144
k = cbuf.length - off;
145145
}
146146
try {
@@ -178,7 +178,7 @@ public boolean ready() {
178178
*/
179179
@Override
180180
public void reset() {
181-
if(mark==-1) {
181+
if (mark==-1) {
182182
position = 0;
183183
}
184184
else {

RSyntaxTextArea/src/main/java/org/fife/print/RPrintUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ private static Segment removeEndingWhitespace(Segment segment) {
539539
* A tab expander for the document currently being printed with the
540540
* font being used for the printing.
541541
*/
542-
private static class RPrintTabExpander implements TabExpander {
542+
private static final class RPrintTabExpander implements TabExpander {
543543

544544
@Override
545545
public float nextTabStop(float x, int tabOffset) {

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/CodeTemplateManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private synchronized void sortTemplates() {
340340
* parameter and a <code>Segment</code> as its second, and knows
341341
* to compare the template's ID to the segment's text.
342342
*/
343-
private static class TemplateComparator implements Comparator<Object>,
343+
private static final class TemplateComparator implements Comparator<Object>,
344344
Serializable{
345345

346346
@Override
@@ -382,7 +382,7 @@ public int compare(Object template, Object segment) {
382382
/**
383383
* A file filter that accepts only XML files.
384384
*/
385-
private static class XMLFileFilter implements FileFilter {
385+
private static final class XMLFileFilter implements FileFilter {
386386
@Override
387387
public boolean accept(File f) {
388388
return f.getName().toLowerCase().endsWith(".xml");

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/ErrorStrip.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ private int yToLine(int y) {
699699
*
700700
* @author predi
701701
*/
702-
private static class DefaultErrorStripMarkerToolTipProvider
702+
private static final class DefaultErrorStripMarkerToolTipProvider
703703
implements ErrorStripMarkerToolTipProvider {
704704

705705
@Override
@@ -753,7 +753,7 @@ public interface ErrorStripMarkerToolTipProvider {
753753
/**
754754
* Listens for events in the error strip and its markers.
755755
*/
756-
private class Listener extends MouseAdapter
756+
private final class Listener extends MouseAdapter
757757
implements PropertyChangeListener, CaretListener {
758758

759759
private final Rectangle r = new Rectangle();

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/MatchedBracketPopup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private void setLocation() {
184184
/**
185185
* Action performed when Escape is pressed in this popup.
186186
*/
187-
private class EscapeAction extends AbstractAction {
187+
private final class EscapeAction extends AbstractAction {
188188

189189
@Override
190190
public void actionPerformed(ActionEvent e) {

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaHighlighter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void removeParserHighlight(HighlightInfo tag) {
284284
* Highlight info implementation used for parser notices and marked
285285
* occurrences.
286286
*/
287-
private static class SyntaxLayeredHighlightInfoImpl extends
287+
private static final class SyntaxLayeredHighlightInfoImpl extends
288288
LayeredHighlightInfoImpl {
289289

290290
private ParserNotice notice;

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxUtilities.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ public static int getNextVisualPositionFrom(int pos, Position.Bias b,
711711

712712
case WEST:
713713
int endOffs = view.getEndOffset();
714-
if(pos == -1) {
714+
if (pos == -1) {
715715
pos = Math.max(0, endOffs - 1);
716716
}
717717
else {
@@ -732,7 +732,7 @@ public static int getNextVisualPositionFrom(int pos, Position.Bias b,
732732
break;
733733

734734
case EAST:
735-
if(pos == -1) {
735+
if (pos == -1) {
736736
pos = view.getStartOffset();
737737
}
738738
else {
@@ -1144,7 +1144,7 @@ public static int getWordStart(RSyntaxTextArea textArea, int offs)
11441144

11451145
int endOffs = Math.min(offs+1, doc.getLength());
11461146
String s = doc.getText(lineStart, endOffs-lineStart);
1147-
if(s != null && !s.isEmpty()) {
1147+
if (s != null && !s.isEmpty()) {
11481148
int i = s.length() - 1;
11491149
char ch = s.charAt(i);
11501150
if (Character.isWhitespace(ch)) {

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/Theme.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ private static Color stringToColor(String s, Color defaultVal) {
595595
/**
596596
* Loads a <code>SyntaxScheme</code> from an XML file.
597597
*/
598-
private static class XmlHandler extends DefaultHandler {
598+
private static final class XmlHandler extends DefaultHandler {
599599

600600
private Theme theme;
601601

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/WrappedSyntaxView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,23 +689,23 @@ public Shape modelToView(int pos, Shape a, Position.Bias b)
689689

690690
boolean isBackward = (b == Position.Bias.Backward);
691691
int testPos = (isBackward) ? Math.max(0, pos - 1) : pos;
692-
if(isBackward && testPos < getStartOffset()) {
692+
if (isBackward && testPos < getStartOffset()) {
693693
return null;
694694
}
695695

696696
int vIndex = getViewIndexAtPosition(testPos);
697697
if ((vIndex != -1) && (vIndex < getViewCount())) {
698698
View v = getView(vIndex);
699-
if(v != null && testPos >= v.getStartOffset() &&
699+
if (v != null && testPos >= v.getStartOffset() &&
700700
testPos < v.getEndOffset()) {
701701
Shape childShape = getChildAllocation(vIndex, a);
702702
if (childShape == null) {
703703
// We are likely invalid, fail.
704704
return null;
705705
}
706706
Shape retShape = v.modelToView(pos, childShape, b);
707-
if(retShape == null && v.getEndOffset() == pos) {
708-
if(++vIndex < getViewCount()) {
707+
if (retShape == null && v.getEndOffset() == pos) {
708+
if (++vIndex < getViewCount()) {
709709
v = getView(vIndex);
710710
retShape = v.modelToView(pos, getChildAllocation(vIndex, a), b);
711711
}

RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/focusabletip/FocusableTip.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public void toolTipRequested(MouseEvent e, String text) {
304304
/**
305305
* Listens for events in a text area.
306306
*/
307-
private class TextAreaListener extends MouseInputAdapter implements
307+
private final class TextAreaListener extends MouseInputAdapter implements
308308
CaretListener, ComponentListener, FocusListener, KeyListener {
309309

310310
@Override

0 commit comments

Comments
 (0)