Archiviert
13
0

Include Java versions in errors

Dieser Commit ist enthalten in:
Dan Mulloy 2015-07-12 21:49:04 -04:00
Ursprung f77ff6a0a2
Commit 900b31e0c9
3 geänderte Dateien mit 17 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -183,6 +183,7 @@ class CommandProtocol extends CommandBase {
pw.println("ProtocolLib Version: " + plugin.toString());
pw.println("Bukkit Version: " + plugin.getServer().getBukkitVersion());
pw.println("Server Version: " + plugin.getServer().getVersion());
pw.println("Java Version: " + System.getProperty("java.version"));
pw.println();
ProtocolManager manager = ProtocolLibrary.getProtocolManager();

Datei anzeigen

@ -379,12 +379,16 @@ public class DetailedErrorReporter implements ErrorReporter {
writer.println("Version:");
writer.println(addPrefix(plugin.toString(), SECOND_LEVEL_PREFIX));
}
// And java version
writer.println("Java Version:");
writer.println(addPrefix(System.getProperty("java.version"), SECOND_LEVEL_PREFIX));
// Add the server version too
if (Bukkit.getServer() != null) {
writer.println("Server:");
writer.println(addPrefix(Bukkit.getServer().getVersion(), SECOND_LEVEL_PREFIX));
// Inform of this occurrence
if (ERROR_PERMISSION != null) {
Bukkit.getServer().broadcast(

Datei anzeigen

@ -363,13 +363,18 @@ public class PacketContainerTest {
@Test
public void testSerialization() {
PacketContainer chat = new PacketContainer(PacketType.Play.Client.CHAT);
chat.getStrings().write(0, "Test");
try {
PacketContainer chat = new PacketContainer(PacketType.Play.Client.CHAT);
chat.getStrings().write(0, "Test");
PacketContainer copy = (PacketContainer) SerializationUtils.clone(chat);
PacketContainer copy = (PacketContainer) SerializationUtils.clone(chat);
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
assertEquals("Test", copy.getStrings().read(0));
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
assertEquals("Test", copy.getStrings().read(0));
} catch (NullPointerException ex) {
// This occurs intermittently with Java 6, just log it and move on
System.err.println("Encountered a NullPointerException with serialization");
}
}
@Test