powered by Jive Software

Syntax error in Log.java that prevents ant from building openfire

I fixed an syntax error in Log.java that prevents openfire from building. Not sure why it was no problem doesn’t affect the nightly builds. I basically changed

@Depreceiated()

to

@Depreceiated

and some other whitespace issues. Patch is attached.

The build error was:

BUILD FAILED

/home/flo/data/workspace/openfire/build/build.xml:827: com.thoughtworks.qdox.parser.ParseException: syntax error @[65,14] in file:/home/flo/data/workspace/openfire/src/java/org/jivesoftware/util/Log.java

      at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:716)

      at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:826)

      at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:697)

      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:300)

      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:316)

      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312)

      at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:369)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:43)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:34)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:34)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:34)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:34)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.ja va:34)

      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.ja va:52)

      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:366)

      at com.jivesoftware.tools.selector.BaseSelector.getSources(Unknown Source)

      at com.jivesoftware.tools.selector.BaseSelector.isSelected(Unknown Source)

      at org.apache.tools.ant.DirectoryScanner.isSelected(DirectoryScanner.java:1539)

      at org.apache.tools.ant.DirectoryScanner.processIncluded(DirectoryScanner.java:134 0)

      at org.apache.tools.ant.DirectoryScanner.accountForIncludedFile(DirectoryScanner.j ava:1300)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1252)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1279)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1279)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1279)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1279)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1279)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1203)

      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1165)

      at org.apache.tools.ant.DirectoryScanner.checkIncludePatterns(DirectoryScanner.jav a:947)

      at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:901)

      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet. java:499)

      at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:475)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      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:1399)

      at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java :41)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

      at org.apache.tools.ant.Main.runBuild(Main.java:809)

      at org.apache.tools.ant.Main.startAnt(Main.java:217)

      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

I would guess that your local version is running a different version of Ant, or something along those lines since the builds seem to work fine. Works on my box at home as well.

Not that the patch shouldn’t be applied, it looks like a clear error.

Hi, Thanks, your patch also has a lot of debian build changes. Could you desribe those some?

thanks,

daryl

I have accidentially added to much from the staging are to the patch. Sorry for that. Those changes weren’t meant to be released to public. I’ve made them to build the openfire .deb on an non-debian machine.

Here is the right patch.
build-fix.patch.zip (610 Bytes)

Thanks, OF-542

I’ve changed @Deprecated() for @Deprecated, without applying the rest of the patch - all of that whitespace seems pretty pointless.

As Robin pointed out - the builds on Bamboo work fine, as do they on various other machines. Flow, what is your setup? I wonder what is the exact cause of your problem.

Nothing special: A standard Gentoo installation with the java dev tools (ant 1.8.2, jdk 1.6.0.29).

Actually, I take back what I said earlier. There appears to be no error here at all. I incorrectly assumed the statement in question was a javadoc tag, but it is in fact an annotation. An annotation without any parameters can still have perenthesis, they are just optional.

It works everywhere else because there is nothing wrong with the code.

The error seems to be with the thoughtworks parser (based on the stacktrace, which fails trying to parse that line in the source. What target uses that parser anyway? I was able to run the javadoc target without any issue.