< prev index next >

src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/WildcardTypeImpl.java

Print this page
*** 51,12 ***
  
      /** The lower bounds.  Lazily converted from FieldTypeSignature[] to Type[]. */
      private volatile Object[] lowerBounds;
  
      // constructor is private to enforce access through static factory
!     private WildcardTypeImpl(FieldTypeSignature[] ubs,
!                              FieldTypeSignature[] lbs,
                               GenericsFactory f) {
          super(f);
          upperBounds = ubs;
          lowerBounds = lbs;
      }
--- 51,12 ---
  
      /** The lower bounds.  Lazily converted from FieldTypeSignature[] to Type[]. */
      private volatile Object[] lowerBounds;
  
      // constructor is private to enforce access through static factory
!     private WildcardTypeImpl(Object[] ubs,
!                              Object[] lbs,
                               GenericsFactory f) {
          super(f);
          upperBounds = ubs;
          lowerBounds = lbs;
      }

*** 75,10 ***
--- 75,21 ---
                                          FieldTypeSignature[] lbs,
                                          GenericsFactory f) {
          return new WildcardTypeImpl(ubs, lbs, f);
      }
  
+     /**
+      * Eager factory method.
+      * @param ubs - an array of types representing the upper bounds
+      * @param lbs - an array of types representing the lower bounds
+      * @return a wild card type with the requested bounds
+      */
+     public static WildcardTypeImpl make(Type[] ubs,
+                                         Type[] lbs) {
+         return new WildcardTypeImpl(ubs, lbs, null);
+     }
+ 
      /**
       * Returns an array of {@code Type} objects representing the upper
       * bound(s) of this type variable.  Note that if no upper bound is
       * explicitly declared, the upper bound is {@code Object}.
       *
< prev index next >