Skip to main content
Participant
October 9, 2010
Question

String index out of range: -15

  • October 9, 2010
  • 1 reply
  • 2964 views

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 has been closed for replies.

1 reply

RobStacyAuthor
Participant
October 9, 2010

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() {
        }
    }
}

clintmodien
Known Participant
October 9, 2010

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

RobStacyAuthor
Participant
October 9, 2010

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?