You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2007/03/13 23:03:20 UTC

svn commit: r517901 - /maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java

Author: carlos
Date: Tue Mar 13 15:03:20 2007
New Revision: 517901

URL: http://svn.apache.org/viewvc?view=rev&rev=517901
Log:
[MECLIPSE-233] Manifest attributes incorrectly treated as case-sensitive
Submitted By: Matthew Beermann

Modified:
    maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java?view=diff&rev=517901&r1=517900&r2=517901
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseOSGiManifestWriter.java Tue Mar 13 15:03:20 2007
@@ -135,18 +135,22 @@
                     continue;
                 }
 
-                if ( line.startsWith( ENTRY_BUNDLE_CLASSPATH ) )
+                // Note that this could be the empty string, if we encounter
+                // a field that we weren't expecting to be multi-line.
+                String name = line.substring( 0, line.indexOf( ":" ) + 1 );
+                
+                if ( name.equalsIgnoreCase( ENTRY_BUNDLE_CLASSPATH ) )
                 {
                     inBundleClasspathEntry = true;
                 }
-                else if ( line.startsWith( ENTRY_BUNDLE_NAME ) )
+                else if ( name.equalsIgnoreCase( ENTRY_BUNDLE_NAME ) )
                 {
                     manifestSb.append( ENTRY_BUNDLE_NAME );
                     manifestSb.append( " " );
                     manifestSb.append( config.getProject().getName() );
                     manifestSb.append( NEWLINE );
                 }
-                else if ( line.startsWith( ENTRY_BUNDLE_SYMBOLICNAME ) )
+                else if ( name.equalsIgnoreCase( ENTRY_BUNDLE_SYMBOLICNAME ) )
                 {
                     manifestSb.append( ENTRY_BUNDLE_SYMBOLICNAME );
                     manifestSb.append( " " );
@@ -154,14 +158,14 @@
                     manifestSb.append( ";singleton:=true" );
                     manifestSb.append( NEWLINE );
                 }
-                else if ( line.startsWith( ENTRY_BUNDLE_VERSION ) )
+                else if ( name.equalsIgnoreCase( ENTRY_BUNDLE_VERSION ) )
                 {
                     manifestSb.append( ENTRY_BUNDLE_VERSION );
                     manifestSb.append( " " );
                     manifestSb.append( getNormalizedVersion( config.getProject().getVersion() ) );
                     manifestSb.append( NEWLINE );
                 }
-                else if ( line.startsWith( ENTRY_BUNDLE_VENDOR ) && config.getProject().getOrganization() != null )
+                else if ( name.equalsIgnoreCase( ENTRY_BUNDLE_VENDOR ) && config.getProject().getOrganization() != null )
                 {
                     manifestSb.append( ENTRY_BUNDLE_VENDOR );
                     manifestSb.append( " " );