You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Jeffrey Morlan <je...@everlaw.com> on 2018/06/13 21:19:06 UTC

nb-javac AssertionError compiling valid code

Hi,

The current nb-javac fails with an AssertionError when compiling an
expression like "a.new B(){}".

This is pretty annoying since it'll happen every time a file with this
construct is saved, and afaik there's no alternate syntax that can be used
to avoid the problem.

As is, nb-javac can't even compile some of its own files because of this.
The exception can also be seen when running the AttrTest.testCheckMethodNPE
unit test, although it doesn't cause a test failure since
JavacTaskImpl.handleExceptions catches it.

I tracked down the cause (a bad merge of existing nb-javac changes with JDK
10 changes) and came up with a 2-line patch:
https://issues.apache.org/jira/browse/NETBEANS-906

Could someone responsible for nb-javac please take a look?

Thanks,
Jeffrey

Re: nb-javac AssertionError compiling valid code

Posted by Jeffrey Morlan <je...@everlaw.com>.
This bug is still present in nb-javac 1.5

On Thu, Jun 14, 2018 at 11:56 AM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com.invalid> wrote:

> Hey this is awesome.
>
> You came across a problem, identified the cause, fixed it, and provided a
> pull request.
>
> That is really great. Yes, those knowledgeable in this area should
> definitely take a look.
>
> Gj
>
>
>
> On Wed, Jun 13, 2018 at 11:19 PM, Jeffrey Morlan <je...@everlaw.com>
> wrote:
>
> > Hi,
> >
> > The current nb-javac fails with an AssertionError when compiling an
> > expression like "a.new B(){}".
> >
> > This is pretty annoying since it'll happen every time a file with this
> > construct is saved, and afaik there's no alternate syntax that can be
> used
> > to avoid the problem.
> >
> > As is, nb-javac can't even compile some of its own files because of this.
> > The exception can also be seen when running the
> AttrTest.testCheckMethodNPE
> > unit test, although it doesn't cause a test failure since
> > JavacTaskImpl.handleExceptions catches it.
> >
> > I tracked down the cause (a bad merge of existing nb-javac changes with
> JDK
> > 10 changes) and came up with a 2-line patch:
> > https://issues.apache.org/jira/browse/NETBEANS-906
> >
> > Could someone responsible for nb-javac please take a look?
> >
> > Thanks,
> > Jeffrey
> >
>

Re: nb-javac AssertionError compiling valid code

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Hey this is awesome.

You came across a problem, identified the cause, fixed it, and provided a
pull request.

That is really great. Yes, those knowledgeable in this area should
definitely take a look.

Gj



On Wed, Jun 13, 2018 at 11:19 PM, Jeffrey Morlan <je...@everlaw.com>
wrote:

> Hi,
>
> The current nb-javac fails with an AssertionError when compiling an
> expression like "a.new B(){}".
>
> This is pretty annoying since it'll happen every time a file with this
> construct is saved, and afaik there's no alternate syntax that can be used
> to avoid the problem.
>
> As is, nb-javac can't even compile some of its own files because of this.
> The exception can also be seen when running the AttrTest.testCheckMethodNPE
> unit test, although it doesn't cause a test failure since
> JavacTaskImpl.handleExceptions catches it.
>
> I tracked down the cause (a bad merge of existing nb-javac changes with JDK
> 10 changes) and came up with a 2-line patch:
> https://issues.apache.org/jira/browse/NETBEANS-906
>
> Could someone responsible for nb-javac please take a look?
>
> Thanks,
> Jeffrey
>