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 350121 | Differences between
and this patch

Collapse All | Expand All

(-)validate/org/eclipse/wst/validation/internal/ValidatorMetaData.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2010 IBM Corporation and others.
2
 * Copyright (c) 2001, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 350-357 Link Here
350
	                    if(outputContainers[i].equals(sourceContainers[j])){
350
	                    if(outputContainers[i].equals(sourceContainers[j])){
351
	                    	return true;
351
	                    	return true;
352
	                    }
352
	                    }
353
						return false;
354
					}
353
					}
354
					return false;
355
				}
355
				}
356
			}
356
			}
357
		}
357
		}
(-)validate/org/eclipse/wst/validation/internal/ValidatorTypeFilter.java (-8 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2008 IBM Corporation and others.
2
 * Copyright (c) 2001, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 73-88 Link Here
73
		// doesn't implement A, then the isInstance call will return false.
73
		// doesn't implement A, then the isInstance call will return false.
74
		//
74
		//
75
		// So, instead of using Class.isInstance, do the checking myself.
75
		// So, instead of using Class.isInstance, do the checking myself.
76
		final String filterClassName = filterClass.getName();
76
		for (Class cl = objectClass; cl != null; cl = cl.getSuperclass()) {
77
		for (Class cl = objectClass; cl != null; cl = cl.getSuperclass()) {
77
			if (cl.getName().equals(filterClass.getName())) {
78
			if (cl.getName().equals(filterClassName))return true;
78
				return true;
79
			}
80
			Class[] clInterfaces = cl.getInterfaces();
79
			Class[] clInterfaces = cl.getInterfaces();
81
			for (int i = 0; i < clInterfaces.length; i++) {
80
			for (int i = 0; i < clInterfaces.length; i++) {
82
				if (clInterfaces[i].getName().equals(filterClass.getName())) {
81
				if (clInterfaces[i].getName().equals(filterClassName))return true;
83
					return true;
82
				if (isInstance(clInterfaces[i], filterClass))return true;
84
				}
85
				return isInstance(clInterfaces[i], filterClass);
86
			}
83
			}
87
		}
84
		}
88
		return false;
85
		return false;
(-)vf2/org/eclipse/wst/validation/internal/ValManager.java (-32 / +1 lines)
Lines 1039-1045 Link Here
1039
		 * Map validator id's to Integers. The integers correspond to bits in the ValProperty instances.
1039
		 * Map validator id's to Integers. The integers correspond to bits in the ValProperty instances.
1040
		 */
1040
		 */
1041
		private final Map<String, Integer> _map = new HashMap<String, Integer>(100);
1041
		private final Map<String, Integer> _map = new HashMap<String, Integer>(100);
1042
		private final Map<Integer, String> _reverseMap = new HashMap<Integer, String>(100);
1043
		
1042
		
1044
		/** Next available bit. */
1043
		/** Next available bit. */
1045
		private int _next;
1044
		private int _next;
Lines 1055-1093 Link Here
1055
			
1054
			
1056
			i = _next++;
1055
			i = _next++;
1057
			_map.put(id, i);
1056
			_map.put(id, i);
1058
			_reverseMap.put(i, id);
1059
			
1057
			
1060
			return i;
1058
			return i;
1061
		}
1059
		}				
1062
		
1063
		/**
1064
		 * Answer the validator id for the index.
1065
		 * @param index
1066
		 * @return null if the index number has not been set.
1067
		 */
1068
		public synchronized String getId(Integer index){
1069
			return _reverseMap.get(index);
1070
		}
1071
		
1072
		public synchronized void reset(){
1073
			_map.clear();
1074
			_reverseMap.clear();
1075
			_next = 0;
1076
		}
1077
		
1078
		/**
1079
		 * Answer the ids for the bit in the bitset. This is used for debugging. 
1080
		 * @param bs
1081
		 */
1082
		public synchronized String[] getIds(BitSet bs){
1083
			List<String> list = new LinkedList<String>();
1084
			for(int i=bs.nextSetBit(0); i>=0; i=bs.nextSetBit(i+1)) {
1085
				String id = getId(i);
1086
				if (id != null)list.add(id);
1087
			}
1088
			String[] s = new String[list.size()];
1089
			return list.toArray(s);
1090
		}		
1091
	}
1060
	}
1092
	
1061
	
1093
	/**
1062
	/**
(-)vf2/org/eclipse/wst/validation/internal/model/FilterRule.java (-2 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 512-518 Link Here
512
		@Override
512
		@Override
513
		public Boolean matchesResource(IResource resource, ContentTypeWrapper wrapper) {
513
		public Boolean matchesResource(IResource resource, ContentTypeWrapper wrapper) {
514
			String name = PortableFileDelim + resource.getProjectRelativePath().toPortableString();
514
			String name = PortableFileDelim + resource.getProjectRelativePath().toPortableString();
515
			if (name == null)return Boolean.FALSE;
516
			return _compiledPattern.matcher(name).matches();
515
			return _compiledPattern.matcher(name).matches();
517
		}		
516
		}		
518
	}
517
	}

Return to bug 350121