Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ByteBufferBackingArray throws NullPointerException #1004

Closed
cheister opened this issue Apr 19, 2018 · 0 comments
Closed

ByteBufferBackingArray throws NullPointerException #1004

cheister opened this issue Apr 19, 2018 · 0 comments
Assignees

Comments

@cheister
Copy link

cheister commented Apr 19, 2018

When parsing the following method

import java.nio.ByteBuffer;

public class ErrorProneTest {
  public void ByteBufferBackingArrayTest() {
    byte[] byteArray = ((ByteBuffer) new Object()).array();
  }
}

Errorprone throws this exception

error-prone version: 2.3.0
  BugPattern: ByteBufferBackingArray
  Stack Trace:
  java.lang.NullPointerException
at com.google.errorprone.bugpatterns.ByteBufferBackingArray.matchMethodInvocation(ByteBufferBackingArray.java:92)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:904)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:145)
@cushon cushon self-assigned this Apr 20, 2018
cushon added a commit to cushon/error-prone that referenced this issue Apr 20, 2018
Fixes google#1004

MOE_MIGRATED_REVID=193610886
@cushon cushon closed this as completed in ea07060 Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants