Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package plexus-utils for openSUSE:Factory checked in at 2023-05-04 17:10:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plexus-utils (Old) and /work/SRC/openSUSE:Factory/.plexus-utils.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plexus-utils" Thu May 4 17:10:08 2023 rev:8 rq:1084304 version:3.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/plexus-utils/plexus-utils.changes 2022-10-25 13:59:19.128403849 +0200 +++ /work/SRC/openSUSE:Factory/.plexus-utils.new.1533/plexus-utils.changes 2023-05-04 17:10:20.596283715 +0200 @@ -1,0 +2,10 @@ +Wed May 3 11:08:12 UTC 2023 - Fridrich Strba <fst...@suse.com> + +- Upgrade to upstream vesion 3.5.1 + * Changes + + Reading and writing files using Java NIO (#232) + + Partial revert of "Support combine.self='remove'" to fix + MNG-7709 (#241) + + Fix reading comments with UTF chars (fixes #238) (#240) + +------------------------------------------------------------------- Old: ---- plexus-utils-3.5.0.tar.gz New: ---- plexus-utils-3.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plexus-utils.spec ++++++ --- /var/tmp/diff_new_pack.4Ektng/_old 2023-05-04 17:10:21.552289313 +0200 +++ /var/tmp/diff_new_pack.4Ektng/_new 2023-05-04 17:10:21.556289336 +0200 @@ -1,7 +1,7 @@ # # spec file for package plexus-utils # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: plexus-utils -Version: 3.5.0 +Version: 3.5.1 Release: 0 Summary: Plexus Common Utilities License: Apache-1.1 AND Apache-2.0 AND xpp AND BSD-3-Clause AND SUSE-Public-Domain ++++++ plexus-utils-3.5.0.tar.gz -> plexus-utils-3.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/.github/workflows/codeql-analysis.yml new/plexus-utils-plexus-utils-3.5.1/.github/workflows/codeql-analysis.yml --- old/plexus-utils-plexus-utils-3.5.0/.github/workflows/codeql-analysis.yml 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/.github/workflows/codeql-analysis.yml 2023-03-02 02:23:12.000000000 +0100 @@ -32,7 +32,7 @@ steps: - name: Checkout repository - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.3.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/.github/workflows/maven.yml new/plexus-utils-plexus-utils-3.5.1/.github/workflows/maven.yml --- old/plexus-utils-plexus-utils-3.5.0/.github/workflows/maven.yml 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/.github/workflows/maven.yml 2023-03-02 02:23:12.000000000 +0100 @@ -22,4 +22,4 @@ jobs: build: name: Build it - uses: codehaus-plexus/.github/.github/workflows/maven.yml@v0.0.1 + uses: codehaus-plexus/.github/.github/workflows/maven.yml@v0.0.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/pom.xml new/plexus-utils-plexus-utils-3.5.1/pom.xml --- old/plexus-utils-plexus-utils-3.5.0/pom.xml 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/pom.xml 2023-03-02 02:23:12.000000000 +0100 @@ -26,7 +26,7 @@ </parent> <artifactId>plexus-utils</artifactId> - <version>3.5.0</version> + <version>3.5.1</version> <name>Plexus Common Utilities</name> <description>A collection of various utility classes to ease working with strings, files, command lines, XML and @@ -37,7 +37,7 @@ <connection>scm:git:g...@github.com:codehaus-plexus/plexus-utils.git</connection> <developerConnection>scm:git:g...@github.com:codehaus-plexus/plexus-utils.git</developerConnection> <url>http://github.com/codehaus-plexus/plexus-utils</url> - <tag>plexus-utils-3.5.0</tag> + <tag>plexus-utils-3.5.1</tag> </scm> <issueManagement> <system>github</system> @@ -51,20 +51,20 @@ </distributionManagement> <properties> - <project.build.outputTimestamp>2022-10-23T08:37:59Z</project.build.outputTimestamp> + <project.build.outputTimestamp>2023-03-02T01:23:05Z</project.build.outputTimestamp> </properties> <dependencies> <dependency> <groupId>org.openjdk.jmh</groupId> <artifactId>jmh-core</artifactId> - <version>1.35</version> + <version>1.36</version> <scope>test</scope> </dependency> <dependency> <groupId>org.openjdk.jmh</groupId> <artifactId>jmh-generator-annprocess</artifactId> - <version>1.35</version> + <version>1.36</version> <scope>test</scope> </dependency> <dependency> @@ -219,6 +219,36 @@ </build> </profile> <profile> + <id>jdk11+</id> + <activation> + <jdk>[11,)</jdk> + </activation> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <executions> + <execution> + <id>compile-java-11</id> + <goals> + <goal>compile</goal> + </goals> + <configuration> + <release>11</release> + <compileSourceRoots> + <compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot> + </compileSourceRoots> + <multiReleaseOutput>true</multiReleaseOutput> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> + </profile> + <profile> <id>plexus-release</id> <build> <plugins> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/BaseFileUtils.java new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/BaseFileUtils.java --- old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/BaseFileUtils.java 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/BaseFileUtils.java 2023-03-02 02:23:12.000000000 +0100 @@ -0,0 +1,25 @@ +package org.codehaus.plexus.util; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; + +/** + * Implementation specific to Java SE 8 version. + */ +abstract class BaseFileUtils +{ + static String fileRead( Path path, String encoding ) throws IOException + { + byte[] bytes = Files.readAllBytes( path ); + return encoding != null ? new String( bytes, encoding ) : new String( bytes ); + } + + static void fileWrite( Path path, String encoding, String data, OpenOption... openOptions ) throws IOException + { + byte[] bytes = encoding != null ? data.getBytes( encoding ) : data.getBytes(); + Files.write( path, bytes, openOptions ); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/FileUtils.java new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/FileUtils.java --- old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/FileUtils.java 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/FileUtils.java 2023-03-02 02:23:12.000000000 +0100 @@ -62,7 +62,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; @@ -70,6 +69,7 @@ import java.net.URL; import java.nio.charset.Charset; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.security.SecureRandom; @@ -114,7 +114,7 @@ * @author <a href="mailto:je...@codehaus.org">Jeff Turner</a> * */ -public class FileUtils +public class FileUtils extends BaseFileUtils { /** * The number of bytes in a kilobyte. @@ -330,7 +330,7 @@ public static String fileRead( String file, String encoding ) throws IOException { - return fileRead( new File( file ), encoding ); + return fileRead( Paths.get( file ), encoding ); } /** @@ -355,33 +355,9 @@ public static String fileRead( File file, String encoding ) throws IOException { - StringBuilder buf = new StringBuilder(); - - try ( Reader reader = getInputStreamReader( file, encoding ) ) - { - int count; - char[] b = new char[512]; - while ( ( count = reader.read( b ) ) >= 0 ) // blocking read - { - buf.append( b, 0, count ); - } - } - - return buf.toString(); + return fileRead( file.toPath(), encoding ); } - private static InputStreamReader getInputStreamReader( File file, String encoding ) throws IOException - { - if ( encoding != null ) - { - return new InputStreamReader( Files.newInputStream( file.toPath() ), encoding ); - } - else - { - return new InputStreamReader( Files.newInputStream( file.toPath() ) ); - } - } - /** * Appends data to a file. The file will be created if it does not exist. Note: the data is written with platform * encoding @@ -411,18 +387,12 @@ public static void fileAppend( String fileName, String encoding, String data ) throws IOException { - try ( OutputStream out = Files.newOutputStream( Paths.get(fileName), - StandardOpenOption.APPEND, StandardOpenOption.CREATE ) ) - { - if ( encoding != null ) - { - out.write( data.getBytes( encoding ) ); - } - else - { - out.write( data.getBytes() ); - } - } + fileAppend( Paths.get( fileName), encoding, data ); + } + + private static void fileAppend( Path path, String encoding, String data ) throws IOException + { + fileWrite( path, encoding, data, StandardOpenOption.APPEND, StandardOpenOption.CREATE ); } /** @@ -450,7 +420,7 @@ public static void fileWrite( String fileName, String encoding, String data ) throws IOException { - File file = ( fileName == null ) ? null : new File( fileName ); + Path file = ( fileName == null ) ? null : Paths.get( fileName ); fileWrite( file, encoding, data ); } @@ -481,23 +451,7 @@ public static void fileWrite( File file, String encoding, String data ) throws IOException { - try ( Writer writer = getOutputStreamWriter( file, encoding ) ) - { - writer.write( data ); - } - } - - private static OutputStreamWriter getOutputStreamWriter( File file, String encoding ) throws IOException - { - OutputStream out = Files.newOutputStream( file.toPath() ); - if ( encoding != null ) - { - return new OutputStreamWriter( out, encoding ); - } - else - { - return new OutputStreamWriter( out ); - } + fileWrite( file.toPath(), encoding, data ); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java --- old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/xml/Xpp3Dom.java 2023-03-02 02:23:12.000000000 +0100 @@ -445,7 +445,7 @@ { for ( String attr : recessive.attributes.keySet() ) { - if ( isEmpty( dominant.getAttribute( attr ) ) && !SELF_COMBINATION_MODE_ATTRIBUTE.equals( attr ) ) + if ( isEmpty( dominant.getAttribute( attr ) ) ) { dominant.setAttribute( attr, recessive.getAttribute( attr ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java --- old/plexus-utils-plexus-utils-3.5.0/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java 2023-03-02 02:23:12.000000000 +0100 @@ -2981,8 +2981,8 @@ // implements XML 1.0 Section 2.5 Comments // ASSUMPTION: seen <!- - char ch = more(); - if ( ch != '-' ) + char cch = more(); + if ( cch != '-' ) throw new XmlPullParserException( "expected <!-- for comment start", this, null ); if ( tokenize ) posStart = pos; @@ -2999,7 +2999,19 @@ while ( true ) { // scan until it hits --> - ch = more(); + cch = more(); + int ch; + char cch2; + if ( Character.isHighSurrogate( cch ) ) + { + cch2 = more(); + ch = Character.toCodePoint( cch, cch2 ); + } + else + { + cch2 = 0; + ch = cch; + } if ( seenDashDash && ch != '>' ) { throw new XmlPullParserException( "in comment after two dashes (--) next character must be >" @@ -3074,7 +3086,11 @@ { if ( pcEnd >= pc.length ) ensurePC( pcEnd ); - pc[pcEnd++] = ch; + pc[pcEnd++] = cch; + if ( cch2 != 0 ) + { + pc[pcEnd++] = cch2; + } } normalizedCR = false; } @@ -4153,7 +4169,7 @@ // ch != '\u0000' ch < '\uFFFE' // private char printable(char ch) { return ch; } - private static String printable( char ch ) + private static String printable( int ch ) { if ( ch == '\n' ) { @@ -4175,18 +4191,25 @@ { return "\\u" + Integer.toHexString( ch ); } - return "" + ch; + if ( Character.isBmpCodePoint( ch ) ) + { + return Character.toString( ( char ) ch ); + } + else + { + return new String( new char[] { Character.highSurrogate( ch ), Character.lowSurrogate( ch ) } ); + } } private static String printable( String s ) { if ( s == null ) return null; - final int sLen = s.length(); + final int sLen = s.codePointCount(0, s.length()); StringBuilder buf = new StringBuilder( sLen + 10 ); for ( int i = 0; i < sLen; ++i ) { - buf.append( printable( s.charAt( i ) ) ); + buf.append( printable( s.codePointAt( i ) ) ); } s = buf.toString(); return s; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/main/java11/org/codehaus/plexus/util/BaseFileUtils.java new/plexus-utils-plexus-utils-3.5.1/src/main/java11/org/codehaus/plexus/util/BaseFileUtils.java --- old/plexus-utils-plexus-utils-3.5.0/src/main/java11/org/codehaus/plexus/util/BaseFileUtils.java 1970-01-01 01:00:00.000000000 +0100 +++ new/plexus-utils-plexus-utils-3.5.1/src/main/java11/org/codehaus/plexus/util/BaseFileUtils.java 2023-03-02 02:23:12.000000000 +0100 @@ -0,0 +1,31 @@ +package org.codehaus.plexus.util; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; + +/** + * Implementation specific to Java SE 11 version. + */ +abstract class BaseFileUtils +{ + static String fileRead( Path path, String encoding ) throws IOException + { + return encoding != null ? Files.readString( path, Charset.forName( encoding ) ) : Files.readString( path ); + } + + static void fileWrite( Path path, String encoding, String data, OpenOption... openOptions ) throws IOException + { + if ( encoding != null ) + { + Files.writeString( path, data, Charset.forName( encoding ), openOptions ); + } + else + { + Files.writeString( path, data, openOptions ); + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/test/java/org/codehaus/plexus/util/FileUtilsTest.java new/plexus-utils-plexus-utils-3.5.1/src/test/java/org/codehaus/plexus/util/FileUtilsTest.java --- old/plexus-utils-plexus-utils-3.5.0/src/test/java/org/codehaus/plexus/util/FileUtilsTest.java 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/src/test/java/org/codehaus/plexus/util/FileUtilsTest.java 2023-03-02 02:23:12.000000000 +0100 @@ -33,6 +33,7 @@ import java.io.Writer; import java.net.URL; import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Properties; import org.junit.Before; @@ -191,7 +192,7 @@ for ( int i = 0; i < urls.length; i++ ) { - assertEquals( files[i].toURL(), urls[i] ); + assertEquals( files[i].toURI().toURL(), urls[i] ); } } @@ -885,14 +886,12 @@ final URL url = this.getClass().getResource( path ); assertNotNull( path + " was not found.", url ); - String filename = url.getFile(); - // The following line applies a fix for spaces in a path - filename = replaceAll( filename, "%20", " " ); + final String filename = Paths.get(url.toURI()).toString(); final String filename2 = "test2.txt"; assertTrue( "test.txt extension == \"txt\"", FileUtils.getExtension( filename ).equals( "txt" ) ); - assertTrue( "Test file does not exist: " + filename, FileUtils.fileExists( filename ) ); + assertTrue( "Test file does exist: " + filename, FileUtils.fileExists( filename ) ); assertTrue( "Second test file does not exist", !FileUtils.fileExists( filename2 ) ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/plexus-utils-plexus-utils-3.5.0/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java new/plexus-utils-plexus-utils-3.5.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java --- old/plexus-utils-plexus-utils-3.5.0/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java 2022-10-23 10:40:12.000000000 +0200 +++ new/plexus-utils-plexus-utils-3.5.1/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java 2023-03-02 02:23:12.000000000 +0100 @@ -1511,4 +1511,30 @@ fail( "should not raise exception: " + e ); } } + + /** + * Ensures emoji can be parsed correctly + */ + @Test + public void testUnicode() throws IOException { + String input = "<project><!--ALL TEH BOMS! \uD83D\uDCA3 --></project>"; + + try + { + MXParser parser = new MXParser(); + parser.setInput( new StringReader( input ) ); + + assertEquals( XmlPullParser.START_TAG, parser.nextToken() ); + assertEquals( "project", parser.getName() ); + assertEquals( XmlPullParser.COMMENT, parser.nextToken() ); + assertEquals( "ALL TEH BOMS! \uD83D\uDCA3 ", parser.getText() ); + assertEquals( XmlPullParser.END_TAG, parser.nextToken() ); + assertEquals( "project", parser.getName() ); + } + catch ( XmlPullParserException e ) + { + e.printStackTrace(); + fail( "should not raise exception: " + e ); + } + } } ++++++ plexus-utils-build.xml ++++++ --- /var/tmp/diff_new_pack.4Ektng/_old 2023-05-04 17:10:21.892291303 +0200 +++ /var/tmp/diff_new_pack.4Ektng/_new 2023-05-04 17:10:21.896291327 +0200 @@ -11,7 +11,7 @@ <property name="project.groupId" value="org.codehaus.plexus"/> <property name="project.fragment" value="utils"/> <property name="project.artifactId" value="plexus-${project.fragment}"/> - <property name="project.version" value="3.5.0"/> + <property name="project.version" value="3.5.1"/> <property name="project.name" value="Plexus Common Utilities"/> <property name="project.description" value="A collection of various utility classes to ease working with strings, files, command lines, XML and more."/> <property name="project.organization.name" value="Codehaus Plexus"/>