Skip to content

Instantly share code, notes, and snippets.

@tksmaru
Last active December 15, 2015 21:19
Show Gist options
  • Save tksmaru/5325012 to your computer and use it in GitHub Desktop.
Save tksmaru/5325012 to your computer and use it in GitHub Desktop.
StringUtilsにまんまと騙された件
@Grab(group='commons-lang', module='commons-lang', version='2.6')
import org.apache.commons.lang.StringUtils;
assert ! StringUtils.isAlpha("2"); // false
assert StringUtils.isAlpha("a"); // true
assert ! StringUtils.isAlpha("あ"); // true…だと…?
@tksmaru
Copy link
Author

tksmaru commented Apr 17, 2013

2013/04/17 9:11:43 org.codehaus.groovy.runtime.StackTraceUtils sanitize
警告: Sanitizing stacktrace:
Assertion failed: 

assert ! StringUtils.isAlpha("あ")
       |             |
       false         true

    at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:386)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:658)
    at ConsoleScript6.run(ConsoleScript6:8)
    at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:266)
    at groovy.lang.GroovyShell.run(GroovyShell.java:517)
    at groovy.lang.GroovyShell.run(GroovyShell.java:172)
    at groovy.lang.GroovyShell$run.call(Unknown Source)
    at groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy:927)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
    at groovy.lang.Closure.call(Closure.java:412)
    at groovy.lang.Closure.call(Closure.java:406)
    at groovy.lang.Closure.run(Closure.java:490)
    at java.lang.Thread.run(Thread.java:680)

Assertion failed: 

assert ! StringUtils.isAlpha("あ")
       |             |
       false         true

    at ConsoleScript6.run(ConsoleScript6:8)

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