Kleine Änderungen

This commit is contained in:
JanUlrich 2014-09-09 14:32:53 +02:00
parent 583dfb23e3
commit 330451271e
3 changed files with 12 additions and 5 deletions

View File

@ -54,7 +54,7 @@ public class JavaClassName {
if (obj == null)
return false;
if(obj instanceof String)
return this.toString().equals(obj) || this.name != null && this.name.equals(obj); //Auch mit Strings als Klassennamen kompatibel TODO: sollte bald obsolet sein
return this.toString().equals(obj) || (this.name != null && this.name.equals(obj)); //Auch mit Strings als Klassennamen kompatibel TODO: sollte bald obsolet sein
if (getClass() != obj.getClass())
return false;
JavaClassName other = (JavaClassName) obj;

View File

@ -6,8 +6,8 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.apache.log4j.Logger;
import de.dhbwstuttgart.bytecode.ClassFile;
import de.dhbwstuttgart.bytecode.CodeAttribute;
import de.dhbwstuttgart.core.MyCompiler;
@ -389,6 +389,13 @@ public class LocalVarDecl extends Statement implements TypeInsertable
return ret;
}
@Override
public String getDescription() {
if(this.getType() == null)return "no type " + declid.toString();
if(this.getType() instanceof TypePlaceholder)return declid.toString();
return this.getType().toString() + " " + declid.toString();
}
@Override
public void parserPostProcessing(SyntaxTreeNode parent) {
super.parserPostProcessing(parent);

View File

@ -1443,7 +1443,7 @@ throws MatchException
} // end if P.OperatorSmaller()
} // end if: RefType
// Swap
if( (P.TA1 instanceof RefType || P.TA1 instanceof GenericTypeVar || P.TA1 instanceof WildcardType) && P.TA2 instanceof TypePlaceholder && P.OperatorEqual())
//PL 06-05-16 GenericTypeVar eingefuegt
@ -1840,8 +1840,8 @@ throws MatchException
//in ein Vector von Paaren um.
Vector<Pair> ret = new Vector<Pair>();
for(Enumeration e=ht.keys();e.hasMoreElements();) {
String k = (String)e.nextElement();
for(Enumeration<JavaClassName> e=ht.keys();e.hasMoreElements();) {
String k = e.nextElement().toString();
// #JB# 11.04.2005
// ###########################################################
ret.addElement(new Pair(TypePlaceholder.backdoorCreate(k), (Type)ht.get(k), PairOperator.Equal));