Skip to content

Commit

Permalink
Fix#8 the default value of keepgenerated is false only in JDK 6.
Browse files Browse the repository at this point in the history
Signed-off-by: hs536 <sawamura.hiroki@fujitsu.com>
  • Loading branch information
hs536 committed Jun 21, 2021
1 parent deb28ea commit 4a9ab1f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/org/apache/jasper/EmbeddedServletOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ public EmbeddedServletOptions(ServletConfig config, ServletContext context) {
}
// END SJSAS 6384538

// keepgenerated default is false for JDK6 for later, true otherwise
keepGenerated = getBoolean(config, !isJDK6(), "keepgenerated");
// keepgenerated default is false for JDK6 or later, true otherwise
keepGenerated = getBoolean(config, !isJDK6orLater(), "keepgenerated");
saveBytecode = getBoolean(config, saveBytecode, "saveBytecode");
trimSpaces = getBoolean(config, trimSpaces, "trimSpaces");
isPoolingEnabled = getBoolean(config, isPoolingEnabled, "enablePooling");
Expand Down Expand Up @@ -725,7 +725,8 @@ private boolean getBoolean(ServletConfig config, boolean init, String param) {
/*
* returns true if running with JDK 6 or later.
*/
private boolean isJDK6() {
return "1.6".equals(System.getProperty("java.specification.version"));
private boolean isJDK6orLater() {
Double version = Double.valueOf(System.getProperty("java.specification.version"));
return (version >= 1.6);
}
}

0 comments on commit 4a9ab1f

Please # to comment.