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

IllegalArgumentException in JDTUtils.getPackageName #371

Merged
merged 1 commit into from
Oct 2, 2017

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Oct 2, 2017

Fixes redhat-developer/vscode-java#312

Signed-off-by: Snjezana Peco [email protected]

@snjeza snjeza requested review from gorkem and fbricon October 2, 2017 17:39
@@ -195,7 +195,7 @@ public static String getPackageName(IJavaProject javaProject, URI uri) {
if (content.isEmpty() && javaProject != null && ProjectsManager.DEFAULT_PROJECT_NAME.equals(javaProject.getProject().getName())) {
java.nio.file.Path path = Paths.get(uri);
java.nio.file.Path parent = path;
while (parent.getParent() != null) {
while (parent.getParent() != null && parent.getParent().getNameCount() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please add a unit test for that one?

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 have added it.

@fbricon fbricon merged commit d70d4bf into eclipse-jdtls:master Oct 2, 2017
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.

3 participants