Ensures that every field in the {@code Event} are immutable to avoid confusion later.
426086
private void makeImmutable() {
        // Make the tags unmodifiable
        event.setTags(Collections.unmodifiableMap(event.getTags()));

        // Make the breadcrumbs unmodifiable
        event.setBreadcrumbs(Collections.unmodifiableList(event.getBreadcrumbs()));

        // Make the contexts unmodifiable
        Map<String, Map<String, Object>> tempContexts = new HashMap<>();
        for (Map.Entry<String, Map<String, Object>> contextEntry : event.getContexts().entrySet()) {
            tempContexts.put(contextEntry.getKey(), Collections.unmodifiableMap(contextEntry.getValue()));
        }
        event.setContexts(Collections.unmodifiableMap(tempContexts));

        // Make the extra properties unmodifiable (everything in it is still mutable though)
        event.setExtra(Collections.unmodifiableMap(event.getExtra()));

        // Make the SentryInterfaces unmodifiable
        event.setSentryInterfaces(Collections.unmodifiableMap(event.getSentryInterfaces()));
    }
868714
public void putEvents(List<Event> events) {
        List<Event> filteredEvents = filterEvents(events);
        executeHandlers(filteredEvents);
        for (Event event : filteredEvents) {
            persistenceHandler.writeEvent(event);
        }
    }
289999
public CompletableFuture<Void> accept(T event) {
    List<CompletableFuture<Void>> futures = new ArrayList<>(listeners.size());
    for (ListenerHolder listener : listeners) {
      if (listener.context != null) {
        futures.add(listener.context.execute(() -> listener.listener.accept(event)));
      } else {
        listener.listener.accept(event);
      }
    }
    return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
  }
585489
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, this,
                    RelType.CLASS_ANNOTATIONS, RelType.CLASSES_WITH_ANNOTATION);
        }
        if (fieldInfo != null) {
            for (final FieldInfo fi : fieldInfo) {
                fi.handleRepeatableAnnotations(allRepeatableAnnotationNames);
            }
        }
        if (methodInfo != null) {
            for (final MethodInfo mi : methodInfo) {
                mi.handleRepeatableAnnotations(allRepeatableAnnotationNames);
            }
        }
    }
12106
@Override
	public void setAll(boolean value) {
		checkMutable();
		if (value) {
			performAdjSet(start, finish);
		} else {
			performAdjClear(start, finish);
		}
	}
1310851
private void ensureBuilders() {
    if (this.builders == null) {
      this.builders = new ArrayList<SingleFieldBuilder<MType, BType, IType>>(messages.size());
      for (int i = 0; i < messages.size(); i++) {
        builders.add(null);
      }
    }
  }
258818
protected final boolean ignoreable(final Attribute event) {
        // Layed out like this because it is easier to understand
        // coverage. No performance differences expected compared
        // to tighter layout.
        if ("Sex".equals(event.getString())) {
            return true;
        }
        if ("Changed".equals(event.getString())) {
            return true;
        }
        if ("Ancestral File Number".equals(event.getString())) {
            return true;
        }
        if ("Title".equals(event.getString())) {
            return true;
        }
        if ("Attribute".equals(event.getString())) {
            // Only care about random attributes if they are dated
            final GetDateVisitor visitor = new GetDateVisitor();
            event.accept(visitor);
            return "".equals(visitor.getDate());
        }
        if ("Note".equals(event.getString())) {
            // Only care about notes if they are dated
            final GetDateVisitor visitor = new GetDateVisitor();
            event.accept(visitor);
            return "".equals(visitor.getDate());
        }
        return "Reference Number".equals(event.getString());
    }
1080683
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(),
                    RelType.FIELD_ANNOTATIONS, RelType.CLASSES_WITH_FIELD_ANNOTATION);
        }
    }
294943
private void processFields() {
    List<Field> fields = getAllFields();
    for (Field field : fields) {
      if (field.isAnnotationPresent(Identifier.class)) {
        processIdentifierField(field);
      } else if (field.isAnnotationPresent(Key.class)) {
        processKeyField(field);
      } else if (field.isAnnotationPresent(ParentKey.class)) {
        processParentKeyField(field);
      } else if (field.isAnnotationPresent(Embedded.class)) {
        processEmbeddedField(field);
      } else {
        processField(field);
      }
    }
  }
581347
public void propertyChange( PropertyChangeEvent evt ) {
        int[] selected = (int[]) selectionHolder.getValue();
        guarded.setEnabled(shouldEnable(selected));
    }
887624
function () {
            this.enableChange();
            if (!fieldName)
                return this.enable;
            var fieldEnable = this.getRowMeta(fieldName, 'enable')
            if (typeof fieldEnable == 'undefined' || fieldEnable == null)
                fieldEnable = true;
            return fieldEnable && this.enable
//				return this.enable && (this.getMeta(fieldName, 'enable') || false)
        }
182439
private void fireFieldChangeEvent(ResourceField field, Object oldValue, Object newValue)
   {
      //
      // Internal event handling
      //
      switch (field)
      {
         case UNIQUE_ID:
         {
            ProjectFile parent = getParentFile();
            if (oldValue != null)
            {
               parent.getResources().unmapUniqueID((Integer) oldValue);
            }
            parent.getResources().mapUniqueID((Integer) newValue, this);

            if (m_assignments.isEmpty() == false)
            {
               for (ResourceAssignment assignment : m_assignments)
               {
                  assignment.setResourceUniqueID((Integer) newValue);
               }
            }
            break;
         }

         case COST:
         case BASELINE_COST:
         {
            m_array[ResourceField.COST_VARIANCE.getValue()] = null;
            break;
         }

         case WORK:
         case BASELINE_WORK:
         {
            m_array[ResourceField.WORK_VARIANCE.getValue()] = null;
            break;
         }

         case BCWP:
         case ACWP:
         {
            m_array[ResourceField.CV.getValue()] = null;
            m_array[ResourceField.SV.getValue()] = null;
            break;
         }

         case BCWS:
         {
            m_array[ResourceField.SV.getValue()] = null;
            break;
         }

         case PEAK:
         case MAX_UNITS:
         {
            m_array[ResourceField.OVERALLOCATED.getValue()] = null;
            break;
         }

         default:
         {
            break;
         }
      }

      //
      // External event handling
      //
      if (m_listeners != null)
      {
         for (FieldListener listener : m_listeners)
         {
            listener.fieldChange(this, field, oldValue, newValue);
         }
      }
   }
926872
private boolean isSetterForField(ExecutableElement setter, VariableElement field) {
    return setter.getParameters() != null
        && setter.getParameters().size() == 1
        && setter.getParameters().get(0).asType().equals(field.asType());
    // TODO inheritance? TypeUtils is applicable?
  }
1181146
public static <S extends Subscribable, E> ModifyEvent<S, E> modifyEvent(
    		final S source, final E element, final E oldValue) {
        return new ModifyEvent<S, E>(source, element, oldValue);
    }
799756
private Map<FieldDescriptor, Object> getAllFieldsMutable() {
    final TreeMap<FieldDescriptor, Object> result =
      new TreeMap<FieldDescriptor, Object>();
    final Descriptor descriptor = internalGetFieldAccessorTable().descriptor;
    for (final FieldDescriptor field : descriptor.getFields()) {
      if (field.isRepeated()) {
        final List<?> value = (List<?>) getField(field);
        if (!value.isEmpty()) {
          result.put(field, value);
        }
      } else {
        if (hasField(field)) {
          result.put(field, getField(field));
        }
      }
    }
    return result;
  }
571868
public boolean addAll(Collection<? extends SimulatorEvent> events) {
    long lastTimeStamp = (lastEvent == null) ? Long.MIN_VALUE : lastEvent
        .getTimeStamp();
    for (SimulatorEvent e : events) {
      if (e.getTimeStamp() < lastTimeStamp) {
        throw new IllegalArgumentException("Event happens in the past: "
            + e.getClass() + "(" + e.getTimeStamp() + "<" + lastTimeStamp);
      }
      e.setInternalCount(eventCount++);
    }
    return this.events.addAll(events);
  }
1326525
function(event) {
            var target = event.target;
            if (this.checkElementByPattern(target)) {
                if (this.invalidElements.indexOf(target) > -1)
                    this.invalidElements.splice(this.invalidElements.indexOf(target), 1);
                this.publicInterface.onValidation([target]);
            } else {
                if (this.invalidElements.indexOf(target) === -1)
                    this.invalidElements.push(target);
                var legend = this.legends[this.currentValidationType] || this.legends.unknown;
                this.publicInterface.onInvalidation([target], legend);
            }
        }