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
Show file tree
Hide file tree
Changes from all commits
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
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
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>
*/
public class JSORestrictionsChecker {

Expand Down Expand Up @@ -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"));
}

private final CompilationUnitDeclaration cud;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
21 changes: 1 addition & 20 deletions dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,27 +412,8 @@ protected void processConnection() throws IOException, BrowserChannelException {
moduleName = oldLoadModule.getModuleName();
userAgent = oldLoadModule.getUserAgent();
protocolVersion = 1;
HelpInfo helpInfo = new HelpInfo() {
@Override
public String getAnchorText() {
return "UsingOOPHM wiki page";
}

@Override
public URL getURL() {
try {
// TODO(jat): better landing page for more info
return new URL(
"http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM");
} catch (MalformedURLException e) {
// can't happen
return null;
}
}
};
logger.log(TreeLogger.WARN, "Connection from old browser plugin -- "
+ "please upgrade to a later version for full functionality", null,
helpInfo);
+ "please upgrade to a later version for full functionality");
break;
case CHECK_VERSIONS:
String connectError = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
41 changes: 41 additions & 0 deletions dev/core/src/com/google/gwt/dev/util/GwtprojectOrgHelpInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2025 GWT Project Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.dev.util;

import com.google.gwt.core.ext.TreeLogger;

import java.net.MalformedURLException;
import java.net.URL;

/**
* Reference to a help document on the GWT project website.
*/
public class GwtprojectOrgHelpInfo extends TreeLogger.HelpInfo {
private URL url;

public GwtprojectOrgHelpInfo(String relativeUrl) {
try {
url = new URL("https://gwtproject.org" + relativeUrl);
} catch (MalformedURLException ignored) {
// ignore, url will be null
}
}

@Override
public URL getURL() {
return url;
}
}
4 changes: 4 additions & 0 deletions dev/core/src/com/google/gwt/dev/util/InstalledHelpInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@

/**
* Help info based on the GWT installation directory.
*
* @deprecated Use {@link GwtprojectOrgHelpInfo} instead so that links work when users aren't using
* the GWT SDK zip.
*/
@Deprecated
public class InstalledHelpInfo extends HelpInfo {
private URL url;

Expand Down
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.

24 changes: 0 additions & 24 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.

Loading