This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 232284 - IndexOutOfBoundsException: start < 0 (-1 < 0)
Summary: IndexOutOfBoundsException: start < 0 (-1 < 0)
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3.1
Hardware: All All
: P3 normal (vote)
Assignee: Michel Graciano
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 20:41 UTC by Michel Graciano
Modified: 2013-12-17 12:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 201916


Attachments
stacktrace (4.48 KB, text/plain)
2013-07-04 20:41 UTC, Michel Graciano
Details
stacktrace (4.48 KB, text/plain)
2013-07-04 20:44 UTC, Michel Graciano
Details
Sample project (1.91 MB, application/zip)
2013-09-24 14:21 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2013-07-04 20:41:31 UTC
Build: NetBeans IDE 7.3.1 (Build 201306052037)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Linux

User Comments:
hmichel: Opening the IDE with entity classes already opened

hmichel: Opening the IDE




Stacktrace: 
java.lang.IndexOutOfBoundsException: start < 0 (-1 < 0)
   at org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription(ErrorDescriptionFactory.java:230)
   at org.netbeans.modules.j2ee.jpa.verification.common.Rule.createProblem(Rule.java:145)
   at org.netbeans.modules.j2ee.jpa.verification.common.Rule.createProblem(Rule.java:120)
   at org.netbeans.modules.j2ee.jpa.verification.rules.attribute.ValidModifiers.check(ValidModifiers.java:105)
   at org.netbeans.modules.j2ee.jpa.verification.rules.entity.ValidAttributes.apply(ValidAttributes.java:154)
   at org.netbeans.modules.j2ee.jpa.verification.rules.entity.ValidAttributes.apply(ValidAttributes.java:79)
Comment 1 Michel Graciano 2013-07-04 20:41:33 UTC
Created attachment 136726 [details]
stacktrace
Comment 2 Michel Graciano 2013-07-04 20:44:16 UTC
Created attachment 136727 [details]
stacktrace

Just opening the IDE with the entity already opened and selected.
Comment 3 Michel Graciano 2013-07-04 21:10:33 UTC
Reproducible with the following sample class:

@Entity
@Getter
@Setter(AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuppressWarnings("serial")
public class TestEntity implements Serializable {

    @Id
    private Long id;
    @Setter(AccessLevel.PACKAGE)
    private String numero;
    private String descricao;
    @Setter(AccessLevel.PACKAGE)
    private Integer nivel;
}

Maybe the problem is the integration with the Lombok processors?
Comment 4 Jan Lahoda 2013-07-08 07:50:33 UTC
Yes, the use of Lombok probably plays a role here.
Comment 5 Sergey Petrov 2013-07-11 14:16:47 UTC
What should be done to make provided sample compilable?
I can't reproduce with the sample, but may be because it's not processed properly.
Comment 6 Michel Graciano 2013-07-11 14:28:43 UTC
Are you using NB 7.4? It won't work because a Lombok issue with Java 8. To test it, you need to use NB < 7.4.
Comment 7 Sergey Petrov 2013-07-11 14:37:14 UTC
yes, 7.4+jdk7.
but I know nothing about lombok
Comment 8 Sergey Petrov 2013-07-11 14:43:20 UTC
there may be an issue with jdk7 also, I have can't initialize ap exception in entity hint after lombok.jar addition.
Comment 9 Sergey Petrov 2013-07-11 14:53:10 UTC
ok, I see now #226165 and http://code.google.com/p/projectlombok/issues/detail?id=451
I would say it's blocker for issue fixing at least with this sample as main development is on 7.4 code base it doesn't matter much to evaluate with 7.3.1 source code with jdk8-netbeans-lombok compatibility issue.
Comment 10 Michel Graciano 2013-07-11 14:54:35 UTC
The Lombok problem in 7.4 is the internal NB javac. Nb JavaC now is the same as Java 8, which is not compatible with Lombok it. Even if you run NB with JDK 7, the NB internal parser is the same as JDK 8... so the Lombok Annotation Processors won't work. It is an open issue at Lombok side and should be fixed (I hope soon). To test it you will need to use Nb < 7.4.
Comment 11 Sergey Petrov 2013-08-01 14:19:11 UTC
ok, may not be evaluated in 7.4 timeframe with current lombok, not sure if it may have sense to close as invalid for 7.4 as it's in real invalid for 7.4 with inability to reproduce.
Comment 12 Sergey Petrov 2013-08-07 11:36:59 UTC
Sorry, it's hard to track issues which can't be evaluated in current release or isn't valid in current release, so for now I can either downgrade to P4 or resolve-invalid. Please reopen back when lombok will be updated. Or with new exceptions new issue will be created anyway with link to this one and it will allow to reevaluate after 7.4 with details from this one I hope.
Comment 13 Michel Graciano 2013-09-24 14:21:35 UTC
Created attachment 140417 [details]
Sample project

Lombok team have fixed some issues and now it is possible to test it with our HEAD. I am attaching a sample project with the issue. All the libs are already attached, you should just open the project and see the issue.
Comment 14 Sergey Petrov 2013-09-24 14:48:16 UTC
thanks, will reevaluate, unfortunately it's late for 7.4
Comment 15 Sergey Petrov 2013-12-16 16:41:08 UTC
related jpa verification code was significantly rewritten in 8.0, 
I can't reproduce this exception if open attached project and open provided entity.
but I see quite a lot of others exceptions in output, but these exceptions aren't persistence related and may need to be filed as separate issue, it may also block this one issue verification if it's related.
Comment 16 Sergey Petrov 2013-12-17 12:27:54 UTC
I would say, there are a lot of lombok-nb compatibility issues yet, like https://netbeans.org/bugzilla/show_bug.cgi?id=237156 etc.
Also this one with out of bounds isn't reproducible, hard to say if it will be reproducible if compatibility problems will be fixed.