question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Null pointer exception when opening gerrit panel on a specific project

See original GitHub issue

The fun part is that this happens only for one specific repository. Also, notifications work OK (changes waiting for review popup), but opening gerrit panel hangs the whole app. I am still able to close the window (whole window, not panel itself) without killing the app.

Looks like the error happens here. I suspect that the case is that currentRevision is null and changeInfo.revisions is also null. Or something else, I am not familiar with gerrit API. Even if it is a bug/misconfiguration on gerrit side, it should not cause exceptions here.

Plugin version: 0.9.9.1-146

PyCharm 2016.2.3 Build #PY-162.1967.10, built on September 7, 2016

use Optional.orNull() instead of Optional.or(null)
java.lang.NullPointerException: use Optional.orNull() instead of Optional.or(null)
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
	at com.google.common.base.Absent.or(Absent.java:51)
	at com.urswolfer.intellij.plugin.gerrit.SelectedRevisions.get(SelectedRevisions.java:57)
	at com.urswolfer.intellij.plugin.gerrit.ui.GerritSelectRevisionInfoColumn.valueOf(GerritSelectRevisionInfoColumn.java:71)
	at com.urswolfer.intellij.plugin.gerrit.ui.GerritSelectRevisionInfoColumn.valueOf(GerritSelectRevisionInfoColumn.java:53)
	at com.intellij.util.ui.ListTableModel.getValueAt(ListTableModel.java:111)
	at javax.swing.JTable.getValueAt(JTable.java:2717)
	at com.intellij.ui.table.JBTable.calculateRowHeight(JBTable.java:162)
	at com.intellij.ui.table.JBTable.getRowHeight(JBTable.java:141)
	at javax.swing.JTable.getRowHeight(JTable.java:992)
	at javax.swing.JTable.getCellRect(JTable.java:2937)
	at javax.swing.plaf.basic.BasicTableUI.createTableSize(BasicTableUI.java:1694)
	at javax.swing.plaf.basic.BasicTableUI.getPreferredSize(BasicTableUI.java:1733)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
	at com.intellij.ui.components.JBScrollPane$Layout.layoutContainer(JBScrollPane.java:575)
	at java.awt.Container.layout(Container.java:1510)
	at com.intellij.ui.components.JBScrollPane.layout(JBScrollPane.java:260)
	at java.awt.Container.doLayout(Container.java:1499)
	at java.awt.Container.validateTree(Container.java:1695)
	at java.awt.Container.validate(Container.java:1630)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:711)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:708)
	at com.intellij.ide.IdeRepaintManager.validateInvalidComponents(IdeRepaintManager.java:85)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1731)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at com.intellij.ide.IdeEventQueue.i(IdeEventQueue.java:793)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:629)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:385)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)```

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uwolfercommented, Nov 10, 2016

I get this exception report from time to time, but I have not idea how it can be reproduced. It would really help if you would find a way to reproduce it.

0reactions
uwolfercommented, Apr 18, 2017

I have added a workaround which prevents broken UI. The revision column is just empty now when no revisions are available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NullPointerException when i try to add a object from a jpa ...
I want to get all projects, where person is empty. Every time i call the endpoint a get a NullPointerException for this line...
Read more >
Null Pointer Exception after a MergeValidationListener throws ...
I get that. In the error.log I expect nothing at all, this is a valid exception, it just shouldn't get merged. Instead I...
Read more >
removing possible null pointer exception (I4f8c9393) · Gerrit Code ...
Topo2 - Show the mastership when selecting an instance panel JIRA Tasks; ONOS-6292 (Merged). onos-6296: Null Pointer check before using null object (Merged)....
Read more >
Plugin Development - Gerrit Code Review
This is a project that demonstrates the various features of the plugin API. It can be taken as an example to develop an...
Read more >
Gerrit server goes down when uploading code,then get an ...
NullPointerException: change 176952 not found in ReviewDb. 253 views ... at com.google.gerrit.server.project.ChangeControl.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found