@Override public void apply(Changes changes) { apply(changes.clone(), null); }
/** * Make sure that a workspace with the supplied name exists. * * @param workspaceName the name of the workspace; may not be null */ protected void predefineWorkspace( RepositoryConfiguration configuration, String workspaceName ) { assertThat(workspaceName, is(notNullValue())); // Edit the configuration ... Editor editor = configuration.edit(); EditableDocument workspaces = editor.getOrCreateDocument("workspaces"); EditableArray predefined = workspaces.getOrCreateArray("predefined"); predefined.addStringIfAbsent(workspaceName); // And apply the changes ... Changes changes = editor.getChanges(); if (changes.isEmpty()) return; try { repository.apply(changes); } catch (Exception e) { e.printStackTrace(); throw new AssertionFailedError("Unexpected error while predefining the \"" + workspaceName + "\" workspace:" + e.getMessage()); } }
@Override public void apply(Changes changes, Observer observer) { if (changes.isEmpty()) { return;
@Override public void apply(Changes changes, Observer observer) { if (changes.isEmpty()) { return;
@Override public void apply(Changes changes) { apply(changes.clone(), null); }