Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
- not perfect, but in few hours significantly improved coverage after 21 years.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Sep 26, 2022
1 parent d79b3b1 commit 3b2b201
Show file tree
Hide file tree
Showing 13 changed files with 596 additions and 917 deletions.
9 changes: 9 additions & 0 deletions impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,15 @@ Copyright &#169; 2019, ${current.year} Eclipse Foundation. All rights reserved.
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997-2020 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
* Copyright (c) 2020 Payara Servicer Ltd.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,10 +16,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.taglibs.standard.lang.jstl.parser;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Vector;

Expand Down Expand Up @@ -718,7 +719,7 @@ final public FunctionInvocation FunctionInvocation() throws ParseException {
break;
}
jj_consume_token(RPAREN);
String allowed = System.getProperty("jakarta.servlet.jsp.functions.allowed");
String allowed = System.getProperty(ELParserConstants.SYSTEM_PROPERTY_ALLOW_FUNCTIONS);
if (allowed == null || !allowed.equalsIgnoreCase("true")) {
throw new ParseException("EL functions are not supported.");
}
Expand Down Expand Up @@ -1109,10 +1110,10 @@ private int jj_ntk() {
}
}

private Vector<int[]> jj_expentries = new Vector<>();
private final Vector<int[]> jj_expentries = new Vector<>();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private final int[] jj_lasttokens = new int[100];
private int jj_endpos;

private void jj_add_error_token(int kind, int pos) {
Expand All @@ -1125,8 +1126,7 @@ private void jj_add_error_token(int kind, int pos) {
jj_expentry = new int[jj_endpos];
System.arraycopy(jj_lasttokens, 0, jj_expentry, 0, jj_endpos);
boolean exists = false;
for (Enumeration<int[]> enum_ = jj_expentries.elements(); enum_.hasMoreElements();) {
int[] oldentry = enum_.nextElement();
for (int[] oldentry : jj_expentries) {
if (oldentry.length == jj_expentry.length) {
exists = true;
for (int i = 0; i < jj_expentry.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
Expand All @@ -18,6 +19,8 @@
package org.apache.taglibs.standard.lang.jstl.parser;

public interface ELParserConstants {
String SYSTEM_PROPERTY_ALLOW_FUNCTIONS = "jakarta.servlet.jsp.functions.allowed";


int EOF = 0;
int NON_EXPRESSION_TEXT = 1;
Expand Down
Loading

0 comments on commit 3b2b201

Please sign in to comment.