Daniel Azarov created JBIDE-10791:
-------------------------------------
Summary: Null Pointer Exception in CDIProject class
Key: JBIDE-10791
URL:
https://issues.jboss.org/browse/JBIDE-10791
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: CDI
Affects Versions: 3.3.0.M5
Reporter: Daniel Azarov
Assignee: Viacheslav Kabanovich
Fix For: 3.3.0.Beta1
Test case:
EXECUTE:
1. Create CDI Project
2. Create New CDI Qualifier:
{code}
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
@Target( { TYPE, METHOD, PARAMETER, FIELD })
@Retention(RUNTIME)
@Documented
@Qualifier
@interface Chunky
{
boolean realChunky() default true;
boolean unrealChunky();
int number() default 5;
int size();
long long_number() default 1000;
long long_size();
short short_number() default 2;
short short_size();
float probability() default (float)13.5;
float probability2();
double double_probability() default 27.3;
double double_probability2();
char charachter() default 'E';
char charachter2();
byte bbb() default (byte)3;
byte bebebe();
}
{code}
3. Create interface:
{code}
interface Animal
{
}
{code}
4. Create CDI Bean:
{code}
@Chunky(bebebe = 10, charachter2 = 10, double_probability2 = 10, long_size = 10,
probability2 = 10, short_size = 10, size = 10, unrealChunky = false)
class Sheep implements Animal
{
}
{code}
4. Create class:
{code}
import javax.inject.Inject;
public class Farm_Broken1 {
@SuppressWarnings("unused")
@Inject private Animal animal;
}
{code}
5. Build project
FAIL:
org.jboss.tools.common.validation.JBTValidationException
at
org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:101)
at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
at
org.jboss.tools.cdi.internal.core.impl.CDIProject.getAnnotationDeclarationKey(CDIProject.java:630)
at
org.jboss.tools.cdi.internal.core.impl.CDIProject.getAnnotationDeclarationKey(CDIProject.java:598)
at
org.jboss.tools.cdi.internal.core.impl.CDIProject.areMatchingQualifiers(CDIProject.java:517)
at org.jboss.tools.cdi.internal.core.impl.CDIProject.getBeans(CDIProject.java:383)
at
org.jboss.tools.cdi.internal.core.validation.CDICoreValidator.validateInjectionPoint(CDICoreValidator.java:1617)
at
org.jboss.tools.cdi.internal.core.validation.CDICoreValidator.validateBean(CDICoreValidator.java:617)
at
org.jboss.tools.cdi.internal.core.validation.CDICoreValidator.validateResource(CDICoreValidator.java:509)
at
org.jboss.tools.cdi.internal.core.validation.CDICoreValidator.validate(CDICoreValidator.java:381)
at
org.jboss.tools.common.validation.ValidatorManager.validate(ValidatorManager.java:116)
at
org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:81)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira