[ 
https://issues.apache.org/jira/browse/MYFACES-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17689635#comment-17689635
 ] 

Werner Punz edited comment on MYFACES-4565 at 2/16/23 9:32 AM:
---------------------------------------------------------------

Reported by [~volosied] 

Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.572 s <<< 
FAILURE! - in 
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentNestedCCTestCase
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentMethodExpressionTestCase.testCompositeMethodExpressionTarget2
  Time elapsed: 0.106 s  <<< ERROR!
java.lang.NullPointerException
        at 
org.apache.myfaces.resource.TempDirFileCacheResourceLoader.deleteDir(TempDirFileCacheResourceLoader.java:145)

—

 

The affected loc is:

 
{code:java}
for (int i = 0; i < children.length; i++)
 {code}
Which means children is null!
{code:java}
if (dir.isDirectory())
{
String[] children = dir.list(); {code}
 

>From the openjdk sources
{code:java}
public String[] list() {
    SecurityManager security = System.getSecurityManager();
    if (security != null)
{         security.checkRead(path);     }
    if (isInvalid())
{        return null;    }
    return fs.list(this);
} {code}
 

So it seems the security manager is blocking here in @volosieds case

(permission problem after all this is a temp dir?)

Question is here if the test environment is the problem and not the test itself.

A fix would be to simply take the null into consideration but do we really want 
that?

 

[~tandraschko] and [~volosied] need to give the input here

 


was (Author: werpu):
Reported by [~volosied] 

Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.572 s <<< 
FAILURE! - in 
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentNestedCCTestCase
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentMethodExpressionTestCase.testCompositeMethodExpressionTarget2
  Time elapsed: 0.106 s  <<< ERROR!
java.lang.NullPointerException
        at 
org.apache.myfaces.resource.TempDirFileCacheResourceLoader.deleteDir(TempDirFileCacheResourceLoader.java:145)

—

 

The affected loc is:

```java

for (int i = 0; i < children.length; i++)

```

 

Which means children is null!

```java

if (dir.isDirectory())
{
String[] children = dir.list();

```

>From the openjdk sources

```java

public String[] list() {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
        security.checkRead(path);
    }
    if (isInvalid()) {
       return null;
   }
    return fs.list(this);
}

```

So it seems the security manager is blocking here in @volosieds case

(permission problem after all this is a temp dir?)

Question is here if the test environment is the problem and not the test itself.

A fix would be to simply take the null into consideration but do we really want 
that?

 

[~tandraschko] and [~volosied] need to voice their ideas here

 

> TempDirFileCacheResourceLoader delete error
> -------------------------------------------
>
>                 Key: MYFACES-4565
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4565
>             Project: MyFaces Core
>          Issue Type: Task
>    Affects Versions: 4.0.0-RC5
>            Reporter: Werner Punz
>            Assignee: Werner Punz
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to