You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Craig Russell (JIRA)" <ji...@apache.org> on 2009/09/18 21:23:16 UTC

[jira] Commented: (JDO-640) NPE when running tck in debug mode

    [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757370#action_12757370 ] 

Craig Russell commented on JDO-640:
-----------------------------------

Nimble fingers you have. Good is the patch. May the force be with you.

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-640.patch, TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field. 
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.