void (AbstractExternalDependency externalDependency) { readDependencyCommonFields(reader, context, externalDependency); if (externalDependency instanceof DefaultExternalLibraryDependency) { DefaultExternalLibraryDependency libraryDependency = (DefaultExternalLibraryDependency)externalDependency; libraryDependency.setFile(readFile(reader, "file")); libraryDependency.setSource(readFile(reader, "source")); libraryDependency.setJavadoc(readFile(reader, "javadoc")); } else if (externalDependency instanceof DefaultExternalMultiLibraryDependency) { DefaultExternalMultiLibraryDependency multiLibraryDependency = (DefaultExternalMultiLibraryDependency)externalDependency; multiLibraryDependency.getFiles().addAll(readFiles(reader)); multiLibraryDependency.getSources().addAll(readFiles(reader)); multiLibraryDependency.getJavadoc().addAll(readFiles(reader)); } else if (externalDependency instanceof DefaultExternalProjectDependency) { DefaultExternalProjectDependency projectDependency = (DefaultExternalProjectDependency)externalDependency; projectDependency.setProjectPath(readString(reader, "projectPath")); projectDependency.setConfigurationName(readString(reader, "configurationName")); projectDependency.setProjectDependencyArtifacts(readFiles(reader)); projectDependency.setProjectDependencyArtifactsSources(readFiles(reader)); } else if (externalDependency instanceof DefaultFileCollectionDependency) { DefaultFileCollectionDependency fileCollectionDependency = (DefaultFileCollectionDependency)externalDependency; fileCollectionDependency.setFiles(readFiles(reader)); fileCollectionDependency.setExcludedFromIndexing(readBoolean(reader, "excludedFromIndexing")); } else if (externalDependency instanceof DefaultUnresolvedExternalDependency) { DefaultUnresolvedExternalDependency unresolvedExternalDependency = (DefaultUnresolvedExternalDependency)externalDependency; unresolvedExternalDependency.setFailureMessage(readString(reader, "failureMessage")); } else { throw new RuntimeException("Unsupported dependency type: " + externalDependency.getClass().getName()); } }