Skip to content

Commit

Permalink
[#929, #1002, #1097]: Remove unused code (#1177)
Browse files Browse the repository at this point in the history
There are instances of unused code across the files
`RepoLocation.java`, `LogsManager.java` and `FileUtil.java`.

Let's remove them for better code quality.
  • Loading branch information
yash-chowdhary authored Apr 3, 2020
1 parent 1a34084 commit 2303c46
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
20 changes: 0 additions & 20 deletions src/main/java/reposense/model/RepoLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -105,22 +103,4 @@ public boolean equals(Object other) {
public int hashCode() {
return location.hashCode();
}

/**
* Converts all the strings in {@code locations} into {@code RepoLocation} objects.
* Returns null if {@code locations} is null.
* @throws InvalidLocationException if any of the strings are in invalid formats.
*/
public static List<RepoLocation> convertStringsToLocations(List<String> locations) throws InvalidLocationException {
if (locations == null) {
return null;
}

List<RepoLocation> convertedLocations = new ArrayList<>();
for (String location : locations) {
convertedLocations.add(new RepoLocation(location));
}

return convertedLocations;
}
}
9 changes: 0 additions & 9 deletions src/main/java/reposense/system/LogsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,5 @@ public static void setLogFolderLocation(Path location) {
logFolderLocation = location;
LOGGER_LIST.stream().forEach(logger -> addFileHandler(logger));
}

public static void setConsoleHandlerLevel(Level level) {
currentConsoleLogLevel = level;
}

public static void setFileConsoleHandlerLevel(Level level) {
currentFileLogLevel = level;
}

}

4 changes: 0 additions & 4 deletions src/main/java/reposense/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,4 @@ private static List<Path> getFilePaths(Path directoryPath, String... fileTypes)
private static boolean isFileTypeInPath(Path path, String... fileTypes) {
return Arrays.stream(fileTypes).anyMatch(path.toString()::endsWith);
}

private static String attachJsPrefix(String original, String prefix) {
return "var " + prefix + " = " + original;
}
}

0 comments on commit 2303c46

Please sign in to comment.