langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
115 } |
115 } |
116 |
116 |
117 protected abstract String formatDiagnostic(JCDiagnostic d, Locale locale); |
117 protected abstract String formatDiagnostic(JCDiagnostic d, Locale locale); |
118 |
118 |
119 public String formatPosition(JCDiagnostic d, PositionKind pk,Locale l) { |
119 public String formatPosition(JCDiagnostic d, PositionKind pk,Locale l) { |
120 assert (d.getPosition() != Position.NOPOS); |
120 Assert.check(d.getPosition() != Position.NOPOS); |
121 return String.valueOf(getPosition(d, pk)); |
121 return String.valueOf(getPosition(d, pk)); |
122 } |
122 } |
123 //where |
123 //where |
124 private long getPosition(JCDiagnostic d, PositionKind pk) { |
124 private long getPosition(JCDiagnostic d, PositionKind pk) { |
125 switch (pk) { |
125 switch (pk) { |