public final class io.netty.resolver.HostsFileParser
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: io.netty.resolver.HostsFileParser
super_class: java.lang.Object
{
private static final java.lang.String WINDOWS_DEFAULT_SYSTEM_ROOT;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "C:\\Windows"
private static final java.lang.String WINDOWS_HOSTS_FILE_RELATIVE_PATH;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "\\system32\\drivers\\etc\\hosts"
private static final java.lang.String X_PLATFORMS_HOSTS_FILE_PATH;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "/etc/hosts"
private static final java.util.regex.Pattern WHITESPACES;
descriptor: Ljava/util/regex/Pattern;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final io.netty.util.internal.logging.InternalLogger logger;
descriptor: Lio/netty/util/internal/logging/InternalLogger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc "[ \t]+"
invokestatic java.util.regex.Pattern.compile:(Ljava/lang/String;)Ljava/util/regex/Pattern;
putstatic io.netty.resolver.HostsFileParser.WHITESPACES:Ljava/util/regex/Pattern;
1: ldc Lio/netty/resolver/HostsFileParser;
invokestatic io.netty.util.internal.logging.InternalLoggerFactory.getInstance:(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger;
putstatic io.netty.resolver.HostsFileParser.logger:Lio/netty/util/internal/logging/InternalLogger;
return
LocalVariableTable:
Start End Slot Name Signature
private static java.io.File locateHostsFile();
descriptor: ()Ljava/io/File;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=5, locals=1, args_size=0
0: invokestatic io.netty.util.internal.PlatformDependent.isWindows:()Z
ifeq 5
1: new java.io.File
dup
new java.lang.StringBuilder
dup
ldc "SystemRoot"
invokestatic java.lang.System.getenv:(Ljava/lang/String;)Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "\\system32\\drivers\\etc\\hosts"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
astore 0
start local 0 2: aload 0
invokevirtual java.io.File.exists:()Z
ifne 6
3: new java.io.File
dup
ldc "C:\\Windows\\system32\\drivers\\etc\\hosts"
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
astore 0
4: goto 6
end local 0 5: StackMap locals:
StackMap stack:
new java.io.File
dup
ldc "/etc/hosts"
invokespecial java.io.File.<init>:(Ljava/lang/String;)V
astore 0
start local 0 6: StackMap locals: java.io.File
StackMap stack:
aload 0
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
2 5 0 hostsFile Ljava/io/File;
6 7 0 hostsFile Ljava/io/File;
public static io.netty.resolver.HostsFileEntries parseSilently();
descriptor: ()Lio/netty/resolver/HostsFileEntries;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=2, args_size=0
0: invokestatic io.netty.resolver.HostsFileParser.locateHostsFile:()Ljava/io/File;
astore 0
start local 0 1: aload 0
invokestatic io.netty.resolver.HostsFileParser.parse:(Ljava/io/File;)Lio/netty/resolver/HostsFileEntries;
2: areturn
3: StackMap locals: java.io.File
StackMap stack: java.io.IOException
astore 1
start local 1 4: getstatic io.netty.resolver.HostsFileParser.logger:Lio/netty/util/internal/logging/InternalLogger;
new java.lang.StringBuilder
dup
ldc "Failed to load and parse hosts file at "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
invokevirtual java.io.File.getPath:()Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 1
invokeinterface io.netty.util.internal.logging.InternalLogger.warn:(Ljava/lang/String;Ljava/lang/Throwable;)V
5: getstatic io.netty.resolver.HostsFileEntries.EMPTY:Lio/netty/resolver/HostsFileEntries;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
1 6 0 hostsFile Ljava/io/File;
4 6 1 e Ljava/io/IOException;
Exception table:
from to target type
1 2 3 Class java.io.IOException
public static io.netty.resolver.HostsFileEntries parse();
descriptor: ()Lio/netty/resolver/HostsFileEntries;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: invokestatic io.netty.resolver.HostsFileParser.locateHostsFile:()Ljava/io/File;
invokestatic io.netty.resolver.HostsFileParser.parse:(Ljava/io/File;)Lio/netty/resolver/HostsFileEntries;
areturn
LocalVariableTable:
Start End Slot Name Signature
Exceptions:
throws java.io.IOException
public static io.netty.resolver.HostsFileEntries parse(java.io.File);
descriptor: (Ljava/io/File;)Lio/netty/resolver/HostsFileEntries;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=1, args_size=1
start local 0 0: aload 0
ldc "file"
invokestatic io.netty.util.internal.ObjectUtil.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual java.io.File.exists:()Z
ifeq 3
aload 0
invokevirtual java.io.File.isFile:()Z
ifeq 3
2: new java.io.BufferedReader
dup
new java.io.FileReader
dup
aload 0
invokespecial java.io.FileReader.<init>:(Ljava/io/File;)V
invokespecial java.io.BufferedReader.<init>:(Ljava/io/Reader;)V
invokestatic io.netty.resolver.HostsFileParser.parse:(Ljava/io/Reader;)Lio/netty/resolver/HostsFileEntries;
areturn
3: StackMap locals:
StackMap stack:
getstatic io.netty.resolver.HostsFileEntries.EMPTY:Lio/netty/resolver/HostsFileEntries;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 file Ljava/io/File;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
file
public static io.netty.resolver.HostsFileEntries parse(java.io.Reader);
descriptor: (Ljava/io/Reader;)Lio/netty/resolver/HostsFileEntries;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=16, args_size=1
start local 0 0: aload 0
ldc "reader"
invokestatic io.netty.util.internal.ObjectUtil.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
pop
1: new java.io.BufferedReader
dup
aload 0
invokespecial java.io.BufferedReader.<init>:(Ljava/io/Reader;)V
astore 1
start local 1 2: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 2
start local 2 3: new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
astore 3
start local 3 4: goto 38
start local 4 5: StackMap locals: java.io.Reader java.io.BufferedReader java.util.Map java.util.Map java.lang.String
StackMap stack:
aload 4
bipush 35
invokevirtual java.lang.String.indexOf:(I)I
istore 5
start local 5 6: iload 5
iconst_m1
if_icmpeq 8
7: aload 4
iconst_0
iload 5
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
astore 4
8: StackMap locals: int
StackMap stack:
aload 4
invokevirtual java.lang.String.trim:()Ljava/lang/String;
astore 4
9: aload 4
invokevirtual java.lang.String.isEmpty:()Z
ifeq 11
10: goto 38
11: StackMap locals:
StackMap stack:
new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 6
start local 6 12: getstatic io.netty.resolver.HostsFileParser.WHITESPACES:Ljava/util/regex/Pattern;
aload 4
invokevirtual java.util.regex.Pattern.split:(Ljava/lang/CharSequence;)[Ljava/lang/String;
dup
astore 10
arraylength
istore 9
iconst_0
istore 8
goto 17
StackMap locals: java.io.Reader java.io.BufferedReader java.util.Map java.util.Map java.lang.String int java.util.List top int int java.lang.String[]
StackMap stack:
13: aload 10
iload 8
aaload
astore 7
start local 7 14: aload 7
invokevirtual java.lang.String.isEmpty:()Z
ifne 16
15: aload 6
aload 7
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 7 16: StackMap locals:
StackMap stack:
iinc 8 1
StackMap locals:
StackMap stack:
17: iload 8
iload 9
if_icmplt 13
18: aload 6
invokeinterface java.util.List.size:()I
iconst_2
if_icmpge 20
19: goto 38
20: StackMap locals: java.io.Reader java.io.BufferedReader java.util.Map java.util.Map java.lang.String int java.util.List
StackMap stack:
aload 6
iconst_0
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast java.lang.String
invokestatic io.netty.util.NetUtil.createByteArrayFromIpAddressString:(Ljava/lang/String;)[B
astore 7
start local 7 21: aload 7
ifnonnull 23
22: goto 38
23: StackMap locals: byte[]
StackMap stack:
iconst_1
istore 8
start local 8 24: goto 37
25: StackMap locals: int
StackMap stack:
aload 6
iload 8
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast java.lang.String
astore 9
start local 9 26: aload 9
getstatic java.util.Locale.ENGLISH:Ljava/util/Locale;
invokevirtual java.lang.String.toLowerCase:(Ljava/util/Locale;)Ljava/lang/String;
astore 10
start local 10 27: aload 9
aload 7
invokestatic java.net.InetAddress.getByAddress:(Ljava/lang/String;[B)Ljava/net/InetAddress;
astore 11
start local 11 28: aload 11
instanceof java.net.Inet4Address
ifeq 33
29: aload 2
aload 10
aload 11
checkcast java.net.Inet4Address
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.net.Inet4Address
astore 12
start local 12 30: aload 12
ifnull 36
31: aload 2
aload 10
aload 12
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 12 32: goto 36
33: StackMap locals: java.lang.String java.lang.String java.net.InetAddress
StackMap stack:
aload 3
aload 10
aload 11
checkcast java.net.Inet6Address
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.net.Inet6Address
astore 12
start local 12 34: aload 12
ifnull 36
35: aload 3
aload 10
aload 12
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 12 end local 11 end local 10 end local 9 36: StackMap locals:
StackMap stack:
iinc 8 1
StackMap locals:
StackMap stack:
37: iload 8
aload 6
invokeinterface java.util.List.size:()I
if_icmplt 25
end local 8 end local 7 end local 6 end local 5 end local 4 38: StackMap locals: java.io.Reader java.io.BufferedReader java.util.Map java.util.Map
StackMap stack:
aload 1
invokevirtual java.io.BufferedReader.readLine:()Ljava/lang/String;
dup
astore 4
start local 4 39: ifnonnull 5
40: aload 2
invokeinterface java.util.Map.isEmpty:()Z
ifeq 42
aload 3
invokeinterface java.util.Map.isEmpty:()Z
ifeq 42
41: getstatic io.netty.resolver.HostsFileEntries.EMPTY:Lio/netty/resolver/HostsFileEntries;
goto 43
42: StackMap locals: java.lang.String
StackMap stack:
new io.netty.resolver.HostsFileEntries
dup
aload 2
aload 3
invokespecial io.netty.resolver.HostsFileEntries.<init>:(Ljava/util/Map;Ljava/util/Map;)V
StackMap locals:
StackMap stack: io.netty.resolver.HostsFileEntries
43: astore 14
44: aload 1
invokevirtual java.io.BufferedReader.close:()V
45: goto 48
StackMap locals: java.io.Reader java.io.BufferedReader java.util.Map java.util.Map java.lang.String top top top top top top top top top io.netty.resolver.HostsFileEntries
StackMap stack: java.io.IOException
46: astore 15
start local 15 47: getstatic io.netty.resolver.HostsFileParser.logger:Lio/netty/util/internal/logging/InternalLogger;
ldc "Failed to close a reader"
aload 15
invokeinterface io.netty.util.internal.logging.InternalLogger.warn:(Ljava/lang/String;Ljava/lang/Throwable;)V
end local 15 48: StackMap locals:
StackMap stack:
aload 14
areturn
end local 4 end local 3 end local 2 49: StackMap locals: java.io.Reader java.io.BufferedReader
StackMap stack: java.lang.Throwable
astore 13
50: aload 1
invokevirtual java.io.BufferedReader.close:()V
51: goto 54
StackMap locals: java.io.Reader java.io.BufferedReader top top top top top top top top top top top java.lang.Throwable
StackMap stack: java.io.IOException
52: astore 15
start local 15 53: getstatic io.netty.resolver.HostsFileParser.logger:Lio/netty/util/internal/logging/InternalLogger;
ldc "Failed to close a reader"
aload 15
invokeinterface io.netty.util.internal.logging.InternalLogger.warn:(Ljava/lang/String;Ljava/lang/Throwable;)V
end local 15 54: StackMap locals:
StackMap stack:
aload 13
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 55 0 reader Ljava/io/Reader;
2 55 1 buff Ljava/io/BufferedReader;
3 49 2 ipv4Entries Ljava/util/Map<Ljava/lang/String;Ljava/net/Inet4Address;>;
4 49 3 ipv6Entries Ljava/util/Map<Ljava/lang/String;Ljava/net/Inet6Address;>;
5 38 4 line Ljava/lang/String;
39 49 4 line Ljava/lang/String;
6 38 5 commentPosition I
12 38 6 lineParts Ljava/util/List<Ljava/lang/String;>;
14 16 7 s Ljava/lang/String;
21 38 7 ipBytes [B
24 38 8 i I
26 36 9 hostname Ljava/lang/String;
27 36 10 hostnameLower Ljava/lang/String;
28 36 11 address Ljava/net/InetAddress;
30 32 12 previous Ljava/net/Inet4Address;
34 36 12 previous Ljava/net/Inet6Address;
47 48 15 e Ljava/io/IOException;
53 54 15 e Ljava/io/IOException;
Exception table:
from to target type
44 45 46 Class java.io.IOException
2 44 49 any
50 51 52 Class java.io.IOException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
reader
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/resolver/HostsFileParser;
}
SourceFile: "HostsFileParser.java"