Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

529 views 7 20
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you