This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229805 - 'REST Client from Java' wizard generated uncompile-able code
Summary: 'REST Client from Java' wizard generated uncompile-able code
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 7.3.1
Hardware: All All
: P1 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-15 20:52 UTC by David Konecny
Modified: 2013-05-17 13:28 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2013-05-15 20:52:53 UTC
Generated code should:

* use javax.ws.rs.client.ClientBuilder instead of javax.ws.rs.client.ClientFactory
* remove "throws javax.ws.rs.client.ClientException"
* replace java.util.Entry with java.util.Map.Entry

These are few problems I notice so far.
Comment 1 David Konecny 2013-05-16 00:24:53 UTC
Fixed in: c105c7678174

Apart from the problems mentioned previously the fix does following:

* instead of removing "throws javax.ws.rs.client.ClientException" I replaced it with "throws javax.ws.rs.ClientErrorException"

* eliminates warning "non-varargs call of varargs method with inexact argument type", that is values usage is now casted to (Object[])

* client for CRUD REST was incorrectly calling delete method with null, for example webTarget.path(smth).request().delete(null);

* empty statement was removed from generated code

There are few other bugs which I'm going to file separately.
Comment 2 David Konecny 2013-05-16 02:43:37 UTC
I filled few more issues:

* issue 229814 - REST Java Client wizard generates uncompilable code - SSL and BASIC authentication

* issue 229815 - REST Java Client wizard generates uncompilable code for Flick rest service

* issue 229816 - REST Java Client wizard throws exception for Delicious service

I have not tested everything but these were problems I bumped into fairly quickly.
Comment 3 Jiri Skrivanek 2013-05-16 08:29:27 UTC
Verified in NetBeans IDE Dev (Build web-main-10532-on-20130516) but filed

Bug 229827 - REST Java Client in web project cannot be deployed.
Comment 4 Petr Hejl 2013-05-16 11:48:40 UTC
The patch seems to be ok.
Comment 5 Petr Jiricka 2013-05-16 13:15:55 UTC
Transplanted to 7.3.1: 
http://hg.netbeans.org/releases/rev/5f2f1e41b9e3
Comment 6 Quality Engineering 2013-05-17 00:04:56 UTC
Integrated into 'releases', will be available in build *201305162200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/5f2f1e41b9e3
User: David Konecny <dkonecny@netbeans.org>
Log: #229805 - 'REST Client from Java' wizard generated uncompile-able code
Comment 7 Quality Engineering 2013-05-17 09:52:09 UTC
Integrated into 'main-golden', will be available in build *201305170640* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c105c7678174
User: David Konecny <dkonecny@netbeans.org>
Log: #229805 - 'REST Client from Java' wizard generated uncompile-able code