Error when Clover instrument source code.

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?

2 answers

This widget could not be displayed.

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

This widget could not be displayed.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

121 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you