diff --git a/AlgebraicDataflowArchitectureModel/src/parser/Parser.java b/AlgebraicDataflowArchitectureModel/src/parser/Parser.java index 50bf734..73ae761 100644 --- a/AlgebraicDataflowArchitectureModel/src/parser/Parser.java +++ b/AlgebraicDataflowArchitectureModel/src/parser/Parser.java @@ -85,7 +85,7 @@ DataTransferModel model = new DataTransferModel(); DataTransferChannel channel; while ((channel = parseChannel(model)) != null) { - if (channel.getInputChannelMembers().size() == 0) { + if (channel.getInputChannelMembers().isEmpty()) { model.addInputChannel(channel); } else { model.addChannel(channel); @@ -231,7 +231,7 @@ } if (((Term) leftTerm).getChild(1) instanceof Term) { Term messageTerm = (Term) ((Term) leftTerm).getChild(1); - if (messageTerm.getSymbol().getSignature() == null && messageTerm.getChildren().size() > 0) { + if (messageTerm.getSymbol().getSignature() == null && !messageTerm.getChildren().isEmpty()) { Type[] signature = new Type[messageTerm.getChildren().size() + 1]; int i = 1; for (Expression e : messageTerm.getChildren()) { @@ -664,7 +664,7 @@ if (!fFirstToken) { newTokens.add(new Token(delimiter, true)); } - if (t.length() > 0) { + if (!t.isEmpty()) { newTokens.add(new Token(t)); } fFirstToken = false; @@ -715,11 +715,11 @@ } public String getSourceText(int from, int to) { - String text = ""; + StringBuilder text = new StringBuilder(); for (int l = from; l <= to; l++) { - text += lines.get(l) + "\n"; + text.append(lines.get(l)).append("\n"); } - return text; + return text.toString(); } }