IDEADEV-41212: Created an artifact from a folder, then renamed the artifact and it broke the link with the artifact I extracted it from (90.137)

This commit is contained in:
nik
2009-11-06 12:58:08 +03:00
parent 6a159827e5
commit d214956031
22 changed files with 213 additions and 114 deletions
@@ -33,5 +33,8 @@ public interface ArtifactModel {
@NotNull
Artifact getArtifactByOriginal(@NotNull Artifact artifact);
@NotNull
Artifact getOriginalArtifact(@NotNull Artifact artifact);
Collection<? extends Artifact> getArtifactsByType(@NotNull ArtifactType type);
}
@@ -24,11 +24,14 @@ import org.jetbrains.annotations.NotNull;
public interface ArtifactPointer {
@NotNull
String getName();
String getArtifactName();
@Nullable
Artifact getArtifact();
@NotNull
String getArtifactName(@NotNull ArtifactModel artifactModel);
@Nullable
Artifact findArtifact(@NotNull ArtifactModel artifactModel);
@@ -27,7 +27,9 @@ public abstract class ArtifactPointerManager {
return ServiceManager.getService(project, ArtifactPointerManager.class);
}
public abstract ArtifactPointer create(@NotNull String name);
public abstract ArtifactPointer createPointer(@NotNull String name);
public abstract ArtifactPointer create(@NotNull Artifact artifact);
public abstract ArtifactPointer createPointer(@NotNull Artifact artifact);
public abstract ArtifactPointer createPointer(@NotNull Artifact artifact, @NotNull ArtifactModel artifactModel);
}
@@ -35,10 +35,17 @@ public interface ModifiableArtifactModel extends ArtifactModel {
@NotNull
ModifiableArtifact getOrCreateModifiableArtifact(@NotNull Artifact artifact);
@Nullable
Artifact getModifiableCopy(Artifact artifact);
void addListener(@NotNull ArtifactListener listener);
void removeListener(@NotNull ArtifactListener listener);
boolean isModified();
void commit();
@Nullable
Artifact getModifiableCopy(Artifact artifact);
void dispose();
}
@@ -20,6 +20,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.project.Project;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.artifacts.ArtifactPointer;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -53,6 +54,9 @@ public abstract class PackagingElementFactory {
@NotNull
public abstract List<? extends PackagingElement<?>> createLibraryElements(@NotNull Library library);
@NotNull
public abstract PackagingElement<?> createArtifactElement(@NotNull ArtifactPointer artifactPointer, @NotNull Project project);
@NotNull
public abstract PackagingElement<?> createArtifactElement(@NotNull Artifact artifact, @NotNull Project project);