FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Question about Netbeans code generation...

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
David Lehrian
Posted via mailing list.





PostPosted: Tue Dec 09, 2008 11:57 pm    Post subject: Question about Netbeans code generation... Reply with quote

When I add a method that throws an exception, Netbeans gives me the option to catch it or re-throw it. When I say I would like to catch it, it adds the following code:

try{

} catch (SomeException ex) {
Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 1:09 am    Post subject: Question about Netbeans code generation... Reply with quote

I don't think you can. The best you can do is make it not write out the Logger statement in Tools|Options|Editor|Hints|Error Fixes|Surround with try-catch and there you will see different check boxes to turn on or off. Seems the hints mechanism really needs to allow some free marker templates like the code templates allow to be entered for them. That would make them much more customizable. They could leave the defaults to use the check boxes, but let folks override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

as I thought that would be a good thing to have. You and others can vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...


When I add a method that throws an exception, Netbeans gives me the option to catch it or re-throw it. When I say I would like to catch it, it adds the following code:

try{

} catch (SomeException ex) {
Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave
Back to top
David Lehrian
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 2:01 am    Post subject: Question about Netbeans code generation... Reply with quote

Ahhh, I see. Thanks for your reply and for filing the request.
Warm Regards,
Dave





From: Wade Chandler [mailto:address-removed]
Sent: Tuesday, December 09, 2008 5:09 PM
To: address-removed
Subject: Re: [nbusers] Question about Netbeans code generation...


I don't think you can. The best you can do is make it not write out the Logger statement in Tools|Options|Editor|Hints|Error Fixes|Surround with try-catch and there you will see different check boxes to turn on or off. Seems the hints mechanism really needs to allow some free marker templates like the code templates allow to be entered for them. That would make them much more customizable. They could leave the defaults to use the check boxes, but let folks override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

as I thought that would be a good thing to have. You and others can vote for it if you think it would be good to have.

Wade


==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org




From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...
When I add a method that throws an exception, Netbeans gives me the option to catch it or re-throw it. When I say I would like to catch it, it adds the following code:

try{

} catch (SomeException ex) {
Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave
Back to top
David G. Simmons
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 12:14 pm    Post subject: Question about Netbeans code generation... Reply with quote

On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:
Quote:
I don't think you can. The best you can do is make it not write out the Logger statement in Tools|Options|Editor|Hints|Error Fixes|Surround with try-catch and there you will see different check boxes to turn on or off. Seems the hints mechanism really needs to allow some free marker templates like the code templates allow to be entered for them. That would make them much more customizable. They could leave the defaults to use the check boxes, but let folks override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087



I hope no one had already voted for it, as it was just closed as a duplicate of a bug I filed a while ago. In fact, the behavior you complain about is actually the *fix* for the original bug (in the beginning, you got Logger. You must have wanted Logger. You HAD to have wanted Logger, because we gave you Logger.).


There was quite a dust-up here about that at the time. Some of us *couldn't* use Logger, and being forced to was a show-stopper.


I wish that Wade's comments on his solution were added to bug http://www.netbeans.org/issues/show_bug.cgi?id=116818 as part of the "Close as duplicate" process, but sadly, they are not (Another RFE for the Issuezilla system?).


dg

Quote:


as I thought that would be a good thing to have. You and others can vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed ([email]address-removed[/email])>
To: address-removed ([email]address-removed[/email])
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me the option to catch it or re-throw it. When I say I would like to catch it, it adds the following code:

try{

} catch (SomeException ex) {
Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave











--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed ([email]address-removed[/email])
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you get to thinkin' you're a person of some influence, try orderin'
somebody else's dog around.
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 2:40 pm    Post subject: Question about Netbeans code generation... Reply with quote

Sounds like a good IZ issue to file for IZ itself yes. Will you file one David? I added my comments to the other issue.

Thanks,

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 7:14:11 AM
Subject: Re: [nbusers] Question about Netbeans code generation...


On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:
Quote:
I don't think you can. The best you can do is make it not write out the Logger statement in Tools|Options|Editor|Hints|Error Fixes|Surround with try-catch and there you will see different check boxes to turn on or off. Seems the hints mechanism really needs to allow some free marker templates like the code templates allow to be entered for them. That would make them much more customizable. They could leave the defaults to use the check boxes, but let folks override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087



I hope no one had already voted for it, as it was just closed as a duplicate of a bug I filed a while ago. In fact, the behavior you complain about is actually the *fix* for the original bug (in the beginning, you got Logger. You must have wanted Logger. You HAD to have wanted Logger, because we gave you Logger.).


There was quite a dust-up here about that at the time. Some of us *couldn't* use Logger, and being forced to was a show-stopper.


I wish that Wade's comments on his solution were added to bug http://www.netbeans.org/issues/show_bug.cgi?id=116818 as part of the "Close as duplicate" process, but sadly, they are not (Another RFE for the Issuezilla system?).


dg

Quote:


as I thought that would be a good thing to have. You and others can vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed ([email]address-removed[/email])>
To: address-removed ([email]address-removed[/email])
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me the option to catch it or re-throw it. When I say I would like to catch it, it adds the following code:

try{

} catch (SomeException ex) {
Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave











--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed ([email]address-removed[/email])
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you get to thinkin' you're a person of some influence, try orderin'
somebody else's dog around.
Back to top
David G. Simmons
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 3:37 pm    Post subject: Question about Netbeans code generation... Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you file
one David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out
*where* to do it. Smile Goggled the daylights out of it and couldn't
find anything about where to file Issuezilla RFEs (did see that, at
least according to some, Issuezilla is 'dead', so I'm not sure if RFEs
are worth the effort. Not sure I'd mourn the death of it, either Smile )

Thanks,
dg

Quote:


Thanks,

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 7:14:11 AM
Subject: Re: [nbusers] Question about Netbeans code generation...


On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:

Quote:
I don't think you can. The best you can do is make it not write out
the Logger statement in Tools|Options|Editor|Hints|Error Fixes|
Surround with try-catch and there you will see different check
boxes to turn on or off. Seems the hints mechanism really needs to
allow some free marker templates like the code templates allow to
be entered for them. That would make them much more customizable.
They could leave the defaults to use the check boxes, but let folks
override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

I hope no one had already voted for it, as it was just closed as a
duplicate of a bug I filed a while ago. In fact, the behavior you
complain about is actually the *fix* for the original bug (in the
beginning, you got Logger. You must have wanted Logger. You HAD to
have wanted Logger, because we gave you Logger.).

There was quite a dust-up here about that at the time. Some of us
*couldn't* use Logger, and being forced to was a show-stopper.

I wish that Wade's comments on his solution were added to bug http://www.netbeans.org/issues/show_bug.cgi?id=116818
as part of the "Close as duplicate" process, but sadly, they are
not (Another RFE for the Issuezilla system?).

dg

Quote:


as I thought that would be a good thing to have. You and others can
vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me the
option to catch it or re-throw it. When I say I would like to
catch it, it adds the following code:

try{

} catch (SomeException ex) {

Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null,
ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave



--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous
statement:
If you get to thinkin' you're a person of some influence, try orderin'
somebody else's dog around.





- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you find yourself in a hole, the first thing to do is stop diggin'.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+IaJPG+temRST4RAgC9AKCdL7Cl1e7AvKHF6/QMxCsZRaDa3ACcCfGm
aNe2snoQ2hFzgJIYTizPtZM=
=xGLj
-----END PGP SIGNATURE-----
Back to top
Filip Zamboj
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 4:00 pm    Post subject: Question about Netbeans code generation... Reply with quote

Hi David,

if you want to file something to issuezilla try netbeans.org/issues.

-------
Regards,
Filip.



David G. Simmons wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you file
one David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out
*where* to do it. Smile Goggled the daylights out of it and couldn't
find anything about where to file Issuezilla RFEs (did see that, at
least according to some, Issuezilla is 'dead', so I'm not sure if RFEs
are worth the effort. Not sure I'd mourn the death of it, either Smile )

Thanks,
dg

Quote:


Thanks,

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 7:14:11 AM
Subject: Re: [nbusers] Question about Netbeans code generation...


On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:

Quote:
I don't think you can. The best you can do is make it not write out
the Logger statement in Tools|Options|Editor|Hints|Error
Fixes|Surround with try-catch and there you will see different check
boxes to turn on or off. Seems the hints mechanism really needs to
allow some free marker templates like the code templates allow to be
entered for them. That would make them much more customizable. They
could leave the defaults to use the check boxes, but let folks
override them with templates. I filed this issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

I hope no one had already voted for it, as it was just closed as a
duplicate of a bug I filed a while ago. In fact, the behavior you
complain about is actually the *fix* for the original bug (in the
beginning, you got Logger. You must have wanted Logger. You HAD to
have wanted Logger, because we gave you Logger.).

There was quite a dust-up here about that at the time. Some of us
*couldn't* use Logger, and being forced to was a show-stopper.

I wish that Wade's comments on his solution were added to bug
http://www.netbeans.org/issues/show_bug.cgi?id=116818 as part of the
"Close as duplicate" process, but sadly, they are not (Another RFE
for the Issuezilla system?).

dg

Quote:


as I thought that would be a good thing to have. You and others can
vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me the
option to catch it or re-throw it. When I say I would like to catch
it, it adds the following code:

try{

} catch (SomeException ex) {

Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave



--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you get to thinkin' you're a person of some influence, try orderin'
somebody else's dog around.





- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you find yourself in a hole, the first thing to do is stop diggin'.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+IaJPG+temRST4RAgC9AKCdL7Cl1e7AvKHF6/QMxCsZRaDa3ACcCfGm
aNe2snoQ2hFzgJIYTizPtZM=
=xGLj
-----END PGP SIGNATURE-----
Back to top
David G. Simmons
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 4:05 pm    Post subject: Question about Netbeans code generation... Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 11:01 AM, Filip Zamboj wrote:

Quote:
Hi David,

if you want to file something to issuezilla try netbeans.org/issues.

That's for issues against NetBeans IDE or Platform. Not Issuezilla
itself (unless I"m just being brain damaged and can't find the
Issuezilla area). I looked in Issuezilla itself, but couldn't find a
category for IZ.

dg

Quote:


-------
Regards,
Filip.



David G. Simmons wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you
file one David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out
*where* to do it. Smile Goggled the daylights out of it and couldn't
find anything about where to file Issuezilla RFEs (did see that, at
least according to some, Issuezilla is 'dead', so I'm not sure if
RFEs are worth the effort. Not sure I'd mourn the death of it,
either Smile )

Thanks,
dg

Quote:


Thanks,

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 7:14:11 AM
Subject: Re: [nbusers] Question about Netbeans code generation...


On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:

Quote:
I don't think you can. The best you can do is make it not write
out the Logger statement in Tools|Options|Editor|Hints|Error
Fixes|Surround with try-catch and there you will see different
check boxes to turn on or off. Seems the hints mechanism really
needs to allow some free marker templates like the code templates
allow to be entered for them. That would make them much more
customizable. They could leave the defaults to use the check
boxes, but let folks override them with templates. I filed this
issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

I hope no one had already voted for it, as it was just closed as a
duplicate of a bug I filed a while ago. In fact, the behavior you
complain about is actually the *fix* for the original bug (in the
beginning, you got Logger. You must have wanted Logger. You HAD to
have wanted Logger, because we gave you Logger.).

There was quite a dust-up here about that at the time. Some of us
*couldn't* use Logger, and being forced to was a show-stopper.

I wish that Wade's comments on his solution were added to bug http://www.netbeans.org/issues/show_bug.cgi?id=116818
as part of the "Close as duplicate" process, but sadly, they are
not (Another RFE for the Issuezilla system?).

dg

Quote:


as I thought that would be a good thing to have. You and others
can vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me
the option to catch it or re-throw it. When I say I would like
to catch it, it adds the following code:

try{

} catch (SomeException ex) {

Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null,
ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave



--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous
statement:
If you get to thinkin' you're a person of some influence, try
orderin'
somebody else's dog around.





- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous
statement:
If you find yourself in a hole, the first thing to do is stop
diggin'.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+IaJPG+temRST4RAgC9AKCdL7Cl1e7AvKHF6/QMxCsZRaDa3ACcCfGm
aNe2snoQ2hFzgJIYTizPtZM=
=xGLj
-----END PGP SIGNATURE-----

- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
A bumble bee is considerably faster than a John Deere tractor.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+iYJPG+temRST4RAun8AJ9dzZjhGCR1B8XqklSQAbS474IqnQCgy78f
QiDu/ICx5WEJ5F8deCOLTH4=
=LhL8
-----END PGP SIGNATURE-----
Back to top
Filip Zamboj
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 4:19 pm    Post subject: Question about Netbeans code generation... Reply with quote

hmm ... sorry, didn't read properly Sad. Anyway, I think those issues
belongs here,

http://www.netbeans.org/issues/enter_bug.cgi?component=www&issue_type=DEFECT

e.g., component www

F.

-------
Regards,
Filip.



David G. Simmons wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 11:01 AM, Filip Zamboj wrote:

Quote:
Hi David,

if you want to file something to issuezilla try netbeans.org/issues.

That's for issues against NetBeans IDE or Platform. Not Issuezilla
itself (unless I"m just being brain damaged and can't find the
Issuezilla area). I looked in Issuezilla itself, but couldn't find a
category for IZ.

dg

Quote:


-------
Regards,
Filip.



David G. Simmons wrote:
Quote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you
file one David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out
*where* to do it. Smile Goggled the daylights out of it and couldn't
find anything about where to file Issuezilla RFEs (did see that, at
least according to some, Issuezilla is 'dead', so I'm not sure if
RFEs are worth the effort. Not sure I'd mourn the death of it,
either Smile )

Thanks,
dg

Quote:


Thanks,

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 7:14:11 AM
Subject: Re: [nbusers] Question about Netbeans code generation...


On Dec 9, 2008, at 8:09 PM, Wade Chandler wrote:

Quote:
I don't think you can. The best you can do is make it not write
out the Logger statement in Tools|Options|Editor|Hints|Error
Fixes|Surround with try-catch and there you will see different
check boxes to turn on or off. Seems the hints mechanism really
needs to allow some free marker templates like the code templates
allow to be entered for them. That would make them much more
customizable. They could leave the defaults to use the check
boxes, but let folks override them with templates. I filed this
issue for you:
http://www.netbeans.org/issues/show_bug.cgi?id=155087

I hope no one had already voted for it, as it was just closed as a
duplicate of a bug I filed a while ago. In fact, the behavior you
complain about is actually the *fix* for the original bug (in the
beginning, you got Logger. You must have wanted Logger. You HAD to
have wanted Logger, because we gave you Logger.).

There was quite a dust-up here about that at the time. Some of us
*couldn't* use Logger, and being forced to was a show-stopper.

I wish that Wade's comments on his solution were added to bug
http://www.netbeans.org/issues/show_bug.cgi?id=116818 as part of
the "Close as duplicate" process, but sadly, they are not (Another
RFE for the Issuezilla system?).

dg

Quote:


as I thought that would be a good thing to have. You and others
can vote for it if you think it would be good to have.

Wade

==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org


From: David Lehrian <address-removed>
To: address-removed
Sent: Tuesday, December 9, 2008 6:57:05 PM
Subject: [nbusers] Question about Netbeans code generation...

When I add a method that throws an exception, Netbeans gives me
the option to catch it or re-throw it. When I say I would like to
catch it, it adds the following code:

try{

} catch (SomeException ex) {

Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null,
ex);
}

I would prefer it to say:

try{

} catch (SomeException ex) {
LogFactory.getLog(MyClass.class.getName()).error(ex);
}

Where in Netbeans do I change this?
Warm Regards,
Dave



--
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the World! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
NOTE: As per SunIT Policy, the following is *not* a humorous
statement:
If you get to thinkin' you're a person of some influence, try orderin'
somebody else's dog around.





- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
If you find yourself in a hole, the first thing to do is stop diggin'.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+IaJPG+temRST4RAgC9AKCdL7Cl1e7AvKHF6/QMxCsZRaDa3ACcCfGm
aNe2snoQ2hFzgJIYTizPtZM=
=xGLj
-----END PGP SIGNATURE-----

- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
A bumble bee is considerably faster than a John Deere tractor.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJP+iYJPG+temRST4RAun8AJ9dzZjhGCR1B8XqklSQAbS474IqnQCgy78f
QiDu/ICx5WEJ5F8deCOLTH4=
=LhL8
-----END PGP SIGNATURE-----
Back to top
Wade Chandler
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 7:42 pm    Post subject: Question about Netbeans code generation... Reply with quote

----- Original Message ----

Quote:
From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 10:36:58 AM
Subject: Re: [nbusers] Question about Netbeans code generation...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you file one
David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out *where* to do
it. Smile Goggled the daylights out of it and couldn't find anything about where
to file Issuezilla RFEs

Saw were you figured this out. I didn't get the issue number though :-S If you can reply back with it I'll add some of my comments from below the issue number.

Quote:
(did see that, at least according to some, Issuezilla is
'dead', so I'm not sure if RFEs are worth the effort. Not sure I'd mourn the
death of it, either Smile )


I didn't know IZ was dead. I thought it was just a version of BugZilla used by the projects and Collab. I know it comes from BugZilla. I don't think BugZilla is bad, but it isn't great. It is flexible though and open source. I know Apache uses Jira as it is free for OSS projects. I don't know though. I would rather use something completely free and open source for OSS personally, but maybe that is just a character flaw Very Happy

Seems IZ could be fairly easily ported to the latest BugZilla. Then maybe work with the BZ team to get some things in there like when something is closed as a duplicate that messages and votes get copied. However, there is the one situation where something isn't a duplicate, so what happens when it is reopened, and those transfered messages and votes are an error? Then, an entire table would have to be devoted to rolling back changes. The bad part probably is that folks don't read all duplicates messages and instead just scan the current page.

Now, a better change maybe is to change the way things are shown and queried. So, if a bug is closed as a duplicate of a given issue then its comments show up in the real issues list, and votes also show up in reporting for the real issue. Then, when the status is changed to reopened and it is no longer a duplicate then the comments show up again on the issue which was thought to be a duplicate. However, then you have the change of having some comments added to the wrong issue, but I don't know there is a good way around that scenario, but one possible and simple solution is to have the shown comments from the duplicate, and the votes, to reflect where they are from. Then a note can be displayed which helps the user understand if they think there is a possibility of the other issue not being a duplicate to vote and comment on that other bug instead. That would take care of most cases...especially once folks get used to it.

Anyways, I didn't keep the issue number we you set up your issue. If you can send it to me I'll add some of these comments to that issue, or you can copy and paste them from the email for me. I would love to have that addressed some how in IZ or moved to BugZ...

Wade


==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org
Back to top
David G. Simmons
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 7:55 pm    Post subject: Question about Netbeans code generation... Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 2:42 PM, Wade Chandler wrote:

Quote:
----- Original Message ----

Quote:
From: David G. Simmons <address-removed>
To: address-removed
Sent: Wednesday, December 10, 2008 10:36:58 AM
Subject: Re: [nbusers] Question about Netbeans code generation...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Dec 10, 2008, at 9:40 AM, Wade Chandler wrote:

Quote:
Sounds like a good IZ issue to file for IZ itself yes. Will you
file one
David? I added my comments to the other issue.

I saw that. THanks for doing so.

I'd be happy to file an RFE for Issuezilla, if I could figure out
*where* to do
it. Smile Goggled the daylights out of it and couldn't find anything
about where
to file Issuezilla RFEs

Saw were you figured this out. I didn't get the issue number
though :-S If you can reply back with it I'll add some of my
comments from below the issue number.

Yeah, made some (un)educated guesses ...
Quote:


Quote:
(did see that, at least according to some, Issuezilla is
'dead', so I'm not sure if RFEs are worth the effort. Not sure I'd
mourn the
death of it, either Smile )


I didn't know IZ was dead. I thought it was just a version of
BugZilla used by the projects and Collab. I know it comes from
BugZilla. I don't think BugZilla is bad, but it isn't great. It is
flexible though and open source. I know Apache uses Jira as it is
free for OSS projects. I don't know though. I would rather use
something completely free and open source for OSS personally, but
maybe that is just a character flaw Very Happy

<http://www.faqs.org/docs/bugzilla/variant-issuezilla.html> is the
"Issuezilla is dead" source. I use Bugzilla for bugtracking and like
it just fine. But hten again, we have a *very* small project to
manage. Nothing on the scale of NetBeans. I'm also a fan of using free
stuff for OSS projects (or non-OSS projects, for that matter).

Quote:
Seems IZ could be fairly easily ported to the latest BugZilla. Then
maybe work with the BZ team to get some things in there like when
something is closed as a duplicate that messages and votes get
copied. However, there is the one situation where something isn't a
duplicate, so what happens when it is reopened, and those transfered
messages and votes are an error? Then, an entire table would have to
be devoted to rolling back changes. The bad part probably is that
folks don't read all duplicates messages and instead just scan the
current page.

Now, a better change maybe is to change the way things are shown and
queried. So, if a bug is closed as a duplicate of a given issue then
its comments show up in the real issues list, and votes also show up
in reporting for the real issue. Then, when the status is changed to
reopened and it is no longer a duplicate then the comments show up
again on the issue which was thought to be a duplicate. However,
then you have the change of having some comments added to the wrong
issue, but I don't know there is a good way around that scenario,
but one possible and simple solution is to have the shown comments
from the duplicate, and the votes, to reflect where they are from.
Then a note can be displayed which helps the user understand if they
think there is a possibility of the other issue not being a
duplicate to vote and comment on that other bug instead. That would
take care of most cases...especially once folks get used to it.

Anyways, I didn't keep the issue number we you set up your issue. If
you can send it to me I'll add some of these comments to that issue,
or you can copy and paste them from the email for me. I would love
to have that addressed some how in IZ or moved to BugZ...

Ordinarily I would do both -- send you the issue ID and add your
comments, but I'm pressed for time today, so ...

<http://www.netbeans.org/issues/show_bug.cgi?id=155160>

Thanks,
dg

Quote:


Wade


==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer
Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org

- --
David G. Simmons
Staff Engineer, SunLabs
Voice: 650-568-4856 ** AIM/iChat: address-removed
BLOG: http://blogs.sun.com/davidgs
Program the world! http://www.SunSpotWorld.com/

** Message digitally signed for security and authenticity.
** If you cannot read the PGP.sig attachement, please go to
** http://www.gnupg.com/ Secure your email!!!
** Public key available at keyserver.pgp.com
NOTE: As per SunIT Policy, the following is *not* a humorous statement:
A bumble bee is considerably faster than a John Deere tractor.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFJQB6mJPG+temRST4RAl5TAKCnlpBfi8bl/Cn15wmFnX9dNd1iRACguPoD
ltCsSQMCdGrW1YBeB7Y06TQ=
=AifU
-----END PGP SIGNATURE-----
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB