/* (non-Javadoc)
   * @see org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.TypeSet#enumerate()
   */
  @Override
  public EnumeratedTypeSet enumerate() {
    if (fEnumCache == null) {
      if (fLowerBound instanceof ArrayType) {
        ArrayType at = (ArrayType) fLowerBound;
        fEnumCache =
            EnumeratedTypeSet.makeArrayTypesForElements(
                TTypes.getAllSuperTypesIterator(at.getComponentType()), getTypeSetEnvironment());
        fEnumCache.add(getJavaLangObject());
      } else
        fEnumCache =
            new EnumeratedTypeSet(
                TTypes.getAllSuperTypesIterator(fLowerBound), getTypeSetEnvironment());

      fEnumCache.add(fLowerBound);
      fEnumCache.initComplete();
    }
    return fEnumCache;
  }
示例#2
0
 /* (non-Javadoc)
  * @see org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.TypeSet#contains(TType)
  */
 @Override
 public boolean contains(TType t) {
   if (!(t instanceof ArrayType)) return false;
   ArrayType at = (ArrayType) t;
   return fElemTypeSet.contains(at.getComponentType());
 }