author | duke |
Wed, 05 Jul 2017 20:56:50 +0200 | |
changeset 33372 | 96277015b613 |
parent 23067 | 7b20ffccad89 |
permissions | -rw-r--r-- |
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
1 |
/* |
5555 | 2 |
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
4 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5555 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5555 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
10 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
15 |
* accompanied this code). |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
16 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
20 |
* |
5555 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
24 |
*/ |
23067 | 25 |
package build.tools.logutil; |
2306
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
26 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
27 |
import java.util.LinkedList; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
28 |
import java.util.Queue; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
29 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
30 |
public class InputException { |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
31 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
32 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
33 |
* The name of this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
34 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
35 |
private final String name; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
36 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
37 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
38 |
* The codes associated with this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
39 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
40 |
private final Queue<InputCode> codes; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
41 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
42 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
43 |
* Constructs a new {@link InputException} with the |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
44 |
* specified name. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
45 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
46 |
* @param name the name of the new exception; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
47 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
48 |
public InputException(final String name) { |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
49 |
this.name = name; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
50 |
codes = new LinkedList<InputCode>(); |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
51 |
} |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
52 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
53 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
54 |
* Adds a new code to this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
55 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
56 |
* @param c the code to add. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
57 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
58 |
public void add(InputCode c) |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
59 |
{ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
60 |
codes.offer(c); |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
61 |
} |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
62 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
63 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
64 |
* Returns the name of this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
65 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
66 |
* @return the exception's name. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
67 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
68 |
public String getName() { |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
69 |
return name; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
70 |
} |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
71 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
72 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
73 |
* Returns the codes associated with this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
74 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
75 |
* @return the exception's codes. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
76 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
77 |
public Queue<InputCode> getCodes() { |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
78 |
return codes; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
79 |
} |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
80 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
81 |
/** |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
82 |
* Returns a textual representation of this exception. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
83 |
* |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
84 |
* @return a textual representation. |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
85 |
*/ |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
86 |
public String toString() { |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
87 |
return getClass().getName() |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
88 |
+ "[name=" + name |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
89 |
+ ",codes=" + codes |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
90 |
+ "]"; |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
91 |
} |
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
92 |
|
70ca22b481e1
6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff
changeset
|
93 |
} |