You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/01/03 17:38:34 UTC

[cxf] 04/06: Some javadoc fixes

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

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit c616e1cfe0f1f132e1c0edac95d62ba88c27b089
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jan 3 15:36:01 2020 +0000

    Some javadoc fixes
    
    (cherry picked from commit 61aeaff2d747379c64cdad40f82cf51e3bfaecf6)
    
    # Conflicts:
    #	tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
---
 .../cxf/attachment/AttachmentDeserializer.java     | 18 +++++-----
 .../org/apache/cxf/jaxrs/impl/UriBuilderImpl.java  | 21 ++++++-----
 .../org/apache/cxf/jaxrs/utils/JAXRSUtils.java     | 41 +++++++++++-----------
 .../apache/cxf/transport/servlet/CXFServlet.java   | 12 +++----
 .../apache/cxf/transport/jms/JMSConfiguration.java | 10 +++---
 .../apache/cxf/transport/jms/uri/JMSEndpoint.java  | 11 +++---
 .../org/apache/cxf/transport/jms/util/JMSUtil.java |  6 ++--
 .../internal/SpringServiceBuilderFactory.java      |  6 ++--
 8 files changed, 61 insertions(+), 64 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
index aaa299d..97a6e86 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
@@ -269,29 +269,29 @@ public class AttachmentDeserializer {
      * @param boundary
      * @throws IOException
      */
-    private static boolean readTillFirstBoundary(PushbackInputStream pbs, byte[] bp) throws IOException {
+    private static boolean readTillFirstBoundary(PushbackInputStream pushbackInStream, byte[] boundary) throws IOException {
 
         // work around a bug in PushBackInputStream where the buffer isn't
         // initialized
         // and available always returns 0.
-        int value = pbs.read();
-        pbs.unread(value);
+        int value = pushbackInStream.read();
+        pushbackInStream.unread(value);
         while (value != -1) {
-            value = pbs.read();
-            if ((byte) value == bp[0]) {
+            value = pushbackInStream.read();
+            if ((byte) value == boundary[0]) {
                 int boundaryIndex = 0;
-                while (value != -1 && (boundaryIndex < bp.length) && ((byte) value == bp[boundaryIndex])) {
+                while (value != -1 && (boundaryIndex < boundary.length) && ((byte) value == boundary[boundaryIndex])) {
 
-                    value = pbs.read();
+                    value = pushbackInStream.read();
                     if (value == -1) {
                         throw new IOException("Unexpected End while searching for first Mime Boundary");
                     }
                     boundaryIndex++;
                 }
-                if (boundaryIndex == bp.length) {
+                if (boundaryIndex == boundary.length) {
                     // boundary found, read the newline
                     if (value == 13) {
-                        pbs.read();
+                        pushbackInStream.read();
                     }
                     return true;
                 }
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
index d95bdbf..8de34fb 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
@@ -47,7 +47,7 @@ import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 
 public class UriBuilderImpl extends UriBuilder implements Cloneable {
     private static final String EXPAND_QUERY_VALUE_AS_COLLECTION = "expand.query.value.as.collection";
-    
+
     private String scheme;
     private String userInfo;
     private int port = -1;
@@ -63,9 +63,9 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
     private Map<String, Object> resolvedTemplates;
     private Map<String, Object> resolvedTemplatesPathEnc;
     private Map<String, Object> resolvedEncodedTemplates;
-    
+
     private boolean queryValueIsCollection;
-    
+
     /**
      * Creates builder with empty URI.
      */
@@ -846,7 +846,6 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
      *
      * @param map query or matrix multivalued map
      * @param separator params separator, '&' for query ';' for matrix
-     * @param fromEncoded if true then values will be decoded
      * @return stringified params.
      */
     private String buildParams(MultivaluedMap<String, String> map, char separator) {
@@ -854,14 +853,14 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
         StringBuilder b = new StringBuilder();
         for (Iterator<Map.Entry<String, List<String>>> it = map.entrySet().iterator(); it.hasNext();) {
             Map.Entry<String, List<String>> entry = it.next();
-            
-            // Expand query parameter as "name=v1,v2,v3" 
+
+            // Expand query parameter as "name=v1,v2,v3"
             if (isQuery && queryValueIsCollection) {
                 b.append(entry.getKey()).append('=');
-                
+
                 for (Iterator<String> sit = entry.getValue().iterator(); sit.hasNext();) {
                     String val = sit.next();
-                    
+
                     if (val != null) {
                         boolean templateValue = val.startsWith("{") && val.endsWith("}");
                         if (!templateValue) {
@@ -872,7 +871,7 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
                         } else {
                             val = URITemplate.createExactTemplate(val).encodeLiteralCharacters(isQuery);
                         }
-                        
+
                         if (!val.isEmpty()) {
                             b.append(val);
                         }
@@ -881,12 +880,12 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
                         b.append(',');
                     }
                 }
-                
+
                 if (it.hasNext()) {
                     b.append(separator);
                 }
             } else {
-                // Expand query parameter as "name=v1&name=v2&name=v3", or use dedicated 
+                // Expand query parameter as "name=v1&name=v2&name=v3", or use dedicated
                 // separator for matrix parameters
                 for (Iterator<String> sit = entry.getValue().iterator(); sit.hasNext();) {
                     String val = sit.next();
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
index 7a16df5..9e6154c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
@@ -181,12 +181,12 @@ public final class JAXRSUtils {
 
     public static List<PathSegment> getPathSegments(String thePath, boolean decode,
                                                     boolean ignoreLastSlash) {
-        List<PathSegment> theList = 
+        List<PathSegment> theList =
             Arrays.asList(thePath.split("/")).stream()
             .filter(StringUtils.notEmpty())
             .map(p -> new PathSegmentImpl(p, decode))
             .collect(Collectors.toList());
-        
+
         int len = thePath.length();
         if (len > 0 && thePath.charAt(len - 1) == '/') {
             String value = ignoreLastSlash ? "" : "/";
@@ -401,7 +401,7 @@ public final class JAXRSUtils {
             LOG.fine(() -> new org.apache.cxf.common.i18n.Message("START_OPER_MATCH",
                                                                   BUNDLE,
                                                                   resource.getServiceClass().getName()).toString());
-            
+
             for (OperationResourceInfo ori : resource.getMethodDispatcher().getOperationResourceInfos()) {
                 boolean added = false;
 
@@ -515,8 +515,8 @@ public final class JAXRSUtils {
 
     }
 
-    
-    
+
+
     public static Level getExceptionLogLevel(Message message, Class<? extends WebApplicationException> exClass) {
         Level logLevel = null;
         Object logLevelProp = message.get(exClass.getName() + ".log.level");
@@ -585,7 +585,7 @@ public final class JAXRSUtils {
     private static Supplier<String> matchMessageLogSupplier(OperationResourceInfo ori,
         String path, String httpMethod, MediaType requestType, List<MediaType> acceptContentTypes,
         boolean added) {
-        org.apache.cxf.common.i18n.Message errorMsg = added 
+        org.apache.cxf.common.i18n.Message errorMsg = added
             ? new org.apache.cxf.common.i18n.Message("OPER_SELECTED_POSSIBLY",
                                                    BUNDLE, ori.getMethodToInvoke().getName())
             : new org.apache.cxf.common.i18n.Message("OPER_NO_MATCH",
@@ -649,7 +649,7 @@ public final class JAXRSUtils {
     public static List<MediaType> getConsumeTypes(Consumes cm) {
         return getConsumeTypes(cm, Collections.singletonList(ALL_TYPES));
     }
- 
+
     public static List<MediaType> getConsumeTypes(Consumes cm, List<MediaType> defaultTypes) {
         return cm == null ? defaultTypes
                           : getMediaTypes(cm.value());
@@ -658,7 +658,7 @@ public final class JAXRSUtils {
     public static List<MediaType> getProduceTypes(Produces pm) {
         return getProduceTypes(pm, Collections.singletonList(ALL_TYPES));
     }
- 
+
     public static List<MediaType> getProduceTypes(Produces pm, List<MediaType> defaultTypes) {
         return pm == null ? defaultTypes
                           : getMediaTypes(pm.value());
@@ -714,13 +714,13 @@ public final class JAXRSUtils {
         }
         return size1 == size2 ? 0 : size1 < size2 ? -1 : 1;
     }
-    
+
     public static int compareMethodParameters(Class<?>[] paraList1, Class<?>[] paraList2) {
         int size1 = paraList1.length;
         int size2 = paraList2.length;
         for (int i = 0; i < size1 && i < size2; i++) {
             if (!paraList1[i].equals(paraList2[i])) {
-                // Handling the case when bridge / synthetic methods may be taken 
+                // Handling the case when bridge / synthetic methods may be taken
                 // into account (f.e. when service implements generic interfaces or
                 // extends the generic classes).
                 if (paraList1[i].isAssignableFrom(paraList2[i])) {
@@ -818,7 +818,7 @@ public final class JAXRSUtils {
                 tuple[i].param = parameterTypes[i];
                 tuple[i].genericParam = InjectionUtils.processGenericTypeIfNeeded(
                     ori.getClassResourceInfo().getServiceClass(), tuple[i].param, genericParameterTypes[i]);
-                tuple[i].param = InjectionUtils.updateParamClassToTypeIfNeeded(tuple[i].param, 
+                tuple[i].param = InjectionUtils.updateParamClassToTypeIfNeeded(tuple[i].param,
                                                                                tuple[i].genericParam);
                 tuple[i].paramAnns = anns == null ? EMPTY_ANNOTATIONS : anns[i];
             } else {
@@ -827,8 +827,8 @@ public final class JAXRSUtils {
                 tuple[i].paramAnns = EMPTY_ANNOTATIONS;
             }
             if (paramsInfo.get(i).getType() == ParameterType.REQUEST_BODY) {
-                params[i] = processRequestBodyParameter(tuple[i].param, 
-                                                        tuple[i].genericParam, 
+                params[i] = processRequestBodyParameter(tuple[i].param,
+                                                        tuple[i].genericParam,
                                                         tuple[i].paramAnns,
                                                         message,
                                                         ori);
@@ -1219,7 +1219,7 @@ public final class JAXRSUtils {
         return createContextValue(m, genericType, clazz);
     }
 
-    
+
     //CHECKSTYLE:OFF
     private static Object readFromUriParam(Message m,
                                            String parameterName,
@@ -1436,7 +1436,7 @@ public final class JAXRSUtils {
             //cache the OutputStream when it's reactive response
             entityStream = new CacheAndWriteOutputStream(entityStream);
         }
-            
+
         if (writers.size() > 1) {
             WriterInterceptor first = writers.remove(0);
             WriterInterceptorContext context = new WriterInterceptorContextImpl(entity,
@@ -1520,8 +1520,9 @@ public final class JAXRSUtils {
     /**
      * intersect two mime types
      *
-     * @param mimeTypesA
-     * @param mimeTypesB
+     * @param requiredMediaTypes
+     * @param userMediaTypes
+     * @param addRequiredParamsIfPossible
      * @return return a list of intersected mime types
      */
     public static List<MediaType> intersectMimeTypes(List<MediaType> requiredMediaTypes,
@@ -1573,7 +1574,7 @@ public final class JAXRSUtils {
     }
 
     private static String stripDoubleQuotesIfNeeded(String value) {
-        if (value != null && value.startsWith("\"") 
+        if (value != null && value.startsWith("\"")
             && value.endsWith("\"") && value.length() > 1) {
             value = value.substring(1,  value.length() - 1);
         }
@@ -1789,7 +1790,7 @@ public final class JAXRSUtils {
     public static ResponseBuilder fromResponse(Response response) {
         return fromResponse(response, true);
     }
-    
+
     public static ResponseBuilder fromResponse(Response response, boolean copyEntity) {
         ResponseBuilder rb = toResponseBuilder(response.getStatus());
         if (copyEntity) {
@@ -1856,7 +1857,7 @@ public final class JAXRSUtils {
         stack.push(new MethodInvocationInfo(ori, realClass, values));
     }
 
-    private static void addTemplateVarValues(List<String> values, 
+    private static void addTemplateVarValues(List<String> values,
                                              MultivaluedMap<String, String> params,
                                              URITemplate template) {
         if (template != null) {
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
index 610fe20..74c950c 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
@@ -88,16 +88,16 @@ public class CXFServlet extends CXFNonSpringServlet
 
     protected void addListener(AbstractApplicationContext wac) {
         /**
-         * The change in the way application listeners are maintained during the context refresh 
+         * The change in the way application listeners are maintained during the context refresh
          * since Spring Framework 5.1.5 (https://github.com/spring-projects/spring-framework/issues/22325). The
          * CXF adds listener **after** the context has been refreshed, not much control we have over it, but
-         * it does matter now: the listeners registered after the context refresh disappear when 
+         * it does matter now: the listeners registered after the context refresh disappear when
          * context is refreshed. The ugly hack here, to stay in the loop, is to add CXF servlet
          * to "earlyApplicationListeners" set, only than it will be kept between refreshes.
          */
         try {
             final Field f = ReflectionUtils.findField(wac.getClass(), "earlyApplicationListeners");
-            
+
             if (f != null) {
                 Collection<Object> c = CastUtils.cast((Collection<?>)ReflectionUtil.setAccessible(f).get(wac));
                 if (c != null) {
@@ -107,7 +107,7 @@ public class CXFServlet extends CXFNonSpringServlet
         } catch (SecurityException | IllegalAccessException e) {
             //ignore.
         }
-        
+
         try {
             //spring 2 vs spring 3 return type is different
             Method m = wac.getClass().getMethod("getApplicationListeners");
@@ -125,8 +125,8 @@ public class CXFServlet extends CXFNonSpringServlet
      * If that does not work then the location is given as is to spring
      *
      * @param ctx
-     * @param sc
-     * @param configLocation
+     * @param servletConfig
+     * @param location
      * @return
      */
     private ApplicationContext createSpringContext(ApplicationContext ctx,
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
index 31a53b7..a1034ba 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
@@ -79,7 +79,7 @@ public class JMSConfiguration {
      */
     private String replyToDestination;
     private volatile Destination replyToDestinationDest;
-    
+
     private String messageType = JMSConstants.TEXT_MESSAGE_TYPE;
     private boolean pubSubDomain;
     private boolean replyPubSubDomain;
@@ -380,9 +380,7 @@ public class JMSConfiguration {
     /**
      * Retrieve connection factory from JNDI
      *
-     * @param jmsConfig
-     * @param jndiConfig
-     * @return
+     * @return the connection factory from JNDI
      */
     private ConnectionFactory getConnectionFactoryFromJndi() {
         if (getJndiEnvironment() == null || getConnectionFactoryName() == null) {
@@ -488,7 +486,7 @@ public class JMSConfiguration {
             ? session.createTemporaryQueue()
             : destinationResolver.resolveDestinationName(session, replyDestination, replyPubSubDomain);
     }
-    
+
     public void resetCachedReplyDestination() {
         synchronized (this) {
             this.replyDestinationDest = null;
@@ -518,7 +516,7 @@ public class JMSConfiguration {
     public int getRetryInterval() {
         return this.retryInterval;
     }
-    
+
     public void setRetryInterval(int retryInterval) {
         this.retryInterval = retryInterval;
     }
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
index eaf810b..6c55c6e 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
@@ -92,8 +92,7 @@ public class JMSEndpoint {
     private boolean ignoreTimeoutException;
 
     /**
-     * @param uri
-     * @param subject
+     * @param endpointUri
      */
     public JMSEndpoint(String endpointUri) {
         this(null, endpointUri);
@@ -102,6 +101,7 @@ public class JMSEndpoint {
     /**
      * Get the extensors from the wsdl and/or configuration that will
      * then be used to configure the JMSConfiguration object
+     * @param endpointUri
      * @param target
      */
     public JMSEndpoint(EndpointInfo endpointInfo, EndpointReferenceType target) {
@@ -109,8 +109,8 @@ public class JMSEndpoint {
     }
 
     /**
-     * @param uri
-     * @param subject
+     * @param ei
+     * @param endpointUri
      */
     public JMSEndpoint(EndpointInfo ei, String endpointUri) {
         this.jmsVariant = JMSEndpoint.QUEUE;
@@ -174,7 +174,6 @@ public class JMSEndpoint {
      * depending on the prefix of the key. If it matches JNDI_PARAMETER_NAME_PREFIX it is stored in the
      * jndiParameters else in the parameters
      *
-     * @param endpoint
      * @param params
      */
     private void configureProperties(Map<String, Object> params) {
@@ -239,7 +238,7 @@ public class JMSEndpoint {
     }
 
     /**
-     * @param targetserviceParameterName
+     * @param key
      * @return
      */
     public String getParameter(String key) {
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/JMSUtil.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/JMSUtil.java
index 6f0d97e..9ce6cf1 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/JMSUtil.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/JMSUtil.java
@@ -35,7 +35,7 @@ import org.apache.cxf.message.Exchange;
 import org.apache.cxf.transport.jms.JMSConstants;
 
 public final class JMSUtil {
-    
+
     public static final String JMS_MESSAGE_CONSUMER = "jms_message_consumer";
     public static final String JMS_IGNORE_TIMEOUT = "jms_ignore_timeout";
     private static final char[] CORRELATTION_ID_PADDING = {
@@ -64,7 +64,7 @@ public final class JMSUtil {
             throw convertJmsException(e);
         }
     }
-    
+
     public static Message receive(Session session,
                                   Destination replyToDestination,
                                   String correlationId,
@@ -112,7 +112,7 @@ public final class JMSUtil {
      * @param payload the message payload, expected to be either of type String or byte[] depending on payload
      *            type
      * @param session the JMS session
-     * @param replyTo the ReplyTo destination if any
+     * @param messageType the JMS message type
      * @return a JMS of the appropriate type populated with the given payload
      */
     public static Message createAndSetPayload(Object payload, Session session, String messageType)
diff --git a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
index 41814a3..6896aa5 100644
--- a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
+++ b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
@@ -64,8 +64,8 @@ public final class SpringServiceBuilderFactory extends ServiceBuilderFactory {
      * @param databindingName
      * @return
      */
-    public static String databindingNameToBeanName(String dbName) {
-        return NameUtil.capitalize(dbName.toLowerCase()) + ToolConstants.DATABIND_BEAN_NAME_SUFFIX;
+    public static String databindingNameToBeanName(String databindingName) {
+        return NameUtil.capitalize(databindingName.toLowerCase()) + ToolConstants.DATABIND_BEAN_NAME_SUFFIX;
     }
 
     @Override
@@ -110,7 +110,7 @@ public final class SpringServiceBuilderFactory extends ServiceBuilderFactory {
     /**
      * This is factored out to permit use in a unit test.
      *
-     * @param bus
+     * @param additionalFilePathnames
      * @return
      */
     public static ApplicationContext getApplicationContext(List<String> additionalFilePathnames) {