public static boolean copyFields(@NotNull Field[] fields, @NotNull Object from, @NotNull Object to, @Nullable DifferenceFilter diffFilter) { Set<Field> sourceFields = new com.intellij.util.containers.HashSet<Field>(Arrays.asList(from.getClass().getFields())); boolean valuesChanged = false; for (Field field : fields) { if (sourceFields.contains(field)) { if (isPublic(field) && !isFinal(field)) { try { if (diffFilter == null || diffFilter.isAccept(field)) { copyFieldValue(from, to, field); valuesChanged = true; } } catch (Exception e) { throw new RuntimeException(e); } } } } return valuesChanged; }
public static boolean copyFields(@Nonnull Field[] fields, @Nonnull Object from, @Nonnull Object to, @Nullable DifferenceFilter diffFilter) { Set<Field> sourceFields = new com.intellij.util.containers.HashSet<Field>(Arrays.asList(from.getClass().getFields())); boolean valuesChanged = false; for (Field field : fields) { if (sourceFields.contains(field)) { if (isPublic(field) && !isFinal(field)) { try { if (diffFilter == null || diffFilter.isAccept(field)) { copyFieldValue(from, to, field); valuesChanged = true; } } catch (Exception e) { throw new RuntimeException(e); } } } } return valuesChanged; }
public void writeExternal(Element parentElement, @NotNull final CustomCodeStyleSettings parentSettings) throws WriteExternalException { final Element childElement = new Element(myTagName); DefaultJDOMExternalizer.writeExternal(this, childElement, new DifferenceFilter<CustomCodeStyleSettings>(this, parentSettings)); if (!childElement.getContent().isEmpty()) { parentElement.addContent(childElement); } }
public void writeExternal(Element parentElement, @Nonnull final CustomCodeStyleSettings parentSettings) throws WriteExternalException { final Element childElement = new Element(myTagName); DefaultJDOMExternalizer.writeExternal(this, childElement, new DifferenceFilter<CustomCodeStyleSettings>(this, parentSettings)); if (!childElement.getContent().isEmpty()) { parentElement.addContent(childElement); } }
private void writeExternal(Element element) throws WriteExternalException { DefaultJDOMExternalizer.writeExternal(this, element, new DifferenceFilter<CodeStyleSettingsManager>(this, new CodeStyleSettingsManager())); }
public void writeExternal(Element element) throws WriteExternalException { DefaultJDOMExternalizer.writeExternal(this, element, new DifferenceFilter<LanguageOptions>(this, DEFAULT_SETTINGS_HOLDER)); }