Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed)

Created:
8 years, 2 months ago by Lasse Reichstein Nielsen
Modified:
8 years, 2 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Removed IllegalAccessException and UnsupportedOperationException. Both were converted to StateError. Committed: https://code.google.com/p/dart/source/detail?r=14012

Patch Set 1 #

Total comments: 17

Patch Set 2 : Changed StateError to UnsupportedError. #

Patch Set 3 : Addressed review comments. #

Patch Set 4 : Addressed last review comment. #

Patch Set 5 : ADded test expectations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1356 lines, -1301 lines) Patch
M lib/compiler/implementation/elements/elements.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/lib/constant_map.dart View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M lib/compiler/implementation/lib/io.dart View 1 4 chunks +22 lines, -22 lines 0 comments Download
M lib/compiler/implementation/lib/isolate_patch.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/lib/js_helper.dart View 1 2 chunks +3 lines, -3 lines 0 comments Download
M lib/compiler/implementation/lib/mirrors.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
M lib/compiler/implementation/lib/scalarlist_patch.dart View 1 1 chunk +20 lines, -20 lines 0 comments Download
M lib/core/bool.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/core/errors.dart View 1 2 chunks +36 lines, -1 line 0 comments Download
M lib/core/exceptions.dart View 1 2 chunks +0 lines, -14 lines 0 comments Download
M lib/core/list.dart View 1 6 chunks +9 lines, -9 lines 0 comments Download
M lib/core/sequences.dart View 1 1 chunk +12 lines, -12 lines 0 comments Download
M lib/html/dart2js/html_dart2js.dart View 172 chunks +406 lines, -406 lines 0 comments Download
M lib/html/dartium/html_dartium.dart View 169 chunks +403 lines, -403 lines 0 comments Download
M lib/html/scripts/systemhtml.py View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/html/scripts/systemnative.py View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/html/src/native_DOMImplementation.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M lib/html/templates/html/dart2js/impl_MouseEvent.darttemplate View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lib/html/templates/html/impl/impl_DocumentFragment.darttemplate View 1 3 chunks +21 lines, -21 lines 0 comments Download
M lib/html/templates/html/impl/impl_Element.darttemplate View 1 5 chunks +12 lines, -12 lines 0 comments Download
M lib/html/templates/html/impl/impl_Node.darttemplate View 1 2 chunks +4 lines, -4 lines 0 comments Download
M lib/html/templates/html/impl/impl_NodeList.darttemplate View 1 2 chunks +4 lines, -4 lines 0 comments Download
M lib/html/templates/html/impl/impl_WheelEvent.darttemplate View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lib/html/templates/immutable_list_mixin.darttemplate View 1 3 chunks +8 lines, -8 lines 0 comments Download
M lib/isolate/timer.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/dartdoc/lib/src/mirrors/util.dart View 1 2 chunks +4 lines, -4 lines 0 comments Download
M pkg/logging/lib/logging.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M pkg/unittest/core_matchers.dart View 1 1 chunk +9 lines, -9 lines 0 comments Download
M pkg/unittest/test/matchers_test.dart View 1 1 chunk +6 lines, -6 lines 0 comments Download
M runtime/bin/process.dart View 1 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/lib/array.dart View 1 8 chunks +21 lines, -21 lines 0 comments Download
M runtime/lib/byte_array.dart View 1 6 chunks +16 lines, -16 lines 0 comments Download
M runtime/lib/error.dart View 1 6 chunks +6 lines, -6 lines 0 comments Download
M runtime/lib/growable_array.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/immutable_map.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
M runtime/lib/integers.dart View 1 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/lib/print_patch.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/string_base.dart View 1 7 chunks +7 lines, -7 lines 0 comments Download
M runtime/tests/vm/dart/byte_array_test.dart View 1 20 chunks +160 lines, -160 lines 0 comments Download
M samples/ui_lib/layout/GridLayoutParams.dart View 1 4 chunks +5 lines, -5 lines 0 comments Download
M samples/ui_lib/layout/GridTracks.dart View 1 3 chunks +4 lines, -4 lines 0 comments Download
M samples/ui_lib/layout/SizingFunctions.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M samples/ui_lib/layout/ViewLayout.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/co19/co19-dart2dart.status View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 4 2 chunks +18 lines, -5 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
M tests/corelib/const_list_literal_test.dart View 1 5 chunks +5 lines, -5 lines 0 comments Download
M tests/corelib/const_list_remove_range_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
tests/corelib/const_list_set_range_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/list_removeat_test.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M tests/corelib/list_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/html/documentfragment_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/html/element_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/html/util.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/isolate/timer_not_available_test.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M tests/language/compile_time_constant_a_test.dart View 1 2 4 chunks +25 lines, -29 lines 0 comments Download
M tests/language/compile_time_constant_b_test.dart View 1 2 3 4 3 chunks +18 lines, -20 lines 0 comments Download
M tests/language/ct_const_test.dart View 1 3 chunks +3 lines, -3 lines 0 comments Download
M tests/language/list_literal3_test.dart View 1 3 chunks +3 lines, -3 lines 0 comments Download
M tests/standalone/io/read_into_const_list_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tools/utils/vim/syntax/dart.vim View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M utils/archive/entry.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M utils/pub/root_source.dart View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M utils/tests/pub/test_pub.dart View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein Nielsen
https://codereview.chromium.org/11235054/diff/1/tests/co19/co19-dart2dart.status File tests/co19/co19-dart2dart.status (right): https://codereview.chromium.org/11235054/diff/1/tests/co19/co19-dart2dart.status#newcode88 tests/co19/co19-dart2dart.status:88: LibTest/core/IllegalAccessException/IllegalAccessException_A01_t01: Fail Will add co19 issue when I get ...
8 years, 2 months ago (2012-10-23 07:33:20 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/lib/constant_map.dart File lib/compiler/implementation/lib/constant_map.dart (right): https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/lib/constant_map.dart#newcode44 lib/compiler/implementation/lib/constant_map.dart:44: throw new StateError("Cannot modify unmodifable Map"); unmodifiable https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/lib/io.dart ...
8 years, 2 months ago (2012-10-23 12:50:32 UTC) #2
Lasse Reichstein Nielsen
8 years, 2 months ago (2012-10-24 12:32:12 UTC) #3
https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/l...
File lib/compiler/implementation/lib/constant_map.dart (right):

https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/l...
lib/compiler/implementation/lib/constant_map.dart:44: throw new
StateError("Cannot modify unmodifable Map");
On 2012/10/23 12:50:32, floitsch wrote:
> unmodifiable

Done.

https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/l...
File lib/compiler/implementation/lib/io.dart (right):

https://codereview.chromium.org/11235054/diff/1/lib/compiler/implementation/l...
lib/compiler/implementation/lib/io.dart:83: throw new
StateError('OSError.toString');
Now throws new UnsupportedError.

https://codereview.chromium.org/11235054/diff/1/runtime/bin/process.dart
File runtime/bin/process.dart (right):

https://codereview.chromium.org/11235054/diff/1/runtime/bin/process.dart#newc...
runtime/bin/process.dart:55: * Throws an [StateError] if the process is
Fixed by changing StateError to UnsupportedError.

https://codereview.chromium.org/11235054/diff/1/runtime/lib/growable_array.dart
File runtime/lib/growable_array.dart (right):

https://codereview.chromium.org/11235054/diff/1/runtime/lib/growable_array.da...
runtime/lib/growable_array.dart:7: throw new StateError(
We don't want to fill our constant pool with exceptions that are, hopefully,
never used.
Apart from OutOfMemoryError and StackOverflowError, you should never need to
create an error ahead of time.
Errors are not intended to be caught, so there is no reason to optimize for
ending your program sooner.

https://codereview.chromium.org/11235054/diff/1/runtime/lib/immutable_map.dart
File runtime/lib/immutable_map.dart (right):

https://codereview.chromium.org/11235054/diff/1/runtime/lib/immutable_map.dar...
runtime/lib/immutable_map.dart:75: throw new StateError("Cannot set value in
unmodifiable Map");
Why const. It's an exception case that should happen at most once in a program.
Using "const" seems like premature optimization, and it grows the constant pool
unnecessarily.

https://codereview.chromium.org/11235054/diff/1/tests/language/compile_time_c...
File tests/language/compile_time_constant_a_test.dart (right):

https://codereview.chromium.org/11235054/diff/1/tests/language/compile_time_c...
tests/language/compile_time_constant_a_test.dart:40: Expect.throws(() =>
m1.putIfAbsent('a', () => 499),
On 2012/10/23 12:50:32, floitsch wrote:
> move into one line. ditto for the remaining ones below.

Done.

https://codereview.chromium.org/11235054/diff/1/tests/language/compile_time_c...
File tests/language/compile_time_constant_b_test.dart (right):

https://codereview.chromium.org/11235054/diff/1/tests/language/compile_time_c...
tests/language/compile_time_constant_b_test.dart:35: Expect.throws(() =>
m1.putIfAbsent('__proto__', () => 499),
fixed where possible. Some are still too long.

Consider adding a helper function:
 void expectUnsupported(func) => Expect.throws(func, isUnsupportedError);

https://codereview.chromium.org/11235054/diff/1/utils/pub/root_source.dart
File utils/pub/root_source.dart (right):

https://codereview.chromium.org/11235054/diff/1/utils/pub/root_source.dart#ne...
utils/pub/root_source.dart:29: throw new StateError(
On 2012/10/23 12:50:32, floitsch wrote:
> one line.

Done.

Powered by Google App Engine
This is Rietveld 408576698