Running code like the following throws exception:
query = "SELECT Coverage FROM ApexCodeCoverageAggregate WHERE ApexClassOrTriggerId ='" + id + "'";
QueryResult q = project.getToolingConnection().query(query);
And the exception:
SEVERE [org.openide.util.Exceptions]
java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object;
at com.sforce.ws.bind.TypeMapper.readArray(TypeMapper.java:578)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:531)
at com.sforce.soap.tooling.Coverage.loadFields(Coverage.java:83)
at com.sforce.soap.tooling.Coverage.load(Coverage.java:75)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:653)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:529)
at com.sforce.soap.tooling.ApexCodeCoverageAggregate.loadFields(ApexCodeCoverageAggregate.java:346)
at com.sforce.soap.tooling.ApexCodeCoverageAggregate.load(ApexCodeCoverageAggregate.java:329)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:653)
at com.sforce.ws.bind.TypeMapper.readArray(TypeMapper.java:553)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:531)
at com.sforce.soap.tooling.QueryResult.loadFields(QueryResult.java:208)
at com.sforce.soap.tooling.QueryResult.load(QueryResult.java:184)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:653)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:529)
at com.sforce.soap.tooling.QueryAllResponse_element.loadFields(QueryAllResponse_element.java:62)
at com.sforce.soap.tooling.QueryAllResponse_element.load(QueryAllResponse_element.java:54)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:653)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:529)
at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:178)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:152)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
at com.sforce.soap.tooling.ToolingConnection.query(ToolingConnection.java:282)
Any chance I can do it?
P.S. Code like this runs fine:
String query = "Select Id from ApexClass Where Name='MyController'";
QueryResult qr = project.getToolingConnection().query(query);