You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2019/07/09 16:53:13 UTC
[cxf] branch master updated: Fix a bunch of issues the new PMD is
reporting, many more to go
This is an automated email from the ASF dual-hosted git repository.
dkulp 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 7815364 Fix a bunch of issues the new PMD is reporting, many more to go
7815364 is described below
commit 78153648e314266ef3147c043e1841cb2f1ec316
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Tue Jul 9 11:48:14 2019 -0400
Fix a bunch of issues the new PMD is reporting, many more to go
---
.../cxf/attachment/AttachmentDataSource.java | 7 +---
.../apache/cxf/common/util/ClassHelperTest.java | 1 +
.../inheritance/ExceptionInheritanceTest.java | 2 +
.../org/apache/cxf/aegis/type/basic/BeanTest.java | 2 +
.../apache/cxf/aegis/type/basic/ByteDataTest.java | 2 +
.../cxf/aegis/type/basic/DynamicProxyTest.java | 2 +
.../cxf/aegis/type/basic/QualificationTest.java | 2 +
.../cxf/aegis/type/encoded/ArrayTypeInfoTest.java | 2 +
.../cxf/aegis/type/encoded/SoapArrayTypeTest.java | 2 +
.../cxf/aegis/type/encoded/StructTypeTest.java | 2 +
.../cxf/ws/rm/persistence/jdbc/RMTxStore.java | 44 +++++++++++-----------
.../org/apache/cxf/ws/rm/SourceSequenceTest.java | 2 +-
.../apache/cxf/wsdl11/WSDLServiceBuilderTest.java | 2 +-
.../jaxrs/failover/AbstractFailoverTest.java | 2 +-
.../apache/cxf/systest/http/HTTPConduitTest.java | 6 +--
.../cxf/systest/https/conduit/HTTPSClientTest.java | 4 +-
.../systest/https/conduit/HTTPSConduitTest.java | 6 +--
.../https/constraints/CertConstraintsTest.java | 4 +-
.../systest/type_test/AbstractTypeTestClient.java | 2 +-
.../ws/rm/AbstractClientPersistenceTest.java | 14 +++----
.../ws/rm/AbstractServerPersistenceTest.java | 2 +-
.../greeter_control/FaultThrowingInterceptor.java | 7 +++-
.../wsdl/type_test/type_test_tester_java.xsl | 2 -
.../java/org/apache/cxf/tools/util/JAXBUtils.java | 14 ++-----
24 files changed, 70 insertions(+), 65 deletions(-)
diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDataSource.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDataSource.java
index fd87ffb..1e2dc09 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDataSource.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDataSource.java
@@ -51,7 +51,7 @@ public class AttachmentDataSource implements DataSource {
cache = new CachedOutputStream();
AttachmentUtil.setStreamedAttachmentProperties(message, cache);
try {
- IOUtils.copy(ins, cache);
+ IOUtils.copyAndCloseInput(ins, cache);
cache.lockOutputStream();
if (delegate != null) {
delegate.setInputStream(cache.getInputStream());
@@ -61,11 +61,6 @@ public class AttachmentDataSource implements DataSource {
cache = null;
throw cee;
} finally {
- try {
- ins.close();
- } catch (Exception ex) {
- //ignore
- }
ins = null;
}
}
diff --git a/core/src/test/java/org/apache/cxf/common/util/ClassHelperTest.java b/core/src/test/java/org/apache/cxf/common/util/ClassHelperTest.java
index 5624a84..dd38c31 100644
--- a/core/src/test/java/org/apache/cxf/common/util/ClassHelperTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/ClassHelperTest.java
@@ -192,6 +192,7 @@ public class ClassHelperTest {
EasyMock.verify(bus);
}
+ @Test
public void getRealLambdaClassPropertyWasSetInBus() {
EasyMock.expect(bus.getProperty(ClassHelper.USE_DEFAULT_CLASS_HELPER)).andReturn(true);
EasyMock.expect(bus.getProperty(ClassUnwrapper.class.getName())).andReturn(null);
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java
index 0074b32..1c6bb66 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/inheritance/ExceptionInheritanceTest.java
@@ -36,6 +36,7 @@ import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.service.invoker.BeanInvoker;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
@@ -45,6 +46,7 @@ public class ExceptionInheritanceTest extends AbstractAegisTest {
private WS1 client;
private Map<String, Object> props;
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
index 73e80a1..8c4b6d2 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
@@ -51,6 +51,7 @@ import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaSequenceMember;
import org.apache.ws.commons.schema.constants.Constants;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -63,6 +64,7 @@ public class BeanTest extends AbstractAegisTest {
TypeMapping mapping;
private AegisContext context;
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/ByteDataTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/ByteDataTest.java
index ee80ae9..69a40f5 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/ByteDataTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/ByteDataTest.java
@@ -25,9 +25,11 @@ import org.apache.cxf.aegis.AbstractAegisTest;
import org.apache.cxf.aegis.services.DataService;
import org.apache.cxf.wsdl.WSDLConstants;
+import org.junit.Before;
import org.junit.Test;
public class ByteDataTest extends AbstractAegisTest {
+ @Before
public void setUp() throws Exception {
super.setUp();
createService(DataService.class);
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java
index 9e8849c..1f4fbcd 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/DynamicProxyTest.java
@@ -25,6 +25,7 @@ import org.apache.cxf.aegis.AegisContext;
import org.apache.cxf.aegis.type.TypeMapping;
import org.apache.cxf.aegis.xml.stax.ElementReader;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -37,6 +38,7 @@ import static org.junit.Assert.fail;
public class DynamicProxyTest extends AbstractAegisTest {
TypeMapping mapping;
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
index e33b92e..c1e4771 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/QualificationTest.java
@@ -32,10 +32,12 @@ import org.apache.cxf.aegis.type.TypeCreationOptions;
import org.apache.cxf.aegis.type.TypeMapping;
import org.apache.ws.commons.schema.constants.Constants;
+import org.junit.Before;
import org.junit.Test;
public class QualificationTest extends AbstractAegisTest {
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java
index 92332db..9534c22 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/ArrayTypeInfoTest.java
@@ -30,6 +30,7 @@ import org.apache.cxf.aegis.xml.stax.ElementReader;
import org.apache.ws.commons.schema.constants.Constants;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertSame;
@@ -40,6 +41,7 @@ public class ArrayTypeInfoTest extends AbstractAegisTest {
private TypeMapping mapping;
private StructType addressType;
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
index 53a66aa..52b3a86 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/SoapArrayTypeTest.java
@@ -28,6 +28,7 @@ import org.apache.cxf.aegis.type.AegisType;
import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
import org.apache.cxf.aegis.xml.stax.ElementReader;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
@@ -48,6 +49,7 @@ public class SoapArrayTypeTest extends AbstractEncodedTest {
},
};
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java
index a7b72aa..c97deba 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/encoded/StructTypeTest.java
@@ -33,6 +33,7 @@ import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
import org.apache.cxf.aegis.xml.stax.ElementReader;
import org.apache.cxf.helpers.DOMUtils;
+import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -49,6 +50,7 @@ public class StructTypeTest extends AbstractEncodedTest {
return new Context(aegisContext);
}
+ @Before
public void setUp() throws Exception {
super.setUp();
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
index 637cab7..e2e9d76 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
@@ -749,29 +749,29 @@ public class RMTxStore implements RMStore {
new Object[] {outbound ? "outbound" : "inbound", nr, id, to});
}
PreparedStatement stmt = null;
- CachedOutputStream cos = msg.getContent();
- InputStream msgin = null;
- try {
- msgin = cos.getInputStream();
- stmt = getStatement(con, outbound ? CREATE_OUTBOUND_MESSAGE_STMT_STR : CREATE_INBOUND_MESSAGE_STMT_STR);
-
- stmt.setString(1, id);
- stmt.setLong(2, nr);
- stmt.setString(3, to);
- stmt.setLong(4, msg.getCreatedTime());
- stmt.setBinaryStream(5, msgin);
- stmt.setString(6, contentType);
- stmt.execute();
- if (LOG.isLoggable(Level.FINE)) {
- LOG.log(Level.FINE, "Successfully stored {0} message number {1} for sequence {2}",
- new Object[] {outbound ? "outbound" : "inbound", nr, id});
- }
- } finally {
- releaseResources(stmt, null);
- if (null != msgin) {
- msgin.close();
+ try (CachedOutputStream cos = msg.getContent()) {
+ InputStream msgin = null;
+ try {
+ msgin = cos.getInputStream();
+ stmt = getStatement(con, outbound ? CREATE_OUTBOUND_MESSAGE_STMT_STR : CREATE_INBOUND_MESSAGE_STMT_STR);
+
+ stmt.setString(1, id);
+ stmt.setLong(2, nr);
+ stmt.setString(3, to);
+ stmt.setLong(4, msg.getCreatedTime());
+ stmt.setBinaryStream(5, msgin);
+ stmt.setString(6, contentType);
+ stmt.execute();
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.log(Level.FINE, "Successfully stored {0} message number {1} for sequence {2}",
+ new Object[] {outbound ? "outbound" : "inbound", nr, id});
+ }
+ } finally {
+ releaseResources(stmt, null);
+ if (null != msgin) {
+ msgin.close();
+ }
}
- cos.close(); // needed to clean-up tmp file folder
}
}
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
index 1ad6529..6cfddf5 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
@@ -73,7 +73,7 @@ public class SourceSequenceTest {
rq = null;
}
- void setUpSource() {
+ protected void setUpSource() {
source = control.createMock(Source.class);
manager = control.createMock(RMManager.class);
EasyMock.expect(source.getManager()).andReturn(manager).anyTimes();
diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
index eae69ca..682c212 100644
--- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
+++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
@@ -107,7 +107,7 @@ public class WSDLServiceBuilderTest {
private DestinationFactoryManager destinationFactoryManager;
- public void setUpBasic() throws Exception {
+ protected void setUpBasic() throws Exception {
setUpWSDL(WSDL_PATH, 0);
}
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/AbstractFailoverTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/AbstractFailoverTest.java
index dc1a4d7..4e5822d 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/AbstractFailoverTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/AbstractFailoverTest.java
@@ -144,7 +144,7 @@ public abstract class AbstractFailoverTest extends AbstractBusClientServerTestBa
getFeature(false, Server.ADDRESS3, null);
strategyTest(Server.ADDRESS1, feature, Server.ADDRESS3, Server.ADDRESS2, false, false, false);
}
-
+ @Test
public void testSequentialStrategyWithDiffBaseAddresses2() throws Exception {
FailoverFeature feature =
getFeature(false, Server.ADDRESS3, null);
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java
index 302b23a..bbd2f8a 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java
@@ -146,11 +146,11 @@ public class HTTPConduitTest extends AbstractBusClientServerTestBase {
//methods that a subclass can override to inject a Proxy into the flow
//and assert the proxy was appropriately called
- public void configureProxy(Client c) {
+ protected void configureProxy(Client c) {
}
- public void resetProxyCount() {
+ protected void resetProxyCount() {
}
- public void assertProxyRequestCount(int i) {
+ protected void assertProxyRequestCount(int i) {
}
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSClientTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSClientTest.java
index 3ab49c3..a7c0c46 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSClientTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSClientTest.java
@@ -73,7 +73,7 @@ public class HTTPSClientTest extends AbstractBusClientServerTestBase {
BusServer.resetPortMap();
}
- public void startServers() throws Exception {
+ protected void startServers() throws Exception {
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -83,7 +83,7 @@ public class HTTPSClientTest extends AbstractBusClientServerTestBase {
}
- public void stopServers() throws Exception {
+ protected void stopServers() throws Exception {
stopAllServers();
System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
BusFactory.setDefaultBus(null);
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSConduitTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSConduitTest.java
index 5e59f0b..2a00593 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSConduitTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/HTTPSConduitTest.java
@@ -251,11 +251,11 @@ public class HTTPSConduitTest extends AbstractBusClientServerTestBase {
//methods that a subclass can override to inject a Proxy into the flow
//and assert the proxy was appropriately called
- public void configureProxy(Client c) {
+ protected void configureProxy(Client c) {
}
- public void resetProxyCount() {
+ protected void resetProxyCount() {
}
- public void assertProxyRequestCount(int i) {
+ protected void assertProxyRequestCount(int i) {
}
/**
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/constraints/CertConstraintsTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/constraints/CertConstraintsTest.java
index 42de190..cd44d70 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/constraints/CertConstraintsTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/constraints/CertConstraintsTest.java
@@ -67,7 +67,7 @@ public class CertConstraintsTest extends AbstractBusClientServerTestBase {
}
}
- public void startServers() throws Exception {
+ protected void startServers() throws Exception {
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -77,7 +77,7 @@ public class CertConstraintsTest extends AbstractBusClientServerTestBase {
}
- public void stopServers() throws Exception {
+ protected void stopServers() throws Exception {
stopAllServers();
System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
BusFactory.setDefaultBus(null);
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
index f065125..3ebac74 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
@@ -61,7 +61,7 @@ public abstract class AbstractTypeTestClient
protected boolean perfTestOnly;
- public void setPerformanceTestOnly() {
+ protected void setPerformanceTestOnly() {
perfTestOnly = true;
}
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
index fd337f4..4fa4576 100644
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
@@ -144,7 +144,7 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
verifyRecovery();
}
- void startClient() throws Exception {
+ protected void startClient() throws Exception {
LOG.fine("Creating greeter client");
System.setProperty("db.name", getPrefix() + "-client");
SpringBusFactory bf = new SpringBusFactory();
@@ -163,7 +163,7 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
bus.getInInterceptors().add(in);
}
- void populateStore() throws Exception {
+ protected void populateStore() throws Exception {
bus.getExtension(RMManager.class).getConfiguration().setBaseRetransmissionInterval(Long.valueOf(60000));
bus.getOutInterceptors().add(new MessageLossSimulator());
@@ -198,7 +198,7 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
mf.verifyAcknowledgements(new boolean[] {false, true, true}, false);
}
- void verifyStorePopulation() {
+ protected void verifyStorePopulation() {
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
@@ -225,12 +225,12 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
assertEquals(0, msgs.size());
}
- void stopClient() {
+ protected void stopClient() {
// ClientProxy.getClient(greeter).destroy();
bus.shutdown(true);
}
- void populateStoreAfterRestart() throws Exception {
+ protected void populateStoreAfterRestart() throws Exception {
bus.getExtension(RMManager.class).getConfiguration().setBaseRetransmissionInterval(Long.valueOf(60000));
@@ -274,7 +274,7 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
}
}
- void recover() throws Exception {
+ protected void recover() throws Exception {
// do nothing - resends should happen in the background
@@ -283,7 +283,7 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
}
- void verifyRecovery() throws Exception {
+ protected void verifyRecovery() throws Exception {
RMManager manager = bus.getExtension(RMManager.class);
assertNotNull(manager);
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractServerPersistenceTest.java b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractServerPersistenceTest.java
index 8026d94..ab190fa 100644
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractServerPersistenceTest.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractServerPersistenceTest.java
@@ -269,7 +269,7 @@ public abstract class AbstractServerPersistenceTest extends AbstractBusClientSer
}
- void verifyRetransmissionQueue() throws Exception {
+ protected void verifyRetransmissionQueue() throws Exception {
awaitMessages(2, 2, 60000);
int count = 0;
diff --git a/testutils/src/main/java/org/apache/cxf/greeter_control/FaultThrowingInterceptor.java b/testutils/src/main/java/org/apache/cxf/greeter_control/FaultThrowingInterceptor.java
index 006a11a..26278e9 100644
--- a/testutils/src/main/java/org/apache/cxf/greeter_control/FaultThrowingInterceptor.java
+++ b/testutils/src/main/java/org/apache/cxf/greeter_control/FaultThrowingInterceptor.java
@@ -47,11 +47,14 @@ public class FaultThrowingInterceptor extends AbstractPhaseInterceptor<Message>
super(phase);
}
- public synchronized void handleMessage(Message message) throws Fault {
+ public void handleMessage(Message message) throws Fault {
if (MessageUtils.isRequestor(message)) {
return;
}
- String msg = MESSAGE_FORMAT.format(new Object[] {getPhase()});
+ String msg = null;
+ synchronized (MESSAGE_FORMAT) {
+ msg = MESSAGE_FORMAT.format(new Object[] {getPhase()});
+ }
LOG.fine(msg);
throw new Fault(new RuntimeException(msg));
}
diff --git a/testutils/src/main/resources/wsdl/type_test/type_test_tester_java.xsl b/testutils/src/main/resources/wsdl/type_test/type_test_tester_java.xsl
index b75c938..b599b5d 100644
--- a/testutils/src/main/resources/wsdl/type_test/type_test_tester_java.xsl
+++ b/testutils/src/main/resources/wsdl/type_test/type_test_tester_java.xsl
@@ -36,8 +36,6 @@ package org.apache.cxf.systest.type_test;
* org.apache.type_test.TypeTestTester
*/
public interface TypeTestTester {
-
- void setPerformanceTestOnly();
void testVoid() throws Exception;
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java b/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
index 7e386bc..11b6253 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
@@ -128,21 +128,13 @@ public final class JAXBUtils {
schemaBindings.appendChild(pkgElement);
rootElement.appendChild(annoElement);
File tmpFile = null;
- OutputStream out = null;
try {
tmpFile = FileUtils.createTempFile("customzied", ".xsd");
- out = Files.newOutputStream(tmpFile.toPath());
- StaxUtils.writeTo(rootElement, out);
+ try (OutputStream out = Files.newOutputStream(tmpFile.toPath())) {
+ StaxUtils.writeTo(rootElement, out);
+ }
} catch (Exception e) {
e.printStackTrace();
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
}
return tmpFile;
}