Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warns the user if specified mainClass is not a valid Java class. #228

Merged
merged 9 commits into from
Apr 23, 2018

Conversation

coollog
Copy link
Contributor

@coollog coollog commented Apr 23, 2018

Fixes #206
Fixes #170

@@ -30,6 +30,8 @@
/** Immutable configuration options for the builder process. */
public class BuildConfiguration {

public static final String VALID_JAVA_CLASS_REGEX = "([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh confusing, can you comment on top of this, what this means?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually never mind, the tests are good.

public void testValidJavaClassRegex() {
Assert.assertTrue("my.Class".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX));
Assert.assertTrue("my.java_Class$valid".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX));
Assert.assertFalse("${start-class}".matches(BuildConfiguration.VALID_JAVA_CLASS_REGEX));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you verify that is123.valid works?
and that mutliple package items work? abc.xyz.Valid

@coollog
Copy link
Contributor Author

coollog commented Apr 23, 2018

Changed the regex method to rather use the built-in method for checking valid Java identifiers.

@coollog coollog merged commit 1b2b180 into master Apr 23, 2018
@coollog coollog deleted the warn-invalid-main-class branch April 23, 2018 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants