Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix#8 the default value of keepgenerated is false only in JDK 6. #26

Merged
merged 1 commit into from
Nov 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/main/java/org/apache/jasper/EmbeddedServletOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public final class EmbeddedServletOptions implements Options {
/**
* Do you want to keep the generated Java files around?
*/
private boolean keepGenerated;
private boolean keepGenerated = false;

/**
* If class files are generated as byte arrays, should they be saved to disk at the end of compilations?
Expand Down Expand Up @@ -497,8 +497,7 @@ 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 = getBoolean(config, keepGenerated, "keepgenerated");
saveBytecode = getBoolean(config, saveBytecode, "saveBytecode");
trimSpaces = getBoolean(config, trimSpaces, "trimSpaces");
isPoolingEnabled = getBoolean(config, isPoolingEnabled, "enablePooling");
Expand Down Expand Up @@ -722,10 +721,4 @@ private boolean getBoolean(ServletConfig config, boolean init, String param) {
return init;
}

/*
* returns true if running with JDK 6 or later.
*/
private boolean isJDK6() {
return "1.6".equals(System.getProperty("java.specification.version"));
}
}