fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 20 forks source link

Suboptimal Java export of INPUT instructions #1121

Closed codemanyak closed 9 months ago

codemanyak commented 11 months ago

On exporting INPUT instructions to Java code, the code generator does not take advantage of existent variable declarations or successful type inference, i.e., even if the type of the input variable is known the Java code generator always uses method Scanner.nextLine() to translate the instruction though more appropriate input methods are available for standard types. Example: grafik

Here, variables priceToPay and customerType have been declared such that type information is available and the methods nextDouble() or nextInt() should have been applied to the Scanner instance (instead of nextLine()).