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

commented Mar 23, 2019

No description provided.

@matthiasblaesing
Copy link
Contributor

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?

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

This comment has been minimized.

Copy link
@matthiasblaesing

matthiasblaesing Mar 23, 2019

Contributor

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?

This comment has been minimized.

Copy link
@matthiasblaesing

matthiasblaesing Mar 23, 2019

Contributor

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.

This comment has been minimized.

Copy link
@rtaneja1

rtaneja1 Mar 23, 2019

Author Contributor

Thanks, removed special handling for -parameters here.

@rtaneja1

This comment has been minimized.

Copy link
Contributor Author

commented Mar 23, 2019

@matthiasblaesing
Copy link
Contributor

left a comment

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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
Projects
None yet
3 participants
You can’t perform that action at this time.