本文整理汇总了Java中com.sun.tools.javac.util.Log.error方法的典型用法代码示例。如果您正苦于以下问题:Java Log.error方法的具体用法?Java Log.error怎么用?Java Log.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.util.Log
的用法示例。
在下文中一共展示了Log.error方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceOne
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
private <T extends Attribute.Compound> T replaceOne(Placeholder<T> placeholder, Annotate.AnnotateRepeatedContext<T> ctx) {
Log log = ctx.log;
// Process repeated annotations
T validRepeated = ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym);
if (validRepeated != null) {
// Check that the container isn't manually
// present along with repeated instances of
// its contained annotation.
ListBuffer<T> manualContainer = ctx.annotated.get(validRepeated.type.tsym);
if (manualContainer != null) {
log.error(ctx.pos.get(manualContainer.first()), "invalid.repeatable.annotation.repeated.and.container.present",
manualContainer.first().type.tsym);
}
}
// A null return will delete the Placeholder
return validRepeated;
}
示例2: checkOptionName
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
private boolean checkOptionName(String optionName, Log log) {
boolean valid = isValidOptionName(optionName);
if (!valid)
log.error("proc.processor.bad.option.name",
optionName,
processor.getClass().getName());
return valid;
}
示例3: ServiceIterator
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
ServiceIterator(ClassLoader classLoader, Log log) {
this.log = log;
try {
try {
loader = ServiceLoader.load(Processor.class, classLoader);
this.iterator = loader.iterator();
} catch (Exception e) {
// Fail softly if a loader is not actually needed.
this.iterator = handleServiceLoaderUnavailability("proc.no.service", null);
}
} catch (Throwable t) {
log.error("proc.service.problem");
throw new Abort(t);
}
}
示例4: ServiceIterator
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
ServiceIterator(ClassLoader classLoader, Log log) {
this.log = log;
try {
try {
loader = ServiceLoader.load(Processor.class, classLoader);
this.iterator = loader.iterator();
} catch (Exception e) {
// Fail softly if a loader is not actually needed.
this.iterator = handleServiceLoaderUnavailability("proc.no.service", null);
}
} catch (Throwable t) {
log.error(Errors.ProcServiceProblem);
throw new Abort(t);
}
}
示例5: checkOptionName
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
private boolean checkOptionName(String optionName, Log log) {
boolean valid = isValidOptionName(optionName);
if (!valid)
log.error(Errors.ProcProcessorBadOptionName(optionName,
processor.getClass().getName()));
return valid;
}
示例6: ServiceIterator
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
ServiceIterator(ClassLoader classLoader, Log log) {
String loadMethodName;
this.log = log;
try {
try {
loaderClass = Class.forName("java.util.ServiceLoader");
loadMethodName = "load";
jusl = true;
} catch (ClassNotFoundException cnfe) {
try {
loaderClass = Class.forName("sun.misc.Service");
loadMethodName = "providers";
jusl = false;
} catch (ClassNotFoundException cnfe2) {
// Fail softly if a loader is not actually needed.
this.iterator = handleServiceLoaderUnavailability("proc.no.service",
null);
return;
}
}
// java.util.ServiceLoader.load or sun.misc.Service.providers
Method loadMethod = loaderClass.getMethod(loadMethodName,
Class.class,
ClassLoader.class);
Object result = loadMethod.invoke(null,
Processor.class,
classLoader);
// For java.util.ServiceLoader, we have to call another
// method to get the iterator.
if (jusl) {
loader = result; // Store ServiceLoader to call reload later
Method m = loaderClass.getMethod("iterator");
result = m.invoke(result); // serviceLoader.iterator();
}
// The result should now be an iterator.
this.iterator = (Iterator<?>) result;
} catch (Throwable t) {
log.error("proc.service.problem");
throw new Abort(t);
}
}