This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 38582fb Fixing a few issues with unused ctr parameters
38582fb is described below
commit 38582fbab7ca33b1383715f1f5094b9b46a0303f
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Wed Mar 13 12:37:31 2019 +0000
Fixing a few issues with unused ctr parameters
---
.../AbstractManagedConnectionImpl.java | 1 +
.../cxf/binding/corba/CorbaServerConduit.java | 5 +---
.../org/apache/cxf/jaxrs/JAXRSServiceImpl.java | 2 +-
.../cxf/jaxrs/ext/multipart/MultipartBody.java | 32 +++++++++-------------
.../apache/cxf/jaxrs/model/ClassResourceInfo.java | 4 +--
.../cxf/service/factory/ServerFactoryTest.java | 6 ++--
.../jaxrs/client/JAXRSClientFactoryBeanTest.java | 8 ++----
.../oauth2/client/HttpRequestProperties.java | 1 +
.../oauth2/provider/JCacheOAuthDataProvider.java | 2 +-
.../systest/jaxrs/CustomOutFaultInterceptor.java | 7 +----
.../cxf/systest/jaxrs/JAXRSLocalTransportTest.java | 5 ----
.../cxf/systest/jaxrs/JAXRSSoapBookTest.java | 17 +-----------
12 files changed, 27 insertions(+), 63 deletions(-)
diff --git
a/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java
b/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java
index 6f8933f..58382a0 100644
---
a/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java
+++
b/integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/AbstractManagedConnectionImpl.java
@@ -50,6 +50,7 @@ public abstract class AbstractManagedConnectionImpl
implements ManagedConnection
this.managedConnectionFactory = managedFactory;
this.crinfo = crInfo;
+ this.subject = sj;
}
diff --git
a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
index 69308e8..cfae928 100644
---
a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
+++
b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
@@ -67,7 +67,7 @@ public class CorbaServerConduit implements Conduit {
public void prepare(Message message) throws IOException {
message.put(CorbaConstants.ORB, orb);
message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject);
- message.setContent(OutputStream.class, new CorbaOutputStream(message));
+ message.setContent(OutputStream.class, new CorbaOutputStream());
if (message instanceof CorbaMessage) {
((CorbaMessage) message).setCorbaTypeMap(typeMap);
}
@@ -154,9 +154,6 @@ public class CorbaServerConduit implements Conduit {
private class CorbaOutputStream extends CachedOutputStream {
- CorbaOutputStream(Message m) {
- }
-
/**
* Perform any actions required on stream flush (freeze headers, reset
* output stream ... etc.)
diff --git
a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceImpl.java
index 6866b3a..bac4d2c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceImpl.java
@@ -82,7 +82,7 @@ public class JAXRSServiceImpl extends
AbstractAttributedInterceptorProvider impl
public JAXRSServiceImpl(List<ClassResourceInfo> cri, boolean create) {
this(cri, null);
- createServiceModel = true;
+ createServiceModel = create;
}
public void setCreateServiceModel(boolean create) {
diff --git
a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
index 01a51d7..017f00e 100644
---
a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
+++
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
@@ -19,6 +19,7 @@
package org.apache.cxf.jaxrs.ext.multipart;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import javax.ws.rs.core.MediaType;
@@ -34,44 +35,37 @@ public class MultipartBody {
private List<Attachment> atts;
private MediaType mt;
- public MultipartBody(List<Attachment> atts, MediaType mt, boolean
outbound) {
- this.atts = atts;
- this.mt = mt == null ? MULTIPART_RELATED_TYPE : mt;
- }
-
- public MultipartBody(List<Attachment> atts, boolean outbound) {
- this(atts, MULTIPART_RELATED_TYPE, outbound);
- }
-
public MultipartBody(Attachment att) {
- atts = new ArrayList<>();
- atts.add(att);
- this.mt = MULTIPART_RELATED_TYPE;
+ this(Collections.singletonList(att));
}
public MultipartBody(List<Attachment> atts) {
- this(atts, MULTIPART_RELATED_TYPE, false);
+ this(atts, false);
+ }
+
+ public MultipartBody(List<Attachment> atts, boolean outbound) {
+ this(atts, MULTIPART_RELATED_TYPE, outbound);
}
public MultipartBody(boolean outbound) {
this(new ArrayList<>(), MULTIPART_RELATED_TYPE, outbound);
}
+ public MultipartBody(List<Attachment> atts, MediaType mt, boolean
outbound) {
+ this.atts = atts;
+ this.mt = mt == null ? MULTIPART_RELATED_TYPE : mt;
+ }
+
public MediaType getType() {
return mt;
}
public List<Attachment> getAllAttachments() {
-
return atts;
}
public List<Attachment> getChildAttachments() {
- List<Attachment> childAtts = new ArrayList<>();
- for (int i = 1; i < atts.size(); i++) {
- childAtts.add(atts.get(i));
- }
- return childAtts;
+ return atts.subList(1, atts.size());
}
public Attachment getRootAttachment() {
diff --git
a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
index b14f15c..bc827da 100644
---
a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
+++
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
@@ -97,11 +97,11 @@ public class ClassResourceInfo extends BeanResourceInfo {
this.createdFromModel = createdFromModel;
}
//CHECKSTYLE:OFF
- public ClassResourceInfo(Class<?> theResourceClass, Class<?> c,
+ public ClassResourceInfo(Class<?> theResourceClass, Class<?>
theServiceClass,
boolean theRoot, boolean enableStatic, boolean
createdFromModel,
String consumesTypes, String producesTypes, Bus
bus) {
//CHECKSTYLE:ON
- this(theResourceClass, theResourceClass, theRoot, enableStatic,
createdFromModel, bus);
+ this(theResourceClass, theServiceClass, theRoot, enableStatic,
createdFromModel, bus);
this.consumesTypes = consumesTypes;
this.producesTypes = producesTypes;
}
diff --git
a/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
b/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
index 92c92a0..2a7259c 100644
---
a/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
+++
b/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ServerFactoryTest.java
@@ -53,7 +53,7 @@ public class ServerFactoryTest extends
AbstractSimpleFrontendTest {
svrBean.setServiceClass(HelloService.class);
svrBean.setServiceBean(new HelloServiceImpl());
svrBean.setBus(getBus());
- svrBean.setDestinationFactory(new CustomDestinationFactory(getBus()));
+ svrBean.setDestinationFactory(new CustomDestinationFactory());
ServerImpl server = (ServerImpl)svrBean.create();
assertTrue(server.getDestination() instanceof CustomDestination);
@@ -108,7 +108,7 @@ public class ServerFactoryTest extends
AbstractSimpleFrontendTest {
}
public class CustomDestinationFactory extends AbstractTransportFactory
implements DestinationFactory {
- public CustomDestinationFactory(Bus b) {
+ public CustomDestinationFactory() {
super(Arrays.asList("id"));
}
public Destination getDestination(EndpointInfo ei, Bus b) throws
IOException {
@@ -140,4 +140,4 @@ public class ServerFactoryTest extends
AbstractSimpleFrontendTest {
}
}
-}
\ No newline at end of file
+}
diff --git
a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
index a9b4d9b..b794d1e 100644
---
a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
+++
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
@@ -200,7 +200,7 @@ public class JAXRSClientFactoryBeanTest {
IProductResource productResourceElement = parts.elementAt("1");
assertNotNull(productResourceElement);
}
-
+
@Test(expected = IllegalArgumentException.class)
public void testInvokePathNull() throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
@@ -218,7 +218,7 @@ public class JAXRSClientFactoryBeanTest {
BookInterface store = bean.create(BookInterface.class);
store.getBook("");
}
-
+
@Test
public void testInvokePathEmptyAllowed() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
@@ -250,10 +250,6 @@ public class JAXRSClientFactoryBeanTest {
private boolean isInitialized;
TestInterceptor() {
- this(Phase.PRE_STREAM);
- }
-
- TestInterceptor(String s) {
super(Phase.PRE_STREAM);
isInitialized = true;
}
diff --git
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/HttpRequestProperties.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/HttpRequestProperties.java
index c5be66b..17d238e 100644
---
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/HttpRequestProperties.java
+++
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/HttpRequestProperties.java
@@ -50,6 +50,7 @@ public class HttpRequestProperties {
this.hostName = hostName;
this.port = port;
this.httpMethod = httpMethod;
+ this.requestQuery = requestQuery;
}
private static int getPortFromURI(URI uri) {
diff --git
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
index a583e70..69b624f 100644
---
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
+++
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java
@@ -60,7 +60,7 @@ public class JCacheOAuthDataProvider extends
AbstractOAuthDataProvider {
this(false);
}
public JCacheOAuthDataProvider(boolean storeJwtTokenKeyOnly) throws
Exception {
- this(DEFAULT_CONFIG_URL, BusFactory.getThreadDefaultBus(true));
+ this(DEFAULT_CONFIG_URL, BusFactory.getThreadDefaultBus(true),
storeJwtTokenKeyOnly);
}
public JCacheOAuthDataProvider(String configFileURL, Bus bus) throws
Exception {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java
index 404ceb4..915797a 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java
@@ -31,12 +31,7 @@ import org.apache.cxf.transport.http.AbstractHTTPDestination;
public class CustomOutFaultInterceptor extends
AbstractPhaseInterceptor<Message> {
private boolean handleMessageCalled;
public CustomOutFaultInterceptor() {
- this(Phase.PRE_STREAM);
- }
-
- public CustomOutFaultInterceptor(String s) {
- super(Phase.MARSHAL);
-
+ super(Phase.PRE_STREAM);
}
public void handleMessage(Message message) throws Fault {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
index 0b920b2..ba5af20 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
@@ -240,12 +240,7 @@ public class JAXRSLocalTransportTest extends
AbstractBusClientServerTestBase {
private static class TestFaultInInterceptor extends
AbstractPhaseInterceptor<Message> {
TestFaultInInterceptor() {
- this(Phase.PRE_STREAM);
- }
-
- TestFaultInInterceptor(String s) {
super(Phase.PRE_STREAM);
-
}
public void handleMessage(Message message) throws Fault {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
index 3c39d17..cee49ed 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
@@ -1068,12 +1068,7 @@ public class JAXRSSoapBookTest extends
AbstractBusClientServerTestBase {
private boolean handleMessageCalled;
public TestInInterceptor() {
- this(Phase.PRE_STREAM);
- }
-
- public TestInInterceptor(String s) {
super(Phase.PRE_STREAM);
-
}
public void handleMessage(Message message) throws Fault {
@@ -1093,13 +1088,8 @@ public class JAXRSSoapBookTest extends
AbstractBusClientServerTestBase {
public TestOutInterceptor(boolean isBadOutInterceptor) {
- this(Phase.PRE_MARSHAL);
- this.isBadOutInterceptor = isBadOutInterceptor;
- }
-
- public TestOutInterceptor(String s) {
super(Phase.PRE_MARSHAL);
-
+ this.isBadOutInterceptor = isBadOutInterceptor;
}
public void handleMessage(Message message) throws Fault {
@@ -1119,12 +1109,7 @@ public class JAXRSSoapBookTest extends
AbstractBusClientServerTestBase {
public class TestFaultInInterceptor extends
AbstractPhaseInterceptor<Message> {
private boolean handleMessageCalled;
public TestFaultInInterceptor() {
- this(Phase.PRE_STREAM);
- }
-
- public TestFaultInInterceptor(String s) {
super(Phase.PRE_STREAM);
-
}
public void handleMessage(Message message) throws Fault {