baidu / baidu/Cafe

遍历测试报java.lang.StringIndexOutOfBoundsException

Open
#19 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
367
Forks
209
PR merge metrics
No merged PRs in 30d

Description

error message="java.lang.StringIndexOutOfBoundsException: length=88; regionStart=0; regionLength=-1" type="java.lang.StringIndexOutOfBoundsException">java.lang.StringIndexOutOfBoundsException: length=88; regionStart=0; regionLength=-1
at java.lang.String.startEndAndLength(String.java:583)
at java.lang.String.substring(String.java:1464)
at com.baidu.cafe.local.traveler.Operation.getTypeString(Operation.java:288)
at com.baidu.cafe.local.traveler.Operation.isTheSameView(Operation.java:271)
at com.baidu.cafe.local.traveler.Operation.equals(Operation.java:212)
at java.util.ArrayList.indexOf(ArrayList.java:354)
at com.baidu.cafe.local.traveler.APPTraveler.updateNodeChildren(APPTraveler.java:408)
at com.baidu.cafe.local.traveler.APPTraveler.travel(APPTraveler.java:122)
at com.baidu.cafe.local.LocalLib.travel(LocalLib.java:2335)
at com.baidu.cafe.local.LocalLib.travel(LocalLib.java:2343)
at com.baidu.cafe.test.CafeTraveler.test_travel(CafeTraveler.java:39)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:115)
at junit.framework.TestResult.runProtected(TestResult.java:133)
at junit.framework.TestResult.run(TestResult.java:118)
at junit.framework.TestCase.run(TestCase.java:124)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1667)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with CafeTraveler.test_travel and reproduce the reported exception. Trace the call through APPTraveler.updateNodeChildren to Operation.equals, isTheSameView, and getTypeString at Operation.java:288. Done means the traversal test completes without the StringIndexOutOfBoundsException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.