Skip to content

Commit e5d18fc

Browse files
committed
Catch UnsupportedOperationException
1 parent 9ea04c3 commit e5d18fc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenProjectMutableState.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ public void restore(MavenProject project) {
7878
}
7979

8080
private <T> void setElements(List<T> collection, List<T> elements) {
81-
if(elements != null) {
82-
collection.clear();
83-
collection.addAll(elements);
81+
try {
82+
if(elements != null) {
83+
collection.clear();
84+
collection.addAll(elements);
85+
}
86+
} catch(UnsupportedOperationException e) {
87+
System.err.println("Can't set elements as requested: ");
88+
e.printStackTrace();
8489
}
8590
}
8691

0 commit comments

Comments
 (0)