Skip to content

Commit

Permalink
[FLINK-3886] [clients] Give a better error when the application Main …
Browse files Browse the repository at this point in the history
…class is not public.

This closes apache#2043
  • Loading branch information
nielsbasjes authored and StephanEwen committed May 31, 2016
1 parent bcf5f46 commit 6db9e6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ private static boolean hasMainMethod(Class<?> entryClass) {

private static void callMainMethod(Class<?> entryClass, String[] args) throws ProgramInvocationException {
Method mainMethod;
if (!Modifier.isPublic(entryClass.getModifiers())) {
throw new ProgramInvocationException("The class " + entryClass.getName() + " must be public.");
}

try {
mainMethod = entryClass.getMethod("main", String[].class);
} catch (NoSuchMethodException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public String getDescription() {
}
}

private static final class TestExecuteTwice {
public static final class TestExecuteTwice {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Expand All @@ -388,15 +388,15 @@ public static void main(String args[]) throws Exception {
}
}

private static final class TestEager {
public static final class TestEager {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.fromElements(1, 2).collect();
}
}

private static final class TestGetRuntime {
public static final class TestGetRuntime {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Expand All @@ -405,7 +405,7 @@ public static void main(String args[]) throws Exception {
}
}

private static final class TestGetJobID {
public static final class TestGetJobID {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Expand All @@ -414,7 +414,7 @@ public static void main(String args[]) throws Exception {
}
}

private static final class TestGetAccumulator {
public static final class TestGetAccumulator {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Expand All @@ -423,7 +423,7 @@ public static void main(String args[]) throws Exception {
}
}

private static final class TestGetAllAccumulator {
public static final class TestGetAllAccumulator {

public static void main(String args[]) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Expand Down

0 comments on commit 6db9e6a

Please sign in to comment.