Skip to content

Commit eaeedef

Browse files
More sonar QA
1 parent f679c20 commit eaeedef

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/java/com/github/bordertech/config/Config.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ public static void notifyListeners() {
160160
// If we get here, then there is at least one listener who wants to be notified when a refresh occurs. The first
161161
// step in this notification process is to create the PropertyChangeEvent object that will be sent to each of
162162
// the registered PropertyChangeListeners.
163-
//
164-
// PropertyChangeEvent event = new PropertyChangeEvent(this, "propertiesRefresh", null, null);
163+
// <code>PropertyChangeEvent event = new PropertyChangeEvent(this, "propertiesRefresh", null, null);</code>
165164
//
166165
// Finally, iterate through the complete set of PropertyChangeListeners and notify them that a change has
167166
// occurred.

src/main/java/com/github/bordertech/config/DefaultConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
import java.nio.charset.StandardCharsets;
1515
import java.security.CodeSource;
1616
import java.security.ProtectionDomain;
17+
import java.util.ArrayDeque;
1718
import java.util.ArrayList;
1819
import java.util.Arrays;
1920
import java.util.Collections;
21+
import java.util.Deque;
2022
import java.util.Enumeration;
2123
import java.util.HashMap;
2224
import java.util.HashSet;
@@ -26,7 +28,6 @@
2628
import java.util.Objects;
2729
import java.util.Properties;
2830
import java.util.Set;
29-
import java.util.Stack;
3031
import java.util.StringTokenizer;
3132
import java.util.TreeSet;
3233
import org.apache.commons.configuration.Configuration;
@@ -141,7 +142,7 @@ public class DefaultConfiguration implements Configuration {
141142
/**
142143
* The resource being loaded. This is used for the relative form of resource loading.
143144
*/
144-
private final Stack<String> resources = new Stack<>();
145+
private final Deque<String> resources = new ArrayDeque<>();
145146

146147
/**
147148
* A generic object that allows us to synchronized refreshes. Required so that gets and refreshes are threadsafe

src/main/java/com/github/bordertech/config/Touchfile.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Touchfile {
1515
/**
1616
* The touch file.
1717
*/
18-
private final File touchfile;
18+
private final File file;
1919

2020
/**
2121
* Check interval in milli seconds.
@@ -41,10 +41,10 @@ public Touchfile(final String filename, final long checkInterval) {
4141
throw new IllegalArgumentException("A touch filename must be provided.");
4242
}
4343
this.filename = filename;
44-
this.touchfile = new File(filename);
44+
this.file = new File(filename);
4545
this.checkInterval = checkInterval < 0 ? 0 : checkInterval;
4646
this.lastChecked = System.currentTimeMillis();
47-
this.lastModified = touchfile.lastModified();
47+
this.lastModified = file.lastModified();
4848
}
4949

5050
/**
@@ -61,7 +61,7 @@ public boolean hasChanged() {
6161
lastChecked = now;
6262

6363
// Has the file changed?
64-
long modified = touchfile.lastModified();
64+
long modified = file.lastModified();
6565
if (lastModified == modified) {
6666
// No Change
6767
return false;

0 commit comments

Comments
 (0)