You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should it be under any existing known organization, or register a new domain and use reverse-domain naming, or just stake out a new top-level package?
My feeling is definitely not under an existing org, which can bite us on perception of generality. I don't personally know a reason to care between the other two (e.g., who really cared between org.junit and junit?).
Should the idea of being annotations-only be built into the name?
My feeling is no; let .annotations be a subpackage, just in case. Also source files don't feel like they belong in a top-level package anyway.
Should it be a "boring" prosaic descriptive name, or something more codenamey?
I (and Google) tend to prefer the prosaic.
Finally, what should be the dang name :-)
I do like the suggestion of codeanalysis brought up by JetBrains at our last meeting. It seems to capture the right subject matter to me.
I'd prefer not to use concatenated words without any visible separator like codeanalysis which IMHO are hard to read. We could camel-hump or snake-case them, but not sure that'd look nice either.
My personal favorite was at.annotations, org.annotations looks also good.
I personally have never seen it as a very important convention.
What top-level package name to choose.
It should be about the topic area (improving code correctness), not an implementation detail of what kind of content we currently expect to have (e.g. annotations).
Google strongly prefers generic descriptive (read: boring) names that aren't vulnerable to trademark issues.
If multiple words, I think the established convention for package names is to run them together, no caps, no underscores. This may be a reason to avoid multiple words.
What subpackage of our TLP to use for annotations?
Both because we may have other small libraries in the future, and because putting anything directly in your TLP is just weird.
"annotations" seems like the obvious choice
Do nullness annotations go in a further subpackage of that?
I think we'll probably never have more than 25 annotations in this package, and will probably be far short of that for a long time. I think a subpackage would be overstructuring.
Putting it all together, I've been defaulting to codeanalysis.annotations for some time. The run-together words are something of an issue ("co-dean-alys-is"?), but I'm not sure how much of a problem. I will also acknowledge that saying "this is the code analysis annotations project" doesn't exactly inspire a warm and fuzzy feeling.
For me, run-together words seem non-beautiful, but I'm not even a native speaker. If it's OK for those, then why not. I also like abbreviated suggestions by @kevin1e100
AFAICT, the publishing requirements for Maven Central state that your groupIdmust be your reverse domain name (IIRC, groupIds like junit or commons-lang are exceptions from the days of Maven 1):
groupId: the top level namespace level for your project starting with the reverse domain name
Assuming the above requirement is strict, I would prefer that the package also be a reverse-domain name, to ensure that the groupId is a prefix of the package. Everything else is just confusing. (FYI, Eclipse Code Recommenders has a heuristic that tries to guess a groupId from the package, precisely because this is such a common convention.)
Reverse-domain naming has probably saved people from a lot of conflicts between util packages over the years, but I grant that there's probably not going to be another codeanalysis package that's widely used. I think we could get away with it; I'd just rather we not be seen as setting a precedent that reverse-domain naming is unnecessary in general.
That said, we own codeanalysis.info. The reverse-domain package info.codeanalysis is only a little longer, it still avoids tying us to any one company, and it sounds like it would play better with some tools' heuristics. As another example (in addition to the one that @sewe described), we had a weird problem with Dagger's top-level dagger package inside Google [edit: see post-submit discussion on internal CL 108276453]. It wasn't hard to fix -- if you understood what the problem was (the error wasn't clear) and you knew how to fix it. Oh, and the Google Java Style Guide used to require a specific order for packages in imports, which required special configuration in at least one IDE every time a new top-level package appeared. It looks like Android is still this way.
Again, I don't anticipate many problems, and I expect them to be minor, but we have at least a few anecdotes now about tools that assume a "normal" package structure, and it sounds like we'll have to use reverse-domain for our Maven artifact, so maybe we should be putting the burden of proof on the top-level package?
We got both jspecify.dev and jspecify.org. (They don't point anywhere useful yet, but I'm on it.)
I ran a quick search over Google's depot to estimate how much more common org is than dev as a top-level package name. It ratio looks close to 100:1, for what that's worth.
One question that we've considered (such as briefly in this text and at slightly more length in some comment threads) is how much of our specification should go in Javadoc versus how much should go in some separate document. If we decide that we want to put a lot of the spec into Javadoc, then where would it go? Neither @Nullable nor @NullAnnotated nor any other single annotation will be the ideal place for treatment of all the questions we'll need to answer -- substitution rules, glossary entries, etc.
Maybe this is primarily an argument in favor of writing a separate spec, rather than squeezing everything into Javadoc. But if we do want the information in Javadoc, then it seems like it would fit best in a package-info file for a package specific to nullness.
(While I believe it's possible to include arbitrary .html files in the output of Javadoc, I suspect that they aren't as easily visible from IDEs, etc. Then again, I'm unsure how easily visible rendered package-info files are from IDEs :))
I like differentiating from java.lang.annotation, since, as you note, that one doesn't include annotations.
[edit: Err, wait: It totally does contain annotations (and some supporting enums). That said, it also contains the interface Annotation itself, along with some exception types, so it's true that it's more general than just annotations.]
While I have only a small preference when it comers to the package name, I have a slightly larger preference for the jar (and maybe artifact?) name. I guess it feels better to me to have a jar "of annotations" than a jar "of annotation?" And if we use plural for the jar, then I think it makes sense to follow suit for the artifact, package, and module. See also ~2x as many "annotations" artifacts as "annotation" artifacts in Maven Central. [much belated edit: And this search for the popular ones would likely also have been helpful.]
Activity
kevinb9n commentedon Sep 20, 2018
My feeling is definitely not under an existing org, which can bite us on perception of generality. I don't personally know a reason to care between the other two (e.g., who really cared between
org.junitandjunit?).My feeling is no; let
.annotationsbe a subpackage, just in case. Also source files don't feel like they belong in a top-level package anyway.I (and Google) tend to prefer the prosaic.
I do like the suggestion of
codeanalysisbrought up by JetBrains at our last meeting. It seems to capture the right subject matter to me.amaembo commentedon Sep 25, 2018
I'm for
codeanalysisunless there's trademark clash or something.cushon commentedon Sep 26, 2018
+1 to a new top-level package, possibly with a domain. Having an associated domain to host the documentation might be nice.
What examples do we have of non-annotation artifacts so far? I don't see a need to rule that out, but it might still be helpful to enumerate them.
One example could be utilities like the CF's
NullnessUtil#castNonNull.It seemed like the front-runner when I set up the temporary repository :)
One other idea:
org.annotationsdonnerpeter commentedon Sep 26, 2018
I'd prefer not to use concatenated words without any visible separator like
codeanalysiswhich IMHO are hard to read. We could camel-hump or snake-case them, but not sure that'd look nice either.My personal favorite was
at.annotations,org.annotationslooks also good.kevin1e100 commentedon Feb 27, 2019
Couple more to throw out:
coda,canal, andcodex, which are mostly plays on "code analysis".kevinb9n commentedon Jun 26, 2019
Resummarizing key decisions:
Putting it all together, I've been defaulting to
codeanalysis.annotationsfor some time. The run-together words are something of an issue ("co-dean-alys-is"?), but I'm not sure how much of a problem. I will also acknowledge that saying "this is the code analysis annotations project" doesn't exactly inspire a warm and fuzzy feeling.donnerpeter commentedon Jul 2, 2019
For me, run-together words seem non-beautiful, but I'm not even a native speaker. If it's OK for those, then why not. I also like abbreviated suggestions by @kevin1e100
sewe commentedon Aug 8, 2019
AFAICT, the publishing requirements for Maven Central state that your
groupIdmust be your reverse domain name (IIRC,groupIds likejunitorcommons-langare exceptions from the days of Maven 1):Assuming the above requirement is strict, I would prefer that the package also be a reverse-domain name, to ensure that the
groupIdis a prefix of the package. Everything else is just confusing. (FYI, Eclipse Code Recommenders has a heuristic that tries to guess agroupIdfrom the package, precisely because this is such a common convention.)cpovirk commentedon Aug 8, 2019
Reverse-domain naming has probably saved people from a lot of conflicts between
utilpackages over the years, but I grant that there's probably not going to be anothercodeanalysispackage that's widely used. I think we could get away with it; I'd just rather we not be seen as setting a precedent that reverse-domain naming is unnecessary in general.That said, we own
codeanalysis.info. The reverse-domain packageinfo.codeanalysisis only a little longer, it still avoids tying us to any one company, and it sounds like it would play better with some tools' heuristics. As another example (in addition to the one that @sewe described), we had a weird problem with Dagger's top-leveldaggerpackage inside Google [edit: see post-submit discussion on internal CL 108276453]. It wasn't hard to fix -- if you understood what the problem was (the error wasn't clear) and you knew how to fix it. Oh, and the Google Java Style Guide used to require a specific order for packages in imports, which required special configuration in at least one IDE every time a new top-level package appeared. It looks like Android is still this way.Again, I don't anticipate many problems, and I expect them to be minor, but we have at least a few anecdotes now about tools that assume a "normal" package structure, and it sounds like we'll have to use reverse-domain for our Maven artifact, so maybe we should be putting the burden of proof on the top-level package?
kevinb9n commentedon Feb 27, 2020
Per mailing list discussions, the project is being named jspecify. We are registering jspecify.dev and (I think) jspecify.org.
This would give us the choice of the package names
jspecify.annotations
org.jspecify.annotations
dev.jspecify.annotations
cpovirk commentedon Mar 2, 2020
We got both jspecify.dev and jspecify.org. (They don't point anywhere useful yet, but I'm on it.)
I ran a quick search over Google's depot to estimate how much more common
orgis thandevas a top-level package name. It ratio looks close to 100:1, for what that's worth.cpovirk commentedon Apr 15, 2020
I wasn't around for many of the early discussions about the package name, but I want to make at least a weak case in favor of the "overstructuring" of putting the nullness-specific annotations in a subpackage:
One question that we've considered (such as briefly in this text and at slightly more length in some comment threads) is how much of our specification should go in Javadoc versus how much should go in some separate document. If we decide that we want to put a lot of the spec into Javadoc, then where would it go? Neither
@Nullablenor@NullAnnotatednor any other single annotation will be the ideal place for treatment of all the questions we'll need to answer -- substitution rules, glossary entries, etc.Maybe this is primarily an argument in favor of writing a separate spec, rather than squeezing everything into Javadoc. But if we do want the information in Javadoc, then it seems like it would fit best in a
package-infofile for a package specific to nullness.cpovirk commentedon Apr 20, 2020
(While I believe it's possible to include arbitrary .html files in the output of Javadoc, I suspect that they aren't as easily visible from IDEs, etc. Then again, I'm unsure how easily visible rendered package-info files are from IDEs :))
build: introduce Gradle, Errorprone, Spotless and GitHub Actions
Introduce Gradle, Errorprone, Spotless and GitHub Actions
3 remaining items
rename package and module based on kevinb9n's proposal
kevin1e100 commentedon Apr 30, 2020
I guess I'd be partial to dropping the trailing
sto save a letter, otherwise LGTMlazaroclapp commentedon Apr 30, 2020
Vote in favor of
org., no opinion on thes.abreslav commentedon May 1, 2020
org.looks good, no opinion on thes.cpovirk commentedon May 7, 2020
Slight preference for including the
s:java.lang.annotation, since, as you note, that one doesn't include annotations.Annotationitself, along with some exception types, so it's true that it's more general than just annotations.]kevinb9n commentedon May 7, 2020
[-]Decide final package name[/-][+]Decide final package name (resolved: org.jspecify.annotations)[/+]Rename package and module, to prepare for install and deploy (#107)
[-]Decide final package name (resolved: org.jspecify.annotations)[/-][+]Decide final package name[/+]Create org.jspecify.nullness, and move the contents of org.jspecify.a…
cpovirk commentedon Mar 12, 2021
As noted in #160, we've changed course to
org.jspecify.nullnessfor nullness annotations, with other packages to be named as we create them.kluever commentedon Jul 22, 2024
Just to close the loop, the final decision that shipped in JSpecify v1.0.0 was
org.jspecify.annotations.