Article View: borland.public.jbuilder.java.language
Article #605Re: The static method readURL(String) from the type URLReader should
From: Scott
Date: Thu, 24 Mar 2005 15:40
Date: Thu, 24 Mar 2005 15:40
41 lines
2387 bytes
2387 bytes
Kevin,
Thanks -- the design didn't start with the method being static and I
completely forgot about the class vs. object bit.
"Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com> wrote in message
news:xn0e03hxrhnuac001-kdean@www.teamb.com...
> scott wrote:
>
> > //line below generates warning
> > public String readURL(String url){
> > String rc = "";
> > try {
> > rc = urlReader.readURL(url);
> > } catch (MalformedURLException e){
> > System.err.println(e.getMessage());
> > }
> > return rc;
> > }
> >
>
> The warning is telling you that you are using an object to call a
> static method; the object is redundant as static methods are usually
> referred to through their class name. Try replacing the object with
> the class name as follows and the warning should go away:
>
> rc = URLReader.readURL(url);
>
> --
> Kevin Dean [TeamB]
> Dolphin Data Development Ltd.
> http://www.datadevelopment.com/
>
> NEW WHITEPAPERS
> Team Development with JBuilder and Borland Enterprise Server
> Securing Borland Enterprise Server
> http://www.datadevelopment.com/papers/index.html
>
> Please see Borland's newsgroup guidelines at
> http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<4242dfb4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4240a17f$1@newsgroups.borland.com> <4240a90c@newsgroups.borland.com> <4241baaa$1@newsgroups.borland.com> <xn0e03hxrhnuac001-kdean@www.teamb.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,6574813dc04e4e07 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Scott" <scotthpowell@yahoo.com> From: "Scott" <scotthpowell@yahoo.com> Newsgroups: borland.public.jbuilder.java.language References: <4240a17f$1@newsgroups.borland.com> <4240a90c@newsgroups.borland.com> <4241baaa$1@newsgroups.borland.com> <xn0e03hxrhnuac001-kdean@www.teamb.com> Subject: Re: The static method readURL(String) from the type URLReader should Date: Thu, 24 Mar 2005 07:40:07 -0800 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 4.28.245.129 Message-ID: <4242dfb4$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111678900 4.28.245.129 (24 Mar 2005 07:41:40 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail