Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

String index out of range: -15

New Here ,
Oct 09, 2010 Oct 09, 2010

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.

TOPICS
FlexPMD
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2010 Oct 09, 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() {
        }
    }
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 09, 2010 Oct 09, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2010 Oct 09, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 10, 2010 Oct 10, 2010

It looks like a bug.

Could you create a ticket on JIRA?

https://bugs.adobe.com/jira/browse/FLEXPMD


About the out-of-memory error, you may need to increase the memory of your Java heap.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 10, 2010 Oct 10, 2010

Can you try to remove the ';' at the end of the metadata?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 17, 2010 Oct 17, 2010
LATEST

Unfortunately I have removed the file and have not had time to test it.  However, it seems the ']' and ')' are out of order

on the metadata.  This may be causing the error.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines