🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3264

Re: Which is the problem in: date.getMonth().toString()

#3264
From: Rich Wilkman
Date: Fri, 03 Apr 1998 00:00
64 lines
2572 bytes
Carlos:

getDay() and all the other "useful" methods in Date return int and not
Integer.  To make an int a String you do String.valueOf(int) instead
of the .toString() you are using.

The deprecation warning comes because the *entire* Date class has been
deprecated in 1.1

-Rich

Carlos Javier Castro Pe�a wrote:
> 
> Sorry, I made a mistake in the previous message and pressed the 'quote'
> button. My message is:
> 
> I need to compare if the actual month equals a string. The method is:
> 
> protected boolean filter_records (String tokens[], boolean valid, int
> log_day, int log_month, int log_time, int log_service, int log_hostname,
> int log_message, String configured_PERIOD) {
>     Date date = new Date();
>     if (configured_PERIOD.equals("all")) {
>       valid = true;
>     }
>       else if ( (configured_PERIOD.equals("month")) &&
> (tokens[log_month].equals() ))  {
>       valid = true;
>     }
>       else if ( (configured_PERIOD.equals("today")) &&
> (tokens[log_day].equals(date.getDay().toString())) )  {
>       valid = true;
>     }
>   return(valid);
>   }
> 
> I receive the following errors:
> 
> object type required, but int found (in the else if sentences)
> Warning: deprecated APIs are used.
> 
> Where are the problems?
> --
> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> Carlos Javier Castro Pe�a
> email: jcaspen@iname.com
> web:   http://www.latin-cancer.com/jcaspen
> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team

If you see something that looks like an opinion up there,
it's mine and mine alone.

Mail sent to me from the newsgroups won't bounce but will
be ignored.  If I have time, I'll respond, but you  have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <352517C9.A4195A07@corp.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35251628.E999AE98@iname.com> <35251697.BFBA6376@iname.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,3d3247475eff7b17
X-Google-Attributes: gid1089d0,public
From: Rich Wilkman <rwilkman@corp.borland.com>
Subject: Re: Which is the problem in: date.getMonth().toString()
Date: 1998/04/03
Message-ID: <352517C9.A4195A07@corp.borland.com>
X-Deja-AN: 340558725
Content-Transfer-Encoding: 8bit
References: <35251628.E999AE98@iname.com> <35251697.BFBA6376@iname.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.api