Hi,
I am getting the following error when running cloverinstr to instrument source code.
Exception: D:\Source\...\CacheClient.java:92:20:expecting SEMI, found ','
at com.cenqua.clover.instr.Instrumenter.instrument(Instrumenter.java:155)
at org.apache.tools.ant.taskdefs.CloverCompilerAdapter.setJavac(CloverCompilerAdapter.java:339)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1094)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:302)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
The line that Clover complains about looks like this,
Map<Integer, ProduAvailability> results = new HashMap<>();
Not sure what is wrong. Encoding problem?
I know this is really old, but I wanted to contribute a solution for future reference since I ran into this myself.
Change this:
Map<Integer, ProduAvailability> results = new HashMap<>();
To this:
Map<Integer, ProduAvailability> results = new HashMap();
As Jack implies the version of Clover you are using doesn't support Java 7 features. You can find info about the diamond operator here:
http://stackoverflow.com/questions/4166966/what-is-the-point-of-the-diamond-operator-in-java-7
Joseph Elwell.
Hi,
What is your Clover version? What java version is your source compatible with?
If you use Java 7 features and old Clover version then it may result in similar issues.
Cheers,
Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.