diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-08-17 00:38:28 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-08-17 00:38:28 +0200 |
commit | 9fe28c5e6f56bd44633283d8b8cb01c5791b7d2a (patch) | |
tree | ff583f876ec12d54642b59f182793d6e195774b6 /sonar-batch | |
parent | a48f3652c54ac1b9444ff740ab020d035fba293d (diff) | |
download | sonarqube-9fe28c5e6f56bd44633283d8b8cb01c5791b7d2a.tar.gz sonarqube-9fe28c5e6f56bd44633283d8b8cb01c5791b7d2a.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-batch')
4 files changed, 6 insertions, 6 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java index 9f20029e633..57c75b2551f 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java @@ -182,6 +182,6 @@ public class DefaultSensorContext implements SensorContext { } private Resource resourceOrProject(Resource resource) { - return (resource != null ? resource : project); + return resource!=null ? resource : project; } } diff --git a/sonar-batch/src/main/java/org/sonar/batch/phases/DecoratorsExecutor.java b/sonar-batch/src/main/java/org/sonar/batch/phases/DecoratorsExecutor.java index 539fc1e4529..75b6cd54be0 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/phases/DecoratorsExecutor.java +++ b/sonar-batch/src/main/java/org/sonar/batch/phases/DecoratorsExecutor.java @@ -61,7 +61,7 @@ public class DecoratorsExecutor implements BatchComponent { DecoratorContext decorateResource(Resource resource, Collection<Decorator> decorators, boolean executeDecorators) { List<DecoratorContext> childrenContexts = Lists.newArrayList(); for (Resource child : index.getChildren(resource)) { - boolean isModule = (child instanceof Project); + boolean isModule = child instanceof Project; DefaultDecoratorContext childContext = (DefaultDecoratorContext) decorateResource(child, decorators, !isModule); childrenContexts.add(childContext.setReadOnly(true)); } diff --git a/sonar-batch/src/main/java/org/sonar/batch/phases/UpdateStatusJob.java b/sonar-batch/src/main/java/org/sonar/batch/phases/UpdateStatusJob.java index 0dd90eca8df..02056e53899 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/phases/UpdateStatusJob.java +++ b/sonar-batch/src/main/java/org/sonar/batch/phases/UpdateStatusJob.java @@ -74,7 +74,7 @@ public class UpdateStatusJob implements BatchComponent { private void enableCurrentSnapshot() { Snapshot previousLastSnapshot = resourcePersister.getLastSnapshot(snapshot, false); - boolean isLast = (previousLastSnapshot == null || previousLastSnapshot.getCreatedAt().before(snapshot.getCreatedAt())); + boolean isLast = previousLastSnapshot == null || previousLastSnapshot.getCreatedAt().before(snapshot.getCreatedAt()); setFlags(snapshot, isLast, Snapshot.STATUS_PROCESSED); logSuccess(LoggerFactory.getLogger(getClass())); } @@ -113,7 +113,7 @@ public class UpdateStatusJob implements BatchComponent { query.setParameter("last", last); query.setParameter("rootId", snapshot.getId()); query.setParameter("path", snapshot.getPath() + snapshot.getId() + ".%"); - query.setParameter("pathRootId", (snapshot.getRootId() == null ? snapshot.getId() : snapshot.getRootId())); + query.setParameter("pathRootId", snapshot.getRootId()==null ? snapshot.getId() : snapshot.getRootId()); query.executeUpdate(); session.commit(); diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DeprecatedFileSystemAdapter.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DeprecatedFileSystemAdapter.java index 4201a6b5bf1..4379089c86e 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DeprecatedFileSystemAdapter.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DeprecatedFileSystemAdapter.java @@ -176,7 +176,7 @@ public class DeprecatedFileSystemAdapter implements ProjectFileSystem { public File getFileFromBuildDirectory(String filename) { File file = new File(getBuildDir(), filename); - return (file.exists() ? file : null); + return file.exists() ? file : null; } public Resource toResource(File file) { @@ -187,7 +187,7 @@ public class DeprecatedFileSystemAdapter implements ProjectFileSystem { if (relativePath == null) { return null; } - return (file.isFile() ? new org.sonar.api.resources.File(relativePath.path()) : new org.sonar.api.resources.Directory(relativePath.path())); + return file.isFile() ? new org.sonar.api.resources.File(relativePath.path()) : new org.sonar.api.resources.Directory(relativePath.path()); } public List<InputFile> mainFiles(String... langs) { |