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

pull-pico-changes: expose and add method #142

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public void postAsMemberOf(
* @see #computeFieldAccessType
* @see #getAnnotatedTypeLhs(Tree)
*/
private boolean computingAnnotatedTypeMirrorOfLHS = false;
protected boolean computingAnnotatedTypeMirrorOfLHS = false;

@Override
public AnnotatedTypeMirror getAnnotatedTypeLhs(Tree lhsTree) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public KeyForTypeHierarchy(
}

@Override
protected boolean isSubtype(
public boolean isSubtype(
AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) {
// TODO: THIS IS FROM THE OLD TYPE HIERARCHY. WE SHOULD FIX DATA-FLOW/PROPAGATION TO DO
// THE RIGHT THING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,15 @@ public S initialStore(
return info;
}

private void addFieldValues(
/**
* Add knowledge about field values to the store {@code info}.
*
* @param info {@code S}
* @param factory the type factory
* @param classTree the class tree
* @param methodTree the method tree
*/
protected void addFieldValues(
S info, AnnotatedTypeFactory factory, ClassTree classTree, MethodTree methodTree) {

// Add knowledge about final fields, or values of non-final fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,15 @@ protected ViewpointAdapter createViewpointAdapter() {
return null;
}

/**
* Get {@link #viewpointAdapter}.
*
* @return {@link #viewpointAdapter}
*/
public ViewpointAdapter getViewpointAdapter() {
return viewpointAdapter;
}

/**
* TypeVariableSubstitutor provides a method to replace type parameters with their arguments.
*/
Expand Down Expand Up @@ -1363,7 +1372,7 @@ private AnnotatedTypeMirror fromExpression(ExpressionTree tree) {
* @param tree the type tree
* @return the (partially) annotated type of the type in the AST
*/
/*package private*/ final AnnotatedTypeMirror fromTypeTree(Tree tree) {
public final AnnotatedTypeMirror fromTypeTree(Tree tree) {
if (shouldCache && fromTypeTreeCache.containsKey(tree)) {
return fromTypeTreeCache.get(tree).deepCopy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public boolean isSubtype(
* @return returns true if {@code subtype} is a subtype of {@code supertype} in the qualifier
* hierarchy whose top is {@code top}
*/
protected boolean isSubtype(
@Override
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't change

public boolean isSubtype(
final AnnotatedTypeMirror subtype,
final AnnotatedTypeMirror supertype,
final AnnotationMirror top) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.checkerframework.framework.type;

import javax.lang.model.element.AnnotationMirror;
import org.checkerframework.framework.util.AnnotatedTypes;

/** Compares AnnotatedTypeMirrors for subtype relationships. See also QualifierHierarchy */
Expand Down Expand Up @@ -59,4 +60,18 @@ public interface TypeHierarchy {
* present.
*/
boolean isSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype);

/**
* The same as {@link #isSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror)}, but only for the
* hierarchy of which {@code top} is the top.
*
* @param subtype possible subtype
* @param supertype possible supertype
* @param top the qualifier at the top of the hierarchy for which the subtype check should be
* preformed
* @return true if {@code subtype} is a subtype of {@code supertype} in the qualifier hierarchy
* whose top is {@code top}
*/
boolean isSubtype(
AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top);
}