本文整理汇总了Java中org.eclipse.jdt.internal.core.util.Util.verbose方法的典型用法代码示例。如果您正苦于以下问题:Java Util.verbose方法的具体用法?Java Util.verbose怎么用?Java Util.verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.core.util.Util
的用法示例。
在下文中一共展示了Util.verbose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readJavaLikeNamesFile
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private char[][] readJavaLikeNamesFile() {
try {
String pathName = getJavaPluginWorkingLocation().toOSString();
File javaLikeNamesFile = new File(pathName, "javaLikeNames.txt"); // $NON-NLS-1$
if (!javaLikeNamesFile.exists()) return null;
char[] javaLikeNames =
org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(javaLikeNamesFile, null);
if (javaLikeNames.length > 0) {
char[][] names = CharOperation.splitOn('\n', javaLikeNames);
return names;
}
} catch (IOException ignored) {
if (JobManager.VERBOSE) Util.verbose("Failed to read javaLikeNames file"); // $NON-NLS-1$
}
return null;
}
示例2: rebuildIndex
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void rebuildIndex(IndexLocation indexLocation, IPath containerPath) {
Object target = JavaModelManager.getTarget(containerPath, true);
if (target == null) return;
if (JobManager.VERBOSE)
Util.verbose(
"-> request to rebuild index: "
+ indexLocation
+ " path: "
+ containerPath); // $NON-NLS-1$ //$NON-NLS-2$
updateIndexState(indexLocation, REBUILDING_STATE);
IndexRequest request = null;
if (target instanceof IProject) {
IProject p = (IProject) target;
if (JavaProject.hasJavaNature(p)) request = new IndexAllProject(p, this);
} else if (target instanceof IFolder) {
request = new IndexBinaryFolder((IFolder) target, this);
} else if (target instanceof IFile) {
request = new AddJarFileToIndex((IFile) target, null, this);
} else if (target instanceof File) {
request = new AddJarFileToIndex(containerPath, null, this);
}
if (request != null) request(request);
}
示例3: readParticipantsIndexNamesFile
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void readParticipantsIndexNamesFile() {
SimpleLookupTable containers = new SimpleLookupTable(3);
try {
char[] participantIndexNames =
org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(
this.participantIndexNamesFile, null);
if (participantIndexNames.length > 0) {
char[][] names = CharOperation.splitOn('\n', participantIndexNames);
if (names.length >= 3) {
// First line is DiskIndex signature (see writeParticipantsIndexNamesFile())
if (DiskIndex.SIGNATURE.equals(new String(names[0]))) {
for (int i = 1, l = names.length - 1; i < l; i += 2) {
IndexLocation indexLocation =
new FileIndexLocation(new File(new String(names[i])), true);
containers.put(indexLocation, new Path(new String(names[i + 1])));
}
}
}
}
} catch (IOException ignored) {
if (JobManager.VERBOSE)
Util.verbose("Failed to read participant index file names"); // $NON-NLS-1$
}
this.participantsContainers = containers;
return;
}
示例4: reset
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
/**
* Flush current state
*/
public synchronized void reset() {
if (VERBOSE)
Util.verbose("Reset"); //$NON-NLS-1$
if (this.processingThread != null) {
discardJobs(null); // discard all jobs
} else {
/* initiate background processing */
this.processingThread = new Thread(this, processName());
this.processingThread.setDaemon(true);
// less prioritary by default, priority is raised if clients are actively waiting on it
this.processingThread.setPriority(Thread.NORM_PRIORITY-1);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=296343
// set the context loader to avoid leaking the current context loader
this.processingThread.setContextClassLoader(this.getClass().getClassLoader());
this.processingThread.start();
}
}
示例5: removeIndexesState
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private synchronized void removeIndexesState(IndexLocation[] locations) {
getIndexStates(); // ensure the states are initialized
int length = locations.length;
boolean changed = false;
for (int i=0; i<length; i++) {
if (locations[i] == null) continue;
if ((this.indexStates.removeKey(locations[i]) != null)) {
changed = true;
if (VERBOSE) {
Util.verbose("-> index state updated to: ? for: "+locations[i]); //$NON-NLS-1$
}
}
}
if (!changed) return;
writeSavedIndexNamesFile();
writeIndexMapFile();
}
示例6: readIndexMap
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void readIndexMap() {
try {
char[] indexMaps = org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(this.indexNamesMapFile, null);
char[][] names = CharOperation.splitOn('\n', indexMaps);
if (names.length >= 3) {
// First line is DiskIndex signature (see writeIndexMapFile())
String savedSignature = DiskIndex.SIGNATURE;
if (savedSignature.equals(new String(names[0]))) {
for (int i = 1, l = names.length-1 ; i < l ; i+=2) {
IndexLocation indexPath = IndexLocation.createIndexLocation(new URL(new String(names[i])));
if (indexPath == null) continue;
this.indexLocations.put(new Path(new String(names[i+1])), indexPath );
this.indexStates.put(indexPath, REUSE_STATE);
}
}
}
} catch (IOException ignored) {
if (VERBOSE)
Util.verbose("Failed to read saved index file names"); //$NON-NLS-1$
}
return;
}
示例7: verbose_failure
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void verbose_failure(CoreException e) {
Util.verbose(
"CPContainer SET - FAILED DUE TO EXCEPTION\n"
+ // $NON-NLS-1$
" container path: "
+ this.containerPath, // $NON-NLS-1$
System.err);
e.printStackTrace();
}
示例8: verbose_update_project
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void verbose_update_project(JavaProject affectedProject) {
Util.verbose(
"CPContainer SET - updating affected project due to setting container\n"
+ // $NON-NLS-1$
" project: "
+ affectedProject.getElementName()
+ '\n'
+ // $NON-NLS-1$
" container path: "
+ this.containerPath); // $NON-NLS-1$
}
示例9: writeSavedIndexNamesFile
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void writeSavedIndexNamesFile() {
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(this.savedIndexNamesFile));
writer.write(DiskIndex.SIGNATURE);
writer.write('+');
writer.write(getJavaPluginWorkingLocation().toOSString());
writer.write('\n');
Object[] keys = this.indexStates.keyTable;
Object[] states = this.indexStates.valueTable;
for (int i = 0, l = states.length; i < l; i++) {
IndexLocation key = (IndexLocation) keys[i];
if (key != null && states[i] == SAVED_STATE) {
writer.write(key.fileName());
writer.write('\n');
}
}
} catch (IOException ignored) {
if (JobManager.VERBOSE)
Util.verbose("Failed to write saved index file names", System.err); // $NON-NLS-1$
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// ignore
}
}
}
}
示例10: verbose_missbehaving_container
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
void verbose_missbehaving_container(
IJavaProject project, IPath containerPath, IClasspathEntry[] classpathEntries) {
Util.verbose(
"CPContainer GET - missbehaving container (returning null classpath entry)\n"
+ // $NON-NLS-1$
" project: "
+ project.getElementName()
+ '\n'
+ // $NON-NLS-1$
" container path: "
+ containerPath
+ '\n'
+ // $NON-NLS-1$
" classpath entries: {\n"
+ // $NON-NLS-1$
org.eclipse.jdt.internal.compiler.util.Util.toString(
classpathEntries,
new org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
public String displayString(Object o) {
StringBuffer buffer = new StringBuffer(" "); // $NON-NLS-1$
if (o == null) {
buffer.append("<null>"); // $NON-NLS-1$
return buffer.toString();
}
buffer.append(o);
return buffer.toString();
}
})
+ "\n }" // $NON-NLS-1$
);
}
示例11: writeParticipantsIndexNamesFile
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private void writeParticipantsIndexNamesFile() {
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(this.participantIndexNamesFile));
writer.write(DiskIndex.SIGNATURE);
writer.write('\n');
Object[] indexFiles = this.participantsContainers.keyTable;
Object[] containers = this.participantsContainers.valueTable;
for (int i = 0, l = indexFiles.length; i < l; i++) {
IndexLocation indexFile = (IndexLocation) indexFiles[i];
if (indexFile != null) {
writer.write(indexFile.getIndexFile().getPath());
writer.write('\n');
writer.write(((IPath) containers[i]).toOSString());
writer.write('\n');
}
}
} catch (IOException ignored) {
if (JobManager.VERBOSE)
Util.verbose("Failed to write participant index file names", System.err); // $NON-NLS-1$
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// ignore
}
}
}
}
示例12: getIndexStates
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private SimpleLookupTable getIndexStates() {
if (this.indexStates != null) return this.indexStates;
this.indexStates = new SimpleLookupTable();
File indexesDirectoryPath = getSavedIndexesDirectory();
char[][] savedNames = readIndexState(getJavaPluginWorkingLocation().toOSString());
if (savedNames != null) {
for (int i = 1, l = savedNames.length;
i < l;
i++) { // first name is saved signature, see readIndexState()
char[] savedName = savedNames[i];
if (savedName.length > 0) {
IndexLocation indexLocation =
new FileIndexLocation(
new File(
indexesDirectoryPath,
String.valueOf(savedName))); // shares indexesDirectoryPath's segments
if (JobManager.VERBOSE)
Util.verbose("Reading saved index file " + indexLocation); // $NON-NLS-1$
this.indexStates.put(indexLocation, SAVED_STATE);
}
}
} else {
// All the index files are getting deleted and hence there is no need to
// further check for change in javaLikeNames.
writeJavaLikeNamesFile();
this.javaLikeNamesChanged = false;
deleteIndexFiles();
}
readIndexMap();
return this.indexStates;
}
示例13: hasJavaLikeNamesChanged
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
private boolean hasJavaLikeNamesChanged() {
char[][] currentNames = org.eclipse.jdt.internal.core.util.Util.getJavaLikeExtensions();
int current = currentNames.length;
char[][] prevNames = readJavaLikeNamesFile();
if (prevNames == null) {
if (JobManager.VERBOSE && current != 1)
Util.verbose(
"No Java like names found and there is atleast one non-default javaLikeName",
System.err); // $NON-NLS-1$
return (current != 1); // Ignore if only java
}
int prev = prevNames.length;
if (current != prev) {
if (JobManager.VERBOSE)
Util.verbose("Java like names have changed", System.err); // $NON-NLS-1$
return true;
}
if (current > 1) {
// Sort the current java like names.
// Copy the array to avoid modifying the Util static variable
System.arraycopy(currentNames, 0, currentNames = new char[current][], 0, current);
Util.sort(currentNames);
}
// The JavaLikeNames would have been sorted before getting stored in the file,
// hence just do a direct compare.
for (int i = 0; i < current; i++) {
if (!CharOperation.equals(currentNames[i], prevNames[i])) {
if (JobManager.VERBOSE)
Util.verbose("Java like names have changed", System.err); // $NON-NLS-1$
return true;
}
}
return false;
}
示例14: removeIndex
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
/** Removes the index for a given path. This is a no-op if the index did not exist. */
public synchronized void removeIndex(IPath containerPath) {
if (JobManager.VERBOSE || DEBUG) Util.verbose("removing index " + containerPath); // $NON-NLS-1$
IndexLocation indexLocation = computeIndexLocation(containerPath);
Index index = getIndex(indexLocation);
File indexFile = null;
if (index != null) {
index.monitor = null;
indexFile = index.getIndexFile();
}
if (indexFile == null)
indexFile =
indexLocation
.getIndexFile(); // index is not cached yet, but still want to delete the file
if (this.indexStates.get(indexLocation) == REUSE_STATE) {
indexLocation.close();
this.indexLocations.put(containerPath, null);
} else if (indexFile != null && indexFile.exists()) {
if (DEBUG) Util.verbose("removing index file " + indexFile); // $NON-NLS-1$
indexFile.delete();
}
this.indexes.removeKey(indexLocation);
if (IS_MANAGING_PRODUCT_INDEXES_PROPERTY) {
this.indexLocations.removeKey(containerPath);
}
updateIndexState(indexLocation, null);
}
示例15: resetIndex
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
/** Resets the index for a given path. Returns true if the index was reset, false otherwise. */
public synchronized boolean resetIndex(IPath containerPath) {
// only called to over write an existing cached index...
String containerPathString =
containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
try {
// Path is already canonical
IndexLocation indexLocation = computeIndexLocation(containerPath);
Index index = getIndex(indexLocation);
if (JobManager.VERBOSE) {
Util.verbose(
"-> reseting index: "
+ indexLocation
+ " for path: "
+ containerPathString); // $NON-NLS-1$ //$NON-NLS-2$
}
if (index == null) {
// the index does not exist, try to recreate it
return recreateIndex(containerPath) != null;
}
index.reset();
return true;
} catch (IOException e) {
// The file could not be created. Possible reason: the project has been deleted.
if (JobManager.VERBOSE) {
Util.verbose("-> failed to reset index for path: " + containerPathString); // $NON-NLS-1$
e.printStackTrace();
}
return false;
}
}