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

Issue 10389206: Issue 3123. Catch exceptions in Source.exists()/initProperties() (Closed)

Created:
8 years, 7 months ago by scheglov
Modified:
8 years, 7 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Issue 3123. Catch exceptions in Source.exists()/initProperties() http://code.google.com/p/dart/issues/detail?id=3123 R=brianwilkerson@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=7754

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -63 lines) Patch
M compiler/java/com/google/dart/compiler/UrlSource.java View 2 chunks +37 lines, -37 lines 4 comments Download
M compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java View 6 chunks +43 lines, -25 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/end2end/inc/MemoryLibrarySource.java View 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
scheglov
8 years, 7 months ago (2012-05-18 16:30:10 UTC) #1
Brian Wilkerson
LGTM https://chromiumcodereview.appspot.com/10389206/diff/1/compiler/java/com/google/dart/compiler/UrlSource.java File compiler/java/com/google/dart/compiler/UrlSource.java (right): https://chromiumcodereview.appspot.com/10389206/diff/1/compiler/java/com/google/dart/compiler/UrlSource.java#newcode1 compiler/java/com/google/dart/compiler/UrlSource.java:1: // Copyright (c) 2011, the Dart project authors. ...
8 years, 7 months ago (2012-05-18 17:02:52 UTC) #2
scheglov
8 years, 7 months ago (2012-05-18 17:21:54 UTC) #3
https://chromiumcodereview.appspot.com/10389206/diff/1/compiler/java/com/goog...
File compiler/java/com/google/dart/compiler/UrlSource.java (right):

https://chromiumcodereview.appspot.com/10389206/diff/1/compiler/java/com/goog...
compiler/java/com/google/dart/compiler/UrlSource.java:1: // Copyright (c) 2011,
the Dart project authors.  Please see the AUTHORS file
On 2012/05/18 17:02:52, Brian Wilkerson wrote:
> nit: copyright year

Done.

https://chromiumcodereview.appspot.com/10389206/diff/1/compiler/java/com/goog...
compiler/java/com/google/dart/compiler/UrlSource.java:131: } catch (Throwable e)
{
On 2012/05/18 17:02:52, Brian Wilkerson wrote:
> Is there a reason for expanding this to catch all exceptions? (And for that
> matter throwing more than MalformedURIException from initPropertiesEx()?) In
> general, I think it's better to be more specific, but this might make sense.

1. There is reason to throw and catch specific exceptions if you are going to do
something interesting with them. Here we don't.

> 
> Should we be fixing the state of the object if an exception is thrown, or will
a
> partially initialized source be good enough? (If these questions are bigger
than
> we need to address at this point feel free to ignore them.)

2. I look on this situation in the following way: this Source is invalid, i.e.
if exists() tells you "false", you should not continue to work with it, all
other methods return undefined values.

Powered by Google App Engine
This is Rietveld 408576698