Skip to content

Commit c6beedc

Browse files
committed
Update, migrate, improve log help links
Fix #10042 See also gwtproject/gwt-site#386
1 parent e71147c commit c6beedc

File tree

9 files changed

+32
-173
lines changed

9 files changed

+32
-173
lines changed

build_tools/doctool/src/com/google/doctool/ResourceIncluder.java

+20-3
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,29 @@ public static String getResourceFromClasspathScrubbedForHTML(String partialPath)
5252
*/
5353
private static String getFileFromClassPath(String partialPath)
5454
throws IOException {
55-
try (InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(partialPath);
56-
){
55+
InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(
56+
partialPath);
57+
try {
5758
if (in == null) {
5859
throw new FileNotFoundException(partialPath);
5960
}
60-
return new String(in.readAllBytes(), StandardCharsets.UTF_8);
61+
ByteArrayOutputStream os = new ByteArrayOutputStream();
62+
byte[] buffer = new byte[1024];
63+
int bytesRead;
64+
while (true) {
65+
bytesRead = in.read(buffer);
66+
if (bytesRead >= 0) {
67+
// Copy the bytes out.
68+
os.write(buffer, 0, bytesRead);
69+
} else {
70+
// End of input stream.
71+
break;
72+
}
73+
}
74+
75+
return os.toString(StandardCharsets.UTF_8);
76+
} finally {
77+
close(in);
6178
}
6279
}
6380

dev/core/src/com/google/gwt/dev/DevMode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import com.google.gwt.dev.shell.jetty.JettyLauncher;
3131
import com.google.gwt.dev.ui.RestartServerCallback;
3232
import com.google.gwt.dev.ui.RestartServerEvent;
33-
import com.google.gwt.dev.util.InstalledHelpInfo;
33+
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
3434
import com.google.gwt.dev.util.Util;
3535
import com.google.gwt.dev.util.arg.ArgHandlerDeployDir;
3636
import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
@@ -723,7 +723,7 @@ private void validateServletTags(TreeLogger logger, ServletValidator servletVali
723723

724724
TreeLogger servletLogger =
725725
logger.branch(TreeLogger.DEBUG, "Validating <servlet> tags for module '" + module.getName()
726-
+ "'", null, new InstalledHelpInfo("servletMappings.html"));
726+
+ "'", null, new GwtprojectOrgHelpInfo("/doc/latest/gwt-dev-help/servletMappings.html"));
727727
for (String servletPath : servletPaths) {
728728
String servletClass = module.findServletForPath(servletPath);
729729
assert (servletClass != null);

dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package com.google.gwt.dev.javac;
1717

1818
import com.google.gwt.dev.jdt.SafeASTVisitor;
19-
import com.google.gwt.dev.util.InstalledHelpInfo;
19+
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
2020
import com.google.gwt.dev.util.collect.Stack;
2121

2222
import org.eclipse.jdt.core.compiler.CharOperation;
@@ -43,16 +43,14 @@
4343
* Check a compilation unit for violations of
4444
* {@link com.google.gwt.core.client.JavaScriptObject JavaScriptObject} (JSO)
4545
* restrictions. The restrictions are summarized in
46-
* <code>jsoRestrictions.html</code>.
47-
*
48-
*
46+
* @see <a href="https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html">jsoRestrictions.html</a>.
4947
* Any violations found are attached as errors on the
5048
* CompilationUnitDeclaration.
5149
*
5250
* @see <a
5351
* href="http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes">Overlay
5452
* types design doc</a>
55-
* @see jsoRestrictions.html
53+
* @see <a href="https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html">jsoRestrictions.html</a>
5654
*/
5755
public class JSORestrictionsChecker {
5856

@@ -288,8 +286,8 @@ static String errAlreadyImplemented(String intfName, String impl1,
288286

289287
private static void errorOn(ASTNode node, CompilationUnitDeclaration cud,
290288
String error) {
291-
GWTProblem.recordError(node, cud, error, new InstalledHelpInfo(
292-
"jsoRestrictions.html"));
289+
GWTProblem.recordError(node, cud, error, new GwtprojectOrgHelpInfo(
290+
"/doc/latest/DevGuideCodingBasicsJSNI.html"));
293291
}
294292

295293
private final CompilationUnitDeclaration cud;

dev/core/src/com/google/gwt/dev/javac/JsniReferenceResolver.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import com.google.gwt.dev.js.ast.JsFunction;
2424
import com.google.gwt.dev.js.ast.JsModVisitor;
2525
import com.google.gwt.dev.js.ast.JsNameRef;
26-
import com.google.gwt.dev.util.InstalledHelpInfo;
26+
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
2727
import com.google.gwt.dev.util.JsniRef;
2828
import com.google.gwt.dev.util.collect.Stack;
2929
import com.google.gwt.thirdparty.guava.common.collect.Lists;
@@ -824,8 +824,8 @@ private boolean isUnsafeLongAnnotation(Annotation annot, ClassScope scope) {
824824
}
825825

826826
private void longAccessError(ASTNode node, String message) {
827-
GWTProblem.recordError(node, cud, message, new InstalledHelpInfo(
828-
"longJsniRestriction.html"));
827+
GWTProblem.recordError(node, cud, message, new GwtprojectOrgHelpInfo(
828+
"/doc/latest/gwt-dev-help/longJsniRestriction.html"));
829829
}
830830

831831
private static void resolveJsniRef(JsniRef jsniRef, FieldBinding fieldBinding) {

dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.gwt.core.ext.ServletContainerLauncher;
2020
import com.google.gwt.core.ext.TreeLogger;
2121
import com.google.gwt.core.ext.UnableToCompleteException;
22-
import com.google.gwt.dev.util.InstalledHelpInfo;
22+
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
2323
import com.google.gwt.dev.util.Util;
2424
import com.google.gwt.thirdparty.guava.common.collect.Iterators;
2525
import com.google.gwt.thirdparty.guava.common.collect.Lists;
@@ -447,7 +447,7 @@ private boolean addContainingClassPathEntry(String warnMessage,
447447
}
448448
branch = branch.branch(logLevel, "Adding classpath entry '"
449449
+ classPathURL + "' to the web app classpath for this session",
450-
null, new InstalledHelpInfo("webAppClassPath.html"));
450+
null, new GwtprojectOrgHelpInfo("/doc/latest/gwt-dev-help/webAppClassPath.html"));
451451
try {
452452
addClassPath(classPathURL);
453453
return true;

distro-source/core/src/doc/helpInfo/jsoRestrictions.html

-54
This file was deleted.

distro-source/core/src/doc/helpInfo/longJsniRestriction.html

-42
This file was deleted.

distro-source/core/src/doc/helpInfo/servletMappings.html

-21
This file was deleted.

distro-source/core/src/doc/helpInfo/webAppClassPath.html

-39
This file was deleted.

0 commit comments

Comments
 (0)