Skip to content

Commit

Permalink
Fix ReportDialog's code loading logic (#275)
Browse files Browse the repository at this point in the history
* Fix bug in ReportDialog

Now it will always contain the last file opened.

* Mention the new report dialog in release notes
  • Loading branch information
lupino3 committed Jan 25, 2020
1 parent abcdc42 commit c5de677
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion RELEASE_NOTES
Expand Up @@ -12,7 +12,8 @@ Notes for this release:
This is version 1.2.6 of EduMIPS64, a release that follows up on version
1.2.5, that was released in August 2018. This release contains a couple of
changes, a new instruction alias (DMULU for DMULTU), an increased memory
size (640kB) and several bug fixes.
size (640kB), a better way to report bugs via GitHub and several bug fixes.

The codename for this release is Phlegmatic. First because it took a while
to release a new version after 1.2.5. Second because I am releasing it while
fighting with a bad and annoying cough, which I hope goes away as soon as
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/edumips64/Main.java
Expand Up @@ -501,7 +501,6 @@ private static void openFile(String file) {
cpu.reset();
symTab.reset();
dinero.reset();

try {
// Update GUI components
front.updateComponents();
Expand All @@ -515,7 +514,9 @@ private static void openFile(String file) {

try {
String absoluteFilename = new File(file).getAbsolutePath();
code = parser.parse(absoluteFilename);
LocalFileUtils lfu = new LocalFileUtils();
code = lfu.ReadFile(absoluteFilename);
parser.parse(absoluteFilename);
} catch (ParserMultiWarningException pmwe) {
new ErrorDialog(mainFrame, pmwe.getExceptionList(), CurrentLocale.getString("GUI_PARSER_ERROR"), configStore.getBoolean(ConfigKey.WARNINGS));
} catch (NullPointerException e) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/edumips64/core/parser/Parser.java
Expand Up @@ -110,14 +110,13 @@ public Parser(FileUtils utils, SymbolTable symTab, Memory memory, InstructionBui
* @throws SecurityException if a security manager exists and its checkRead method denies read access to the file.
* @returns A string containing the code parsed.
*/
public String parse(String filename) throws ParserMultiException, ReadException {
public void parse(String filename) throws ParserMultiException, ReadException {
logger.info("About to parse " + filename);
this.filename = filename;
basePath = fileUtils.GetBasePath(filename);
String code = preprocessor(filename);
doParsing(code);
logger.info(filename + " correctly parsed.");
return code;
}

/** Replace all Tabulator with space
Expand Down

0 comments on commit c5de677

Please sign in to comment.