Bug 570101 - org.eclipse.core.runtime.IPath.lastSegment()" is null
Summary: org.eclipse.core.runtime.IPath.lastSegment()" is null
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-01-05 14:12 EST by Wojtek Bok CLA
Modified: 2021-05-01 16:24 EDT (History)
2 users (show)

See Also:


Attachments
error.log as requested (158.15 KB, text/plain)
2021-01-05 17:20 EST, Wojtek Bok CLA
no flags Details
Location file (62 bytes, application/octet-stream)
2021-04-30 11:37 EDT, Wojtek Bok CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wojtek Bok CLA 2021-01-05 14:12:40 EST
On Jan 4, I downloaded eclipse-php-2020-12-R-win32-x86_64.zip

I unzipped it and put it into C:\Eclipse\php\eclipse

The shortcut to start it is C:\Eclipse\php\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk-15\bin"

I do not have a local PHP server installed, instead I am using a PHP server in a Docker instance on another machine. The workspace target is on the same machine via a mapped drive.

When I type $avar = "asdf"; I get the error:

Cannot invoke "String.equals(Object)" because the return value of "org.eclipse.core.runtime.IPath.lastSegment()" is null

When I save I get the same multiple identical errors. These errors also pop-up at other random times as I am typing.
Comment 1 Andrey Loskutov CLA 2021-01-05 14:18:43 EST
Please attach error log.
Comment 2 Wojtek Bok CLA 2021-01-05 17:20:07 EST
Created attachment 285193 [details]
error.log as requested

error.log as requested
Comment 3 Wojtek Bok CLA 2021-01-07 15:22:50 EST
I know how priorities work, and workload, etc

However this is extremely annoying. There are times where every second keystroke causes this popup error. Trying to type anything is an exercise in frustration. 

You type a character or two, then you have to dismiss the popup, then another character, then dismiss the popup, then...

Is there anything I can do here?
Comment 4 Wojtek Bok CLA 2021-01-08 19:08:01 EST
Ok, as a work-around.

I was dismissing the popup error dialog each time (click on OK). So the next time an error occurred it popped up again and grabbed focus.

Now I simply drag the error popup to the side, and when new errors appear, it does not grab focus.

So I can basically ignore it, though the problem still exists.

As a side note, I just noticed that the project name in the Project Explorer (root of the tree) is blank. Opening up Properties does show the Project name.
Comment 5 Michael Skutek CLA 2021-04-30 03:25:15 EDT
I have the same problem here. I spent some time for investigation and I have a suspicion that the reason for that issue is the character "/" at the end of the project path in the file ".location" in your workspace settings. This occurs especially if the project is located directly at top of a drive (e.g. "D:\") under Windows.

The file can be found at:

WORKSPACE_DIR/.metadata/.plugins/org.eclipse.core.resources/.projects/PROJECT_NAME/.location

You may find an entry which includes a project path like this:

URI//file:/D:/

The project is located directly at the windows drive D:\ and therefore the last character in this path will be a "/" which may confuse eclipse while it tries to extract the last part of this path.

Removing this last "/" will remove the error message too and the name of the project will appear again. Unfortunately, the content of this project (all files) are not found by eclipse anymore. 
So I can provide no workaround other than create the project at a place within a directory.
Comment 6 Wojtek Bok CLA 2021-04-30 11:37:35 EDT
Created attachment 286280 [details]
Location file

This file contains non-text characters. It should not be handled as a plain-text file
Comment 7 Wojtek Bok CLA 2021-04-30 11:40:09 EDT
I attached the .location file. It has non-text characters, and yes it has a trailing / after the path. I would edit it, but I don't know if the other characters are significant.
Comment 8 Michael Skutek CLA 2021-05-01 16:24:40 EDT
Yes, these characters seem to be relevant. I fiddled with the content but with no positive effect other than already described in my first comment.