public String getHash(final JvmDeclaredType type) {
   if (type.eResource() instanceof TypeResource) {
     IMirror mirror = ((TypeResource) type.eResource()).getMirror();
     if (mirror instanceof IMirrorExtension && ((IMirrorExtension) mirror).isSealed())
       return type.getIdentifier();
   }
   return cache.get(
       Tuples.create(HASH_CACHE_KEY, type),
       type.eResource(),
       new Provider<String>() {
         public String get() {
           return signatureBuilderProvider.get().appendSignature(type).hash();
         }
       });
 }
Ejemplo n.º 2
0
 @Test
 public void testBug300216() {
   JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName("java.lang.Object");
   assertTrue(type.getSuperTypes().isEmpty());
   URI unresolveableType = URI.createURI("java:/Objects/Something#Something");
   JvmVoid proxy = TypesFactory.eINSTANCE.createJvmVoid();
   JvmParameterizedTypeReference typeReference =
       TypesFactory.eINSTANCE.createJvmParameterizedTypeReference();
   typeReference.setType(proxy);
   ((InternalEObject) proxy).eSetProxyURI(unresolveableType);
   type.getSuperTypes().add(typeReference);
   assertTrue(type.getSuperTypes().get(0).getType().eIsProxy());
   assertEquals(2, type.eResource().getResourceSet().getResources().size());
 }