Skip to content

Commit

Permalink
eliminated PMD warning UselessQualifiedThis in emissary
Browse files Browse the repository at this point in the history
  • Loading branch information
racheldaniels04 committed Jun 18, 2024
1 parent 906d8c0 commit c69bff6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/emissary/admin/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ protected boolean placeSetup(final int directoryActionArg, final Map<String, Str
final String localDirectory = localDirectoriesArg.get(thePlaceHost);

if (localDirectory == null) {
hostParameters.forEach(Startup.this.placesToStart::remove);
if (Startup.this.failedLocalDirectories.get(thePlaceHost) != null) {
hostParameters.forEach(placesToStart::remove);
if (failedLocalDirectories.get(thePlaceHost) != null) {
logger.warn("Skipping {} due to previously failed directory", thePlaceHost);
} else {
logger.warn("Skipping {} : local Directory not found", thePlaceHost);
Expand All @@ -356,7 +356,7 @@ protected boolean placeSetup(final int directoryActionArg, final Map<String, Str
}

if (directoryActionArg != DIRECTORYSTART && directoryActionArg != DIRECTORYADD) {
hostParameters.forEach(Startup.this.placesToStart::remove);
hostParameters.forEach(placesToStart::remove);
return;
}

Expand All @@ -376,15 +376,15 @@ protected boolean placeSetup(final int directoryActionArg, final Map<String, Str
final String thePlaceClassString = PlaceStarter.getClassString(thePlaceLocation);
if (thePlaceClassString == null) {
logger.warn("Skipping {}, no class string", thePlaceLocation);
Startup.this.placesToStart.remove(thePlaceLocation);
placesToStart.remove(thePlaceLocation);
return;
}
logger.debug("Starting place {}", thePlaceLocation);
if (KeyManipulator.isLocalTo(thePlaceLocation,
String.format("http://%s:%s/StartupEngine", Startup.this.node.getNodeName(), Startup.this.node.getNodePort()))) {
String.format("http://%s:%s/StartupEngine", node.getNodeName(), node.getNodePort()))) {
if (directoryActionArg == DIRECTORYADD && Namespace.exists(thePlaceLocation)) {
logger.info("Local place already exists: {}", thePlaceLocation);
Startup.this.placesToStart.remove(thePlaceLocation);
placesToStart.remove(thePlaceLocation);
// add place to placeAlreadyStarted list, so can be verified in verifyNoInvisibleStartPlaces
placeAlreadyStarted.add(thePlaceLocation.substring(thePlaceLocation.lastIndexOf("/") + 1));
return;
Expand All @@ -398,8 +398,8 @@ protected boolean placeSetup(final int directoryActionArg, final Map<String, Str
placesArg.put(thePlaceLocation, thePlaceLocation);
} else {
logger.error("{} failed to start!", thePlaceLocation);
Startup.this.failedPlaces.add(thePlaceLocation);
Startup.this.placesToStart.remove(thePlaceLocation);
failedPlaces.add(thePlaceLocation);
placesToStart.remove(thePlaceLocation);
}
}
});
Expand Down Expand Up @@ -521,7 +521,7 @@ private void sortPickupOrPlace(String theLocation, Map<String, Set<String>> plac
/**
* Verifies the active directory places vs places started up. Log if any places are started without being announced in
* start-up.
*
*
* @return true if no invisible places started, false if yes
*/
public static boolean verifyNoInvisiblePlacesStarted() {
Expand Down

0 comments on commit c69bff6

Please sign in to comment.