Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 162850 Details for
Bug 306917
Exception occurred during compilation unit conversion:
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
.log
bug.log (text/x-log), 30.85 KB, created by
Dani Megert
on 2010-03-24 05:26:59 EDT
(
hide
)
Description:
.log
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2010-03-24 05:26:59 EDT
Size:
30.85 KB
patch
obsolete
>!SESSION 2010-03-24 08:37:59.715 ----------------------------------------------- >eclipse.buildId=I20100323-0800 >java.version=1.6.0_16 >java.vendor=Sun Microsystems Inc. >BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH >Framework arguments: -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation >Command-line arguments: -debug -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation -data c:\eclipse\workspaces\Development_HEAD\plugins > >!ENTRY org.eclipse.jdt.core 4 4 2010-03-24 10:03:10.495 >!MESSAGE Exception occurred during compilation unit conversion: >----------------------------------- SOURCE BEGIN ------------------------------------- >/******************************************************************************* > * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.jdt.internal.corext.util; > >import org.eclipse.osgi.util.TextProcessor; > >import org.eclipse.core.runtime.Assert; > >import org.eclipse.jface.action.LegacyActionTools; >import org.eclipse.jface.viewers.StyledString; > >import org.eclipse.jface.text.BadLocationException; >import org.eclipse.jface.text.DefaultLineTracker; >import org.eclipse.jface.text.ILineTracker; >import org.eclipse.jface.text.IRegion; > >import org.eclipse.jdt.core.IJavaProject; >import org.eclipse.jdt.core.formatter.IndentManipulation; > > >/** > * Helper class to provide String manipulation functions not available in standard JDK. > */ >public class Strings { > > private Strings(){} > > > /** > * Tells whether we have to use the {@link TextProcessor} > * <p> > * This is used for performance optimization. > * </p> > * @since 3.4 > */ > public static final boolean USE_TEXT_PROCESSOR; > static { > String testString= "args : String[]"; //$NON-NLS-1$ > USE_TEXT_PROCESSOR= testString != TextProcessor.process(testString); > } > > private static final String JAVA_ELEMENT_DELIMITERS= TextProcessor.getDefaultDelimiters() + "<>(),?{} "; //$NON-NLS-1$ > > /** > * Adds special marks so that that the given styled string is readable in a BIDI environment. > * > * @param styledString the styled string > * @return the processed styled string > * @since 3.4 > */ > public static StyledString markLTR(StyledString styledString) { > > /* > * NOTE: For performance reasons we do not call markLTR(styledString, null) > */ > > if (!USE_TEXT_PROCESSOR) > return styledString; > > String inputString= styledString.getString(); > String string= TextProcessor.process(inputString); > if (string != inputString) > insertMarks(styledString, inputString, string); > return styledString; > } > > /** > * Adds special marks so that that the given styled string is readable in a BIDI environment. > * > * @param styledString the styled string > * @param additionalDelimiters the additional delimiters > * @return the processed styled string > * @since 3.4 > */ > public static StyledString markLTR(StyledString styledString, String additionalDelimiters) { > if (!USE_TEXT_PROCESSOR) > return styledString; > > String inputString= styledString.getString(); > String string= TextProcessor.process(inputString, TextProcessor.getDefaultDelimiters() + additionalDelimiters); > if (string != inputString) > insertMarks(styledString, inputString, string); > return styledString; > } > /** > * Adds special marks so that that the given styled string is readable in a BIDI environment. > * > * @param styledString the styled string > * @param additionalDelimiters the additional delimiters > * @return the processed styled string > * @since 3.4 > */ > public static StyledString markLTR(StyledString styledString, String additionalDelimiters) { > if (!USE_TEXT_PROCESSOR) > return styledString; > > String inputString= styledString.getString(); > String string= TextProcessor.process(inputString, TextProcessor.getDefaultDelimiters() + additionalDelimiters); > if (string != inputString) > insertMarks(styledString, inputString, string); > return styledString; > } > > /** > * Inserts the marks into the given styled string. > * > * @param styledString the styled string > * @param originalString the original string > * @param processedString the processed string > * @since 3.5 > */ > private static void insertMarks(StyledString styledString, String originalString, String processedString) { > int i= 0; > char orig= originalString.charAt(0); > int processedStringLength= originalString.length(); > for (int processedIndex= 0; processedIndex < processedStringLength; processedIndex++) { > char processed= processedString.charAt(processedIndex); > if (orig == processed) > orig= originalString.charAt(++i); > else > styledString.insert(processed, processedIndex); > } > } > > /** > * Adds special marks so that that the given string is readable in a BIDI environment. > * > * @param string the string > * @return the processed styled string > * @since 3.4 > */ > public static String markLTR(String string) { > if (!USE_TEXT_PROCESSOR) > return string; > > return TextProcessor.process(string); > } > > /** > * Adds special marks so that that the given string is readable in a BIDI environment. > * > * @param string the string > * @param additionalDelimiters the additional delimiters > * @return the processed styled string > * @since 3.4 > */ > public static String markLTR(String string, String additionalDelimiters) { > if (!USE_TEXT_PROCESSOR) > return string; > > return TextProcessor.process(string, TextProcessor.getDefaultDelimiters() + additionalDelimiters); > } > > /** > * Adds special marks so that that the given Java element label is readable in a BIDI > * environment. > * > * @param string the string > * @return the processed styled string > * @since 3.6 > */ > public static String markJavaElementLTR(String string) { > if (!USE_TEXT_PROCESSOR) > return string; > > return TextProcessor.process(string, JAVA_ELEMENT_DELIMITERS); > } > > /** > * Tests if a char is lower case. Fix for 26529. > * @param ch the char > * @return return true if char is lower case > */ > public static boolean isLowerCase(char ch) { > return Character.toLowerCase(ch) == ch; > } > > public static boolean startsWithIgnoreCase(String text, String prefix) { > int textLength= text.length(); > int prefixLength= prefix.length(); > if (textLength < prefixLength) > return false; > for (int i= prefixLength - 1; i >= 0; i--) { > if (Character.toLowerCase(prefix.charAt(i)) != Character.toLowerCase(text.charAt(i))) > return false; > } > return true; > } > > public static String removeNewLine(String message) { > StringBuffer result= new StringBuffer(); > int current= 0; > int index= message.indexOf('\n', 0); > while (index != -1) { > result.append(message.substring(current, index)); > if (current < index && index != 0) > result.append(' '); > current= index + 1; > index= message.indexOf('\n', current); > } > result.append(message.substring(current)); > return result.toString(); > } > > /** > * Converts the given string into an array of lines. The lines > * don't contain any line delimiter characters. > * > * @param input the string > * @return the string converted into an array of strings. Returns <code> > * null</code> if the input string can't be converted in an array of lines. > */ > public static String[] convertIntoLines(String input) { > try { > ILineTracker tracker= new DefaultLineTracker(); > tracker.set(input); > int size= tracker.getNumberOfLines(); > String result[]= new String[size]; > for (int i= 0; i < size; i++) { > IRegion region= tracker.getLineInformation(i); > int offset= region.getOffset(); > result[i]= input.substring(offset, offset + region.getLength()); > } > return result; > } catch (BadLocationException e) { > return null; > } > } > > /** > * Returns <code>true</code> if the given string only consists of > * white spaces according to Java. If the string is empty, <code>true > * </code> is returned. > * > * @param s the string to test > * @return <code>true</code> if the string only consists of white > * spaces; otherwise <code>false</code> is returned > * > * @see java.lang.Character#isWhitespace(char) > */ > public static boolean containsOnlyWhitespaces(String s) { > int size= s.length(); > for (int i= 0; i < size; i++) { > if (!Character.isWhitespace(s.charAt(i))) > return false; > } > return true; > } > > /** > * Removes leading tabs and spaces from the given string. If the string > * doesn't contain any leading tabs or spaces then the string itself is > * returned. > * @param line the line > * @return the trimmed line > */ > public static String trimLeadingTabsAndSpaces(String line) { > int size= line.length(); > int start= size; > for (int i= 0; i < size; i++) { > char c= line.charAt(i); > if (!IndentManipulation.isIndentChar(c)) { > start= i; > break; > } > } > if (start == 0) > return line; > else if (start == size) > return ""; //$NON-NLS-1$ > else > return line.substring(start); > } > > public static String trimTrailingTabsAndSpaces(String line) { > int size= line.length(); > int end= size; > for (int i= size - 1; i >= 0; i--) { > char c= line.charAt(i); > if (IndentManipulation.isIndentChar(c)) { > end= i; > } else { > break; > } > } > if (end == size) > return line; > else if (end == 0) > return ""; //$NON-NLS-1$ > else > return line.substring(0, end); > } > > /** > * Returns the indent of the given string in indentation units. Odd spaces > * are not counted. > * > * @param line the text line > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @return the number of indent units > * @since 3.1 > */ > public static int computeIndentUnits(String line, IJavaProject project) { > return IndentManipulation.measureIndentUnits(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); > } > > /** > * Returns the indent of the given string in indentation units. Odd spaces > * are not counted. > * > * @param line the text line > * @param tabWidth the width of the '\t' character in space equivalents > * @param indentWidth the width of one indentation unit in space equivalents > * @return the indent of the given string in indentation units > * > * @since 3.1 > */ > public static int computeIndentUnits(String line, int tabWidth, int indentWidth) { > return IndentManipulation.measureIndentUnits(line, tabWidth, indentWidth); > } > > /** > * Computes the visual length of the indentation of a > * <code>CharSequence</code>, counting a tab character as the size until > * the next tab stop and every other whitespace character as one. > * > * @param line the string to measure the indent of > * @param tabSize the visual size of a tab in space equivalents > * @return the visual length of the indentation of <code>line</code> > * @since 3.1 > */ > public static int measureIndentLength(CharSequence line, int tabSize) { > return IndentManipulation.measureIndentInSpaces(line, tabSize); > } > > /** > * Removes the given number of indents from the line. Asserts that the given line > * has the requested number of indents. If <code>indentsToRemove <= 0</code> > * the line is returned. > * @param line the line > * @param indentsToRemove the indents to remove > * > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @return the trimmed line > * > * @since 3.1 > */ > public static String trimIndent(String line, int indentsToRemove, IJavaProject project) { > return IndentManipulation.trimIndent(line, indentsToRemove, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); > } > > /** > * Removes the given number of indents from the line. Asserts that the given line > * has the requested number of indents. If <code>indentsToRemove <= 0</code> > * the line is returned. > * @param line the line > * @param indentsToRemove the indents to remove > * @param tabWidth the tab width > * @param indentWidth the indent width > * @return the trimmed line > * > * @since 3.1 > */ > public static String trimIndent(String line, int indentsToRemove, int tabWidth, int indentWidth) { > return IndentManipulation.trimIndent(line, indentsToRemove, tabWidth, indentWidth); > } > > /** > * Removes the common number of indents from all lines. If a line > * only consists out of white space it is ignored. > * @param lines the lines > > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @since 3.1 > */ > public static void trimIndentation(String[] lines, IJavaProject project) { > trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), true); > } > /** > * Removes the common number of indents from all lines. If a line > * only consists out of white space it is ignored. > * @param lines the lines > * @param tabWidth the size of one tab in space equivalents > * @param indentWidth the size of the indent in space equivalents > * > * @since 3.1 > */ > public static void trimIndentation(String[] lines, int tabWidth, int indentWidth) { > trimIndentation(lines, tabWidth, indentWidth, true); > } > > /** > * Removes the common number of indents from all lines. If a line > * only consists out of white space it is ignored. If <code> > * considerFirstLine</code> is false the first line will be ignored. > * @param lines the lines > * > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @param considerFirstLine If <code>considerFirstLine</code> is false the first line will be ignored. > * @since 3.1 > */ > public static void trimIndentation(String[] lines, IJavaProject project, boolean considerFirstLine) { > trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); > } > > /** > * Removes the common number of indents from all lines. If a line > * only consists out of white space it is ignored. If <code> > * considerFirstLine</code> is false the first line will be ignored. > * @param lines the lines > * @param tabWidth the size of one tab in space equivalents > * @param indentWidth the size of the indent in space equivalents > * @param considerFirstLine If <code> considerFirstLine</code> is false the first line will be ignored. > * @since 3.1 > */ > public static void trimIndentation(String[] lines, int tabWidth, int indentWidth, boolean considerFirstLine) { > String[] toDo= new String[lines.length]; > // find indentation common to all lines > int minIndent= Integer.MAX_VALUE; // very large > for (int i= considerFirstLine ? 0 : 1; i < lines.length; i++) { > String line= lines[i]; > if (containsOnlyWhitespaces(line)) > continue; > toDo[i]= line; > int indent= computeIndentUnits(line, tabWidth, indentWidth); > if (indent < minIndent) { > minIndent= indent; > } > } > > if (minIndent > 0) { > // remove this indent from all lines > for (int i= considerFirstLine ? 0 : 1; i < toDo.length; i++) { > String s= toDo[i]; > if (s != null) > lines[i]= trimIndent(s, minIndent, tabWidth, indentWidth); > else { > String line= lines[i]; > int indent= computeIndentUnits(line, tabWidth, indentWidth); > if (indent > minIndent) > lines[i]= trimIndent(line, minIndent, tabWidth, indentWidth); > else > lines[i]= trimLeadingTabsAndSpaces(line); > } > } > } > } > > /** > * Returns that part of the indentation of <code>line</code> that makes up > * a multiple of indentation units. > * > * @param line the line to scan > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @return the indent part of <code>line</code>, but no odd spaces > * @since 3.1 > */ > public static String getIndentString(String line, IJavaProject project) { > return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); > } > > /** > * Returns that part of the indentation of <code>line</code> that makes up > * a multiple of indentation units. > * > * @param line the line to scan > * @param tabWidth the size of one tab in space equivalents > * @param indentWidth the size of the indent in space equivalents > * @return the indent part of <code>line</code>, but no odd spaces > * @since 3.1 > */ > public static String getIndentString(String line, int tabWidth, int indentWidth) { > return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); > } > > public static String[] removeTrailingEmptyLines(String[] sourceLines) { > int lastNonEmpty= findLastNonEmptyLineIndex(sourceLines); > String[] result= new String[lastNonEmpty + 1]; > for (int i= 0; i < result.length; i++) { > result[i]= sourceLines[i]; > } > return result; > } > > private static int findLastNonEmptyLineIndex(String[] sourceLines) { > for (int i= sourceLines.length - 1; i >= 0; i--) { > if (! sourceLines[i].trim().equals(""))//$NON-NLS-1$ > return i; > } > return -1; > } > > /** > * Change the indent of, possible multi-line, code range. The current indent is removed, a new indent added. > * The first line of the code will not be changed. (It is considered to have no indent as it might start in > * the middle of a line) > * @param code the code > * @param codeIndentLevel level of indentation > * > * @param project the java project from which to get the formatter > * preferences, or <code>null</code> for global preferences > * @param newIndent new indent > * @param lineDelim line delimiter > * @return the changed code > * @since 3.1 > */ > public static String changeIndent(String code, int codeIndentLevel, IJavaProject project, String newIndent, String lineDelim) { > return IndentManipulation.changeIndent(code, codeIndentLevel, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), newIndent, lineDelim); > } > > /** > * Change the indent of, possible muti-line, code range. The current indent is removed, a new indent added. > * The first line of the code will not be changed. (It is considered to have no indent as it might start in > * the middle of a line) > * @param code the code > * @param codeIndentLevel indent level > * @param tabWidth the size of one tab in space equivalents > * @param indentWidth the size of the indent in space equivalents > * @param newIndent new indent > * @param lineDelim line delimiter > * @return the changed code > * @since 3.1 > */ > public static String changeIndent(String code, int codeIndentLevel, int tabWidth, int indentWidth, String newIndent, String lineDelim) { > return IndentManipulation.changeIndent(code, codeIndentLevel, tabWidth, indentWidth, newIndent, lineDelim); > } > > public static String trimIndentation(String source, IJavaProject project, boolean considerFirstLine) { > return trimIndentation(source, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); > } > > public static String trimIndentation(String source, int tabWidth, int indentWidth, boolean considerFirstLine) { > try { > ILineTracker tracker= new DefaultLineTracker(); > tracker.set(source); > int size= tracker.getNumberOfLines(); > if (size == 1) > return source; > String lines[]= new String[size]; > for (int i= 0; i < size; i++) { > IRegion region= tracker.getLineInformation(i); > int offset= region.getOffset(); > lines[i]= source.substring(offset, offset + region.getLength()); > } > Strings.trimIndentation(lines, tabWidth, indentWidth, considerFirstLine); > StringBuffer result= new StringBuffer(); > int last= size - 1; > for (int i= 0; i < size; i++) { > result.append(lines[i]); > if (i < last) > result.append(tracker.getLineDelimiter(i)); > } > return result.toString(); > } catch (BadLocationException e) { > Assert.isTrue(false,"Can not happend"); //$NON-NLS-1$ > return null; > } > } > > > /** > * Concatenate the given strings into one strings using the passed line delimiter as a > * delimiter. No delimiter is added to the last line. > * @param lines the lines > * @param delimiter line delimiter > * @return the concatenated lines > */ > public static String concatenate(String[] lines, String delimiter) { > StringBuffer buffer= new StringBuffer(); > for (int i= 0; i < lines.length; i++) { > if (i > 0) > buffer.append(delimiter); > buffer.append(lines[i]); > } > return buffer.toString(); > } > > public static boolean equals(String s, char[] c) { > if (s.length() != c.length) > return false; > > for (int i = c.length; --i >= 0;) > if (s.charAt(i) != c[i]) > return false; > return true; > } > > public static String removeTrailingCharacters(String text, char toRemove) { > int size= text.length(); > int end= size; > for (int i= size - 1; i >= 0; i--) { > char c= text.charAt(i); > if (c == toRemove) { > end= i; > } else { > break; > } > } > if (end == size) > return text; > else if (end == 0) > return ""; //$NON-NLS-1$ > else > return text.substring(0, end); > } > > public static String removeMnemonicIndicator(String string) { > return LegacyActionTools.removeMnemonics(string); > } >} > >----------------------------------- SOURCE END ------------------------------------- >!STACK 0 >org.eclipse.core.runtime.OperationCanceledException > at org.eclipse.jdt.core.dom.ASTConverter.checkCanceled(ASTConverter.java:403) > at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:419) > at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:180) > at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2709) > at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1266) > at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:280) > at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:206) > at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89) > at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) > at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788) > at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89) > at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151) > at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) > at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:102) > at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) > at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) > > >!ENTRY org.eclipse.jdt.core 4 4 2010-03-24 10:07:20.035 >!MESSAGE Exception occurred during compilation unit conversion: >----------------------------------- SOURCE BEGIN ------------------------------------- >/******************************************************************************* > * Copyright (c) 2008, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.jdt.internal.ui.viewsupport; > >import java.io.File; > >import org.eclipse.osgi.util.TextProcessor; > >import org.eclipse.core.runtime.IPath; > >import org.eclipse.core.resources.IResource; > >import org.eclipse.ui.IWorkingSet; > >import org.eclipse.jdt.core.ITypeRoot; > >import org.eclipse.jdt.internal.corext.util.Strings; > >import org.eclipse.jdt.ui.JavaElementLabels; > >/** > * A label provider for basic elements like paths. The label provider will make sure that the labels are correctly > * shown in RTL environments. > * > * @since 3.4 > */ >public class BasicElementLabels { > > > private static final String FILE_PATTERN_DELIMITER= TextProcessor.getDefaultDelimiters() + "*.?"); //$NON-NLS-1$ > > /** > * Returns the label of a path. > * > * @param path the path > * @param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path. > * @return the label of the path to be used in the UI. > */ > public static String getPathLabel(IPath path, boolean isOSPath) { > String label; > if (isOSPath) { > label= path.toOSString(); > } else { > label= path.makeRelative().toString(); > } > return Strings.markLTR(label); > } > > /** > * Returns the label of the path of a file. > * > * @param file the file > * @return the label of the file path to be used in the UI. > */ > public static String getPathLabel(File file) { > return Strings.markLTR(file.getAbsolutePath()); > } > > /** > * Returns the label for a file pattern like '*.java' > * > * @param name the pattern > * @return the label of the pattern. > */ > public static String getFilePattern(String name) { > return Strings.markLTR(name, FILE_PATTERN_DELIMITERS); > } > > /** > * Returns the label for a URL, URI or URL part. Example is 'http://www.x.xom/s.html#1' > * > * @param name the URL string > * @return the label of the URL. > */ > public static String getURLPart(String name) { > return Strings.markLTR(name, ":@?-"); //$NON-NLS-1$ > } > > /** > * Returns a label for a resource name. > * > * @param resource the resource > * @return the label of the resource name. > */ > public static String getResourceName(IResource resource) { > return Strings.markLTR(resource.getName()); > } > > /** > * Returns a label for a resource name. > * > * @param resourceName the resource name > * @return the label of the resource name. > */ > public static String getResourceName(String resourceName) { > return Strings.markLTR(resourceName); > } > > /** > * Returns a label for a type root name which is a file name. > * > * @param typeRoot the typeRoot > * @return the label of the resource name. > */ > public static String getFileName(ITypeRoot typeRoot) { > return Strings.markLTR(typeRoot.getElementName()); > } > > /** > * Returns a label for Java element name. Example is 'new Test<? extends List>() { ...}'. > * This method should only be used for simple element names. Use > * {@link JavaElementLabels} to create a label from a Java element or {@link BindingLabelProvider} > * for labels of bindings. > * > * @param name the Java element name. > * @return the label for the Java element > */ > public static String getJavaElementName(String name) { > return Strings.markJavaElementLTR(name); > } > > /** > * Returns a label for Java code snippet used in a label. Example is 'Test test= new Test<? extends List>() { ...}'. > * > * @param string the Java code snippet > * @return the label for the Java code snippet > */ > public static String getJavaCodeString(String string) { > return Strings.markLTR(string, "<>()?,{}+-*!%=^|&;[]~"); //$NON-NLS-1$ > } > > /** > * Returns a label for a version name. Example is '1.4.1' > * > * @param name the version string > * @return the version label > */ > public static String getVersionName(String name) { > return Strings.markLTR(name); > } > > /** > * Returns a label for a working set > * > * @param set the working set > * @return the label of the working set > */ > public static String getWorkingSetLabel(IWorkingSet set) { > return Strings.markLTR(set.getLabel()); > } > > >} > >----------------------------------- SOURCE END ------------------------------------- >!STACK 0 >org.eclipse.core.runtime.OperationCanceledException > at org.eclipse.jdt.core.dom.ASTConverter.checkCanceled(ASTConverter.java:403) > at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2658) > at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1266) > at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:280) > at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:203) > at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258) > at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515) > at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1079) > at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:170) > at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89) > at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) > at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788) > at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1244) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89) > at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87) > at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151) > at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) > at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:102) > at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) > at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 306917
: 162850 |
163133