Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
log4j.28300
log4j-java8compat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File log4j-java8compat.patch of Package log4j.28300
--- apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java 2022-06-13 15:06:56.430463284 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java 2022-06-13 15:07:08.462485456 +0200 @@ -283,7 +283,7 @@ writeToDestination(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); } } finally { - buf.clear(); + ((Buffer)buf).clear(); } } --- apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ByteBufferDestinationHelper.java 2022-06-13 15:06:56.434463292 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/ByteBufferDestinationHelper.java 2022-06-13 15:07:08.462485456 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.core.layout; +import java.nio.Buffer; import java.nio.ByteBuffer; /** @@ -39,9 +40,9 @@ ByteBuffer destBuff = destination.getByteBuffer(); while (source.remaining() > destBuff.remaining()) { final int originalLimit = source.limit(); - source.limit(Math.min(source.limit(), source.position() + destBuff.remaining())); + ((Buffer)source).limit(Math.min(source.limit(), source.position() + destBuff.remaining())); destBuff.put(source); - source.limit(originalLimit); + ((Buffer)source).limit(originalLimit); destBuff = destination.drain(destBuff); } destBuff.put(source); --- apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/StringBuilderEncoder.java 2022-06-13 15:06:56.434463292 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/StringBuilderEncoder.java 2022-06-13 15:07:08.462485456 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.core.layout; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -84,8 +85,8 @@ threadLocal.set(threadLocalState); } else { ((CharsetEncoder) threadLocalState[0]).reset(); - ((CharBuffer) threadLocalState[1]).clear(); - ((ByteBuffer) threadLocalState[2]).clear(); + ((Buffer) threadLocalState[1]).clear(); + ((Buffer) threadLocalState[2]).clear(); } return threadLocalState; } --- apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/TextEncoderHelper.java 2022-06-13 15:06:56.434463292 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/TextEncoderHelper.java 2022-06-13 15:08:14.334606818 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.core.layout; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; @@ -58,9 +59,9 @@ encodeChunkedText(charsetEncoder, charBuf, byteBuf, text, destination); return; } - charBuf.clear(); + ((Buffer)charBuf).clear(); text.getChars(0, text.length(), charBuf.array(), charBuf.arrayOffset()); - charBuf.limit(text.length()); + ((Buffer)charBuf).limit(text.length()); final CoderResult result = charsetEncoder.encode(charBuf, byteBuf, true); writeEncodedText(charsetEncoder, charBuf, byteBuf, destination, result); } @@ -92,9 +93,9 @@ // be safe. If the byteBuf is an unrelated buffer, the comparison between the buffers should fail despite // destination.getByteBuffer() is not protected with the synchronization on the destination object. if (byteBuf != destination.getByteBuffer()) { - byteBuf.flip(); + ((Buffer)byteBuf).flip(); destination.writeBytes(byteBuf); - byteBuf.clear(); + ((Buffer)byteBuf).clear(); } } @@ -132,11 +133,11 @@ CoderResult result = CoderResult.UNDERFLOW; boolean endOfInput = false; while (!endOfInput && result.isUnderflow()) { - charBuf.clear(); + ((Buffer)charBuf).clear(); final int copied = copy(text, start, charBuf); start += copied; endOfInput = start >= text.length(); - charBuf.flip(); + ((Buffer)charBuf).flip(); result = charsetEncoder.encode(charBuf, byteBuf, endOfInput); } if (endOfInput) { @@ -149,11 +150,11 @@ while (!endOfInput) { result = CoderResult.UNDERFLOW; while (!endOfInput && result.isUnderflow()) { - charBuf.clear(); + ((Buffer)charBuf).clear(); final int copied = copy(text, start, charBuf); start += copied; endOfInput = start >= text.length(); - charBuf.flip(); + ((Buffer)charBuf).flip(); result = charsetEncoder.encode(charBuf, byteBuf, endOfInput); } byteBuf = writeAndEncodeAsMuchAsPossible(charsetEncoder, charBuf, endOfInput, destination, byteBuf, @@ -252,9 +253,9 @@ synchronized (destination) { final ByteBuffer destinationBuffer = destination.getByteBuffer(); if (destinationBuffer != temp) { - temp.flip(); + ((Buffer)temp).flip(); ByteBufferDestinationHelper.writeToUnsynchronized(temp, destination); - temp.clear(); + ((Buffer)temp).clear(); return destination.getByteBuffer(); } else { return destination.drain(destinationBuffer); @@ -277,9 +278,9 @@ throwException(result); } if (temp.remaining() > 0 && temp != destination.getByteBuffer()) { - temp.flip(); + ((Buffer)temp).flip(); ByteBufferDestinationHelper.writeToUnsynchronized(temp, destination); - temp.clear(); + ((Buffer)temp).clear(); } } @@ -295,7 +296,7 @@ final char[] array = destination.array(); final int start = destination.position(); source.getChars(offset, offset + length, array, destination.arrayOffset() + start); - destination.position(start + length); + ((Buffer)destination).position(start + length); return length; } } --- apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java 2022-06-13 15:06:56.438463300 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/FilePasswordProvider.java 2022-06-13 15:07:08.462485456 +0200 @@ -17,6 +17,7 @@ package org.apache.logging.log4j.core.net.ssl; import java.io.IOException; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -69,7 +70,7 @@ final CharBuffer decoded = Charset.defaultCharset().decode(bb); final char[] result = new char[decoded.limit()]; decoded.get(result, 0, result.length); - decoded.rewind(); + ((Buffer)decoded).rewind(); decoded.put(new char[result.length]); // erase decoded CharBuffer return result; } catch (final IOException e) { --- apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java 2022-06-13 15:06:56.446463314 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java 2022-06-13 15:07:08.462485456 +0200 @@ -22,6 +22,7 @@ import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; +import java.nio.Buffer; import java.nio.CharBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -305,7 +306,7 @@ reader.read(buffer); reader.close(); setup.temp.delete(); - buffer.flip(); + ((Buffer)buffer).flip(); final String raw = buffer.toString(); System.out.print(raw); --- apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java 2022-06-13 15:06:56.450463322 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java 2022-06-13 15:07:08.462485456 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.core.layout; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -100,7 +101,7 @@ final Destination destination = new Destination(); layout.encode(event, destination); final ByteBuffer byteBuffer = destination.getByteBuffer(); - byteBuffer.flip(); // set limit to position, position back to zero + ((Buffer)byteBuffer).flip(); // set limit to position, position back to zero assertEquals(expectedStr, new String(byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(), byteBuffer.remaining())); } --- apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SpyByteBufferDestination.java 2022-06-13 15:06:56.450463322 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/SpyByteBufferDestination.java 2022-06-13 15:07:08.462485456 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.core.layout; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -54,10 +55,10 @@ @Override public ByteBuffer drain(final ByteBuffer buf) { - buf.flip(); + ((Buffer)buf).flip(); drainPoints.add(new Data(buf.position(), buf.limit())); drained.put(buf); - buf.clear(); + ((Buffer)buf).clear(); return buf; } --- apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java 2022-06-13 15:06:56.454463328 +0200 +++ apache-log4j-2.17.2-src/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java 2022-06-13 15:07:08.462485456 +0200 @@ -23,6 +23,7 @@ import org.apache.logging.log4j.core.layout.SerializedLayout; import java.io.Serializable; +import java.nio.Buffer; import java.nio.ByteBuffer; /** @@ -75,14 +76,14 @@ final Destination content = new Destination(); content.byteBuffer.put(layout.getHeader()); layout.encode(event, content); - content.getByteBuffer().flip(); + ((Buffer)(content.getByteBuffer()).flip(); final byte[] record = new byte[content.getByteBuffer().remaining()]; content.getByteBuffer().get(record); data.add(record); } else { final Destination content = new Destination(); layout.encode(event, content); - content.getByteBuffer().flip(); + ((Buffer)(content.getByteBuffer()).flip(); final byte[] record = new byte[content.getByteBuffer().remaining()]; content.getByteBuffer().get(record); write(record); --- apache-log4j-2.17.2-src/log4j-core-its/src/test/java/org/apache/logging/log4j/PerformanceComparison.java 2022-06-13 15:06:56.466463351 +0200 +++ apache-log4j-2.17.2-src/log4j-core-its/src/test/java/org/apache/logging/log4j/PerformanceComparison.java 2022-06-13 15:07:08.462485456 +0200 @@ -22,6 +22,7 @@ import java.io.FileWriter; import java.io.OutputStream; import java.io.Writer; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @@ -190,9 +191,9 @@ } private ByteBuffer getByteBuffer(final ByteBuffer buf, final String s) { - buf.clear(); + ((Buffer)buf).clear(); buf.put(s.getBytes()); - buf.flip(); + ((Buffer)buf).flip(); return buf; } --- apache-log4j-2.17.2-src/log4j-core-its/src/test/java/org/apache/logging/log4j/PerformanceRun.java 2022-06-13 15:06:56.466463351 +0200 +++ apache-log4j-2.17.2-src/log4j-core-its/src/test/java/org/apache/logging/log4j/PerformanceRun.java 2022-06-13 15:07:08.462485456 +0200 @@ -21,6 +21,7 @@ import java.io.FileWriter; import java.io.OutputStream; import java.io.Writer; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @@ -123,9 +124,9 @@ } private ByteBuffer getByteBuffer(final ByteBuffer buf, final String s) { - buf.clear(); + ((Buffer)buf).clear(); buf.put(s.getBytes()); - buf.flip(); + ((Buffer)buf).flip(); return buf; } --- apache-log4j-2.17.2-src/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java 2022-06-13 15:06:56.466463351 +0200 +++ apache-log4j-2.17.2-src/log4j-iostreams/src/main/java/org/apache/logging/log4j/io/ByteStreamLogger.java 2022-06-13 15:07:08.462485456 +0200 @@ -20,6 +20,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; @@ -36,7 +37,7 @@ @Override public int read() throws IOException { - ByteStreamLogger.this.buf.flip(); + ((Buffer)(ByteStreamLogger.this.buf)).flip(); int result = -1; if (ByteStreamLogger.this.buf.limit() > 0) { result = ByteStreamLogger.this.buf.get() & 0xFF; @@ -47,7 +48,7 @@ @Override public int read(final byte[] bytes, final int off, final int len) throws IOException { - ByteStreamLogger.this.buf.flip(); + ((Buffer)(ByteStreamLogger.this.buf)).flip(); int result = -1; if (ByteStreamLogger.this.buf.limit() > 0) { result = Math.min(len, ByteStreamLogger.this.buf.limit()); --- apache-log4j-2.17.2-src/log4j-layout-template-json/src/test/java/org/apache/logging/log4j/layout/template/json/BlackHoleByteBufferDestination.java 2022-06-13 15:06:56.478463373 +0200 +++ apache-log4j-2.17.2-src/log4j-layout-template-json/src/test/java/org/apache/logging/log4j/layout/template/json/BlackHoleByteBufferDestination.java 2022-06-13 15:07:08.462485456 +0200 @@ -18,6 +18,7 @@ import org.apache.logging.log4j.core.layout.ByteBufferDestination; +import java.nio.Buffer; import java.nio.ByteBuffer; class BlackHoleByteBufferDestination implements ByteBufferDestination { @@ -35,13 +36,13 @@ @Override public ByteBuffer drain(final ByteBuffer byteBuffer) { - byteBuffer.clear(); + ((Buffer)byteBuffer).clear(); return byteBuffer; } @Override public void writeBytes(final ByteBuffer byteBuffer) { - byteBuffer.clear(); + ((Buffer)byteBuffer).clear(); } @Override --- apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmark.java 2022-06-13 15:06:56.482463380 +0200 +++ apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/layout/template/json/JsonTemplateLayoutBenchmark.java 2022-06-13 15:07:08.466485463 +0200 @@ -21,6 +21,7 @@ import org.apache.logging.log4j.core.layout.ByteBufferDestination; import org.openjdk.jmh.annotations.Benchmark; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.List; @@ -178,7 +179,7 @@ } final ByteBuffer byteBuffer = destination.getByteBuffer(); final int position = byteBuffer.position(); - byteBuffer.clear(); + ((Buffer)byteBuffer).clear(); return position; } --- apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java 2022-06-13 15:06:56.482463380 +0200 +++ apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java 2022-06-13 15:07:08.466485463 +0200 @@ -17,6 +17,7 @@ package org.apache.logging.log4j.perf.jmh; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.concurrent.TimeUnit; @@ -255,9 +256,9 @@ @Override public ByteBuffer drain(final ByteBuffer buf) { - buf.flip(); + ((Buffer)buf).flip(); consume(buf.array(), buf.arrayOffset() + buf.position(), buf.arrayOffset() + buf.limit()); - buf.clear(); + ((Buffer)buf).clear(); return buf; } @@ -272,7 +273,7 @@ } public void reset() { - buffer.clear(); + ((Buffer)buffer).clear(); } } --- apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java 2022-06-13 15:06:56.482463380 +0200 +++ apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java 2022-06-13 15:07:08.466485463 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.perf.jmh; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -76,9 +77,9 @@ @Override public ByteBuffer drain(final ByteBuffer buf) { - buf.flip(); + ((Buffer)buf).flip(); count += buf.limit(); - buf.clear(); + ((Buffer)buf).clear(); return buf; } @@ -194,7 +195,7 @@ final char[] array = destination.array(); final int start = destination.position(); source.getChars(offset, offset + length, array, destination.arrayOffset() + start); - destination.position(start + length); + ((Buffer)destination).position(start + length); return length; } --- apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/nogc/DemoAppender.java 2022-06-13 15:06:56.482463380 +0200 +++ apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/nogc/DemoAppender.java 2022-06-13 15:07:08.466485463 +0200 @@ -16,6 +16,7 @@ */ package org.apache.logging.log4j.perf.nogc; +import java.nio.Buffer; import java.nio.ByteBuffer; import org.apache.logging.log4j.core.Layout; @@ -65,9 +66,9 @@ @Override public ByteBuffer drain(final ByteBuffer buf) { - buf.flip(); + ((Buffer)buf).flip(); consume(buf.array(), buf.arrayOffset() + buf.position(), buf.arrayOffset() + buf.limit()); - buf.clear(); + ((Buffer)buf).clear(); return buf; } --- apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/DemoAppender.java 2022-06-13 15:06:56.482463380 +0200 +++ apache-log4j-2.17.2-src/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/DemoAppender.java 2022-06-13 15:07:08.466485463 +0200 @@ -24,6 +24,7 @@ import org.apache.logging.log4j.core.layout.ByteBufferDestinationHelper; import org.apache.logging.log4j.core.util.Constants; +import java.nio.Buffer; import java.nio.ByteBuffer; /** @@ -56,9 +57,9 @@ @Override public ByteBuffer drain(final ByteBuffer buf) { - buf.flip(); + ((Buffer)buf).flip(); consume(buf.array(), buf.position(), buf.limit()); - buf.clear(); + ((Buffer)buf).clear(); return buf; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor