DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCJPA-149
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Rolf Aden
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
DataNucleus API JPA

SingularAttribute.isOptional throws ArrayIndexOutOfBoundsException

Created: 29/Jul/11 05:13 PM   Updated: 01/Aug/11 05:13 PM   Resolved: 29/Jul/11 07:40 PM
Component/s: API
Affects Version/s: 3.0.0.m6
Fix Version/s: 3.0.0.release

File Attachments: 1. Zip Archive (2 kB)

Environment: windows 7

 Description  « Hide
Calling the method isOptional() on javax.persistence.metamodel.SingularAttribute throws a ArrayIndexOutOfBoundsException.

java.lang.ArrayIndexOutOfBoundsException: 0
at org.datanucleus.api.jpa.metamodel.SingularAttributeImpl.isOptional(

You can reproduce it with the following persistent class.

public class A {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private Boolean boolOpt;

@Basic(optional = false)
private boolean bool;

private Integer integerOpt;

@Basic(optional = false)
private int integer;

Sort Order: Ascending order - Click to sort in descending order
Rolf Aden added a comment - 29/Jul/11 05:16 PM
The issue can be reproduced using the attached test case.

Andy Jefferson added a comment - 29/Jul/11 07:40 PM
SVN trunk works. thx