Skip to content

Comments

Document DS component constructor validation and reduce duplication#7086

Merged
chrisrueger merged 1 commit intomasterfrom
copilot/update-docs-for-dsannotations
Feb 10, 2026
Merged

Document DS component constructor validation and reduce duplication#7086
chrisrueger merged 1 commit intomasterfrom
copilot/update-docs-for-dsannotations

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Documents the DS component constructor validation introduced in PRs #7082 and #7085. Starting with bnd 7.3.0, component classes must have either a public no-arg constructor or a public @Activate-annotated constructor. Non-static inner classes now fail validation correctly.

Changes

  • docs/_chapters/200-components.md: Added "Component Class Requirements" section with constructor validation rules, valid/invalid examples, and inner class requirements (104 lines)

  • docs/_instructions/_ext/dsannotations.md: Added brief validation overview linking to detailed section (reduced duplication by 16 lines)

  • docs/_chapters/920-faq.md: Added FAQ entry "Why does bnd require a public no-arg constructor for my DS component?" with concise answer linking to detailed section (reduced duplication by 58 lines)

Error Example

The DS component class {className} must declare a public no-arg constructor, 
or a public constructor annotated with @Activate.

Valid Patterns

// Implicit no-arg constructor
@Component
public class MyComponent { }

// Constructor injection
@Component
public class MyComponent {
    @Activate
    public MyComponent(BundleContext context) { }
}

// Static inner class
@Component
public class Outer {
    @Component
    public static class Inner { }
}

Total duplication eliminated: 74 lines. Detailed content consolidated in 200-components.md with cross-references from dsannotations.md and 920-faq.md.

Original prompt

Based on issue #7078 and PRs #7082 and #7085 please suggest what should be added to related docs pages such as:

  • docs/_chapters/200-components.md
  • docs/instructions/dsannotations_options.html
  • docs/instructions/dsannotations.html

and maybe other places like FAQ docs/chapters/920-faq.html


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update documentation for dsannotations options and components Add documentation for DS component constructor validation Feb 4, 2026
Copilot AI requested a review from chrisrueger February 4, 2026 20:49
Copilot AI changed the title Add documentation for DS component constructor validation Document DS component constructor validation and reduce duplication Feb 4, 2026
@chrisrueger chrisrueger marked this pull request as ready for review February 4, 2026 20:54
@chrisrueger
Copy link
Contributor

@kwin I asked for some help with the docs for recent DS related PR: #7078 , #7082 and #7085

Would be great if you have a look to if it makes sense. Feel free to suggest improvements / changes.

@peterkir FYI

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Co-Authored-By: chrisrueger <188422+chrisrueger@users.noreply.github.com>
@chrisrueger chrisrueger force-pushed the copilot/update-docs-for-dsannotations branch from 26c7fca to d66b268 Compare February 10, 2026 18:43
@chrisrueger chrisrueger merged commit 8d7c277 into master Feb 10, 2026
10 of 11 checks passed
@chrisrueger chrisrueger deleted the copilot/update-docs-for-dsannotations branch February 10, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants