Class ASTUtil


  • public class ASTUtil
    extends Object
    Implements different methods for comparing nodes (incl. their descendents).
    • Constructor Detail

      • ASTUtil

        public ASTUtil()
    • Method Detail

      • isEqual

        public static final boolean isEqual​(@NotNull
                                            ch.uzh.ifi.seal.changedistiller.treedifferencing.Node _left,
                                            @NotNull
                                            ch.uzh.ifi.seal.changedistiller.treedifferencing.Node _right,
                                            @NotNull
                                            ASTUtil.NODE_COMPARE_MODE _mode)
                                     throws IllegalArgumentException
        Returns true if the nodes are equal with regard to parameter mode.
        Parameters:
        _mode - a ASTUtil.NODE_COMPARE_MODE object.
        _left - a Node object.
        _right - a Node object.
        Returns:
        a boolean.
        Throws:
        IllegalArgumentException - if any.
      • intersectSourceCodeChanges

        public static final Set<Object> intersectSourceCodeChanges​(Collection _a,
                                                                   Collection _b,
                                                                   boolean _relaxed)

        intersectSourceCodeChanges.

        Parameters:
        _a - a Collection object.
        _b - a Collection object.
        _relaxed - a boolean.
        Returns:
        a Set object.
      • intersectSourceCodeChanges

        public static final Set<Object> intersectSourceCodeChanges​(Collection _a,
                                                                   Collection _b,
                                                                   boolean _relaxed,
                                                                   String _cn)

        intersectSourceCodeChanges.

        Parameters:
        _a - a Collection object.
        _b - a Collection object.
        _relaxed - a boolean.
        _cn - ClassName
        Returns:
        a Set object.
      • getChangeType

        public static ch.uzh.ifi.seal.changedistiller.model.classifiers.ChangeType getChangeType​(String changeType)
        Maps string representation of ChangeType to the corresponding enumeration value.
        Parameters:
        changeType - - String representation of changeType
        Returns:
        instance of ChangeType corresponding to the SourceCodeChange EntityType
      • getJavaEntityType

        public static ch.uzh.ifi.seal.changedistiller.model.classifiers.EntityType getJavaEntityType​(String type)
        Helper method for mapping the JaveEntityTypes for source code entities to string name of EntityType in the JSON TODO : It might be better to move this into a BaseClass, might also be used for deserializing SourceCodeChange
        Parameters:
        type - a String object.
        Returns:
        Corresponding EntityType Number of SourceCodeEntityTypes