Skip to content

Commit

Permalink
Update Javadoc @returns that have deviated from code
Browse files Browse the repository at this point in the history
We shouldn't describe a method as returning a "set of" anything when it
actually returns an array.

We shouldn't describe a method as returning `true` or `false` when it
actually returns a `byte`.
  • Loading branch information
liblit committed Oct 8, 2024
1 parent 904a3a4 commit af63831
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
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
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 af63831

Please sign in to comment.