JsonException .java

net.minecraft.client.util.JsonException (class): members: exceptionMessage, field_151383_a, func_151379_a, func_151380_a, func_151381_b, Entry, getMessage.

net.minecraft.client.utilclass89 linesclientextends IOException2.6 KB

API Surface (6)

void func_151380_a(String p_151380_1_)
void func_151381_b(String p_151381_1_)
String getMessage()
JsonException func_151379_a(Exception p_151379_0_)
String func_151372_b()
String toString()

Fields & Constants (2)

field_151383_a
exceptionMessage

String literals (4)

"Invalid "
"File not found"
"(Unknown file) "
"(Unknown file)"

Same Package (1)

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

JsonException.java89 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.util;
2
3
import com.google.common.collect.Lists;
4
import java.io.FileNotFoundException;
5
import java.io.IOException;
6
import java.util.List;
7
import org.apache.commons.lang3.StringUtils;
8
9
public class JsonException extends IOException
10
{
11
    private final List<JsonException.Entry> field_151383_a = Lists.<JsonException.Entry>newArrayList();
12
    private final String exceptionMessage;
13
14
    public JsonException(String message)
15
    {
16
        this.field_151383_a.add(new JsonException.Entry());
17
        this.exceptionMessage = message;
18
    }
19
20
    public JsonException(String message, Throwable cause)
21
    {
22
        super(cause);
23
        this.field_151383_a.add(new JsonException.Entry());
24
        this.exceptionMessage = message;
25
    }
26
27
    public void func_151380_a(String p_151380_1_)
28
    {
29
        ((JsonException.Entry)this.field_151383_a.get(0)).func_151373_a(p_151380_1_);
30
    }
31
32
    public void func_151381_b(String p_151381_1_)
33
    {
34
        ((JsonException.Entry)this.field_151383_a.get(0)).field_151376_a = p_151381_1_;
35
        this.field_151383_a.add(0, new JsonException.Entry());
36
    }
37
38
    public String getMessage()
39
    {
40
        return "Invalid " + ((JsonException.Entry)this.field_151383_a.get(this.field_151383_a.size() - 1)).toString() + ": " + this.exceptionMessage;
41
    }
42
43
    public static JsonException func_151379_a(Exception p_151379_0_)
44
    {
45
        if (p_151379_0_ instanceof JsonException)
46
        {
47
            return (JsonException)p_151379_0_;
48
        }
49
        else
50
        {
51
            String s = p_151379_0_.getMessage();
52
53
            if (p_151379_0_ instanceof FileNotFoundException)
54
            {
55
                s = "File not found";
56
            }
57
58
            return new JsonException(s, p_151379_0_);
59
        }
60
    }
61
62
    public static class Entry
63
    {
64
        private String field_151376_a;
65
        private final List<String> field_151375_b;
66
67
        private Entry()
68
        {
69
            this.field_151376_a = null;
70
            this.field_151375_b = Lists.<String>newArrayList();
71
        }
72
73
        private void func_151373_a(String p_151373_1_)
74
        {
75
            this.field_151375_b.add(0, p_151373_1_);
76
        }
77
78
        public String func_151372_b()
79
        {
80
            return StringUtils.join((Iterable)this.field_151375_b, "->");
81
        }
82
83
        public String toString()
84
        {
85
            return this.field_151376_a != null ? (!this.field_151375_b.isEmpty() ? this.field_151376_a + " " + this.func_151372_b() : this.field_151376_a) : (!this.field_151375_b.isEmpty() ? "(Unknown file) " + this.func_151372_b() : "(Unknown file)");
86
        }
87
    }
88
}
89

Deobfuscated MCP 1.8.9 source of JsonException from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/util/JsonException.java), stored verbatim.