Skip to content

Commit

Permalink
Merge pull request #1134 from fesch/bugfix
Browse files Browse the repository at this point in the history
Version 3.32-17 candidate
  • Loading branch information
fesch authored Mar 11, 2024
2 parents fc93d6c + 8d2d125 commit 95d4e6a
Show file tree
Hide file tree
Showing 18 changed files with 321 additions and 96 deletions.
4 changes: 2 additions & 2 deletions buildapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
name="Structorizer"
displayname="Structorizer"
identifier="lu.fisch.Structorizer"
shortversion="3.32-16"
version="3.32-16"
shortversion="3.32-17"
version="3.32-17"
icon="icons/Structorizer.icns"
mainclassname="Structorizer"
copyright="Bob Fisch"
Expand Down
14 changes: 12 additions & 2 deletions src/lu/fisch/structorizer/elements/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
* Kay Gürtzig 2022-08-22 Bugfix #1068: Type inference failure for array initialisers mended
* Kay Gürtzig 2023-12-14 Issue #1119: To set an empty string as text now leads to an empty StringList
* Kay Gürtzig 2024-01-22 Bugfix #1125: Equality check must consider disabled state
* Kay Gürtzig 2024-03-07 Bugfix #1128 Risk of endless loop in method retrieveComponentNmes() fixed;
* Issue #1129: Limitation of error lines in the Analyser warning popup
*
******************************************************************************************************
*
Expand Down Expand Up @@ -306,7 +308,7 @@ public String toString()
public static final long E_HELP_FILE_SIZE = 12300000;
public static final String E_DOWNLOAD_PAGE = "https://www.fisch.lu/Php/download.php";
// END KGU#791 2020-01-20
public static final String E_VERSION = "3.32-16";
public static final String E_VERSION = "3.32-17";
public static final String E_THANKS =
"Developed and maintained by\n"+
" - Robert Fisch <[email protected]>\n"+
Expand Down Expand Up @@ -352,7 +354,7 @@ public String toString()
" - DE: Klaus-Peter Reimers <[email protected]>\n"+
" - LU: Laurent Zender <[email protected]>\n"+
" - ES: Andres Cabrera <[email protected]>\n"+
" - PT/BR: Theldo Cruz <[email protected]>\n"+
" - PT/BR: Theldo Cruz Franqueiro <[email protected]>\n"+
" - IT: Andrea Maiani <[email protected]>, A. Simonetta (University of Rome Tor Vergata)\n"+
" - ZH-CN: Wang Lei <[email protected]>\n"+
" - ZH-TW: Joe Chem <[email protected]>\n"+
Expand Down Expand Up @@ -478,6 +480,9 @@ public static int getPadding() {
/** Shall warning markers be drawn in flawed elements? */
public static boolean E_ANALYSER_MARKER = true;
// END KGU#906 2021-01-02
// START KGU#1116 2024-03-07: Issue #1129
public static int E_ANALYSER_MAX_POPUP_LINES = 10;
// END KGU#1116 2024-03-07
// START KGU#123 2016-01-04: New toggle for Enh. #87
/** Is collapsing by mouse wheel rotation enabled? */
public static boolean E_WHEELCOLLAPSE = false;
Expand Down Expand Up @@ -3853,6 +3858,11 @@ else if (prevToken.equals("[")) {
path.remove(0);
}
}
// START KGU#1115 2024-03-07: Bugfix #1128: We must not get trapped in the loop
else {
varType = null;
}
// END KGU#1115 2024-03-07
}
if (varType != null && varType.isRecord()) {
// path must now be exhausted, the component names are our proposals
Expand Down
10 changes: 6 additions & 4 deletions src/lu/fisch/structorizer/elements/Root.java
Original file line number Diff line number Diff line change
Expand Up @@ -4237,7 +4237,9 @@ private boolean mayBeJavaMethod(String _var, StringList _tokens) {
}
}
} catch (ClassNotFoundException exc) {
System.err.println(exc);
// START KGU#1115 2024-03-07: Issue #1128 Nobody wants to see this except on debugging
//System.err.println(exc);
// END KGU#1115 2024-03-07
}
}
}
Expand All @@ -4264,7 +4266,7 @@ private void analyse_5_7_13(Element ele, Vector<DetectedError> _errors, StringLi
_myVars.addIfNew(((Try)ele).getExceptionVarName());
}
// END KGU#812 2020-02-21
for (int j=0; j<_myVars.count(); j++)
for (int j = 0; j < _myVars.count(); j++)
{
String myVar = _myVars.get(j);
// START KGU#343 2017-02-07: Ignore pseudo-variables (markers)
Expand All @@ -4274,9 +4276,9 @@ private void analyse_5_7_13(Element ele, Vector<DetectedError> _errors, StringLi
// END KGU#343 2017-02-07

// CHECK: non-uppercase var (#5)
if(!myVar.toUpperCase().equals(myVar) && !rootVars.contains(myVar))
if (!myVar.toUpperCase().equals(myVar) && !rootVars.contains(myVar))
{
if(!((myVar.toLowerCase().equals("result") && this.isSubroutine())))
if (!((myVar.toLowerCase().equals("result") && this.isSubroutine())))
{
//error = new DetectedError("The variable «"+myVars.get(j)+"» must be written in uppercase!",(Element) _node.getElement(i));
addError(_errors, new DetectedError(errorMsg(Menu.error05, myVar), ele), 5);
Expand Down
36 changes: 26 additions & 10 deletions src/lu/fisch/structorizer/gui/Diagram.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
* Kay Gürtzig 2023-09-12 Bugfix #1086: Defective arrangement on source import with two routines
* Kay Gürtzig 2023-11-09 Enh. #1114: Place the InputBox caret at the first question mark in
* the default text for new Elements
* Kay Gürtzig 2024-03-07 Issue #1129: Restrict the number of lines to show in a warning popup
*
******************************************************************************************************
*
Expand Down Expand Up @@ -1115,7 +1116,10 @@ public void mouseMoved(MouseEvent e) {
String text = "";
for (Entry<Element, Vector<DetectedError>> entry: errorMap.entrySet()) {
Element errEle = entry.getKey();
if (errorMap.size() > 1 || errEle != selEle) {
// START KGU#1116 2024-03-07: Issue #1129: Restrict the popup lines
//if (errorMap.size() > 1 || errEle != selEle) {
if ((errorMap.size() > 1 || errEle != selEle) && lines < Element.E_ANALYSER_MAX_POPUP_LINES) {
// END KGU#1116 2024-03-07
// This is a collapsed element, i.e., potentially represents several elements
text = ElementNames.getElementName(errEle, false, null);
StringList elText = errEle.getText();
Expand All @@ -1133,19 +1137,31 @@ public void mouseMoved(MouseEvent e) {
lines++;
}
for (DetectedError err: entry.getValue()) {
text = err.getMessage();
if (err.isWarning()) {
sb.append("<span style=\"color: #FF0000;\">");
}
else {
sb.append("<span style=\"color: #0000FF;\">");
// START KGU#1116 2024-03-07: Issue #1129: Restrict the popup lines
if (lines < Element.E_ANALYSER_MAX_POPUP_LINES) {
// END KGU#1116 2024-03-07
text = err.getMessage();
if (err.isWarning()) {
sb.append("<span style=\"color: #FF0000;\">");
}
else {
sb.append("<span style=\"color: #0000FF;\">");
}
sb.append(BString.encodeToHtml(text));
sb.append("</span><br/>");
width = Math.max(width, fm.stringWidth(text));
// START KGU#1116 2024-03-07: Issue #1129: Restrict the popup lines
}
sb.append(BString.encodeToHtml(text));
sb.append("</span><br/>");
width = Math.max(width, fm.stringWidth(text));
// END KGU#1116 2024-03-07
lines++;
}
}
// START KGU#1116 2024-03-07: Issue #1129: Restrict the popup lines
if (lines > Element.E_ANALYSER_MAX_POPUP_LINES) {
sb.append("... (+ " + (lines - Element.E_ANALYSER_MAX_POPUP_LINES) + ")<br/>");
lines = Element.E_ANALYSER_MAX_POPUP_LINES + 1;
}
// END KGU#1116 2024-03-07
sb.append("</html>");
lblPop.setText(sb.toString());
lblPop.setPreferredSize(
Expand Down
11 changes: 9 additions & 2 deletions src/lu/fisch/structorizer/gui/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Known issues (also see https://github.com/fesch/Structorizer.Desktop/issues):
- ARM export is still experimental and relies on a specific and very restricted
syntax for the element contents in order to produce meaningful results.

Current development version 3.32-16 (2024-02-28)
Current development version 3.32-17 (2024-03-10)
- 01: Bugfix #987: Duplicate subroutine comment export by Pascal generator <2>
- 01: Bugfix #988: Syntax error in Structorizer.bat and Arranger.bat fixed <2>
- 01: Bugfix #989: Expressions in EXIT elements (e.g. return) were forgotten
Expand Down Expand Up @@ -191,9 +191,16 @@ Current development version 3.32-16 (2024-02-28)
- 16: Bugfix #1122 Defective export of INPUT instructions to Javascript <2>
- 16: Issue #1123 Proper export of random(...) to C, C++, C#, Java, Js <2>
- 16: Issue #1125 Diagram comparison didn't distinguish disabled state <2>
- 16: Bugfix #1126: Spanish and Italian messages for View menu were missing,
- 16: Bugfix #1126 Spanish and Italian messages for View menu were missing,
the attempt to open Translator led to an error abort. <2>
- 16: Completion and corrections of the Portuguese/Brazilian locale <T. Cruz>
- 17: Menu mnemonics for the PT_BR locale rectified <T. Cruz>
- 17: Bugfix #1128 Risk of getting stuck on record component retrieval (in
Analyser or Input assist) eliminated [K.-P. Reimers]<2>
- 17: Issue #1129 Analyser popup didn't open with too many error entries <2>
- 17: Bugfix #1130 C import expanded macros within char literals [csrabak]2
- 17: Issue #1131 Handling of anonymous inner classes on Java import <2>
- 17: Bugfix #1132 Java import defect on backslashes in string literals <2>

Version 3.32 (2021-09-19) requiring Java 11 or newer
- 01: Bugfix #851/2: SPECIAL-NAMES sections caused COBOL parser abort <2>
Expand Down
4 changes: 3 additions & 1 deletion src/lu/fisch/structorizer/gui/parsers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
</option>
</plugin>
<plugin title="Java-SE8" class="lu.fisch.structorizer.parsers.JavaParser" icon="">
<option name="convert_syntax" type="Boolean" title="Convert declarations etc. to Pascal/Structorizer style" help="This setting slightly raises the chance of executability and re-export in Structorizer " default="true" />
<option name="convert_syntax" type="Boolean" title="Convert declarations etc. to Pascal/Structorizer style" help="This setting slightly raises the chance of executability and re-export in Structorizer" default="true" />
<option name="dissect_anon_inner_class" type="Boolean" title="Dissect anonymous inner classes into diagrams" help="Otherwise on-the-fly-defined subclasses will be passed as very long source code expressions to the instantiation element." default="true" />
</plugin>
<plugin title="Processing" class="lu.fisch.structorizer.parsers.ProcessingParser" icon="">
<option name="convert_syntax" type="Boolean" title="Convert declarations etc. to Pascal/Structorizer style" help="This setting slightly raises the chance of executability and re-export in Structorizer" default="true" />
<option name="dissect_anon_inner_class" type="Boolean" title="Dissect anonymous inner classes into diagrams" help="Otherwise on-the-fly-defined subclasses will be passed as very long source code expressions to the instantiation element." default="true" />
</plugin>

</plugins>
10 changes: 8 additions & 2 deletions src/lu/fisch/structorizer/locales/de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
* Kay Gürtzig 2023-10-06 Issue #311: Menu reorganisation (menuDiagram split)
* Kay Gürtzig 2023-10-13 Issues #980,#1096: New messages for declaration syntax check (error31_*)
* Kay Gürtzig 2023-11-13 Enh. #1115: New messages for C99 import option definesToConstants
* Kay Gürtzig 2024-03-04 Mnemonic changed on Find&Replace, PluginOptionDialog message added
* Kay Gürtzig 2024-03-09 Issue #1117: Messages for new PuginOptionDialog option dissect_anon_inner_class
*
******************************************************************************************************
*
Expand Down Expand Up @@ -1206,6 +1208,8 @@ PluginOptionDialog.btnOk.text=OK
PluginOptionDialog.btnCancel.text=Abbrechen
PluginOptionDialog.optionComponents.convert_syntax.text=Deklarationen/Ausdrücke usw. in Pascal-ähnlichen Stil wandeln
PluginOptionDialog.optionComponents.convert_syntax.tooltip=Diese Einstellung vergrößert die Chancen der Ausführbarkeit oder des Re-Exports in Structorizer
PluginOptionDialog.optionComponents.dissect_anon_inner_class.text=Anonyme innere Klassen in Diagramme zerlegen
PluginOptionDialog.optionComponents.dissect_anon_inner_class.tooltip=Anderenfalls würde die en passant definierte innere Klasse einfach als sehr langer Quellcode-Ausdruck in das instanziierende Element durchgereicht.
PluginOptionDialog.optionComponents.debugLines.text[getPluginKey():COBOLParser]=Debug-Zeilen als aktiven Code importieren
PluginOptionDialog.optionComponents.debugLines.tooltip[getPluginKey():COBOLParser]=Falls aktiviert, werden Debug-Zeilen ggf. als gültiger Code importiert, anderenfalls in Kommentarzeilen "DEBUG ..." umgewandelt.
PluginOptionDialog.optionComponents.decimalComma.text[getPluginKey():COBOLParser]=Dezimalkomma (statt Dezimalpunkt) im Quelltext
Expand Down Expand Up @@ -1242,6 +1246,8 @@ PluginOptionDialog.optionComponents.alignArrays.text=Speicherausrichtung für Da
PluginOptionDialog.optionComponents.alignArrays.tooltip=Fügt passende .align-Direktiven vor Daten-Deklarationen und am Anfang des Text-Bereichs ein (nur im GNU-Modus).
PluginOptionDialog.optionComponents.terminateStrings.text=Zeichenketten mit Abschlusszeichen versehen
PluginOptionDialog.optionComponents.terminateStrings.tooltip=Normalerweise werden Zeichenketten einfach als Array ihrer enthaltenen Zeichencodes generiert. Diese Option sorgt für das Anhängen eines NUL-Zeichens (wie in C).
PluginOptionDialog.optionComponents.restrictedSyntax.text=Auf Elementinhalte auf ARM-Niveau beschränken.
PluginOptionDialog.optionComponents.restrictedSyntax.tooltip=Keine erweiterten Compilerfähigkeiten anwenden, sondern Inhalte zurückweisen, die das Niveau von ARM-Befehlen übersteigen.

-----[ ElementNamePreferences ]-----
ElementNamePreferences.title=Elementnamen einstellen
Expand Down Expand Up @@ -1301,7 +1307,7 @@ FindAndReplace.chkCaseSensitive.mnemonic=g
FindAndReplace.chkWholeWord.text=Ganzes Wort
FindAndReplace.chkWholeWord.mnemonic=w
FindAndReplace.chkRegEx.text=Reguläre Ausdrücke
FindAndReplace.chkRegEx.mnemonic=x
FindAndReplace.chkRegEx.mnemonic=k
FindAndReplace.rbDown.text=Abwärts
FindAndReplace.rbDown.mnemonic=b
FindAndReplace.rbUp.text=Aufwärts
Expand Down Expand Up @@ -1519,7 +1525,7 @@ ArrangerIndex.msgConfirmDissolve.text=Sicher, diese Gruppe(n) aufzulösen?\n%
-----> Executor
-----[ Control ]-----
Control.title=Diagramm-Test
Control.lblSpeed.text=Verzögerung:
Control.lblSpeed.text= Verzögerung:
Control.btnCallStack.text=Aufrufstapel
Control.lblCallLevel.text=Aufruftiefe:
Control.chkCollectRuntimeData.text=Sammle Laufzeitdaten
Expand Down
7 changes: 6 additions & 1 deletion src/lu/fisch/structorizer/locales/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
* Kay Gürtzig 2022-09-29 Bugfix #1072: New message InputBoxFor.msgIllegalWordInField added
* Kay Gürtzig 2023-08-01 Enh. #1082: Function name now included in messages Menu.error13_*
* Kay Gürtzig 2023-10-06 Issue #311: Menu reorganisation (menuDiagram split)
* Kay Gürtzig 2023-10-16 Issue #980/#1096: New messages for declaration syntax check (error31_*)
* Kay Gürtzig 2023-10-16 Issue #980/#1096: New messages for declaration syntax check (error31_*)
* Kay Gürtzig 2024-03-09 Issue #1117: Messages for new PuginOptionDialog option dissect_anon_inner_class
*
******************************************************************************************************
*
Expand Down Expand Up @@ -1202,6 +1203,8 @@ PluginOptionDialog.btnOk.text=OK
PluginOptionDialog.btnCancel.text=Cancel
PluginOptionDialog.optionComponents.convert_syntax.text=
PluginOptionDialog.optionComponents.convert_syntax.tooltip=
PluginOptionDialog.optionComponents.dissect_anon_inner_class.text=
PluginOptionDialog.optionComponents.dissect_anon_inner_class.tooltip=
PluginOptionDialog.optionComponents.debugLines.text[getPluginKey():COBOLParser]=
PluginOptionDialog.optionComponents.debugLines.tooltip[getPluginKey():COBOLParser]=
PluginOptionDialog.optionComponents.decimalComma.text[getPluginKey():COBOLParser]=
Expand Down Expand Up @@ -1238,6 +1241,8 @@ PluginOptionDialog.optionComponents.alignArrays.text=Guarantee memory alignment
PluginOptionDialog.optionComponents.alignArrays.tooltip=Inserts .align directives before any data allocation and at the beginning of the text area (GNU mode only).
PluginOptionDialog.optionComponents.terminateStrings.text=Store strings with 0-termination
PluginOptionDialog.optionComponents.terminateStrings.tooltip=Normally strings will be stored as arrays of only the contained characters. This option will add a terminating NUL character
PluginOptionDialog.optionComponents.restrictedSyntax.text=Restrict to Element content on ARM level
PluginOptionDialog.optionComponents.restrictedSyntax.tooltip=Don't make use of extended compiling capabilities, reject all content that exceeds ARM level.

-----[ ElementNamePreferences ]-----
ElementNamePreferences.title=Element Name Preferences
Expand Down
Loading

0 comments on commit 95d4e6a

Please sign in to comment.