Ejemplo n.º 1
0
  private void removeValue(int inputId, Value value) {
    final Object input = getInput(value);
    if (input == null) {
      return;
    }

    if (input instanceof ChangeBufferingList) {
      final ChangeBufferingList changesList = (ChangeBufferingList) input;
      changesList.remove(inputId);
      if (!changesList.isEmpty()) return;
    } else if (input instanceof Integer) {
      if (((Integer) input).intValue() != inputId) {
        return;
      }
    }

    if (!(myInputIdMapping instanceof THashMap)) {
      myInputIdMapping = null;
      myInputIdMappingValue = null;
    } else {
      THashMap<Value, Object> mapping = (THashMap<Value, Object>) myInputIdMapping;
      mapping.remove(value);
      if (mapping.size() == 1) {
        myInputIdMapping = mapping.keySet().iterator().next();
        myInputIdMappingValue = mapping.get((Value) myInputIdMapping);
      }
    }
  }
 protected void readExternalImpl(Element e) {
   if (e.getAttribute("injector-id") == null) {
     setClassName(JDOMExternalizer.readString(e, "CLASS"));
     // setApplyInHierarchy(JDOMExternalizer.readBoolean(e, "APPLY_IN_HIERARCHY"));
     readOldFormat(e);
     final THashMap<String, String> map = new THashMap<>();
     JDOMExternalizer.readMap(e, map, null, "SIGNATURES");
     for (String s : map.keySet()) {
       final String fixedSignature = fixSignature(s, false);
       myParameterMap.put(fixedSignature, new MethodInfo(fixedSignature, map.get(s)));
     }
   }
 }