[ 
http://jira.codehaus.org/browse/MNG-3580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135705#action_135705
 ] 

Benjamin Bentmann commented on MNG-3580:
----------------------------------------

bq. but you forgot that JDK impl is vendor specific. 
The terms "implementation" and "vendor specific" are inheritly related, that's 
no news. My concern was that besides some vendor-specific differences under the 
hood, *every* JRE impl must obey the contracts imposed by the API.

After some investigation, the problem boils down to a JRE bug just like Erik 
assumed, i.e. the {{null}} value should never appear in the plugin list 
iterated by Maven and it is not Maven's fault that it does. Take the following 
code snippet:
{code:java}
Collection coll = Arrays.asList( new String[] { "1", "2" } );

List list = new ArrayList();

list.add( "a" );
list.add( 0, "b" );
list.add( 0, "c" );
list.add( 0, "d" );
list.add( 0, "e" );
list.add( 0, "f" );
list.add( 0, "g" );
list.add( 0, "h" );
list.add( 0, "i" );

list.addAll( 6, coll );

System.out.println( System.getProperty( "java.vendor.url" ) );
System.out.println( list.size() );
System.out.println( list );
System.out.println( list.contains( null ) );
{code}
On a Sun JDK the following output is observed:
{noformat}
http://java.sun.com/
11
[i, h, g, f, e, d, 1, 2, c, b, a]
false
{noformat}
In contrast, on harmony-jdk-629320 I observed
{noformat}
http://harmony.apache.org
12
[i, h, g, f, e, d, 1, 2, d, c, b, null]
true
{noformat}
which is just incorrect.

Facit: Here is nothing to fix in Maven. I wouldn't ever consider a workaround 
since this would require to review *all* code spots that use {{ArrayList}} and 
not just the one class {{ModelUtils}} where the JRE bug manifested itself for 
the first time. The JRE vendor is responsible to fix this.

> FATAL ERROR and NPE on start
> ----------------------------
>
>                 Key: MNG-3580
>                 URL: http://jira.codehaus.org/browse/MNG-3580
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.9
>         Environment: Linux iitm50ws1106 2.6.25.3-2-default #1 SMP 2008-05-10 
> 07:46:36 +0200 x86_64 x86_64 x86_64 GNU/Linux
> java version "1.6.0"
> Java(TM) SE Runtime Environment (build pxa6460sr1-20080416_01(SR1))
> IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Linux amd64-64 
> jvmxa6460-20080415_18762 (JIT enabled, AOT enabled)
> J9VM - 20080415_018762_LHdSMr
> JIT  - r9_20080415_1520
> GC   - 20080415_AA)
> JCL  - 20080412_01
>            Reporter: Erik Putrycz
>         Attachments: maven.log, MNG-3580.patch
>
>
> Any mvn command does give me the following error message
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO]   Business Rules Extractor
> [INFO]   Business Rules Extractor core functions
> [INFO]   COBOL Parser and ANTLR Tools
> [INFO]   Business Rules Extractor data model
> [INFO]   Documentation Extractor module
> [INFO]   Extractor module
> [INFO]   Business Rules Navigator
> WAGON_VERSION: 1.0-beta-2
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building Business Rules Extractor
> [INFO]    task-segment: [install]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] null
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
>         at 
> org.apache.maven.project.ModelUtils.mergePluginLists(ModelUtils.java:164)
>         at 
> org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler.assembleBuildInheritance(DefaultModelInheritanceAssembler.java:366)
>         at 
> org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler.assembleModelInheritance(DefaultModelInheritanceAssembler.java:168)
>         at 
> org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler.assembleModelInheritance(DefaultModelInheritanceAssembler.java:61)
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:852)
>         at 
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:253)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:265)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:197)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:176)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1274)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging(DefaultLifecycleExecutor.java:1033)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:997)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:477)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:59)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
>         at java.lang.reflect.Method.invoke(Method.java:612)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 1 second
> [INFO] Finished at: Fri May 16 13:10:16 EDT 2008
> [INFO] Final Memory: 6M/19M
> [INFO] 
> ------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to