Compare commits
7 Commits
1bcf396f95
...
JannikChan
Author | SHA1 | Date | |
---|---|---|---|
91552ad147 | |||
084808c3ab | |||
d19748766f | |||
|
4bdb65a6ce | ||
|
97e0c228d6 | ||
|
d4be77ceb2 | ||
ca539add98 |
@@ -1,11 +0,0 @@
|
||||
package ast.statement;
|
||||
|
||||
import ast.statements.IStatementNode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockStatementNode {
|
||||
List<IStatementNode> statements;
|
||||
|
||||
public BlockStatementNode(List<IStatementNode> statements) {this.statements = statements;}
|
||||
}
|
@@ -281,8 +281,13 @@ public class ASTBuilder extends SimpleJavaBaseVisitor<ASTNode> {
|
||||
|
||||
@Override
|
||||
public ASTNode visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) {
|
||||
IfElseNode ifElseStatementNode = new IfElseNode((IfNode) visit(ctx.ifStatement()),
|
||||
(ElseNode) visit(ctx.elseStatement()));
|
||||
IfElseNode ifElseStatementNode;
|
||||
if(ctx.elseStatement() != null) {
|
||||
ifElseStatementNode = new IfElseNode((IfNode) visit(ctx.ifStatement()),
|
||||
(ElseNode) visit(ctx.elseStatement()));
|
||||
} else {
|
||||
ifElseStatementNode = new IfElseNode((IfNode) visit(ctx.ifStatement()), null);
|
||||
}
|
||||
|
||||
for (SimpleJavaParser.ElseIfStatementContext elseIf : ctx.elseIfStatement()){
|
||||
ifElseStatementNode.addElseIfStatement(((IfNode) visit(elseIf)));
|
||||
|
@@ -325,6 +325,12 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
||||
public TypeCheckResult analyze(MethodCallNode toCheck) {
|
||||
|
||||
if (toCheck.target != null) {
|
||||
if(toCheck.target.memberAccess == null){
|
||||
MemberAccessNode memberAccessNode = new MemberAccessNode(false);
|
||||
memberAccessNode.identifiers.add(currentClass.identifier);
|
||||
memberAccessNode.identifiers.add(toCheck.target.identifier);
|
||||
toCheck.target.memberAccess = memberAccessNode;
|
||||
}
|
||||
if (toCheck.target.identifier != null) {
|
||||
var targetType = currentScope.getLocalVar(toCheck.target.identifier);
|
||||
if (targetType == null) {
|
||||
@@ -612,6 +618,11 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
||||
|
||||
if (targetNode.memberAccess != null) {
|
||||
return targetNode.memberAccess.accept(this);
|
||||
} else if(targetNode.identifier != null) {
|
||||
MemberAccessNode memberAccessNode = new MemberAccessNode(false);
|
||||
memberAccessNode.identifiers.add(currentClass.identifier);
|
||||
memberAccessNode.identifiers.add(targetNode.identifier);
|
||||
targetNode.memberAccess = memberAccessNode;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -333,6 +333,92 @@ class AstBuilderTest {
|
||||
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("If Test")
|
||||
public void ifTest() {
|
||||
BlockNode block = new BlockNode();
|
||||
block.addStatement(new LocalVariableDeclarationNode(new BaseType(TypeEnum.INT), "intValue", "=", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))));
|
||||
|
||||
BlockNode ifBlock = new BlockNode();
|
||||
ifBlock.addStatement(new DecrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
block.addStatement(new IfElseNode(new IfNode(new NonCalculationNode(new UnaryNode("intValue"), "==", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))), ifBlock), null));
|
||||
|
||||
block.addStatement(new ReturnNode(null));
|
||||
|
||||
ConstructorNode constructor = new ConstructorNode("public", "If", block);
|
||||
|
||||
ClassNode class1 = new ClassNode("public", "If");
|
||||
class1.addMember(constructor);
|
||||
|
||||
ProgramNode expected = new ProgramNode();
|
||||
expected.addClass(class1);
|
||||
|
||||
ASTNode actual = Helper.generateAST(directoryPath + "If.java");
|
||||
|
||||
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("If Else Test")
|
||||
public void ifElseTest() {
|
||||
BlockNode block = new BlockNode();
|
||||
block.addStatement(new LocalVariableDeclarationNode(new BaseType(TypeEnum.INT), "intValue", "=", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))));
|
||||
|
||||
BlockNode ifBlock = new BlockNode();
|
||||
ifBlock.addStatement(new DecrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
BlockNode elseBlock = new BlockNode();
|
||||
elseBlock.addStatement(new IncrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
block.addStatement(new IfElseNode(new IfNode(new NonCalculationNode(new UnaryNode("intValue"), "==", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))), ifBlock), new ElseNode(elseBlock)));
|
||||
|
||||
block.addStatement(new ReturnNode(null));
|
||||
|
||||
ConstructorNode constructor = new ConstructorNode("public", "IfElse", block);
|
||||
|
||||
ClassNode class1 = new ClassNode("public", "IfElse");
|
||||
class1.addMember(constructor);
|
||||
|
||||
ProgramNode expected = new ProgramNode();
|
||||
expected.addClass(class1);
|
||||
|
||||
ASTNode actual = Helper.generateAST(directoryPath + "IfElse.java");
|
||||
|
||||
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("If Else If ElseTest")
|
||||
public void ifElseIfElseTest() {
|
||||
BlockNode block = new BlockNode();
|
||||
block.addStatement(new LocalVariableDeclarationNode(new BaseType(TypeEnum.INT), "intValue", "=", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))));
|
||||
|
||||
BlockNode ifBlock = new BlockNode();
|
||||
ifBlock.addStatement(new DecrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
BlockNode elseBlock = new BlockNode();
|
||||
elseBlock.addStatement(new IncrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
|
||||
IfElseNode ifElseStatement = new IfElseNode(new IfNode(new NonCalculationNode(new UnaryNode("intValue"), "==", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "5"))), ifBlock), new ElseNode(elseBlock));
|
||||
|
||||
BlockNode ifElseBlock = new BlockNode();
|
||||
ifElseBlock.addStatement(new IncrementNode(CrementType.SUFFIX, new AssignableNode("intValue")));
|
||||
ifElseStatement.addElseIfStatement(new IfNode(new NonCalculationNode(new UnaryNode("intValue"), "==", new UnaryNode(new ValueNode(EnumValueNode.INT_VALUE, "4"))), ifElseBlock));
|
||||
|
||||
block.addStatement(ifElseStatement);
|
||||
|
||||
block.addStatement(new ReturnNode(null));
|
||||
|
||||
ConstructorNode constructor = new ConstructorNode("public", "IfElseIfElse", block);
|
||||
|
||||
ClassNode class1 = new ClassNode("public", "IfElseIfElse");
|
||||
class1.addMember(constructor);
|
||||
|
||||
ProgramNode expected = new ProgramNode();
|
||||
expected.addClass(class1);
|
||||
|
||||
ASTNode actual = Helper.generateAST(directoryPath + "IfElseIfElse.java");
|
||||
|
||||
assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Self Reference Test")
|
||||
public void selfReferneceTest(){
|
||||
|
@@ -26,10 +26,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import semantic.exceptions.AlreadyDeclaredException;
|
||||
import semantic.exceptions.MultipleReturnTypes;
|
||||
import semantic.exceptions.NotDeclaredException;
|
||||
import semantic.exceptions.TypeMismatchException;
|
||||
import semantic.exceptions.*;
|
||||
import semantic.exceptions.NotDeclaredException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@@ -170,7 +167,7 @@ public class EndToTypedAstTest {
|
||||
|
||||
@Test
|
||||
public void typeMismatchTest() {
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/johnsTests/TypeMismatchIntBool.java");
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/TypeMismatchIntBool.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
@@ -180,7 +177,7 @@ public class EndToTypedAstTest {
|
||||
|
||||
@Test
|
||||
public void parameterAlreadyDecleared() {
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/johnsTests/ParameterAlreadyDecleared.java");
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/ParameterAlreadyDecleared.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
@@ -190,7 +187,7 @@ public class EndToTypedAstTest {
|
||||
|
||||
@Test
|
||||
public void fieldAlreadyDecleared(){
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/johnsTests/FieldAlreadyDecleared.java");
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/FieldAlreadyDecleared.java");
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
@@ -200,7 +197,7 @@ public class EndToTypedAstTest {
|
||||
|
||||
@Test
|
||||
public void typeMismatchRefType(){
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/johnsTests/TypeMismatchRefType.java");
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/TypeMismatchRefType.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
@@ -210,75 +207,77 @@ public class EndToTypedAstTest {
|
||||
|
||||
@Test
|
||||
public void correctRetType(){
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/CorrectRetType.java");
|
||||
|
||||
CharStream codeCharStream = null;
|
||||
try {
|
||||
codeCharStream = CharStreams.fromPath(Paths.get("src/test/resources/semantic/endToTAST/CorrectRetType.java"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
SimpleJavaLexer lexer = new SimpleJavaLexer(codeCharStream);
|
||||
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
|
||||
|
||||
SimpleJavaParser parser = new SimpleJavaParser(tokenStream);
|
||||
ParseTree parseTree = parser.program();
|
||||
|
||||
ASTBuilder astBuilder = new ASTBuilder();
|
||||
ProgramNode abstractSyntaxTree = (ProgramNode) astBuilder.visit(parseTree);
|
||||
|
||||
ASTNode tast = SemanticAnalyzer.generateTast(abstractSyntaxTree);
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertTrue(SemanticAnalyzer.errors.isEmpty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void retTypeMismatch(){
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/RetTypeMismatch.java");
|
||||
|
||||
CharStream codeCharStream = null;
|
||||
try {
|
||||
codeCharStream = CharStreams.fromPath(Paths.get("src/test/resources/semantic/endToTAST/retTypeMismatch.java"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
SimpleJavaLexer lexer = new SimpleJavaLexer(codeCharStream);
|
||||
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
|
||||
|
||||
SimpleJavaParser parser = new SimpleJavaParser(tokenStream);
|
||||
ParseTree parseTree = parser.program();
|
||||
|
||||
ASTBuilder astBuilder = new ASTBuilder();
|
||||
ProgramNode abstractSyntaxTree = (ProgramNode) astBuilder.visit(parseTree);
|
||||
|
||||
ASTNode tast = SemanticAnalyzer.generateTast(abstractSyntaxTree);
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
assertInstanceOf(TypeMismatchException.class, SemanticAnalyzer.errors.getFirst());
|
||||
|
||||
assertTrue(SemanticAnalyzer.errors.stream().anyMatch(c -> c instanceof TypeMismatchException));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multipleRetType(){
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/MultipleRetTypes.java");
|
||||
|
||||
CharStream codeCharStream = null;
|
||||
try {
|
||||
codeCharStream = CharStreams.fromPath(Paths.get("src/test/resources/semantic/endToTAST/MultipleRetTypes.java"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
SimpleJavaLexer lexer = new SimpleJavaLexer(codeCharStream);
|
||||
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
|
||||
|
||||
SimpleJavaParser parser = new SimpleJavaParser(tokenStream);
|
||||
ParseTree parseTree = parser.program();
|
||||
|
||||
ASTBuilder astBuilder = new ASTBuilder();
|
||||
ProgramNode abstractSyntaxTree = (ProgramNode) astBuilder.visit(parseTree);
|
||||
|
||||
ASTNode tast = SemanticAnalyzer.generateTast(abstractSyntaxTree);
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
assertInstanceOf(MultipleReturnTypes.class, SemanticAnalyzer.errors.getFirst());
|
||||
assertTrue(SemanticAnalyzer.errors.stream().anyMatch(c -> c instanceof MultipleReturnTypes));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void BothTypesMustBeSameGreaterSmallerEqual(){
|
||||
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/BothTypesMustBeSame.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
assertTrue(SemanticAnalyzer.errors.stream().anyMatch(c -> c instanceof TypeMismatchException));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void NoSuchType(){
|
||||
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/ClassNotDeclared.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
assertTrue(SemanticAnalyzer.errors.stream().anyMatch(c -> c instanceof NotDeclaredException));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void FieldIsNotVisible(){
|
||||
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/FieldIsNotVisible.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertFalse(SemanticAnalyzer.errors.isEmpty());
|
||||
assertTrue(SemanticAnalyzer.errors.stream().anyMatch(c -> c instanceof NotVisibleException));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ChainedMethods(){
|
||||
|
||||
ASTNode tast = SemanticHelper.generateTypedASTFrom("src/test/resources/input/singleFeatureSemanticTests/ChainedMethods.java");
|
||||
|
||||
SemanticAnalyzer.generateTast(tast);
|
||||
|
||||
assertTrue(SemanticAnalyzer.errors.isEmpty());
|
||||
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25
src/test/resources/input/endabgabeTests/Car.java
Normal file
25
src/test/resources/input/endabgabeTests/Car.java
Normal file
@@ -0,0 +1,25 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Car myCar = new Car(2020);
|
||||
int tires = 0;
|
||||
int year = myCar.getYear();
|
||||
|
||||
if (year == 2020) {
|
||||
tires = 4;
|
||||
} else {
|
||||
tires = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Car {
|
||||
private int year;
|
||||
|
||||
public Car(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public int getYear() {
|
||||
return this.year;
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
public class ControlStructures {
|
||||
|
||||
public int sum(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
public cahr checkNumber(int num) {
|
||||
if (num > 0) {
|
||||
return "p";
|
||||
} else if (num < 0) {
|
||||
return "n";
|
||||
} else {
|
||||
return "z";
|
||||
}
|
||||
}
|
||||
|
||||
public void printNumbersUpTo(int limit) {
|
||||
int even = 0;
|
||||
int uneven = 0;
|
||||
int i = 0;
|
||||
while (i < limit) {
|
||||
if (i % 2 == 0) {
|
||||
even++;
|
||||
} else {
|
||||
uneven = uneven + 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ControlStructures cs = new ControlStructures();
|
||||
cs.printNumbersUpTo(5);
|
||||
int result = cs.sum(5, 5);
|
||||
}
|
||||
}
|
11
src/test/resources/input/endabgabeTests/Person.java
Normal file
11
src/test/resources/input/endabgabeTests/Person.java
Normal file
@@ -0,0 +1,11 @@
|
||||
public class Person {
|
||||
private int age;
|
||||
|
||||
public Person(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return this.age;
|
||||
}
|
||||
}
|
@@ -5,5 +5,18 @@ public class AllFeaturesClassExample {
|
||||
while (a > bool) {
|
||||
a--;
|
||||
}
|
||||
|
||||
if (a == bool) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (a < bool) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
public class Test {
|
||||
|
||||
public House h;
|
||||
|
||||
public int test(House h){
|
||||
return h.getW().getSize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class House {
|
||||
|
||||
private Window w;
|
||||
|
||||
public Window getW(){
|
||||
return w;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Window{
|
||||
|
||||
private int size;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
}
|
@@ -4,9 +4,4 @@ public class Test {
|
||||
public House1 h;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class House {
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
public class CorrectRetType {
|
||||
public static int testMethod(int x){
|
||||
return x;
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
public class MultipleRetTypes {
|
||||
public static int testMethod(int x, char c){
|
||||
return x;
|
||||
return c;
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
public class Example {
|
||||
public static int testMethod(char x){
|
||||
return x;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8
src/test/resources/input/singleFeatureTests/If.java
Normal file
8
src/test/resources/input/singleFeatureTests/If.java
Normal file
@@ -0,0 +1,8 @@
|
||||
public class If {
|
||||
public If() {
|
||||
int intValue = 5;
|
||||
if(intValue == 5) {
|
||||
intValue--;
|
||||
}
|
||||
}
|
||||
}
|
10
src/test/resources/input/singleFeatureTests/IfElse.java
Normal file
10
src/test/resources/input/singleFeatureTests/IfElse.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class IfElse {
|
||||
public IfElse() {
|
||||
int intValue = 5;
|
||||
if(intValue == 5) {
|
||||
intValue--;
|
||||
} else {
|
||||
intValue++;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
public class IfElseIfElse {
|
||||
public IfElseIfElse() {
|
||||
int intValue = 5;
|
||||
if(intValue == 5) {
|
||||
intValue--;
|
||||
} else if(intValue ==4) {
|
||||
intValue++;
|
||||
} else {
|
||||
intValue++;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
// @expected: TypeMismatchException
|
||||
public class Test{
|
||||
|
||||
public void test(boolean b){
|
||||
if(b == 2){
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user