MCPcopy Index your code
hub / github.com/JakeWharton/nopen

github.com/JakeWharton/nopen @1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.1 ↗ · + Follow
21 symbols 27 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Nope'n!

An error-prone checker which requires that classes be final, abstract, or annotated with @Open.

Design and document for inheritance or else prohibit it

– Item 19, Effective Java, Third Edition

Usage

Java creates new types as open by default which can be dangerous. This checker ensures that the intent to leave a class open is explicitly declared.

import com.jakewharton.nopen.annotation.Open;

final class Foo {}
abstract class Bar {}
@Open class Baz {}

Non-final, Non-abstract classes without the @Open annotation will be marked with an error.

class Bad {}
Bad.java:1: error: [Nopen] Classes should be explicitly marked final, abstract, or @Open
class Bad {}
^

For more information see Item 19 of Effective Java, Third Edition.

Download

Gradle, using net.ltgt.errorprone plugin:

dependencies {
  compileOnly 'com.jakewharton.nopen:nopen-annotations:1.0.1'
  errorprone 'com.jakewharton.nopen:nopen-checker:1.0.1'
}

License

Copyright 2019 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

matchClass
called by 0
nopen-checker/src/main/java/com/jakewharton/nopen/checker/NopenChecker.java

Shape

Class 16
Method 3
Enum 1
Interface 1

Languages

Java100%

Modules by API surface

nopen-checker/src/test/resources/com/jakewharton/nopen/checker/NopenTests.java17 symbols
nopen-checker/src/test/java/com/jakewharton/nopen/checker/NopenCheckerTest.java2 symbols
nopen-checker/src/main/java/com/jakewharton/nopen/checker/NopenChecker.java2 symbols

For agents

$ claude mcp add nopen \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact