Skip to content

Commit

Permalink
Fix Checkstyle and PMD errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kyakdan committed Oct 19, 2022
1 parent e2ecc02 commit d6e0c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ public interface JXPathClassFilter {
* passed.
* @return true if the java class can be exposed via xpath, false otherwise
*/
public boolean exposeToXPath(String className);
boolean exposeToXPath(String className);
}
12 changes: 4 additions & 8 deletions src/main/java/org/apache/commons/jxpath/ri/JXPathFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @version $Revision$ $Date$
*/
public class JXPathFilter implements JXPathClassFilter {
Set<String> allowedClassesList = null;
private Set<String> allowedClassesList = null;

public JXPathFilter() {
init();
Expand All @@ -39,7 +39,7 @@ public JXPathFilter() {
public void init() {
String restrictedClasses = System.getProperty("jxpath.class.allow");
allowedClassesList = null;
if ((restrictedClasses != null) && (restrictedClasses.trim().length() > 0)) {
if (restrictedClasses != null && restrictedClasses.trim().length() > 0) {
allowedClassesList = new HashSet<>();
allowedClassesList.addAll(Arrays.asList(restrictedClasses.split(",")));
}
Expand All @@ -54,15 +54,11 @@ public void init() {
*/
@Override
public boolean exposeToXPath(String className) {
if ((allowedClassesList == null) || (allowedClassesList.size() < 1)) {
if (allowedClassesList == null || allowedClassesList.size() < 1) {
return false;
}

if (allowedClassesList.contains(className) || allowedClassesList.contains("*")) {
return true;
}

return false;
return allowedClassesList.contains(className) || allowedClassesList.contains("*");
}
}

0 comments on commit d6e0c94

Please sign in to comment.