zD12 / pircbotx

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

buildForServer doesn't work as expected #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The following code:
Configuration.Builder builder = new Configuration.Builder();
builder
    .setAutoNickChange(true)
    .setAutoReconnect(true)
    .setCapEnabled(false)
    .setIdentServerEnabled(false)
    .setShutdownHookEnabled(true)
    .setRealName("TestBot")
    .setName("TestBot")
    .setLogin("TestBot")
    .setVersion("TestBot 1.0");
PircBotX bot = new PircBotX(builder.buildForServer("chat.freenode.net", 6667));

Throws an exception in the last line:
Exception in thread "main" java.lang.IllegalArgumentException: Must specify 
server hostname
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
    at org.pircbotx.Configuration.<init>(Configuration.java:135)
    at org.pircbotx.Configuration$Builder.buildConfiguration(Configuration.java:589)
    at org.pircbotx.Configuration$Builder.buildForServer(Configuration.java:611)
    at Main.main(Main.java:84)

What is the expected output?
That I don't need to use builder.setServer to set the server.

What version of the product are you using? On what operating system?
pircbotx 2.0.1

Original issue reported on code.google.com by FH3...@gmail.com on 7 Feb 2014 at 11:05

GoogleCodeExporter commented 9 years ago
I accidentally used the wrong fields in those methods. Fixed in Revision 
08c215492bc8

Original comment by Lord.Qua...@gmail.com on 9 Feb 2014 at 6:07