Skip to content

Add StringWriter#10333

Merged
zbynek merged 3 commits into
gwtproject:mainfrom
treblereel:string_writer
Jul 9, 2026
Merged

Add StringWriter#10333
zbynek merged 3 commits into
gwtproject:mainfrom
treblereel:string_writer

Conversation

@treblereel

Copy link
Copy Markdown
Contributor
  • added a GWT port of StringWriter for compatibility with the J2CL Java emulation layer

ref https://github.com/google/j2cl/blob/master/jre/java/java/io/StringWriter.java

@treblereel
treblereel force-pushed the string_writer branch 3 times, most recently from 1df014e to bdda85d Compare June 4, 2026 21:30
@treblereel

Copy link
Copy Markdown
Contributor Author

hmm, not sure if it's related to this pr

Warning: c] [WARNING] Could not transfer metadata org.gwtproject:gwt:HEAD-SNAPSHOT/maven-metadata.xml from/to sonatype-snapshots (https://central.sonatype.com/repository/maven-snapshots/): status code: 403, reason phrase: Forbidden (403) [exec] Downloading from sonatype-snapshots: https://central.sonatype.com/repository/maven-snapshots/org/gwtproject/gwt/HEAD-SNAPSHOT/gwt-HEAD-SNAPSHOT.pom Error: RROR] [ERROR] Some problems were encountered while processing the POMs: Error: xec] [ERROR] Non-resolvable import POM: The following artifacts could not be resolved: org.gwtproject:gwt:pom:HEAD-SNAPSHOT (absent): Could not transfer artifact org.gwtproject:gwt:pom:HEAD-SNAPSHOT from/to sonatype-snapshots (https://central.sonatype.com/repository/maven-snapshots/): status code: 403, reason phrase: Forbidden (403) @ line 19, column 19 [exec] @ Error: xec] [ERROR] The build could not read 1 project -> [Help 1] Error: xec] [ERROR] Error: xec] [ERROR] The project com.google.gwt.sample.dynatable:dynatable:1.0-SNAPSHOT (/home/runner/work/gwt/gwt/gwt/samples/dynatable/pom.xml) has 1 error Error: xec] [ERROR] Non-resolvable import POM: The following artifacts could not be resolved: org.gwtproject:gwt:pom:HEAD-SNAPSHOT (absent): Could not transfer artifact org.gwtproject:gwt:pom:HEAD-SNAPSHOT from/to sonatype-snapshots (https://central.sonatype.com/repository/maven-snapshots/): status code: 403, reason phrase: Forbidden (403) @ line 19, column 19 -> [Help 2] Error: xec] [ERROR] Error: xec] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. Error: xec] [ERROR] Re-run Maven using the -X switch to enable full debug logging. Error: xec] [ERROR] Error: xec] [ERROR] For more information about the errors and possible solutions, please read the following articles: Error: xec] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException Error: xec] [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

@niloc132 niloc132 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see that j2cl also has ASF sources for this class, contributed in google/j2cl@7a98b9c, but with slightly different contents, and fairly different tests (so I don't think you're attributing Google because you copied it from them?).

@@ -0,0 +1,141 @@
/*
* Copyright 2025 Google Inc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026, GWT project authors

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niloc132 still an issue?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think so, but @treblereel can confirm - this was copied (and modified) from the j2cl repo, where it is copyright Google and licensed as apache, so we can copy from there if we retain those details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap, exactly. I took StringWriter and the tests from J2CL and adapted them

Comment thread user/test/com/google/gwt/emultest/java/io/StringWriterTest.java Outdated
@@ -0,0 +1,96 @@
// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I definitely appreciate the attribution and the fact that there is an apache licensed emul out there we can lean on, two questions:

  • first, this appears simple enough it could just be implemented from scratch, right? the test apparently isnt from asf, so that work had to be done fresh...?
  • second, who is the copyright owner? my read of the copyright notice is that we must list the owner. The content at https://www.apache.org/licenses/LICENSE-2.0.html (almost the link below, but https) says

To apply the Apache License to specific files in your work, attach the following boilerplate declaration, replacing the fields enclosed by brackets "[]" with your own identifying information. (Don't include the brackets!) Enclose the text in the appropriate comment syntax for the file format. We also recommend that you include a file or class name and description of purpose on the same "printed page" as the copyright notice for easier identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

From https://www.apache.org/foundation/license-faq,

Note that the Apache Software Foundation uses a different source header that is related to our use of a CLA. Our instructions for our project's source headers are here.

@niloc132 niloc132 added the ready This PR has been reviewed by a maintainer and is ready for a CI run. label Jun 5, 2026
@treblereel
treblereel force-pushed the string_writer branch 2 times, most recently from 4afbcfd to 44a94c9 Compare June 6, 2026 17:41
Comment thread user/super/com/google/gwt/emul/java/io/StringWriter.java
@treblereel
treblereel requested a review from niloc132 June 8, 2026 22:15

@niloc132 niloc132 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you merge this up to date for CI? Otherwise looks good to me.

- added a GWT port of StringWriter for compatibility with the J2CL Java emulation layer

Signed-off-by: Dmitrii Tikhomirov <chani.liet@gmail.com>
Signed-off-by: Dmitrii Tikhomirov <chani.liet@gmail.com>
Signed-off-by: Dmitrii Tikhomirov <chani.liet@gmail.com>
@zbynek
zbynek merged commit be33e83 into gwtproject:main Jul 9, 2026
6 checks passed
@treblereel
treblereel deleted the string_writer branch July 10, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready This PR has been reviewed by a maintainer and is ready for a CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants