Skip to content

Commit 7e0ed18

Browse files
committed
metafacture-runner/ (main): Fix Checkstyle violations.
1 parent 25401d5 commit 7e0ed18

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

metafacture-runner/src/main/java/org/metafacture/runner/Flux.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.runner;
1718

19+
import org.metafacture.commons.ResourceUtil;
20+
import org.metafacture.flux.FluxCompiler;
21+
import org.metafacture.flux.parser.FluxProgramm;
22+
import org.metafacture.runner.util.DirectoryClassLoader;
23+
24+
import org.antlr.runtime.RecognitionException;
25+
1826
import java.io.File;
1927
import java.io.IOException;
2028
import java.util.HashMap;
2129
import java.util.Map;
2230
import java.util.regex.Matcher;
2331
import java.util.regex.Pattern;
2432

25-
import org.antlr.runtime.RecognitionException;
26-
import org.metafacture.commons.ResourceUtil;
27-
import org.metafacture.flux.FluxCompiler;
28-
import org.metafacture.flux.parser.FluxProgramm;
29-
import org.metafacture.runner.util.DirectoryClassLoader;
30-
3133
/**
3234
* @author Markus Michael Geipel
3335
* @author Christoph Böhme
@@ -46,25 +48,22 @@ private Flux() {
4648
}
4749

4850
public static void main(final String[] args) throws IOException, RecognitionException {
49-
5051
loadCustomJars();
5152

52-
if (args.length < (1)) {
53+
if (args.length < 1) {
5354
FluxProgramm.printHelp(System.out);
5455
System.exit(2);
55-
} else {
56-
56+
}
57+
else {
5758
final File fluxFile = new File(args[0]);
5859
if (!fluxFile.exists()) {
5960
System.err.println("File not found: " + args[0]);
6061
System.exit(1);
61-
return;
6262
}
6363

6464
// get variable assignments
6565
final Map<String, String> vars = new HashMap<String, String>();
66-
vars.put(SCRIPT_HOME, fluxFile.getAbsoluteFile().getParent()
67-
+ System.getProperty("file.separator"));
66+
vars.put(SCRIPT_HOME, fluxFile.getAbsoluteFile().getParent() + System.getProperty("file.separator"));
6867

6968
for (int i = 1; i < args.length; ++i) {
7069
final Matcher matcher = VAR_PATTERN.matcher(args[i]);

metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.metafacture.runner.util;
1718

19+
import org.metafacture.framework.MetafactureException;
20+
1821
import java.io.File;
1922
import java.io.FilenameFilter;
2023
import java.net.MalformedURLException;
2124
import java.net.URL;
2225
import java.net.URLClassLoader;
2326

24-
import org.metafacture.framework.MetafactureException;
25-
2627
/**
2728
* A class loader which allows adding directories to the class
2829
* path instead of class-files or jar-files.
@@ -36,14 +37,13 @@ public final class DirectoryClassLoader extends URLClassLoader {
3637
private static final String CLASS_FILE_EXTENSION = ".class";
3738

3839
private static final FilenameFilter JAR_AND_CLASS_FILTER =
39-
new FilenameFilter() {
40+
new FilenameFilter() {
4041

41-
@Override
42-
public boolean accept(final File dir, final String name) {
43-
return name.endsWith(JAR_FILE_EXTENSION)
44-
|| name.endsWith(CLASS_FILE_EXTENSION);
45-
}
46-
};
42+
@Override
43+
public boolean accept(final File dir, final String name) {
44+
return name.endsWith(JAR_FILE_EXTENSION) || name.endsWith(CLASS_FILE_EXTENSION);
45+
}
46+
};
4747

4848
public DirectoryClassLoader(final ClassLoader parent) {
4949
super(new URL[0], parent);
@@ -53,7 +53,8 @@ public void addDirectory(final File dir) {
5353
for (final File file : dir.listFiles(JAR_AND_CLASS_FILTER)) {
5454
try {
5555
addURL(file.toURI().toURL());
56-
} catch (final MalformedURLException e) {
56+
}
57+
catch (final MalformedURLException e) {
5758
throw new MetafactureException("Could not add " + file + " to class loader", e);
5859
}
5960
}

0 commit comments

Comments
 (0)