Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and improve help info logs #10081

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update, migrate, improve log help links
vegegoku committed Jan 9, 2025
commit c6beedca31790425e9da37ce73416ee216a154dc
23 changes: 20 additions & 3 deletions build_tools/doctool/src/com/google/doctool/ResourceIncluder.java
Original file line number Diff line number Diff line change
@@ -52,12 +52,29 @@ public static String getResourceFromClasspathScrubbedForHTML(String partialPath)
*/
private static String getFileFromClassPath(String partialPath)
throws IOException {
try (InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(partialPath);
){
InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(
partialPath);
try {
if (in == null) {
throw new FileNotFoundException(partialPath);
}
return new String(in.readAllBytes(), StandardCharsets.UTF_8);
ByteArrayOutputStream os = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int bytesRead;
while (true) {
bytesRead = in.read(buffer);
if (bytesRead >= 0) {
// Copy the bytes out.
os.write(buffer, 0, bytesRead);
} else {
// End of input stream.
break;
}
}

return os.toString(StandardCharsets.UTF_8);
} finally {
close(in);
}
}

4 changes: 2 additions & 2 deletions dev/core/src/com/google/gwt/dev/DevMode.java
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
import com.google.gwt.dev.shell.jetty.JettyLauncher;
import com.google.gwt.dev.ui.RestartServerCallback;
import com.google.gwt.dev.ui.RestartServerEvent;
import com.google.gwt.dev.util.InstalledHelpInfo;
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
import com.google.gwt.dev.util.Util;
import com.google.gwt.dev.util.arg.ArgHandlerDeployDir;
import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
@@ -723,7 +723,7 @@ private void validateServletTags(TreeLogger logger, ServletValidator servletVali

TreeLogger servletLogger =
logger.branch(TreeLogger.DEBUG, "Validating <servlet> tags for module '" + module.getName()
+ "'", null, new InstalledHelpInfo("servletMappings.html"));
+ "'", null, new GwtprojectOrgHelpInfo("/doc/latest/gwt-dev-help/servletMappings.html"));
for (String servletPath : servletPaths) {
String servletClass = module.findServletForPath(servletPath);
assert (servletClass != null);
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
package com.google.gwt.dev.javac;

import com.google.gwt.dev.jdt.SafeASTVisitor;
import com.google.gwt.dev.util.InstalledHelpInfo;
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
import com.google.gwt.dev.util.collect.Stack;

import org.eclipse.jdt.core.compiler.CharOperation;
@@ -43,16 +43,14 @@
* Check a compilation unit for violations of
* {@link com.google.gwt.core.client.JavaScriptObject JavaScriptObject} (JSO)
* restrictions. The restrictions are summarized in
* <code>jsoRestrictions.html</code>.
*
*
* @see <a href="https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html">jsoRestrictions.html</a>.
* Any violations found are attached as errors on the
* CompilationUnitDeclaration.
*
* @see <a
* href="http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes">Overlay
* types design doc</a>
* @see jsoRestrictions.html
* @see <a href="https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html">jsoRestrictions.html</a>
Copy link
Member

Choose a reason for hiding this comment

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

Could point to the same file after moving it.

*/
public class JSORestrictionsChecker {

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

private static void errorOn(ASTNode node, CompilationUnitDeclaration cud,
String error) {
GWTProblem.recordError(node, cud, error, new InstalledHelpInfo(
"jsoRestrictions.html"));
GWTProblem.recordError(node, cud, error, new GwtprojectOrgHelpInfo(
"/doc/latest/DevGuideCodingBasicsJSNI.html"));
Copy link
Member

Choose a reason for hiding this comment

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

why not link to the jsoRestrictions.html file that was moved?

}

private final CompilationUnitDeclaration cud;
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
import com.google.gwt.dev.js.ast.JsFunction;
import com.google.gwt.dev.js.ast.JsModVisitor;
import com.google.gwt.dev.js.ast.JsNameRef;
import com.google.gwt.dev.util.InstalledHelpInfo;
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
import com.google.gwt.dev.util.JsniRef;
import com.google.gwt.dev.util.collect.Stack;
import com.google.gwt.thirdparty.guava.common.collect.Lists;
@@ -824,8 +824,8 @@ private boolean isUnsafeLongAnnotation(Annotation annot, ClassScope scope) {
}

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

private static void resolveJsniRef(JsniRef jsniRef, FieldBinding fieldBinding) {
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import com.google.gwt.core.ext.ServletContainerLauncher;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.dev.util.InstalledHelpInfo;
import com.google.gwt.dev.util.GwtprojectOrgHelpInfo;
import com.google.gwt.dev.util.Util;
import com.google.gwt.thirdparty.guava.common.collect.Iterators;
import com.google.gwt.thirdparty.guava.common.collect.Lists;
@@ -447,7 +447,7 @@ private boolean addContainingClassPathEntry(String warnMessage,
}
branch = branch.branch(logLevel, "Adding classpath entry '"
+ classPathURL + "' to the web app classpath for this session",
null, new InstalledHelpInfo("webAppClassPath.html"));
null, new GwtprojectOrgHelpInfo("/doc/latest/gwt-dev-help/webAppClassPath.html"));
try {
addClassPath(classPathURL);
return true;
54 changes: 0 additions & 54 deletions distro-source/core/src/doc/helpInfo/jsoRestrictions.html

This file was deleted.

42 changes: 0 additions & 42 deletions distro-source/core/src/doc/helpInfo/longJsniRestriction.html

This file was deleted.

21 changes: 0 additions & 21 deletions distro-source/core/src/doc/helpInfo/servletMappings.html

This file was deleted.

39 changes: 0 additions & 39 deletions distro-source/core/src/doc/helpInfo/webAppClassPath.html

This file was deleted.