You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Robert Sfeir <ro...@codepuccino.com> on 2004/05/17 22:01:34 UTC

[PATCH]Redundant Casts

Index: OQLLexer.java
===================================================================
RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/odmg/oql/OQLLexer.java,v
retrieving revision 1.18
diff -r1.18 OQLLexer.java
261c261
< 				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
---
> 				else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
628c628
< 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
---
> 			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
673c673
< 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
---
> 			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
749c749
< 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
---
> 			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
761c761
< 				if ( _cnt34>=1 ) { break _loop34; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
---
> 				if ( _cnt34>=1 ) { break _loop34; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
791c791
< 					if ( _cnt37>=1 ) { break _loop37; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
---
> 					if ( _cnt37>=1 ) { break _loop37; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
821c821
< 					if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
---
> 					if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
872c872
< 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
---
> 			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
988c988
< 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
---
> 			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());

Re: [PATCH]Redundant Casts

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi robert,

it was not my intension to give you a negative feedback. i've done lots of 
cleanups like you did (removing unused imports, unnecessary casts, hidden fields 
and the like) but i think we should not touch generated classes.

jakob


Robert Sfeir wrote:

> Don't know enough to discern between what to ignore and what not to  
> ignore :-)  Doesn't take that long to do these short ones.  I'm looking  
> for redundant thrown exception right now.  Will post a couple, and if I  
> don't get any negative feedback, or if I'm looking in the wrong place,  
> then I'll keep going on them.  There seems to be a few.
> 
> R
> 
> On May 17, 2004, at 4:16 PM, Jakob Braeuchi wrote:
> 
>> hi robert,
>>
>> i check these kinds of issues some times.
>> But OQLLexer is a generated class so imo we should not care about  
>> unnecessary casts. the other class QueryImpl is under development.
>>
>> jakob
>>
>> Robert Sfeir wrote:
>>
>>> Index: OQLLexer.java
>>> ===================================================================
>>> RCS file:  /home/cvspublic/db-ojb/src/java/org/apache/ojb/odmg/oql/ 
>>> OQLLexer.java,v
>>> retrieving revision 1.18
>>> diff -r1.18 OQLLexer.java
>>> 261c261
>>> <                 else {throw new 
>>> NoViableAltForCharException((char)LA(1),  getFilename(), getLine(), 
>>> getColumn());}
>>> ---
>>>
>>>>                 else {throw new NoViableAltForCharException(LA(1),  
>>>> getFilename(), getLine(), getColumn());}
>>>
>>> 628c628
>>> <             throw new NoViableAltForCharException((char)LA(1),  
>>> getFilename(), getLine(), getColumn());
>>> ---
>>>
>>>>             throw new NoViableAltForCharException(LA(1), 
>>>> getFilename(),  getLine(), getColumn());
>>>
>>> 673c673
>>> <             throw new NoViableAltForCharException((char)LA(1),  
>>> getFilename(), getLine(), getColumn());
>>> ---
>>>
>>>>             throw new NoViableAltForCharException(LA(1), 
>>>> getFilename(),  getLine(), getColumn());
>>>
>>> 749c749
>>> <             throw new NoViableAltForCharException((char)LA(1),  
>>> getFilename(), getLine(), getColumn());
>>> ---
>>>
>>>>             throw new NoViableAltForCharException(LA(1), 
>>>> getFilename(),  getLine(), getColumn());
>>>
>>> 761c761
>>> <                 if ( _cnt34>=1 ) { break _loop34; } else {throw 
>>> new  NoViableAltForCharException((char)LA(1), getFilename(), 
>>> getLine(),  getColumn());}
>>> ---
>>>
>>>>                 if ( _cnt34>=1 ) { break _loop34; } else {throw new  
>>>> NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>>> getColumn());}
>>>
>>> 791c791
>>> <                     if ( _cnt37>=1 ) { break _loop37; } else {throw 
>>> new  NoViableAltForCharException((char)LA(1), getFilename(), 
>>> getLine(),  getColumn());}
>>> ---
>>>
>>>>                     if ( _cnt37>=1 ) { break _loop37; } else {throw 
>>>> new  NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>>> getColumn());}
>>>
>>> 821c821
>>> <                     if ( _cnt40>=1 ) { break _loop40; } else {throw 
>>> new  NoViableAltForCharException((char)LA(1), getFilename(), 
>>> getLine(),  getColumn());}
>>> ---
>>>
>>>>                     if ( _cnt40>=1 ) { break _loop40; } else {throw 
>>>> new  NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>>> getColumn());}
>>>
>>> 872c872
>>> <             throw new NoViableAltForCharException((char)LA(1),  
>>> getFilename(), getLine(), getColumn());
>>> ---
>>>
>>>>             throw new NoViableAltForCharException(LA(1), 
>>>> getFilename(),  getLine(), getColumn());
>>>
>>> 988c988
>>> <             throw new NoViableAltForCharException((char)LA(1),  
>>> getFilename(), getLine(), getColumn());
>>> ---
>>>
>>>>             throw new NoViableAltForCharException(LA(1), 
>>>> getFilename(),  getLine(), getColumn());
>>>>
>>>>
>>>> --------------------------------------------------------------------- 
>>>> ---
>>>>
>>>> Index: QueryImpl.java
>>>> ===================================================================
>>>> RCS file:  
>>>> /home/cvspublic/db-ojb/src/java/org/apache/ojb/jdo/QueryImpl.java,v
>>>> retrieving revision 1.8
>>>> diff -r1.8 QueryImpl.java
>>>> 167c167
>>>> <         Collection results =  (Collection)  
>>>> m_conn.getCollectionByQuery(query);
>>>> ---
>>>>
>>>>>         Collection results =  m_conn.getCollectionByQuery(query);
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------- 
>>>>> ----
>>>>>
>>>>>
>>>>> Robert S. Sfeir
>>>>> Technical Lead
>>>>> HHS Portal
>>>>> robert_sfeir@sra.com
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------- 
>>>>> ----
>>>>>
>>>>> -------------------------------------------------------------------- -
>>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
> Robert S. Sfeir
> Technical Lead
> HHS Portal
> robert_sfeir@sra.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [PATCH]Redundant Casts

Posted by Robert Sfeir <ro...@codepuccino.com>.
Don't know enough to discern between what to ignore and what not to  
ignore :-)  Doesn't take that long to do these short ones.  I'm looking  
for redundant thrown exception right now.  Will post a couple, and if I  
don't get any negative feedback, or if I'm looking in the wrong place,  
then I'll keep going on them.  There seems to be a few.

R

On May 17, 2004, at 4:16 PM, Jakob Braeuchi wrote:

> hi robert,
>
> i check these kinds of issues some times.
> But OQLLexer is a generated class so imo we should not care about  
> unnecessary casts. the other class QueryImpl is under development.
>
> jakob
>
> Robert Sfeir wrote:
>
>> Index: OQLLexer.java
>> ===================================================================
>> RCS file:  
>> /home/cvspublic/db-ojb/src/java/org/apache/ojb/odmg/oql/ 
>> OQLLexer.java,v
>> retrieving revision 1.18
>> diff -r1.18 OQLLexer.java
>> 261c261
>> < 				else {throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());}
>> ---
>>> 				else {throw new NoViableAltForCharException(LA(1),  
>>> getFilename(), getLine(), getColumn());}
>> 628c628
>> < 			throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());
>> ---
>>> 			throw new NoViableAltForCharException(LA(1), getFilename(),  
>>> getLine(), getColumn());
>> 673c673
>> < 			throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());
>> ---
>>> 			throw new NoViableAltForCharException(LA(1), getFilename(),  
>>> getLine(), getColumn());
>> 749c749
>> < 			throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());
>> ---
>>> 			throw new NoViableAltForCharException(LA(1), getFilename(),  
>>> getLine(), getColumn());
>> 761c761
>> < 				if ( _cnt34>=1 ) { break _loop34; } else {throw new  
>> NoViableAltForCharException((char)LA(1), getFilename(), getLine(),  
>> getColumn());}
>> ---
>>> 				if ( _cnt34>=1 ) { break _loop34; } else {throw new  
>>> NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>> getColumn());}
>> 791c791
>> < 					if ( _cnt37>=1 ) { break _loop37; } else {throw new  
>> NoViableAltForCharException((char)LA(1), getFilename(), getLine(),  
>> getColumn());}
>> ---
>>> 					if ( _cnt37>=1 ) { break _loop37; } else {throw new  
>>> NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>> getColumn());}
>> 821c821
>> < 					if ( _cnt40>=1 ) { break _loop40; } else {throw new  
>> NoViableAltForCharException((char)LA(1), getFilename(), getLine(),  
>> getColumn());}
>> ---
>>> 					if ( _cnt40>=1 ) { break _loop40; } else {throw new  
>>> NoViableAltForCharException(LA(1), getFilename(), getLine(),  
>>> getColumn());}
>> 872c872
>> < 			throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());
>> ---
>>> 			throw new NoViableAltForCharException(LA(1), getFilename(),  
>>> getLine(), getColumn());
>> 988c988
>> < 			throw new NoViableAltForCharException((char)LA(1),  
>> getFilename(), getLine(), getColumn());
>> ---
>>> 			throw new NoViableAltForCharException(LA(1), getFilename(),  
>>> getLine(), getColumn());
>>>
>>>
>>> --------------------------------------------------------------------- 
>>> ---
>>>
>>> Index: QueryImpl.java
>>> ===================================================================
>>> RCS file:  
>>> /home/cvspublic/db-ojb/src/java/org/apache/ojb/jdo/QueryImpl.java,v
>>> retrieving revision 1.8
>>> diff -r1.8 QueryImpl.java
>>> 167c167
>>> < 		Collection results =  (Collection)  
>>> m_conn.getCollectionByQuery(query);
>>> ---
>>>
>>>> 		Collection results =  m_conn.getCollectionByQuery(query);
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> ----
>>>>
>>>>
>>>> Robert S. Sfeir
>>>> Technical Lead
>>>> HHS Portal
>>>> robert_sfeir@sra.com
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> ----
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
Robert S. Sfeir
Technical Lead
HHS Portal
robert_sfeir@sra.com


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [PATCH]Redundant Casts

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi robert,

i check these kinds of issues some times.
But OQLLexer is a generated class so imo we should not care about unnecessary 
casts. the other class QueryImpl is under development.

jakob

Robert Sfeir wrote:

> Index: OQLLexer.java
> ===================================================================
> RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/odmg/oql/OQLLexer.java,v
> retrieving revision 1.18
> diff -r1.18 OQLLexer.java
> 261c261
> < 				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
> ---
> 
>>				else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
> 
> 628c628
> < 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
> ---
> 
>>			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
> 
> 673c673
> < 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
> ---
> 
>>			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
> 
> 749c749
> < 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
> ---
> 
>>			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
> 
> 761c761
> < 				if ( _cnt34>=1 ) { break _loop34; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
> ---
> 
>>				if ( _cnt34>=1 ) { break _loop34; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
> 
> 791c791
> < 					if ( _cnt37>=1 ) { break _loop37; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
> ---
> 
>>					if ( _cnt37>=1 ) { break _loop37; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
> 
> 821c821
> < 					if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
> ---
> 
>>					if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
> 
> 872c872
> < 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
> ---
> 
>>			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
> 
> 988c988
> < 			throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
> ---
> 
>>			throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
>>
>>
>>------------------------------------------------------------------------
>>
>>Index: QueryImpl.java
>>===================================================================
>>RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/jdo/QueryImpl.java,v
>>retrieving revision 1.8
>>diff -r1.8 QueryImpl.java
>>167c167
>>< 		Collection results =  (Collection) m_conn.getCollectionByQuery(query);
>>---
>>
>>>		Collection results =  m_conn.getCollectionByQuery(query);
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> Robert S. Sfeir
>>> Technical Lead
>>> HHS Portal
>>> robert_sfeir@sra.com
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org