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 293992
Collapse All | Expand All

(-)src/org/eclipse/jst/jsp/core/internal/taglib/TaglibHelper.java (-8 / +33 lines)
Lines 94-105 Link Here
94
	private Map fTranslationProblems = null;
94
	private Map fTranslationProblems = null;
95
	private Set fContainerEntries = null;
95
	private Set fContainerEntries = null;
96
	private IJavaProject fJavaProject;
96
	private IJavaProject fJavaProject;
97
	
98
	/**
99
	 * A cache of class names that the class loader could not find.
100
	 * Because the TaglibHelper is destroyed and recreated whenever
101
	 * the classpath changes this cache will not become stale when the
102
	 * classpath changes.
103
	 * See Bug 293992.
104
	 */
105
	private Set fNotFoundClasses = null;
97
106
98
	public TaglibHelper(IProject project) {
107
	public TaglibHelper(IProject project) {
99
		setProject(project);
108
		setProject(project);
100
		fProjectEntries = new HashSet();
109
		fProjectEntries = new HashSet();
101
		fContainerEntries = new HashSet();
110
		fContainerEntries = new HashSet();
102
		fTranslationProblems = new HashMap();
111
		fTranslationProblems = new HashMap();
112
		fNotFoundClasses = new HashSet();
103
	}
113
	}
104
114
105
	private boolean isIterationTag(TLDElementDeclaration elementDecl, IStructuredDocument document, ITextRegionCollection customTag, List problems) {
115
	private boolean isIterationTag(TLDElementDeclaration elementDecl, IStructuredDocument document, ITextRegionCollection customTag, List problems) {
Lines 109-119 Link Here
109
119
110
		Class tagClass;
120
		Class tagClass;
111
		try {
121
		try {
112
			tagClass = Class.forName(className, true, getClassloader());
122
			/* check to be sure the class name is not one that can not currently be found on
113
			if (tagClass != null) {
123
			 * the class path.
114
				return IterationTag.class.isInstance(tagClass.newInstance());
124
			 */
115
			}
125
			if(!fNotFoundClasses.contains(className)) {
126
				tagClass = Class.forName(className, true, getClassloader());
127
				if (tagClass != null) {
128
					return IterationTag.class.isInstance(tagClass.newInstance());
129
				}
130
			} 
116
		} catch (ClassNotFoundException e) {
131
		} catch (ClassNotFoundException e) {
132
			//the class could not be found so add it to the cache
133
			fNotFoundClasses.add(className);
134
			
117
			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TagClassNotFound, JSPCoreMessages.TaglibHelper_3, className, true);
135
			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TagClassNotFound, JSPCoreMessages.TaglibHelper_3, className, true);
118
			if (createdProblem != null)
136
			if (createdProblem != null)
119
				problems.add(createdProblem);
137
				problems.add(createdProblem);
Lines 341-351 Link Here
341
359
342
		Class teiClass = null;
360
		Class teiClass = null;
343
		try {
361
		try {
344
			/*
362
			/* check to be sure the class name is not one that can not currently be found on
345
			 * JDT could tell us about it, but loading and calling it would
363
			 * the class path.
346
			 * still take time
347
			 */
364
			 */
348
			teiClass = Class.forName(teiClassname, true, loader);
365
			if(!fNotFoundClasses.contains(teiClassname)) {
366
				/* JDT could tell us about it, but loading and calling it would
367
				 * still take time
368
				 */
369
				teiClass = Class.forName(teiClassname, true, loader);
370
			}
349
			if (teiClass != null) {
371
			if (teiClass != null) {
350
				Object teiObject = teiClass.newInstance();
372
				Object teiObject = teiClass.newInstance();
351
				if (TagExtraInfo.class.isInstance(teiObject)) {
373
				if (TagExtraInfo.class.isInstance(teiObject)) {
Lines 389-394 Link Here
389
			}
411
			}
390
		}
412
		}
391
		catch (ClassNotFoundException e) {
413
		catch (ClassNotFoundException e) {
414
			//the class could not be found so add it to the cache
415
			fNotFoundClasses.add(teiClassname);
416
			
392
			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TEIClassNotFound, JSPCoreMessages.TaglibHelper_0, teiClassname, true);
417
			Object createdProblem = createJSPProblem(document, customTag, IJSPProblem.TEIClassNotFound, JSPCoreMessages.TaglibHelper_0, teiClassname, true);
393
			if (createdProblem != null) {
418
			if (createdProblem != null) {
394
				problems.add(createdProblem);
419
				problems.add(createdProblem);

Return to bug 293992