chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Li (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CMIS-958) InMemory server failing CmisJS tests, cause found, patch suggested
Date Thu, 19 Nov 2015 08:07:11 GMT

     [ https://issues.apache.org/jira/browse/CMIS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Steven Li updated CMIS-958:
---------------------------
    Description: 
The InMemory server is failing the test suites from the CmisJS project (https://github.com/agea/CmisJS),
I traced it down to a somewhat straightforward bug in ObjectService.java (in package org.apache.chemistry.opencmis.server.impl.browser),
around line 494, see below:

{code}
String changeToken = (changeTokens != null && changeTokens.size() > i ? changeTokens.get(i)
: null);
                if (changeToken.length() == 0) {
                    changeToken = null;
                }
{code}

The first statement would sometimes yields a "null" value, which is then used immediately
as a valid object, resulting in NullPointerException when executing the test cases. A reasonable
patch would be to change the 2nd line to:

{code}
        if ( (changeToken!=null) && (changeToken.length()==0) ) {
{code}

Wondering if this makes sense to you all...

  was:
The InMemory server is failing the test suites from the CmisJS project (https://github.com/agea/CmisJS),
I traced it down to a somewhat straightforward bug in ObjectService.java (in package org.apache.chemistry.opencmis.server.impl.browser),
around line 494, see below:

{code}
String changeToken = (changeTokens != null && changeTokens.size() > i ? changeTokens.get(i)
: null);
                if (changeToken.length() == 0) {
                    changeToken = null;
                }
{code}

The first statement would sometimes yields a "null" value, which is then used immediately
always as valid object, resulting in NullPointerException. A reasonable patch would be to
change the 2nd line to:

{code}
        if ( (changeToken!=null) && (changeToken.length()==0) ) {
{code}
Wondering if this makes sense to you all...

        Summary: InMemory server failing CmisJS tests, cause found, patch suggested  (was:
InMemory failing CmisJS tests, cause found, patch suggested)

> InMemory server failing CmisJS tests, cause found, patch suggested
> ------------------------------------------------------------------
>
>                 Key: CMIS-958
>                 URL: https://issues.apache.org/jira/browse/CMIS-958
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 0.14.0
>         Environment: CentOS 7.1
>            Reporter: Steven Li
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The InMemory server is failing the test suites from the CmisJS project (https://github.com/agea/CmisJS),
I traced it down to a somewhat straightforward bug in ObjectService.java (in package org.apache.chemistry.opencmis.server.impl.browser),
around line 494, see below:
> {code}
> String changeToken = (changeTokens != null && changeTokens.size() > i ? changeTokens.get(i)
: null);
>                 if (changeToken.length() == 0) {
>                     changeToken = null;
>                 }
> {code}
> The first statement would sometimes yields a "null" value, which is then used immediately
as a valid object, resulting in NullPointerException when executing the test cases. A reasonable
patch would be to change the 2nd line to:
> {code}
>         if ( (changeToken!=null) && (changeToken.length()==0) ) {
> {code}
> Wondering if this makes sense to you all...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message