View | Details | Raw Unified | Return to bug 183395 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java (-3 / +9 lines)
Lines 100-119 Link Here
100
100
101
		TypeBinding exceptionType = this.type.resolveType(scope, true /* check bounds*/);
101
		TypeBinding exceptionType = this.type.resolveType(scope, true /* check bounds*/);
102
		if (exceptionType == null) return null;
102
		if (exceptionType == null) return null;
103
		boolean hasError = false;
103
		if (exceptionType.isBoundParameterizedType()) {
104
		if (exceptionType.isBoundParameterizedType()) {
104
			scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this);
105
			scope.problemReporter().invalidParameterizedExceptionType(exceptionType, this);
105
			return null;
106
			hasError = true;
107
			// fall thru to create the variable - avoids additional errors because the variable is missing
106
		}
108
		}
107
		if (exceptionType.isTypeVariable()) {
109
		if (exceptionType.isTypeVariable()) {
108
			scope.problemReporter().invalidTypeVariableAsException(exceptionType, this);
110
			scope.problemReporter().invalidTypeVariableAsException(exceptionType, this);
109
			return null;
111
			hasError = true;
112
			// fall thru to create the variable - avoids additional errors because the variable is missing
110
		}
113
		}
111
		if (exceptionType.isArrayType() && ((ArrayBinding) exceptionType).leafComponentType == TypeBinding.VOID) {
114
		if (exceptionType.isArrayType() && ((ArrayBinding) exceptionType).leafComponentType == TypeBinding.VOID) {
112
			scope.problemReporter().variableTypeCannotBeVoidArray(this);
115
			scope.problemReporter().variableTypeCannotBeVoidArray(this);
113
			return null;
116
			hasError = true;
117
			// fall thru to create the variable - avoids additional errors because the variable is missing
114
		}
118
		}
115
		if (exceptionType.findSuperTypeErasingTo(TypeIds.T_JavaLangThrowable, true) == null) {
119
		if (exceptionType.findSuperTypeErasingTo(TypeIds.T_JavaLangThrowable, true) == null) {
116
			scope.problemReporter().cannotThrowType(this.type, exceptionType);
120
			scope.problemReporter().cannotThrowType(this.type, exceptionType);
121
			hasError = true;
117
			// fall thru to create the variable - avoids additional errors because the variable is missing
122
			// fall thru to create the variable - avoids additional errors because the variable is missing
118
		}
123
		}
119
		
124
		
Lines 131-136 Link Here
131
		
136
		
132
		scope.addLocalVariable(binding);
137
		scope.addLocalVariable(binding);
133
		binding.setConstant(Constant.NotAConstant);
138
		binding.setConstant(Constant.NotAConstant);
139
		if (hasError) return null;
134
		return exceptionType;
140
		return exceptionType;
135
	}
141
	}
136
142

Return to bug 183395