# Com / Example

## Overview

The `com.example` package serves as a placeholder top-level namespace within this project. Rather than representing a cohesive application layer or domain, it acts as a container for example and test-fixture code used to exercise code quality tools, import resolution, and linting rules. The package itself contains no indexed source files, classes, or methods at its own level — its structure is defined entirely by its child modules.

This pattern is common in code-analysis and static-lint projects where the goal is to create minimal, reproducible examples that trigger specific rule behaviors (such as import ordering, language feature detection, or JSP scriptlet parsing) without introducing production-grade complexity.

## Sub-module Guide

### `bugca002` — Import Resolution Fixture

The `com.example.bugca002` sub-package is the only child module under `com.example`. It provides a `KnownClass` placeholder whose sole purpose is to satisfy Java import resolution. Other files in the project — notably a JSP file named `BugCa002Language Before Import.jsp` — import `com.example.bugca002.KnownClass` to avoid compilation errors related to missing types.

The class has an empty `execute()` method as a minimal API surface, ensuring callers have something to invoke beyond simple instantiation. This sub-package is a structural dependency: it exists not for runtime behavior but so that import statements in other test units resolve cleanly against a known canonical name.

#### How `bugca002` Fits Into the Project

The `bugca002` module is tightly coupled to a single consumer: the `BugCa002Language Before Import.jsp` file. That JSP imports `KnownClass` to test language-level import behavior (the "Before Import" naming suggests this is part of a before/after comparison for import-related code quality rules). The relationship is directional — `bugca002` provides the type, and the JSP consumes it to validate that the import resolves correctly.

```mermaid
flowchart TD
    JSP["BugCa002Language Before Import.jsp"] --> KC["KnownClass
com.example.bugca002"]
```

### Sub-module Summary

| Sub-module | Role | Key Class | Consumer |
|---|---|---|---|
| `bugca002` | Import resolution fixture | `KnownClass` | `BugCa002Language Before Import.jsp` |

## Key Patterns and Architecture

The `com.example` package follows a **stub-as-dependency** pattern. Rather than organizing code around business domains or application layers, the package structure is driven by testing and analysis needs:

1. **Minimal fixture classes** — Classes like `KnownClass` are intentionally empty or near-empty, designed solely to satisfy the compiler and enable import resolution. This keeps test fixtures from obscuring the rule-under-test with unrelated behavior.

2. **Single-consumer coupling** — Each fixture is consumed by at most one other unit. This tight, one-to-one relationship makes it easy to trace which test or example exercises which fixture, simplifying maintenance when the consuming unit is updated or removed.

3. **Test-driven naming** — The sub-package name `bugca002` and the JSP filename `BugCa002Language Before Import.jsp` together suggest a systematic numbering scheme (e.g., `bug-ca-002`) used to catalog and reference individual code quality rule scenarios. This naming convention likely maps to a lint rule configuration or a rule test harness elsewhere in the project.

No design patterns beyond basic fixture/stub usage are present at this level. The architecture is intentionally minimal by design — the goal is reproducible test input, not production-quality structure.

## Dependencies and Integration

- **Internal dependencies:** The `com.example` package has no direct source files or classes at its own level. Its only inbound/outbound relationships flow through the `bugca002` sub-package, which is consumed by `BugCa002Language Before Import.jsp`.
- **External dependencies:** There are no external library dependencies, no configuration files, and no cross-module relationships outside of the fixture-to-consumer chain described above.
- **Integration with the rest of the system:** The package's role is to provide stable, resolvable types for other test units. It does not integrate with application servers, databases, or other production subsystems.

## Notes for Developers

- **This is test fixture code, not production code.** The classes here are stubs and placeholders. Adding business logic to `KnownClass` is unlikely to be the right direction unless you are explicitly extending the `bug-ca-002` test scenario.
- **If a new sub-package is needed:** Follow the existing naming convention — use a `bugcaXXX` format where `XXX` corresponds to the code quality rule or lint scenario being tested. Each new sub-package should provide a minimal, well-named class that the consuming test unit imports.
- **No external dependencies to manage.** All classes in this package depend only on the Java standard library (if at all). There are no configuration files, build-time code generation, or service registrations to track.
- **Extension point:** The actual rule logic for `bug-ca-002` lives in the lint/config rules that reference `KnownClass`, not in the class itself. To extend or fix the rule, look at the lint configuration and test harness that drive the `bugca002` fixture, not within `KnownClass` itself.
