Skip to content

Commit 217ba50

Browse files
mernsterfan-arvan
authored andcommitted
Comment changes (#6700)
1 parent 1d5fb60 commit 217ba50

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

dataflow/src/main/java/org/checkerframework/dataflow/analysis/AbstractAnalysis.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,10 @@ protected boolean updateNodeValues(Node node, TransferResult<V, S> transferResul
468468
* @param b the block to add to {@link #worklist}
469469
*/
470470
protected void addToWorklist(Block b) {
471-
// TODO: use a more efficient way to check if b is already present
471+
// TODO: This costs linear (!) time. Use a more efficient way to check if b is already present.
472+
// Two possibilities:
473+
// * add unconditionally, and detect duplicates when removing from the queue.
474+
// * maintain a HashSet of the elements that are already in the queue.
472475
if (!worklist.contains(b)) {
473476
worklist.add(b);
474477
}

dataflow/src/main/java/org/checkerframework/dataflow/analysis/TransferInput.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
/**
1212
* {@code TransferInput} is used as the input type of the individual transfer functions of a {@link
1313
* ForwardTransferFunction} or a {@link BackwardTransferFunction}. It also contains a reference to
14-
* the node for which the transfer function will be applied.
14+
* the node to which the transfer function will be applied.
1515
*
1616
* <p>A {@code TransferInput} contains one or two stores. If two stores are present, one belongs to
17-
* 'then', and the other to 'else'.
17+
* "then", and the other to "else".
1818
*
1919
* @param <V> type of the abstract value that is tracked
2020
* @param <S> the store type used in the analysis
@@ -36,12 +36,12 @@ public class TransferInput<V extends AbstractValue<V>, S extends Store<S>> imple
3636
protected final @Nullable S store;
3737

3838
/**
39-
* The 'then' result store (or {@code null} if none is present). See invariant at {@link #store}.
39+
* The "then" result store (or {@code null} if none is present). See invariant at {@link #store}.
4040
*/
4141
protected final @Nullable S thenStore;
4242

4343
/**
44-
* The 'else' result store (or {@code null} if none is present). See invariant at {@link #store}.
44+
* The "else" result store (or {@code null} if none is present). See invariant at {@link #store}.
4545
*/
4646
protected final @Nullable S elseStore;
4747

@@ -64,8 +64,8 @@ public long getUid(@UnknownInitialization TransferInput<V, S> this) {
6464
*
6565
* @param node the corresponding node
6666
* @param store the regular result store, or {@code null} if none is present
67-
* @param thenStore the 'then' result store, or {@code null} if none is present
68-
* @param elseStore the 'else' result store, or {@code null} if none is present
67+
* @param thenStore the "then" result store, or {@code null} if none is present
68+
* @param elseStore the "else" result store, or {@code null} if none is present
6969
* @param analysis analysis the corresponding analysis class to get intermediate flow results
7070
*/
7171
private TransferInput(
@@ -166,7 +166,7 @@ protected TransferInput(TransferInput<V, S> from) {
166166
}
167167

168168
/**
169-
* Returns the abstract value of node {@code n}, which is required to be a 'sub-node' (that is, a
169+
* Returns the abstract value of node {@code n}, which is required to be a "sub-node" (that is, a
170170
* direct or indirect child) of the node this transfer input is associated with. Furthermore,
171171
* {@code n} cannot be a l-value node. Returns {@code null} if no value is available.
172172
*

framework/src/main/java/org/checkerframework/framework/type/GenericAnnotatedTypeFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,6 +2439,7 @@ protected void addAnnotationsFromDefaultForType(
24392439
@FormatMethod
24402440
private static void log(String format, Object... args) {
24412441
if (debug) {
2442+
System.out.flush();
24422443
SystemPlume.sleep(1); // logging can interleave with typechecker output
24432444
System.out.printf(format, args);
24442445
}

0 commit comments

Comments
 (0)