Skip to content

Commit

Permalink
Support user preferences exported by the Export->Preferences wizard by
Browse files Browse the repository at this point in the history
removing prefixes when loading.
  • Loading branch information
dlwildschut committed Jul 28, 2015
1 parent fd7ec8b commit 01b7df7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions findbugs/src/java/edu/umd/cs/findbugs/config/UserPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ public void read(@WillClose InputStream in) throws IOException {
if (props.size() == 0) {
return;
}

Properties prefixlessProperties = new Properties();
for (Map.Entry<?, ?> e : props.entrySet()) {
if(e.getKey() instanceof String) {
String key = e.getKey().toString();
String value = e.getValue().toString();
prefixlessProperties.setProperty(key.replace("/instance/edu.umd.cs.findbugs.plugin.eclipse/", ""), value);
} else {
prefixlessProperties.put(e.getKey(), e.getValue());
}
}
props = prefixlessProperties;

for (int i = 0; i < MAX_RECENT_FILES; i++) {
String key = "recent" + i;
String projectName = (String) props.get(key);
Expand All @@ -206,6 +219,7 @@ public void read(@WillClose InputStream in) throws IOException {
}
}


for (Map.Entry<?, ?> e : props.entrySet()) {

String key = (String) e.getKey();
Expand Down

0 comments on commit 01b7df7

Please sign in to comment.