-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b100
-
x86
-
linux
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8175424 | openjdk7u | Sundararajan Athijegannathan | P4 | Resolved | Fixed | master |
A DESCRIPTION OF THE PROBLEM :
The provided sample implementation of the method getProgram is simply contains syntax error. It is a mix of PHP and Java.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
public String getProgram(String... statements) {
int len = 0;
for (String line : statements) {
len += 1 + line.length();
}
StringBuilder sb = new StringBuilder(len);
for( String line : statements){
sb.append(line).append("\n");
}
return sb.toString();
}
ACTUAL -
public String getProgram(String... statements) {
$retval = "<?\n";
int len = statements.length;
for (int i = 0; i < len; i++) {
$retval += statements[i] + ";\n";
}
$retval += "?>";
}
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngineFactory.html#getProgram%28java.lang.String...%29
The provided sample implementation of the method getProgram is simply contains syntax error. It is a mix of PHP and Java.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
public String getProgram(String... statements) {
int len = 0;
for (String line : statements) {
len += 1 + line.length();
}
StringBuilder sb = new StringBuilder(len);
for( String line : statements){
sb.append(line).append("\n");
}
return sb.toString();
}
ACTUAL -
public String getProgram(String... statements) {
$retval = "<?\n";
int len = statements.length;
for (int i = 0; i < len; i++) {
$retval += statements[i] + ";\n";
}
$retval += "?>";
}
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngineFactory.html#getProgram%28java.lang.String...%29
- backported by
-
JDK-8175424 JavaDoc for ScriptEngineFactory.getProgram() contains an error
- Resolved