Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tweaks to @Initializer annotations in wala.util #1474

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions util/src/main/java/com/ibm/wala/qual/Initializer.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.ibm.wala.util.collections.NonNullSingletonIterator;
import com.ibm.wala.util.debug.UnimplementedError;
import com.ibm.wala.util.graph.NumberedGraph;
import com.uber.nullaway.annotations.Initializer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NoSuchElementException;
Expand All @@ -32,9 +33,10 @@ public abstract class DFSDiscoverTimeIterator<T> extends ArrayList<T> implements
private static final long serialVersionUID = 4238700455408861924L;

/** an enumeration of all nodes to search from */
private @Nullable Iterator<? extends T> roots;
private Iterator<? extends T> roots;

/** subclass constructors must call this! */
@Initializer
protected void init(Iterator<? extends T> nodes) {
roots = nodes;
assert nodes != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
package com.ibm.wala.util.graph.traverse;

import com.ibm.wala.qual.Initializer;
import com.ibm.wala.util.collections.EmptyIterator;
import com.ibm.wala.util.collections.Iterator2Iterable;
import com.ibm.wala.util.debug.UnimplementedError;
import com.ibm.wala.util.graph.Graph;
import com.uber.nullaway.annotations.Initializer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NoSuchElementException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
package com.ibm.wala.util.graph.traverse;

import com.ibm.wala.util.graph.Graph;
import com.uber.nullaway.annotations.Initializer;
import java.util.Iterator;
import org.jspecify.annotations.NullUnmarked;
import org.jspecify.annotations.Nullable;

abstract class GraphDFSDiscoverTimeIterator<T> extends DFSDiscoverTimeIterator<T> {

private static final long serialVersionUID = -5673397879499010863L;

/** the graph being searched */
private @Nullable Graph<T> G;
private Graph<T> G;

@Initializer
protected void init(Graph<T> G, Iterator<? extends T> nodes) {
if (G == null) {
throw new IllegalArgumentException("G is null");
Expand All @@ -30,7 +30,6 @@ protected void init(Graph<T> G, Iterator<? extends T> nodes) {
super.init(nodes);
}

@NullUnmarked
@Override
protected Iterator<? extends T> getConnected(T n) {
return G.getSuccNodes(n);
Expand Down
Loading