Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public String run() {
return Boolean.parseBoolean(cname);
}


@SuppressWarnings("PMD.UselessPureMethodCall")
public static void doHacks() {
if (skipHack("org.apache.cxf.JDKBugHacks.all")) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public static Logger getL7dLogger(Class<?> cls,
/**
* Create a logger
*/
@SuppressWarnings("PMD.UselessPureMethodCall")
protected static Logger createLogger(Class<?> cls,
String name,
String loggerName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class ConfigurerImpl extends BeanConfigurerSupport
private final Map<String, List<MatcherHolder>> wildCardBeanDefinitions = new TreeMap<>();
private BeanFactory beanFactory;

@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable")
static class MatcherHolder implements Comparable<MatcherHolder> {
Matcher matcher;
String wildCardId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.apache.cxf.common.util.ReflectionUtil;

@NoJSR250Annotations
@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable")
public class AutomaticWorkQueueImpl implements AutomaticWorkQueue {
public static final String PROPERTY_NAME = "name";
static final int DEFAULT_MAX_QUEUE_SIZE = 256;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class AttachmentDeserializerTest {

Expand Down Expand Up @@ -696,12 +696,8 @@ public void testManyAttachments() throws Exception {
ad.initializeAttachments();

// Force it to load the attachments
try {
msg.getAttachments().size();
fail("Failure expected on too many attachments");
} catch (RuntimeException ex) {
// expected
}
assertThrows("Failure expected on too many attachments", RuntimeException.class,
() -> msg.getAttachments().size());
}

@Test
Expand Down Expand Up @@ -734,12 +730,8 @@ public void testChangingMaxAttachmentCount() throws Exception {
ad.initializeAttachments();

// Force it to load the attachments
try {
msg.getAttachments().size();
fail("Failure expected on too many attachments");
} catch (RuntimeException ex) {
// expected
}
assertThrows("Failure expected on too many attachments", RuntimeException.class,
() -> msg.getAttachments().size());

// Now we'll allow it
msg = new MessageImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class SpringBasedTimedAnnotationProviderTest {
private MethodDispatcher methodDispatcher;

@Before
@SuppressWarnings("PMD.UselessPureMethodCall")
public void setUp() {
openMocks(this);
underTest = new SpringBasedTimedAnnotationProvider();
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.16.0</version>
<version>7.17.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.cxf.aegis.type.array;

@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable")
public class DuplicateArrayReturnItem implements Comparable<Object> {

String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class JAXBContextInitializer extends ServiceModelVisitor {
}

@Override
@SuppressWarnings("PMD.UselessPureMethodCall")
public void begin(MessagePartInfo part) {
Class<?> clazz = part.getTypeClass();
if (clazz == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.MockitoAnnotations.openMocks;

@SuppressWarnings("PMD.UselessPureMethodCall")
public class DefaultExceptionClassProviderTest {

private static final Exception EXCEPTION_CAUSE = new CauseException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.MockitoAnnotations.openMocks;

@SuppressWarnings({"unused"})
@SuppressWarnings({"unused", "PMD.UselessPureMethodCall"})
public class DefaultTimedAnnotationProviderTest {

private DefaultTimedAnnotationProvider underTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static org.mockito.MockitoAnnotations.openMocks;


@SuppressWarnings("PMD.UselessPureMethodCall")
public class StandardTagsTest {

private static final String DUMMY_METHOD_NAME = "dummyMethod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.MockitoAnnotations.openMocks;

@SuppressWarnings("PMD.UselessPureMethodCall")
public class JaxwsFaultCodeProviderTest {

private static final String RUNTIME_FAULT_STRING = "RUNTIME_FAULT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import jakarta.activation.DataHandler;
import jakarta.mail.util.ByteArrayDataSource;
Expand Down Expand Up @@ -55,7 +56,11 @@ public void testCreateAndModify() {
assertTrue(attachments.containsAll(attachments));
List<String> testCollection = new ArrayList<>();
testCollection.add("Some value");
assertFalse(attachments.containsAll(testCollection));
assertFalse(attachments
.stream()
.map(Attachment::toString)
.collect(Collectors.toList())
.containsAll(testCollection));

attachments.add(att3);
assertEquals(3, attachments.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public void testWrapperClassLoaderWithWrappedOperationsAndLegacyConvention() thr
loadedClassNames);
}

@SuppressWarnings("PMD.UselessPureMethodCall")
private List<String> testWrapperClassLoaderWithNamingConvention(WrapperClassNamingConvention convention)
throws Exception {
bus.setExtension(convention, WrapperClassNamingConvention.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public ResponseTimeCounter(ObjectName on) {
objectName = on;
}

@SuppressWarnings("PMD.UselessPureMethodCall")
public void increase(MessageHandlingTimeRecorder mhtr) {
if (!enabled) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
/**
*
*/
@SuppressWarnings("PMD.UselessPureMethodCall")
public class AbstractRMInterceptorTest {
@Test
public void testAccessors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void getBookNoContentInterface(@Suspended AsyncResponse async) {

@GET
@Path("/books/cancel")
@SuppressWarnings("PMD.UselessPureMethodCall")
public void getBookDescriptionWithCancel(@PathParam("id") String id,
@Suspended AsyncResponse async) {
PhaseInterceptorChain.getCurrentMessage().getClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.cxf.systest.provider;

@SuppressWarnings("PMD.OverrideBothEqualsAndHashCodeOnComparable")
public class HWSourcePayloadProvider extends AbstractSourcePayloadProvider
implements Comparable<HWSourcePayloadProvider> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public void testAuthorizationCodeFlowWithRefresh() throws Exception {
accessToken = response.readEntity(ClientAccessToken.class);
assertNotNull(accessToken.getTokenKey());
assertNotNull(accessToken.getRefreshToken());
accessToken.getParameters().get("id_token");
assertNotNull(accessToken.getParameters().get("id_token"));
assertNotNull(idToken);

if (isAccessTokenInJWTFormat()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public void testUserInfoRefreshToken() throws Exception {
accessToken = response.readEntity(ClientAccessToken.class);
assertNotNull(accessToken.getTokenKey());
assertNotNull(accessToken.getRefreshToken());
accessToken.getParameters().get("id_token");
assertNotNull(accessToken.getParameters().get("id_token"));
assertNotNull(idToken);
String newAccessToken = accessToken.getTokenKey();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import jakarta.xml.ws.Endpoint;
import jakarta.xml.ws.WebServiceException;
import org.apache.cxf.BusFactory;
import org.apache.cxf.connector.Connection;
import org.apache.cxf.jca.cxf.CXFConnectionRequestInfo;
Expand All @@ -44,7 +43,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class OutBoundConnectionTest extends AbstractBusClientServerTestBase {
public static final String PORT = Server.PORT;
Expand Down Expand Up @@ -89,7 +87,6 @@ public static void startServers() throws Exception {
}

@Test
@org.junit.Ignore
public void testBasicConnection() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(wsdl);
Expand All @@ -108,19 +105,14 @@ public void testBasicConnection() throws Exception {
Object o = mc.getConnection(subject, cri);

// test for the Object hash()
try {
o.hashCode();
o.toString();
} catch (WebServiceException ex) {
fail("The connection object should support Object method");
}
assertNotNull(o.hashCode());
assertNotNull(o.toString());

verifyResult(o);
}


@Test
@org.junit.Ignore
public void testGetConnectionFromSEI() throws Exception {
CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
requestInfo.setInterface(Greeter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public Set<String> getImports() {
return imports;
}

@SuppressWarnings("PMD.UselessPureMethodCall")
private void prompt() {
toString();
}
Expand Down
Loading