Browse Source

REPORT-20327 sonar问题修复

research/11.0
kerry 5 years ago
parent
commit
afdd96c1a3
  1. 1
      designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java
  2. 3
      designer-realize/src/main/java/com/fr/poly/creator/BlockCreator.java
  3. 3
      designer-realize/src/main/java/com/fr/poly/creator/BlockEditor.java
  4. 4
      designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java
  5. 1
      designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java

1
designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java

@ -159,6 +159,7 @@ public class PolyDesignUI extends ComponentUI {
return new Rectangle(resx, resy, width, height); return new Rectangle(resx, resy, width, height);
} }
@SuppressWarnings("squid:S2142")
private void scrollWhenCreatorAtCorner(final BlockCreator creator){ private void scrollWhenCreatorAtCorner(final BlockCreator creator){
Thread scrollThread = new Thread(new Runnable() { Thread scrollThread = new Thread(new Runnable() {

3
designer-realize/src/main/java/com/fr/poly/creator/BlockCreator.java

@ -54,6 +54,9 @@ public abstract class BlockCreator<T extends TemplateBlock> extends JComponent i
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == null) {
return false;
}
return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName()); return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName());
} }
}); });

3
designer-realize/src/main/java/com/fr/poly/creator/BlockEditor.java

@ -125,6 +125,9 @@ public abstract class BlockEditor<T extends JComponent,U extends TemplateBlock>
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == null) {
return false;
}
return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName()); return ComparatorUtils.equals(o.getClass().getName(), this.getClass().getName());
} }
}); });

4
designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

@ -1,6 +1,7 @@
package com.fr.start.fx; package com.fr.start.fx;
import com.fr.concurrent.NamedThreadFactory; import com.fr.concurrent.NamedThreadFactory;
import com.fr.log.FineLoggerFactory;
import com.sun.javafx.iio.ImageFrame; import com.sun.javafx.iio.ImageFrame;
import com.sun.javafx.iio.ImageLoadListener; import com.sun.javafx.iio.ImageLoadListener;
import com.sun.javafx.iio.ImageLoader; import com.sun.javafx.iio.ImageLoader;
@ -79,6 +80,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
} }
@Override @Override
@SuppressWarnings("squid:S2142")
public PlatformImage getFrame(int index) { public PlatformImage getFrame(int index) {
while (images[index] == null) { while (images[index] == null) {
synchronized (this) { synchronized (this) {
@ -86,7 +88,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
try { try {
this.wait(); this.wait();
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
} }

1
designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java

@ -55,6 +55,7 @@ public class SplashFxWindow extends Application {
* *
* @return 运行实例 * @return 运行实例
*/ */
@SuppressWarnings("squid:S2142")
public static SplashFxWindow waitForStartUpTest() { public static SplashFxWindow waitForStartUpTest() {
try { try {
LATCH.await(); LATCH.await();

Loading…
Cancel
Save