[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-03-06 Thread Brian Slesinsky

Brian Slesinsky has abandoned this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. Instead, catch the exception at the artifact level and log  
it with some context.

..


Abandoned

Submitted.

--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Brian Slesinsky 
Gerrit-Reviewer: Colin Alworth 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-Reviewer: Thomas Broyer 

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-28 Thread Matthew Dempsky

Matthew Dempsky has posted comments on this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. Instead, catch the exception at the artifact level and log  
it with some context.

..


Patch Set 2: Code-Review+1

--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Brian Slesinsky 
Gerrit-Reviewer: Colin Alworth 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-Reviewer: Thomas Broyer 
Gerrit-HasComments: No

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-28 Thread Brian Slesinsky

Brian Slesinsky has posted comments on this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. Instead, catch the exception at the artifact level and log  
it with some context.

..


Patch Set 1:

(2 comments)


File dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
Line 223:   throws IOException, UnableToCompleteException {
Good point; reverted. I changed it so we log an error and throw  
UnableToComplete in the usual way, since that seems to makes the most sense  
for artifacts.




File dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
Line 72
I deleted readString() and transferToStream() because they're unused.


--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Brian Slesinsky 
Gerrit-Reviewer: Colin Alworth 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-Reviewer: Thomas Broyer 
Gerrit-HasComments: Yes

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-28 Thread Brian Slesinsky

Brian Slesinsky has uploaded a new patch set (#2).

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. Instead, catch the exception at the artifact level and log  
it with some context.

..

Remove unnecessary wrapping of IOException in DiskCacheToken.
Instead, catch the exception at the artifact level and log it
with some context.

Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Review-Link: https://gwt-review.googlesource.com/#/c/2020/
---
M dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
M dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
M  
dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
M  
dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java

M dev/core/src/com/google/gwt/dev/util/DiskCache.java
M dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
6 files changed, 20 insertions(+), 32 deletions(-)


--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Colin Alworth 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-Reviewer: Thomas Broyer 

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-28 Thread Thomas Broyer

Thomas Broyer has posted comments on this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. This just increases stack trace verbosity, since the  
callers either throw IOException already or could easily do so.

..


Patch Set 1:

(1 comment)


File dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
Line 223:   throws IOException, UnableToCompleteException {
This is a breaking change. I personnally don't really care, but it might be  
different for JBoss or Sencha.



--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Colin Alworth 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-Reviewer: Thomas Broyer 
Gerrit-HasComments: Yes

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-27 Thread Matthew Dempsky

Matthew Dempsky has posted comments on this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. This just increases stack trace verbosity, since the  
callers either throw IOException already or could easily do so.

..


Patch Set 1:

Hm, after reading the Javadoc for UnableToCompleteException, just letting  
the original exceptions propagate seems most appropriate.


I think StandardLinkerContext.productOutput() needs to throw an  
UnableToCompleteException if it catches an IOException (or allow the  
IOException to propagate).  That seems like a bug at the moment that we  
might just log "Fatal error" and then let the compilation succeed anyway. :(


--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-HasComments: No

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-27 Thread Matthew Dempsky

Matthew Dempsky has posted comments on this change.

Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. This just increases stack trace verbosity, since the  
callers either throw IOException already or could easily do so.

..


Patch Set 1:

(1 comment)

Looks like you could also simplify  
StandardPublicResource.SerializedPublicResource.writeTo()?


Also, I think this alters the semantics of  
StandardLinkerContext.productOutput()?  Currently there's a "catch  
(IOException e)" that would ignore UnableToCompleteExceptions, whereas now  
they'll be caught.


Looking around, there seems to be a lot of  
catch-IOException-log-and-throw-UnableToCompleteException code actually.   
Do you think all of that should just let the IOException propagate  
directly?  Maybe we can add a constructor to UnableToCompleteException to  
wrap an existing exception?



File dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
Line 72
Removing readString() is intentional?


--
To view, visit https://gwt-review.googlesource.com/2020
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Brian Slesinsky 
Gerrit-Reviewer: Matthew Dempsky 
Gerrit-HasComments: Yes

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: Remove unnecessary wrapping of IOException in DiskCacheToken...

2013-02-27 Thread Brian Slesinsky

Brian Slesinsky has uploaded a new change for review.

  https://gwt-review.googlesource.com/2020


Change subject: Remove unnecessary wrapping of IOException in  
DiskCacheToken. This just increases stack trace verbosity, since the  
callers either throw IOException already or could easily do so.

..

Remove unnecessary wrapping of IOException in DiskCacheToken.
This just increases stack trace verbosity, since the callers
either throw IOException already or could easily do so.

Change-Id: Idf40e5c09dc2b9a91c8ae96d8ba79f6f69890410
---
M dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
M dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
M  
dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java

M dev/core/src/com/google/gwt/dev/util/DiskCache.java
M dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
5 files changed, 11 insertions(+), 38 deletions(-)



diff --git  
a/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java  
b/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java

index 067c238..4809866 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/EmittedArtifact.java
@@ -220,15 +220,10 @@
* Provides access to the contents of the EmittedResource.
*/
   public void writeTo(TreeLogger logger, OutputStream out)
-  throws UnableToCompleteException {
-try {
-  InputStream in = getContents(logger);
-  Util.copyNoClose(in, out);
-  Utility.close(in);
-} catch (IOException e) {
-  logger.log(TreeLogger.ERROR, "Unable to read or write stream", e);
-  throw new UnableToCompleteException();
-}
+  throws IOException, UnableToCompleteException {
+InputStream in = getContents(logger);
+Util.copyNoClose(in, out);
+Utility.close(in);
   }

   @Override
diff --git  
a/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java  
b/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java

index 8fbb6f8..2fee86f 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/SyntheticArtifact.java
@@ -62,7 +62,7 @@

   @Override
   public void writeTo(TreeLogger logger, OutputStream out)
-  throws UnableToCompleteException {
+  throws IOException {
 diskCache.transferToStream(token, out);
   }

diff --git  
a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java  
b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java

index c0b62d8..a25a3c5 100644
---  
a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
+++  
b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java

@@ -57,7 +57,7 @@

   @Override
   public void writeTo(TreeLogger logger, OutputStream out)
-  throws UnableToCompleteException {
+  throws IOException {
 diskCache.transferToStream(token, out);
   }

diff --git a/dev/core/src/com/google/gwt/dev/util/DiskCache.java  
b/dev/core/src/com/google/gwt/dev/util/DiskCache.java

index f966f1f..5f34d13 100644
--- a/dev/core/src/com/google/gwt/dev/util/DiskCache.java
+++ b/dev/core/src/com/google/gwt/dev/util/DiskCache.java
@@ -144,7 +144,7 @@
*
* @return a token to retrieve the data later
*/
-  public synchronized long transferFromStream(InputStream in) {
+  public synchronized long transferFromStream(InputStream in) throws  
IOException {

 assert in != null;
 byte[] buf = Util.takeThreadLocalBuf();
 try {
@@ -167,8 +167,6 @@
   // Don't eagerly seek the end, the next operation might be a read.
   atEnd = false;
   return position;
-} catch (IOException e) {
-  throw new RuntimeException("Unable to read from byte cache", e);
 } finally {
   Util.releaseThreadLocalBuf(buf);
 }
@@ -180,7 +178,7 @@
* @param token a previously returned token
* @param out the stream to write into
*/
-  public synchronized void transferToStream(long token, OutputStream out) {
+  public synchronized void transferToStream(long token, OutputStream out)  
throws IOException {

 byte[] buf = Util.takeThreadLocalBuf();
 try {
   atEnd = false;
@@ -197,8 +195,6 @@
 length -= read;
 out.write(buf, 0, read);
   }
-} catch (IOException e) {
-  throw new RuntimeException("Unable to read from byte cache", e);
 } finally {
   Util.releaseThreadLocalBuf(buf);
 }
diff --git a/dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java  
b/dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java

index 36952ce..373558f 100644
--- a/dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
+++ b/dev/core/src/com/google/gwt/dev/util/DiskCacheToken.java
@@ -15,9 +15,9 @@
  */
 package com.google.gwt.dev.util;

+import java.io.IOException;
 import