Skip to content

Commit

Permalink
Fixed loading worksheets with plugin components
Browse files Browse the repository at this point in the history
  • Loading branch information
kristian committed Feb 13, 2024
1 parent 1970f6b commit 2d29d0b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.5.1 (2024-02-13)
### Fixed
- Loading worksheets with plugin components

## 2.5.0 (2024-02-07)
### Added
- Legacy mode to open old plugins (created for version < 1.*)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>lc.kra.jds</groupId>
<artifactId>jds</artifactId>
<version>2.5.0</version>
<version>2.5.1</version>

<name>JDigitalSimulator</name>
<description>JDigitalSimulator is a plattform independend Electronic Design Automation software entirely build in Java</description>
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/lc/kra/jds/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,22 @@ public LegacyObjectInputStream(InputStream in) throws IOException {
}
return descriptor;
}
@Override
protected Class<?> resolveClass(ObjectStreamClass descriptor) throws ClassNotFoundException, IOException {
try {
return super.resolveClass(descriptor);
} catch (ClassNotFoundException e_a) {
try {
return Class.forName(descriptor.getName(), false, getSimpleClassLoader());
} catch (ClassNotFoundException e_b) {
if (hasLegacyClassLoader()) {
return Class.forName(descriptor.getName(), false, getLegacyClassLoader());
} else {
throw e_b;
}
}
}
}
public static String replaceLegacyPackage(String name) {
return name.replaceFirst("^(\\[L)?"+Pattern.quote(LEGACY_PACKAGE_PREFIX), "$1"+Matcher.quoteReplacement(PACKAGE_PREFIX));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/lc/kra/jds/gui/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@
/**
* JDigitalSimulator
* @author Kristian Kraljic
* @version 2.5.0
* @version 2.5.1
*/
public class Application extends JFrame {
private static final long serialVersionUID = -4693271310855486553L;

public static final String FILE_EXTENSION = "jdsim";
public static File pluginDirectory, currentDirectory;

private static final String VERSION = "2.5.0", COPYRIGHT = "2010-2024", LINES_OF_CODE = "9.509", WORDS_OF_CODE = "36.133", PAGES_OF_CODE = "245";
private static final String VERSION = "2.5.1", COPYRIGHT = "2010-2024", LINES_OF_CODE = "9.509", WORDS_OF_CODE = "36.133", PAGES_OF_CODE = "245";

private static final String[]
TOOLBAR_FRAME_FOCUS = new String[]{"save", "print", "print_level", "simulate", "left", "right", "up", "down", "grid", "secure", "zoom_default", "zoom", "zoom_in", "zoom_out"},
Expand Down

0 comments on commit 2d29d0b

Please sign in to comment.