You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/04/22 17:00:49 UTC
[tomcat] branch master updated (e663ab0 -> bf5b9fe)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.
from e663ab0 Code clean-up. No functional change. Primarily to trigger a CI build.
new b58cc11 Remove unnecessary code.
new 7dcf54b Remove unused code
new 1c1fb14 Remove unnecessary code.
new bf5b9fe Remove unnecessary code
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java/org/apache/jasper/compiler/Generator.java | 64 +++++++++++++-------------
1 file changed, 32 insertions(+), 32 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 04/04: Remove unnecessary code
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit bf5b9feca166557134120f0fc5210588c7b3673d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 22 17:19:05 2021 +0100
Remove unnecessary code
---
java/org/apache/jasper/compiler/Generator.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index c98ddf7..474ac5c 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2802,10 +2802,12 @@ class Generator {
if (varName == null) {
varName = n.getTagData().getAttributeString(
tagVarInfo.getNameFromAttribute());
- } else if (tagVarInfo.getNameFromAttribute() != null) {
- // alias
- continue;
}
+ // Alias is not possible here.
+ // Alias can only be configured for tag files. As SimpleTag
+ // implementations, isFragment will always be true above
+ // hence execution never reaches this point.
+
String tmpVarName = "_jspx_" + varName + "_"
+ n.getCustomNestingLevel();
out.printin(tmpVarName);
@@ -2872,10 +2874,12 @@ class Generator {
if (varName == null) {
varName = n.getTagData().getAttributeString(
tagVarInfo.getNameFromAttribute());
- } else if (tagVarInfo.getNameFromAttribute() != null) {
- // alias
- continue;
}
+ // Alias is not possible here.
+ // Alias can only be configured for tag files. As SimpleTag
+ // implementations, isFragment will always be true above
+ // hence execution never reaches this point.
+
String tmpVarName = "_jspx_" + varName + "_"
+ n.getCustomNestingLevel();
out.printin(varName);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 01/04: Remove unnecessary code.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit b58cc1149894633ff426b1dd993f2745dfc4a0cc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 21 09:42:48 2021 +0100
Remove unnecessary code.
If useTagPlugin has been set to true, then getAtSTag() and getAtETag()
will also have been configured to return non-null values.
---
java/org/apache/jasper/compiler/Generator.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index b7ad241..6304797 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2361,13 +2361,9 @@ class Generator {
}
private void generateTagPlugin(Node.CustomTag n) throws JasperException {
- if (n.getAtSTag() != null) {
- n.getAtSTag().visit(this);
- }
+ n.getAtSTag().visit(this);
visitBody(n);
- if (n.getAtETag() != null) {
- n.getAtETag().visit(this);
- }
+ n.getAtETag().visit(this);
}
private void generateCustomStart(Node.CustomTag n,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 02/04: Remove unused code
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 7dcf54b7a7f5fdd9560241d25427aba3e8899a84
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 21 12:51:04 2021 +0100
Remove unused code
---
java/org/apache/jasper/compiler/Generator.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index 6304797..df5bd9d 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2334,7 +2334,9 @@ class Generator {
public void visit(Node.AttributeGenerator n) throws JasperException {
Node.CustomTag tag = n.getTag();
Node.JspAttribute[] attrs = tag.getJspAttributes();
- for (int i = 0; attrs != null && i < attrs.length; i++) {
+ // The TagPluginManager only creates AttributeGenerator nodes for
+ // attributes that are present.
+ for (int i = 0; i < attrs.length; i++) {
if (attrs[i].getName().equals(n.getName())) {
out.print(evaluateAttribute(getTagHandlerInfo(tag),
attrs[i], tag, null));
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 03/04: Remove unnecessary code.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 1c1fb14930b5ccf19d7dacaf6582c20f8b8658d6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 21 19:46:04 2021 +0100
Remove unnecessary code.
ScriptingVariabler$ScriptingVariableVisitor will already have skipped
any variables where declare is set to false.
---
java/org/apache/jasper/compiler/Generator.java | 36 ++++++++++++--------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index df5bd9d..c98ddf7 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -2714,33 +2714,31 @@ class Generator {
return;
}
+ // Note: ScriptingVariabler$ScriptingVariableVisitor will already
+ // have skipped any variables where declare is set to false.
List<Object> vec = n.getScriptingVars(scope);
if (vec != null) {
for (Object elem : vec) {
if (elem instanceof VariableInfo) {
VariableInfo varInfo = (VariableInfo) elem;
- if (varInfo.getDeclare()) {
- out.printin(varInfo.getClassName());
- out.print(" ");
- out.print(varInfo.getVarName());
- out.println(" = null;");
- }
+ out.printin(varInfo.getClassName());
+ out.print(" ");
+ out.print(varInfo.getVarName());
+ out.println(" = null;");
} else {
TagVariableInfo tagVarInfo = (TagVariableInfo) elem;
- if (tagVarInfo.getDeclare()) {
- String varName = tagVarInfo.getNameGiven();
- if (varName == null) {
- varName = n.getTagData().getAttributeString(
- tagVarInfo.getNameFromAttribute());
- } else if (tagVarInfo.getNameFromAttribute() != null) {
- // alias
- continue;
- }
- out.printin(tagVarInfo.getClassName());
- out.print(" ");
- out.print(varName);
- out.println(" = null;");
+ String varName = tagVarInfo.getNameGiven();
+ if (varName == null) {
+ varName = n.getTagData().getAttributeString(
+ tagVarInfo.getNameFromAttribute());
+ } else if (tagVarInfo.getNameFromAttribute() != null) {
+ // alias
+ continue;
}
+ out.printin(tagVarInfo.getClassName());
+ out.print(" ");
+ out.print(varName);
+ out.println(" = null;");
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org