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

maven project compile args not passed to editor javac #1173

Merged
merged 3 commits into from
Mar 25, 2019

Conversation

rtaneja1
Copy link
Contributor

No description provided.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

I left comments inline. There is one side question remaining: will the the compiler still work, if it is faced with unsupported parameters?

if (ARG_PARAMETERS.equals(compilerArg.trim())) {
return Arrays.asList(ARG_PARAMETERS);//reqd?
}
return Arrays.asList(compilerArgs);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the point of this loop. Currently the code results in returning the full list of arguments, if at least one parameter is not null. I tried to provoke a NULL value in the arguments list. None of these variants resulted in a null value:

<arg></arg>
<arg/>
<arg xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

So I would propose to return the argument list, if it is not null directly.

return Arrays.asList(ARG_PARAMETERS);
if (compilerArg != null) {
if (ARG_PARAMETERS.equals(compilerArg.trim())) {
return Arrays.asList(ARG_PARAMETERS);//reqd?
Copy link
Contributor

Choose a reason for hiding this comment

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

In the original code there are only two cases:

  • if a compiler argument -parameters was provided, it will be returned
  • else an empty list is returned

This makes sense reading the commit message of the addition:
http://hg.netbeans.org/main-golden/log/tip/maven/src/org/netbeans/modules/maven/queries/PomCompilerOptionsQueryImpl.java
It is basicly a guard to limit the change to that single parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, removed special handling for -parameters here.

@rtaneja1
Copy link
Contributor Author

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks for the pointer to the validation code!

PS: Please squash the commits before merge.

@rtaneja1 rtaneja1 merged commit 6152dae into apache:master Mar 25, 2019
@geertjanw geertjanw added the Cherry Pick Consider cherry picking for release update label Mar 30, 2019
@rtaneja1 rtaneja1 added the NB11 label Apr 2, 2019
@lkishalmi lkishalmi removed the Cherry Pick Consider cherry picking for release update label Jun 29, 2020
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.

4 participants