Skip to content

Commit e71147c

Browse files
niloc132vegegoku
authored andcommitted
Quick draft
1 parent b9d1d99 commit e71147c

File tree

5 files changed

+51
-45
lines changed

5 files changed

+51
-45
lines changed

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

+3-20
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,12 @@ public static String getResourceFromClasspathScrubbedForHTML(String partialPath)
5252
*/
5353
private static String getFileFromClassPath(String partialPath)
5454
throws IOException {
55-
InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(
56-
partialPath);
57-
try {
55+
try (InputStream in = ResourceIncluder.class.getClassLoader().getResourceAsStream(partialPath);
56+
){
5857
if (in == null) {
5958
throw new FileNotFoundException(partialPath);
6059
}
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);
60+
return new String(in.readAllBytes(), StandardCharsets.UTF_8);
7861
}
7962
}
8063

dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java

+1-20
Original file line numberDiff line numberDiff line change
@@ -412,27 +412,8 @@ protected void processConnection() throws IOException, BrowserChannelException {
412412
moduleName = oldLoadModule.getModuleName();
413413
userAgent = oldLoadModule.getUserAgent();
414414
protocolVersion = 1;
415-
HelpInfo helpInfo = new HelpInfo() {
416-
@Override
417-
public String getAnchorText() {
418-
return "UsingOOPHM wiki page";
419-
}
420-
421-
@Override
422-
public URL getURL() {
423-
try {
424-
// TODO(jat): better landing page for more info
425-
return new URL(
426-
"http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM");
427-
} catch (MalformedURLException e) {
428-
// can't happen
429-
return null;
430-
}
431-
}
432-
};
433415
logger.log(TreeLogger.WARN, "Connection from old browser plugin -- "
434-
+ "please upgrade to a later version for full functionality", null,
435-
helpInfo);
416+
+ "please upgrade to a later version for full functionality");
436417
break;
437418
case CHECK_VERSIONS:
438419
String connectError = null;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2025 GWT Project Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.google.gwt.dev.util;
17+
18+
import com.google.gwt.core.ext.TreeLogger;
19+
20+
import java.net.MalformedURLException;
21+
import java.net.URL;
22+
23+
/**
24+
* Reference to a help document on the GWT project website.
25+
*/
26+
public class GwtprojectOrgHelpInfo extends TreeLogger.HelpInfo {
27+
private URL url;
28+
29+
public GwtprojectOrgHelpInfo(String relativeUrl) {
30+
try {
31+
url = new URL("https://gwtproject.org" + relativeUrl);
32+
} catch (MalformedURLException ignored) {
33+
// ignore, url will be null
34+
}
35+
}
36+
37+
@Override
38+
public URL getURL() {
39+
return url;
40+
}
41+
}

dev/core/src/com/google/gwt/dev/util/InstalledHelpInfo.java

+4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424

2525
/**
2626
* Help info based on the GWT installation directory.
27+
*
28+
* @deprecated Use {@link GwtprojectOrgHelpInfo} instead so that links work when users aren't using
29+
* the GWT SDK zip.
2730
*/
31+
@Deprecated
2832
public class InstalledHelpInfo extends HelpInfo {
2933
private URL url;
3034

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
tags. These define Java Servlets that implement the server-side
1010
component of a GWT-enabled web application.</p>
1111

12-
<p>Prior to GWT 1.6, these GWT module servlet tags controlled the set of
13-
servlets were actually instantiated during hosted mode. But as of GWT 1.6, this
14-
is no longer true. Instead, the web application's <code>WEB-INF/web.xml</code>
15-
configuration file controls what servlets are instantiated. A GWT module
16-
specifies only what servlets are <i>expected</i>.
12+
<p>In modern GWT applications, these are only used for testing, and it is
13+
discouraged to use them in application code.</p>
1714

1815
<p>During hosted mode startup, the set of expected servlets (from GWT module
1916
<code>&lt;servlet&gt;</code> tags) is validated against the set of actual

0 commit comments

Comments
 (0)