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

Remove deprecated or internal types, mark unused code deprecated #9925

Merged
merged 10 commits into from
Oct 15, 2024
2 changes: 0 additions & 2 deletions dev/core/src/com/google/gwt/dev/DevMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.google.gwt.dev.util.InstalledHelpInfo;
import com.google.gwt.dev.util.Util;
import com.google.gwt.dev.util.arg.ArgHandlerDeployDir;
import com.google.gwt.dev.util.arg.ArgHandlerDeprecatedDisableUpdateCheck;
import com.google.gwt.dev.util.arg.ArgHandlerExtraDir;
import com.google.gwt.dev.util.arg.ArgHandlerFilterJsInteropExports;
import com.google.gwt.dev.util.arg.ArgHandlerGenerateJsInteropExports;
Expand Down Expand Up @@ -246,7 +245,6 @@ public ArgProcessor(HostedModeOptions options) {
registerHandler(new ArgHandlerExtraDir(options));
registerHandler(new ArgHandlerModulePathPrefix(options));
registerHandler(new ArgHandlerWorkDirOptional(options));
registerHandler(new ArgHandlerDeprecatedDisableUpdateCheck());
registerHandler(new ArgHandlerMethodNameDisplayMode(options));
registerHandler(new ArgHandlerSourceLevel(options));
registerHandler(new ArgHandlerGenerateJsInteropExports(options));
Expand Down
7 changes: 7 additions & 0 deletions dev/core/src/com/google/gwt/dev/GetJreEmulation.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@

/**
* Entry point that outputs the GWT JRE support.
*
* @deprecated This class is deprecated for removal, with no replacement.
*/
@Deprecated
public class GetJreEmulation {

/**
Expand Down Expand Up @@ -68,6 +71,10 @@ public static void main(String[] args) {
PrintWriterTreeLogger logger = new PrintWriterTreeLogger(new PrintWriter(
System.err, true));
logger.setMaxDetail(TreeLogger.WARN);
logger.log(TreeLogger.Type.WARN,
"GetJreEmulation is deprecated for removal, please consider other options to get " +
"this information from the GWT jar. See https://github.com/gwtproject/gwt/issues/9923 " +
"to discuss other options.");
CompilerContext.Builder compilerContextBuilder = new CompilerContext.Builder();
CompilerContext compilerContext = compilerContextBuilder.build();
ModuleDef module =
Expand Down
12 changes: 1 addition & 11 deletions dev/core/src/com/google/gwt/dev/PrecompileTaskArgProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.gwt.dev.util.arg.ArgHandlerClosureFormattedOutput;
import com.google.gwt.dev.util.arg.ArgHandlerCompileReport;
import com.google.gwt.dev.util.arg.ArgHandlerCompilerMetrics;
import com.google.gwt.dev.util.arg.ArgHandlerDeprecatedDisableUpdateCheck;
import com.google.gwt.dev.util.arg.ArgHandlerDeprecatedOptimizeDataflow;
import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking;
import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata;
Expand All @@ -38,21 +37,17 @@
import com.google.gwt.dev.util.arg.ArgHandlerFragmentMerge;
import com.google.gwt.dev.util.arg.ArgHandlerGenDir;
import com.google.gwt.dev.util.arg.ArgHandlerGenerateJsInteropExports;
import com.google.gwt.dev.util.arg.ArgHandlerIncrementalCompileWarnings;
import com.google.gwt.dev.util.arg.ArgHandlerJsonSoyc;
import com.google.gwt.dev.util.arg.ArgHandlerMethodNameDisplayMode;
import com.google.gwt.dev.util.arg.ArgHandlerMissingDepsFile;
import com.google.gwt.dev.util.arg.ArgHandlerNamespace;
import com.google.gwt.dev.util.arg.ArgHandlerOptimize;
import com.google.gwt.dev.util.arg.ArgHandlerOverlappingSourceWarnings;
import com.google.gwt.dev.util.arg.ArgHandlerSaveSource;
import com.google.gwt.dev.util.arg.ArgHandlerScriptStyle;
import com.google.gwt.dev.util.arg.ArgHandlerSetProperties;
import com.google.gwt.dev.util.arg.ArgHandlerSourceLevel;
import com.google.gwt.dev.util.arg.ArgHandlerSoyc;
import com.google.gwt.dev.util.arg.ArgHandlerSoycDetailed;
import com.google.gwt.dev.util.arg.ArgHandlerStrict;
import com.google.gwt.dev.util.arg.ArgHandlerStrictResources;
import com.google.gwt.dev.util.arg.ArgHandlerValidateOnlyFlag;

class PrecompileTaskArgProcessor extends CompileArgProcessor {
Expand All @@ -71,29 +66,24 @@ public PrecompileTaskArgProcessor(PrecompileTaskOptions options) {
registerHandler(new ArgHandlerDisableOrdinalizeEnums(options));
registerHandler(new ArgHandlerDisableRunAsync(options));
registerHandler(new ArgHandlerDisableSoycHtml(options));
registerHandler(new ArgHandlerDeprecatedDisableUpdateCheck());
registerHandler(new ArgHandlerDraftCompile(options));
registerHandler(new ArgHandlerDumpSignatures());
registerHandler(new ArgHandlerEnableAssertions(options));
registerHandler(new ArgHandlerFragmentCount(options));
registerHandler(new ArgHandlerFragmentMerge(options));
registerHandler(new ArgHandlerFragmentMerge());
registerHandler(new ArgHandlerGenDir(options));
registerHandler(new ArgHandlerIncrementalCompileWarnings());
registerHandler(new ArgHandlerGenerateJsInteropExports(options));
registerHandler(new ArgHandlerFilterJsInteropExports(options));
registerHandler(new ArgHandlerMethodNameDisplayMode(options));
registerHandler(new ArgHandlerMissingDepsFile());
registerHandler(new ArgHandlerNamespace(options));
registerHandler(new ArgHandlerOptimize(options));
registerHandler(new ArgHandlerOverlappingSourceWarnings());
registerHandler(new ArgHandlerSaveSource(options));
registerHandler(new ArgHandlerSetProperties(options));
registerHandler(new ArgHandlerScriptStyle(options));
registerHandler(new ArgHandlerSoyc(options));
registerHandler(new ArgHandlerSoycDetailed(options));
registerHandler(new ArgHandlerJsonSoyc(options));
registerHandler(new ArgHandlerStrict(options));
registerHandler(new ArgHandlerStrictResources());
registerHandler(new ArgHandlerValidateOnlyFlag(options));
registerHandler(new ArgHandlerSourceLevel(options));
}
Expand Down
6 changes: 6 additions & 0 deletions dev/core/src/com/google/gwt/dev/RunWebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
/**
* An utility class for running web apps with Jetty and launching the default
* browser.
*
* @deprecated This class is deprecated for removal, with no replacement.
*/
@Deprecated
public class RunWebApp {

interface RunWebAppOptions extends OptionStartupURLs, OptionPort {
Expand Down Expand Up @@ -130,6 +133,9 @@ public RunWebApp(RunWebAppOptions options) {

protected void run() {
PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
logger.log(TreeLogger.Type.WARN,
"RunWebApp is deprecated for removal, please run your server directly. Visit " +
"https://github.com/gwtproject/gwt/issues/9923 to discuss other options.");
logger.setMaxDetail(TreeLogger.WARN);
int port = options.getPort();
try {
Expand Down
1 change: 1 addition & 0 deletions dev/core/src/com/google/gwt/dev/SignatureDumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.io.PrintStream;

@Deprecated
class SignatureDumper {

public interface Filter {
Expand Down
4 changes: 1 addition & 3 deletions dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class JJSOptionsImpl implements JJSOptions, Serializable {
private boolean disableClassMetadata = false;
private boolean enableAssertions;
private int fragmentCount = -1;
private int fragmentsMerge = -1;
private boolean inlineLiteralParameters = true;
private boolean jsonSoycEnabled = false;
private JsNamespaceOption namespace = JsNamespaceOption.NONE;
Expand Down Expand Up @@ -97,7 +96,7 @@ public int getFragmentCount() {

@Override
public int getFragmentsMerge() {
return fragmentsMerge;
return -1;
}

@Override
Expand Down Expand Up @@ -210,7 +209,6 @@ public void setFragmentCount(int numFragments) {

@Override
public void setFragmentsMerge(int numFragments) {
this.fragmentsMerge = numFragments;
}

@Override
Expand Down
12 changes: 0 additions & 12 deletions dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,6 @@ private Pair<SyntheticArtifact, MultipleDependencyGraphRecorder> splitJsIntoFrag
ByteArrayOutputStream baos = new ByteArrayOutputStream();

int expectedFragmentCount = options.getFragmentCount();
// -1 is the default value, we trap 0 just in case (0 is not a legal value in any case)
if (expectedFragmentCount <= 0) {
// Fragment count not set check fragments merge.
int numberOfMerges = options.getFragmentsMerge();
if (numberOfMerges > 0) {
// + 1 for left over, + 1 for initial gave us the total number
// of fragments without splitting.
expectedFragmentCount =
Math.max(0, jprogram.getRunAsyncs().size() + 2 - numberOfMerges);
}
}

int minFragmentSize = properties.getConfigurationProperties()
.getInteger(CodeSplitters.MIN_FRAGMENT_SIZE, 0);

Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion dev/core/src/com/google/gwt/dev/shell/WorkDirs.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import java.io.File;

/**
* Provides information about work directories.
* Deprecated for removal, the compiler no longer uses this to create work directories.
*/
@Deprecated
public interface WorkDirs {
/**
* Gets the compiler output directory for a particular module.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

/**
* Tree logger that logs servlet context information.
*
* @deprecated This class is deprecated for removal, with no replacement.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we need to add a doc for deprecation reason and the replacement if there is any?

@Deprecated
public class ServletContextTreeLogger extends AbstractTreeLogger {

private final ServletContext ctx;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ public byte[] rewrite(TypeOracle typeOracle, String className,

v = new RewriteJsniMethods(v, anonymousClassMap);

if (Double.parseDouble(System.getProperty("java.class.version")) < Opcodes.V1_8) {
// TODO(cromwellian) implement Retrolambda?
v = new ForceClassVersion15(v);
}

new ClassReader(classBytes).accept(v, 0);
classBytesRewriteEvent.end();
return writer.toByteArray();
Expand Down

This file was deleted.

Loading