@@ -198,6 +198,21 @@ public class Java2ScriptVisitor extends ASTVisitor {
198198
199199 private IJavaProject global_project ;
200200
201+ /**
202+ * multipurpose flag for testing development ideas.
203+ *
204+ */
205+ private boolean global_testing ;
206+ // make private fields properties of p1$ ?
207+ // the problem only shows up with a2s subclasses of Swing components
208+ // because they could declare the same private variable and not get
209+ // caught by the compiler, since they do not subclass that class.
210+ //
211+ // possible issues:
212+ // 1) We may have changed some awt, sun, and javax fields from private to public
213+ // 2) Is there an issue with inner classes referencing outer-class private fields?
214+
215+
201216 private String package_name ;
202217 private int package_blockLevel = 0 ;
203218 private int package_currentBlockForVisit = -1 ;
@@ -305,6 +320,7 @@ private Java2ScriptVisitor setInnerGlobals(Java2ScriptVisitor parent, ASTNode no
305320 */
306321 private boolean haveDefaultConstructor ;
307322
323+
308324 private static IType appletType ;
309325
310326 public Java2ScriptVisitor () {
@@ -318,7 +334,8 @@ public Java2ScriptVisitor() {
318334// }
319335 }
320336
321- public Java2ScriptVisitor setProject (IJavaProject project ) {
337+ public Java2ScriptVisitor setProject (IJavaProject project , boolean testing ) {
338+ this .global_testing = testing ;
322339 this .global_project = project ;
323340 return this ;
324341 }
@@ -1626,7 +1643,7 @@ private void addClassOrInterface(ASTNode node, ITypeBinding binding, List<?> bod
16261643
16271644 Java2ScriptVisitor tempVisitor = null ;
16281645 try {
1629- tempVisitor = getClass ().newInstance ().setProject (global_project ).setInnerGlobals (this , node );
1646+ tempVisitor = getClass ().newInstance ().setProject (global_project , global_testing ).setInnerGlobals (this , node );
16301647 } catch (@ SuppressWarnings ("unused" ) Exception e ) {
16311648 // impossible
16321649 }
0 commit comments