예제 #1
0
 private void doModification(final ConstructorMetadata constructor, final CustomData customData) {
   MemberHoldingTypeDetails memberHoldingTypeDetails =
       memberHoldingTypeDetailsMap.get(constructor.getDeclaredByMetadataId());
   if (memberHoldingTypeDetails != null) {
     ConstructorMetadata matchedConstructor =
         memberHoldingTypeDetails.getDeclaredConstructor(
             AnnotatedJavaType.convertFromAnnotatedJavaTypes(constructor.getParameterTypes()));
     if (matchedConstructor != null
         && !matchedConstructor.getCustomData().keySet().containsAll(customData.keySet())) {
       TypeDetailsBuilder typeDetailsBuilder = getTypeDetailsBuilder(memberHoldingTypeDetails);
       typeDetailsBuilder.addDataToConstructor(constructor, customData);
       changed = true;
     }
   }
 }
예제 #2
0
 public void addDataToConstructor(
     final ConstructorMetadata replacement, final CustomData customData) {
   // If the MIDs don't match then the proposed can't be a replacement
   if (!replacement.getDeclaredByMetadataId().equals(getDeclaredByMetadataId())) {
     return;
   }
   for (ConstructorMetadataBuilder existingConstructor : getDeclaredConstructors()) {
     if (AnnotatedJavaType.convertFromAnnotatedJavaTypes(existingConstructor.getParameterTypes())
         .equals(
             AnnotatedJavaType.convertFromAnnotatedJavaTypes(replacement.getParameterTypes()))) {
       for (Object key : customData.keySet()) {
         existingConstructor.putCustomData(key, customData.get(key));
       }
       break;
     }
   }
 }