diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java index 77dac690fff2a32c4ae8e629ac3142f7466e5d18..72ee85a26188e5f7dee88f592d6043686967423c 100644 --- a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java +++ b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java @@ -159,10 +159,10 @@ public class ExampleSimulationProgram DisThreadedNetworkInterface.PduListener pduListener; Pdu receivedPdu; - static final String networkAddress_DEFAULT = "239.1.2.3"; - static final int networkPort_DEFAULT = 3000; - static String networkAddress = networkAddress_DEFAULT; - static int networkPort = networkPort_DEFAULT; + static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3"; + static final int NETWORK_PORT_DEFAULT = 3000; + static String networkAddress = NETWORK_ADDRESS_DEFAULT; + static int networkPort = NETWORK_PORT_DEFAULT; /** * Constructor design goal: additional built-in initialization conveniences can go here @@ -299,10 +299,12 @@ public class ExampleSimulationProgram if ((comments != null) && (comments.length > 0)) { ArrayList<String> newCommentsList = new ArrayList<>(); - for (int i = 0; i < comments.length; i++) + for (String comment : comments) { - if (!comments[i].isEmpty()) - newCommentsList.add(comments[i]); // OK found something to send + if (!comment.isEmpty()) + { + newCommentsList.add(comment); // OK found something to send + } } if (!newCommentsList.isEmpty()) {