raisedragon / pircbotx

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

Update UserChannelDao Javadocs #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Error:

[2015/01/03 21:31:10] [ForkJoinPool-1-worker-11] [INFO] 
org.pircbotx.output.OutputRaw - NOTICE JZTech101 :Failed to execute command, 
please make sure you are$
org.pircbotx.exception.DaoException: UnknownChannel: tacocat
        at org.pircbotx.UserChannelDao.getChannel(UserChannelDao.java:275)
        at com.techcavern.wavetact.utils.IRCUtils.getChannelbyName(IRCUtils.java:237)
        at com.techcavern.wavetact.ircCommands.anonymonity.Say.onCommand(Say.java:38)
        at com.techcavern.wavetact.eventListeners.ChanMsgListener$1process.run(ChanMsgListener.java:35)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:902)
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1689)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1644)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

event.getBot().getUserChannelDao().getChannel(channelName); when channelName is 
a user in a channel.. it errors out o.o

Original issue reported on code.google.com by jzhou2...@gmail.com on 3 Jan 2015 at 9:37

GoogleCodeExporter commented 9 years ago
What are the log lines before this?

Original comment by Lord.Qua...@gmail.com on 4 Jan 2015 at 1:53

GoogleCodeExporter commented 9 years ago
The line before it is a command being executed.  If you're requesting a full 
reproducible log,  I'll have to provide it tomorrow. The command being run is 
&say tacocat smells.  tacocat  being a user in the channel I was executing the 
command.  The bots source is on github.  http//github.com/TechCavern/WaveTact

Original comment by jzhou2...@gmail.com on 4 Jan 2015 at 2:31

GoogleCodeExporter commented 9 years ago
https://gist.github.com/jztech101/cc721d4a091b45adbb4e Full log

Original comment by jzhou2...@gmail.com on 4 Jan 2015 at 5:09

GoogleCodeExporter commented 9 years ago
I knew ReplayServer would come in handy someday!

I converted your log into the ReplayServer format and guessed your 
implementation. Both files are attached. I can't seem to reproduce it though, 
the MessageEvent channel is correct, the WhoisEvent channels are correct, and 
the bot responds to everything correctly. 

Are you sure your getting the right value?

Original comment by Lord.Qua...@gmail.com on 5 Jan 2015 at 8:28

Attachments:

GoogleCodeExporter commented 9 years ago
I'm afraid I'm failing to see where you are using getUserChannelDao. 
getChannel().  Perhaps I have worded the issue incorrectly. I am try to get the 
channel if there is one as the first parameter. However if I enter a user as 
the first parameter it throws then forementioned error instead of returning null

Original comment by jzhou2...@gmail.com on 5 Jan 2015 at 12:30

GoogleCodeExporter commented 9 years ago
Ohhhh.... sorry the way you worded it sounded like PircBotX was returning a 
user as a channel

getChannel and getUser will now throw an exception instead of returning null 
and causing unexpected and difficult to debug NPEs. This also keeps the 
original contract where they never returned nulls.

This was already documented in the changelog, although the UserChannelDao 
methods barely have any javadoc. 

Original comment by Lord.Qua...@gmail.com on 5 Jan 2015 at 4:02

GoogleCodeExporter commented 9 years ago
Fixed in  Revision 0fb15122183b

Original comment by Lord.Qua...@gmail.com on 12 Jan 2015 at 4:13