Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PatternSyntaxException in AndroidFileHandle.java #21

Open
GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment
Open

PatternSyntaxException in AndroidFileHandle.java #21

GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Trying to run the gdx-tests on an HTC Desire with Android 2.3.7.

What is the expected output? What do you see instead?
I see a "Force Close" when choosing an item from the testlist.

Problem comes from:
Package: com.badlogic.gdx.backends.android
File: AndroidFileHandle.java

I believe its the malformed regex "\\"
Row 36: super(fileName.replaceAll("\\", "/"), type);
Row 46: name = name.replaceAll("\\", "/");

Possible solution: use replace("\\", "/")
or rewrite the regex (escape the backslashes).

My logcat:
-------------
05-19 21:11:33.625: W/dalvikvm(26686): threadid=9: thread exiting with uncaught 
exception (group=0x40015560)
05-19 21:11:33.625: E/AndroidRuntime(26686): FATAL EXCEPTION: GLThread 10
05-19 21:11:33.625: E/AndroidRuntime(26686): 
java.util.regex.PatternSyntaxException: Syntax error 
U_REGEX_BAD_ESCAPE_SEQUENCE near index 1:
05-19 21:11:33.625: E/AndroidRuntime(26686): \
05-19 21:11:33.625: E/AndroidRuntime(26686):  ^
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
java.util.regex.Pattern.compileImpl(Native Method)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
java.util.regex.Pattern.compile(Pattern.java:400)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
java.util.regex.Pattern.<init>(Pattern.java:383)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
java.util.regex.Pattern.compile(Pattern.java:374)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
java.lang.String.replaceAll(String.java:1963)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
com.badlogic.gdx.backends.android.AndroidFileHandle.<init>(AndroidFileHandle.jav
a:36)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
com.badlogic.gdx.backends.android.AndroidFiles.internal(AndroidFiles.java:55)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
com.badlogic.gdx.tests.ShadowMappingTest.setupScene(ShadowMappingTest.java:86)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
com.badlogic.gdx.tests.ShadowMappingTest.create(ShadowMappingTest.java:70)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphi
cs.java:292)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
05-19 21:11:33.625: E/AndroidRuntime(26686):    at 
android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

Original issue reported on code.google.com by r...@ernell.se on 19 May 2012 at 7:41

@GoogleCodeExporter
Copy link
Author

The problem has been resolved in latest version by using replace(....)
Thanks.

Original comment by r...@ernell.se on 21 May 2012 at 10:41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant