Skip to content

Commit

Permalink
Revert "Issue a warning instead of throwing an exception."
Browse files Browse the repository at this point in the history
This reverts commit 5d72128.
  • Loading branch information
khatchad committed Jul 25, 2024
1 parent 5d72128 commit abc9b16
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,29 @@ private Util() {}

/**
* If the given {@link ConstantKey}'s value is <code>null</code>, then issue a warning and return
* <code>null</code>. Otherwise, issue a warning stating that an {@link AllocationSiteInNode}
* cannot be extracted from the given {@link ConstantKey}. A value of <code>
* <code>null</code>. Otherwise, throw an {@link IllegalArgumentException} stating that an {@link
* AllocationSiteInNode} cannot be extracted from the given {@link ConstantKey}. A value of <code>
* null</code> most likely indicates that a receiver can potentially be <code>null</code>.
*
* @param constantKey The {@link ConstantKey} from which to extract the corresponding {@link
* AllocationSiteInNode}.
* @return <code>null</code>.
* @return <code>null</code> if the given {@link ConstantKey}'s value is <code>null</code>.
* @throws IllegalArgumentException If the constant's value is another else other than <code>null
* </code>.
*/
private static AllocationSiteInNode getAllocationSiteInNode(ConstantKey<?> constantKey) {
Object value = constantKey.getValue();

if (value == null)
if (value == null) {
LOGGER.warning("Can't extract AllocationSiteInNode from: " + constantKey + ".");
else
LOGGER.warning(
return null;
} else
throw new IllegalArgumentException(
"Can't extract AllocationSiteInNode from: "
+ constantKey
+ ". Not expecting value of: "
+ value
+ " from ConstantKey.");

return null;
}

/**
Expand Down

0 comments on commit abc9b16

Please sign in to comment.