Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 192142 - Java editor incorrectly underlines package statement and give bad hint
Java editor incorrectly underlines package statement and give bad hint
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Hints & Annotations
7.0
PC Windows 7 x64
: P2 (vote)
: 7.0
Assigned To: Jan Lahoda
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-18 23:13 UTC by muzPayne
Modified: 2010-11-20 06:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
bug in java editor in package statement (19.37 KB, image/png)
2010-11-18 23:13 UTC, muzPayne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muzPayne 2010-11-18 23:13:36 UTC
Created attachment 103085 [details]
bug in java editor in package statement

On the last version of NetBeans, 7.0Beta there is bug with following source code:

package beans.entities;


import beans.IJavaBean;
import beans.annotations.Invisible;
import beans.annotations.NotEditable;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.Min;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;


@ToString
public class TestingBean implements IJavaBean, Cloneable, Serializable {

    @Getter
    @Setter
    private Integer id;

    @Getter
    @Setter
    private String name;

    @Getter
    @Setter
    @Min(1)
    private Integer age;

    @Getter
    @Setter
    private Boolean marriage;

    @Invisible
    @Getter
    @Setter
    private Date startingDate;


    @Getter
    @Setter
    @NotEditable
    private String notEditable;


    @Override
    public Object clone() throws CloneNotSupportedException {
        TestingBean clone = (TestingBean) super.clone();

        clone.startingDate = this.startingDate != null ? new Date(this.startingDate.getTime())
                                                       : null;

        return clone;
    }

    @Override
    public Object cloneWithoutId() throws CloneNotSupportedException {
        throw new AssertionError();
    }
}

this is weird, because the same code is valid and in fact is working and compilable under the Beta version, under the 6.9.1 is compilable and no error hint is shown.

the package statement is underlined and provides following hint:
operator >>> cannot be applied to java.lang.String,java.lang.Integer
-> see in attachment

I use Maven project, NetBeans 7.0Beta, Win7 64bit, Oracle JDK 6u22 32bit
Comment 1 Jan Lahoda 2010-11-19 10:20:22 UTC
The underlaying problem is that lombok touches javac internals, but is not prepared for changes in the internals:
http://code.google.com/p/projectlombok/issues/detail?id=161

dbalek has workarounded that for 6.9, workarounding again after recent merge of newer javac:
http://hg.netbeans.org/jet-main/rev/fcdfbcc8a860
Comment 2 Quality Engineering 2010-11-20 06:13:12 UTC
Integrated into 'main-golden', will be available in build *201011200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fcdfbcc8a860
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #192142: updating nb-javac library


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo