SAFE Logo
CodeMatch Detailed Report
Version: 5.6.0 | Date: 06/18/12 | Time: 19:09:04

SCORE

SETTINGS
Compare file 1: C:\Users\Evan\Desktop\Java2SE5.0\src\com\sun\jmx\snmp\IPAcl\ParseException.java
To file 2: C:\Users\Evan\Desktop\Android2.2Froyo\org\apache\james\mime4j\field\address\parser\ParseException.java
Links to results: Matching Statements
Matching Comments and Strings
Matching Instruction Sequences
Matching Identifiers
Partially Matching Identifiers
Score
RESULTS
Matching Statements
File1 Line# File2 Line# Statement
2028public class ParseException extends Exception {
3442public ParseException(Token currentTokenVal,
3543int[][] expectedTokenSequencesVal,
3644String[] tokenImageVal
4048specialConstructor = true
4149currentToken = currentTokenVal
4250expectedTokenSequences = expectedTokenSequencesVal
4351tokenImage = tokenImageVal
5664public ParseException() {
58
63
66
71
specialConstructor = false
6169public ParseException(String message) {
6270super(message)
7179protected boolean specialConstructor
7886public Token currentToken
8593public int[][] expectedTokenSequences
92100public String[] tokenImage
104112public String getMessage() {
105113if (!specialConstructor) {
106114return super.getMessage()
109117int maxSize = 0
110
124
156
118
132
165
for (int i = 0
110118i < expectedTokenSequences.length
110
124
156
118
132
165
i++) {
111119if (maxSize < expectedTokenSequences[i].length) {
112120maxSize = expectedTokenSequences[i].length
114122for (int j = 0
114122j < expectedTokenSequences[i].length
114122j++) {
117125if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
122130String retval =
123131Token tok = currentToken.next
124132i < maxSize
125133if (i != 0) retval +=
126134if (tok.kind == 0) {
127135retval += tokenImage[0]
130138retval += add_escapes(tok.image)
131139tok = tok.next
134143if (expectedTokenSequences.length == 1) {
135
137
144
146
retval += + eol +
140149return retval
146155protected String eol = System.getProperty( , )
153162protected String add_escapes(String str) {
154163StringBuffer retval = new StringBuffer()
155164char ch
156165i < str.length()
157166switch (str.charAt(i))
159168case 0 :
162
165
168
171
174
177
180
183
171
174
177
180
183
186
189
192
retval.append( )
186195if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
187196String s = + Integer.toString(ch, 16)
188197retval.append( + s.substring(s.length() - 4, s.length()))
190199retval.append(ch)
195204return retval.toString()

to top

Matching Comments and Strings
File1 Line# File2 Line# Comment/String
1220* This exception is thrown when parse errors are encountered.
1321* You can explicitly create objects of this exception type by
1422* calling the method generateParseException in the generated
1523* parser.
1725* You can modify this class to customize your error reporting
1826* mechanisms so long as you retain the public fields.
2331* This constructor is used by the method "generateParseException"
2432* in the generated parser. Calling this constructor generates
2533* a new object of this type with the fields "currentToken",
2634* "expectedTokenSequences", and "tokenImage" set. The boolean
2735* flag "specialConstructor" is also set to true to indicate that
2836* this constructor was used to create this object.
2937* This constructor calls its super class with the empty string
3038* to force the "toString" method of parent class "Throwable" to
3139* print the error message in the form:
3240* ParseException: <result of getMessage>
4755* The following constructors are for use by you for whatever
4856* purpose you can think of. Constructing the exception in this
4957* manner makes the exception behave in the normal way - i.e., as
5058* documented in the class "Throwable". The fields "errorToken",
5159* "expectedTokenSequences", and "tokenImage" do not contain
5260* relevant information. The JavaCC generated code does not use
5361* these constructors.
6775* This variable determines which constructor was used to create
6876* this object and thereby affects the semantics of the
6977* "getMessage" method (see below).
7482* This is the last token that has been consumed successfully. If
7583* this object has been created due to a parse error, the token
7684* followng this token will (therefore) be the first error token.
8189* Each entry in this array is an array of integers. Each array
8290* of integers represents a sequence of tokens (by their ordinal
8391* values) that is expected at this point of the parse.
8896* This is a reference to the "tokenImage" array of the generated
8997* parser within which the parse error occurred. This array is
9098* defined in the generated ...Constants interface.
95103* This method has the standard behavior when this object has been
96104* created using the standard constructors. Otherwise, it uses
97105* "currentToken" and "expectedTokenSequences" to generate a parse
98106* error message and returns it. If this object has been created
99107* due to a parse error, and you do not catch it (it gets thrown
100108* from the parser), then this method is called during the printing
101109* of the final stack trace, and hence the correct error message
102110* gets displayed.
118126...
122130Encountered \"
133141\" at line
133141, column
135144Was expecting:
137146Was expecting one of:
144153* The end of line string for this machine.
146155line.separator
149158* Used to convert raw characters to their escaped version
150159* when these raw version cannot be used as part of an ASCII
151160* string literal.
162171\\b
165174\\t
168177\\n
171180\\f
174183\\r
177186\\\"
180189\\\'
183192\\\\
1871960000
188197\\u

to top

Matching Instruction Sequences
File1 Line# File2 Line# Number of matching instructions
9 17 23
109 117 25
133 142 49
160 172 22
160 175 19
160 178 16
160 181 13
160 184 10
163 169 22
166 169 19
169 169 16
172 169 13
175 169 10

to top

Matching Identifiers
0x20 0x7e 16 add_escapes append beginColumn beginLine ch
charAt currentToken currentTokenVal eol Exception expected expectedTokenSequences expectedTokenSequencesVal
getMessage getProperty image kind length maxSize message next
ParseException retval specialConstructor str StringBuffer substring System tok
Token tokenImage tokenImageVal toString

to top

Partially Matching Identifiers
*** NONE ***
to the top
SCORE 82

CodeSuite copyright 2003-2012 by Software Analysis and Forensic Engineering Corporation