Browse Source

REPORT-20328 sonar问题修复

research/11.0
jinbokai 5 years ago
parent
commit
7ddfbdaa44
  1. 4
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java
  2. 8
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  3. 17
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/MakefileTokenMaker.java

4
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java

@ -1326,9 +1326,9 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo
newModel.addChangeListener(modelListener);
scrollbar.repaint();
scrollbar.revalidate();
} else if ("orientation" == propertyName) {
} else if (StringUtils.equals("orientation", propertyName)) {
updateButtonDirections();
} else if ("componentOrientation" == propertyName) {
} else if (StringUtils.equals("componentOrientation", propertyName)) {
updateButtonDirections();
InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_FOCUSED, inputMap);

8
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -9,9 +9,11 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -109,7 +111,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
if (CommonUtils.equals(value, this.value)) {
return;
}
this.value = value;
@ -132,7 +134,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value;
if (value == this.value) {
if (CommonUtils.equals(value, this.value)) {
return;
}
this.value = value;
@ -371,4 +373,4 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
// jf.setSize(400, 400);
// jf.setVisible(true);
}
}
}

17
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/MakefileTokenMaker.java

@ -10,12 +10,13 @@
*/
package com.fr.design.gui.syntax.ui.rsyntaxtextarea.modes;
import java.io.*;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.AbstractJFlexTokenMaker;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.Token;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.TokenImpl;
import java.io.IOException;
import java.util.Stack;
import javax.swing.text.Segment;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.*;
/**
* Scanner for makefiles.<p>
@ -762,8 +763,8 @@ public final void yybegin(int newState) {
{ addToken(Token.LITERAL_CHAR);
}
case 25: break;
case 12:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.TRUE) {
case 12:
{ if (!varDepths.empty() && Boolean.TRUE.equals(varDepths.peek())) {
varDepths.pop();
if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);
@ -771,8 +772,8 @@ public final void yybegin(int newState) {
}
}
case 26: break;
case 11:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.FALSE) {
case 11:
{ if (!varDepths.empty() && Boolean.FALSE.equals(varDepths.peek())) {
varDepths.pop();
if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);
@ -864,4 +865,4 @@ public final void yybegin(int newState) {
}
}
}

Loading…
Cancel
Save