powered by Jive Software

Packet Reader Class

In Packet Reader the static fields of XmlPullParser should be accessed in a static way.

Instead of

“eventType == parser.END_TAG”

should be

eventType == XmlPullParser.END_TAG

Actually, I just follow the standard code format that the XMLPull documentation recommends. More info at:

http://www.xmlpull.org/v1/download/unpacked/doc/quick_intro.html

Regards,

Matt

The program I use to program, Eclipse (very,very good by IBM), as give me this warning about the way it access the fields.

By the way, I think its in the java code standarts that the correct way to access a static field is this way.

We use IntelliJ at Jive Software, which I’‘d also argue is a really good application, and no warnings from it. However, I’'ll consider changing the syntax when I get a chance. Thanks for your input!

Regards,

Matt

These “static fields…static way” errors appear in Eclipse 2.1 but not in 2.0.2 so being a Java newbie I did some checking…

Apparently accessing static fields/methods via the class name instead of the class object is the “preferred” method as it’'s more clear to someone looking at the code that the field/method is static but does not affect the actual code operation at all.

Matt: Eclipse roolz!

You are right. It not affect the code, but it’'s more “correct” via the class name. Turns the code more easy to read.

Hi Matt,

you mention you are using IntelliJ. I’'ve been tossing up whether to use WSAD5 or Idea 3.0 of late and wonder whether you can give me some information.

One thing I note is that the arrangement of the source folders/resources etc needs to change significantly to be used within WSAD. Is the existing layout in the source zip as you use it from Idea?

What are you normally using to deploy to and debug? I only really had the latest version of Tomcat around and the Idea integration hasn’'t caught up with 4.1 yet…

Any info regarding debug settings from within Idea would be wonderful…

Thanks,

Greg

Greg,

I love Intellij and think everyone else should use it too. Still, I haven’‘t actually used WSAD so I can’'t give an accurate comparison.

A great thing about Intellij is that you can use a normal directory of source file for your projects (as I do with Smack). The app-server I usually use for testing is Resin, but Tomcat should be fine too. The usual thing I do is run an Ant deploy script from inside IntelliJ that deploys the latest version of the app. I then cycle Resin (takes a few seconds) and reload the web page. I know some people have hacked their setups a bit more to make testing even faster.

In terms of debugging – I very rarely use a debugger so can’'t offer much help there. System.out.println is my friend.

Regards,

Matt

Hi Matt,

both in WSAD and in Idea 3 I’'m having problems finding

com.jivesoftware.forum.stats.*,

com.jivesoftware.base.stats.util.*,

where the stats package cannot be found.

(ReportManager is the offending class)

where should i be expecting these to be please?

Thanks,

Greg

Hmm. We try to keep the Smack libraries in the org.jivesoftware package namespace. So anything pointing into the com.jivesoftware namespace is a mistake. What class are you getting the reference to those classes?

-iain

Greg,

I’‘m betting that this is a Jive Forums question and not a Smack one? Make sure you are compiling with all JAR’'s we include in your classpath. Another option is to use the Ant scripts we include.

Regards,

Matt

Yes Matt,

you are correct and managed to beat me to mentioning this myself.

I did a global search to find this topic and then was not looking at which forum I was posting in.

I’'ll take this and move it to Jive Forums.

Thanks,

Greg