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

[NETBEANS-4177] Add another check for valid parameter list position to avoid exception if sourcecode is incorrect #2082

Merged
merged 1 commit into from Apr 23, 2020

Conversation

graben
Copy link
Contributor

@graben graben commented Apr 15, 2020

No description provided.

@graben
Copy link
Contributor Author

graben commented Apr 15, 2020

@eirikbakke : Should fix your mentioned issue

@eirikbakke
Copy link
Contributor

Reading through the method, this seems straightforward enough. Thank you!

Copy link
Contributor

@jlahoda jlahoda 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. Might be nice to add a test.

@graben
Copy link
Contributor Author

graben commented Apr 16, 2020

@jlahoda : Simple test added.

Copy link
Contributor

@jlahoda jlahoda 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.

…o avoid exception if sourcecode is incorrect
@graben
Copy link
Contributor Author

graben commented Apr 21, 2020

@jlahoda : Should be considered for 12.0, too?

@jlahoda jlahoda added this to the 12.0 milestone Apr 21, 2020
@jlahoda
Copy link
Contributor

jlahoda commented Apr 21, 2020

Yes, I believe this should be considered for 12.0. Eirik - what do you think?

@eirikbakke
Copy link
Contributor

Looks completely safe to include to me.

@ebarboni ebarboni merged commit 976501a into apache:master Apr 23, 2020
@graben graben deleted the NETBEANS-4177 branch April 23, 2020 14:55
@eirikbakke
Copy link
Contributor

If you still have this patch running on your build, could you see if this also handles the following case?

public class FooTest {
  public void someMethod() {
    List<String> someFoo = listOf(transform(null, s -> new Integer(5)));
  }

  public static <E> List<E> listOf(E element) {
    throw new UnsupportedOperationException();
  }

  public static <F, T> Iterable<T> transform(
      Iterable<F> fromIterable, Function<? super F, ? extends T> function)
  {
    throw new UnsupportedOperationException();
  }
}

@graben
Copy link
Contributor Author

graben commented May 2, 2020

Hi @eirikbakke, works for me on master build 1578.

@eirikbakke
Copy link
Contributor

@graben Excellent--thank you!

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.

None yet

4 participants