• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TypeComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.jdi.TypeComponent的典型用法代码示例。如果您正苦于以下问题:Java TypeComponent类的具体用法?Java TypeComponent怎么用?Java TypeComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeComponent类属于com.sun.jdi包,在下文中一共展示了TypeComponent类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setFieldValueWithConflict

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
private Value setFieldValueWithConflict(ObjectReference obj, List<Field> fields, String name, String belongToClass,
                                        String value, Map<String, Object> options) throws ClassNotLoadedException, InvalidTypeException {
    Field field;
    // first try to resolve field by fully qualified name
    List<Field> narrowedFields = fields.stream().filter(TypeComponent::isStatic)
            .filter(t -> t.name().equals(name) && t.declaringType().name().equals(belongToClass))
            .collect(Collectors.toList());
    if (narrowedFields.isEmpty()) {
        // second try to resolve field by formatted name
        narrowedFields = fields.stream().filter(TypeComponent::isStatic)
                .filter(t -> t.name().equals(name)
                        && context.getVariableFormatter().typeToString(t.declaringType(), options).equals(belongToClass))
                .collect(Collectors.toList());
    }
    if (narrowedFields.size() == 1) {
        field = narrowedFields.get(0);
    } else {
        throw new UnsupportedOperationException(String.format("SetVariableRequest: Name conflicted for %s.", name));
    }
    return field.isStatic() ? setStaticFieldValue(field.declaringType(), field, name, value, options)
            : this.setObjectFieldValue(obj, field, name, value, options);
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:23,代码来源:SetVariableRequestHandler.java


示例2: isSynthetic

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
@Override
public boolean isSynthetic(TypeComponent typeComponent) {
  String name = typeComponent.name();
  if (LambdaMethodFilter.isLambdaName(name)) {
    return false;
  }
  else {
    ReferenceType type = typeComponent.declaringType();
    if (type.name().contains("$$Lambda$")) {
      return true;
    }
  }
  VirtualMachine machine = typeComponent.virtualMachine();
  if (machine != null && machine.canGetSyntheticAttribute()) {
    return typeComponent.isSynthetic();
  }
  else {
    return name.contains("$");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DefaultSyntheticProvider.java


示例3: listStaticVariables

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
/**
 * Get the static variable of an stack frame.
 *
 * @param stackFrame
 *            the stack frame
 * @return the static variable of an stack frame.
 */
public static List<Variable> listStaticVariables(StackFrame stackFrame) {
    List<Variable> res = new ArrayList<>();
    ReferenceType type = stackFrame.location().declaringType();
    type.allFields().stream().filter(TypeComponent::isStatic).forEach(field -> {
        Variable staticVar = new Variable(field.name(), type.getValue(field));
        staticVar.field = field;
        res.add(staticVar);
    });
    return res;
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:18,代码来源:VariableUtils.java


示例4: hasBlueprintProtectionDomain

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
private static boolean hasBlueprintProtectionDomain(ObjectReference context) {
  return context
      .referenceType()
      .allFields()
      .stream()
      .map(TypeComponent::name)
      .anyMatch("bundleContext"::equals);
}
 
开发者ID:coyotesqrl,项目名称:acdebugger,代码行数:9,代码来源:BreakpointProcessor.java


示例5: hasBundleProtectionDomain

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
private static boolean hasBundleProtectionDomain(ObjectReference context) {
  return context
      .referenceType()
      .allFields()
      .stream()
      .map(TypeComponent::name)
      .anyMatch("bundle"::equals);
}
 
开发者ID:coyotesqrl,项目名称:acdebugger,代码行数:9,代码来源:BreakpointProcessor.java


示例6: getWeight

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
@Override
public double getWeight(TypeComponent comp) {
	if (comp instanceof Method)
		return ProbabilityComputer.getMethodProbability((Method)comp, weights) * getMethodFudge(((Method)comp));
	else if (comp instanceof Field)
		return ProbabilityComputer.getFieldProbability((Field)comp, weights);
	else
		throw new IllegalArgumentException(String.valueOf(comp));
}
 
开发者ID:jgalenson,项目名称:codehint,代码行数:10,代码来源:MethodFieldWeightedList.java


示例7: getWeight

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
@Override
public double getWeight(TypeComponent comp) {
	double weight = super.getWeight(comp);
	IJavaType type = comp instanceof Field ? EclipseUtils.getTypeAndLoadIfNeeded(((Field)comp).typeName(), stack, target, typeCache) : getReturnType(receiver, (Method)comp, ((Method)comp).isConstructor());
	try {
		weight *= getTypeFactor(type);
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
	return weight;
}
 
开发者ID:jgalenson,项目名称:codehint,代码行数:12,代码来源:StochasticExpressionGenerator.java


示例8: F3TypeComponent

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
public F3TypeComponent(F3VirtualMachine f3vm, TypeComponent underlying) {
    super(f3vm, underlying);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:4,代码来源:F3TypeComponent.java


示例9: underlying

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
@Override
protected TypeComponent underlying() {
    return (TypeComponent) super.underlying();
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:5,代码来源:F3TypeComponent.java


示例10: createModifiers

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
/**
 * TODO: reduce the cyclomatic complexity.
 */
private Set<NodeModifier> createModifiers(final TypeComponent member)
{
  final Set<NodeModifier> modifiers = new LinkedHashSet<NodeModifier>();
  // final
  if (member.isFinal())
  {
    modifiers.add(NM_FINAL);
  }
  // static
  if (member.isStatic())
  {
    modifiers.add(NM_STATIC);
  }
  // transient
  if (member instanceof Field && ((Field) member).isTransient())
  {
    modifiers.add(NM_TRANSIENT);
  }
  // volatile
  if (member instanceof Field && ((Field) member).isVolatile())
  {
    modifiers.add(NM_VOLATILE);
  }
  // bridge method (for covariance in generic types)
  if (member instanceof Method && ((Method) member).isBridge())
  {
    modifiers.add(NM_BRIDGE);
  }
  // constructor
  if (member instanceof Method && ((Method) member).isConstructor())
  {
    modifiers.add(NM_CONSTRUCTOR);
  }
  // compiler generated method (e.g., bridges, constructors)
  if (member instanceof Method && ((Method) member).isSynthetic())
  {
    modifiers.add(NM_SYNTHETIC);
  }
  return modifiers;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:44,代码来源:StaticModelDelegateForJDI.java


示例11: createVisibility

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
private NodeVisibility createVisibility(final TypeComponent member)
{
  return member.isPackagePrivate() ? NV_PACKAGE : member.isPrivate() ? NV_PRIVATE : member
      .isProtected() ? NV_PROTECTED : NV_PUBLIC;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:6,代码来源:StaticModelDelegateForJDI.java


示例12: isSynthetic

import com.sun.jdi.TypeComponent; //导入依赖的package包/类
boolean isSynthetic(TypeComponent typeComponent); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:SyntheticTypeComponentProvider.java



注:本文中的com.sun.jdi.TypeComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TiContext类代码示例发布时间:2022-05-23
下一篇:
Java Annotation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap