GithubHelp home page GithubHelp logo

kohsuke / youdebug Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 15.0 469 KB

Non-interactive Java debugger with Groovy

Home Page: http://youdebug.kohsuke.org/

License: MIT License

Groovy 63.73% CSS 1.37% Java 34.90%

youdebug's People

Contributors

kohsuke avatar muzir avatar uehaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

youdebug's Issues

Update to work with modern Java versions and Groovy 4

Hey,

I have given a couple of presentations on YouDebug in the past (local Java User Group, GR8Conf 2015 in Copenhagen) and just this week at JavaLand 2024 in Germany. For the latter I updated YouDebug to work with modern Java versions (JDK11+) and would like to see if/how we can merge this upstream instead of live in my clone of the repo.

I will create a PR and am happy to discuss the changes.

Iterate HashMap entries from script

Hi,

I wrote the following script:

vm.breakpoint("com.acme.Test",111) {
    def map = hashmap
    def entries = map.entrySet()
    println map
    println entries
}

Which prints:

instance of java.util.HashMap(id=33)
instance of java.util.HashMap$EntrySet(id=38)

Although entries should be a Set, not java.util.HashMap$EntrySet since that class does not exist.

When I iterate over the entries, I get the following exception:

vm.breakpoint("freemarker.template.Template",383) {
    def map = dataModel.map
    def entries = map.entrySet()
    println map
    println entries
    for (entry in entries) {
        println(entry.getKey())
    }
}
Caused by: org.kohsuke.youdebug.NoSuchMethodException: No such method getKey on class java.util.HashMap$EntrySet (no class loader) that takes [[]]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:192)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200)
	at org.kohsuke.youdebug.JDICategory.chooseMethod(JDICategory.groovy:135)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:187)
	at org.kohsuke.youdebug.JDICategory.methodMissing(JDICategory.groovy:84)
	... 125 more

What would be the way to iterate through HashMap entries?

Thanks!

No license specified

YouDebug does not state its license. I searched the pom.xml, source code headers, documentation, ... but to no avail. Could you please clarify the license? Is it Apache Public License 2.0 or MIT?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.