code cleanup: collapse identical catch clauses in JPS modules

This commit is contained in:
nik
2017-02-15 17:19:46 +03:00
parent f86aa4ac80
commit a6adce160f
10 changed files with 12 additions and 52 deletions
@@ -34,10 +34,7 @@ public class TaskFutureAdapter<T> implements TaskFuture<T> {
try {
get();
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
catch (ExecutionException e) {
catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
catch (CancellationException ignored) {
@@ -49,15 +46,10 @@ public class TaskFutureAdapter<T> implements TaskFuture<T> {
try {
get(timeout, unit);
}
catch (InterruptedException e) {
catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
catch (ExecutionException e) {
throw new RuntimeException(e);
}
catch (TimeoutException ignored) {
}
catch (CancellationException ignored) {
catch (TimeoutException | CancellationException ignored) {
}
return isDone();
}
@@ -1025,10 +1025,7 @@ public class IncProjectBuilder {
// }));
//}
}
catch (BuildDataCorruptedException e) {
throw e;
}
catch (ProjectBuildException e) {
catch (BuildDataCorruptedException | ProjectBuildException e) {
throw e;
}
catch (Throwable e) {
@@ -102,13 +102,7 @@ public class FormsParsing {
LOG.debug(e);
}
}
catch (ClassNotFoundException e) {
LOG.error(e);
}
catch (InstantiationException e) {
LOG.error(e);
}
catch (IllegalAccessException e) {
catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
LOG.error(e);
}
}
@@ -248,13 +248,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
return compile(context, chunk, dirtyFilesHolder, filesToCompile, outputConsumer, compilingTool);
}
catch (BuildDataCorruptedException e) {
throw e;
}
catch (ProjectBuildException e) {
throw e;
}
catch (PersistentEnumeratorBase.CorruptedException e) {
catch (BuildDataCorruptedException | PersistentEnumeratorBase.CorruptedException | ProjectBuildException e) {
throw e;
}
catch (Exception e) {
@@ -97,10 +97,7 @@ public class ResourcesBuilder extends TargetBuilder<ResourceRootDescriptor, Reso
context.processMessage(new ProgressMessage(""));
}
catch(BuildDataCorruptedException e) {
throw e;
}
catch(ProjectBuildException e) {
catch(BuildDataCorruptedException | ProjectBuildException e) {
throw e;
}
catch (Exception e) {
@@ -340,10 +340,7 @@ public abstract class JpsBuildTestCase extends UsefulTestCase {
builder.build(scopeBuilder.build(), false);
result.storeMappingsDump(descriptor);
}
catch (RebuildRequestedException e) {
throw new RuntimeException(e);
}
catch (IOException e) {
catch (RebuildRequestedException | IOException e) {
throw new RuntimeException(e);
}
return result;
@@ -65,10 +65,7 @@ public class JpsGlobalElementSaver {
try {
return JDOMUtil.load(configFile);
}
catch (JDOMException e) {
throw new RuntimeException(e);
}
catch (IOException e) {
catch (JDOMException | IOException e) {
throw new RuntimeException(e);
}
}
@@ -87,10 +87,7 @@ public class JpsPluginSyntheticArtifactProvider extends JpsSyntheticArtifactProv
}
}
}
catch (JDOMException e) {
LOG.info(e);
}
catch (IOException e) {
catch (JDOMException | IOException e) {
LOG.info(e);
}
}
@@ -68,10 +68,7 @@ public class EclipseProjectFinder implements EclipseXml {
}
name = name.replace("\n", " ").trim();
}
catch (JDOMException e) {
return null;
}
catch (IOException e) {
catch (JDOMException | IOException e) {
return null;
}
}
@@ -65,9 +65,7 @@ public class ResourceRootFilter {
propertiesMap.put("matcher", matcher);
}
}
catch (JsonSyntaxException e) {
throw new RuntimeException("Unsupported filter: " + properties , e);
} catch (JsonParseException e) {
catch (JsonParseException e) {
throw new RuntimeException("Unsupported filter: " + properties , e);
}
if(propertiesMap == null) {