Bug 561377 - NPE upon opening GitView
Summary: NPE upon opening GitView
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 5.7.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 561597 562425 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-23 10:54 EDT by Dirk Gfroerer CLA
Modified: 2020-04-24 03:37 EDT (History)
4 users (show)

See Also:


Attachments
Exception Stack Trace (4.44 KB, text/plain)
2020-03-23 10:54 EDT, Dirk Gfroerer CLA
no flags Details
SessionData (314 bytes, text/plain)
2020-03-23 10:54 EDT, Dirk Gfroerer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Gfroerer CLA 2020-03-23 10:54:26 EDT
Created attachment 282196 [details]
Exception Stack Trace

Since upgrade to Elipse 202003 I do encounter an NPE when switching from e.g. the Java Perspective to the Git Perspective. Switching back to Eclipse 201912 resolves the issue for me.
Comment 1 Dirk Gfroerer CLA 2020-03-23 10:54:51 EDT
Created attachment 282197 [details]
SessionData
Comment 2 Matthias Sohn CLA 2020-03-23 12:13:26 EDT
I cannot reproduce this problem on Mac.

When exactly does the NPE occur ?
Immediately when switching the perspective or at a later action ?

The code throwing the NPE was introduced in 5.7 by this change
https://git.eclipse.org/r/#/c/153953/5/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java

@Thomas: does this ring a bell ?
Comment 3 Dirk Gfroerer CLA 2020-03-23 12:37:41 EDT
It happens immediately when switching from e.g. the Java Perspective to the Git Perspective.
It than also happens when being in the Git Perspective and expanding a repository.

With 201912 I see
Repository [master] - Path on local file system

With 202003 I see
Repository [master]

so the dash followed by the local path is missing.
Comment 4 Matthias Sohn CLA 2020-03-23 13:00:48 EDT
(In reply to Dirk Gfroerer from comment #3)
> It happens immediately when switching from e.g. the Java Perspective to the
> Git Perspective.
> It than also happens when being in the Git Perspective and expanding a
> repository.
> 
> With 201912 I see
> Repository [master] - Path on local file system
> 
> With 202003 I see
> Repository [master]
> 
> so the dash followed by the local path is missing.

on Mac this works fine
Comment 5 Dirk Gfroerer CLA 2020-03-23 13:39:34 EDT
I'm running

Red Hat Enterprise Linux Workstation release 7.7 (Maipo)

with all patches applied.
Comment 6 Thomas Wolf CLA 2020-03-23 14:55:40 EDT
(In reply to Dirk Gfroerer from comment #5)
> I'm running
> 
> Red Hat Enterprise Linux Workstation release 7.7 (Maipo)
> 
> with all patches applied.

Cannot reproduce on CentOS 7.7, Adwaita, gtk 3.22.30, X11. Tried with a 2020-03 Eclipse JEE, both Java 8u222 and AdoptOpenJDK 11.0.6+10, and also light and dark mode.

However... the code in question indeed doesn't handle rangesAfter == null. I have no idea under what circumstances the viewer cell should not have any style ranges, but I suggest we just make that code check for null and not fiddle with the styles in that case.
Comment 7 Eclipse Genie CLA 2020-03-24 03:29:23 EDT
New Gerrit change created: https://git.eclipse.org/r/159922
Comment 8 Eclipse Genie CLA 2020-03-24 20:51:04 EDT
Gerrit change https://git.eclipse.org/r/159922 was merged to [stable-5.7].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=467ab6e50409e63c34e24c9f3e60fc0d662344b4
Comment 9 Matthias Sohn CLA 2020-03-31 03:06:49 EDT
*** Bug 561597 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Wolf CLA 2020-03-31 16:30:38 EDT
(In reply to Matthias Sohn from comment #9)
> *** Bug 561597 has been marked as a duplicate of this bug. ***

Oof. Eclipse has a preference to switch off styled labels:

Preferences->General->Appearance->Use mixed fonts and colors for labels

If that is off, there are of course no styles on the label, and then one gets this NPE.
Comment 11 Matthias Sohn CLA 2020-03-31 19:10:26 EDT
(In reply to Thomas Wolf from comment #10)
> (In reply to Matthias Sohn from comment #9)
> > *** Bug 561597 has been marked as a duplicate of this bug. ***
> 
> Oof. Eclipse has a preference to switch off styled labels:
> 
> Preferences->General->Appearance->Use mixed fonts and colors for labels
> 
> If that is off, there are of course no styles on the label, and then one
> gets this NPE.

arrgh, looks like there are too many preferences
Comment 12 Florian Körner CLA 2020-03-31 23:34:17 EDT
(In reply to Thomas Wolf from comment #10)
> (In reply to Matthias Sohn from comment #9)
> > *** Bug 561597 has been marked as a duplicate of this bug. ***
> 
> Oof. Eclipse has a preference to switch off styled labels:
> 
> Preferences->General->Appearance->Use mixed fonts and colors for labels
> 
> If that is off, there are of course no styles on the label, and then one
> gets this NPE.

Great, that helps.
Comment 13 Thomas Wolf CLA 2020-04-02 12:30:51 EDT
(In reply to Florian Körner from comment #12)
> (In reply to Thomas Wolf from comment #10)
> > (In reply to Matthias Sohn from comment #9)
> > > *** Bug 561597 has been marked as a duplicate of this bug. ***
> > 
> > Oof. Eclipse has a preference to switch off styled labels:
> > 
> > Preferences->General->Appearance->Use mixed fonts and colors for labels
> > 
> > If that is off, there are of course no styles on the label, and then one
> > gets this NPE.
> 
> Great, that helps.

EGit nightly should have the fix for this. Update site at https://download.eclipse.org/egit/updates-nightly .
Comment 14 Thomas Wolf CLA 2020-04-23 10:51:39 EDT
*** Bug 562425 has been marked as a duplicate of this bug. ***
Comment 15 Thomas Wolf CLA 2020-04-24 03:37:30 EDT
Also reported in the forum at https://www.eclipse.org/forums/index.php/t/1103486/ .