[sip-comm-dev] Null pointer dereference


#1

Hello!
I just downloaded the source for SIP Communicator, browsed it a little and
noticed quite an amount of bugs/mistakes (for example FindBugs plugin in
Eclipse reports 865 bugs, and while some of them may not be real it is still
a big number!). Just to see how you respond to such messages and if maybe
you have a lot of the things I noticed corrected in some newer version, I
report just one for now.

package: net.java.sip.communicator.impl.contactlist
method: stop(BundleContext bc)
line: 228

whole context with line 228 marked with ***

            if(opSetPersPresence != null)
            {
                opSetPersPresence
                    .removeSubscriptionListener(clSubscriptionEventHandler);
                opSetPersPresence

.removeServerStoredGroupChangeListener(clGroupEventHandler);
            }
            else
            {
                //check if a non persistent presence operation set exists.
                OperationSetPresence opSetPresence =
(OperationSetPresence)pp
                        .getOperationSet(OperationSetPresence.class);

                if(opSetPresence != null)
                {
*** opSetPersPresence .removeSubscriptionListener(
                        clSubscriptionEventHandler);
                }
            }
        }

Clearly opSetPersPresence needs to be substituted by opSetPresence.

Should I report such observations via your bug tracker?

Best regards!
Marcin


#2

Hello Marcin,

Thank you for reporting.

I've been reducing the number of warnings in Eclipse and FindBugs for
some time now and I'm still doing it but since they're in the
thousands, you'd understand why the fixing isn't my primary focus.
Since I started reducing them, the warnings in Eclipse came down from
~7000 to ~4700 and the FindBugs warnings fell from ~1300 to 998. Most
of the warnings aren't extremely important but I'm fixing them because
it's like looking for a needing in a haystack when the total number is
so high.

You're welcome to report important problems and I'm sure the SIP
Communicator community will also welcome your patches.

Regards,
Lubo

···

On Mon, Mar 16, 2009 at 10:31 PM, Marcin <middle.curse@gmail.com> wrote:

Hello!
I just downloaded the source for SIP Communicator, browsed it a little and
noticed quite an amount of bugs/mistakes (for example FindBugs plugin in
Eclipse reports 865 bugs, and while some of them may not be real it is still
a big number!). Just to see how you respond to such messages and if maybe
you have a lot of the things I noticed corrected in some newer version, I
report just one for now.
package: net.java.sip.communicator.impl.contactlist
method: stop(BundleContext bc)
line: 228
whole context with line 228 marked with ***
if(opSetPersPresence != null)
{
opSetPersPresence
.removeSubscriptionListener(clSubscriptionEventHandler);
opSetPersPresence

.removeServerStoredGroupChangeListener(clGroupEventHandler);
}
else
{
//check if a non persistent presence operation set exists.
OperationSetPresence opSetPresence =
(OperationSetPresence)pp
.getOperationSet(OperationSetPresence.class);
if(opSetPresence != null)
{
*** opSetPersPresence .removeSubscriptionListener(
clSubscriptionEventHandler);
}
}
}
Clearly opSetPersPresence needs to be substituted by opSetPresence.
Should I report such observations via your bug tracker?
Best regards!
Marcin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Guys,

Before my previous e-mail comes the wrong way, I'd like to politely
invite everyone to join the warning-squashing effort.

Eclipse users will see a lot of them in the Problems view and in the
editors marked in yellow. While most of the default ones will be about
raw-type uses, parties not interested in resolving them may want to
switch them off in Window > Preferences > Java > Compiler >
Errors/Warnings under Generic types.

As Marcin mentioned, FindBugs (http://findbugs.sourceforge.net/) is
another way of unlocking more warnings. It can be run either outside
Eclipse or inside it. Refer to the Downloads section for the available
options and the download locations.

And if these aren't enough, Lint4j (http://www.jutils.com/) can add
some more. I've personally used it only as an Eclipse plug-in
(http://www.jutils.com/eclipse/index.html) and I just turn its builder
to analyze the code as modifications are made.

Thank you,
Lubo

···

On Mon, Mar 16, 2009 at 10:53 PM, Lubomir Marinov <lubomir.marinov@gmail.com> wrote:

Hello Marcin,

Thank you for reporting.

I've been reducing the number of warnings in Eclipse and FindBugs for
some time now and I'm still doing it but since they're in the
thousands, you'd understand why the fixing isn't my primary focus.
Since I started reducing them, the warnings in Eclipse came down from
~7000 to ~4700 and the FindBugs warnings fell from ~1300 to 998. Most
of the warnings aren't extremely important but I'm fixing them because
it's like looking for a needing in a haystack when the total number is
so high.

You're welcome to report important problems and I'm sure the SIP
Communicator community will also welcome your patches.

Regards,
Lubo

On Mon, Mar 16, 2009 at 10:31 PM, Marcin <middle.curse@gmail.com> wrote:

Hello!
I just downloaded the source for SIP Communicator, browsed it a little and
noticed quite an amount of bugs/mistakes (for example FindBugs plugin in
Eclipse reports 865 bugs, and while some of them may not be real it is still
a big number!). Just to see how you respond to such messages and if maybe
you have a lot of the things I noticed corrected in some newer version, I
report just one for now.
package: net.java.sip.communicator.impl.contactlist
method: stop(BundleContext bc)
line: 228
whole context with line 228 marked with ***
if(opSetPersPresence != null)
{
opSetPersPresence
.removeSubscriptionListener(clSubscriptionEventHandler);
opSetPersPresence

.removeServerStoredGroupChangeListener(clGroupEventHandler);
}
else
{
//check if a non persistent presence operation set exists.
OperationSetPresence opSetPresence =
(OperationSetPresence)pp
.getOperationSet(OperationSetPresence.class);
if(opSetPresence != null)
{
*** opSetPersPresence .removeSubscriptionListener(
clSubscriptionEventHandler);
}
}
}
Clearly opSetPersPresence needs to be substituted by opSetPresence.
Should I report such observations via your bug tracker?
Best regards!
Marcin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

And if the use of proprietary software isn't an obstacle for you,
IntelliJ IDEA seems to me to discover a lot of additional warnings.

···

On Tue, Mar 17, 2009 at 1:21 AM, Lubomir Marinov <lubomir.marinov@gmail.com> wrote:

Guys,

Before my previous e-mail comes the wrong way, I'd like to politely
invite everyone to join the warning-squashing effort.

Eclipse users will see a lot of them in the Problems view and in the
editors marked in yellow. While most of the default ones will be about
raw-type uses, parties not interested in resolving them may want to
switch them off in Window > Preferences > Java > Compiler >
Errors/Warnings under Generic types.

As Marcin mentioned, FindBugs (http://findbugs.sourceforge.net/) is
another way of unlocking more warnings. It can be run either outside
Eclipse or inside it. Refer to the Downloads section for the available
options and the download locations.

And if these aren't enough, Lint4j (http://www.jutils.com/) can add
some more. I've personally used it only as an Eclipse plug-in
(http://www.jutils.com/eclipse/index.html) and I just turn its builder
to analyze the code as modifications are made.

Thank you,
Lubo

On Mon, Mar 16, 2009 at 10:53 PM, Lubomir Marinov > <lubomir.marinov@gmail.com> wrote:

Hello Marcin,

Thank you for reporting.

I've been reducing the number of warnings in Eclipse and FindBugs for
some time now and I'm still doing it but since they're in the
thousands, you'd understand why the fixing isn't my primary focus.
Since I started reducing them, the warnings in Eclipse came down from
~7000 to ~4700 and the FindBugs warnings fell from ~1300 to 998. Most
of the warnings aren't extremely important but I'm fixing them because
it's like looking for a needing in a haystack when the total number is
so high.

You're welcome to report important problems and I'm sure the SIP
Communicator community will also welcome your patches.

Regards,
Lubo

On Mon, Mar 16, 2009 at 10:31 PM, Marcin <middle.curse@gmail.com> wrote:

Hello!
I just downloaded the source for SIP Communicator, browsed it a little and
noticed quite an amount of bugs/mistakes (for example FindBugs plugin in
Eclipse reports 865 bugs, and while some of them may not be real it is still
a big number!). Just to see how you respond to such messages and if maybe
you have a lot of the things I noticed corrected in some newer version, I
report just one for now.
package: net.java.sip.communicator.impl.contactlist
method: stop(BundleContext bc)
line: 228
whole context with line 228 marked with ***
if(opSetPersPresence != null)
{
opSetPersPresence
.removeSubscriptionListener(clSubscriptionEventHandler);
opSetPersPresence

.removeServerStoredGroupChangeListener(clGroupEventHandler);
}
else
{
//check if a non persistent presence operation set exists.
OperationSetPresence opSetPresence =
(OperationSetPresence)pp
.getOperationSet(OperationSetPresence.class);
if(opSetPresence != null)
{
*** opSetPersPresence .removeSubscriptionListener(
clSubscriptionEventHandler);
}
}
}
Clearly opSetPersPresence needs to be substituted by opSetPresence.
Should I report such observations via your bug tracker?
Best regards!
Marcin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net