You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/04/26 08:01:56 UTC

[maven-resolver] branch MRESOLVER-171 updated (b522f5a -> 30dcda9)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch MRESOLVER-171
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git.


 discard b522f5a  [MRESOLVER-171] Resolver fails when compiled on Java 9+ and run on Java 8 due to JDK API breakage
     new 30dcda9  [MRESOLVER-171] Resolver fails when compiled on Java 9+ and run on Java 8 due to JDK API breakage

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b522f5a)
            \
             N -- N -- N   refs/heads/MRESOLVER-171 (30dcda9)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/eclipse/aether/connector/basic/ChecksumCalculator.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[maven-resolver] 01/01: [MRESOLVER-171] Resolver fails when compiled on Java 9+ and run on Java 8 due to JDK API breakage

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MRESOLVER-171
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git

commit 30dcda9d2240acc0546b2ffcc25982fb7128c729
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon Apr 26 09:08:23 2021 +0200

    [MRESOLVER-171] Resolver fails when compiled on Java 9+ and run on Java 8 due to JDK API breakage
---
 .../aether/connector/basic/ChecksumCalculator.java      |  9 +++++----
 .../aether/internal/impl/DefaultFileProcessor.java      |  9 +++++----
 .../spi/connector/transport/AbstractTransporter.java    | 17 +++++++++--------
 .../aether/internal/test/util/TestFileProcessor.java    |  7 ++++---
 .../transport/classpath/RecordingTransportListener.java |  7 ++++---
 .../transport/file/RecordingTransportListener.java      |  7 ++++---
 .../transport/http/RecordingTransportListener.java      |  7 ++++---
 .../transport/wagon/RecordingTransportListener.java     |  7 ++++---
 8 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java
index e5a1780..068fd75 100644
--- a/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java
+++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.connector.basic;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -165,7 +166,7 @@ final class ChecksumCalculator
                     read -= total - dataOffset;
                 }
                 buffer.rewind();
-                buffer.limit( read );
+                ( (Buffer) buffer ).limit( read );
                 update( buffer );
             }
 
@@ -199,7 +200,7 @@ final class ChecksumCalculator
     {
         for ( Checksum checksum : checksums )
         {
-            data.mark();
+            ( (Buffer) data ).mark();
             checksum.update( data );
             data.reset();
         }
diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java
index 20a13c4..d2b8ecc 100644
--- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java
+++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.internal.impl;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,6 +25,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 
@@ -46,7 +47,7 @@ public class DefaultFileProcessor
      * Thread-safe variant of {@link File#mkdirs()}. Creates the directory named by the given abstract pathname,
      * including any necessary but nonexistent parent directories. Note that if this operation fails it may have
      * succeeded in creating some of the necessary parent directories.
-     * 
+     *
      * @param directory The directory to create, may be {@code null}.
      * @return {@code true} if and only if the directory was created, along with all necessary parent directories;
      *         {@code false} otherwise
@@ -232,7 +233,7 @@ public class DefaultFileProcessor
                 try
                 {
                     buffer.rewind();
-                    buffer.limit( bytes );
+                    ( (Buffer) buffer ).limit( bytes );
                     listener.progressed( buffer );
                 }
                 catch ( Exception e )
diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java
index 21a0da3..f420d0d 100644
--- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java
+++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.spi.connector.transport;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,6 +22,7 @@ package org.eclipse.aether.spi.connector.transport;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -53,7 +54,7 @@ public abstract class AbstractTransporter
 
     /**
      * Implements {@link #peek(PeekTask)}, gets only called if the transporter has not been closed.
-     * 
+     *
      * @param task The existence check to perform, must not be {@code null}.
      * @throws Exception If the existence of the specified resource could not be confirmed.
      */
@@ -69,7 +70,7 @@ public abstract class AbstractTransporter
 
     /**
      * Implements {@link #get(GetTask)}, gets only called if the transporter has not been closed.
-     * 
+     *
      * @param task The download to perform, must not be {@code null}.
      * @throws Exception If the transfer failed.
      */
@@ -80,7 +81,7 @@ public abstract class AbstractTransporter
      * Performs stream-based I/O for the specified download task and notifies the configured transport listener.
      * Subclasses might want to invoke this utility method from within their {@link #implGet(GetTask)} to avoid
      * boilerplate I/O code.
-     * 
+     *
      * @param task The download to perform, must not be {@code null}.
      * @param is The input stream to download the data from, must not be {@code null}.
      * @param close {@code true} if the supplied input stream should be automatically closed, {@code false} to leave the
@@ -149,7 +150,7 @@ public abstract class AbstractTransporter
 
     /**
      * Implements {@link #put(PutTask)}, gets only called if the transporter has not been closed.
-     * 
+     *
      * @param task The upload to perform, must not be {@code null}.
      * @throws Exception If the transfer failed.
      */
@@ -160,7 +161,7 @@ public abstract class AbstractTransporter
      * Performs stream-based I/O for the specified upload task and notifies the configured transport listener.
      * Subclasses might want to invoke this utility method from within their {@link #implPut(PutTask)} to avoid
      * boilerplate I/O code.
-     * 
+     *
      * @param task The upload to perform, must not be {@code null}.
      * @param os The output stream to upload the data to, must not be {@code null}.
      * @param close {@code true} if the supplied output stream should be automatically closed, {@code false} to leave
@@ -252,7 +253,7 @@ public abstract class AbstractTransporter
         {
             os.write( array, 0, read );
             buffer.rewind();
-            buffer.limit( read );
+            ( (Buffer) buffer ).limit( read );
             listener.transportProgressed( buffer );
         }
     }
diff --git a/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java
index 118ef13..6fc36da 100644
--- a/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java
+++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.internal.test.util;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,6 +26,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 
@@ -219,7 +220,7 @@ public class TestFileProcessor
                 try
                 {
                     buffer.rewind();
-                    buffer.limit( bytes );
+                    ( (Buffer) buffer ).limit( bytes );
                     listener.progressed( buffer );
                 }
                 catch ( Exception e )
diff --git a/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java
index 9447d39..8d453b1 100644
--- a/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java
+++ b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.transport.classpath;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,7 @@ package org.eclipse.aether.transport.classpath;
  */
 
 import java.io.ByteArrayOutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 
 import org.eclipse.aether.spi.connector.transport.TransportListener;
@@ -63,7 +64,7 @@ class RecordingTransportListener
         throws TransferCancelledException
     {
         progressedCount++;
-        baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() );
+        baos.write( data.array(), data.arrayOffset() + ( (Buffer) data ).position(), data.remaining() );
         if ( cancelProgress )
         {
             throw new TransferCancelledException();
diff --git a/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java
index c6331e0..76e3585 100644
--- a/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java
+++ b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.transport.file;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,7 @@ package org.eclipse.aether.transport.file;
  */
 
 import java.io.ByteArrayOutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 
 import org.eclipse.aether.spi.connector.transport.TransportListener;
@@ -63,7 +64,7 @@ class RecordingTransportListener
         throws TransferCancelledException
     {
         progressedCount++;
-        baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() );
+        baos.write( data.array(), data.arrayOffset() + ( (Buffer) data ).position(), data.remaining() );
         if ( cancelProgress )
         {
             throw new TransferCancelledException();
diff --git a/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java
index d88a320..e7ca7c9 100644
--- a/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java
+++ b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.transport.http;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,7 @@ package org.eclipse.aether.transport.http;
  */
 
 import java.io.ByteArrayOutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 
 import org.eclipse.aether.spi.connector.transport.TransportListener;
@@ -63,7 +64,7 @@ class RecordingTransportListener
         throws TransferCancelledException
     {
         progressedCount++;
-        baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() );
+        baos.write( data.array(), data.arrayOffset() + ( (Buffer) data ).position(), data.remaining() );
         if ( cancelProgress )
         {
             throw new TransferCancelledException();
diff --git a/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java
index 7f61985..3f1859d 100644
--- a/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java
+++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java
@@ -8,9 +8,9 @@ package org.eclipse.aether.transport.wagon;
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,7 @@ package org.eclipse.aether.transport.wagon;
  */
 
 import java.io.ByteArrayOutputStream;
+import java.nio.Buffer;
 import java.nio.ByteBuffer;
 
 import org.eclipse.aether.spi.connector.transport.TransportListener;
@@ -63,7 +64,7 @@ class RecordingTransportListener
         throws TransferCancelledException
     {
         progressedCount++;
-        baos.write( data.array(), data.arrayOffset() + data.position(), data.remaining() );
+        baos.write( data.array(), data.arrayOffset() + ( (Buffer) data ).position(), data.remaining() );
         if ( cancelProgress )
         {
             throw new TransferCancelledException();