Skip to content

Commit

Permalink
Merge branch 'master' into Gradle-8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
liblit authored Nov 16, 2024
2 parents f3624a4 + 7be9fb5 commit 057f70d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ public static String deployment2CanonicalTypeString(String dString) {
String baseType = dString.substring(0, arrayIndex);
int dim = (dString.length() - arrayIndex) / 2;
baseType = deployment2CanonicalTypeString(baseType);
StringBuilder result = new StringBuilder("[".repeat(dim));
result.append(baseType);
return result.toString();
return "[".repeat(dim) + baseType;
} else {
if (primitiveClassNames.get(dString) != null) {
return primitiveClassNames.get(dString);
Expand Down Expand Up @@ -102,9 +100,7 @@ public static String deployment2CanonicalDescriptorTypeString(String dString) {
String baseType = dString.substring(0, arrayIndex);
int dim = (dString.length() - arrayIndex) / 2;
baseType = deployment2CanonicalDescriptorTypeString(baseType);
StringBuilder result = new StringBuilder("[".repeat(dim));
result.append(baseType);
return result.toString();
return "[".repeat(dim) + baseType;
} else {
if (primitiveClassNames.get(dString) != null) {
return primitiveClassNames.get(dString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public IClass getConcreteType() {
/**
* @param pei a PEI instruction
* @param cha governing class hierarchy
* @return a set of ConcreteTypeKeys that represent the exceptions the PEI may throw.
* @return an array of ConcreteTypeKeys that represent the exceptions the PEI may throw.
* @throws IllegalArgumentException if pei is null
*/
public static InstanceKey[] getInstanceKeysForPEI(SSAInstruction pei, IClassHierarchy cha) {
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/com/ibm/wala/ssa/SSABuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,7 @@ public String[] getLocalNames(int index, int vn) {

public int[] allocateNewLocalsArray(int maxLocals) {
int[] result = new int[maxLocals];
for (int i = 0; i < maxLocals; i++) {
result[i] = OPTIMISTIC ? TOP : BOTTOM;
}
Arrays.fill(result, OPTIMISTIC ? TOP : BOTTOM);
return result;
}

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

import com.ibm.wala.fixpoint.AbstractOperator;
import com.ibm.wala.fixpoint.AbstractStatement;
import com.ibm.wala.fixpoint.FixedPointConstants;
import com.ibm.wala.fixpoint.IVariable;
import org.jspecify.annotations.NullUnmarked;

Expand All @@ -30,7 +31,8 @@ public abstract class GeneralStatement<T extends IVariable<T>>
/**
* Evaluate this equation, setting a new value for the left-hand side.
*
* @return true if the lhs value changed. false otherwise
* @return a constant defined by {@link FixedPointConstants} that reflects whether the lhs value
* changed
*/
@Override
public byte evaluate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package com.ibm.wala.fixedpoint.impl;

import com.ibm.wala.fixpoint.AbstractOperator;
import com.ibm.wala.fixpoint.FixedPointConstants;
import com.ibm.wala.fixpoint.IVariable;

/** An operator of the form lhs = op */
Expand All @@ -25,7 +26,8 @@ public byte evaluate(T lhs, T[] rhs) throws UnsupportedOperationException {
/**
* Evaluate this equation, setting a new value for the left-hand side.
*
* @return true if the lhs value changes. false otherwise.
* @return a constant defined by {@link FixedPointConstants} that reflects whether the lhs value
* changed
*/
public abstract byte evaluate(T lhs);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package com.ibm.wala.fixedpoint.impl;

import com.ibm.wala.fixpoint.AbstractStatement;
import com.ibm.wala.fixpoint.FixedPointConstants;
import com.ibm.wala.fixpoint.IVariable;

/** Represents a single step, restricted to a nullary operator. */
Expand All @@ -23,7 +24,8 @@ public abstract class NullaryStatement<T extends IVariable<T>>
/**
* Evaluate this equation, setting a new value for the left-hand side.
*
* @return true if the lhs value changed. false otherwise
* @return a constant defined by {@link FixedPointConstants} that reflects whether the lhs value
* changed
*/
@Override
public byte evaluate() {
Expand Down
3 changes: 2 additions & 1 deletion util/src/main/java/com/ibm/wala/fixpoint/UnaryOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public abstract class UnaryOperator<T extends IVariable<T>> extends AbstractOper
/**
* Evaluate this equation, setting a new value for the left-hand side.
*
* @return true if the lhs value changes. false otherwise.
* @return a constant defined by {@link FixedPointConstants} that reflects whether the lhs value
* changed
*/
public abstract byte evaluate(@Nullable T lhs, T rhs);

Expand Down
3 changes: 2 additions & 1 deletion util/src/main/java/com/ibm/wala/fixpoint/UnaryStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public abstract class UnaryStatement<T extends IVariable<T>>
/**
* Evaluate this equation, setting a new value for the left-hand side.
*
* @return true if the lhs value changed. false otherwise
* @return a constant defined by {@link FixedPointConstants} that reflects whether the lhs value
* changed
*/
@Override
public byte evaluate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private static Collection<String> findClassNames(String rootDir, File f) {
}

/**
* @return set of strings that are names of directories that contain "bin"
* @return duplicate-free array of strings that are names of directories that contain "bin"
*/
private static Object[] extractBinDirectories(String classpath) {
StringTokenizer t = new StringTokenizer(classpath, ";");
Expand Down

0 comments on commit 057f70d

Please sign in to comment.