mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 04:35:32 +00:00
Removed warnings which came up with Eclipse 4.2 Juno. See Bug 1131 for more information.
This commit is contained in:
@@ -15,6 +15,7 @@ public class Example {
|
||||
while ((line = in.readLine()) != null) {
|
||||
lines.add(line);
|
||||
}
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ public class GenerateUnifiedDiffTest extends TestCase {
|
||||
while ((line = in.readLine()) != null) {
|
||||
lines.add(line);
|
||||
}
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
fail(e.getMessage());
|
||||
|
||||
+3
@@ -313,6 +313,9 @@ public class DeclinationStoreTest extends AbstractDeclinationTest {
|
||||
// this was to be expected
|
||||
}
|
||||
ois.close();
|
||||
|
||||
oos1.close();
|
||||
oos2.close();
|
||||
} finally {
|
||||
tmpFile.delete();
|
||||
}
|
||||
|
||||
+2
-1
@@ -232,7 +232,8 @@ public class StoreAndForward implements Runnable {
|
||||
public void stop() throws UnknownHostException, IOException, InterruptedException {
|
||||
logger.entering(getClass().getName(), "stop");
|
||||
stopped = true;
|
||||
new Socket("localhost", portForClients); // this is to stop the client listener thread
|
||||
Socket closer = new Socket("localhost", portForClients); // this is to stop the client listener thread
|
||||
closer.close();
|
||||
logger.info("joining clientListener thread "+clientListener);
|
||||
clientListener.join();
|
||||
socket.close(); // will let a read terminate abnormally
|
||||
|
||||
+2
@@ -320,6 +320,8 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
case TMD:
|
||||
notifyListenersTMD(message);
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Theres currently no support for the enum value '" + message.getType() + "' in this method.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -132,6 +132,8 @@ public class SwissTimingReplayServiceImpl implements SwissTimingReplayService {
|
||||
bos.write(buf, 0, read);
|
||||
}
|
||||
new SwissTimingReplayParserImpl().readData(new ByteArrayInputStream(bos.getBuffer(), 0, bos.size()), replayListener);
|
||||
|
||||
bos.close();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
+4
@@ -53,6 +53,8 @@ public class UDPMirrorTest {
|
||||
didReceive[0] = true;
|
||||
didReceive.notifyAll();
|
||||
}
|
||||
|
||||
udpSocket.close();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -67,6 +69,8 @@ public class UDPMirrorTest {
|
||||
didReceive.wait();
|
||||
}
|
||||
}
|
||||
sendingSocket.close();
|
||||
|
||||
assertTrue(Arrays.equals(buf1, buf2));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ public class UDPMirror implements Runnable {
|
||||
}
|
||||
int listeningOnPort = Integer.valueOf(args[c++]);
|
||||
byte[] buf = new byte[65536];
|
||||
@SuppressWarnings("resource") //Can't close resource due to the infinite loop. Will be closed, when the thread is terminated.
|
||||
DatagramSocket udpSocket = new DatagramSocket(listeningOnPort);
|
||||
DatagramPacket received = new DatagramPacket(buf, buf.length);
|
||||
DatagramSocket[] sendingSockets = new DatagramSocket[(args.length - 1) / 2];
|
||||
|
||||
+4
@@ -910,6 +910,8 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
result.sideToWhichMarkAtLegStartWasRounded = mpm.getSide();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Theres currently no support for the enum value '" + maneuver.getType() + "' in this method.");
|
||||
}
|
||||
}
|
||||
result.averageManeuverLossInMeters = new HashMap<ManeuverType, Double>();
|
||||
@@ -2434,6 +2436,8 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
case RACE_RANK:
|
||||
result = (double) trackedLeg.getRank(timePoint);
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Theres currently no support for the enum value '" + dataType + "' in this method.");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
+2
@@ -375,6 +375,8 @@ public abstract class AbstractChartPanel<SettingsType extends ChartSettings> ext
|
||||
break;
|
||||
case WINDWARD_DISTANCE_TO_OVERALL_LEADER:
|
||||
detailTypeUnit = getStringMessages().windwardDistanceToGoInMetersUnit();
|
||||
default:
|
||||
throw new UnsupportedOperationException("Theres currently no support for the enum value '" + getSelectedDetailType() + "' in this method.");
|
||||
}
|
||||
return detailTypeUnit;
|
||||
}
|
||||
|
||||
+2
@@ -438,6 +438,8 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
|
||||
lastCombinedWindTrackInfoDTO = windTrackInfoDTO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Theres currently no support for the enum value '" + windSource.getType() + "' in this method.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,11 @@ public abstract class UDPReceiver<MessageType extends UDPMessage, ListenerType e
|
||||
stopped = true;
|
||||
byte[] buf = new byte[0];
|
||||
DatagramPacket stopPacket = new DatagramPacket(buf, 0, InetAddress.getLocalHost(), listeningOnPort);
|
||||
new DatagramSocket().send(stopPacket);
|
||||
|
||||
DatagramSocket stopper = new DatagramSocket();
|
||||
stopper.send(stopPacket);
|
||||
stopper.close();
|
||||
|
||||
if (!udpSocket.isConnected()) {
|
||||
udpSocket.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user