Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteae578c

Browse files
author
zhourenjian
committed
Synchronize Java2ScriptImageCompiler with JDT 3.5's Compiler#process
1 parentfb40f40 commiteae578c

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

‎sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptImageCompiler.java‎

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
importjava.io.PrintWriter;
1515
importjava.util.ArrayList;
1616
importjava.util.List;
17+
importjava.util.Map;
1718

1819
importnet.sf.j2s.core.builder.ClasspathDirectory;
1920
importnet.sf.j2s.core.builder.ClasspathDirectoryProxy;
@@ -22,6 +23,7 @@
2223
importnet.sf.j2s.core.builder.NameEnvironmentProxy;
2324

2425
importorg.eclipse.core.resources.IContainer;
26+
importorg.eclipse.jdt.core.compiler.CompilationProgress;
2527
importorg.eclipse.jdt.internal.compiler.Compiler;
2628
importorg.eclipse.jdt.internal.compiler.ICompilerRequestor;
2729
importorg.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
@@ -41,14 +43,33 @@ public class Java2ScriptImageCompiler extends Compiler {
4143
protectedListsourceUnits;
4244
protectedIContainerbinaryFolder;
4345

46+
publicJava2ScriptImageCompiler(INameEnvironmentenvironment,
47+
IErrorHandlingPolicypolicy,Mapsettings,
48+
ICompilerRequestorrequestor,IProblemFactoryproblemFactory,
49+
booleanparseLiteralExpressionsAsConstants) {
50+
super(environment,policy,settings,requestor,problemFactory,
51+
parseLiteralExpressionsAsConstants);
52+
}
53+
54+
publicJava2ScriptImageCompiler(INameEnvironmentenvironment,
55+
IErrorHandlingPolicypolicy,Mapsettings,
56+
ICompilerRequestorrequestor,IProblemFactoryproblemFactory) {
57+
super(environment,policy,settings,requestor,problemFactory);
58+
}
59+
60+
publicJava2ScriptImageCompiler(INameEnvironmentenvironment,
61+
IErrorHandlingPolicypolicy,CompilerOptionsoptions,
62+
ICompilerRequestorrequestor,IProblemFactoryproblemFactory,
63+
PrintWriterout,CompilationProgressprogress) {
64+
super(environment,policy,options,requestor,problemFactory,out,progress);
65+
}
66+
4467
publicJava2ScriptImageCompiler(INameEnvironmentenvironment,IErrorHandlingPolicypolicy,CompilerOptionsoptions,ICompilerRequestorrequestor,IProblemFactoryproblemFactory,PrintWriterout) {
4568
super(environment,policy,options,requestor,problemFactory,out);
46-
// TODO Auto-generated constructor stub
4769
}
4870

4971
publicJava2ScriptImageCompiler(INameEnvironmentenvironment,IErrorHandlingPolicypolicy,CompilerOptionsoptions,ICompilerRequestorrequestor,IProblemFactoryproblemFactory) {
5072
super(environment,policy,options,requestor,problemFactory);
51-
// TODO Auto-generated constructor stub
5273
}
5374

5475
/* (non-Javadoc)
@@ -90,32 +111,47 @@ public void process(CompilationUnitDeclaration unit, int i) {
90111
}
91112

92113
this.lookupEnvironment.unitBeingCompleted =unit;
114+
longparseStart =System.currentTimeMillis();
93115

94116
this.parser.getMethodBodies(unit);
95117

118+
longresolveStart =System.currentTimeMillis();
119+
this.stats.parseTime +=resolveStart -parseStart;
120+
96121
// fault in fields & methods
97122
if (unit.scope !=null)
98123
unit.scope.faultInTypes();
99124

100125
// verify inherited methods
101126
if (unit.scope !=null)
102-
unit.scope.verifyMethods(lookupEnvironment.methodVerifier());
127+
unit.scope.verifyMethods(this.lookupEnvironment.methodVerifier());
103128

104129
// type checking
105130
unit.resolve();
106131

132+
longanalyzeStart =System.currentTimeMillis();
133+
this.stats.resolveTime +=analyzeStart -resolveStart;
134+
107135
// flow analysis
108136
unit.analyseCode();
109137

138+
longgenerateStart =System.currentTimeMillis();
139+
this.stats.analyzeTime +=generateStart -analyzeStart;
140+
110141
// code generation
111142
unit.generateCode();
112143

113144
// reference info
114-
if (options.produceReferenceInfo &&unit.scope !=null)
145+
if (this.options.produceReferenceInfo &&unit.scope !=null)
115146
unit.scope.storeDependencyInfo();
116147

148+
// finalize problems (suppressWarnings)
149+
unit.finalizeProblems();
150+
151+
this.stats.generateTime +=System.currentTimeMillis() -generateStart;
152+
117153
// refresh the total number of units known at this stage
118-
unit.compilationResult.totalUnitsKnown =totalUnits;
154+
unit.compilationResult.totalUnitsKnown =this.totalUnits;
119155

120156
this.lookupEnvironment.unitBeingCompleted =null;
121157
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp