From 3d0d11adb70c7a8fb5dcf8ac120cda606b31b98f Mon Sep 17 00:00:00 2001 From: Michael Uhl Date: Tue, 14 May 2019 21:43:32 +0200 Subject: [PATCH] =?UTF-8?q?Code=20aufger=C3=A4umt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../typeinference/result/ResultPairMap.java | 39 ------------------- .../typeinference/result/ResultSet.java | 5 --- 2 files changed, 44 deletions(-) delete mode 100644 src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairMap.java diff --git a/src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairMap.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairMap.java deleted file mode 100644 index d032ace2..00000000 --- a/src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairMap.java +++ /dev/null @@ -1,39 +0,0 @@ -package de.dhbwstuttgart.typeinference.result; - -import java.util.HashMap; -import java.util.Map; - -import org.antlr.v4.runtime.Token; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -public class ResultPairMap { - - private Table> indexMap = HashBasedTable.create(); - private Map> inner = new HashMap<>(); - - public static final ResultPairMap RESULT_PAIRS = new ResultPairMap(); - - private ResultPairMap() { - // Nothing to do here. - } - - public void put(Token tkn, ResultPair resultPair) { - inner.put(tkn, resultPair); - } - - public void put(Token tkn, String insertString, ResultPair resultPair) { - indexMap.put(tkn, insertString.trim(), resultPair); - inner.put(tkn, resultPair); - } - - public ResultPair get(Token tkn, String insertString) { - return inner.get(tkn); - } - - public void clear() { - inner.clear(); - indexMap.clear(); - } -} diff --git a/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java index 0f60a0a1..f508fe34 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java @@ -2,7 +2,6 @@ package de.dhbwstuttgart.typeinference.result; import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import de.dhbwstuttgart.exceptions.NotImplementedException; import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType; @@ -12,8 +11,6 @@ import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -import static de.dhbwstuttgart.typeinference.result.ResultPairMap.RESULT_PAIRS; - @SuppressWarnings("rawtypes") public class ResultSet { @@ -91,8 +88,6 @@ class Resolver implements ResultSetVisitor { } for(ResultPair resultPair : result.results){ currentPair = resultPair; - RESULT_PAIRS.put(resultPair.getLeft().getOffset(), resultPair); - RESULT_PAIRS.put(resultPair.getRight().getOffset(), resultPair); resultPair.accept(this); } if(resolved==null){//TPH kommt nicht im Result vor: