Skip to content

Commit

Permalink
prep for java 9, cleanup deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wshackle committed Mar 16, 2017
1 parent 2d33225 commit 510164c
Show file tree
Hide file tree
Showing 25 changed files with 219 additions and 714 deletions.
1 change: 1 addition & 0 deletions rcsjava_maven/rcslib/nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Any value defined here will override the pom.xml file value but is only applicab
-->
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
<netbeans.hint.licensePath>${project.basedir}/license-NIST.txt</netbeans.hint.licensePath>
<netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
8 changes: 8 additions & 0 deletions rcsjava_maven/rcslib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The NIST RCS (Real-time Control Systems)
//******************************************************************************
package diagapplet.CodeGen;

import java.applet.Applet;
import java.awt.Button;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
Expand All @@ -50,6 +49,7 @@ The NIST RCS (Real-time Control Systems)
import diagapplet.utils.CountButton;
import diagapplet.utils.ModifiedFileDialog;
import diagapplet.utils.URLLoadInfoPanel;
import java.awt.Container;

import rcs.utils.URL_and_FileLoader;

Expand All @@ -58,7 +58,7 @@ The NIST RCS (Real-time Control Systems)
* not needed for newer recommended CodeGenCmdLine
* @author shackle
*/
public class CodeGen extends Applet implements Runnable, ActionListener {
public class CodeGen extends Container implements Runnable, ActionListener {

/**
* Unique id for this class.
Expand Down Expand Up @@ -252,7 +252,7 @@ public static void main(String args[]) {
if (debug_on) {
System.out.println("applet_CodeGen.start();");
}
applet_CodeGen.start();
// applet_CodeGen.start();
}

private static void ShowCodeGenStandalone() {
Expand Down Expand Up @@ -579,7 +579,7 @@ public void init() {
if (cgc.get_display_on()) {

if (!m_fStandAlone) {
resize(1000, 400);
setSize(1000, 400);
}
if (null == cgc.get_m_modulesHashTable()) {
cgc.set_m_modulesHashTable(new Hashtable());
Expand Down Expand Up @@ -908,7 +908,7 @@ public void run() {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
stop();
// stop();
}
}
cgc.set_running(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ public void CreateJavaDefinition(StructureTypeInfo type_info) {
}
int this_dim_length = ModuleInfo.doArrayLengthMath(this_dim_array_string);
array_length *= this_dim_length;
new_array_length_string += (new Integer(this_dim_length)).toString();
new_array_length_string += Integer.toString(this_dim_length);
l_squareParamIndex = array_length_string.indexOf('[', l_squareParamIndex + 1);
r_squareParamIndex = array_length_string.indexOf(']', l_squareParamIndex + 1);
if (-1 != r_squareParamIndex && -1 != l_squareParamIndex) {
Expand All @@ -1424,7 +1424,7 @@ public void CreateJavaDefinition(StructureTypeInfo type_info) {
DebugPrint("this_dim_length=" + this_dim_length + ", r_squareParamIndex=" + r_squareParamIndex + ", l_squareParamIndex=" + l_squareParamIndex + ", num_dims=" + num_dims);
}
}
array_length_string = (new Integer(array_length)).toString();
array_length_string = Integer.toString(array_length);
num_dims = 1;
}
lastSpaceIndex = info_token.lastIndexOf(' ');
Expand Down Expand Up @@ -1576,7 +1576,7 @@ public void CreateJavaDefinition(StructureTypeInfo type_info) {
keystring = (String) enum_keys.nextElement();
Ival = (Integer) enum_info.reverse_hashtable.get(keystring);
ival2 = Ival.intValue();
type_info.JavaClassArrayInitializers += "\t\t\tI_" + enum_info.Name + "= new Integer(" + ival2 + ");\n";
type_info.JavaClassArrayInitializers += "\t\t\tI_" + enum_info.Name + "= (" + ival2 + ");\n";
type_info.JavaClassArrayInitializers += "\t\t\tStr_" + enum_info.Name + "= \"" + keystring + "\";\n";
type_info.JavaClassArrayInitializers += "\t\t\tnml_enum_info_for_" + enum_info.Name + ".int_to_string_hash.put(I_" + enum_info.Name + ",Str_" + enum_info.Name + ");\n";
type_info.JavaClassArrayInitializers += "\t\t\tnml_enum_info_for_" + enum_info.Name + ".string_to_int_hash.put(Str_" + enum_info.Name + ",I_" + enum_info.Name + ");\n";
Expand Down Expand Up @@ -4739,7 +4739,7 @@ private boolean IsNMLMsgHidden(String classname) {
if (null != var_class_type_info.type_id_string) {
String idString = m_currentModule.ReplaceDefinedValues(var_class_type_info.type_id_string, 0, null);
if (Character.isDigit(idString.charAt(0)) || idString.charAt(0) == '+') {
Long idLong = new Long(rcs.utils.StrToLong.convert(idString));
Long idLong = Long.valueOf(rcs.utils.StrToLong.convert(idString));
long new_id = idLong.longValue();
if (new_id >= 1) {
var_class_type_info.Id = new_id;
Expand Down Expand Up @@ -7211,7 +7211,7 @@ public void GenerateJavaMessageDict() {
WriteOutput("\n\t\t// Conflict for type " + type_info.Name + " with ID " + type_info.Id + "\n");
continue;
}
WriteOutput("\t\tI=new Integer(" + selected_classes[i] + "_TYPE);\n");
WriteOutput("\t\tI= (" + selected_classes[i] + "_TYPE);\n");
WriteOutput("\t\tS=\"" + selected_classes[i] + "\";\n");
WriteOutput("\t\th1.put(I,S); h2.put(S,I);\n");

Expand Down Expand Up @@ -8197,7 +8197,7 @@ private void LoadHierarchyInternal(final String hierarchyFileName) throws Except
if (ifdef_vector.size() < ifdef_level + 1) {
ifdef_vector.setSize(ifdef_level + 1);
}
ifdef_vector.setElementAt(new Boolean(lastIfdefFalse), ifdef_level);
ifdef_vector.setElementAt(Boolean.valueOf(lastIfdefFalse), ifdef_level);
ifdef_level++;
} else if (parseString.startsWith("#ifndef")) {
String varname = parseString.substring(7).trim();
Expand All @@ -8211,7 +8211,7 @@ private void LoadHierarchyInternal(final String hierarchyFileName) throws Except
if (ifdef_vector.size() < ifdef_level + 1) {
ifdef_vector.setSize(ifdef_level + 1);
}
ifdef_vector.setElementAt(new Boolean(lastIfdefFalse), ifdef_level);
ifdef_vector.setElementAt(Boolean.valueOf(lastIfdefFalse), ifdef_level);
ifdef_level++;
} else if (parseString.startsWith("#define")) {
if (insideFalseIfdef) {
Expand Down Expand Up @@ -8255,7 +8255,7 @@ private void LoadHierarchyInternal(final String hierarchyFileName) throws Except
Boolean lastIfdefFalseBoolean = (Boolean) ifdef_vector.get(ifdef_level - 1);
lastIfdefFalse = lastIfdefFalseBoolean.booleanValue();
lastIfdefFalse = !lastIfdefFalse;
lastIfdefFalseBoolean = new Boolean(lastIfdefFalse);
lastIfdefFalseBoolean = Boolean.valueOf(lastIfdefFalse);
ifdef_vector.setElementAt(lastIfdefFalseBoolean, ifdef_level - 1);
insideFalseIfdef = lastIfdefFalse;
} else if (parseString.startsWith("#endif")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CodeGenFrame extends Frame implements WindowListener

static public int codegen_frames = 0;
static public boolean in_an_applet = false;
Applet innerApplet = null;
// Container innerApplet = null;


// CodeGenFrame constructor
Expand Down Expand Up @@ -111,19 +111,19 @@ public void windowOpened(WindowEvent evt)

public void windowClosing(WindowEvent evt)
{
try
{
if(null != innerApplet)
{
innerApplet.stop();
innerApplet = null;
removeAll();
}
}
catch(Exception e)
{
e.printStackTrace();
}
// try
// {
// if(null != innerApplet)
// {
// innerApplet.stop();
// innerApplet = null;
// removeAll();
// }
// }
// catch(Exception e)
// {
// e.printStackTrace();
// }
try
{
dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public void update(NMLFormatConverter NMLfc) {
NMLfc.msg_type = type;
} else {
if (cmd_stream) {
ltype = new Long(type);
ltype = Long.valueOf(type);
typeInfo = (StructureTypeInfo) ModuleInfo.m_cmd_structInfoHashTable.get(ltype);
if (typeInfo == null && null != ModuleInfo.m_structInfoHashTable) {
typeInfo = (StructureTypeInfo) ModuleInfo.m_structInfoHashTable.get(ltype);
Expand All @@ -395,7 +395,7 @@ public void update(NMLFormatConverter NMLfc) {
}

} else if (stat_stream && ModuleInfo.m_stat_structInfoHashTable != null) {
ltype = new Long(type);
ltype = Long.valueOf(type);
typeInfo = (StructureTypeInfo) ModuleInfo.m_stat_structInfoHashTable.get(ltype);
if (typeInfo == null && null != ModuleInfo.m_structInfoHashTable) {
typeInfo = (StructureTypeInfo) ModuleInfo.m_structInfoHashTable.get(ltype);
Expand All @@ -408,7 +408,7 @@ public void update(NMLFormatConverter NMLfc) {
}
}
} else {
ltype = new Long(type);
ltype = Long.valueOf(type);
typeInfo = (StructureTypeInfo) ModuleInfo.m_structInfoHashTable.get(ltype);
if (typeInfo == null && null != ModuleInfo.m_stat_structInfoHashTable) {
typeInfo = (StructureTypeInfo) ModuleInfo.m_stat_structInfoHashTable.get(ltype);
Expand Down Expand Up @@ -734,7 +734,7 @@ public void update(NMLFormatConverter NMLfc) {
}
if (debug_on) {
for (int ii = 0; ii < array_length; ii++) {
System.out.print((new Integer((int) bao.array[ii])).toString() + " ");
System.out.print((Integer.toString((int) bao.array[ii])) + " ");
}
DebugPrint("");
}
Expand Down Expand Up @@ -938,7 +938,7 @@ public void update(NMLFormatConverter NMLfc) {
if (debug_on) {
DebugPrint("lengths_hashtable.put(" + fullvarname.substring(0, fullvarname.length() - 7) + ", " + ints[ints_in_message] + ")");
}
lengths_hashtable.put(fullvarname.substring(0, fullvarname.length() - 7), new Integer(ints[ints_in_message]));
lengths_hashtable.put(fullvarname.substring(0, fullvarname.length() - 7), (ints[ints_in_message]));
}
ints_in_message++;
continue;
Expand Down
Loading

0 comments on commit 510164c

Please sign in to comment.