Bug 245942 - Wrong JPA @Column value -> Eclipse NullPointerException
Summary: Wrong JPA @Column value -> Eclipse NullPointerException
Status: VERIFIED DUPLICATE of bug 242933
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4.1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 04:43 EDT by Dominik CLA
Modified: 2008-09-16 09:52 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik CLA 2008-09-02 04:43:14 EDT
Usage of JPA Annotation @Column with a very large value for the length-parameter may lead to NullPointerException and several other exceptions in eclipse. After trying to save the file it becomes impossible to reopen it as java file.

For reproduction:

import javax.persistence.Column;

public class Test {
	
	@Column(length=2147483648)
	byte[] array;
}


The value 2147483648 (2GB) brings eclipse to throw various messages, when you try to save.
length normally takes an integer.
Comment 1 Walter Harley CLA 2008-09-02 10:45:22 EDT
Dominik, can you please add a stack trace for the NPE (and for any other exceptions you've gotten)?

What annotation processor is being used, what version of Eclipse (I'm guessing it is not 4.0 like you entered), and what JRE?

If you build the code with javac, rather than with Eclipse, do you get any errors?
Comment 2 Dominik CLA 2008-09-02 11:15:19 EDT
Ok, sorry for the missing information. Its my first bug report. (Actually it's the first bug i ever noticed in eclipse) :)

I am using eclipse version 3.4.0 and JDK 1.6.0_07. I also got JRE 1.6.0_10 installed on my PC.
I am not sure how to find out which annotation processor was used, could you give me some further instruction on that?
The used framework for persistence was hibernate (3.3.0CR2) + hibernate annotations (3.4.0CR2).

If I compile it with javac it shows the error "integer number too large", which makes sense. Eclipse itself also shows a similar error when editing the file, which is ok. But then it goes completely "nuts" when i try to save it anyway.


Here is a copy of the NullPointerException which is thrown when i try to save the file. It is thrown in an endless loop many times within a second, which makes eclipse nearly unusable.


eclipse.buildId=I20080617-2000
java.version=1.6.0_10-rc
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86

This is a continuation of log file C:\Documents and Settings\Dominik ******\workspace_new\.metadata\.bak_0.log
Created Time: 2008-09-02 16:51:51.500


Error
Tue Sep 02 16:51:52 CEST 2008
java.lang.NullPointerException

java.lang.NullPointerException
at org.eclipse.jdt.internal.core.util.Util.getAnnotationMemberValue(Util.java:3003)
at org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor.getMemberValue(CompilationUnitStructureRequestor.java:650)
at org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor.getMemberValuePair(CompilationUnitStructureRequestor.java:631)
at org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor.getMemberValuePairs(CompilationUnitStructureRequestor.java:638)
at org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor.enterAnnotation(CompilationUnitStructureRequestor.java:272)
at org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor.enterField(CompilationUnitStructureRequestor.java:336)
at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:498)
at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:661)
at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:431)
at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:912)
at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:170)
at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:193)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:257)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:514)
at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1065)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:170)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:709)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:770)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1224)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:124)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:149)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:102)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)

Comment 3 Walter Harley CLA 2008-09-02 11:43:45 EDT
Reassigning to JDT Core.  Annotation processing is not involved here - based on stack trace, this is happening in ordinary compilation, I think there is no annotation processor present.

Raising severity from 'normal' to 'major', since according to the reporter this makes Eclipse impossible to use when it happens.

Comment 4 Jerome Lanneluc CLA 2008-09-02 11:56:33 EDT

*** This bug has been marked as a duplicate of bug 242933 ***
Comment 5 David Audel CLA 2008-09-04 08:49:59 EDT
Verified for 3.4.1 using M20080903-2000 build
Comment 6 David Audel CLA 2008-09-16 05:23:17 EDT
Verified for 3.5M2 using I20080914-2000