Click here to Skip to main content
15,902,635 members

Comments by Michael Hurt (Top 18 by date)

Michael Hurt 9-Jun-16 9:40am View    
Yeah I know what you mean but that won't work with the Plugin type or some others. I think I will just compare the length of each whilst I wait for a solution. Will get me out of trouble but not good programing.
Michael Hurt 9-Jun-16 8:20am View    
I have updated my question, if you read it again, it might give more insight.
Michael Hurt 9-Jun-16 8:12am View    
Exactly, so I need a work around.
One possibility I have thought of is to check the super types or interfaces of the super types or interfaces which should be the root interface. However this is a very long and convoluted method and I can't guarantee that it will work with all types.
Michael Hurt 9-Jun-16 7:43am View    
I have and I need help. This is why....

public myExample(List<string> myList) {}

The constructor now has parameter type "java.util.List"
Now lets create the list.

private List<string> myList = new ArrayList<>();

Ok, so now the list is of type "java.util.ArrayList"
So now lets compare the parameter in the constructor with the argument we just made to make sure we are passing the correct argument to the constructor.

if ("java.util.List" == "java.util.ArrayList") { doSomething() }

Whoops!
And so this is what I need help with.

if (cArgType.equalsIgnoreCase(ctorType.getTypeName())) {
ctorTypeMatches++;
break;
}
Michael Hurt 9-Jun-16 7:29am View    
I added one of the constructors so you can see where cArgs comes from.