mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8269753: Misplaced caret in PatternSyntaxException's detail message
Reviewed-by: prappo
This commit is contained in:
parent
c3d8e9228d
commit
bb508e1303
2 changed files with 24 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -107,7 +107,9 @@ public class PatternSyntaxException
|
|||
sb.append(pattern);
|
||||
if (index >= 0 && pattern != null && index < pattern.length()) {
|
||||
sb.append(System.lineSeparator());
|
||||
for (int i = 0; i < index; i++) sb.append(' ');
|
||||
for (int i = 0; i < index; i++) {
|
||||
sb.append((pattern.charAt(i) == '\t') ? '\t' : ' ');
|
||||
}
|
||||
sb.append('^');
|
||||
}
|
||||
return sb.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue