raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Broken ListenerAdapter #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Extending to the ListenerAdapter class
2.
3.

What is the expected output? What do you see instead?
Expected to be able to catch events like stated in example codes

Got error: ListenerAdapter is a raw type. References to generic type 
ListenerAdapter<T> should be parameterized. Even following the example source 
doesn't work.

What version of the product are you using? On what operating system?
Latest version on Eclipse IDE; Win7 32-bit Ultimate

Please provide any additional information below.
The available fixes from eclipse don't work, which is adding arguments to 
ListenerAdapter class so: public class MyBot extends ListenerAdapter<object>

Original issue reported on code.google.com by arvnd...@gmail.com on 27 Aug 2011 at 1:36

GoogleCodeExporter commented 9 years ago
Are you turning warnings into errors? That should be a warning, not an error. 
Note that an error like that is a warning on Sun Java, I've never used Eclipse

Original comment by Lord.Qua...@gmail.com on 27 Aug 2011 at 6:29

GoogleCodeExporter commented 9 years ago
No I'm not turning them into errors, I get the warnings and ignore them but 
when I run it the bot connects and things but the listener doesn't pick up on 
whatever the event is.  I've tried using just the examples in the HowTo 
documents and they run, but again it doesn't pick up on the onEvent method.

Original comment by arvnd...@gmail.com on 27 Aug 2011 at 1:15

GoogleCodeExporter commented 9 years ago
Here are some links to screen shots of what I'm actually talking about:

http://img37.imageshack.us/img37/9907/ss2tc.png
http://img854.imageshack.us/img854/2985/unledsal.png
http://img851.imageshack.us/img851/4135/ss3q.png

In the last one I say hi and the bot doesn't respond with "Hello World" like 
its supposed to.

Original comment by arvnd...@gmail.com on 27 Aug 2011 at 1:54

GoogleCodeExporter commented 9 years ago
Hmm, I'll download eclipse and see if I can reproduce the problem. I know the 
examples work in Sun Java since I tested all of them. Especially 
PircBotXExample, since I use that class all the time to test whatever feature 
I'm working on

Original comment by Lord.Qua...@gmail.com on 27 Aug 2011 at 5:01

GoogleCodeExporter commented 9 years ago
I did all of this testing with Eclipse and a test bot and everything until I 
looked at your code one last time. You just made an easy mistake: Not adding 
the Listener to the ListenerManager

You just need this line before you connect to the server
bot.getListenerManager().addListener(new HelloBot());

Now that PircBotX has your ListenerAdapter, it will execute it when a message 
comes in.

Side note: Going from Netbeans to Eclipse is a jarring experience

Original comment by Lord.Qua...@gmail.com on 27 Aug 2011 at 9:13