Skip to main content
Participant
Oct 9, 2010 6:40 PM UTC
Question

String index out of range: -15

When I try and run FlexPMD from the command line or through Maven Site I get the following exception:

com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -15
        at java.lang.String.substring(Unknown Source)
        at com.adobe.ac.pmd.nodes.impl.MetaDataNode.compute(MetaDataNode.java:72)
        at com.adobe.ac.pmd.nodes.impl.NodeFactory.createMetaData(NodeFactory.java:48)
        at com.adobe.ac.pmd.nodes.impl.AbstractNode.computeMetaDataList(AbstractNode.java:59)
        at com.adobe.ac.pmd.nodes.impl.FunctionNode.compute(FunctionNode.java:145)
        at com.adobe.ac.pmd.nodes.impl.ClassNode.detectFunction(ClassNode.java:414)
        at com.adobe.ac.pmd.nodes.impl.ClassNode.computeClassContent(ClassNode.java:366)
        at com.adobe.ac.pmd.nodes.impl.ClassNode.compute(ClassNode.java:129)
        at com.adobe.ac.pmd.nodes.impl.PackageNode.compute(PackageNode.java:86)
        at com.adobe.ac.pmd.nodes.impl.NodeFactory.createPackage(NodeFactory.java:57)
        at com.adobe.ac.pmd.files.FileSetUtils.computeAsts(FileSetUtils.java:136)
        at com.adobe.ac.pmd.FlexPmdViolations.computeAsts(FlexPmdViolations.java:123)
        at com.adobe.ac.pmd.FlexPmdViolations.computeViolations(FlexPmdViolations.java:102)
        at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.computeViolations(AbstractFlexPmdEngine.java:161)
        at com.adobe.ac.pmd.engines.AbstractFlexPmdEngine.executeReport(AbstractFlexPmdEngine.java:138)
        at com.adobe.ac.pmd.commandline.FlexPMD.startFlexPMD(FlexPMD.java:119)
        at com.adobe.ac.pmd.commandline.FlexPMD.main(FlexPMD.java:70)

When I run through eclipse on a small set of code it works fine.  However if I try running on the whole project it never seems to finish after an hour.  I am using version 1.2 on a Windows 7 box.

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

RobStacyAuthor
Participant
Oct 9, 2010 6:52 PM UTC

Here is the offending class that causes the issue:

package com.zcorum.truvizion.vo
{
    public class MacAddress
    {
        [RemoteClass(alias="com.zcorum.enterprise.common.MacAddress"]);
        public function MacAddress() {
        }
    }
}

Translate
clintmodien
Known Participant
Oct 9, 2010 7:14 PM UTC

try putting the RemoteClass tag on the class not on the constructor

Translate
RobStacyAuthor
Participant
Oct 9, 2010 7:24 PM UTC

Tried that and it still fails.  The only way I could get it to work was to remove the RemoteClass completely.  On a side note, I am getting out of memory when I run the plugin in Maven with MVN site.  Suggestions?

Translate