Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 154894
Collapse All | Expand All

(-)src-fastxpath-common/org/eclipse/tptp/platform/provisional/fastxpath/compiler/EclipseCompiler.java (-2 / +16 lines)
Lines 51-56 Link Here
51
	private char[] sourcecode;
51
	private char[] sourcecode;
52
52
53
	private Set classLoaders;
53
	private Set classLoaders;
54
	
55
	//154894 OutOfMemoryError with IBMJDK 1.5
56
	private MyClassLoader classLoader = null;
54
57
55
	/**
58
	/**
56
	 * @see org.eclipse.tptp.platform.provisional.fastxpath.compiler.FastXPathClassGenerator#getBytes()
59
	 * @see org.eclipse.tptp.platform.provisional.fastxpath.compiler.FastXPathClassGenerator#getBytes()
Lines 63-69 Link Here
63
	 * @see org.eclipse.tptp.platform.provisional.fastxpath.compiler.FastXPathClassGenerator#generateClass(byte[])
66
	 * @see org.eclipse.tptp.platform.provisional.fastxpath.compiler.FastXPathClassGenerator#generateClass(byte[])
64
	 */
67
	 */
65
	public Class generateClass(byte[] bArr) throws ClassNotFoundException, CodeGenerationError {
68
	public Class generateClass(byte[] bArr) throws ClassNotFoundException, CodeGenerationError {
66
		return new MyClassLoader(getClass().getClassLoader()).defineClass(bArr);
69
			//154894 OutOfMemoryError with IBMJDK 1.5
70
			return getClassLoader().defineClass(bArr);
67
	}
71
	}
68
72
69
	/**
73
	/**
Lines 75-81 Link Here
75
	 */
79
	 */
76
	public Class generateClass(final char[] source, final String targetClassName) throws ClassNotFoundException, CodeGenerationError {
80
	public Class generateClass(final char[] source, final String targetClassName) throws ClassNotFoundException, CodeGenerationError {
77
81
78
		final MyClassLoader classLoader = new MyClassLoader(getClass().getClassLoader());
82
		//154894 OutOfMemoryError with IBMJDK 1.5
83
		final MyClassLoader classLoader = getClassLoader();
84
		
79
		final ArrayList problemList = new ArrayList();
85
		final ArrayList problemList = new ArrayList();
80
86
81
		final INameEnvironment env = new MyNameEnvironment(targetClassName, this.getClass().getClassLoader(), source);
87
		final INameEnvironment env = new MyNameEnvironment(targetClassName, this.getClass().getClassLoader(), source);
Lines 364-367 Link Here
364
			}
370
			}
365
			return is;
371
			return is;
366
	}
372
	}
373
	
374
	//154894 OutOfMemoryError with IBMJDK 1.5
375
	protected MyClassLoader getClassLoader(){
376
		if(classLoader == null){
377
			classLoader = new MyClassLoader(getClass().getClassLoader());
378
		}
379
		return classLoader;
380
	}
367
}
381
}

Return to bug 154894