Skip to content

Commit

Permalink
Removed warnings about unused code or missing serialVersionUID and fi…
Browse files Browse the repository at this point in the history
…xed one real error (arquillian#163)
  • Loading branch information
WolfgangHG committed May 12, 2024
1 parent c74e5f0 commit 9043ff1
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void changed_input_value_has_been_applied() {
updatedName = myBean.getName();
}

@SuppressWarnings("unused")
public String getUpdatedName() {
return updatedName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void perform() {
.inspect(new Inspection() {
private static final long serialVersionUID = 1L;

@SuppressWarnings("unused")
private Object payload = new NonSerializableObject();

@BeforeServlet
Expand Down Expand Up @@ -113,6 +114,7 @@ public void perform() {
.inspect(new Inspection() {
private static final long serialVersionUID = 1L;

@SuppressWarnings("unused")
private Object payload;

@BeforeServlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean matches(HttpRequest request) {

for (String val : values) {

if (val.equals(values)) {
if (val.equals(value)) {

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private URL getProxyUrl(URL realURL) {
return proxyURL;
}

private Injector injector() {
/*private Injector injector() {
return injector.get();
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

package org.jboss.arquillian.warp.impl.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Represents the known and supported Platforms that WebDriver runs on. This is pretty close to the
* Operating System, but differs slightly, because this class is used to extract information such as
Expand Down Expand Up @@ -135,10 +132,6 @@ public Platform family() {
},

ANDROID("android", "dalvik") {
public String getLineEnding() {
return "\n";
}

@Override
public Platform family() {
return LINUX;
Expand All @@ -156,12 +149,13 @@ public boolean is(Platform compareWith) {
};

private final String[] partOfOsName;
private final int minorVersion;
private final int majorVersion;
//private final int minorVersion;
//private final int majorVersion;

Platform(String... partOfOsName) {
this.partOfOsName = partOfOsName;

/*Unused...
String version = System.getProperty("os.version", "0.0.0");
int major = 0;
int min = 0;
Expand All @@ -178,7 +172,7 @@ public boolean is(Platform compareWith) {
}
majorVersion = major;
minorVersion = min;
minorVersion = min;*/
}

public String[] getPartOfOsName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ public void test() {
}

private static class StartBlockingObserver {
@SuppressWarnings("unused")
public void blockStart(@Observes EventContext<StartBus> ctx) {
}

@SuppressWarnings("unused")
public void blockStop(@Observes EventContext<StopBus> ctx) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ public Result run(Argument argument, String string) {
}
}

/**
* Must be public. If not the test is failing:
* "java.lang.IllegalAccessError: tried to access class org.jboss.arquillian.warp.impl.client.separation.TestSeparateInvocator$Result
* from class com.sun.proxy.$Proxy4"
*/
@SuppressWarnings("serial")
public static class Result implements Serializable {
}

@SuppressWarnings("serial")
public static class Argument implements Serializable {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public Class<?> answer(InvocationOnMock invocation) throws Throwable {
SeparatedClassLoader separated = new SeparatedClassLoader(cl1, cl2);

try {
@SuppressWarnings("unused")
Class<?> loadedClass = separated.loadClass("SomeNonExistingClassName");
fail("class should not be found");
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public static Inspection getAnonymousServerInspection() {
Inspection inspection = new Inspection() {
private static final long serialVersionUID = 1L;

@SuppressWarnings("unused")
@BeforeServlet
public String get() {
return "Test";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.jboss.arquillian.warp.Inspection;
import org.jboss.arquillian.warp.impl.shared.RequestPayload;

@SuppressWarnings("unused")
@SuppressWarnings({ "unused", "serial" })
public class SharingClass implements Serializable {

public RequestPayload getStaticInnerClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@RunWith(SeparatedClassloaderRunner.class)
public class TestDynamicClassLoading {

@SuppressWarnings({ "unused", "serial" })
private Inspection inspection = new Inspection() {
};

Expand All @@ -35,6 +36,7 @@ static JavaArchive getClasspath() {

@Test
public void test() {
@SuppressWarnings("unused")
String test = "xyz";
}
}

0 comments on commit 9043ff1

Please sign in to comment.