Skip to content

Commit c5de677

Browse files
authored
Fix ReportDialog's code loading logic (#275)
* Fix bug in ReportDialog Now it will always contain the last file opened. * Mention the new report dialog in release notes
1 parent abcdc42 commit c5de677

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

RELEASE_NOTES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Notes for this release:
1212
This is version 1.2.6 of EduMIPS64, a release that follows up on version
1313
1.2.5, that was released in August 2018. This release contains a couple of
1414
changes, a new instruction alias (DMULU for DMULTU), an increased memory
15-
size (640kB) and several bug fixes.
15+
size (640kB), a better way to report bugs via GitHub and several bug fixes.
16+
1617
The codename for this release is Phlegmatic. First because it took a while
1718
to release a new version after 1.2.5. Second because I am releasing it while
1819
fighting with a bad and annoying cough, which I hope goes away as soon as

src/main/java/org/edumips64/Main.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ private static void openFile(String file) {
501501
cpu.reset();
502502
symTab.reset();
503503
dinero.reset();
504-
505504
try {
506505
// Update GUI components
507506
front.updateComponents();
@@ -515,7 +514,9 @@ private static void openFile(String file) {
515514

516515
try {
517516
String absoluteFilename = new File(file).getAbsolutePath();
518-
code = parser.parse(absoluteFilename);
517+
LocalFileUtils lfu = new LocalFileUtils();
518+
code = lfu.ReadFile(absoluteFilename);
519+
parser.parse(absoluteFilename);
519520
} catch (ParserMultiWarningException pmwe) {
520521
new ErrorDialog(mainFrame, pmwe.getExceptionList(), CurrentLocale.getString("GUI_PARSER_ERROR"), configStore.getBoolean(ConfigKey.WARNINGS));
521522
} catch (NullPointerException e) {

src/main/java/org/edumips64/core/parser/Parser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,13 @@ public Parser(FileUtils utils, SymbolTable symTab, Memory memory, InstructionBui
110110
* @throws SecurityException if a security manager exists and its checkRead method denies read access to the file.
111111
* @returns A string containing the code parsed.
112112
*/
113-
public String parse(String filename) throws ParserMultiException, ReadException {
113+
public void parse(String filename) throws ParserMultiException, ReadException {
114114
logger.info("About to parse " + filename);
115115
this.filename = filename;
116116
basePath = fileUtils.GetBasePath(filename);
117117
String code = preprocessor(filename);
118118
doParsing(code);
119119
logger.info(filename + " correctly parsed.");
120-
return code;
121120
}
122121

123122
/** Replace all Tabulator with space

0 commit comments

Comments
 (0)