diff --git a/pom.xml b/pom.xml index 3d0e92d..731dd59 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,7 @@ 3.0.0 2.1.0 - 1.9.15 + 1.10.0 2.1.0 4.13.2 @@ -146,12 +146,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.0.0-M6 org.apache.felix maven-bundle-plugin - 5.1.4 + 5.1.5 true @@ -172,7 +172,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.0 org.apache.maven.plugins @@ -187,7 +187,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M5 + 3.0.0-M6 org.apache.maven.plugins diff --git a/saaj-ri/pom.xml b/saaj-ri/pom.xml index 3925f89..8e5ab49 100644 --- a/saaj-ri/pom.xml +++ b/saaj-ri/pom.xml @@ -219,7 +219,7 @@ org.jacoco jacoco-maven-plugin - 0.8.7 + 0.8.8 diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java index 5c7c36a..0a3e3e6 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java @@ -302,7 +302,7 @@ else if (c == '"') { // Check for SPECIAL or CTL if (c < 040 || c >= 0177 || delimiters.indexOf(c) >= 0) { currentPos++; // re-position currentPos - char ch[] = new char[1]; + char[] ch = new char[1]; ch[0] = c; return new Token(c, new String(ch)); } diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/MimeUtility.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/MimeUtility.java index 78e2f8c..d70c176 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/MimeUtility.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/internet/MimeUtility.java @@ -1346,7 +1346,7 @@ static int checkAscii(InputStream is, int max, boolean breakOnNonAscii) { int linelen = 0; boolean longLine = false, badEOL = false; boolean checkEOL = encodeEolStrict && breakOnNonAscii; - byte buf[] = null; + byte[] buf = null; if (max != 0) { block = (max == ALL) ? 4096 : Math.min(max, 4096); buf = new byte[block]; @@ -1446,12 +1446,12 @@ public void write(int b) throws IOException { } @Override - public void write(byte b[]) throws IOException { + public void write(byte[] b) throws IOException { write(b, 0, b.length); } @Override - public void write(byte b[], int off, int len) throws IOException { + public void write(byte[] b, int off, int len) throws IOException { len += off; for (int i = off; i < len ; i++) check(b[i]); diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java index 02040fe..da77c47 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java @@ -120,7 +120,7 @@ public int available() throws IOException { * This character array provides the character to value map * based on RFC1521. */ - private final static char pem_array[] = { + private final static char[] pem_array = { 'A','B','C','D','E','F','G','H', // 0 'I','J','K','L','M','N','O','P', // 1 'Q','R','S','T','U','V','W','X', // 2 @@ -131,7 +131,7 @@ public int available() throws IOException { '4','5','6','7','8','9','+','/' // 7 }; - private final static byte pem_convert_array[] = new byte[256]; + private final static byte[] pem_convert_array = new byte[256]; static { for (int i = 0; i < 255; i++) diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java index c06de9b..2d913a2 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java @@ -120,7 +120,7 @@ public void close() throws IOException { } /** This array maps the characters to their 6 bit values */ - private final static char pem_array[] = { + private final static char[] pem_array = { 'A','B','C','D','E','F','G','H', // 0 'I','J','K','L','M','N','O','P', // 1 'Q','R','S','T','U','V','W','X', // 2 diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/OutputUtil.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/OutputUtil.java index 31d5571..0713366 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/OutputUtil.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/OutputUtil.java @@ -29,9 +29,11 @@ * * @author Kohsuke Kawaguchi */ -public abstract class OutputUtil { +public final class OutputUtil { private static byte[] newline = {'\r','\n'}; + private OutputUtil() {} + public static void writeln(String s,OutputStream out) throws IOException { writeAsAscii(s,out); writeln(out); diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/QPEncoderStream.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/QPEncoderStream.java index 0a231c7..6e5fb8c 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/QPEncoderStream.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/packaging/mime/util/QPEncoderStream.java @@ -148,7 +148,7 @@ private void outputCRLF() throws IOException { } // The encoding table - private final static char hex[] = { + private final static char[] hex = { '0','1', '2', '3', '4', '5', '6', '7', '8','9', 'A', 'B', 'C', 'D', 'E', 'F' }; diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/EnvelopeFactory.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/EnvelopeFactory.java index ed9afa3..df2a022 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/EnvelopeFactory.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/EnvelopeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -41,7 +41,7 @@ * EnvelopeFactory creates SOAP Envelope objects using different * underlying implementations. */ -public class EnvelopeFactory { +public final class EnvelopeFactory { private static final String SAX_PARSER_POOL_SIZE_PROP_NAME = "com.sun.xml.messaging.saaj.soap.saxParserPoolSize"; private static final int DEFAULT_SAX_PARSER_POOL_SIZE = 5; @@ -70,6 +70,8 @@ public Integer run() { } }; + private EnvelopeFactory() {} + public static Envelope createEnvelope(Source src, SOAPPartImpl soapPart) throws SOAPException { diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/FastInfosetDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/FastInfosetDataContentHandler.java index 22eea53..95e7825 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/FastInfosetDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/FastInfosetDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -37,7 +37,7 @@ public FastInfosetDataContentHandler() { */ @Override public ActivationDataFlavor[] getTransferDataFlavors() { // throws Exception; - ActivationDataFlavor flavors[] = new ActivationDataFlavor[1]; + ActivationDataFlavor[] flavors = new ActivationDataFlavor[1]; flavors[0] = new ActivationDataFlavor( FastInfosetReflection.getFastInfosetSource_class(), "application/fastinfoset", "Fast Infoset"); diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/GifDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/GifDataContentHandler.java index cb6d43b..26ea5ee 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/GifDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/GifDataContentHandler.java @@ -31,6 +31,8 @@ public class GifDataContentHandler extends Component implements DataContentHandl "image/gif", "GIF Image"); + public GifDataContentHandler() {} + protected ActivationDataFlavor getDF() { return myDF; } @@ -69,7 +71,7 @@ public Object getContent(DataSource ds) throws IOException { InputStream is = ds.getInputStream(); int pos = 0; int count; - byte buf[] = new byte[1024]; + byte[] buf = new byte[1024]; while ((count = is.read(buf, pos, buf.length - pos)) != -1) { pos += count; @@ -79,7 +81,7 @@ public Object getContent(DataSource ds) throws IOException { size += size; else size += 256*1024; - byte tbuf[] = new byte[size]; + byte[] tbuf = new byte[size]; System.arraycopy(buf, 0, tbuf, 0, pos); buf = tbuf; } diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/JpegDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/JpegDataContentHandler.java index 5fc4197..844c1ee 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/JpegDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/JpegDataContentHandler.java @@ -33,13 +33,15 @@ public class JpegDataContentHandler public static final String STR_SRC = "java.awt.Image"; + public JpegDataContentHandler() {} + /** * Return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ @Override public ActivationDataFlavor[] getTransferDataFlavors() { // throws Exception; - ActivationDataFlavor flavors[] = new ActivationDataFlavor[1]; + ActivationDataFlavor[] flavors = new ActivationDataFlavor[1]; try { flavors[0] = diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/MultipartDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/MultipartDataContentHandler.java index b671db7..c311a9f 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/MultipartDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/MultipartDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -22,6 +22,8 @@ public class MultipartDataContentHandler implements DataContentHandler { "multipart/mixed", "Multipart"); + public MultipartDataContentHandler() {} + /** * Return the DataFlavors for this DataContentHandler. * diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/SOAPFactoryImpl.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/SOAPFactoryImpl.java index 1762d35..010394d 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/SOAPFactoryImpl.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/SOAPFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -32,6 +32,8 @@ public abstract class SOAPFactoryImpl extends SOAPFactory { log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, "com.sun.xml.messaging.saaj.soap.LocalStrings"); + protected SOAPFactoryImpl() {} + protected abstract SOAPDocumentImpl createDocument(); @Override diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/StringDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/StringDataContentHandler.java index c12c9e0..ab73e19 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/StringDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/StringDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -19,16 +19,17 @@ /** * JAF data content handler for text/plain --> String - * */ public class StringDataContentHandler implements DataContentHandler { private static ActivationDataFlavor myDF = new ActivationDataFlavor( - java.lang.String.class, - "text/plain", - "Text String"); + java.lang.String.class, + "text/plain", + "Text String"); + + public StringDataContentHandler() {} protected ActivationDataFlavor getDF() { - return myDF; + return myDF; } /** @@ -38,7 +39,7 @@ protected ActivationDataFlavor getDF() { */ @Override public ActivationDataFlavor[] getTransferDataFlavors() { - return new ActivationDataFlavor[] { getDF() }; + return new ActivationDataFlavor[]{getDF()}; } /** @@ -50,106 +51,108 @@ public ActivationDataFlavor[] getTransferDataFlavors() { */ @Override public Object getTransferData(ActivationDataFlavor df, DataSource ds) - throws IOException { - // use myDF.equals to be sure to get ActivationDataFlavor.equals, - // which properly ignores Content-Type parameters in comparison - if (getDF().equals(df)) - return getContent(ds); - else - return null; + throws IOException { + // use myDF.equals to be sure to get ActivationDataFlavor.equals, + // which properly ignores Content-Type parameters in comparison + if (getDF().equals(df)) + return getContent(ds); + else + return null; } @Override public Object getContent(DataSource ds) throws IOException { - String enc = null; - InputStreamReader is = null; - - try { - enc = getCharset(ds.getContentType()); - is = new InputStreamReader(ds.getInputStream(), enc); - } catch (IllegalArgumentException iex) { - /* - * An unknown charset of the form ISO-XXX-XXX will cause - * the JDK to throw an IllegalArgumentException. The - * JDK will attempt to create a classname using this string, - * but valid classnames must not contain the character '-', - * and this results in an IllegalArgumentException, rather than - * the expected UnsupportedEncodingException. Yikes. - */ - throw new UnsupportedEncodingException(enc); - } - - try { - int pos = 0; - int count; - char buf[] = new char[1024]; - - while ((count = is.read(buf, pos, buf.length - pos)) != -1) { - pos += count; - if (pos >= buf.length) { - int size = buf.length; - if (size < 256*1024) - size += size; - else - size += 256*1024; - char tbuf[] = new char[size]; - System.arraycopy(buf, 0, tbuf, 0, pos); - buf = tbuf; - } - } - return new String(buf, 0, pos); - } finally { - try { - is.close(); - } catch (IOException ex) { } - } + String enc = null; + InputStreamReader is = null; + + try { + enc = getCharset(ds.getContentType()); + is = new InputStreamReader(ds.getInputStream(), enc); + } catch (IllegalArgumentException iex) { + /* + * An unknown charset of the form ISO-XXX-XXX will cause + * the JDK to throw an IllegalArgumentException. The + * JDK will attempt to create a classname using this string, + * but valid classnames must not contain the character '-', + * and this results in an IllegalArgumentException, rather than + * the expected UnsupportedEncodingException. Yikes. + */ + throw new UnsupportedEncodingException(enc); + } + + try { + int pos = 0; + int count; + char[] buf = new char[1024]; + + while ((count = is.read(buf, pos, buf.length - pos)) != -1) { + pos += count; + if (pos >= buf.length) { + int size = buf.length; + if (size < 256 * 1024) { + size += size; + } else { + size += 256 * 1024; + } + char[] tbuf = new char[size]; + System.arraycopy(buf, 0, tbuf, 0, pos); + buf = tbuf; + } + } + return new String(buf, 0, pos); + } finally { + try { + is.close(); + } catch (IOException ex) { + } + } } - + /** * Write the object to the output stream, using the specified MIME type. */ @Override public void writeTo(Object obj, String type, OutputStream os) - throws IOException { - if (!(obj instanceof String)) - throw new IOException("\"" + getDF().getMimeType() + - "\" DataContentHandler requires String object, " + - "was given object of type " + obj.getClass().toString()); - - String enc = null; - OutputStreamWriter osw = null; - - try { - enc = getCharset(type); - osw = new OutputStreamWriter(os, enc); - } catch (IllegalArgumentException iex) { - /* - * An unknown charset of the form ISO-XXX-XXX will cause - * the JDK to throw an IllegalArgumentException. The - * JDK will attempt to create a classname using this string, - * but valid classnames must not contain the character '-', - * and this results in an IllegalArgumentException, rather than - * the expected UnsupportedEncodingException. Yikes. - */ - throw new UnsupportedEncodingException(enc); - } - - String s = (String)obj; - osw.write(s, 0, s.length()); - osw.flush(); + throws IOException { + if (!(obj instanceof String)) + throw new IOException("\"" + getDF().getMimeType() + + "\" DataContentHandler requires String object, " + + "was given object of type " + obj.getClass().toString()); + + String enc = null; + OutputStreamWriter osw = null; + + try { + enc = getCharset(type); + osw = new OutputStreamWriter(os, enc); + } catch (IllegalArgumentException iex) { + /* + * An unknown charset of the form ISO-XXX-XXX will cause + * the JDK to throw an IllegalArgumentException. The + * JDK will attempt to create a classname using this string, + * but valid classnames must not contain the character '-', + * and this results in an IllegalArgumentException, rather than + * the expected UnsupportedEncodingException. Yikes. + */ + throw new UnsupportedEncodingException(enc); + } + + String s = (String) obj; + osw.write(s, 0, s.length()); + osw.flush(); } private String getCharset(String type) { - try { - ContentType ct = new ContentType(type); - String charset = ct.getParameter("charset"); - if (charset == null) - // If the charset parameter is absent, use US-ASCII. - charset = "us-ascii"; - return MimeUtility.javaCharset(charset); - } catch (Exception ex) { - return null; - } + try { + ContentType ct = new ContentType(type); + String charset = ct.getParameter("charset"); + if (charset == null) + // If the charset parameter is absent, use US-ASCII. + charset = "us-ascii"; + return MimeUtility.javaCharset(charset); + } catch (Exception ex) { + return null; + } } } diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/XmlDataContentHandler.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/XmlDataContentHandler.java index d29228b..a21c27e 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/XmlDataContentHandler.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/XmlDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -43,7 +43,7 @@ public XmlDataContentHandler() throws ClassNotFoundException { */ @Override public ActivationDataFlavor[] getTransferDataFlavors() { // throws Exception; - ActivationDataFlavor flavors[] = new ActivationDataFlavor[2]; + ActivationDataFlavor[] flavors = new ActivationDataFlavor[2]; flavors[0] = new ActivationDataFlavor(streamSourceClass, "text/xml", "XML"); diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java index ba650e8..2d84fd7 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java @@ -21,6 +21,9 @@ * @author SAAJ RI Development Team */ public class SOAPFactoryDynamicImpl extends SOAPFactoryImpl { + + public SOAPFactoryDynamicImpl() {} + @Override protected SOAPDocumentImpl createDocument() { return null; diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java index 1890663..ef116d4 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java @@ -16,6 +16,9 @@ import com.sun.xml.messaging.saaj.soap.MessageFactoryImpl; public class SOAPMessageFactoryDynamicImpl extends MessageFactoryImpl { + + public SOAPMessageFactoryDynamicImpl() {} + @Override public SOAPMessage createMessage() throws SOAPException { throw new UnsupportedOperationException( diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementFactory.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementFactory.java index 3d231a2..37b5464 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementFactory.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -34,6 +34,9 @@ public class ElementFactory { + + private ElementFactory() {} + public static SOAPElement createElement( SOAPDocumentImpl ownerDocument, Name name) { diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/Base64.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/Base64.java index 2b41d1f..c2d9e52 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/Base64.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/Base64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -68,6 +68,7 @@ public final class Base64 { } + private Base64() {} static boolean isBase64( byte octect ) { //shall we ignore white space? JEFF?? @@ -96,7 +97,7 @@ public static byte[] encode( byte[] binaryData ) { int lengthDataBits = binaryData.length*EIGHTBIT; int fewerThan24bits = lengthDataBits%TWENTYFOURBITGROUP; int numberTriplets = lengthDataBits/TWENTYFOURBITGROUP; - byte encodedData[] = null; + byte[] encodedData = null; if ( fewerThan24bits != 0 ) //data not divisible by 24 bit @@ -162,7 +163,7 @@ public static byte[] encode( byte[] binaryData ) { */ public byte[] decode( byte[] base64Data ) { int numberQuadruple = base64Data.length/FOURBYTE; - byte decodedData[] = null; + byte[] decodedData = null; byte b1=0,b2=0,b3=0, b4=0, marker0=0, marker1=0; // Throw away anything not in base64Data @@ -206,7 +207,7 @@ public byte[] decode( byte[] base64Data ) { } - static final int base64[]= { + static final int[] base64 = { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63, @@ -226,7 +227,7 @@ public byte[] decode( byte[] base64Data ) { }; public static String base64Decode( String orig ) { - char chars[]=orig.toCharArray(); + char[] chars =orig.toCharArray(); StringBuilder sb=new StringBuilder(); int i=0; diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteInputStream.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteInputStream.java index 07ef6e1..bda2af6 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteInputStream.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -22,11 +22,11 @@ public ByteInputStream() { this(EMPTY_ARRAY, 0); } - public ByteInputStream(byte buf[], int length) { + public ByteInputStream(byte[] buf, int length) { super(buf, 0, length); } - public ByteInputStream(byte buf[], int offset, int length) { + public ByteInputStream(byte[] buf, int offset, int length) { super(buf, offset, length); } diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteOutputStream.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteOutputStream.java index ea220a0..30b16a9 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteOutputStream.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ByteOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -138,7 +138,7 @@ public void reset() { * because this is evil! */ @Deprecated - public byte toByteArray()[] { + public byte[] toByteArray() { byte[] newbuf = new byte[count]; System.arraycopy(buf, 0, newbuf, 0, count); return newbuf; diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/FastInfosetReflection.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/FastInfosetReflection.java index 86daca5..c1839ae 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/FastInfosetReflection.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/FastInfosetReflection.java @@ -24,7 +24,7 @@ * @author Santiago.PericasGeertsen@sun.com * @author Paul.Sandoz@sun.com */ -public class FastInfosetReflection { +public final class FastInfosetReflection { /** * FI DOMDocumentParser constructor using reflection. @@ -112,6 +112,8 @@ public class FastInfosetReflection { } } + private FastInfosetReflection() {} + // -- DOMDocumentParser ---------------------------------------------- public static Object DOMDocumentParser_new() throws Exception { diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/MimeHeadersUtil.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/MimeHeadersUtil.java index ffbea36..7cdac64 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/MimeHeadersUtil.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/MimeHeadersUtil.java @@ -15,7 +15,10 @@ import jakarta.xml.soap.MimeHeader; import jakarta.xml.soap.MimeHeaders; -public class MimeHeadersUtil { +public final class MimeHeadersUtil { + + private MimeHeadersUtil() {} + public static MimeHeaders copy(MimeHeaders headers) { MimeHeaders newHeaders = new MimeHeaders(); Iterator eachHeader = headers.getAllHeaders(); diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ParseUtil.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ParseUtil.java index 9b40663..0730e95 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ParseUtil.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/ParseUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -13,7 +13,10 @@ // Cut&paste from sun.net.www.ParseUtil: decode, unescape -public class ParseUtil { +public final class ParseUtil { + + private ParseUtil() {} + /** * Un-escape and return the character at position i in string s. */ diff --git a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/SAAJUtil.java b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/SAAJUtil.java index bc2034d..8b89b3c 100644 --- a/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/SAAJUtil.java +++ b/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/util/SAAJUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -20,6 +20,8 @@ */ public final class SAAJUtil { + private SAAJUtil() {} + public static boolean getSystemBoolean(String arg) { try { return Boolean.getBoolean(arg); diff --git a/saaj-ri/src/test/java/bugfixes/BugfixesTest.java b/saaj-ri/src/test/java/bugfixes/BugfixesTest.java index b006ddf..bc75d12 100644 --- a/saaj-ri/src/test/java/bugfixes/BugfixesTest.java +++ b/saaj-ri/src/test/java/bugfixes/BugfixesTest.java @@ -1588,11 +1588,11 @@ public ByteInputStream() { this(EMPTY_ARRAY, 0); } - public ByteInputStream(byte buf[], int length) { + public ByteInputStream(byte[] buf, int length) { super(buf, 0, length); } - public ByteInputStream(byte buf[], int offset, int length) { + public ByteInputStream(byte[] buf, int offset, int length) { super(buf, offset, length); } diff --git a/saaj-ri/src/test/java/bugfixes/NamespaceTest.java b/saaj-ri/src/test/java/bugfixes/NamespaceTest.java index c677066..f9f8d76 100644 --- a/saaj-ri/src/test/java/bugfixes/NamespaceTest.java +++ b/saaj-ri/src/test/java/bugfixes/NamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -123,7 +123,7 @@ public void testNamespaceDeclaration() throws Exception { assertTrue(curAttr.getPrefix().length() > 0); } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(NamespaceTest.class); diff --git a/saaj-ri/src/test/java/bugfixes/SAAJConnectionTest.java b/saaj-ri/src/test/java/bugfixes/SAAJConnectionTest.java index 0e50a76..909ee96 100644 --- a/saaj-ri/src/test/java/bugfixes/SAAJConnectionTest.java +++ b/saaj-ri/src/test/java/bugfixes/SAAJConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -96,7 +96,7 @@ public void testSAAJ56() throws Exception { } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(SAAJConnectionTest.class); } diff --git a/saaj-ri/src/test/java/mime/AttachImageTest.java b/saaj-ri/src/test/java/mime/AttachImageTest.java index 7f6a514..bcd4117 100644 --- a/saaj-ri/src/test/java/mime/AttachImageTest.java +++ b/saaj-ri/src/test/java/mime/AttachImageTest.java @@ -353,10 +353,10 @@ public void testSetGetRawContent() throws Exception { public void testSetContentGetRawContent() throws Exception { - byte buf1[] = new byte[30000]; - byte buf2[] = new byte[30000]; - byte buf3[] = new byte[30000]; - byte buf4[] = new byte[30000]; + byte[] buf1 = new byte[30000]; + byte[] buf2 = new byte[30000]; + byte[] buf3 = new byte[30000]; + byte[] buf4 = new byte[30000]; MessageFactory mf = MessageFactory.newInstance(); SOAPMessage msg = mf.createMessage(); @@ -401,10 +401,10 @@ public void testSetContentGetRawContent() throws Exception { public void testSetContentGetRawContent2() throws Exception { - byte buf1[] = new byte[30000]; - byte buf2[] = new byte[30000]; - byte buf3[] = new byte[30000]; - byte buf4[] = new byte[30000]; + byte[] buf1 = new byte[30000]; + byte[] buf2 = new byte[30000]; + byte[] buf3 = new byte[30000]; + byte[] buf4 = new byte[30000]; MessageFactory mf = MessageFactory.newInstance(); SOAPMessage msg = mf.createMessage(); @@ -444,10 +444,10 @@ public void testSetContentGetRawContent2() throws Exception { public void testSetRawContentBytes() throws Exception { - byte buf1[] = new byte[30000]; - byte buf2[] = new byte[30000]; - byte buf3[] = new byte[30000]; - byte buf4[] = new byte[30000]; + byte[] buf1 = new byte[30000]; + byte[] buf2 = new byte[30000]; + byte[] buf3 = new byte[30000]; + byte[] buf4 = new byte[30000]; MessageFactory mf = MessageFactory.newInstance(); SOAPMessage msg = mf.createMessage(); diff --git a/saaj-ri/src/test/java/mime/MimeRecreateTest.java b/saaj-ri/src/test/java/mime/MimeRecreateTest.java index 679bc41..c052869 100644 --- a/saaj-ri/src/test/java/mime/MimeRecreateTest.java +++ b/saaj-ri/src/test/java/mime/MimeRecreateTest.java @@ -123,7 +123,7 @@ public void testMessageRecreation() { } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(MimeRecreateTest.class); diff --git a/saaj-ri/src/test/java/namespace/NSDeclTest.java b/saaj-ri/src/test/java/namespace/NSDeclTest.java index 4bcbdd8..be356e6 100644 --- a/saaj-ri/src/test/java/namespace/NSDeclTest.java +++ b/saaj-ri/src/test/java/namespace/NSDeclTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -164,7 +164,7 @@ public void testGetDocElement() throws Exception { fail("The following value should not be null: " + docElement); } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(NSDeclTest.class); diff --git a/saaj-ri/src/test/java/namespace/NamespaceTest.java b/saaj-ri/src/test/java/namespace/NamespaceTest.java index e719300..168d0c6 100644 --- a/saaj-ri/src/test/java/namespace/NamespaceTest.java +++ b/saaj-ri/src/test/java/namespace/NamespaceTest.java @@ -447,7 +447,7 @@ public void testAddChildElementToNullNamespaceNoDeclarations() throws Exception assertEquals(namespace, childInDefaultNamespace.getNamespaceURI()); } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(NamespaceTest.class); diff --git a/saaj-ri/src/test/java/soap/SourceResetTest.java b/saaj-ri/src/test/java/soap/SourceResetTest.java index 7e8d248..861d15e 100644 --- a/saaj-ri/src/test/java/soap/SourceResetTest.java +++ b/saaj-ri/src/test/java/soap/SourceResetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -21,7 +21,7 @@ public class SourceResetTest extends TestCase { - private String msgText[]; + private String[] msgText; public SourceResetTest(String name) { super(name); diff --git a/saaj-ri/src/test/java/wsi/WSISupportTest.java b/saaj-ri/src/test/java/wsi/WSISupportTest.java index 89ebebb..526c5a1 100644 --- a/saaj-ri/src/test/java/wsi/WSISupportTest.java +++ b/saaj-ri/src/test/java/wsi/WSISupportTest.java @@ -171,7 +171,7 @@ public void testFaultLocale() throws Exception { } - public static void main(String argv[]) { + public static void main(String[] argv) { junit.textui.TestRunner.run(WSISupportTest.class);