Skip to content
Permalink
Browse files

Treat compiler warnings as build failures.

Big thanks to Christian Klemke for making this possible!
  • Loading branch information...
jsampson committed May 27, 2019
1 parent 9cf710a commit 55967c75f266d62de43acb5260ff54fd732a28d5
@@ -75,7 +75,7 @@ public MethodInfo(Method p_method) {
*/
public Method getMethod()
throws Exception {
Class<?>[] args = new Class[m_argTypes.length];
Class<?>[] args = new Class<?>[m_argTypes.length];
for (int i = 0; i < args.length; ++i) {
args[i] = Class.forName(m_argTypes[i]);
}
@@ -69,7 +69,7 @@
final TransactionHint<P> p_hint) {
return (P) Proxy.newProxyInstance
(p_intf.getClassLoader(),
new Class[]{p_intf},
new Class<?>[]{p_intf},
new InvocationHandler() {
public Object invoke(Object p_proxy,
Method p_method,
@@ -43,7 +43,7 @@
extends TestCase {
public void testSimple()
throws Exception {
Method m = String.class.getMethod("length", new Class[0]);
Method m = String.class.getMethod("length", new Class<?>[0]);
MethodInfo mi = new MethodInfo(m);
assertEquals("methods should be equal", m, mi.getMethod());
}
@@ -30,6 +30,10 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
@@ -189,6 +189,7 @@ public PrevaylerFactory() {
* @deprecated Use createCheckpointPrevayler() instead of this method.
* Deprecated since Prevayler2.00.001.
*/
@Deprecated
public static <P> Prevayler<P> createTransientPrevayler(P newPrevalentSystem, String snapshotDirectory) {
return createCheckpointPrevayler(newPrevalentSystem, snapshotDirectory);
}
17 pom.xml
@@ -144,6 +144,12 @@
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Christian Klemke</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<id>frederic.langlet</id>
<name>Frederic Langlet</name>
@@ -350,12 +356,19 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
<fork>true</fork> <!-- enables usage of compilerArgs -->
<showWarnings>true</showWarnings>
<failOnWarning>true</failOnWarning>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Xlint:-options</arg> <!-- suppresses bootclasspath warning when using higher-version Java compiler than target -->
<arg>-Xlint:-path</arg> <!-- suppresses warnings when running tests due to modules that do not have any test classes -->
</compilerArgs>
</configuration>
</plugin>

@@ -13,7 +13,7 @@
<!-- modules inherit parent's group id and version. -->
<artifactId>prevayler-snapshot-scheduler</artifactId>
<name>Prevayler Snapshot Scheduler</name>
<description>An implementation of a scheduler for Prevayler snahpshots.</description>
<description>An implementation of a scheduler for Prevayler snapshots.</description>

<packaging>jar</packaging>

@@ -67,7 +67,7 @@ public static synchronized void submit(Long senderID, String message, Object obj

Iterator<NotificationThread> i = clients.iterator();
while (i.hasNext()) {
client = (NotificationThread) i.next();
client = i.next();
if (client.isAlive()) {
if (enabledCallbacks.containsKey(client.getSocketId())) {
Map<String, Integer> callbacks = enabledCallbacks.get(client.getSocketId());
@@ -107,7 +107,7 @@ public static void registerCallback(long myId, String message) {
if (!callbacks.containsKey(message)) {
callbacks.put(message, new Integer(1));
} else {
Integer numInterested = (Integer) callbacks.get(message);
Integer numInterested = callbacks.get(message);
callbacks.put(message, new Integer(numInterested.intValue() + 1));
}
}
@@ -130,7 +130,7 @@ public static void unregisterCallback(long myId, String message) {
// Decrement the count of interested parties in this callback or remove it if nobody is interested
if (callbacks != null) {
if (callbacks.containsKey(message)) {
Integer numInterested = (Integer) callbacks.get(message);
Integer numInterested = callbacks.get(message);

// If nobody is interested, remove the callback
if (numInterested.intValue() == 1) {
@@ -77,7 +77,7 @@ public static void registerNotificationThread(Long id, NotificationThread thread
* @param id The ID of the command thread that died.
*/
public static void reap(Long id) {
NotificationThread thread = (NotificationThread) notificationThreads.get(id);
NotificationThread thread = notificationThreads.get(id);
if (thread != null) {
if (thread.isAlive())
thread.interrupt();

0 comments on commit 55967c7

Please sign in to comment.
You can’t perform that action at this time.