diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/IPSubnet.java index 053575dada..3c3be74cd6 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/IPSubnet.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/IPSubnet.java @@ -99,7 +99,7 @@ public class IPSubnet int size = 0; for (byte element : _mask) { - size += Integer.bitCount((element & 0xFF)); + size += Integer.bitCount(element & 0xFF); } try diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/StringUtil.java index d39f3b6f86..5dda5f8b29 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/StringUtil.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/commons/util/StringUtil.java @@ -147,38 +147,38 @@ import org.l2jmobius.Config; * *
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/Util.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/CommonUtil.java
similarity index 64%
rename from L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/Util.java
rename to L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/CommonUtil.java
index 21d42a0e3e..21dfc30786 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/Util.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/CommonUtil.java
@@ -18,111 +18,39 @@ package org.l2jmobius.commons.util;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.util.logging.Logger;
 
 /**
  * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  * @author luisantonioa
  */
-public class Util
+public class CommonUtil
 {
-	protected static final Logger LOGGER = Logger.getLogger(Util.class.getName());
-	
 	public static boolean isInternalIP(String ipAddress)
 	{
 		return ipAddress.startsWith("192.168.") || ipAddress.startsWith("10.") || ipAddress.startsWith("127.0.0.1");
 	}
 	
+	/**
+	 * Method to generate the hexadecimal representation of a byte array.
+ * 16 bytes per row, while ascii chars or "." is shown at the end of the line. + * @param data the byte array to be represented in hexadecimal representation + * @param len the number of bytes to represent in hexadecimal representation + * @return byte array represented in hexadecimal format + */ public static String printData(byte[] data, int len) { - final StringBuilder result = new StringBuilder(); - int counter = 0; - for (int i = 0; i < len; i++) - { - if ((counter % 16) == 0) - { - result.append(fillHex(i, 4) + ": "); - } - - result.append(fillHex(data[i] & 0xff, 2) + " "); - counter++; - if (counter == 16) - { - result.append(" "); - int charpoint = i - 15; - for (int a = 0; a < 16; a++) - { - final int t1 = data[charpoint++]; - if ((t1 > 0x1f) && (t1 < 0x80)) - { - result.append((char) t1); - } - else - { - result.append('.'); - } - } - - result.append('\n'); - counter = 0; - } - } - - final int rest = data.length % 16; - if (rest > 0) - { - for (int i = 0; i < (17 - rest); i++) - { - result.append(" "); - } - - int charpoint = data.length - rest; - for (int a = 0; a < rest; a++) - { - final int t1 = data[charpoint++]; - if ((t1 > 0x1f) && (t1 < 0x80)) - { - result.append((char) t1); - } - else - { - result.append('.'); - } - } - - result.append('\n'); - } - - return result.toString(); - } - - public static String fillHex(int data, int digits) - { - String number = Integer.toHexString(data); - for (int i = number.length(); i < digits; i++) - { - number = "0" + number; - } - return number; - } - - public static void printSection(String section) - { - String s = "=[ " + section + " ]"; - while (s.length() < 61) - { - s = "-" + s; - } - LOGGER.info(s); + return new String(HexUtils.bArr2HexEdChars(data, len)); } /** - * @param raw - * @return + * This call is equivalent to Util.printData(data, data.length) + * @see CommonUtil#printData(byte[],int) + * @param data data to represent in hexadecimal + * @return byte array represented in hexadecimal format */ - public static String printData(byte[] raw) + public static String printData(byte[] data) { - return printData(raw, raw.length); + return printData(data, data.length); } /** @@ -135,18 +63,6 @@ public class Util return minutesToConvert * 60000; } - /** - * Method to get the stack trace of a Throwable into a String - * @param t Throwable to get the stacktrace from - * @return stack trace from Throwable as String - */ - public static String getStackTrace(Throwable t) - { - final StringWriter sw = new StringWriter(); - t.printStackTrace(new PrintWriter(sw)); - return sw.toString(); - } - /** * Method to generate a random sequence of bytes returned as byte array * @param size number of random bytes to generate @@ -168,6 +84,18 @@ public class Util return array; } + /** + * Method to get the stack trace of a Throwable into a String + * @param t Throwable to get the stacktrace from + * @return stack trace from Throwable as String + */ + public static String getStackTrace(Throwable t) + { + final StringWriter sw = new StringWriter(); + t.printStackTrace(new PrintWriter(sw)); + return sw.toString(); + } + /** * @param * @param array - the array to look into diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/HexUtils.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/HexUtils.java new file mode 100644 index 0000000000..4567492fe7 --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/HexUtils.java @@ -0,0 +1,269 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.l2jmobius.commons.util; + +import java.util.Arrays; + +/** + * @author HorridoJoho + */ +public class HexUtils +{ + // lookup table for hex characters + private static final char[] _NIBBLE_CHAR_LOOKUP = + { + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F' + }; + private static final char[] _NEW_LINE_CHARS = System.getProperty("line.separator").toCharArray(); + + /** + * Method to generate the hexadecimal character presentation of a byte
+ * This call is equivalent to {@link HexUtils#b2HexChars(byte, char[], int)} with parameters (data, null, 0) + * @param data byte to generate the hexadecimal character presentation from + * @return a new char array with exactly 2 elements + */ + public static char[] b2HexChars(byte data) + { + return b2HexChars(data, null, 0); + } + + /** + * Method to generate the hexadecimal character presentation of a byte + * @param data byte to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with 2 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] b2HexChars(byte data, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[2]; + dstOffset = 0; + } + + // ///////////////////////////// + // NIBBLE LOOKUP + dstHexChars[dstOffset] = _NIBBLE_CHAR_LOOKUP[(data & 0xF0) >> 4]; + dstHexChars[dstOffset + 1] = _NIBBLE_CHAR_LOOKUP[data & 0x0F]; + + return dstHexChars; + } + + /** + * Method to generate the hexadecimal character presentation of an integer This call is equivalent to {@link HexUtils#int2HexChars(int, char[], int)} with parameters (data, null, 0) + * @param data integer to generate the hexadecimal character presentation from + * @return new char array with 8 elements + */ + public static char[] int2HexChars(int data) + { + return int2HexChars(data, new char[8], 0); + } + + /** + * Method to generate the hexadecimal character presentation of an integer + * @param data integer to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with 8 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] int2HexChars(int data, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[8]; + dstOffset = 0; + } + + b2HexChars((byte) ((data & 0xFF000000) >> 24), dstHexChars, dstOffset); + b2HexChars((byte) ((data & 0x00FF0000) >> 16), dstHexChars, dstOffset + 2); + b2HexChars((byte) ((data & 0x0000FF00) >> 8), dstHexChars, dstOffset + 4); + b2HexChars((byte) (data & 0x000000FF), dstHexChars, dstOffset + 6); + + return dstHexChars; + } + + /** + * Method to generate the hexadecimal character presentation of a byte array
+ * This call is equivalent to {@link HexUtils#bArr2HexChars(byte[], int, int, char[], int)} with parameters (data, offset, len, null, 0) + * @param data byte array to generate the hexadecimal character presentation from + * @param offset offset where to start in data array + * @param len number of bytes to generate the hexadecimal character presentation from + * @return a new char array with len*2 elements + */ + public static char[] bArr2HexChars(byte[] data, int offset, int len) + { + return bArr2HexChars(data, offset, len, null, 0); + } + + /** + * Method to generate the hexadecimal character presentation of a byte array + * @param data byte array to generate the hexadecimal character presentation from + * @param offset offset where to start in data array + * @param len number of bytes to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with len*2 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] bArr2HexChars(byte[] data, int offset, int len, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[len * 2]; + dstOffset = 0; + } + + for (int dataIdx = offset, charsIdx = dstOffset; dataIdx < (len + offset); ++dataIdx, ++charsIdx) + { + // ///////////////////////////// + // NIBBLE LOOKUP, we duplicate the code from b2HexChars here, we want to save a few cycles(for charsIdx increment) + dstHexChars[charsIdx] = _NIBBLE_CHAR_LOOKUP[(data[dataIdx] & 0xF0) >> 4]; + dstHexChars[++charsIdx] = _NIBBLE_CHAR_LOOKUP[data[dataIdx] & 0x0F]; + } + + return dstHexChars; + } + + public static char[] bArr2AsciiChars(byte[] data, int offset, int len) + { + return bArr2AsciiChars(data, offset, len, new char[len], 0); + } + + public static char[] bArr2AsciiChars(byte[] data, int offset, int len, char[] dstAsciiCharsValue, int dstOffsetValue) + { + char[] dstAsciiChars = dstAsciiCharsValue; + int dstOffset = dstOffsetValue; + if (dstAsciiChars == null) + { + dstAsciiChars = new char[len]; + dstOffset = 0; + } + + for (int dataIdx = offset, charsIdx = dstOffset; dataIdx < (len + offset); ++dataIdx, ++charsIdx) + { + if ((data[dataIdx] > 0x1f) && (data[dataIdx] < 0x80)) + { + dstAsciiChars[charsIdx] = (char) data[dataIdx]; + } + else + { + dstAsciiChars[charsIdx] = '.'; + } + } + + return dstAsciiChars; + } + + private static final int HEX_ED_BPL = 16; + private static final int HEX_ED_CPB = 2; + + /** + * Method to generate the hexadecimal character representation of a byte array like in a hex editor
+ * Line Format: {OFFSET} {HEXADECIMAL} {ASCII}({NEWLINE})
+ * {OFFSET} = offset of the first byte in line(8 chars)
+ * {HEXADECIMAL} = hexadecimal character representation({@link #HEX_ED_BPL}*2 chars)
+ * {ASCII} = ascii character presentation({@link #HEX_ED_BPL} chars) + * @param data byte array to generate the hexadecimal character representation + * @param len the number of bytes to generate the hexadecimal character representation from + * @return byte array which contains the hexadecimal character representation of the given byte array + */ + public static char[] bArr2HexEdChars(byte[] data, int len) + { + // {OFFSET} {HEXADECIMAL} {ASCII}{NEWLINE} + final int lineLength = 9 + (HEX_ED_BPL * HEX_ED_CPB) + 1 + HEX_ED_BPL + _NEW_LINE_CHARS.length; + final int lenBplMod = len % HEX_ED_BPL; + // create text buffer + // 1. don't allocate a full last line if not _HEX_ED_BPL bytes are shown in last line + // 2. no new line at end of buffer + // BUG: when the length is multiple of _HEX_ED_BPL we erase the whole ascii space with this + // char[] textData = new char[lineLength * numLines - (_HEX_ED_BPL - (len % _HEX_ED_BPL)) - _NEW_LINE_CHARS.length]; + // FIXED HERE + int numLines; + char[] textData; + if (lenBplMod == 0) + { + numLines = len / HEX_ED_BPL; + textData = new char[(lineLength * numLines) - _NEW_LINE_CHARS.length]; + } + else + { + numLines = (len / HEX_ED_BPL) + 1; + textData = new char[(lineLength * numLines) - (HEX_ED_BPL - (lenBplMod)) - _NEW_LINE_CHARS.length]; + } + + // performance penalty, only doing space filling in the loop is faster + // Arrays.fill(textData, ' '); + + int dataOffset; + int dataLen; + int lineStart; + int lineHexDataStart; + int lineAsciiDataStart; + for (int i = 0; i < numLines; ++i) + { + dataOffset = i * HEX_ED_BPL; + dataLen = Math.min(len - dataOffset, HEX_ED_BPL); + lineStart = i * lineLength; + lineHexDataStart = lineStart + 9; + lineAsciiDataStart = lineHexDataStart + (HEX_ED_BPL * HEX_ED_CPB) + 1; + + int2HexChars(dataOffset, textData, lineStart); // the offset of this line + textData[lineHexDataStart - 1] = ' '; // separate + bArr2HexChars(data, dataOffset, dataLen, textData, lineHexDataStart); // the data in hex + bArr2AsciiChars(data, dataOffset, dataLen, textData, lineAsciiDataStart); // the data in ascii + + if (i < (numLines - 1)) + { + textData[lineAsciiDataStart - 1] = ' '; // separate + System.arraycopy(_NEW_LINE_CHARS, 0, textData, lineAsciiDataStart + HEX_ED_BPL, _NEW_LINE_CHARS.length); // the new line + } + else if (dataLen < HEX_ED_BPL) + { + // last line which shows less than _HEX_ED_BPL bytes + final int lineHexDataEnd = lineHexDataStart + (dataLen * HEX_ED_CPB); + Arrays.fill(textData, lineHexDataEnd, lineHexDataEnd + ((HEX_ED_BPL - dataLen) * HEX_ED_CPB) + 1, ' '); // spaces, for the last line if there are not _HEX_ED_BPL bytes + } + else + { + // last line which shows _HEX_ED_BPL bytes + textData[lineAsciiDataStart - 1] = ' '; // separate + } + } + return textData; + } +} diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/IPSubnet.java index 9bf90c8d8b..3c3be74cd6 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/IPSubnet.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/IPSubnet.java @@ -64,26 +64,29 @@ public class IPSubnet } } } - // check for embedded v4 in v6 addr (not done !) - else if (_isIPv4) - { - // my V4 vs V6 - for (int i = 0; i < _addr.length; i++) - { - if ((addr[i + 12] & _mask[i]) != _addr[i]) - { - return false; - } - } - } else { - // my V6 vs V4 - for (int i = 0; i < _addr.length; i++) + // check for embedded v4 in v6 addr (not done !) + if (_isIPv4) { - if ((addr[i] & _mask[i + 12]) != _addr[i + 12]) + // my V4 vs V6 + for (int i = 0; i < _addr.length; i++) { - return false; + if ((addr[i + 12] & _mask[i]) != _addr[i]) + { + return false; + } + } + } + else + { + // my V6 vs V4 + for (int i = 0; i < _addr.length; i++) + { + if ((addr[i] & _mask[i + 12]) != _addr[i + 12]) + { + return false; + } } } } @@ -120,7 +123,11 @@ public class IPSubnet { return applyMask(((IPSubnet) o).getAddress()); } - return (o instanceof InetAddress) && applyMask(((InetAddress) o).getAddress()); + else if (o instanceof InetAddress) + { + return applyMask(((InetAddress) o).getAddress()); + } + return false; } private static byte[] getMask(int n, int maxLength) throws UnknownHostException diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/StringUtil.java index 4cd4ff2b32..906227b1f8 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/StringUtil.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/commons/util/StringUtil.java @@ -25,10 +25,14 @@ import java.util.Locale; import org.l2jmobius.Config; /** - * String utilities optimized for the best performance. + * String utilities optimized for the best performance.
*

How to Use It

- *

concat() or append()

If concatenating strings in single call, use StringUtil.concat(), otherwise use StringUtil.append() and its variants. - *

Minimum Calls

Bad: + *

concat() or append()

If concatenating strings
+ * in single call, use StringUtil.concat(), otherwise use StringUtil.append()
+ * and its variants.
+ *
+ *

Minimum Calls


+ * Bad: * *
  * final StringBuilder sbString = new StringBuilder();
@@ -44,8 +48,12 @@ import org.l2jmobius.Config;
  * 
* * Why?
- * Because the less calls you do, the less memory re-allocations have to be done so the whole text fits into the memory and less array copy tasks has to be performed. So if using less calls, less memory is used and string concatenation is faster. - *

Size Hints for Loops

Bad: + * Because the less calls you do, the less memory re-allocations have to be done
+ * so the whole text fits into the memory and less array copy tasks has to be
+ * performed. So if using less calls, less memory is used and string concatenation is faster.
+ *
+ *

Size Hints for Loops


+ * Bad: * *
  * final StringBuilder sbString = new StringBuilder();
@@ -71,8 +79,10 @@ import org.l2jmobius.Config;
  * because new memory has not to be allocated on each cycle. Also it is much faster if no string copy tasks has to be performed. So if concatenating strings in a loop, count approximately the size and set it as the hint for the string builder size. It's better to make the size hint little bit larger
  * rather than smaller.
* In case there is no text appended before the cycle, just use new - * StringBuilder(1300). - *

Concatenation and Constants

Bad: + * StringBuilder(1300).
+ *
+ *

Concatenation and Constants


+ * Bad: * *
  * StringUtil.concat("text 1 ", "text 2", String.valueOf(npcId));
@@ -91,7 +101,7 @@ import org.l2jmobius.Config;
  * 
* * Why?
- * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed. + * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed.
*

Concatenation and Constant Variables

Bad: * *
@@ -108,8 +118,10 @@ import org.l2jmobius.Config;
  * 
  * Why? Because when using final keyword, the glue is marked as constant string and compiler treats it as a constant string so it is able to create string "text1some gluetext2some glue" during the compilation. But this only works in case the value is known at compilation
  * time, so this cannot be used for cases like final String objectIdString =
- * String.valueOf(getObjectId).
- * 

StringBuilder Reuse

Bad: + * String.valueOf(getObjectId).
+ *
+ *

StringBuilder Reuse


+ * Bad: * *
  * final StringBuilder sbString1 = new StringBuilder();
@@ -132,10 +144,12 @@ import org.l2jmobius.Config;
  * Why?
* In first case, new memory has to be allocated for the second string. In second case already allocated memory is reused, but only in case the new string is not longer than the previously allocated string. Anyway, the second way is better because the string either fits in the memory and some memory * is saved, or it does not fit in the memory, and in that case it works as in the first case. - *

Primitives to Strings

To convert primitives to string, use String.valueOf(). - *

How much faster is it?

Here are some results of my tests. Count is number of strings concatenated. Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder - * with predefined size is the fastest (and also most memory efficient) solution. It is about 5 times faster when concatenating 7 strings, compared to StringBuilder. Also, with more strings concatenated, the difference between StringBuilder and StringBuilder gets larger. In code, there are many - * cases, where there are concatenated 50+ strings so the time saving is even greater. + *

Primitives to Strings

To convert primitives to string, use String.valueOf().
+ *
+ *

How much faster is it?


+ * Here are some results of my tests. Count is number of strings concatenated. Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder with predefined size is the + * fastest (and also most memory efficient) solution. It is about 5 times faster when concatenating 7 strings, compared to TextBuilder. Also, with more strings concatenated, the difference between StringBuilder and TextBuilder gets larger. In code, there are many cases, where there are concatenated + * 50+ strings so the time saving is even greater.
* *
  * Count: 2
@@ -188,7 +202,6 @@ public class StringUtil
 	 * Concatenates strings.
 	 * @param strings strings to be concatenated
 	 * @return concatenated string
-	 * @see StringUtil
 	 */
 	public static String concat(String... strings)
 	{
@@ -205,7 +218,6 @@ public class StringUtil
 	 * @param sizeHint hint for string builder size allocation
 	 * @param strings strings to be appended
 	 * @return created string builder
-	 * @see StringUtil
 	 */
 	public static StringBuilder startAppend(int sizeHint, String... strings)
 	{
@@ -222,7 +234,6 @@ public class StringUtil
 	 * Appends strings to existing string builder.
 	 * @param sbString string builder
 	 * @param strings strings to be appended
-	 * @see StringUtil
 	 */
 	public static void append(StringBuilder sbString, String... strings)
 	{
@@ -251,19 +262,12 @@ public class StringUtil
 	 * @param strings array of strings
 	 * @return total length of all the strings
 	 */
-	private static int getLength(String[] strings)
+	public static int getLength(String[] strings)
 	{
 		int length = 0;
 		for (String string : strings)
 		{
-			if (string == null)
-			{
-				length += 4;
-			}
-			else
-			{
-				length += string.length();
-			}
+			length += (string == null) ? 4 : string.length();
 		}
 		return length;
 	}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java
index 7ecf645a82..847f4c259e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java
@@ -33,7 +33,6 @@ import org.l2jmobius.commons.enums.ServerMode;
 import org.l2jmobius.commons.util.Chronos;
 import org.l2jmobius.commons.util.DeadLockDetector;
 import org.l2jmobius.commons.util.PropertiesParser;
-import org.l2jmobius.commons.util.Util;
 import org.l2jmobius.gameserver.cache.CrestCache;
 import org.l2jmobius.gameserver.cache.HtmCache;
 import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
@@ -170,13 +169,13 @@ public class GameServer
 		// Initialize config
 		Config.load(ServerMode.GAME);
 		
-		Util.printSection("Database");
+		printSection("Database");
 		DatabaseFactory.init();
 		
-		Util.printSection("ThreadPool");
+		printSection("ThreadPool");
 		ThreadPool.init();
 		
-		Util.printSection("IdManager");
+		printSection("IdManager");
 		IdManager.getInstance();
 		if (!IdManager.hasInitialized())
 		{
@@ -192,7 +191,7 @@ public class GameServer
 		CrestCache.getInstance();
 		ScriptEngineManager.getInstance();
 		
-		Util.printSection("World");
+		printSection("World");
 		World.getInstance();
 		MapRegionData.getInstance();
 		AnnouncementsTable.getInstance();
@@ -205,7 +204,7 @@ public class GameServer
 		CharNameTable.getInstance();
 		ExperienceData.getInstance();
 		
-		Util.printSection("Players");
+		printSection("Players");
 		PlayerTemplateData.getInstance();
 		if (Config.ENABLE_CLASS_DAMAGE_SETTINGS)
 		{
@@ -217,7 +216,7 @@ public class GameServer
 			ForumsBBSManager.getInstance().initRoot();
 		}
 		
-		Util.printSection("Skills");
+		printSection("Skills");
 		if (!SkillTable.getInstance().isInitialized())
 		{
 			LOGGER.info("Could not find the extraced files. Please Check Your Data.");
@@ -233,7 +232,7 @@ public class GameServer
 		}
 		LOGGER.info("Skills: All skills loaded.");
 		
-		Util.printSection("Items");
+		printSection("Items");
 		ItemTable.getInstance();
 		ArmorSetData.getInstance();
 		ExtractableItemData.getInstance();
@@ -244,7 +243,7 @@ public class GameServer
 			FishData.getInstance();
 		}
 		
-		Util.printSection("Npc");
+		printSection("Npc");
 		SchemeBufferTable.getInstance();
 		WalkerRouteData.getInstance();
 		if (!NpcTable.getInstance().isInitialized())
@@ -253,24 +252,24 @@ public class GameServer
 			throw new Exception("Could not initialize the npc table");
 		}
 		
-		Util.printSection("Geodata");
+		printSection("Geodata");
 		GeoEngine.getInstance();
 		
-		Util.printSection("Economy");
+		printSection("Economy");
 		TradeManager.getInstance();
 		MultisellData.getInstance();
 		
-		Util.printSection("Clan Halls");
+		printSection("Clan Halls");
 		ClanHallManager.getInstance();
 		FortressOfResistance.getInstance();
 		DevastatedCastle.getInstance();
 		BanditStrongholdSiege.getInstance();
 		AuctionManager.getInstance();
 		
-		Util.printSection("Zone");
+		printSection("Zone");
 		ZoneData.getInstance();
 		
-		Util.printSection("Spawnlist");
+		printSection("Spawnlist");
 		if (!Config.ALT_DEV_NO_SPAWNS)
 		{
 			SpawnTable.getInstance();
@@ -291,10 +290,10 @@ public class GameServer
 		}
 		DayNightSpawnManager.getInstance().notifyChangeMode();
 		
-		Util.printSection("Dimensional Rift");
+		printSection("Dimensional Rift");
 		DimensionalRiftManager.getInstance();
 		
-		Util.printSection("Misc");
+		printSection("Misc");
 		RecipeData.getInstance();
 		RecipeManager.getInstance();
 		EventDroplist.getInstance();
@@ -313,41 +312,41 @@ public class GameServer
 			ItemsAutoDestroyTaskManager.getInstance();
 		}
 		
-		Util.printSection("Manor");
+		printSection("Manor");
 		ManorSeedData.getInstance();
 		CastleManorManager.getInstance();
 		
-		Util.printSection("Castles");
+		printSection("Castles");
 		CastleManager.getInstance();
 		SiegeManager.getInstance();
 		FortManager.getInstance();
 		FortSiegeManager.getInstance();
 		CrownManager.getInstance();
 		
-		Util.printSection("Boat");
+		printSection("Boat");
 		BoatData.getInstance();
 		
-		Util.printSection("Doors");
+		printSection("Doors");
 		DoorData.getInstance().load();
 		FenceData.getInstance();
 		
-		Util.printSection("Four Sepulchers");
+		printSection("Four Sepulchers");
 		FourSepulchersManager.getInstance();
 		
-		Util.printSection("Seven Signs");
+		printSection("Seven Signs");
 		SevenSigns.getInstance();
 		SevenSignsFestival.getInstance();
 		AutoSpawnHandler.getInstance();
 		AutoChatHandler.getInstance();
 		
-		Util.printSection("Olympiad System");
+		printSection("Olympiad System");
 		Olympiad.getInstance();
 		Hero.getInstance();
 		
-		Util.printSection("Access Levels");
+		printSection("Access Levels");
 		AdminData.getInstance();
 		
-		Util.printSection("Handlers");
+		printSection("Handlers");
 		ItemHandler.getInstance();
 		SkillHandler.getInstance();
 		AdminCommandHandler.getInstance();
@@ -367,7 +366,7 @@ public class GameServer
 			CustomMailManager.getInstance();
 		}
 		
-		Util.printSection("Scripts");
+		printSection("Scripts");
 		if (!Config.ALT_DEV_NO_SCRIPT)
 		{
 			LOGGER.info("ScriptEngineManager: Loading server scripts:");
@@ -380,7 +379,7 @@ public class GameServer
 		}
 		
 		/* QUESTS */
-		Util.printSection("Quests");
+		printSection("Quests");
 		if (!Config.ALT_DEV_NO_QUESTS)
 		{
 			if (QuestManager.getInstance().getQuests().size() == 0)
@@ -397,7 +396,7 @@ public class GameServer
 			QuestManager.getInstance().unloadAllQuests();
 		}
 		
-		Util.printSection("Game Server");
+		printSection("Game Server");
 		
 		LOGGER.info("IdFactory: Free ObjectID's remaining: " + IdManager.size());
 		
@@ -411,7 +410,7 @@ public class GameServer
 			ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
 		}
 		
-		Util.printSection("EventManager");
+		printSection("EventManager");
 		EventManager.getInstance().startEventRegistration();
 		
 		if (EventManager.TVT_EVENT_ENABLED || EventManager.CTF_EVENT_ENABLED || EventManager.DM_EVENT_ENABLED)
@@ -439,7 +438,7 @@ public class GameServer
 			OfflineTraderTable.restoreOfflineTraders();
 		}
 		
-		Util.printSection("Protection");
+		printSection("Protection");
 		
 		if (Config.CHECK_SKILLS_ON_ENTER)
 		{
@@ -489,7 +488,7 @@ public class GameServer
 			deadDetectThread.start();
 		}
 		
-		Util.printSection("Status");
+		printSection("Status");
 		
 		if (Config.IS_TELNET_ENABLED)
 		{
@@ -515,6 +514,16 @@ public class GameServer
 		INSTANCE = new GameServer();
 	}
 	
+	private void printSection(String section)
+	{
+		String s = "=[ " + section + " ]";
+		while (s.length() < 61)
+		{
+			s = "-" + s;
+		}
+		LOGGER.info(s);
+	}
+	
 	public static GameServer getInstance()
 	{
 		return INSTANCE;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/items/Henna.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/items/Henna.java
index 2d8e416e27..f0ed6e422c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/items/Henna.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/items/Henna.java
@@ -16,7 +16,7 @@
  */
 package org.l2jmobius.gameserver.model.items;
 
-import org.l2jmobius.commons.util.Util;
+import org.l2jmobius.commons.util.CommonUtil;
 import org.l2jmobius.gameserver.model.StatSet;
 import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
 
@@ -108,6 +108,6 @@ public class Henna
 	 */
 	public boolean canBeUsedBy(PlayerInstance player)
 	{
-		return Util.contains(_classes, player.getClassId().getId());
+		return CommonUtil.contains(_classes, player.getClassId().getId());
 	}
 }
\ No newline at end of file
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
index 6be7ab561a..fa9adf348e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
@@ -23,7 +23,7 @@ import java.util.logging.LogRecord;
 
 import org.l2jmobius.Config;
 import org.l2jmobius.commons.util.StringUtil;
-import org.l2jmobius.commons.util.Util;
+import org.l2jmobius.commons.util.CommonUtil;
 
 public class ConsoleLogFormatter extends Formatter
 {
@@ -39,7 +39,7 @@ public class ConsoleLogFormatter extends Formatter
 		{
 			try
 			{
-				StringUtil.append(output, Util.getStackTrace(record.getThrown()), Config.EOL);
+				StringUtil.append(output, CommonUtil.getStackTrace(record.getThrown()), Config.EOL);
 			}
 			catch (Exception ex)
 			{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/Util.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/CommonUtil.java
similarity index 64%
rename from L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/Util.java
rename to L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/CommonUtil.java
index 21d42a0e3e..21dfc30786 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/Util.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/CommonUtil.java
@@ -18,111 +18,39 @@ package org.l2jmobius.commons.util;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.util.logging.Logger;
 
 /**
  * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  * @author luisantonioa
  */
-public class Util
+public class CommonUtil
 {
-	protected static final Logger LOGGER = Logger.getLogger(Util.class.getName());
-	
 	public static boolean isInternalIP(String ipAddress)
 	{
 		return ipAddress.startsWith("192.168.") || ipAddress.startsWith("10.") || ipAddress.startsWith("127.0.0.1");
 	}
 	
+	/**
+	 * Method to generate the hexadecimal representation of a byte array.
+ * 16 bytes per row, while ascii chars or "." is shown at the end of the line. + * @param data the byte array to be represented in hexadecimal representation + * @param len the number of bytes to represent in hexadecimal representation + * @return byte array represented in hexadecimal format + */ public static String printData(byte[] data, int len) { - final StringBuilder result = new StringBuilder(); - int counter = 0; - for (int i = 0; i < len; i++) - { - if ((counter % 16) == 0) - { - result.append(fillHex(i, 4) + ": "); - } - - result.append(fillHex(data[i] & 0xff, 2) + " "); - counter++; - if (counter == 16) - { - result.append(" "); - int charpoint = i - 15; - for (int a = 0; a < 16; a++) - { - final int t1 = data[charpoint++]; - if ((t1 > 0x1f) && (t1 < 0x80)) - { - result.append((char) t1); - } - else - { - result.append('.'); - } - } - - result.append('\n'); - counter = 0; - } - } - - final int rest = data.length % 16; - if (rest > 0) - { - for (int i = 0; i < (17 - rest); i++) - { - result.append(" "); - } - - int charpoint = data.length - rest; - for (int a = 0; a < rest; a++) - { - final int t1 = data[charpoint++]; - if ((t1 > 0x1f) && (t1 < 0x80)) - { - result.append((char) t1); - } - else - { - result.append('.'); - } - } - - result.append('\n'); - } - - return result.toString(); - } - - public static String fillHex(int data, int digits) - { - String number = Integer.toHexString(data); - for (int i = number.length(); i < digits; i++) - { - number = "0" + number; - } - return number; - } - - public static void printSection(String section) - { - String s = "=[ " + section + " ]"; - while (s.length() < 61) - { - s = "-" + s; - } - LOGGER.info(s); + return new String(HexUtils.bArr2HexEdChars(data, len)); } /** - * @param raw - * @return + * This call is equivalent to Util.printData(data, data.length) + * @see CommonUtil#printData(byte[],int) + * @param data data to represent in hexadecimal + * @return byte array represented in hexadecimal format */ - public static String printData(byte[] raw) + public static String printData(byte[] data) { - return printData(raw, raw.length); + return printData(data, data.length); } /** @@ -135,18 +63,6 @@ public class Util return minutesToConvert * 60000; } - /** - * Method to get the stack trace of a Throwable into a String - * @param t Throwable to get the stacktrace from - * @return stack trace from Throwable as String - */ - public static String getStackTrace(Throwable t) - { - final StringWriter sw = new StringWriter(); - t.printStackTrace(new PrintWriter(sw)); - return sw.toString(); - } - /** * Method to generate a random sequence of bytes returned as byte array * @param size number of random bytes to generate @@ -168,6 +84,18 @@ public class Util return array; } + /** + * Method to get the stack trace of a Throwable into a String + * @param t Throwable to get the stacktrace from + * @return stack trace from Throwable as String + */ + public static String getStackTrace(Throwable t) + { + final StringWriter sw = new StringWriter(); + t.printStackTrace(new PrintWriter(sw)); + return sw.toString(); + } + /** * @param * @param array - the array to look into diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/HexUtils.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/HexUtils.java new file mode 100644 index 0000000000..4567492fe7 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/HexUtils.java @@ -0,0 +1,269 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.l2jmobius.commons.util; + +import java.util.Arrays; + +/** + * @author HorridoJoho + */ +public class HexUtils +{ + // lookup table for hex characters + private static final char[] _NIBBLE_CHAR_LOOKUP = + { + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F' + }; + private static final char[] _NEW_LINE_CHARS = System.getProperty("line.separator").toCharArray(); + + /** + * Method to generate the hexadecimal character presentation of a byte
+ * This call is equivalent to {@link HexUtils#b2HexChars(byte, char[], int)} with parameters (data, null, 0) + * @param data byte to generate the hexadecimal character presentation from + * @return a new char array with exactly 2 elements + */ + public static char[] b2HexChars(byte data) + { + return b2HexChars(data, null, 0); + } + + /** + * Method to generate the hexadecimal character presentation of a byte + * @param data byte to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with 2 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] b2HexChars(byte data, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[2]; + dstOffset = 0; + } + + // ///////////////////////////// + // NIBBLE LOOKUP + dstHexChars[dstOffset] = _NIBBLE_CHAR_LOOKUP[(data & 0xF0) >> 4]; + dstHexChars[dstOffset + 1] = _NIBBLE_CHAR_LOOKUP[data & 0x0F]; + + return dstHexChars; + } + + /** + * Method to generate the hexadecimal character presentation of an integer This call is equivalent to {@link HexUtils#int2HexChars(int, char[], int)} with parameters (data, null, 0) + * @param data integer to generate the hexadecimal character presentation from + * @return new char array with 8 elements + */ + public static char[] int2HexChars(int data) + { + return int2HexChars(data, new char[8], 0); + } + + /** + * Method to generate the hexadecimal character presentation of an integer + * @param data integer to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with 8 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] int2HexChars(int data, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[8]; + dstOffset = 0; + } + + b2HexChars((byte) ((data & 0xFF000000) >> 24), dstHexChars, dstOffset); + b2HexChars((byte) ((data & 0x00FF0000) >> 16), dstHexChars, dstOffset + 2); + b2HexChars((byte) ((data & 0x0000FF00) >> 8), dstHexChars, dstOffset + 4); + b2HexChars((byte) (data & 0x000000FF), dstHexChars, dstOffset + 6); + + return dstHexChars; + } + + /** + * Method to generate the hexadecimal character presentation of a byte array
+ * This call is equivalent to {@link HexUtils#bArr2HexChars(byte[], int, int, char[], int)} with parameters (data, offset, len, null, 0) + * @param data byte array to generate the hexadecimal character presentation from + * @param offset offset where to start in data array + * @param len number of bytes to generate the hexadecimal character presentation from + * @return a new char array with len*2 elements + */ + public static char[] bArr2HexChars(byte[] data, int offset, int len) + { + return bArr2HexChars(data, offset, len, null, 0); + } + + /** + * Method to generate the hexadecimal character presentation of a byte array + * @param data byte array to generate the hexadecimal character presentation from + * @param offset offset where to start in data array + * @param len number of bytes to generate the hexadecimal character presentation from + * @param dstHexCharsValue the char array the hexadecimal character presentation should be copied to, if this is null, dstOffset is ignored and a new char array with len*2 elements is created + * @param dstOffsetValue offset at which the hexadecimal character presentation is copied to dstHexChars + * @return the char array the hexadecimal character presentation was copied to + */ + public static char[] bArr2HexChars(byte[] data, int offset, int len, char[] dstHexCharsValue, int dstOffsetValue) + { + char[] dstHexChars = dstHexCharsValue; + int dstOffset = dstOffsetValue; + if (dstHexChars == null) + { + dstHexChars = new char[len * 2]; + dstOffset = 0; + } + + for (int dataIdx = offset, charsIdx = dstOffset; dataIdx < (len + offset); ++dataIdx, ++charsIdx) + { + // ///////////////////////////// + // NIBBLE LOOKUP, we duplicate the code from b2HexChars here, we want to save a few cycles(for charsIdx increment) + dstHexChars[charsIdx] = _NIBBLE_CHAR_LOOKUP[(data[dataIdx] & 0xF0) >> 4]; + dstHexChars[++charsIdx] = _NIBBLE_CHAR_LOOKUP[data[dataIdx] & 0x0F]; + } + + return dstHexChars; + } + + public static char[] bArr2AsciiChars(byte[] data, int offset, int len) + { + return bArr2AsciiChars(data, offset, len, new char[len], 0); + } + + public static char[] bArr2AsciiChars(byte[] data, int offset, int len, char[] dstAsciiCharsValue, int dstOffsetValue) + { + char[] dstAsciiChars = dstAsciiCharsValue; + int dstOffset = dstOffsetValue; + if (dstAsciiChars == null) + { + dstAsciiChars = new char[len]; + dstOffset = 0; + } + + for (int dataIdx = offset, charsIdx = dstOffset; dataIdx < (len + offset); ++dataIdx, ++charsIdx) + { + if ((data[dataIdx] > 0x1f) && (data[dataIdx] < 0x80)) + { + dstAsciiChars[charsIdx] = (char) data[dataIdx]; + } + else + { + dstAsciiChars[charsIdx] = '.'; + } + } + + return dstAsciiChars; + } + + private static final int HEX_ED_BPL = 16; + private static final int HEX_ED_CPB = 2; + + /** + * Method to generate the hexadecimal character representation of a byte array like in a hex editor
+ * Line Format: {OFFSET} {HEXADECIMAL} {ASCII}({NEWLINE})
+ * {OFFSET} = offset of the first byte in line(8 chars)
+ * {HEXADECIMAL} = hexadecimal character representation({@link #HEX_ED_BPL}*2 chars)
+ * {ASCII} = ascii character presentation({@link #HEX_ED_BPL} chars) + * @param data byte array to generate the hexadecimal character representation + * @param len the number of bytes to generate the hexadecimal character representation from + * @return byte array which contains the hexadecimal character representation of the given byte array + */ + public static char[] bArr2HexEdChars(byte[] data, int len) + { + // {OFFSET} {HEXADECIMAL} {ASCII}{NEWLINE} + final int lineLength = 9 + (HEX_ED_BPL * HEX_ED_CPB) + 1 + HEX_ED_BPL + _NEW_LINE_CHARS.length; + final int lenBplMod = len % HEX_ED_BPL; + // create text buffer + // 1. don't allocate a full last line if not _HEX_ED_BPL bytes are shown in last line + // 2. no new line at end of buffer + // BUG: when the length is multiple of _HEX_ED_BPL we erase the whole ascii space with this + // char[] textData = new char[lineLength * numLines - (_HEX_ED_BPL - (len % _HEX_ED_BPL)) - _NEW_LINE_CHARS.length]; + // FIXED HERE + int numLines; + char[] textData; + if (lenBplMod == 0) + { + numLines = len / HEX_ED_BPL; + textData = new char[(lineLength * numLines) - _NEW_LINE_CHARS.length]; + } + else + { + numLines = (len / HEX_ED_BPL) + 1; + textData = new char[(lineLength * numLines) - (HEX_ED_BPL - (lenBplMod)) - _NEW_LINE_CHARS.length]; + } + + // performance penalty, only doing space filling in the loop is faster + // Arrays.fill(textData, ' '); + + int dataOffset; + int dataLen; + int lineStart; + int lineHexDataStart; + int lineAsciiDataStart; + for (int i = 0; i < numLines; ++i) + { + dataOffset = i * HEX_ED_BPL; + dataLen = Math.min(len - dataOffset, HEX_ED_BPL); + lineStart = i * lineLength; + lineHexDataStart = lineStart + 9; + lineAsciiDataStart = lineHexDataStart + (HEX_ED_BPL * HEX_ED_CPB) + 1; + + int2HexChars(dataOffset, textData, lineStart); // the offset of this line + textData[lineHexDataStart - 1] = ' '; // separate + bArr2HexChars(data, dataOffset, dataLen, textData, lineHexDataStart); // the data in hex + bArr2AsciiChars(data, dataOffset, dataLen, textData, lineAsciiDataStart); // the data in ascii + + if (i < (numLines - 1)) + { + textData[lineAsciiDataStart - 1] = ' '; // separate + System.arraycopy(_NEW_LINE_CHARS, 0, textData, lineAsciiDataStart + HEX_ED_BPL, _NEW_LINE_CHARS.length); // the new line + } + else if (dataLen < HEX_ED_BPL) + { + // last line which shows less than _HEX_ED_BPL bytes + final int lineHexDataEnd = lineHexDataStart + (dataLen * HEX_ED_CPB); + Arrays.fill(textData, lineHexDataEnd, lineHexDataEnd + ((HEX_ED_BPL - dataLen) * HEX_ED_CPB) + 1, ' '); // spaces, for the last line if there are not _HEX_ED_BPL bytes + } + else + { + // last line which shows _HEX_ED_BPL bytes + textData[lineAsciiDataStart - 1] = ' '; // separate + } + } + return textData; + } +} diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java index 9bf90c8d8b..3c3be74cd6 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java @@ -64,26 +64,29 @@ public class IPSubnet } } } - // check for embedded v4 in v6 addr (not done !) - else if (_isIPv4) - { - // my V4 vs V6 - for (int i = 0; i < _addr.length; i++) - { - if ((addr[i + 12] & _mask[i]) != _addr[i]) - { - return false; - } - } - } else { - // my V6 vs V4 - for (int i = 0; i < _addr.length; i++) + // check for embedded v4 in v6 addr (not done !) + if (_isIPv4) { - if ((addr[i] & _mask[i + 12]) != _addr[i + 12]) + // my V4 vs V6 + for (int i = 0; i < _addr.length; i++) { - return false; + if ((addr[i + 12] & _mask[i]) != _addr[i]) + { + return false; + } + } + } + else + { + // my V6 vs V4 + for (int i = 0; i < _addr.length; i++) + { + if ((addr[i] & _mask[i + 12]) != _addr[i + 12]) + { + return false; + } } } } @@ -120,7 +123,11 @@ public class IPSubnet { return applyMask(((IPSubnet) o).getAddress()); } - return (o instanceof InetAddress) && applyMask(((InetAddress) o).getAddress()); + else if (o instanceof InetAddress) + { + return applyMask(((InetAddress) o).getAddress()); + } + return false; } private static byte[] getMask(int n, int maxLength) throws UnknownHostException diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/StringUtil.java index 4cd4ff2b32..906227b1f8 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/StringUtil.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/commons/util/StringUtil.java @@ -25,10 +25,14 @@ import java.util.Locale; import org.l2jmobius.Config; /** - * String utilities optimized for the best performance. + * String utilities optimized for the best performance.
*

How to Use It

- *

concat() or append()

If concatenating strings in single call, use StringUtil.concat(), otherwise use StringUtil.append() and its variants. - *

Minimum Calls

Bad: + *

concat() or append()

If concatenating strings
+ * in single call, use StringUtil.concat(), otherwise use StringUtil.append()
+ * and its variants.
+ *
+ *

Minimum Calls


+ * Bad: * *
  * final StringBuilder sbString = new StringBuilder();
@@ -44,8 +48,12 @@ import org.l2jmobius.Config;
  * 
* * Why?
- * Because the less calls you do, the less memory re-allocations have to be done so the whole text fits into the memory and less array copy tasks has to be performed. So if using less calls, less memory is used and string concatenation is faster. - *

Size Hints for Loops

Bad: + * Because the less calls you do, the less memory re-allocations have to be done
+ * so the whole text fits into the memory and less array copy tasks has to be
+ * performed. So if using less calls, less memory is used and string concatenation is faster.
+ *
+ *

Size Hints for Loops


+ * Bad: * *
  * final StringBuilder sbString = new StringBuilder();
@@ -71,8 +79,10 @@ import org.l2jmobius.Config;
  * because new memory has not to be allocated on each cycle. Also it is much faster if no string copy tasks has to be performed. So if concatenating strings in a loop, count approximately the size and set it as the hint for the string builder size. It's better to make the size hint little bit larger
  * rather than smaller.
* In case there is no text appended before the cycle, just use new - * StringBuilder(1300). - *

Concatenation and Constants

Bad: + * StringBuilder(1300).
+ *
+ *

Concatenation and Constants


+ * Bad: * *
  * StringUtil.concat("text 1 ", "text 2", String.valueOf(npcId));
@@ -91,7 +101,7 @@ import org.l2jmobius.Config;
  * 
* * Why?
- * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed. + * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed.
*

Concatenation and Constant Variables

Bad: * *
@@ -108,8 +118,10 @@ import org.l2jmobius.Config;
  * 
  * Why? Because when using final keyword, the glue is marked as constant string and compiler treats it as a constant string so it is able to create string "text1some gluetext2some glue" during the compilation. But this only works in case the value is known at compilation
  * time, so this cannot be used for cases like final String objectIdString =
- * String.valueOf(getObjectId).
- * 

StringBuilder Reuse

Bad: + * String.valueOf(getObjectId).
+ *
+ *

StringBuilder Reuse


+ * Bad: * *
  * final StringBuilder sbString1 = new StringBuilder();
@@ -132,10 +144,12 @@ import org.l2jmobius.Config;
  * Why?
* In first case, new memory has to be allocated for the second string. In second case already allocated memory is reused, but only in case the new string is not longer than the previously allocated string. Anyway, the second way is better because the string either fits in the memory and some memory * is saved, or it does not fit in the memory, and in that case it works as in the first case. - *

Primitives to Strings

To convert primitives to string, use String.valueOf(). - *

How much faster is it?

Here are some results of my tests. Count is number of strings concatenated. Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder - * with predefined size is the fastest (and also most memory efficient) solution. It is about 5 times faster when concatenating 7 strings, compared to StringBuilder. Also, with more strings concatenated, the difference between StringBuilder and StringBuilder gets larger. In code, there are many - * cases, where there are concatenated 50+ strings so the time saving is even greater. + *

Primitives to Strings

To convert primitives to string, use String.valueOf().
+ *
+ *

How much faster is it?


+ * Here are some results of my tests. Count is number of strings concatenated. Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder with predefined size is the + * fastest (and also most memory efficient) solution. It is about 5 times faster when concatenating 7 strings, compared to TextBuilder. Also, with more strings concatenated, the difference between StringBuilder and TextBuilder gets larger. In code, there are many cases, where there are concatenated + * 50+ strings so the time saving is even greater.
* *
  * Count: 2
@@ -188,7 +202,6 @@ public class StringUtil
 	 * Concatenates strings.
 	 * @param strings strings to be concatenated
 	 * @return concatenated string
-	 * @see StringUtil
 	 */
 	public static String concat(String... strings)
 	{
@@ -205,7 +218,6 @@ public class StringUtil
 	 * @param sizeHint hint for string builder size allocation
 	 * @param strings strings to be appended
 	 * @return created string builder
-	 * @see StringUtil
 	 */
 	public static StringBuilder startAppend(int sizeHint, String... strings)
 	{
@@ -222,7 +234,6 @@ public class StringUtil
 	 * Appends strings to existing string builder.
 	 * @param sbString string builder
 	 * @param strings strings to be appended
-	 * @see StringUtil
 	 */
 	public static void append(StringBuilder sbString, String... strings)
 	{
@@ -251,19 +262,12 @@ public class StringUtil
 	 * @param strings array of strings
 	 * @return total length of all the strings
 	 */
-	private static int getLength(String[] strings)
+	public static int getLength(String[] strings)
 	{
 		int length = 0;
 		for (String string : strings)
 		{
-			if (string == null)
-			{
-				length += 4;
-			}
-			else
-			{
-				length += string.length();
-			}
+			length += (string == null) ? 4 : string.length();
 		}
 		return length;
 	}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java
index 180d4d66c5..3b2440559c 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java
@@ -33,7 +33,6 @@ import org.l2jmobius.commons.enums.ServerMode;
 import org.l2jmobius.commons.util.Chronos;
 import org.l2jmobius.commons.util.DeadLockDetector;
 import org.l2jmobius.commons.util.PropertiesParser;
-import org.l2jmobius.commons.util.Util;
 import org.l2jmobius.gameserver.cache.CrestCache;
 import org.l2jmobius.gameserver.cache.HtmCache;
 import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
@@ -174,13 +173,13 @@ public class GameServer
 		// Initialize config
 		Config.load(ServerMode.GAME);
 		
-		Util.printSection("Database");
+		printSection("Database");
 		DatabaseFactory.init();
 		
-		Util.printSection("ThreadPool");
+		printSection("ThreadPool");
 		ThreadPool.init();
 		
-		Util.printSection("IdManager");
+		printSection("IdManager");
 		IdManager.getInstance();
 		if (!IdManager.hasInitialized())
 		{
@@ -196,7 +195,7 @@ public class GameServer
 		CrestCache.getInstance();
 		ScriptEngineManager.getInstance();
 		
-		Util.printSection("World");
+		printSection("World");
 		World.getInstance();
 		MapRegionData.getInstance();
 		AnnouncementsTable.getInstance();
@@ -210,7 +209,7 @@ public class GameServer
 		ExperienceData.getInstance();
 		DuelManager.getInstance();
 		
-		Util.printSection("Players");
+		printSection("Players");
 		PlayerTemplateData.getInstance();
 		if (Config.ENABLE_CLASS_DAMAGE_SETTINGS)
 		{
@@ -222,7 +221,7 @@ public class GameServer
 			ForumsBBSManager.getInstance().initRoot();
 		}
 		
-		Util.printSection("Skills");
+		printSection("Skills");
 		if (!SkillTable.getInstance().isInitialized())
 		{
 			LOGGER.info("Could not find the extraced files. Please Check Your Data.");
@@ -238,7 +237,7 @@ public class GameServer
 		}
 		LOGGER.info("Skills: All skills loaded.");
 		
-		Util.printSection("Items");
+		printSection("Items");
 		ItemTable.getInstance();
 		ArmorSetData.getInstance();
 		ExtractableItemData.getInstance();
@@ -249,7 +248,7 @@ public class GameServer
 			FishData.getInstance();
 		}
 		
-		Util.printSection("Npc");
+		printSection("Npc");
 		SchemeBufferTable.getInstance();
 		WalkerRouteData.getInstance();
 		if (!NpcTable.getInstance().isInitialized())
@@ -258,24 +257,24 @@ public class GameServer
 			throw new Exception("Could not initialize the npc table");
 		}
 		
-		Util.printSection("Geodata");
+		printSection("Geodata");
 		GeoEngine.getInstance();
 		
-		Util.printSection("Economy");
+		printSection("Economy");
 		TradeManager.getInstance();
 		MultisellData.getInstance();
 		
-		Util.printSection("Clan Halls");
+		printSection("Clan Halls");
 		ClanHallManager.getInstance();
 		FortressOfResistance.getInstance();
 		DevastatedCastle.getInstance();
 		BanditStrongholdSiege.getInstance();
 		AuctionManager.getInstance();
 		
-		Util.printSection("Zone");
+		printSection("Zone");
 		ZoneData.getInstance();
 		
-		Util.printSection("Spawnlist");
+		printSection("Spawnlist");
 		if (!Config.ALT_DEV_NO_SPAWNS)
 		{
 			SpawnTable.getInstance();
@@ -296,10 +295,10 @@ public class GameServer
 		}
 		DayNightSpawnManager.getInstance().notifyChangeMode();
 		
-		Util.printSection("Dimensional Rift");
+		printSection("Dimensional Rift");
 		DimensionalRiftManager.getInstance();
 		
-		Util.printSection("Misc");
+		printSection("Misc");
 		RecipeData.getInstance();
 		RecipeManager.getInstance();
 		EventDroplist.getInstance();
@@ -320,41 +319,41 @@ public class GameServer
 			ItemsAutoDestroyTaskManager.getInstance();
 		}
 		
-		Util.printSection("Manor");
+		printSection("Manor");
 		ManorSeedData.getInstance();
 		CastleManorManager.getInstance();
 		
-		Util.printSection("Castles");
+		printSection("Castles");
 		CastleManager.getInstance();
 		SiegeManager.getInstance();
 		FortManager.getInstance();
 		FortSiegeManager.getInstance();
 		CrownManager.getInstance();
 		
-		Util.printSection("Boat");
+		printSection("Boat");
 		BoatData.getInstance();
 		
-		Util.printSection("Doors");
+		printSection("Doors");
 		DoorData.getInstance().load();
 		FenceData.getInstance();
 		
-		Util.printSection("Four Sepulchers");
+		printSection("Four Sepulchers");
 		FourSepulchersManager.getInstance();
 		
-		Util.printSection("Seven Signs");
+		printSection("Seven Signs");
 		SevenSigns.getInstance();
 		SevenSignsFestival.getInstance();
 		AutoSpawnHandler.getInstance();
 		AutoChatHandler.getInstance();
 		
-		Util.printSection("Olympiad System");
+		printSection("Olympiad System");
 		Olympiad.getInstance();
 		Hero.getInstance();
 		
-		Util.printSection("Access Levels");
+		printSection("Access Levels");
 		AdminData.getInstance();
 		
-		Util.printSection("Handlers");
+		printSection("Handlers");
 		ItemHandler.getInstance();
 		SkillHandler.getInstance();
 		AdminCommandHandler.getInstance();
@@ -374,7 +373,7 @@ public class GameServer
 			CustomMailManager.getInstance();
 		}
 		
-		Util.printSection("Scripts");
+		printSection("Scripts");
 		if (!Config.ALT_DEV_NO_SCRIPT)
 		{
 			LOGGER.info("ScriptEngineManager: Loading server scripts:");
@@ -392,7 +391,7 @@ public class GameServer
 		}
 		
 		/* QUESTS */
-		Util.printSection("Quests");
+		printSection("Quests");
 		if (!Config.ALT_DEV_NO_QUESTS)
 		{
 			if (QuestManager.getInstance().getQuests().size() == 0)
@@ -409,7 +408,7 @@ public class GameServer
 			QuestManager.getInstance().unloadAllQuests();
 		}
 		
-		Util.printSection("Game Server");
+		printSection("Game Server");
 		
 		LOGGER.info("IdFactory: Free ObjectID's remaining: " + IdManager.size());
 		
@@ -423,7 +422,7 @@ public class GameServer
 			ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
 		}
 		
-		Util.printSection("EventManager");
+		printSection("EventManager");
 		EventManager.getInstance().startEventRegistration();
 		
 		if (EventManager.TVT_EVENT_ENABLED || EventManager.CTF_EVENT_ENABLED || EventManager.DM_EVENT_ENABLED)
@@ -451,7 +450,7 @@ public class GameServer
 			OfflineTraderTable.restoreOfflineTraders();
 		}
 		
-		Util.printSection("Protection");
+		printSection("Protection");
 		
 		if (Config.CHECK_SKILLS_ON_ENTER)
 		{
@@ -501,7 +500,7 @@ public class GameServer
 			deadDetectThread.start();
 		}
 		
-		Util.printSection("Status");
+		printSection("Status");
 		
 		if (Config.IS_TELNET_ENABLED)
 		{
@@ -527,6 +526,16 @@ public class GameServer
 		INSTANCE = new GameServer();
 	}
 	
+	private void printSection(String section)
+	{
+		String s = "=[ " + section + " ]";
+		while (s.length() < 61)
+		{
+			s = "-" + s;
+		}
+		LOGGER.info(s);
+	}
+	
 	public static GameServer getInstance()
 	{
 		return INSTANCE;
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/items/Henna.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/items/Henna.java
index 2d8e416e27..f0ed6e422c 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/items/Henna.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/items/Henna.java
@@ -16,7 +16,7 @@
  */
 package org.l2jmobius.gameserver.model.items;
 
-import org.l2jmobius.commons.util.Util;
+import org.l2jmobius.commons.util.CommonUtil;
 import org.l2jmobius.gameserver.model.StatSet;
 import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
 
@@ -108,6 +108,6 @@ public class Henna
 	 */
 	public boolean canBeUsedBy(PlayerInstance player)
 	{
-		return Util.contains(_classes, player.getClassId().getId());
+		return CommonUtil.contains(_classes, player.getClassId().getId());
 	}
 }
\ No newline at end of file
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
index 6be7ab561a..fa9adf348e 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/log/formatter/ConsoleLogFormatter.java
@@ -23,7 +23,7 @@ import java.util.logging.LogRecord;
 
 import org.l2jmobius.Config;
 import org.l2jmobius.commons.util.StringUtil;
-import org.l2jmobius.commons.util.Util;
+import org.l2jmobius.commons.util.CommonUtil;
 
 public class ConsoleLogFormatter extends Formatter
 {
@@ -39,7 +39,7 @@ public class ConsoleLogFormatter extends Formatter
 		{
 			try
 			{
-				StringUtil.append(output, Util.getStackTrace(record.getThrown()), Config.EOL);
+				StringUtil.append(output, CommonUtil.getStackTrace(record.getThrown()), Config.EOL);
 			}
 			catch (Exception ex)
 			{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/tools/gsregistering/BaseGameServerRegister.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/tools/gsregistering/BaseGameServerRegister.java
index 539e4de127..f472bc803e 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/tools/gsregistering/BaseGameServerRegister.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/tools/gsregistering/BaseGameServerRegister.java
@@ -32,7 +32,7 @@ import java.util.ResourceBundle;
 import org.l2jmobius.Config;
 import org.l2jmobius.commons.database.DatabaseFactory;
 import org.l2jmobius.commons.enums.ServerMode;
-import org.l2jmobius.commons.util.Util;
+import org.l2jmobius.commons.util.CommonUtil;
 import org.l2jmobius.loginserver.GameServerTable;
 
 /**
@@ -125,7 +125,7 @@ public abstract class BaseGameServerRegister
 	 */
 	public static void registerGameServer(int id, String outDir) throws IOException
 	{
-		final byte[] hexId = Util.generateHex(16);
+		final byte[] hexId = CommonUtil.generateHex(16);
 		GameServerTable.getInstance().registerServerOnDB(hexId, id, "");
 		
 		final Properties hexSetting = new Properties();
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/IPSubnet.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/IPSubnet.java
index 053575dada..3c3be74cd6 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/IPSubnet.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/IPSubnet.java
@@ -99,7 +99,7 @@ public class IPSubnet
 		int size = 0;
 		for (byte element : _mask)
 		{
-			size += Integer.bitCount((element & 0xFF));
+			size += Integer.bitCount(element & 0xFF);
 		}
 		
 		try
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/StringUtil.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/StringUtil.java
index d39f3b6f86..5dda5f8b29 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/StringUtil.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/commons/util/StringUtil.java
@@ -147,38 +147,38 @@ import org.l2jmobius.Config;
  * 
  * 
  * Count: 2
- * TextBuilder: 1893
- * TextBuilder with size: 1703
+ * StringBuilder: 1893
+ * StringBuilder with size: 1703
  * String: 1033
  * StringBuilder: 993
  * StringBuilder with size: 1024
  * Count: 3
- * TextBuilder: 1973
- * TextBuilder with size: 1872
+ * StringBuilder: 1973
+ * StringBuilder with size: 1872
  * String: 2583
  * StringBuilder: 1633
  * StringBuilder with size: 1156
  * Count: 4
- * TextBuilder: 2188
- * TextBuilder with size: 2229
+ * StringBuilder: 2188
+ * StringBuilder with size: 2229
  * String: 4207
  * StringBuilder: 1816
  * StringBuilder with size: 1444
  * Count: 5
- * TextBuilder: 9185
- * TextBuilder with size: 9464
+ * StringBuilder: 9185
+ * StringBuilder with size: 9464
  * String: 6937
  * StringBuilder: 2745
  * StringBuilder with size: 1882
  * Count: 6
- * TextBuilder: 9785
- * TextBuilder with size: 10082
+ * StringBuilder: 9785
+ * StringBuilder with size: 10082
  * String: 9471
  * StringBuilder: 2889
  * StringBuilder with size: 1857
  * Count: 7
- * TextBuilder: 10169
- * TextBuilder with size: 10528
+ * StringBuilder: 10169
+ * StringBuilder with size: 10528
  * String: 12746
  * StringBuilder: 3081
  * StringBuilder with size: 2139