Browse Source

Merge pull request #1085 in DESIGN/design from ~JINBOKAI/design:feature/10.0 to feature/10.0

* commit '400f588c357e82cd78921dc73d201556cbed8c00':
  REPORT-20328 sonar问题修复
research/11.0
Jinbokai 5 years ago
parent
commit
6fdf5a2f03
  1. 4
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java
  2. 6
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  3. 11
      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); newModel.addChangeListener(modelListener);
scrollbar.repaint(); scrollbar.repaint();
scrollbar.revalidate(); scrollbar.revalidate();
} else if ("orientation" == propertyName) { } else if (StringUtils.equals("orientation", propertyName)) {
updateButtonDirections(); updateButtonDirections();
} else if ("componentOrientation" == propertyName) { } else if (StringUtils.equals("componentOrientation", propertyName)) {
updateButtonDirections(); updateButtonDirections();
InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED); InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_FOCUSED, inputMap); SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_FOCUSED, inputMap);

6
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.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
@ -109,7 +111,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
} }
value = value < minValue ? minValue : value; value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value; value = value > maxValue ? maxValue : value;
if (value == this.value) { if (CommonUtils.equals(value, this.value)) {
return; return;
} }
this.value = value; this.value = value;
@ -132,7 +134,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
value = value < minValue ? minValue : value; value = value < minValue ? minValue : value;
value = value > maxValue ? maxValue : value; value = value > maxValue ? maxValue : value;
if (value == this.value) { if (CommonUtils.equals(value, this.value)) {
return; return;
} }
this.value = value; this.value = value;

11
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; 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 java.util.Stack;
import javax.swing.text.Segment; import javax.swing.text.Segment;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.*;
/** /**
* Scanner for makefiles.<p> * Scanner for makefiles.<p>
@ -763,7 +764,7 @@ public final void yybegin(int newState) {
} }
case 25: break; case 25: break;
case 12: case 12:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.TRUE) { { if (!varDepths.empty() && Boolean.TRUE.equals(varDepths.peek())) {
varDepths.pop(); varDepths.pop();
if (varDepths.empty()) { if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL); addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);
@ -772,7 +773,7 @@ public final void yybegin(int newState) {
} }
case 26: break; case 26: break;
case 11: case 11:
{ if (!varDepths.empty() && varDepths.peek()==Boolean.FALSE) { { if (!varDepths.empty() && Boolean.FALSE.equals(varDepths.peek())) {
varDepths.pop(); varDepths.pop();
if (varDepths.empty()) { if (varDepths.empty()) {
addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL); addToken(start,zzStartRead, Token.VARIABLE); yybegin(YYINITIAL);

Loading…
Cancel
Save