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

@rtaneja1 rtaneja1 commented Mar 23, 2019

No description provided.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

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

Loading

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

@matthiasblaesing matthiasblaesing Mar 23, 2019

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.

Loading

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

@matthiasblaesing matthiasblaesing Mar 23, 2019

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.

Loading

Copy link
Contributor Author

@rtaneja1 rtaneja1 Mar 23, 2019

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.

Loading

@rtaneja1
Copy link
Contributor Author

@rtaneja1 rtaneja1 commented Mar 23, 2019

Loading

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

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

PS: Please squash the commits before merge.

Loading

@rtaneja1 rtaneja1 merged commit 6152dae into apache:master Mar 25, 2019
1 check passed
Loading
@rtaneja1 rtaneja1 added the NB11 label Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants