javax-extras

Extra utilities for javax

License

License

GroupId

GroupId

com.uber.javaxextras
ArtifactId

ArtifactId

javax-extras
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

javax-extras
Extra utilities for javax
Project URL

Project URL

https://github.com/uber-common/javax-extras/
Source Code Management

Source Code Management

https://github.com/uber-common/javax-extras/

Download javax-extras

How to add to project

<!-- https://jarcasting.com/artifacts/com.uber.javaxextras/javax-extras/ -->
<dependency>
    <groupId>com.uber.javaxextras</groupId>
    <artifactId>javax-extras</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.uber.javaxextras/javax-extras/
implementation 'com.uber.javaxextras:javax-extras:0.1.0'
// https://jarcasting.com/artifacts/com.uber.javaxextras/javax-extras/
implementation ("com.uber.javaxextras:javax-extras:0.1.0")
'com.uber.javaxextras:javax-extras:jar:0.1.0'
<dependency org="com.uber.javaxextras" name="javax-extras" rev="0.1.0">
  <artifact name="javax-extras" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.uber.javaxextras', module='javax-extras', version='0.1.0')
)
libraryDependencies += "com.uber.javaxextras" % "javax-extras" % "0.1.0"
[com.uber.javaxextras/javax-extras "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 3.0.2

Project Modules

There are no modules declared in this project.

DEPRECATED

JSR 305 annotations are not compatible with the Java 9 module system. We recommend using Jetbrains' annotations artifact or (if on Android) the support library annotations.

javax-extras

Extra utilities for javax

Why a separate artifact?

Aside from reuse - the recommend scope to use this library in is compileOnly or provided. Modern tooling will recognize annotations in bytecode, and allows you to depend on this in a way that allows tooling to leverage it without bundling it as a part of your library/API.

Related reading: https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111

What's available?

EverythingIsNonNullByDefault

  • The nuclear option: Everything is NonNull by default. This includes method fields, method return types, method parameters, and local variables.

FieldsMethodsAndParametersAreNonNullByDefault

  • This includes fields, method return types, and method parameters.

MethodsAndParametersAreNonNullByDefault

  • This includes method return types and method parameters.

ParametersAreNonnullByDefault

  • Is already in the jsr305 findbugs package this depends on. Use it :)

Others

We're open to suggestions! Feel free to open an issue or propose in a PR.

Proguard

As mentioned above, the recommended configuration for javax-extras annotations is compileOnly or provided scope. This can cause warning in proguard though. Our recommendation is to mark them as -dontwarn, as the annotations are only CLASS-retained and not in danger of runtime classloader issues.

-dontwarn com.uber.javaxextras.**

Download

Maven Central

compileOnly 'com.uber.javaxextras:javax-extras:x.y.z'

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright (C) 2017 Uber Technologies

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.
com.uber.javaxextras

Uber Common

Uber's open source utility libraries

Versions

Version
0.1.0