I have been tasked with changing a java file that I had to get from a decompiler. I am not so familiar and get errors compiling as follows:
C:\Program Files\IBM\SQLLIB\java\jdk\bin>javac C:\jarsSrc\dbms\Main.java
C:\jarsSrc\dbms\Main.java:258: int cannot be dereferenced
for(i = Integer.valueOf(0); i.intValue() < lines.length
^
C:\jarsSrc\dbms\Main.java:260: int cannot be dereferenced
if(lines[i.intValue()].equals((new StringBuilder()).append("NAME: ")
.append(apiname).toString()))
^
C:\jarsSrc\dbms\Main.java:262: int cannot be dereferenced
j = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:262: operator + cannot be applied to <any>,int
j = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:265: int cannot be dereferenced
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:265: operator + cannot be applied to <any>,int
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:269: int cannot be dereferenced
System.out.println((new StringBuilder()).append("Found API base url for
").append(apiname).append(": Using ").append(lines[j.intValue()]).toString());
^
C:\jarsSrc\dbms\Main.java:270: int cannot be dereferenced
return lines[j.intValue()];
^
8 errors
HERE is the section of code returning the errors:
public static String get_api_url(String apiname)
{
int i ;
int j ;
String lines[];
String html = getHTML(" BEFORE POSTING");
html = html.replace("URL: ", "");
lines = html.split("\n");
for(i = Integer.valueOf(0); i < lines.length
{
if(lines[i.intValue()].equals((new StringBuilder()).append("NAME: ").append(apiname).toString()))
{
j = Integer.valueOf(i.intValue() + 1);
}
Integer integer = i;
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
// integer;
}
System.out.println((new StringBuilder()).append("Found API base url for ").append(apiname).append(": Using ").append(lines[j.intValue()]).toString());
return lines[j.intValue()];
Exception e;
System.err.println("Can't find this API, returning the default.");
return " BEFORE POSTING=";
}
}
C:\Program Files\IBM\SQLLIB\java\jdk\bin>javac C:\jarsSrc\dbms\Main.java
C:\jarsSrc\dbms\Main.java:258: int cannot be dereferenced
for(i = Integer.valueOf(0); i.intValue() < lines.length
^
C:\jarsSrc\dbms\Main.java:260: int cannot be dereferenced
if(lines[i.intValue()].equals((new StringBuilder()).append("NAME: ")
.append(apiname).toString()))
^
C:\jarsSrc\dbms\Main.java:262: int cannot be dereferenced
j = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:262: operator + cannot be applied to <any>,int
j = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:265: int cannot be dereferenced
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:265: operator + cannot be applied to <any>,int
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
^
C:\jarsSrc\dbms\Main.java:269: int cannot be dereferenced
System.out.println((new StringBuilder()).append("Found API base url for
").append(apiname).append(": Using ").append(lines[j.intValue()]).toString());
^
C:\jarsSrc\dbms\Main.java:270: int cannot be dereferenced
return lines[j.intValue()];
^
8 errors
HERE is the section of code returning the errors:
public static String get_api_url(String apiname)
{
int i ;
int j ;
String lines[];
String html = getHTML(" BEFORE POSTING");
html = html.replace("URL: ", "");
lines = html.split("\n");
for(i = Integer.valueOf(0); i < lines.length
{
if(lines[i.intValue()].equals((new StringBuilder()).append("NAME: ").append(apiname).toString()))
{
j = Integer.valueOf(i.intValue() + 1);
}
Integer integer = i;
Integer integer1 = i = Integer.valueOf(i.intValue() + 1);
// integer;
}
System.out.println((new StringBuilder()).append("Found API base url for ").append(apiname).append(": Using ").append(lines[j.intValue()]).toString());
return lines[j.intValue()];
Exception e;
System.err.println("Can't find this API, returning the default.");
return " BEFORE POSTING=";
}
}