instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uber-go__zap__185 | uber-go/zap | 185 | defect | 5c7c5002f484c5062d2e7ec0ba3ca08773c0692d | f721f6d505386f66d497efcf3b7a82622404cf59 | Add SugaredLogger | This PR carries forward the work that @akabos did in #147. Once complete, this will resolve #138.
Relevant benchmarks for logrus, the regular zap logger, and the sugared logger:
```
BenchmarkLogrusAddingFields-4 100000 10219 ns/op 5726 B/op 77 allocs/op
BenchmarkLogrusW... | diff --git a/benchmarks/zap_sugar_bench_test.go b/benchmarks/zap_sugar_bench_test.go
new file mode 100644
index 000000000..405e6b17b
--- /dev/null
+++ b/benchmarks/zap_sugar_bench_test.go
@@ -0,0 +1,150 @@
+// Copyright (c) 2016 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person... | 7 | 4 | 2 | [{"id": "G0", "claim": "The new WithStack method should be reworked as WithCallers, adding a complete structured caller trace to the context under the key \"callers\" via a Callers() field.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The API should ke... | null |
uber-go__zap__197 | uber-go/zap | 197 | defect | 2a8f287b5620c77c427ac78d29bda4af737f2f00 | 5febc998ddaba1957f2b923e342edc3d90fe0fdd | Convert DFatal => DPanic(Level) | Fixes #175.
Doing this ahead of coming interface-pocalypse discused with @akshayjshah et al (mentioned in the tabled #194). | diff --git a/checked_message.go b/checked_message.go
index f654e4187..1d6623926 100644
--- a/checked_message.go
+++ b/checked_message.go
@@ -55,14 +55,14 @@ func NewCheckedMessage(logger Logger, lvl Level, msg string) *CheckedMessage {
}
// Write logs the pre-checked message with the supplied fields. It will call
-... | 4 | 3 | 1 | [{"id": "G0", "claim": "The DPanicLevel doc comment in level.go would be clearer reworded to say that DPanicLevel logs are particularly important errors and that in development the logger panics after writing the message.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {... | null |
uber-go__zap__250 | uber-go/zap | 250 | defect | 64245ad20f34374f5fd8984221ac68468e9ec6a0 | 40713ddb4275e67dee17312354df06624a0ade27 | Add support for named loggers | This resolves #130. | diff --git a/logger.go b/logger.go
index b3f0cf653..c375a7b29 100644
--- a/logger.go
+++ b/logger.go
@@ -24,6 +24,7 @@ import (
"fmt"
"os"
"runtime"
+ "strings"
"time"
"go.uber.org/zap/zapcore"
@@ -31,19 +32,26 @@ import (
func defaultEncoderConfig() zapcore.JSONConfig {
msgF := func(msg string) zapcor... | 2 | 1 | 0 | [{"id": "G0", "claim": "Instead of always joining the logger name with `.` inside Named, pass the name around as a []string and let the NameFormatter decide how to turn it into a zapcore.Field.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Replace the fie... | null |
uber-go__zap__289 | uber-go/zap | 289 | defect | 354dbf48220425b1d30a531dd1cd6cf6bd02329b | d807d7506bc1e22e30fda40e4f3adb5d9b43af0e | Fix allocation when returning []byte to pool | In order to pool byte slices without incurring an allocation (by casting into
`interface{}`), we need to switch to using a pointer type. The natural candidate
is the standard library's `bytes.Buffer`; it's a bit slower than straight
slices, but that's probably okay. However, we use `strconv.AppendFloat` and
friends... | diff --git a/Makefile b/Makefile
index 4258d2377..9368c9022 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ export GO15VENDOREXPERIMENT=1
BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem
PKGS ?= $(shell glide novendor)
# Many Go tools take file globs or directories as arguments instead of pa... | 6 | 1 | 0 | [{"id": "G0", "claim": "The internal/bufferpool package may not need to exist as its own package; `buffer.Get` and `buffer.Put` seem OK.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The redundant cast of `i` (already an int64) to int64 in AppendInt shoul... | null |
uber-go__zap__307 | uber-go/zap | 307 | defect | 066278dd4c1dedb5aa4dbc4a79df2651401810fd | eb220a021f59bfa136bfed16f3afbcfcc8ff3eb9 | Add colored LevelEncoders | Add a small internal package to handle TTY output coloring, and use that package to define some color-aware LevelEncoders.
Fixes #234.

| diff --git a/config.go b/config.go
index 14ca99a73..b2e7f79b9 100644
--- a/config.go
+++ b/config.go
@@ -129,7 +129,7 @@ func NewDevelopmentConfig() Config {
CallerKey: "C",
MessageKey: "M",
StacktraceKey: "S",
- EncodeLevel: zapcore.CapitalLevelEncoder,
+ EncodeLevel: zapcore.ColoredCap... | 7 | 7 | 4 | [{"id": "G0", "claim": "The colored level encoders should avoid allocating on every call: use `Sprintf` instead of `Sprint` and cache the colorized (lowercase and capitalized) strings for the known levels.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim... | null |
uber-go__zap__325 | uber-go/zap | 325 | defect | 75282a0f3362b28d20e988351ed788e0b5f6583a | bd30b7e4aefd987602b23041c8a7495621340945 | Support non-standard, rich error types | Users who take the time (and performance hit) of using Dave Cheney's errors
package should get rich, annotated errors and stacktraces in their logs.
However, that package is only one of a number of similar packages and hasn't yet
committed to a stable API, so we don't want to take a direct dependency on it.
To su... | diff --git a/glide.lock b/glide.lock
index 6361e4e99..e3fbbde12 100644
--- a/glide.lock
+++ b/glide.lock
@@ -1,8 +1,8 @@
-hash: a388f2aa2d844ff734fe0e8d309d1b67166f8434c1d331242c162bf92923ce5f
-updated: 2017-02-15T11:47:26.561157555-08:00
+hash: 914c2496c3082b58188a9d2417ff56745ab9699c391e74bf0dcb18bac732fcd2
+updated:... | 2 | 2 | 1 | [{"id": "G0", "claim": "Putting the error message and the verbose/stacktrace output under a single key makes filtering on the error alone harder (e.g. in ELK); the `error` key should always hold just the error message, with the verbose representation in a second field when the type implements fmt.Formatter.", "category... | null |
uber-go__zap__333 | uber-go/zap | 333 | defect | c55503708841efe770d8fe5ae3817004ce71411f | 4a27f010b45d8081f7f678ee5a27ee4d1b770be0 | Further error-logging improvements | First, add support for customizing error fields' keys; now that we support rich errors, we can't simply rely on string fields.
Second, use that support in `Any` and `Errors`. This should complete our support for `github.com/pkg/errors`.
Fully resolves #303. | diff --git a/array.go b/array.go
index 7052eb1ff..20305a07c 100644
--- a/array.go
+++ b/array.go
@@ -21,11 +21,16 @@
package zap
import (
+ "sync"
"time"
"go.uber.org/zap/zapcore"
)
+var _errArrayElemPool = sync.Pool{New: func() interface{} {
+ return &errArrayElem{}
+}}
+
// Array constructs a field with... | 3 | 2 | 0 | [{"id": "G0", "claim": "Remove the extra blank line before the closing brace of errArrayElem.MarshalLogObject.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Add a test which also exercises the errorVerbose output for rich errors in error arrays... | null |
uber-go__zap__386 | uber-go/zap | 386 | defect | 4257c7cf05477d92ec25c31cfd3d60e89575f18a | 94fac96428b632f6f67ba56d4dd76dc0eb5c7bc5 | zaptest/observer: Support filtering by message or field | Add `Filter*` functions to filter a set of ObservedLogs and return
a new set of ObservedLogs. This allows chaining of multiple filters
such as `sink.FilterMessage(..).FilterField(..)` for easier use in
tests.
Fixes #383 | diff --git a/zaptest/observer/observer.go b/zaptest/observer/observer.go
index 0f6462d3d..781133f9b 100644
--- a/zaptest/observer/observer.go
+++ b/zaptest/observer/observer.go
@@ -80,6 +80,39 @@ func (o *ObservedLogs) AllUntimed() []LoggedEntry {
return ret
}
+// FilterMessage filters entries to those that have t... | 1 | 1 | 1 | [{"id": "G0", "claim": "FilterField should drop the explicit key comparison and return true as soon as any field in the entry's context equals the filter field, so entries with multiple fields sharing the same key (e.g. via zap.Namespace) still match.", "category": "correctness", "verdict": "supported", "priority": "P1... | null |
uber-go__zap__396 | uber-go/zap | 396 | defect | 7cb1af25c667ffc545ab09add063672a602be547 | f84f3ac6e74b1929b2e2bf42512e34e52e857080 | Open should only return close on success | Config assumes that Open will always return a close function
which causes a panic when Open returns an error, since it doesn't
return a close function.
We can instead clean up the assumption that we return partial values
on error, and instead use a more common pattern:
- On success, `err == nil` and all other r... | diff --git a/config.go b/config.go
index a198f16ea..cdd251981 100644
--- a/config.go
+++ b/config.go
@@ -217,13 +217,11 @@ func (cfg Config) buildOptions(errSink zapcore.WriteSyncer) []Option {
func (cfg Config) openSinks() (zapcore.WriteSyncer, zapcore.WriteSyncer, error) {
sink, closeOut, err := Open(cfg.OutputPat... | 1 | 1 | 0 | [{"id": "G0", "claim": "The wantErr field of the test struct in TestOpenFails is not used anywhere and can be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber-go__zap__751 | uber-go/zap | 751 | defect | 0065243e7bbd958fab35324e41201f5eb682c527 | 3c1997736a08accc5bb9d8eedbcf511812c3a851 | Add support for Go modules | This switches Zap to using Go modules instead of Glide for managing
dependencies, while keeping the glide.yaml around to provide
constraints for legacy ecosystems.
The change ended up being more complicated than a `go mod init` because
Zap has a few tests that verify its behavior inside `GOPATH` and a
vendor/ di... | diff --git a/.gitignore b/.gitignore
index 08fbde6ce..50fe6d857 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,7 @@ _testmain.go
*.pprof
*.out
*.log
+
+/bin
+profile.out
+cover.html
diff --git a/.travis.yml b/.travis.yml
index ada5ebdcc..635b5cd07 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,13 @@
... | 4 | 4 | 0 | [{"id": "G0", "claim": "Lint gating should be controlled via LINT=yes in .travis.yml so that lint versions are decided in the same place as the Go versions tested against, instead of by LINTABLE_MINOR_VERSIONS in the Makefile.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {... | null |
uber-go__zap__758 | uber-go/zap | 758 | defect | a6015e13fab9b744d96085308ce4e8f11bad1996 | 606e9d7eba3764f3c69792e23caaee9ba1337572 | Allow representations of nillable primitive field values | Fixes #753 by exporting util functions to handle nillable primitives. The version here uses `Reflect()` under the hood to encode `nil`, and makes corresponding changes in `json_encoder.go` to efficiently handle encoding `nil` field values. | diff --git a/buffer/buffer.go b/buffer/buffer.go
index 7592e8c63..2b292c762 100644
--- a/buffer/buffer.go
+++ b/buffer/buffer.go
@@ -44,6 +44,11 @@ func (b *Buffer) AppendString(s string) {
b.bs = append(b.bs, s...)
}
+// AppendBytes appends a byte slice to the Buffer.
+func (b *Buffer) AppendBytes(bs []byte) {
+ ... | 2 | 2 | 0 | [{"id": "G0", "claim": "Do not add a new public Buffer.AppendBytes method; the existing Write suffices at the call site (zapcore should not grow public surface unnecessarily).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Apply the same nil-to-null-lite... | null |
uber-go__zap__775 | uber-go/zap | 775 | defect | 66bdb5be13b81467a46a87a3766a9c908eeea6dd | b7c0c883d8b1a21f56f5d5744703cbc20683f6f6 | Add option to increase the level of a logger | We've had a few requests on how to change the level of a logger. With
the current APIs, it's not possible to reduce the log level (e.g., go
from Info to Debug), but it is possible to increase the level using
`WrapCore` with a custom filtering core.
Since it's a common request, I think we should add an option to m... | diff --git a/logger_test.go b/logger_test.go
index a9f705788..e6b0d96e7 100644
--- a/logger_test.go
+++ b/logger_test.go
@@ -392,6 +392,21 @@ func TestLoggerReplaceCore(t *testing.T) {
})
}
+func TestLoggerIncreaseLevel(t *testing.T) {
+ withLogger(t, DebugLevel, opts(IncreaseLevel(WarnLevel)), func(logger *Logger... | 4 | 4 | 1 | [{"id": "G0", "claim": "The new API name NewLevelCore does not imply that it can only increase levels; it needs a similar name that implies increasing levels only.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "There should be a way to guard against atte... | null |
uber-go__zap__786 | uber-go/zap | 786 | defect | 127ea09767984a610aa6a53141f271b35f975ddb | 19424758e8aaf33e6e5a06a9cde9b55d460d19df | Use Time.AppendFormat when possible | Fixes #783.
We can take advantage of Time.AppendFormat by adding a new exported
method to the JSON encoder, and upcasting when encoding time to use
the append-based method. This avoids an allocation to convert the time
to a string before appending to the buffer.
The benchmarks use the production config, which ... | diff --git a/buffer/buffer.go b/buffer/buffer.go
index 7592e8c63..3f4b86e08 100644
--- a/buffer/buffer.go
+++ b/buffer/buffer.go
@@ -23,7 +23,10 @@
// package's zero-allocation formatters.
package buffer // import "go.uber.org/zap/buffer"
-import "strconv"
+import (
+ "strconv"
+ "time"
+)
const _size = 1024 // ... | 2 | 1 | 1 | [{"id": "G0", "claim": "Export the new appendTimeEncoder interface, since it will become part of the contract for custom encoders, or alternatively document on the ISO8601, RFC3339, and RFC3339Nano time encoders that AppendTimeLayout is used when an encoder implements the interface.", "category": "design", "verdict": "... | null |
uber-go__zap__791 | uber-go/zap | 791 | defect | c89bd3c833f56cad3bc6dfa104b9c6d144526145 | 0385f6c201618390f1179e8b7776b21bd9e7dd38 | EncoderConfig and AtomicLevel validation added | Resolves #777 | diff --git a/config.go b/config.go
index 6fe17d9e0..e1cd7087d 100644
--- a/config.go
+++ b/config.go
@@ -174,6 +174,13 @@ func (cfg Config) Build(opts ...Option) (*Logger, error) {
return nil, err
}
+ if cfg.Level == (AtomicLevel{}) {
+ cfg.Level = NewAtomicLevelAt(InfoLevel)
+ if cfg.Development {
+ cfg.Lev... | 4 | 3 | 2 | [{"id": "G0", "claim": "The parentheses around AtomicLevel{} in the added zero-value check are unnecessary and should be dropped.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Config.Build should return an error for an unspecified Level (and buil... | null |
uber-go__zap__804 | uber-go/zap | 804 | defect | f994215a7b136a32fc6605fba57edb859983a497 | e48bc3efd66420e704a7e5209426784ab9f7c08a | Fix handling of Time values out of UnixNano range | Fixes #737, #803.
Time values are encoded by storing the UnixNano representation, but this
fails when the value of UnixNano is out of int64 range, see docs:
https://golang.org/pkg/time/#Time.UnixNano
> The result is undefined if the Unix time in nanoseconds cannot be
represented by an int64 (a date before the ... | diff --git a/field.go b/field.go
index 83c1ea245..7d65f33e6 100644
--- a/field.go
+++ b/field.go
@@ -32,6 +32,11 @@ import (
// improves the navigability of this package's API documentation.
type Field = zapcore.Field
+var (
+ _minTimeInt64 = time.Unix(0, 0)
+ _maxTimeInt64 = time.Unix(0, math.MaxInt64)
+)
+
// Sk... | 4 | 3 | 2 | [{"id": "G0", "claim": "Introducing a new Type enum value (TimeFullType) may not be okay and could break callers who only handle known Type values; the reviewer asks whether it would make sense instead to store an invalid value like -1 in the integer field to indicate that the Interface field is set.", "category": "des... | null |
uber-go__zap__897 | uber-go/zap | 897 | defect | a68efdbdd15b7816de33cdbe7e6def2a559bdf64 | 8c20a9bd2a1081272eb2c8209f0fb85935ee9383 | Add WithClock Option | Allow passing current time source.
Fix #694 | diff --git a/logger.go b/logger.go
index bdcc5d666..e5741cc4f 100644
--- a/logger.go
+++ b/logger.go
@@ -51,6 +51,9 @@ type Logger struct {
addStack zapcore.LevelEnabler
callerSkip int
+
+ // now returns current time, default is time.Now.
+ now func() time.Time
}
// New constructs a new Logger from the provid... | 5 | 4 | 3 | [{"id": "G0", "claim": "The new test file's license header copyright year reads 2016 and should be updated to 2020.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The time source should be a Clock interface with a WithClock(Clock) Option instead o... | null |
uber-go__zap__912 | uber-go/zap | 912 | defect | a68efdbdd15b7816de33cdbe7e6def2a559bdf64 | 248b2a44e7304a9ee80a9e8d1696ce743b9fc0e1 | Support multi-field encoding using zap.Inline | Fixes #876
Currently, a `zap.Field` can only represent a single key-value. Add
`zap.Inline` to allow adding multiple fields to the current
namespace from a type implementing `zap.ObjectMarshaler`.
This also solves a more general problem: a single `zap.Field` can now
be used to add multiple key/value pairs. | diff --git a/example_test.go b/example_test.go
index ab5733f45..0ca4a4e56 100644
--- a/example_test.go
+++ b/example_test.go
@@ -165,6 +165,29 @@ func ExampleNamespace() {
// {"level":"info","msg":"tracked some metrics","metrics":{"counter":1}}
}
+type request struct {
+ URL string
+ IP string
+}
+
+func (r reque... | 3 | 3 | 2 | [{"id": "G0", "claim": "A test is needed somewhere to verify how InlineObject behaves when used inside an object, e.g. via InlineObject(...).AddTo(enc) within a MarshalLogObject.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The InlineObject function s... | null |
uber-go__zap__948 | uber-go/zap | 948 | defect | 374825111f7fc2fca60d36daeb8d656c3bc5d40a | 96bbcb2463891fd6bbc41d80f4821650705aca68 | Add NewTicker to the Clock Interface | Changes in this diff:
- Move Clock interface to zapcore and re-exported from the top-level zap package
- Add NewTicker method as part of Clock Interface
With this changes Clock interface will be available inside of zapcore and the NewTicker method will allow us to control time.Ticker when it is necessary.
T... | diff --git a/clock.go b/clock.go
index 7d0e574ed..c19a40246 100644
--- a/clock.go
+++ b/clock.go
@@ -20,13 +20,14 @@
package zap
-import "time"
+import (
+ "time"
+
+ "go.uber.org/zap/zapcore"
+)
// Clock is a source of time for logged entries.
-type Clock interface {
- // Now returns the current local time.
- ... | 5 | 4 | 2 | [{"id": "G0", "claim": "The zap-level Clock type should be dropped or, if kept, declared as a type alias so it resolves to zapcore.Clock instead of being a distinct type.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "It would help to include a test/mock... | null |
uber-go__zap__971 | uber-go/zap | 971 | defect | aa3e73ec0896f8b066ddf668597a02f89628ee50 | 0072bc45abed55690b129fa5c10798dc2ead4e39 | Add zapio.Writer | This adds a new zapio package that provides a `Writer`. The writer
implements `io.WriteCloser` and `zapcore.WriteSyncer`.
It works by splitting the input on newlines, flushing to the logger as
new lines are encountered, and buffering input otherwise.
So for example, if write "foobar\n" is split across multiple ... | diff --git a/zapio/writer.go b/zapio/writer.go
new file mode 100644
index 000000000..8c367d7f2
--- /dev/null
+++ b/zapio/writer.go
@@ -0,0 +1,108 @@
+// Copyright (c) 2021 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated doc... | 7 | 2 | 1 | [{"id": "G0", "claim": "When the buffer is empty, the contents could be written directly to the logger instead of being copied into w.buff first (optional performance optimization).", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Using a strings.Buil... | null |
uber__AutoDispose__107 | uber/AutoDispose | 107 | defect | a4df0f89d2053c1e07f03614170694646c8653c9 | ba7487c4a79a9ace9a19d758f571434acb872b9f | Add untilEvent overload for AndroidLifecycleScopeProvider#from | <!--
Thank you for contributing to AutoDispose. Before pressing the "Create Pull Request" button, please consider the following points.
Feel free to remove any irrelevant parts that you know are not related to the issue.
Any HTML comment like this will be stripped when rendering markdown, no need to delete them.
--... | diff --git a/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/lifecycle/AndroidLifecycleScopeProviderTest.java b/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/lifecycle/AndroidLifecycleScopeProviderTest.java
index 9e9b44e0b..f0f44a84f 100644
---... | 2 | 2 | 0 | [{"id": "G0", "claim": "The minor fixes mentioned in the pull request description (\"I also fixed minor issues I found while scanning through the code\") should be called out, perhaps in comments.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The... | null |
uber__AutoDispose__138 | uber/AutoDispose | 138 | defect | 2ec7f8e7b62c47c34f3604f545234447a43ae8cf | e7e1b87926abb2f944d0c6f9e4a87d16837dec36 | Incorporate feedback from #130 | This PR incorporates feedback from #130, but it not currently complete yet. CC @akarnokd whenever you have time to review (no rush!)
## Completed
> AutoDisposePlugins.java#L36: Such lockdown support may not be desirable on Android. The same feature was aimed at server/J2EE container use of RxJava.
Mentioned in... | diff --git a/android/autodispose-android-archcomponents/src/main/java/com/uber/autodispose/android/lifecycle/LifecycleEventsObservable.java b/android/autodispose-android-archcomponents/src/main/java/com/uber/autodispose/android/lifecycle/LifecycleEventsObservable.java
index 3efcd4a8d..0844b36c7 100644
--- a/android/aut... | 5 | 5 | 5 | [{"id": "G0", "claim": "In LifecycleEventsObservable.subscribeActual, if the Observer disposes immediately, the code still adds the observer as a lifecycle listener and keeps a reference to it, so it should check isDisposed after the add and call removeObserver.", "category": "correctness", "verdict": "supported", "pri... | null |
uber__AutoDispose__155 | uber/AutoDispose | 155 | defect | bd4b912ab932867646bd17cc09273e7552a43e34 | fa777902b6629f206c0acf321672b41ef3994051 | Parallel flowable support | Closes #142 | diff --git a/autodispose-kotlin/src/main/kotlin/com/uber/autodispose/kotlin/autodispose.kt b/autodispose-kotlin/src/main/kotlin/com/uber/autodispose/kotlin/autodispose.kt
index 5244bd6f7..6455d3897 100644
--- a/autodispose-kotlin/src/main/kotlin/com/uber/autodispose/kotlin/autodispose.kt
+++ b/autodispose-kotlin/src/ma... | 6 | 4 | 2 | [{"id": "G0", "claim": "The ParallelFlowableConverter entry in AutoDisposeConverter's extends clause should be moved next to FlowableConverter in the declaration.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Since it will never be used with to... | null |
uber__AutoDispose__156 | uber/AutoDispose | 156 | defect | c1802368a0a6e3e8070cee2d185f578911487538 | f00166185088ac7a1ef28b89beb5af20f4236013 | Error prone check added to check unbinded subscriptions | This is a copy of the check from [Uber/Ribs](https://github.com/uber/RIBs) with 2 major differences:
1. Support for 3rd party libraries like Ribs and Conductor via error-prone flag -XepOpt:AutoDisposeLeakCheck.
2. Added support for the new `as` based API.
Things to do:
1. It still doesn't include matcher for `P... | diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 4af5a9d4a..e2eeadd48 100755
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -24,6 +24,10 @@ def versions = [
support: '26.1.0'
]
+def apt = [
+ autoService : "com.google.auto.service:auto-service:1.0-rc3",
+]
... | 34 | 31 | 3 | [{"id": "G0", "claim": "The new `apt` block in gradle/dependencies.gradle should be formatted to match the rest of the file's style.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The autoService dependency should be bumped from 1.0-rc3 to the r... | null |
uber__AutoDispose__160 | uber/AutoDispose | 160 | defect | 75f28081c133b2f1a339e3407af7631bc1064b5b | 2a74367b815d56cecca58f6c91a15ff68eb8760b | Test methods in subscribe proxies | Closes #137 | diff --git a/autodispose/src/main/java/com/uber/autodispose/CompletableScoper.java b/autodispose/src/main/java/com/uber/autodispose/CompletableScoper.java
index d4a865a36..a59cb3b7d 100644
--- a/autodispose/src/main/java/com/uber/autodispose/CompletableScoper.java
+++ b/autodispose/src/main/java/com/uber/autodispose/Co... | 1 | 1 | 0 | [{"id": "G0", "claim": "The javadocs of the new test() methods in the subscribe proxies should be changed to match the style of the other methods in the proxies and link the corresponding upstream methods they mirror.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__AutoDispose__183 | uber/AutoDispose | 183 | defect | c740cf4b95c53c4a3c58875a93cefb7d7f6ca7f4 | 15adcba5b0b640182ccb474752c6d7f26c51f621 | AutoDisposeAndroidPlugins (and main thread checker hook) | Resolves #181
This introduces a new plugins mechanism for Android use via `AutoDisposeAndroidPlugins`. The first plugin is a hook for main thread checks, which will allow for supplying a custom `BooleanSupplier` impl that can customize how main thread checks work. The conventional use case of this is Android JUnit ... | diff --git a/README.md b/README.md
index 09dbd5ded..92414c58d 100755
--- a/README.md
+++ b/README.md
@@ -118,6 +118,26 @@ If you have your own handling of exceptions in lifecycle boundary events, you ca
`AutoDisposePlugins#setFillInOutsideLifecycleExceptionStacktraces` to `false`. This will result in
AutoDispose `no... | 3 | 2 | 0 | [{"id": "G0", "claim": "The NullPointerException message \"defaultChecker == null\" should be worded \"defaultChecker must not be null\" as better practice for exception wording.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The local variable ... | null |
uber__AutoDispose__190 | uber/AutoDispose | 190 | defect | 9823eb08b766bb4060df376567959acb3e855d50 | 39ba40f0c06146fba2a6b02b568b04acd3d4f0d7 | Update to AGP 3.1.0 final | This is a long awaited update to AGP 3.x. We had to skip 3.0 because it had gradle classpath issues and we didn't want to pollute the root build.gradle file with a bunch of plugins.
This PR does the following:
* Updates to AGP 3.1.0
* Updates dependencies to respective `api`, `implementation`, and `compileOnly` de... | diff --git a/android/autodispose-android-archcomponents-kotlin/build.gradle b/android/autodispose-android-archcomponents-kotlin/build.gradle
index d948b8aa1..16e9f170c 100644
--- a/android/autodispose-android-archcomponents-kotlin/build.gradle
+++ b/android/autodispose-android-archcomponents-kotlin/build.gradle
@@ -37,... | 2 | 2 | 1 | [{"id": "G0", "claim": "Expected that CI (the instrumentation tests ZacSweers predicted would break on CI) will get fixed before this pull request is merged.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "AGP has version 3.1.2 available now (bumping... | null |
uber__AutoDispose__196 | uber/AutoDispose | 196 | defect | 1f8887d23918ef9a416c289bf1fd255e538eed98 | a1bad5652b729e4e22be1b233a34bdc1f6ddaac3 | Match >= for compareTo if lifecycle events are Comparable | Resolves #192, this checks if the lifecycle even type is comparable and uses it in comparison checking. This works for enums as a convention, I can't think of any examples that don't abide by this, but also allows for overriding the behavior if necessary. The idea here is that if we target end event "B" from start even... | diff --git a/android/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/lifecycle/AndroidLifecycleScopeProviderTest.java b/android/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/lifecycle/AndroidLifecycleScopeProviderTest.java
index 22dadb7bd..9ac0... | 1 | 1 | 0 | [{"id": "G0", "claim": "Match the end event with compareTo instead of enum ordinal, since all java enums implement Comparable, so the >= behavior works by default and consumers can provide their own comparison for custom enum events.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced... | null |
uber__AutoDispose__308 | uber/AutoDispose | 308 | defect | f430cd74200dd18161b7b8476f5e1f7deee70454 | db6919c059980c87e2e120b1d8e4ac8540df32a4 | Make error-prone checker add custom scopes to default scopes | This adds a new flag `isScopeExclusive` (open to suggestions) that will make the classes supplied in `TypesWithScope` exclusive and will only perform the check on those classes.
In the absence of that flag, we will *add* the custom scope classes to the `DEFAULT_CLASSES_WITH_LIFECYCLE` instead of ignoring the defaul... | diff --git a/static-analysis/autodispose-error-prone/src/main/java/com/uber/autodispose/errorprone/UseAutoDispose.java b/static-analysis/autodispose-error-prone/src/main/java/com/uber/autodispose/errorprone/UseAutoDispose.java
index 9f26c5b83..3b62faa36 100644
--- a/static-analysis/autodispose-error-prone/src/main/java... | 7 | 7 | 0 | [{"id": "G0", "claim": "The flag name `IsScopeExclusive` is a misnomer since there can be multiple scopes, and the PR author was open to other names; rename it (ZacSweers proposed `OverrideScopes`).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": ... | null |
uber__AutoDispose__41 | uber/AutoDispose | 41 | defect | 35fe0e9848c562c6fc21ee40d86e9ccb339b6652 | 93e4073b5e13b7bcdc18c927f1ac6561d17851ef | Documentation pass | Resolves #9
Plus a couple other minor nits and better namings | diff --git a/README.md b/README.md
index bb306c369..00b1705ec 100755
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ corresponding events are for the current lifecycle state (e.g. `ATTACH` -> `DETA
you to enforce lifecycle boundary requirements, and by default will error if the lifecycle has either
not started yet ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The AutoDispose entry-point javadoc should mention ScopeProvider, since using ScopeProvider should be encouraged over inline Maybe creation everywhere.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ScopeUtil documentat... | null |
uber__AutoDispose__433 | uber/AutoDispose | 433 | defect | 6f1353795a25a99a5b6d97220547f1c003d5eea2 | d6ec4e69e045bb06d5ee8fd6f65b6b677c0dbe9f | Deprecate TestLifecycleOwner | In favor of the androidx 1st party alternative - https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:lifecycle/lifecycle-runtime-testing/src/main/java/androidx/lifecycle/testing/TestLifecycleOwner.kt
<!--
Thank you for contributing to AutoDispose. Before pressing the "Create Pull Reque... | diff --git a/android/autodispose-androidx-lifecycle-test/Module.md b/android/autodispose-androidx-lifecycle-test/Module.md
index 5021b801b..8591b1172 100644
--- a/android/autodispose-androidx-lifecycle-test/Module.md
+++ b/android/autodispose-androidx-lifecycle-test/Module.md
@@ -1,3 +1,3 @@
# Module autodispose-andro... | 4 | 4 | 1 | [{"id": "G0", "claim": "The default initialState of androidx.lifecycle.testing.TestLifecycleOwner is Lifecycle.State.STARTED, so the tests should construct it with `new TestLifecycleOwner(Lifecycle.State.INITIALIZING)` when they want to manually move through each lifecycle state — and the same applies to all other uses... | null |
uber__AutoDispose__48 | uber/AutoDispose | 48 | defect | 0e0823b4d880bf29df0549b911beb04b5c93143c | 7493c39a5f590c95491ded66de2c773e1d84160f | Adding TestLifecycleScopeProvider. | https://github.com/uber/AutoDispose/issues/45
This isn't quite ready for merging, but I wanted to open a PR to discuss the API for `TestLifecycleScopeProvider`. | diff --git a/autodispose-test/build.gradle b/autodispose-test/build.gradle
new file mode 100755
index 000000000..14441a093
--- /dev/null
+++ b/autodispose-test/build.gradle
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017. Uber Technologies
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may ... | 3 | 2 | 0 | [{"id": "G0", "claim": "The `default:` branch of the corresponding-events switch that throws IllegalStateException for unknown lifecycle events can be removed and the exception just thrown at the end of the switch.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "... | null |
uber__AutoDispose__49 | uber/AutoDispose | 49 | defect | 3e2c0c327cf05a5500d0a14d821c25201991d665 | 7d6096614e15038c84ff5c1c401856eef4780d36 | TestScopeProvider + build fixes | This introduces `TestScopeProvider` + fixes some build issues | diff --git a/autodispose/src/main/java/com/uber/autodispose/TestLifecycleScopeProvider.java b/autodispose/src/main/java/com/uber/autodispose/TestLifecycleScopeProvider.java
index b01acfb16..97959f68f 100644
--- a/autodispose/src/main/java/com/uber/autodispose/TestLifecycleScopeProvider.java
+++ b/autodispose/src/main/j... | 2 | 2 | 2 | [{"id": "G0", "claim": "It never matters what value emit(Object) emits, so the reviewer sees no good use case for that API and questions it.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The two emitError() APIs are not very useful and almost suggest te... | null |
uber__AutoDispose__57 | uber/AutoDispose | 57 | defect | c7db290013e1815d52cc6d174edee3bfd8a69cff | 03c9e680a4b7b1a685441f6e0c207d671eadaa20 | Add plugin API for handling OutsideLifecycleExceptions. | (Addresses https://github.com/uber/AutoDispose/issues/52)
The API is very similar to RxJavaPlugins.
One thing I'm a bit concerned about here - if you're providing your own `ScopeProvider` or `LifecycleScopeProvider`, you need to either manually use `ScopeUtil` or manually call the plugin yourself before throwing ... | diff --git a/autodispose/src/main/java/com/uber/autodispose/AutoDisposePlugins.java b/autodispose/src/main/java/com/uber/autodispose/AutoDisposePlugins.java
new file mode 100644
index 000000000..1bac371a6
--- /dev/null
+++ b/autodispose/src/main/java/com/uber/autodispose/AutoDisposePlugins.java
@@ -0,0 +1,102 @@
+/*
+ ... | 9 | 8 | 4 | [{"id": "G0", "claim": "The AutoDisposePlugins utility class should be declared final.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The lockdown javadoc should put the text on its own line and drop the closing paragraph marker.", "category": "documenta... | null |
uber__AutoDispose__85 | uber/AutoDispose | 85 | defect | aac4fe1612603f04f8bce0aaea27b44deccf8f74 | 865cdea920d61621eaeb63a7c58f63ce6a1d20db | Fix CI tests | Time to fix #81 | diff --git a/.travis.yml b/.travis.yml
index 78274e067..86207dd7a 100755
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,30 +1,34 @@
language: android
-dist: trusty
android:
components:
- - tools # Tools
- - platform-tools # Platform tools
- - build-tools-26.0.1 ... | 1 | 1 | 0 | [{"id": "G0", "claim": "The hardcoded SDK license SHA should be moved into a Travis CI environment variable configured in the job setup instead of being echoed literally in .travis.yml.", "category": "security", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__AutoDispose__88 | uber/AutoDispose | 88 | defect | 2ea6a53ff28db34fe2961d843da02b8c49c5554f | 6e833fdfa05aa95a7ea952d62322718fbf427dd3 | Bring back static factories again, this time with autocomplete! | This is yet another attempt at static factories, but I feel pretty good about this.
Prior art: #61 #17 #42 #43
Basically - the static API wasn't possible before because of java generics issues. I could never find a sweet spot of conciseness/readability and tooling support (basically - IDE autocomplete). After pla... | diff --git a/autodispose/src/main/java/com/uber/autodispose/AutoDispose.java b/autodispose/src/main/java/com/uber/autodispose/AutoDispose.java
new file mode 100644
index 000000000..6f10469b3
--- /dev/null
+++ b/autodispose/src/main/java/com/uber/autodispose/AutoDispose.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2017.... | 1 | 1 | 1 | [{"id": "G0", "claim": "The public, consumer-focused methods in AutoDispose (the with(...) factories and the ScopeHandler entry points) should have javadocs.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
uber__AutoDispose__89 | uber/AutoDispose | 89 | defect | 2ea6a53ff28db34fe2961d843da02b8c49c5554f | 5864478e45514b37b3e3e4b4165655e8e2930413 | Add support for exposing delegate observers. | Resolves #78
This change updated `AutoDisposingSubscriber` implement `FlowableSubscriber` instead of `Subscriber`. We wanted to have more consistency with how the rest of the `Observer`s are handled in RxJava. This change remains backward compatible because `FlowableSubscriber` still extends `Subscriber`.
This al... | diff --git a/autodispose/src/main/java/com/uber/autodispose/observers/AutoDisposingSubscriber.java b/autodispose/src/main/java/com/uber/autodispose/observers/AutoDisposingSubscriber.java
index 053e3209e..f6bec0cdf 100644
--- a/autodispose/src/main/java/com/uber/autodispose/observers/AutoDisposingSubscriber.java
+++ b/a... | 6 | 6 | 3 | [{"id": "G0", "claim": "The javadoc on AutoDisposingSubscriber should include a tidbit of the explanation for the FlowableSubscriber change that was put in the PR description.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "The delegate-observer as... | null |
uber__AutoDispose__94 | uber/AutoDispose | 94 | defect | 040bbb00aa7e0c2856e921d830ea529e076d840b | 915bfeb86cf2786a1ea9e7952af47eb70ba19972 | Rename ArchComponents to AndroidLifecycle. | Rename ArchComponents to AndroidLifecycle.
Summary:
* Rename com.uber.autodispose.android.archcomponents package to com.uber.autodispose.android.lifecycle
* Rename AndroidLifecycleScopeProvider to just AndroidLifecycle
Resolves #91 | diff --git a/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/archcomponents/AndroidLifecycleScopeProviderTest.java b/autodispose-android-archcomponents/src/androidTest/java/com/uber/autodispose/android/androidlifecycle/AndroidLifecycleScopeProviderTest.java
similarity index 99%
rena... | 1 | 1 | 0 | [{"id": "G0", "claim": "The package should be `com.uber.autodispose.android.lifecycle` and `AndroidLifecycleScopeProvider` should be renamed to just `AndroidLifecycle`.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__NullAway__1004 | uber/NullAway | 1,004 | defect | 43bbb79695fb61cadbbeaef7109f18f4da3be44d | dd390eb78fc5a90a374bc520c13ff3cfeceaff0f | JSpecify: read upper bound annotations from bytecode and add tests | We add support for reading upper bound annotations from bytecodes for JSpecify mode generics checks. Many more types of annotations need to be read with special handling on JDK versions earlier than 22, due to https://bugs.openjdk.org/browse/JDK-8225377. For now, we disable some tests on earlier JDKs. We may add thi... | diff --git a/nullaway/build.gradle b/nullaway/build.gradle
index 17adb65077..3f9926e4b6 100644
--- a/nullaway/build.gradle
+++ b/nullaway/build.gradle
@@ -178,3 +178,15 @@ tasks.register('buildWithNullAway', JavaCompile) {
project.tasks.named('check').configure {
dependsOn 'buildWithNullAway'
}
+
+tasks.withType... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add more context (a comment) on why the new bytecode-reading code is needed, since it will not be obvious to someone looking at the code why it is needed or where to find more info.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__NullAway__1006 | uber/NullAway | 1,006 | defect | ee23831f74f2c2a36fc8974c9f26fb9289d37deb | b372f5305e58251fa852f2b84662bfe57354b2ac | External Library Models: Adding support for @Nullable Method parameters | With these changes we can read annotations from method parameters and use them with our External Library Models in the following manner.
Externally annotated code example:
```java
@NullMarked
public class ParameterAnnotationExample {
public static Integer add(Integer a, Integer b) {
return a + b;
... | diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 13263c2095..8f9e4794a4 100755
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -52,6 +52,7 @@ def versions = [
commonscli : "1.4",
autoValue : "1.10.2",
autoService : "1.1.1"... | 10 | 10 | 3 | [{"id": "G0", "claim": "JarInferTest should add unit tests for a method returning an Object[] and for a method in a generic class, since the output format for such methods may have changed.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The generator sh... | null |
uber__NullAway__1015 | uber/NullAway | 1,015 | defect | b37f5f98c15c314f84be369692b64acff216d453 | 57b3b84a47bf3e53f2fe8c64da419c4e9a1fe555 | JSpecify: handle intersection type in one place | Intersection types may arise, e.g., as part of string concatenation. We handling of an intersection type for one scenario; broader handling definitely requires more testing and thinking.
Fixes #1013 | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java b/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java
index dda48e44ca..7bf0b44e50 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java... | 1 | 1 | 0 | [{"id": "G0", "claim": "The valid assignment cases should be encoded as negative tests for the new intersection-type handling — e.g. `var x = (A<@Nullable String> & Serializable) o; x = new B();` should have no error, and corresponding testNegative1/testNegative2 cases should be added so this never regresses.", "catego... | null |
uber__NullAway__1029 | uber/NullAway | 1,029 | defect | b7756eaa0f28d88e09ad6a52a22d373e4a42ae56 | c644768361571f6c36e36c023bb16046f44e176d | Partial handling for restrictive annotations on varargs in unannotated code | Partially addresses #1027. Most importantly, handles the case with unannotated methods and _no_ restrictive annotations; we were getting warnings in some cases with the main branch, which impacts backward compatibility.
I started implementing full support for restrictive annotations on varargs parameters and then r... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index ee9236d959..5b0815ff23 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -1789,7 +1789,8 @@ private Descrip... | 3 | 3 | 3 | [{"id": "G0", "claim": "In legacy mode, passing a null array in the varargs position to a third-party method with a JetBrains @NotNull annotation on the varargs parameter no longer produces an error, and the reviewer would prefer to keep the old workaround that detects it.", "category": "correctness", "verdict": "suppo... | null |
uber__NullAway__1045 | uber/NullAway | 1,045 | defect | 940c40edda0e972df7fcb3543f514a14de661917 | 61b0cdcb9bebac06dcb821f034307311fa7bde63 | Enforce correct type-use annotation locations for nested types | Enforce correct type-use annotation locations for nested types as per JSpecify norms. We enforce type-use annotations to be on the inner class and raise an error if they are not. For annotations that are both type use and declaration, we raise an error at an invalid location.
**Current behavior**
```
// All three... | diff --git a/nullaway/src/main/java/com/uber/nullaway/ErrorMessage.java b/nullaway/src/main/java/com/uber/nullaway/ErrorMessage.java
index aa3c364306..e5040a471f 100644
--- a/nullaway/src/main/java/com/uber/nullaway/ErrorMessage.java
+++ b/nullaway/src/main/java/com/uber/nullaway/ErrorMessage.java
@@ -59,6 +59,7 @@ pub... | 17 | 17 | 2 | [{"id": "G0", "claim": "The new nested-class check should occur independent of whether the initializer assignment is valid, using the state.reportMatch API to report errors and always returning Description.NO_MATCH instead of being gated inside the mayBeNullExpr branch.", "category": "correctness", "verdict": "supporte... | null |
uber__NullAway__1055 | uber/NullAway | 1,055 | defect | 0f6f3d29de739f1b757dc8e5b80604e0a2fe59ca | ced7613508d6630bafe1b282125562407544a391 | Fix bugs in reading varargs annotations from bytecodes | For the case of declaration annotations, we were using `Flags.VARARGS` to check if a `Symbol` represented a varargs parameter, but this only works if the method is defined in source code. We add new methods for varargs parameters that may be defined in bytecodes, and always check for declaration annotations in such ca... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java b/nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java
index 514e569d13..08db99285e 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java
@@ -303,7... | 4 | 3 | 0 | [{"id": "G0", "claim": "Add tests (unless they already exist elsewhere) showing the true-positive case: a lambda that does not check for null fails when @Nullable is a type-use annotation on the parameter.", "category": "testing", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "... | null |
uber__NullAway__1063 | uber/NullAway | 1,063 | defect | e9541e3a30ad4a502fd92942704916051f05139b | 9ce9aa483a74e0577f93134901900cf5c49b3448 | Remove fixes.tsv serialization from NullAway serialization service | This PR removes the now-redundant serialization of fixes.tsv following updates to errors.tsv (#643). Previously, `fixes.tsv` recorded the locations of all non-null variables that participated in pseudo-assignments from nullable to non-null types, triggering NullAway errors. However, there was no direct link between the... | diff --git a/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java b/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java
index 4cdb31d4a5..889934a06a 100755
--- a/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java
+++ b/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java
@@ -36,7 +36,6 @@
... | 3 | 1 | 0 | [{"id": "G0", "claim": "The reviewer questions the need to bump the serialization version to 4 (adding SerializationV4Adapter), since the V3 serialized state should still work with Annotator, and asks for justification of the bump.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}... | null |
uber__NullAway__1070 | uber/NullAway | 1,070 | defect | 0a5fa0f735d69bb8345404cce1adb91bc1c8757e | 24ca5a1f05672e1bd7c58d07015d777fb8f8b34d | Substitute type arguments when checking type parameter nullability at call site | - I have made NullAway to check generic type paramater's nullability using type arguments explicityly passed at the call site.
- The relevant unit test is `void genericMethodAndVoidType()` in the `jspecify/GenericMethodTests.java` file. | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index e7c6af8f47..38b1b1d6dd 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -1852,7 +1852,7 @@ private Descrip... | 1 | 1 | 0 | [{"id": "G0", "claim": "The duplicated logic that substitutes explicit generic type arguments into the invoked method's type, which now appears in multiple places, should be extracted into a method that returns the method type with the generic type arguments substituted in.", "category": "maintainability", "verdict": "... | null |
uber__NullAway__108 | uber/NullAway | 108 | defect | cd6320bfcac74656e5074916a386e17815742e87 | 2227f29ad195bdaf49667dcc510fe65ebe5090f5 | Properly handle invocation of anonymous class constructor with parameters | Fixes #102. We now treat the invocation as if it were directly invoking the constructor of the superclass, so appropriate nullability annotations are checked. | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 81a87c8bde..32861b0fcc 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -32,6 +32,7 @@
import com.google.... | 2 | 2 | 1 | [{"id": "G0", "claim": "The null return of findSuperConstructorInType is used unchecked; it should error out, keep the original methodSymbol, or assert this is impossible.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The name comparison in findSup... | null |
uber__NullAway__1118 | uber/NullAway | 1,118 | defect | 43054bba441ba0bcb05c0d91283cdbbcd7ff5424 | 2bdc9446809d2adb123b5773de1b8d3e4e3f39f6 | Add support for static fields in contracts | This PR adds support for static fields in `@EnsureNonnull`,`EnsureNonnullIf`,`@RequiresNonnull` annotations. Currently the following code will throw validation errors (as well as the annotation handlers are unable to handle static fields). However, after this change, static fields for all three annotations are supporte... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPath.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPath.java
index 634548110e..9daf1af988 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPath.java
+++ b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPat... | 11 | 11 | 1 | [{"id": "G0", "claim": "NullAway should not honor a `this.`-qualified field reference (`this.nullableItem`) that names a static field in a contract annotation, even though Java allows the syntax.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a ... | null |
uber__NullAway__1131 | uber/NullAway | 1,131 | defect | f0642227f4e779cf5b258f691a830fd3b4cdf630 | ddf244085de9e820c355d0e94d879bfc99f01006 | JSpecify: infer generic method type arguments for assignments | This PR infers nullability of generic method type arguments for the case where the result of the call is assigned to a variable, e.g.:
```java
class Foo<T extends @Nullable Object> {
Foo(T t) {}
static <U extends @Nullable Object> Foo<U> make(U u) { return new Foo<>(u); }
void test() {
Foo<@Nu... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index b9d42df44c..e338d63d3d 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -277,6 +277,8 @@ public Config get... | 17 | 16 | 4 | [{"id": "G0", "claim": "The pull request makes the `:nullaway:buildWithNullAway` CI task fail with a crash, which should be debugged by writing a unit test that reproduces the failure.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The explicit publ... | null |
uber__NullAway__1141 | uber/NullAway | 1,141 | defect | 427fa894fb776f4ea9a3396473416de15d8cee2e | ec0f65e45c9838ce14bba968b7d3075832b969c1 | Handle calls to generic constructors in JSpecify mode | Fixes #1138
| diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 2205c66854..43dd7f15b6 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 1 | 1 | 1 | [{"id": "G0", "claim": "Further down the method (around line 178) the code again casts tree to MethodInvocationTree, so calls on a NEW_CLASS tree would still hit the unhandled case the switch at the top of the method was added for.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introdu... | null |
uber__NullAway__1143 | uber/NullAway | 1,143 | defect | a1df1c4a287d42754dc9c9f09deed8d06de4521b | 9674e643baf1c6606f0d2d9902d778538ca6cff8 | JSpecify: preserve explicit nullability annotations on type variables when performing substitutions | Fixes #1091
Consider the following code:
```java
abstract class Test {
abstract <V> @Nullable V foo(Function<@Nullable V, @Nullable V> f);
void testPositive(Function<String, String> f) {
this.<String>foo(f); // error
}
}
```
The call to `foo` should not type check. Since the type of its parame... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/CoreNullnessStoreInitializer.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/CoreNullnessStoreInitializer.java
index f61272168d..715ba66498 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/CoreNullnessStoreInitializer.java
+++ b/nulla... | 2 | 2 | 0 | [{"id": "G0", "claim": "The PR should explain in its diff description what kind of substitution is meant and why nullability annotations from type variables are lost after performing a substitution.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "T... | null |
uber__NullAway__1144 | uber/NullAway | 1,144 | defect | 7fa7bf93374034e8b164cb7df4bfcd81893cdc88 | 068dc16f698cce883c89cb66505c04d8982bbc15 | Always acknowledge restrictive annotations in JSpecify mode | Previously, we neglected to acknowledge explicit `@Nullable` return types and `@NonNull` parameter types in `@NullUnmarked` code unless the `AcknowledgeRestrictiveAnnotations` setting was passed. But, the JSpecify spec requires acknowledging restrictive annotations in `@NullUnmarked` code. So now, in JSpecify mode, w... | diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/Handlers.java b/nullaway/src/main/java/com/uber/nullaway/handlers/Handlers.java
index 168c4dc18e..2b30699809 100644
--- a/nullaway/src/main/java/com/uber/nullaway/handlers/Handlers.java
+++ b/nullaway/src/main/java/com/uber/nullaway/handlers/Handlers.java
@... | 2 | 1 | 0 | [{"id": "G0", "claim": "This change causes a new error to be reported in Caffeine, which looks valid, and the valid warnings it causes should be fixed (in Caffeine) before the change ships in NullAway.", "category": "correctness", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "... | null |
uber__NullAway__1146 | uber/NullAway | 1,146 | defect | 6f4cda7c374965d670f28ec088fe07ad323e4013 | 8ce7f194745dc641cb6a05e959889faef1067690 | Add support for local variables for arrays. | I added changes to support local variables specifically for arrays. Added a new class `LocalVariableLocation` that will contain location details in the scenario when the target is a local variable. | diff --git a/nullaway/src/main/java/com/uber/nullaway/fixserialization/location/LocalVariableLocation.java b/nullaway/src/main/java/com/uber/nullaway/fixserialization/location/LocalVariableLocation.java
new file mode 100644
index 0000000000..d18a235ff5
--- /dev/null
+++ b/nullaway/src/main/java/com/uber/nullaway/fixser... | 2 | 2 | 0 | [{"id": "G0", "claim": "The while-loop searching up the owner chain for the enclosing method is unnecessary because the owner of a local variable is already a method or constructor, so a direct cast of target.owner would suffice.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "intro... | null |
uber__NullAway__1149 | uber/NullAway | 1,149 | defect | 15c817aa672e712416bc0a4ca5ce46162845fc2e | b70e03f4d7da79b719172c01f0cb2897547bbd8e | Better `@MonotonicNonNull` support | Fixes #1148
We add explicit support for any annotation named `@MonotonicNonNull` and add our own version of the annotation to our annotations package. The main additional support is that we now reason that once assigned a non-null value, `@MonotonicNull` fields remain non-null when accessed from subsequent lambdas... | diff --git a/annotations/src/main/java/com/uber/nullaway/annotations/MonotonicNonNull.java b/annotations/src/main/java/com/uber/nullaway/annotations/MonotonicNonNull.java
new file mode 100644
index 0000000000..e177eea76a
--- /dev/null
+++ b/annotations/src/main/java/com/uber/nullaway/annotations/MonotonicNonNull.java
@... | 3 | 3 | 1 | [{"id": "G0", "claim": "The method name 'hasNullableFieldAnnotation' is misleading since it covers both @Nullable and @MonotonicNonNull annotations; it should be renamed (e.g. to something like 'hasNullabilityFieldAnnotation') so it is not mistaken for covering only @Nullable.", "category": "maintainability", "verdict"... | null |
uber__NullAway__1191 | uber/NullAway | 1,191 | defect | 86febe1dbcd35bf66085566e38cf2b56258b0824 | 06f6ebe2fd7bbbf563e812611142a8aafac9fe6b | Fix multiple issues with `NewClassTree`s that have enclosing expressions | Fixes #1188, exactly as suggested in that issue. This both simplifies the code and fixes a false negative with `@Nullable` enclosing expressions. | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 51a1ea259f..74506d9ffc 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -441,9 +441,18 @@ public Descripti... | 2 | 1 | 0 | [{"id": "G0", "claim": "The test method 'issue1888' should be renamed to a more descriptive name reflecting its intent to help long-term code readability.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The logic in matchNewClass for handling the... | null |
uber__NullAway__1210 | uber/NullAway | 1,210 | defect | bb847a421ba149fe381262dccc252885861707f6 | 0b21fb23f27340052e8b1f4b56876a808d21c934 | Allowing NewClassTree to be passed into getGenericParameterNullnessAtInvocation | ### unit test: newNullableWithArg()
Generalised the parameters of getGenericParameterNullnessAtInvocation to accept NewClassTree
Fixes #1214
| diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 904144f2e3..9d6bd1071e 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -1924,9 +1924,10 @@ private Descri... | 5 | 5 | 2 | [{"id": "G0", "claim": "In getGenericParameterNullnessAtInvocation, reaching the `else if (!(tree instanceof NewClassTree) || invokedMethodSymbol.isStatic())` branch already implies the tree is a NewClassTree with a non-static invoked method, so the reviewer believes the entire `else if` case is redundant and should be... | null |
uber__NullAway__1217 | uber/NullAway | 1,217 | defect | ec6d82955c9024afdac09ef7f6dc19f5d5ffdf12 | 1a3697aa2b7977065c2f49e9203ec94727c32ea6 | Handle NewClassTree in compareGenericTypeParameterNullabilityForCall(#1212) |
Handle NewClassTree for constructor type substitution in compareGenericTypeParameterNullabilityForCall.
Addresses part of #1212
| diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index b084b99971..4df4b8e7aa 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add a clarifying comment above the 'Type enclosingType = getTreeType(tree, config);' line in the new NewClassTree branch stating that the type arguments are obtained from the NewClassTree itself.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__NullAway__1231 | uber/NullAway | 1,231 | defect | 10d4fee52e2af4d3a252b75a89ad7f407870f583 | ae38a25df22442afbabcd7b321b964b677378275 | Add `SuppressionNameAliases` configuration option | Prior to this change, NullAway could be skipped only with an explicit `@SuppressWarnings("NullAway")` annotation. However, existing inspections like `DataFlowIssue` by JetBrains imply that NullAway should be skipped too.
With this change, NullAway can be configured to back off when additional names are present, via ... | diff --git a/nullaway/src/main/java/com/uber/nullaway/Config.java b/nullaway/src/main/java/com/uber/nullaway/Config.java
index 3dc955265e..495571b19c 100644
--- a/nullaway/src/main/java/com/uber/nullaway/Config.java
+++ b/nullaway/src/main/java/com/uber/nullaway/Config.java
@@ -240,6 +240,13 @@ public interface Config ... | 3 | 3 | 1 | [{"id": "G0", "claim": "The new suppression-name config option should get tests: one that a configured suppression string suppresses the warning and one that an unconfigured string does not.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Avoid building ... | null |
uber__NullAway__1244 | uber/NullAway | 1,244 | defect | ba4ff830b2a14ec092d436cc8f33d9252fae75d5 | 45aad648cfd20a777f954921ef8966d7a5084f9a | Improved inference for generic method calls | This goes part way towards addressing #1075 and hopefully sets us up with a decent architecture for further inference improvements in the future. We introduce a basic constraint generation / constraint solver infrastructure for solving inference. The solver interface is `ConstraintSolver` with an initial implementati... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/ConstraintSolver.java b/nullaway/src/main/java/com/uber/nullaway/generics/ConstraintSolver.java
new file mode 100644
index 0000000000..9c0a330c74
--- /dev/null
+++ b/nullaway/src/main/java/com/uber/nullaway/generics/ConstraintSolver.java
@@ -0,0 +1,49 @@
+p... | 23 | 11 | 1 | [{"id": "G0", "claim": "The test method iteratorOverObjArrays() appears to be duplicated in GenericsTests.java and the duplicate should be removed.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "fromUnannotatedMethod may be called multiple times for t... | null |
uber__NullAway__1255 | uber/NullAway | 1,255 | defect | 4d710aed45d639e32b4b0d1a7095280e69ef3648 | 886da4bb1db54525937709b51ef82f7a049ca5d1 | More generics inference fixes | Three fixes:
1. There may be multiple `TypeVariable` objects representing the same underlying type variable due to differences in annotations (e.g., `T` vs `@Nullable T`). Switch our maps key'd on `TypeVariable` to use the underlying `Element` instead, which should uniquely identify the type variable.
2. Previously ... | diff --git a/nullaway/src/main/java/com/uber/nullaway/Config.java b/nullaway/src/main/java/com/uber/nullaway/Config.java
index 5fd6542117..5745666bc7 100644
--- a/nullaway/src/main/java/com/uber/nullaway/Config.java
+++ b/nullaway/src/main/java/com/uber/nullaway/Config.java
@@ -310,4 +310,12 @@ public interface Config ... | 2 | 2 | 0 | [{"id": "G0", "claim": "checkTypeParameterNullnessForAssignability should, as defensive programming, use an `else if (tree instanceof AssignmentTree)` branch with an error-handling `else` (or a precondition check) instead of unconditionally casting to AssignmentTree, even though the contract says only those two tree ty... | null |
uber__NullAway__1258 | uber/NullAway | 1,258 | defect | 7b64688ae693825c350b31a20c9a3ba9bfdbdf89 | 88e0c31f974150afd4f902ba4b74552ac357fced | Suppress `CastToNonNull` warnings for `@NullUnmarked` method calls | ### Description
Currently, NullAway emits warnings when developers pass the return values of `@NullUnmarked` methods to `assumeNonNull` or `castToNonNull`.
However, in incremental null-safety migration scenarios, these warnings are unnecessary and may create noise for developers.
This change ensures that no warnin... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 5582d9bb38..ec2db373d9 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -321,6 +321,29 @@ private boolean ... | 6 | 4 | 1 | [{"id": "G0", "claim": "Strip surrounding parentheses and casts before the instanceof check and use getSymbolForMethodInvocation(...) instead of ASTHelpers.getSymbol(...) in isCallToUnmarkedMethod, so the helper also recognizes wrapped calls and handles static imports and JDK 18 implicit Object methods correctly.", "ca... | null |
uber__NullAway__1259 | uber/NullAway | 1,259 | defect | d0e9bbb2ae57c6088e40d3cbbdc14c4a91bee1a4 | bb805b4b7e261cfd3c7749fe781bf8b9e5c1c70e | issue-1250 pattern matching for instanceof in switch case | Fixes #1250
The goal is to make visitCase aware of pattern variables. When it encounters a case with a pattern (like case BusinessExceptionUnauthenticated e), it should:
1. Positively identify that this is a pattern matching case, not a simple constant case.
2. In the "then" branch (the code path for the bo... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessPropagation.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessPropagation.java
index 844eaaefaf..a3eaae9cbc 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessPropagation.java
+++ b/nu... | 11 | 6 | 3 | [{"id": "G0", "claim": "The helper isTypePattern should be renamed (e.g. getVariableNodeForTypePattern) because an isXXX name implies a boolean return, and it should get Javadoc documenting when it can return null.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id":... | null |
uber__NullAway__1265 | uber/NullAway | 1,265 | defect | d0e9bbb2ae57c6088e40d3cbbdc14c4a91bee1a4 | 41ef2c4fc7a7cf3a0ad7ebed258e0d65c426212b | JSpecify: Fix crash when overriding with raw types | Fixes #1264
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- Bug Fixes
- Improved robustness when analyzing generic method types to prevent rare crashes; safer method-type handling reduces risk of ClassCastExceptions.
- Tests
- Added a test covering inherita... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/TypeSubstitutionUtils.java b/nullaway/src/main/java/com/uber/nullaway/generics/TypeSubstitutionUtils.java
index 5234c809c7..5fbb280078 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/TypeSubstitutionUtils.java
+++ b/nullaway/src/main/java/com... | 3 | 2 | 0 | [{"id": "G0", "claim": "The test's doc comment says \"For issue 1250\" but the PR fixes issue 1264, so the reference should be updated to avoid confusion.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "An additional test variant where the base met... | null |
uber__NullAway__1266 | uber/NullAway | 1,266 | defect | cf02218902ba6d89b169a69a576a789a9cf3e825 | 308d1d3d6b91222070d4285fb41e9fe0b5e01f57 | Account for annotations in extends / implements when computing view as supertype | Fixes #1252
In JDK 21 and earlier, the `Types.asSuper` method did not account for annotations present in extends / implements clauses. So, here we wrap calls to `asSuper` in extra logic to re-introduce these annotations. We already introduced the logic to fix the same issue with `Types.memberType`.
This fix al... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java b/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java
index 492a9599dc..c26d87b72b 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java... | 6 | 2 | 0 | [{"id": "G0", "claim": "The @return Javadoc of the new inheritancePath overload still says the path leads to \"the class that declares {@code method}\"; update it to reference {@code supertypeSymbol}.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": ... | null |
uber__NullAway__1277 | uber/NullAway | 1,277 | defect | 1f49bef19212535a6fe091838e4ef6297fea3705 | e30ddbdec8c6a1c35f447f5d2971885466485f8b | Bug fix with type substitutions after inference | Fixes #1267
Due to possible type mutations, e.g., when substituting for bounds, sometimes we see `TypeVar`s in types that are not the same object as in the original method type for which we performed inference. Previously, we wouldn't substitute properly in such cases. Here, we collect all `TypeVar`s with the sam... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 5ac7cf5ab9..0feb6df460 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 7 | 4 | 2 | [{"id": "G0", "claim": "substituteInferredNullabilityForTypeVariables must return targetType when no substitutions are found, otherwise the method is left without a return and fails to compile.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "scan() r... | null |
uber__NullAway__1279 | uber/NullAway | 1,279 | defect | 9272d8b20dec09cf598d20026ce37dcbbe42168b | 13c379aa09b4213363026eb6936612bf8f0e0978 | JSpecify: Improve error messages for type incompatibility at pseudo-assignments | Here is the new test:
```java
@Test
public void assignmentIncompatibilityViaExtendsErrorMessage() {
makeHelper()
.addSourceLines(
"Test.java",
"import org.jspecify.annotations.*;",
"@NullMarked",
"class Test {",
" class A<T extends ... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 3aa9500cde..2dcc2c0e66 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 5 | 1 | 1 | [{"id": "G0", "claim": "The subtype-hint computation in errorMessageForIncompatibleTypesAtPseudoAssignment should be guarded to declared class types only, since the cast to ClassSymbol assumes lhsType is a declared class and arrays or type variables could yield misleading hints.", "category": "correctness", "verdict": ... | null |
uber__NullAway__129 | uber/NullAway | 129 | defect | 872c3e40d50ec497ff5b7fc9cbac84cbc511d066 | b6ec879ddce678b916b70337328d775b10187521 | Add support for (a subset of) org.jetbrains.annotations.Contract | Fix #96 by introducing support for a number of cases of the `@Contract` annotation mentioned by @hzsweers.
Currently, we can only reason about cases where the contract specifies that the return value of the method depends on the nullness value of a single argument. This means we can reason about rules like the follo... | diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 9981f001a3..c843e14226 100755
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -18,7 +18,7 @@ def versions = [
checkerFramework : "2.3.2",
checkerFrameworkNAFork : "2.3.2.1-nullaway",
errorProne ... | 3 | 1 | 1 | [{"id": "G0", "claim": "The pull request makes an unexplained, apparently unnecessary change of indentation in the dependency block of gradle/dependencies.gradle.", "category": "style", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The @Contract parser should reject malformed cl... | null |
uber__NullAway__1293 | uber/NullAway | 1,293 | defect | 085fd42fc41476d500fb9dfbed6d3dce5e641cb0 | 5c77f3ece4b3c10f82fc16d2deee0da1835e92aa | Use inference for generic call passed as receiver to instance method | See the new test; we missed this case before.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- New Features
- Improved nullability analysis for chained calls where a generic method invocation is used as the receiver; the analyzer now infers receiver types when ex... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index c61cf3be24..7dfaab7fdc 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 2 | 1 | 1 | [{"id": "G0", "claim": "Strip parentheses from the receiver before checking for a generic call needing inference, and add a test for the parenthesized-receiver shape, so that `(make(...)).get()` also triggers the new inference path.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introd... | null |
uber__NullAway__1295 | uber/NullAway | 1,295 | defect | c98783154afc7b9d4c651c29a57015a09467ee37 | 78ced4274b35a3146476f0a8dcca9a0a12bc2e0b | Accept any annotation with simple name `Contract`, and change reporting of invalid contract annotations | Fixes #1222
Fixes #1215
We make the following changes to NullAway's handling of `@Contract` annotations. First, NullAway now treats any annotation with simple name `Contract` as a contract annotation, not just the JetBrains `@Contract`. This improves the user experience when using third-party libraries containi... | diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractCheckHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractCheckHandler.java
index b641623350..5e42d5f6ae 100644
--- a/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractCheckHandler.java
+++ b/nu... | 18 | 10 | 4 | [{"id": "G0", "claim": "The Config mock in ContractUtilsTest is only used in verifyNoInteractions and tests no real behavior of getAntecedent, so it should be removed (or tests added for methods that actually use Config).", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": ... | null |
uber__NullAway__1309 | uber/NullAway | 1,309 | defect | b4b272bbe687afeac8200f9eca32ce7bacfe9330 | 87ecb0892e06228d35bc26b559983139aa540da3 | Use refined types from dataflow analysis in generic method inference | Fixes #1287
In generic method inference, we now try to obtain a refined type from dataflow-based type inference for arguments when generating constraints. This introduces a recursive dependence between dataflow analysis and generic method inference, which we handle as follows. We track whether generic method infe... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
index 0c58342472..62c7759bda 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
+++ b/nullaway/sr... | 8 | 4 | 1 | [{"id": "G0", "claim": "The new calledFromDataflow re-entrancy flag is not exception- or nesting-safe (an exception can leave it true forever and nested calls reset it), so it must be set and restored with try/finally using a getter to save the previous state.", "category": "correctness", "verdict": "supported", "prior... | null |
uber__NullAway__1312 | uber/NullAway | 1,312 | defect | b4b272bbe687afeac8200f9eca32ce7bacfe9330 | e9a40e97e3aeaaa0f33d4933c48dfe7150c83963 | Improve inference for generic method with void-returning lambda argument | `javac `inference for lambda argument leads to incorrect subtype constraint generation.
solution: Skipping subtype constraint generation for lambda argument and using the results from constraint solver inference by saving it in a new map.
This currently only handles void-returning lambdas. We will extend inference... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
index 0c58342472..a51e562291 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
+++ b/nullaway/sr... | 9 | 6 | 1 | [{"id": "G0", "claim": "The public getter getInferredLambdaType lacks Javadoc explaining when it returns a non-null inferred type, when it returns null, and who is meant to call it.", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add a comment at t... | null |
uber__NullAway__1316 | uber/NullAway | 1,316 | defect | defbda5d8c73d3fc1def609daade59fbed90a2a7 | cf74c8b811eea32d122dc6ef001e919b1acf43a6 | Jdk javac plugin: don't serialize info for classes / methods without annotations | This pull request will optimize the `jdk-javac-plugin` by only writing class and method information on the JSON file when jspecify annotations are used.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Deeper nullability detection across generi... | diff --git a/jdk-javac-plugin/src/main/java/com/uber/nullaway/javacplugin/NullnessAnnotationSerializer.java b/jdk-javac-plugin/src/main/java/com/uber/nullaway/javacplugin/NullnessAnnotationSerializer.java
index c29dfed169..fe2037751b 100644
--- a/jdk-javac-plugin/src/main/java/com/uber/nullaway/javacplugin/NullnessAnno... | 19 | 7 | 2 | [{"id": "G0", "claim": "The annotation check only looks at top-level type annotations, so nested type-use annotations (e.g. List<@Nullable String>) are missed and annotated methods may be skipped; use a deep type traversal and add tests.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "i... | null |
uber__NullAway__1317 | uber/NullAway | 1,317 | defect | 99075862da4be90d4f3553f60d68902b971e42a4 | 844e7a3fb84db722f94396b1842999118002c2d3 | Fail if NullAway is run in JSpecify mode with an incompatible javac version / configuration | Fixes #1310
NullAway now fails with an exception if run on an incompatible javac configuration, i.e., a configuration that does not support reading type use annotations from bytecode (see https://github.com/uber/NullAway/wiki/JSpecify-Support#supported-jdk-versions). Specifically, NullAway fails if it is running on... | diff --git a/jdk-annotations/jdk-integration-test/src/test/java/com/uber/nullaway/jdkannotations/JDKIntegrationTest.java b/jdk-annotations/jdk-integration-test/src/test/java/com/uber/nullaway/jdkannotations/JDKIntegrationTest.java
index 791cd30ce6..16f6a2c606 100644
--- a/jdk-annotations/jdk-integration-test/src/test/j... | 8 | 5 | 1 | [{"id": "G0", "claim": "The -XDaddTypeAnnotationsToSymbol=true flag wiring repeated inline across many JSpecify test suites should be consolidated into a shared helper or constant to avoid typos and duplication.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G... | null |
uber__NullAway__1323 | uber/NullAway | 1,323 | defect | 7923ea27997e20381d8a71b1d3f6b27f40c236b6 | f8518fe46b6ef06ac33723560851d6c4997945e4 | Checker to ensure explicit null marking of every class | NullAway has long supported the [`AnnotatedPackages`](https://github.com/uber/NullAway/wiki/Configuration#annotated-packages) setting to indicate that all packages within a namespace should be treated as "annotated" (i.e., "null-marked"), with packages treated as hierarchical. JSpecify instead requires writing `@NullM... | diff --git a/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java b/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java
new file mode 100644
index 0000000000..c5d0f1c22b
--- /dev/null
+++ b/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java
@@ -0,0 +1,69 @@... | 6 | 1 | 0 | [{"id": "G0", "claim": "The new file's copyright header says 2024 but should be updated to 2025 since the PR was created in 2025.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider adding test coverage for module-level @NullMarked annotations... | null |
uber__NullAway__1328 | uber/NullAway | 1,328 | defect | 334479c0c843fd9582e41ca42a71d1321ff4827e | 541883bc24d3c4bb422f8456bc5bc4bad3c3b833 | Address severe performance regression in dataflow analysis | Fixes #1327 (I hope)
#1309 introduced a severe performance regression in dataflow analysis, as the result of running the dataflow analysis was no longer being cached. This caused a >100X slowdown in our dataflow micro-benchmark! (Which we really should have measured before landing #1309...)
This PR re-introduce... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 0ea8848596..947fbd825b 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -22,6 +22,7 @@
package com.uber... | 6 | 1 | 0 | [{"id": "G0", "claim": "In getEnclosingTypeForCallExpression, when methodSelect is an IdentifierTree (implicit this or super call), the code should use the newly threaded path parameter (when non-null) to locate the enclosing class instead of state.getPath(), which can be wrong when the current leaf is not the invocati... | null |
uber__NullAway__1337 | uber/NullAway | 1,337 | defect | 85ac16d1a0d2e9bf0b8b4b690b087f796f3793dc | 59959e970cb55736b6d22e8507bf8bc9b8591538 | Improve inference for generic methods with lambda argument containing return statements | This is a follow up to #1312
While generating constraints for params in `generateConstraintsForParam`, if argument is a lambda expression, then generate constraints for the return expression inside lambda and the functional interface method return type. If the return expression is a method invocation then recursively... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 701ac8012c..71e397c142 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -1022,9 +1022,13 @@ private Descri... | 2 | 2 | 1 | [{"id": "G0", "claim": "Recursive constraint generation runs only for block-bodied return expressions, so an expression-bodied lambda like `() -> id(null)` is not recursed into and parentheses are not stripped before the instanceof checks and type reads, leading to under-inference; fix both and add corresponding tests.... | null |
uber__NullAway__1344 | uber/NullAway | 1,344 | defect | 7923ea27997e20381d8a71b1d3f6b27f40c236b6 | b18fea41b7b6e550b244bcbe97ba5afb93ba86ab | Method name parsing in `ExternalStubxLibraryModels` class is missing a corner case | When loading external library models through the `ExternalStubxLibraryModels` class, it previously didn't parse the method name for methods with wildcard types properly. This PR fixes the method parsing so that it will work for those cases.
The unit test for this is located in `java/com/uber/nullaway/jdkannotations/... | diff --git a/jdk-annotations/jdk-integration-test/src/test/java/com/uber/nullaway/jdkannotations/JDKIntegrationTest.java b/jdk-annotations/jdk-integration-test/src/test/java/com/uber/nullaway/jdkannotations/JDKIntegrationTest.java
index d0b6468132..573add1890 100644
--- a/jdk-annotations/jdk-integration-test/src/test/j... | 3 | 2 | 1 | [{"id": "G0", "claim": "The new test belongs in the ReturnAnnotation test fixtures (test-annotated/test-unannotated) with the method called from JDKIntegrationTest so the test verifies that the annotation on the return type actually gets through, which msridhar expected to fail without the fix.", "category": "testing",... | null |
uber__NullAway__1348 | uber/NullAway | 1,348 | defect | 8dd292f8fb84a153ee29051e7e83c3c510b22c52 | 111de8cb53997b2b431a870d1a1d13907d62e06e | Correctly get parameter types for a lambda whose type was inferred | Previously we would just use the type from `javac`, which wouldn't properly account for cases where we had inferred the type of the lambda since it was passed to a generic method.
Also, store the proper inferred types for lambdas in the `inferredLambdaTypes`, with inferred nullability applied to the type of the lamb... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 2176050284..1240c3cf80 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 3 | 1 | 1 | [{"id": "G0", "claim": "Consider tracking the TODO about optimizing the repeated nullability-substitution steps as a follow-up if performance becomes a concern.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "castToNonNull(ASTHelpers.getType(lamb... | null |
uber__NullAway__1369 | uber/NullAway | 1,369 | defect | 6165b8e1349e11a1dfbe078fc3c2fcdb49bb8052 | b0d85ca24d7bb6f921dc2b2c022b4a8f63e3605d | Fix URL for RequireExplicitNullMarking checker | Fixes #1368
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Added a documentation link to the RequireExplicitNullMarking checker so diagnostics include a guidance URL.
* **Tests**
* Added test coverage confirming the checker emits the expe... | diff --git a/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java b/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java
index 127a8b9ea8..ee25009fff 100644
--- a/nullaway/src/main/java/com/uber/nullaway/RequireExplicitNullMarking.java
+++ b/nullaway/src/main/java/com/uber/nullaw... | 1 | 1 | 1 | [{"id": "G0", "claim": "Remove the trailing space from the URL returned by linkUrl(), because trailing whitespace breaks URL parsing in terminals and automated tools and violates RFC 3986.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
uber__NullAway__1370 | uber/NullAway | 1,370 | defect | 6165b8e1349e11a1dfbe078fc3c2fcdb49bb8052 | 23f1482058c4bdde0b77b5e4aa21d7b0efbe8178 | Include method type parameters in astubx files. | This pull request adds method type parameter upper bound information to `astubx` files and updates the JSON-to-astubx generator accordingly.
The unit tests are located in `NullAway/jdk-annotations/jdk-integration-test/src/test/java/com/uber/nullaway/jdkannotations/JDKIntegrationTest.java` and `NullAway/jdk-annotatio... | diff --git a/jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java b/jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java
index e3fbe07082..0f7c35f424 100644
--- a/jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfe... | 7 | 3 | 2 | [{"id": "G0", "claim": "Changing MethodAnnotationsRecord.create from 2 to 3 parameters is a breaking API change, so ensure every caller of create() passes the new typeParamNullableUpperbounds parameter.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Conf... | null |
uber__NullAway__1371 | uber/NullAway | 1,371 | defect | 6dd3976fd714fa41313f996114a8b720f2bd2e4d | 98f28a8f211b14a29255c0e857b4c3c58b06d940 | Handle annotations on type variables in return and field types | Fixes #1354
If a method return type or a field type has nullability annotations on field types, those annotations need to be restored when getting the type of a corresponding method invocation or field read.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **B... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index dbc149c05e..6f340db6d9 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 1 | 1 | 0 | [{"id": "G0", "claim": "Optionally add a clarifying comment above the annotation-restoration block in GenericsChecks.getTreeType explaining why ASTHelpers.getType() may not preserve explicit nullability annotations on type variables and why the restoration step is necessary.", "category": "documentation", "verdict": "s... | null |
uber__NullAway__1375 | uber/NullAway | 1,375 | defect | 938a897232a761185d84677db3774db63d824ca7 | a1ce026af7c88d592a85f242f58b738225a84b3a | Run dataflow analysis on bodies of lambdas passed to generic methods | Fixes #1373
This is a follow up to #1337. We now use dataflow analysis to refine the returned type from a lambda when generating constraints for generic method inference. This ended up being a rather subtle change due to cyclic dependencies between the dataflow analysis and the generic inference. To run dataflow... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 71e397c142..a607017bbd 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -2818,7 +2818,7 @@ public ErrorBui... | 9 | 5 | 1 | [{"id": "G0", "claim": "The guard conditional in resultBeforeWithAnalysisRunning is hard to parse and its RuntimeException is inconsistent with nearby DataFlow APIs that use IllegalArgumentException for bad inputs, so the guard logic should be refactored for consistency.", "category": "maintainability", "verdict": "sup... | null |
uber__NullAway__1432 | uber/NullAway | 1,432 | defect | 4b4d1e85ec182764d46c5cc46856542da5fde86e | c2fb5ff221f243f0261b3aff65e28983a99b27c4 | Update jdk-javac-plugin to contain nested annotations | This pull requests updates the jdk-javac-plugin to parse the nested annotations in external libraries and creates JSON files according to it. For the nested annotation information, it uses [`NestedAnnotationInfo`](https://github.com/uber/NullAway/blob/50ff5820bf6a645db68c4cdff5a00f647e27b5d1/nullaway/src/main/java/com/... | diff --git a/jdk-javac-plugin/build.gradle b/jdk-javac-plugin/build.gradle
index 3b6f4ec098..bf65f2ac8b 100644
--- a/jdk-javac-plugin/build.gradle
+++ b/jdk-javac-plugin/build.gradle
@@ -57,6 +57,8 @@ dependencies {
implementation libs.gson
implementation libs.jspecify
+ implementation project(':nullaway... | 22 | 19 | 3 | [{"id": "G0", "claim": "The instance fields `path` and `nestedAnnotationInfoList` of CreateNestedAnnotationInfoVisitor have package-private visibility and should be private to encapsulate the visitor's internal state.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1",... | null |
uber__NullAway__1436 | uber/NullAway | 1,436 | defect | 80fbdc9aa22e6a737a50d10206d88d9111e5c01c | 75d57b7fa2f1f8c5cc9ad2667d92f3b689db0805 | Allow suppressing nullaway on individual parameters | Fixes https://github.com/uber/NullAway/issues/1433
Currently it's not possible to suppress warnings about overriding a NonNull parameter as Nullable on a per-parameter basis, only on the whole method.
This PR fixes that.
That enables this code to compile:
```java
import com.google.common.util.concurrent.Futu... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index b4f2b9075f..b20c92448e 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -908,7 +908,7 @@ private Descripti... | 7 | 4 | 2 | [{"id": "G0", "claim": "Add a null guard for the TreePath returned by getTreesInstance(state).getPath(paramSymbol) before passing it to state.withPath(), since it can return null when a member reference points to a library method, which can cause issues.", "category": "correctness", "verdict": "supported", "priority": ... | null |
uber__NullAway__1438 | uber/NullAway | 1,438 | defect | 32febbd4846e2e396946b0772c9510e717b4a1d8 | ef71582414115329efa8127e79661795e8a79fb3 | JSpecify: improve inference for generic methods based on method reference arguments | We now integrate inference of types for method references passed to generic method calls as part of the overall inference process for generic method calls. Includes handling of method references to varargs methods (which has a surprising number of corner cases).
<!-- This is an auto-generated comment: release notes... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index b9bd1ec967..c05d8d5ba5 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -98,6 +98,7 @@
import com.uber.nu... | 7 | 4 | 1 | [{"id": "G0", "claim": "getInferredMethodTypeForGenericMethodReference only checks the immediate parent, so a method reference wrapped in parentheses (or casts) misses the inference lookup; walk up through ParenthesizedTree before checking for the MethodInvocationTree.", "category": "correctness", "verdict": "supported... | null |
uber__NullAway__1441 | uber/NullAway | 1,441 | defect | 7f8bbcafbee8d38e26f616bb612c6532bffe5bf5 | b8d2b36b8b03b2de35980aa2c6f8ce2e3d66c01a | Improve verification of !null -> !null contracts | Fixes #1440
Fixes #1104
It turns out we can relatively easily handle these cases by looking for `BOTTOM` in the `NullnessStore` before the return expression (which means the path is infeasible). I do wonder if there are other places in our analyses we should be checking for `BOTTOM`, but we want to be careful si... | diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
index 110866cf50..c8e3713a86 100644
--- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessAnalysis.java
+++ b/nullaway/sr... | 2 | 2 | 1 | [{"id": "G0", "claim": "Guard against a null return expression from `return;` in void methods to prevent a NullPointerException when constructing the TreePath in visitReturn.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "testPositive1's null branch... | null |
uber__NullAway__1447 | uber/NullAway | 1,447 | defect | 4c619e85af4d915e71d382046de791f01b4609b1 | 887fd15c3fce8618d087691ddf300c0fa0691114 | Better support for some contracts with boolean argument constraints | Fixes #1232
We now support contracts like `@Contract("false -> !null")`. This turned out to be easier than I thought (Codex helped :-) ). The support only detects cases when the literal `false` or `true` is passed at the call site. And, we currently cannot verify these contracts; we can only use them at call sit... | diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractHandler.java
index ab774919cd..401d45f354 100644
--- a/nullaway/src/main/java/com/uber/nullaway/handlers/contract/ContractHandler.java
+++ b/nullaway/src/main... | 1 | 1 | 1 | [{"id": "G0", "claim": "The test line nonNullWhenPassedFalse(b || !b).hashCode() is a true positive, not the false positive the comment claims; the false-positive case should be tested by calling nonNullWhenPassedTrue(b || !b) instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "int... | null |
uber__NullAway__1456 | uber/NullAway | 1,456 | defect | 40381625f8cc8adca808cb9f5e0c478183428304 | d6795b145fadc7a4272d05e42df8d00b6445fe21 | Include nested annotation information in astubx files when loading external library models | Fixes #1410
This pull request includes nested annotation information when loading external libraries.
First, the `astubx-generator` project is updated to include nested annotation information to astubx.
Second, the `StubxCacheUtil` class is updated so that it will read the newly added information and store it.
F... | diff --git a/jar-infer/jar-infer-lib/build.gradle b/jar-infer/jar-infer-lib/build.gradle
index 9a821d032b..ed721d810a 100644
--- a/jar-infer/jar-infer-lib/build.gradle
+++ b/jar-infer/jar-infer-lib/build.gradle
@@ -32,6 +32,7 @@ dependencies {
api libs.commons.io
compileOnly libs.error.prone.check.api
im... | 9 | 6 | 1 | [{"id": "G0", "claim": "Two leftover changes that should have been reverted when moving NestedAnnotationInfo - the compileOnly project(':jdk-javac-plugin') dependency in jar-infer-lib and the 'from sourceSets.main.output' line in the astubx-generator-cli shadowJar - need to be reverted.", "category": "maintainability",... | null |
uber__NullAway__1464 | uber/NullAway | 1,464 | defect | cc6df93e06ab1ed832c710112b9b0b709429bcdc | 2454efdc625dd3e7c29a81669db6c6884d5ee9e5 | Initial handling of constructor diamond operators | Fixes #1451
This adds partial support for diamond operators, sufficient to fix #1451. We still need to fully support diamonds in generic method inference.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Context- and path-aware type infere... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 2e397298ab..e119f7b765 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 15 | 8 | 4 | [{"id": "G0", "claim": "In the scan() override of findPathToSubtree, currentPath is assumed non-null with a confusing dead branch; consider using castToNonNull(getCurrentPath()) to make the non-null contract explicit and produce a clearer failure.", "category": "maintainability", "verdict": "supported", "priority": "P2... | null |
uber__NullAway__1471 | uber/NullAway | 1,471 | defect | cc6df93e06ab1ed832c710112b9b0b709429bcdc | 04ab8eaed5c3181a4d367b2269a903d322caa155 | JSpecify: assume NONNULL in generic method inference for unconstrained type variables | Fixes #1453
I think a change in 0.13.0 made it more important that we have some solution for all type variables of a method.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved handling of generic methods so unconstrained type paramete... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 2e397298ab..6f6cb10bac 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 1 | 1 | 0 | [{"id": "G0", "claim": "Remove the unused org.jetbrains.annotations.Contract import in the test source NullUtil.java, since the annotation is never applied.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__NullAway__1473 | uber/NullAway | 1,473 | defect | cc6df93e06ab1ed832c710112b9b0b709429bcdc | be220e793557933c42b50a3630ec241d708d75aa | Re-introduce annotations elided by `javac` for certain cases | Fixes #1455
For reference here is the test case:
```java
@NullMarked
class Foo<OuterT> {
interface Supplier<T extends @Nullable Object> {
T get();
}
Supplier<@Nullable OuterT> sup;
<T extends Supplier<?>> T acceptSup(T supplier) {
return supplier;
}
void test() {
acceptSu... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericTypePrettyPrintingVisitor.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericTypePrettyPrintingVisitor.java
index dbfb8814c8..7d36eaba41 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericTypePrettyPrintingVisitor.java... | 3 | 1 | 0 | [{"id": "G0", "claim": "The helper repairs parameter substitutions but leaves return and thrown types untouched, so if a method type variable also appears in the return type, the repaired parameter substitution paired with the unrepaired return type could create inconsistent nullability in inferred types; the reviewer ... | null |
uber__NullAway__1484 | uber/NullAway | 1,484 | defect | e9c223c4051063ac823399ad9691c64f66ab93bc | fc4744d4b895b255e55de1d5706e4ba58e558c31 | Handle restrictive type-use `@NonNull` annotations on varargs array | I think this mostly completes our handling of #1027. Will wait to close that issue until I can double check we have tests for all the cases.
This PR focuses on a case like:
```java
@NullUnmarked
class Foo {
public void test(String @NonNull ... args) {}
}
```
Before, we would allow for a `@Nullable` array... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 8eecf5254b..9e819a1ab8 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -2112,19 +2112,24 @@ private Descr... | 2 | 2 | 1 | [{"id": "G0", "claim": "The test's javadoc should keep the \"defined in bytecode\" wording in addition to the new parenthesis, since this test is specifically about the com.uber.lib.unannotated. bytecode target.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1"... | null |
uber__NullAway__1485 | uber/NullAway | 1,485 | defect | 9cc7bd5f43d5857216685c6611c85f8acb9f0541 | 0b782857e025007f67eb5e30da89e0cf462d5afe | Fix library modeling for varargs arrays | Fixes #1481, which should enable us to handle #1480
This gives us the ability to model more nullability scenarios for varargs arrays via library models. For example, we can now write a library model for a method like [`Objects.hash(@Nullable Object @Nullable ...)`](https://github.com/jspecify/jdk/blob/cf198c06e3bd... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index 8eecf5254b..9f200ad5b5 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -2043,7 +2043,9 @@ private Descrip... | 4 | 4 | 3 | [{"id": "G0", "claim": "The nested-annotation model entries for nonNullContents and bothNonNull name the wrong owner class (NullMarkedVarargsWithModel instead of NullUnmarkedVarargsWithModel), so as written the model entries will not apply to the intended methods.", "category": "correctness", "verdict": "supported", "p... | null |
uber__NullAway__1497 | uber/NullAway | 1,497 | defect | d1aa5048c3fbb37e94b348e0db2eaefd4dd7ea44 | 1aa61dabada90b5c6428b582c9888c0210bacd28 | JDK javac plugin: properly handle nested annotations on array parameter types and varargs | Fixes #1480
For array and varargs parameter types, we were not properly distinguishing between `@Nullable` annotations on the array elements vs the array itself.
The logic changes are in `AstubxGenerator`. We add unit tests in `NullnessAnnotationSerializerTest` (for serializing from source code to JSON), `Astub... | diff --git a/jdk-annotations/astubx-generator/src/main/java/com/uber/nullaway/jdkannotations/AstubxGenerator.java b/jdk-annotations/astubx-generator/src/main/java/com/uber/nullaway/jdkannotations/AstubxGenerator.java
index 7850a4c462..b462c1dd71 100644
--- a/jdk-annotations/astubx-generator/src/main/java/com/uber/nulla... | 5 | 2 | 1 | [{"id": "G0", "claim": "containsNullableAnnotation flips the top-level parameter to nullable for any @Nullable in the rendered type, so element-nullable-only varargs and array parameters are also serialized as whole-parameter nullable, making the generated model accept a null array where only nullable elements were int... | null |
uber__NullAway__1499 | uber/NullAway | 1,499 | defect | e78dc899ad7a99d7e14301e34fc2cb1d935f70ed | 63ab1862f96d78dec7587f84e8d4d272b4876b5a | Better handling of method references passed to generic methods in JSpecify mode | Fixes #1431
Fixes #1474
We make two key changes. First, we store the inferred types of method reference expressions in the `inferredPolyExpressionTypes` cache, similar to what we did for lambdas, so that some later checks that require the type of the method reference get the inferred type.
Second, when a meth... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java b/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
index 205b045770..954eadf594 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
+++ b/nullaway/src/main/java/com/uber/nullaway/generi... | 5 | 5 | 0 | [{"id": "G0", "claim": "processMethodRefTypeRelations should use a null check with an early return instead of castToNonNull, since getMemberReferenceMethodType can return null when not in JSpecify mode and the cast would crash.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"... | null |
uber__NullAway__1508 | uber/NullAway | 1,508 | defect | cf60f5888446045735e1accf47b6636193b5fcb3 | f84d27da74383572a8d36efe78f13543107d7b53 | Fix crash with captured array types | Fixes #1503
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved handling of captured/wildcard array types during generic nullability checks to prevent incorrect assumptions and avoid crashes in expressions that mix arrays and generics.
* **... | diff --git a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java b/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java
index 708ab96853..facb63ab74 100644
--- a/nullaway/src/main/java/com/uber/nullaway/generics/CheckIdenticalNullabilityVisitor.java... | 3 | 1 | 0 | [{"id": "G0", "claim": "The new defensive bail-out for a null component type (rhsComponentType == null) has no test coverage, and it is not certain that a null value cannot arise there.", "category": "testing", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A tracking issue shoul... | null |
uber__NullAway__191 | uber/NullAway | 191 | defect | 34e6db491eeace1c59c57e5046b1612e1a926e64 | 4f1d435fbf338aa76b3ca4ef6d830201d3e19166 | Check that castToNonNull method is not passed @NonNull | This adds a NullAway warning whenever all the following conditions apply:
- A `castToNonNull` method is configured with `-XepOpt:NullAway:CastToNonNullMethod=...`
- This method is passed an argument that NullAway knows to be `@NonNull`
- The invocation happens outside an initializer (inside an initializer, an `@No... | diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
index fb214de2a3..4461c8b479 100644
--- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java
+++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java
@@ -298,7 +298,7 @@ public Descriptio... | 1 | 1 | 0 | [{"id": "G0", "claim": "Extract the castToNonNull checking logic in handleInvocation into its own function.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__NullAway__194 | uber/NullAway | 194 | defect | 00b6e13dd009566c3b4827adb6ca31994f8db3fc | 37f3a7846006578b155f8453f732057e5cb345f4 | Various fixes for AcknowledgeRestrictiveAnnotations | This is a collection of fixes that actually makes the `AcknowledgeRestrictiveAnnotations` option usable.
The version of this flag shipped with NullAway 0.5.0 is pretty much useless in large codebases and will break some parts of our dataflow analysis even for first-party/annotated code.
Additionally, we needed su... | diff --git a/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java b/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
index 00d123c852..81388b4221 100644
--- a/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
+++ b/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
@@ -61,6 +61,9 @@... | 3 | 1 | 0 | [{"id": "G0", "claim": "Consider also running handler.onOverrideMayBeNullExpr before dataflow (rather than after) in the identifier/field-access and conditional-expression/assignment branches of mayBeNullExpr, though the author notes it is not clear what to do until handlers exist that actually override the nullability... | null |
uber__NullAway__228 | uber/NullAway | 228 | defect | f3be0a7b929e0f3058842d80f7777a1100355083 | be8f556c6a2b9e7e2b4d8db2cd676d7040c90ce1 | Add support for marking library parameters as explicitly @Nullable | Note that this allows us to force overriding methods to have the
corresponding parameters annotated as @Nullable.
In particular, we are marking android.view.GestureDetector.
OnGestureListener.onScroll as taking @Nullable for the first
parameter. Since this callback can be passed null under some
circumstances. | diff --git a/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java b/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
index 81388b4221..83a5006196 100644
--- a/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
+++ b/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java
@@ -41,6 +41,15 @... | 1 | 1 | 0 | [{"id": "G0", "claim": "Rename nullableParameters() to a more distinguishing name, such as nullableParamsForOverrides() or explicitNullableParameters(), so it is not confused with the default case where parameters are just assumed @Nullable.", "category": "maintainability", "verdict": "supported", "priority": "P2", "sc... | null |
uber__NullAway__270 | uber/NullAway | 270 | defect | 0ac60570bc79b21ea7a91e44cd6fe50f8d750e57 | 985952a9b5944e236efa803698361aef297b71b9 | Model parseXXX methods of boxed primitives as having @NonNull parameter | E.g., the parameter of Long.parseLong(String) should not be null or a NumberFormatException gets thrown. We should model all the parseXXX methods of all the java.lang boxed primitive types.
Following methods are added
1. parseInt 2. parseFloat 3. parseShort 4. parseLong 5. parseDouble 6. parseByte 7. parseBoolean
... | diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java
index 40d8ef7ece..8506cb1478 100644
--- a/nullaway/src/main/java/com/uber/nullaway/handlers/LibraryModelsHandler.java
+++ b/nullaway/src/main/java/com/ub... | 1 | 1 | 1 | [{"id": "G0", "claim": "The PR should also model the radix-taking overloads of parseXXX methods, such as Integer.parseInt(String,int), and similarly for Long, as having a @NonNull parameter.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
uber__NullAway__312 | uber/NullAway | 312 | defect | 8fce284386a7ae604de4cea7e853009c499552a1 | 120357fe8e379fa2783a9b13eb0c21facb8b7375 | Added contract check support | Added `ContractCheckHandler` which tries to supports Contract Checking.
Currently, it supports the case when there is only one clause in the contract. The clause of the form in which all the elements of the antecedent are either of "_", "null" or "!null", and the consequent is "!null" is supported. The handler chec... | diff --git a/nullaway/src/main/java/com/uber/nullaway/AbstractConfig.java b/nullaway/src/main/java/com/uber/nullaway/AbstractConfig.java
index b387178613..9b09b65d30 100644
--- a/nullaway/src/main/java/com/uber/nullaway/AbstractConfig.java
+++ b/nullaway/src/main/java/com/uber/nullaway/AbstractConfig.java
@@ -70,6 +70,... | 17 | 14 | 3 | [{"id": "G0", "claim": "The new option's identifiers should use the plural form: flag string CheckContracts, constant FL_CHECK_CONTRACTS, field checkContracts and method checkContracts().", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The contra... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.