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

Wildcard prefix matching #481

Merged
merged 1 commit into from
Oct 5, 2015
Merged

Conversation

brunobowden
Copy link
Contributor

Fixes #430

Example:

prefixes.properties: com.example.dir.*=Wildcard
Test File:           com/example/dir/subdir/Test.java
Test Name:           WildcardTest

@brunobowden
Copy link
Contributor Author

PTAL

String root = s.substring(0, s.length() - 2).replace(".", "\\.");
return String.format('^(%s|%s\\..*)$', root, root);
}
return String.format('^%s$', s.replace(".", "\\.").replace("\\*", ".*"));
Copy link
Contributor

Choose a reason for hiding this comment

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

use Pattern.quote(s) as the format argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deliberately want this to match the logic within J2ObjC's code. Some I'm minimizing changes to make it easier to compare in the future.

@advayDev1
Copy link
Contributor

lgtm with comments

Fixes j2objc-contrib#430

Example:
prefixes.properties: com.example.dir.*=Wildcard
Test File:           com/example/dir/subdir/Test.java
Test Name:           WildcardTest
brunobowden added a commit that referenced this pull request Oct 5, 2015
@brunobowden brunobowden merged commit b7f4aad into j2objc-contrib:master Oct 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wildcard matching in prefixes.properties
2 participants