eclipse-platform / eclipse-platform/eclipse.platform
Expressions containing strings with backslash escape character
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 165
- Forks
- 174
- Ø Merge
- 2 T. 8 Std.
- Gemergte PRs (30 T.)
- 22
Beschreibung
Not sure it I'm filing this bug in the right place. I was not able to find a duplicate bug for this, but maybe I used the wrong search criteria.
When debugging and using the expressions evaluation window, expressions that contain a string with a backslash (escape) character do no work properly you must add extra escape characters to get the expression to evaluate properly.
Here's a simple expression that illustrates the problem:
"filename.ext".split("//.")
This gives you an error complaining that dot is not a valid escape sequence.
if you use:
"filename.ext".split("////.")
this expression evaluates does split the string into an array of two strings split by the dot. From the Java language spec, this technically shouldn't have given the result of an array of one string matching the entire literal string. It quite obvious that the string input to new expressions is itself requiring escaped input and is not handling the case that an expression itself might be containing strings that contain escaped sequences.
The same issue occurs with an expressions like:
new File("//ext//file.x")
Please note that Java executes the code correctly, you just can't copy and paste those statements from the source code into the expressions window. This is certainly not how anyone would expect it to behave.
I've attached a csv file that lets you know what versions of the various components I have installed. I had also done an update on all the components, so I think I'm pretty much up-to-date and the problem still persists. I've also noticed a StackExchange issue that reported the same observation.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit Eclipses Fenster zur Auswertung von Ausdrücken und reproduziere die Beispiele mit "filename.ext".split("//.") und new File("//ext//file.x"). Vergleiche ihr Verhalten mit denselben Java-Anweisungen, die aus dem Quelltext ausgeführt werden, und verwende die Versionen der angehängten Komponenten als Kontext. Erledigt ist die Aufgabe, wenn String-Escaping im Quelltextstil direkt im Auswertungsfenster funktioniert, ohne zusätzliche Escape-Zeichen hinzuzufügen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100