[ checkstyle-Bugs-1589131 ] [indentation]AOOB exception on Runnable with inner switch

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ checkstyle-Bugs-1589131 ] [indentation]AOOB exception on Runnable with inner switch

SourceForge.net
Bugs item #1589131, was opened at 2006-11-02 00:59
Message generated for change (Comment added) made by joba01
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1589131&group_id=29721

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Framework
Group: release 4.2
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Johannes Stamminger (jstammi)
Assigned to: Nobody/Anonymous (nobody)
Summary: [indentation]AOOB exception on Runnable with inner switch

Initial Comment:
Attached class leads to:

checkstyle-must-have-rules:
[checkstyle] Running Checkstyle 4.1 on 1 files
[checkstyle]
src/main/net/eads/space/lapap/plugin/clsw/CheckstyleBug.java:0:
Got an exception -
java.lang.ArrayIndexOutOfBoundsException: 2147483647


When moving the switch part to separat method the
AOOB exception disappears.

----------------------------------------------------------------------

Comment By: joba01 (joba01)
Date: 2012-04-19 06:36

Message:
Hey,

seems to be an old bug but is still not fixed, are there any attempts to
fix it?
I'm using: Eclipse Checkstyle Plug-in 5.5.0.201111092104

In case the first line of a file is emtpy an ArrayOutOfBound exception
occurs.

I use the following rule:

<module name="RegexpMultiline"><property name="id"
value="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck_1334841628"/><property
name="severity" value="warning"/><property name="format"
value="@SimpleValue(\(.*?\))?([\n\r\s])*([(private)(public)(protected)(static)([\n\r\s])*])*([\n\r\s])*final"/><property
name="message" value="KiSImpleValue Injections may not be
'final'"/></module

cheers Joe

----------------------------------------------------------------------

Comment By: Tomaszewski P. (ksswzza)
Date: 2011-10-03 06:01

Message:
Happens with
Eclipse Checkstyle Plugin 5.4.1.201109192037
also.

----------------------------------------------------------------------

Comment By: chaosdeathfish (chaosdeathfish)
Date: 2006-12-07 04:31

Message:
Logged In: YES
user_id=1297990
Originator: NO

The problem appears to be in
com.puppycrawl.tools.checkstyle.checks.indentation.ExpressionHandler#getFirstLine
(line 450). I've fixed the problem in by adding the following before line
462:

if (currLine < aStartLine) {
    aStartLine = currLine;
}

This seems to have fixed the problem, but I have no idea if this is correct
behaviour.

----------------------------------------------------------------------

Comment By: Oleg Sukhodolsky (o_sukhodolsky)
Date: 2006-11-08 12:33

Message:
Logged In: YES
user_id=746148

The problem is in IndentationCheck andit isreproduciblewith 4.2.
Here is a stack trace:
java.lang.ArrayIndexOutOfBoundsException: 2147483647
        at
com.puppycrawl.tools.checkstyle.checks.indentation.ExpressionHandler.checkExpressionSubtree(ExpressionHandler.java:434)
        at
com.puppycrawl.tools.checkstyle.checks.indentation.ExpressionHandler.checkChildren(ExpressionHandler.java:410)
        at
com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler.checkIndentation(BlockParentHandler.java:298)
        at
com.puppycrawl.tools.checkstyle.checks.indentation.MethodDefHandler.checkIndentation(MethodDefHandler.java:131)
        at
com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.visitToken(IndentationCheck.java:256)
        at
com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:500)
        at
com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:625)
        at
com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:426)
        at
com.puppycrawl.tools.checkstyle.TreeWalker.process(TreeWalker.java:244)
        at
com.puppycrawl.tools.checkstyle.TreeWalker.process(TreeWalker.java:590)
        at
com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:239)
        at com.puppycrawl.tools.checkstyle.Main.main(Main.java:127)


----------------------------------------------------------------------

Comment By: Johannes Stamminger (jstammi)
Date: 2006-11-02 03:58

Message:
Logged In: YES
user_id=1521016

Sorry, if we have the need to change our build env then we may do this.

But this is a shared build productive environment (automated builds on a
perforce
server checking for compilation, code style, metrics, unit tests, ...) for
a large
team that I may not change just for testing a newer release. For that
purpose I
have to setup a copy of that server, update the checkstyle and then may
test it.
And before using the changed configuration we would observe the copy build
server
some time before switching our configuration (if the problem solving is not
a
blocker, as it is here as we now use the workaround).

But anyway, I will see if I can test for it locally.

----------------------------------------------------------------------

Comment By: Oliver Burn (oburn)
Date: 2006-11-02 02:30

Message:
Logged In: YES
user_id=218824

this may be a silly question, but if you cannot update the
version of Checkstyle, then how would you be able to take a
patch to fix the problem?

Please verify if it is a problem under 4.2 as there are a
number of bug fixes in that release.

Also, please attached a full stack track so I can see where
the AOOB is being generated.

----------------------------------------------------------------------

Comment By: Johannes Stamminger (jstammi)
Date: 2006-11-02 02:21

Message:
Logged In: YES
user_id=1521016

Sorry, but it is not that easy for me to switch the checkstyle installation
as it
is in controlled automated build environment. Please request again if you
cannot
reproduce this bug, I will then spent some more effort on this.

----------------------------------------------------------------------

Comment By: Oliver Burn (oburn)
Date: 2006-11-02 02:07

Message:
Logged In: YES
user_id=218824

and could you test with 4.2 release.

----------------------------------------------------------------------

Comment By: Oliver Burn (oburn)
Date: 2006-11-02 02:06

Message:
Logged In: YES
user_id=218824

also need the configuration file you are using for the checks.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1589131&group_id=29721

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Checkstyle-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-devel