Skip to content

Commit bb4ca7c

Browse files
committed
Fixed multi-threading issue
1 parent a4911ed commit bb4ca7c

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

com/ip2location/Country.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* <p>
1818
*
1919
* @author IP2Location.com
20-
* @version 8.12.1
20+
* @version 8.12.2
2121
*/
2222
public class Country {
2323
private final Map<String, Map<String, String>> records = new HashMap<>();

com/ip2location/IP2Location.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* <p>
3535
*
3636
* @author IP2Location.com
37-
* @version 8.12.1
37+
* @version 8.12.2
3838
*/
3939
public class IP2Location {
4040
private static final Pattern pattern = Pattern.compile("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); // IPv4
@@ -305,7 +305,7 @@ private void DestroyMappedBytes() {
305305
_MapDataBuffer = null;
306306
}
307307

308-
private void CreateMappedBytes() throws IOException {
308+
private synchronized void CreateMappedBytes() throws IOException {
309309
try (RandomAccessFile aFile = new RandomAccessFile(IPDatabasePath, "r")) {
310310
final FileChannel inChannel = aFile.getChannel();
311311
CreateMappedBytes(inChannel);

com/ip2location/IP2LocationWebService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* <p>
2727
*
2828
* @author IP2Location.com
29-
* @version 8.12.1
29+
* @version 8.12.2
3030
*/
3131
public class IP2LocationWebService {
3232
private static final Pattern pattern = Pattern.compile("^[\\dA-Z]{10}$");

com/ip2location/IPResult.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* <p>
88
*
99
* @author IP2Location.com
10-
* @version 8.12.1
10+
* @version 8.12.2
1111
*/
1212
public class IPResult {
1313
static final String NOT_SUPPORTED = "Not_Supported";
@@ -39,7 +39,7 @@ public class IPResult {
3939
String as;
4040
String status;
4141
boolean delay = false;
42-
String version = "Version 8.12.1";
42+
String version = "Version 8.12.2";
4343

4444
IPResult(String ipstring) {
4545
ip_address = ipstring;

com/ip2location/IPTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* <p>
3535
*
3636
* @author IP2Location.com
37-
* @version 8.12.1
37+
* @version 8.12.2
3838
*/
3939
public class IPTools {
4040
private static final BigInteger MAX_IPV4_RANGE = new BigInteger("4294967295");

com/ip2location/Region.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* <p>
1919
*
2020
* @author IP2Location.com
21-
* @version 8.12.1
21+
* @version 8.12.2
2222
*/
2323
public class Region {
2424
private final Map<String, List<Map<String, String>>> records = new HashMap<>();

0 commit comments

Comments
 (0)