Browse Source

we really want those fields to be static ...

... and manipulated from instance methods
master
Stefan Bodewig 8 years ago
parent
commit
720df700d8
2 changed files with 6 additions and 5 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
  2. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java View File

@@ -115,7 +115,7 @@ public class AggregateTransformer {
/**
* Used to ensure the uniqueness of a property
*/
private static int counter = 0;
private volatile static int counter = 0;

/** the format to use for the report. Must be <tt>FRAMES</tt> or <tt>NOFRAMES</tt> */
protected String format = FRAMES;
@@ -260,7 +260,7 @@ public class AggregateTransformer {
xsltTask.setIn(((XMLResultAggregator) task).getDestinationFile());
File outputFile = null;
if (format.equals(FRAMES)) {
String tempFileProperty = getClass().getName() + String.valueOf(counter++);
String tempFileProperty = getClass().getName() + String.valueOf(counter++); //NOSONAR
File tmp = FILE_UTILS.resolveFile(project.getBaseDir(), project
.getProperty("java.io.tmpdir"));
tempFileTask.setDestDir(tmp);


+ 4
- 3
src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java View File

@@ -53,6 +53,7 @@ public class SplashTask extends Task {
private String progressRegExp = null;
private String displayText = null;

// class instance so we'll never show two splash screens at the same time
private static SplashScreen splash = null;

/**
@@ -163,7 +164,7 @@ public class SplashTask extends Task {
splash.setVisible(false);
getProject().removeBuildListener(splash);
splash.dispose();
splash = null;
splash = null; //NOSONAR
}

log("Creating new SplashScreen", Project.MSG_VERBOSE);
@@ -248,7 +249,7 @@ public class SplashTask extends Task {

try {
ImageIcon img = new ImageIcon(bout.toByteArray());
splash = new SplashScreen(img, progressRegExp, displayText);
splash = new SplashScreen(img, progressRegExp, displayText); //NOSONAR
success = true;
} catch (Throwable e) {
logHeadless(e);
@@ -268,7 +269,7 @@ public class SplashTask extends Task {
}
} else {
try {
splash = new SplashScreen("Image Unavailable.", progressRegExp,
splash = new SplashScreen("Image Unavailable.", progressRegExp, //NOSONAR
displayText);
success = true;
} catch (Throwable e) {


Loading…
Cancel
Save