Hello Thomas,

Inspector is quite right here. You do not need assign any default
value to newtext because it will be initialized by each control flow
path before it would be used for the first time. So, declaring
"StringBuffer newtext;" would be just perfect.

-- 
Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"

HT> i get the Message 'Variable newtext intializer null at line 1487 is
HT> redundant' : and the code looks like this:

HT> // example 

HT>         StringBuffer newtext = null;

HT>         if ( condition )  {
HT>                 newtext = new StringBuffer("text");
HT>         } else if ( condition1) {
HT>                 newtext = new StringBuffer("text1");    
HT>         } else newtext = StringBuffer("");

HT>         // and later i.e
HT>         System.out.println(newtext);

HT> any ideas ? do i something wrong ? i don't want to initialize the
HT> StringBuffer twice ( first with the default value ("") ( or other :) ), and
HT> then (if condition or condition1 == true) the second time...


HT> Thanks for feature 'Type cast is redudant', but i miss the option of
HT> automatically removing of the redudant casting statements, if i remove them
HT> manually, idea throws exceptions ( Internal Error occured-dialog ), the code
HT> inspection status becomes 'INVALID' and it has to be restarted :((

HT> It seems like the app becomes slooooooow after the code inspection...

HT> best regards
HT> Tomasz


HT> _______________________________________________
HT> Eap-list mailing list
HT> [EMAIL PROTECTED]
HT> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to