Skip to content

Commit

Permalink
Fix quality flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Brandhof committed Jun 30, 2015
1 parent 6c6dbc1 commit 3176e6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Expand Up @@ -291,8 +291,9 @@ private SearchResult<IssueDoc> execute(IssueQuery query, SearchOptions options)
}

private void writeResponse(Request request, SearchResult<IssueDoc> result, JsonWriter json) {
if (result.getFacets().contains(IssueIndex.DEBT_AGGREGATION_NAME)) {
json.prop("debtTotal", result.getFacets().get(IssueIndex.DEBT_AGGREGATION_NAME).get(Facets.TOTAL));
Map<String, Long> debtFacet = result.getFacets().get(IssueIndex.DEBT_AGGREGATION_NAME);
if (debtFacet != null) {
json.prop("debtTotal", debtFacet.get(Facets.TOTAL));
}

List<String> issueKeys = newArrayList();
Expand Down
Expand Up @@ -67,7 +67,7 @@ public TempFolder provide(BootstrapProperties bootstrapProps) {
try {
cleanTempFolders(workingPath);
} catch (IOException e) {
LOG.warn("failed to clean global working directory: " + e.getMessage());
LOG.error(String.format("failed to clean global working directory: %s", workingPath), e);
}

Path tempDir = workingPath.resolve(TMP_NAME_PREFIX + System.currentTimeMillis());
Expand Down Expand Up @@ -110,12 +110,12 @@ private static void cleanTempFolders(Path path) throws IOException {

private static class CleanFilter implements DirectoryStream.Filter<Path> {
@Override
public boolean accept(Path e) throws IOException {
if (!Files.isDirectory(e)) {
public boolean accept(Path path) throws IOException {
if (!Files.isDirectory(path)) {
return false;
}

if (!e.getFileName().toString().startsWith(TMP_NAME_PREFIX)) {
if (!path.getFileName().toString().startsWith(TMP_NAME_PREFIX)) {
return false;
}

Expand All @@ -125,9 +125,9 @@ public boolean accept(Path e) throws IOException {
BasicFileAttributes attrs;

try {
attrs = Files.readAttributes(e, BasicFileAttributes.class);
attrs = Files.readAttributes(path, BasicFileAttributes.class);
} catch (IOException ioe) {
LOG.warn("couldn't read file attributes for " + e + " : " + ioe.getMessage());
LOG.error(String.format("Couldn't read file attributes for %s : ", path), ioe);
return false;
}

Expand Down
Expand Up @@ -56,7 +56,7 @@ public static void assertBundlesUpToDate() {
}

Collection<File> bundles = FileUtils.listFiles(bundleFolder, new String[]{"properties"}, false);
Map<String, String> failedAssertionMessages = new HashMap();
Map<String, String> failedAssertionMessages = new HashMap<>();
for (File bundle : bundles) {
String bundleName = bundle.getName();
if (bundleName.indexOf('_') > 0) {
Expand Down

0 comments on commit 3176e6a

Please sign in to comment.