void (@NotNull ExternalDependency targetDependency, @NotNull String newScope) { if (targetDependency.getScope().equals(COMPILE_SCOPE) || !(targetDependency instanceof AbstractExternalDependency)) { return; } final AbstractExternalDependency dep = ((AbstractExternalDependency)targetDependency); if (newScope.equals(COMPILE_SCOPE)) { dep.setScope(COMPILE_SCOPE); } if ((dep.getScope().equals(RUNTIME_SCOPE) && newScope.equals(PROVIDED_SCOPE)) || (dep.getScope().equals(PROVIDED_SCOPE) && newScope.equals(RUNTIME_SCOPE))) { dep.setScope(COMPILE_SCOPE); } }