eldur / jwbf

Java Wiki Bot Framework is a library to maintain Wikis like Wikipedia based on MediaWiki.
http://jwbf.sourceforge.net/
Apache License 2.0
78 stars 33 forks source link

Add support for int params in RequestBuilder #27

Closed lorinczz closed 10 years ago

lorinczz commented 10 years ago

I wrote an action which has an integer parameter baserevid and I got this:

Exception in thread "main" java.lang.UnsupportedOperationException: No Handler found for java.lang.Integer
    at net.sourceforge.jwbf.core.actions.HttpActionClient.applyToEntityBuilder(HttpActionClient.java:205)
    at net.sourceforge.jwbf.core.actions.HttpActionClient.post(HttpActionClient.java:186)
    at net.sourceforge.jwbf.core.actions.HttpActionClient.processAction(HttpActionClient.java:159)
    at net.sourceforge.jwbf.core.actions.HttpActionClient.performAction(HttpActionClient.java:133)
    at net.sourceforge.jwbf.core.bots.HttpBot.performAction(HttpBot.java:56)
    at net.sourceforge.jwbf.mediawiki.bots.MediaWikiBot.performAction(MediaWikiBot.java:261)
    at net.sourceforge.jwbf.mediawiki.bots.MediaWikiBot.getPerformedAction(MediaWikiBot.java:266)
eldur commented 10 years ago

Sounds that there is a missing mapping or an too open signature at my side -- can you give me your lines, where you try to build the request?

I assume something like this

new ApiRequestBuilder() //
        .action("whatever") //
        .postParam("baserevid", 1) //
        ...

if so, the quickfix will be, but I have to improve this definitely.

        .postParam("baserevid", "1") //
lorinczz commented 10 years ago

Exactly. This was the case.

eldur commented 10 years ago

Hope this makes it clearer, how postParam should be used https://github.com/eldur/jwbf/commit/2a5410d959fa07a8487add0319ab53876a66490d#diff-d4ba5366a91c58b5aaeb8f8638fe254bL62

If you are fine with this, I'll close this issue, ok?

lorinczz commented 10 years ago

It's working now. Thank you.