Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs - CDI guide - remove unnecessary dummy constructor #2823

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions docs/src/main/asciidoc/cdi-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ You can use for example package-private modifiers:
public class CounterBean {

@Inject
CounterService counterService; // <1>
CounterService counterService; <1>

void onMessage(@Observes Event msg) { // <2>
void onMessage(@Observes Event msg) { <2>
}
}
----
1. A package-private injection field
2. A package-private observer method
<1> A package-private injection field.
<2> A package-private observer method.

Or constructor injection:

Expand All @@ -75,19 +75,14 @@ Or constructor injection:
@ApplicationScoped
public class CounterBean {

private final CounterService service;
private CounterService service;

CounterBean() { // <1>
}

@Inject
CounterBean(CounterService service) { // <2>
CounterBean(CounterService service) { <1>
this.service = service;
}
}
----
1. Dummy constructor needed for CDI beans with a normal scope
2. A package-private constructor injection
<1> A package-private constructor injection.


[[supported_features]]
Expand Down Expand Up @@ -120,7 +115,7 @@ public class CounterBean {
* `@ConversationScoped` is not supported
* Decorators are not supported
* Portable Extensions are not supported
* `BeanManager` - only the following methods are implemented: `getBeans()`, `createCreationalContext()`, `getReference()`, `resolve()`, `getContext()`, `getEvent()` and `createInstance()`
* `BeanManager` - only the following methods are implemented: `getBeans()`, `createCreationalContext()`, `getReference()`, `getInjectableReference()` , `resolve()`, `getContext()`, `fireEvent()`, `getEvent()` and `createInstance()`
* Specialization is not supported
* `beans.xml` descriptor content is ignored
* Passivation and passivating scopes are not supported
Expand Down