Skip to content

Commit

Permalink
Merge pull request #32 from harshil-p/master
Browse files Browse the repository at this point in the history
Guava dependency version upgrade, Sets.cartesianProduct() populates List<Category> in lexicographical order in newer version. However in older version, this order wasn't guaranteed. https://guava.dev/releases/24.1.1-jre/api/docs/com/google/common/collect/Sets.html#cartesianProduct-java.util.List- https://guava.dev/releases/13.0/api/docs/com/google/common/collect/Sets.html#cartesianProduct(java.util.List)
  • Loading branch information
trumpyla authored Feb 18, 2021
2 parents 73f0d14 + ed1f051 commit 22ab230
Show file tree
Hide file tree
Showing 57 changed files with 242 additions and 188 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<slf4j.version>1.6.1</slf4j.version>
<log4j.version>1.2.14</log4j.version>
<easymock.version>3.1</easymock.version>
<guava.version>13.0.1</guava.version>
<guava.version>24.1.1-jre</guava.version>
<xml.resolver.version>1.2</xml.resolver.version>
<yammer.metrics.version>3.0.2</yammer.metrics.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
8 changes: 8 additions & 0 deletions xacml-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
<schemaDirectory>${basedir}/src/main/xsd</schemaDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
13 changes: 7 additions & 6 deletions xacml-core/src/main/java/org/xacml4j/v30/Attribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.xacml4j.v30.types.EntityExp;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
Expand Down Expand Up @@ -116,12 +117,12 @@ public boolean apply(AttributeExp a) {

@Override
public final String toString(){
return Objects.toStringHelper(this)
.add("AttributeId", attributeId)
.add("Issuer", issuer)
.add("IncludeInResult", includeInResult)
.add("Values", values)
.toString();
return MoreObjects.toStringHelper(this)
.add("AttributeId", attributeId)
.add("Issuer", issuer)
.add("IncludeInResult", includeInResult)
.add("Values", values)
.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.xacml4j.v30.pdp.AttributeAssignmentExpression;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -104,11 +105,11 @@ public int hashCode(){

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("attributeId", attributeId)
.add("category", category)
.add("value", attribute)
.add("issuer", issuer).toString();
return MoreObjects.toStringHelper(this)
.add("attributeId", attributeId)
.add("category", category)
.add("value", attribute)
.add("issuer", issuer).toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* #L%
*/

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -71,11 +72,11 @@ public BagOfAttributeExp resolve(EvaluationContext context)

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("Category", getCategory())
.add("AttributeId", attributeId)
.add("DataType", getDataType())
.add("Issuer", issuer).toString();
return MoreObjects.toStringHelper(this)
.add("Category", getCategory())
.add("AttributeId", attributeId)
.add("DataType", getDataType())
.add("Issuer", issuer).toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* #L%
*/

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -83,11 +84,11 @@ public BagOfAttributeExp resolve(EvaluationContext context)

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("Category", getCategory())
.add("Path", xpath)
.add("DataType", getDataType())
.add("ContextSelectorId", contextSelectorId).toString();
return MoreObjects.toStringHelper(this)
.add("Category", getCategory())
.add("Path", xpath)
.add("DataType", getDataType())
.add("ContextSelectorId", contextSelectorId).toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.NoSuchElementException;
import java.util.Set;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMultiset;
Expand Down Expand Up @@ -242,7 +243,7 @@ public boolean equals(Object o){

@Override
public String toString() {
return Objects.toStringHelper(this).
return MoreObjects.toStringHelper(this).
add("DataType", type.getDataType()).
add("Values", values).toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Arrays;
import java.util.Collections;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;

Expand Down Expand Up @@ -121,8 +122,8 @@ public int hashCode(){

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("TypeId", type.getDataTypeId())
.toString();
return MoreObjects.toStringHelper(this)
.add("TypeId", type.getDataTypeId())
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import java.util.Collection;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSetMultimap;
Expand Down Expand Up @@ -87,11 +88,11 @@ protected boolean equalsTo(BaseDecisionRuleResponse r) {

@Override
public final String toString(){
return Objects.toStringHelper(this)
.add("id", id)
.add("attributes", attributes)
.add("fullFillOn", fulfillOn)
.toString();
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("attributes", attributes)
.add("fullFillOn", fulfillOn)
.toString();
}

public abstract static class Builder<T extends Builder<?>>
Expand Down
11 changes: 6 additions & 5 deletions xacml-core/src/main/java/org/xacml4j/v30/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* #L%
*/

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
Expand Down Expand Up @@ -96,11 +97,11 @@ public CategoryId getCategoryId(){

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("category", categoryId)
.add("id", id)
.add("entity", entity)
.toString();
return MoreObjects.toStringHelper(this)
.add("category", categoryId)
.add("id", id)
.add("entity", entity)
.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* #L%
*/

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -51,9 +52,9 @@ public String getReferenceId(){

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("referenceId", referenceId)
.toString();
return MoreObjects.toStringHelper(this)
.add("referenceId", referenceId)
.toString();
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions xacml-core/src/main/java/org/xacml4j/v30/DNSName.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static DNSName parse(String value){
}

public String getDomainName(){
return name.name();
return name.toString();
}

/**
Expand Down Expand Up @@ -101,7 +101,7 @@ public boolean isTopPrivateDomain(){
}

public String getPublicSuffix(){
return name.publicSuffix().name();
return name.publicSuffix().toString();
}

public List<String> getDomainNameParts(){
Expand All @@ -113,7 +113,7 @@ public PortRange getPortRange(){
}

public String getTopPrivateDomain(){
return name.topPrivateDomain().name();
return name.topPrivateDomain().toString();
}

@Override
Expand Down Expand Up @@ -142,7 +142,7 @@ public String toString(){
}

public String toXacmlString() {
StringBuilder b = new StringBuilder(name.name());
StringBuilder b = new StringBuilder(name.toString());
if(!portRange.isUnbound()){
b.append(':').append(portRange.toString());
}
Expand Down
9 changes: 5 additions & 4 deletions xacml-core/src/main/java/org/xacml4j/v30/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.xacml4j.v30.types.XPathExp;
import org.xacml4j.v30.types.XacmlTypes;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -231,10 +232,10 @@ public BagOfAttributeExp getAttributeValues(String attributeId, AttributeExpType

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("attributes", attributes)
.add("content", (content != null)?DOMUtil.toString(content.getDocumentElement()):content)
.toString();
return MoreObjects.toStringHelper(this)
.add("attributes", attributes)
.add("content", (content != null)?DOMUtil.toString(content.getDocumentElement()):content)
.toString();
}

@Override
Expand Down
13 changes: 7 additions & 6 deletions xacml-core/src/main/java/org/xacml4j/v30/RequestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Set;

import com.google.common.base.Function;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
Expand Down Expand Up @@ -348,12 +349,12 @@ public Collection<Category> getIncludeInResultAttributes()

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("ReturnPolicyIDList", returnPolicyIdList)
.add("CombineDecision", combinedDecision)
.addValue(attributes.values())
.add("RequestReferences", requestReferences)
.add("RequestDefaults", requestDefaults).toString();
return MoreObjects.toStringHelper(this)
.add("ReturnPolicyIDList", returnPolicyIdList)
.add("CombineDecision", combinedDecision)
.addValue(attributes.values())
.add("RequestReferences", requestReferences)
.add("RequestDefaults", requestDefaults).toString();
}

@Override
Expand Down
10 changes: 4 additions & 6 deletions xacml-core/src/main/java/org/xacml4j/v30/RequestDefaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
* #L%
*/

import com.google.common.base.Objects;


import com.google.common.base.MoreObjects;

public class RequestDefaults
{
Expand All @@ -44,9 +42,9 @@ public XPathVersion getXPathVersion(){

@Override
public String toString(){
return Objects.toStringHelper(this)
.add("xpathVersion", xpathVersion)
.toString();
return MoreObjects.toStringHelper(this)
.add("xpathVersion", xpathVersion)
.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.xacml4j.v30.pdp.RequestSyntaxException;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;

Expand Down Expand Up @@ -57,7 +58,7 @@ public int hashCode(){

@Override
public String toString(){
return Objects
return MoreObjects
.toStringHelper(this)
.add("references", references)
.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import java.util.Collection;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -51,7 +52,7 @@ public int hashCode(){

@Override
public String toString(){
return Objects
return MoreObjects
.toStringHelper(this)
.add("results", results)
.toString();
Expand Down
3 changes: 2 additions & 1 deletion xacml-core/src/main/java/org/xacml4j/v30/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.LinkedHashMap;
import java.util.Map;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
Expand Down Expand Up @@ -199,7 +200,7 @@ public Collection<CompositeDecisionRuleIDReference> getPolicyIdentifiers(){

@Override
public String toString(){
return Objects
return MoreObjects
.toStringHelper(this)
.add("status", status)
.add("decision", decision)
Expand Down
Loading

0 comments on commit 22ab230

Please sign in to comment.