forked from JavaTX/JavaCompilerCore
Fehler behoben, Fehler behoben, Fehler behoben.
This commit is contained in:
parent
615d2c633e
commit
99d3ecf030
@ -99,19 +99,37 @@ class GenericVarPatch {
|
|||||||
*/
|
*/
|
||||||
public void add(Pair p){
|
public void add(Pair p){
|
||||||
GenericVarExtendsDeclarationPatch toAdd = new GenericVarExtendsDeclarationPatch(p);
|
GenericVarExtendsDeclarationPatch toAdd = new GenericVarExtendsDeclarationPatch(p);
|
||||||
|
boolean mussDeklariertWerden = true;
|
||||||
|
for(GenericVarDeclarationPatch patch : genericVarDeclarations){
|
||||||
|
if(patch.genericVar.equals(p.TA2)){
|
||||||
|
mussDeklariertWerden = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(!this.genericVarExtendDeclarations.contains(toAdd))this.genericVarExtendDeclarations.add(toAdd);
|
if(!this.genericVarExtendDeclarations.contains(toAdd))this.genericVarExtendDeclarations.add(toAdd);
|
||||||
|
if(mussDeklariertWerden && p.TA2 instanceof TypePlaceholder)this.add((TypePlaceholder)p.TA2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInsertString(ResultSet rs){
|
public String getInsertString(ResultSet rs){
|
||||||
//Hier sollten TPHs nicht aufgelöst sondern in Generische Variablen umgewandelt werden:
|
//Hier sollten TPHs nicht aufgelöst sondern in Generische Variablen umgewandelt werden:
|
||||||
String ret = "";
|
String ret = "";
|
||||||
Iterator<GenericVarDeclarationPatch> it1 = this.genericVarDeclarations.iterator();
|
Iterator<GenericVarDeclarationPatch> it1 = this.genericVarDeclarations.iterator();
|
||||||
|
boolean bereitsVorhanden = false;
|
||||||
while(it1.hasNext()){
|
while(it1.hasNext()){
|
||||||
|
bereitsVorhanden = false;
|
||||||
GenericVarDeclarationPatch p = it1.next();
|
GenericVarDeclarationPatch p = it1.next();
|
||||||
ret += p.getInsertString(rs);
|
//Kontrollieren, ob GenericVar bereits von den Extends Declarations definiert wird:
|
||||||
if(it1.hasNext())ret += ", ";
|
for(GenericVarExtendsDeclarationPatch pe : this.genericVarExtendDeclarations){
|
||||||
|
if(pe.definesGenericVar(p.genericVar)){
|
||||||
|
bereitsVorhanden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(bereitsVorhanden == false){
|
||||||
|
ret += p.getInsertString(rs);
|
||||||
|
if(it1.hasNext())ret += ", ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(this.genericVarExtendDeclarations.size()>0)ret+=", ";
|
if(this.genericVarExtendDeclarations.size()>0 && bereitsVorhanden == false)ret+=", ";
|
||||||
Iterator<GenericVarExtendsDeclarationPatch> it2 = this.genericVarExtendDeclarations.iterator();
|
Iterator<GenericVarExtendsDeclarationPatch> it2 = this.genericVarExtendDeclarations.iterator();
|
||||||
while(it2.hasNext()){
|
while(it2.hasNext()){
|
||||||
GenericVarExtendsDeclarationPatch p = it2.next();
|
GenericVarExtendsDeclarationPatch p = it2.next();
|
||||||
@ -120,7 +138,7 @@ class GenericVarPatch {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(TypePlaceholder tph) {
|
public void add(TypePlaceholder tph) {
|
||||||
GenericVarDeclarationPatch toAdd = new GenericVarDeclarationPatch(tph);
|
GenericVarDeclarationPatch toAdd = new GenericVarDeclarationPatch(tph);
|
||||||
if(!this.genericVarDeclarations.contains(toAdd))this.genericVarDeclarations.add(toAdd);
|
if(!this.genericVarDeclarations.contains(toAdd))this.genericVarDeclarations.add(toAdd);
|
||||||
@ -145,6 +163,11 @@ class GenericVarExtendsDeclarationPatch {
|
|||||||
|
|
||||||
private Pair genericPair;
|
private Pair genericPair;
|
||||||
|
|
||||||
|
public boolean definesGenericVar(TypePlaceholder tph){
|
||||||
|
if(genericPair.TA1.equals(tph))return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public GenericVarExtendsDeclarationPatch(Pair p) {
|
public GenericVarExtendsDeclarationPatch(Pair p) {
|
||||||
this.genericPair = p;
|
this.genericPair = p;
|
||||||
}
|
}
|
||||||
@ -178,17 +201,17 @@ class GenericVarExtendsDeclarationPatch {
|
|||||||
*/
|
*/
|
||||||
class GenericVarDeclarationPatch {
|
class GenericVarDeclarationPatch {
|
||||||
|
|
||||||
private TypePlaceholder genericPair;
|
TypePlaceholder genericVar;
|
||||||
|
|
||||||
public GenericVarDeclarationPatch(TypePlaceholder p) {
|
public GenericVarDeclarationPatch(TypePlaceholder p) {
|
||||||
this.genericPair = p;
|
this.genericVar = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInsertString(ResultSet resultSet){
|
public String getInsertString(ResultSet resultSet){
|
||||||
String ret = "";
|
String ret = "";
|
||||||
if(this.genericPair != null){
|
if(this.genericVar != null){
|
||||||
//ret += this.genericPair.printJavaCode(resultSet);
|
//ret += this.genericPair.printJavaCode(resultSet);
|
||||||
ret += this.genericPair.getName().toString();
|
ret += this.genericVar.getName().toString();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -196,7 +219,12 @@ class GenericVarDeclarationPatch {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o){
|
public boolean equals(Object o){
|
||||||
if(!(o instanceof GenericVarDeclarationPatch))return false;
|
if(!(o instanceof GenericVarDeclarationPatch))return false;
|
||||||
if(!(this.genericPair.equals(((GenericVarDeclarationPatch)o).genericPair)))return false;
|
if(!(this.genericVar.equals(((GenericVarDeclarationPatch)o).genericVar)))return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return genericVar.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,3 +8,12 @@ class OverloadingInMethod{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class OverloadingInMethod2{
|
||||||
|
|
||||||
|
<ABM, T11702297201, ABL extends ABM, R1702297201 extends ABL, C extends T11702297201> Fun1<? extends Fun1<? extends ABM, ? super Fun1<R1702297201, T11702297201>>, ? super C> m () {
|
||||||
|
Fun1<? extends Fun1<? extends ABM, ? super Fun1<R1702297201, T11702297201>>, ? super C> op;
|
||||||
|
op = (m) -> (f) -> f.apply(m);
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user