Bug 514917

Summary: [open type] Open Type dialog should ignore leading/trailing whitespace
Product: [Eclipse Project] JDT Reporter: Andreas Sewe <sewe>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P5 CC: daniel_megert, frank.rene.benoit, lukas.eder
Version: 4.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Andreas Sewe CLA 2017-04-07 05:34:15 EDT
When one copies and pastes class names from external sources (stack traces, build output, etc.), it is easy to accidentally include leading or trailing whitespace. It would be nice if the Open Type dialog would simply strip or ignore any leading and trailing whitespace, as it cannot occur in a type name anyway.
Comment 1 Dani Megert CLA 2017-04-07 06:53:27 EDT
Note that a trailing space has a meaning: it prevents the automatic prefix matching.

Did you try Navigate > Open from Clipboard (Ctrl+Shift+V)? This does what you want and even more. It can e.g. also open methods and understands stack trace entries, e.g.
MessageDialog.openConfirm(Shell, String, String)
Comment 2 Andreas Sewe CLA 2017-04-07 07:13:01 EDT
(In reply to Dani Megert from comment #1)
> Note that a trailing space has a meaning: it prevents the automatic prefix
> matching.

Didn't know that.

"Enter type name prefix or pattern (*, ?, or camel case)" doesn't communicate this. I have no idea how to rephrase this such that it does, unfortunately.

If JDT would use well-known anchor characters like ^ or $, a terse description along the lines of "*, ?, or camel case", which relies on the developer's experience with globs, might work, but $ is obviously a bad anchor character in Java code.

> Did you try Navigate > Open from Clipboard (Ctrl+Shift+V)? This does what
> you want and even more. It can e.g. also open methods and understands stack
> trace entries, e.g.
> MessageDialog.openConfirm(Shell, String, String)

No, I went straight for Open Type (Ctrl+Shift+T), as I knew I had copy and pasted a type name.
Comment 3 Dani Megert CLA 2018-04-17 08:31:55 EDT
*** Bug 520292 has been marked as a duplicate of this bug. ***
Comment 4 Noopur Gupta CLA 2020-08-07 01:51:15 EDT
*** Bug 565866 has been marked as a duplicate of this bug. ***