-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typo in new UTF-8 codepoint length logic.
- jcodings-1.0.62
- jcodings-1.0.61
- jcodings-1.0.60
- jcodings-1.0.59
- jcodings-1.0.58
- jcodings-1.0.57
- jcodings-1.0.56
- jcodings-1.0.55
- jcodings-1.0.54
- jcodings-1.0.53
- jcodings-1.0.52
- jcodings-1.0.51
- jcodings-1.0.50
- jcodings-1.0.49
- jcodings-1.0.48
- jcodings-1.0.47
- jcodings-1.0.46
- jcodings-1.0.45
- jcodings-1.0.44
- jcodings-1.0.43
- jcodings-1.0.42
- jcodings-1.0.41
- jcodings-1.0.40
- jcodings-1.0.39
- jcodings-1.0.38
- jcodings-1.0.37
- jcodings-1.0.36
- jcodings-1.0.35
- jcodings-1.0.34
- jcodings-1.0.33
- jcodings-1.0.32
- jcodings-1.0.31
- jcodings-1.0.30
- jcodings-1.0.29
- jcodings-1.0.28
- jcodings-1.0.27
- jcodings-1.0.26
- jcodings-1.0.25
- jcodings-1.0.24
- jcodings-1.0.23
Showing
14 changed files
with
130 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.jcodings.exception; | ||
|
||
import org.jcodings.util.IntHash; | ||
|
||
public enum EncodingError { | ||
ERR_TYPE_BUG(ErrorMessages.ERR_TYPE_BUG, ErrorCodes.ERR_TYPE_BUG), | ||
|
||
ERR_TOO_BIG_WIDE_CHAR_VALUE(ErrorMessages.ERR_TOO_BIG_WIDE_CHAR_VALUE, ErrorCodes.ERR_TOO_BIG_WIDE_CHAR_VALUE), | ||
ERR_TOO_LONG_WIDE_CHAR_VALUE(ErrorMessages.ERR_TOO_LONG_WIDE_CHAR_VALUE, ErrorCodes.ERR_TOO_LONG_WIDE_CHAR_VALUE), | ||
|
||
ERR_INVALID_CHAR_PROPERTY_NAME(ErrorMessages.ERR_INVALID_CHAR_PROPERTY_NAME, ErrorCodes.ERR_INVALID_CHAR_PROPERTY_NAME), | ||
ERR_INVALID_CODE_POINT_VALUE(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE, ErrorCodes.ERR_INVALID_CODE_POINT_VALUE), | ||
|
||
ERR_ENCODING_CLASS_DEF_NOT_FOUND(ErrorMessages.ERR_ENCODING_CLASS_DEF_NOT_FOUND, ErrorCodes.ERR_ENCODING_CLASS_DEF_NOT_FOUND), | ||
ERR_ENCODING_LOAD_ERROR(ErrorMessages.ERR_ENCODING_LOAD_ERROR, ErrorCodes.ERR_ENCODING_LOAD_ERROR), | ||
|
||
ERR_ENCODING_ALREADY_REGISTERED(ErrorMessages.ERR_ENCODING_ALREADY_REGISTERED, ErrorCodes.ERR_ENCODING_ALREADY_REGISTERED), | ||
ERR_ENCODING_ALIAS_ALREADY_REGISTERED(ErrorMessages.ERR_ENCODING_ALIAS_ALREADY_REGISTERED, ErrorCodes.ERR_ENCODING_ALIAS_ALREADY_REGISTERED), | ||
ERR_ENCODING_REPLICA_ALREADY_REGISTERED(ErrorMessages.ERR_ENCODING_REPLICA_ALREADY_REGISTERED, ErrorCodes.ERR_ENCODING_REPLICA_ALREADY_REGISTERED), | ||
ERR_NO_SUCH_ENCODNG(ErrorMessages.ERR_NO_SUCH_ENCODNG, ErrorCodes.ERR_NO_SUCH_ENCODNG), | ||
ERR_COULD_NOT_REPLICATE(ErrorMessages.ERR_COULD_NOT_REPLICATE, ErrorCodes.ERR_COULD_NOT_REPLICATE), | ||
|
||
// transcoder messages | ||
ERR_TRANSCODER_ALREADY_REGISTERED(ErrorMessages.ERR_TRANSCODER_ALREADY_REGISTERED, ErrorCodes.ERR_TRANSCODER_ALREADY_REGISTERED), | ||
ERR_TRANSCODER_CLASS_DEF_NOT_FOUND(ErrorMessages.ERR_TRANSCODER_CLASS_DEF_NOT_FOUND, ErrorCodes.ERR_TRANSCODER_CLASS_DEF_NOT_FOUND), | ||
ERR_TRANSCODER_LOAD_ERROR(ErrorMessages.ERR_TRANSCODER_LOAD_ERROR, ErrorCodes.ERR_TRANSCODER_LOAD_ERROR); | ||
|
||
EncodingError(String message, int code) { | ||
this.message = message; | ||
this.code = code; | ||
} | ||
|
||
private final String message; | ||
private final int code; | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public int getCode() { | ||
return code; | ||
} | ||
|
||
public static EncodingError fromCode(int code) { | ||
return CODE_TO_ERROR.get(code); | ||
} | ||
|
||
private static final IntHash<EncodingError> CODE_TO_ERROR = new IntHash<EncodingError>(); | ||
static { | ||
for (EncodingError error : EncodingError.values()) { | ||
CODE_TO_ERROR.put(error.getCode(), error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters