org.eclipse.jdt.internal.compiler.lookup.BlockScope.isLambdaSubscope()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(15.1k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.isLambdaSubscope()方法的一些代码示例,展示了BlockScope.isLambdaSubscope()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.isLambdaSubscope()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:isLambdaSubscope

BlockScope.isLambdaSubscope介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {
  LocalDeclaration local = binding.declaration;
  IJavaElement parent = null;
  if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {
    HashSet existingElements = new HashSet();
    HashMap knownScopes = new HashMap();

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {
  LocalDeclaration local = binding.declaration;
  IJavaElement parent = null;
  if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {
    HashSet existingElements = new HashSet();
    HashMap knownScopes = new HashMap();

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {
  LocalDeclaration local = binding.declaration;
  IJavaElement parent = null;
  if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {
    HashSet existingElements = new HashSet();
    HashMap knownScopes = new HashMap();

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {
  LocalDeclaration local = binding.declaration;
  IJavaElement parent = null;
  if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {
    HashSet existingElements = new HashSet();
    HashMap knownScopes = new HashMap();

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {
  LocalDeclaration local = binding.declaration;
  IJavaElement parent = null;
  if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {
    HashSet existingElements = new HashSet();
    HashMap knownScopes = new HashMap();

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0)	{
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
  // perform some extra emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
    }
  }
  }
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0)	{
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
  // perform some extra emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
    }
  }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();

  // perform some emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {

    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
      // request cascade of accesses
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
      // request cascade of accesses
    }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0)	{
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
  // perform some extra emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
    }
  }
  }
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();

  // perform some emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {

    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
      // request cascade of accesses
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
      // request cascade of accesses
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();

  // perform some emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {

    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
      // request cascade of accesses
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
      // request cascade of accesses
    }
  }
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();

  // perform some emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {

    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
      // request cascade of accesses
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
      // request cascade of accesses
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0)	{
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
  // perform some extra emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
    }
  }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0)	{
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
  // perform some extra emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
    }
  }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private JavaElement getJavaElement(LocalVariableBinding binding) {
  LocalDeclaration local = binding.declaration;
  JavaElement parent = null;
  ReferenceContext referenceContext = binding.declaringScope.isLambdaSubscope() ? binding.declaringScope.namedMethodScope().referenceContext() : binding.declaringScope.referenceContext();
  if (referenceContext instanceof AbstractMethodDeclaration) {
    AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
    parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
  } else if (referenceContext instanceof TypeDeclaration){
    // Local variable is declared inside an initializer
    TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
    JavaElement type = this.getJavaElementOfCompilationUnit(typeDeclaration, typeDeclaration.binding);
    parent = Util.getUnresolvedJavaElement(local.sourceStart, local.sourceEnd, type);
  }
  if (parent == null) return null;
  return new LocalVariable(
      parent,
      new String(local.name),
      local.declarationSourceStart,
      local.declarationSourceEnd,
      local.sourceStart,
      local.sourceEnd,
      local.type == null ? Signature.createTypeSignature(binding.type.signableName(), true) : Util.typeSignature(local.type),
      binding.declaration.annotations,
      local.modifiers,
      local.getKind() == AbstractVariableDeclaration.PARAMETER);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
  if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
  ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();

  // perform some emulation work in case there is some and we are inside a local type only
  if (allocatedTypeErasure.isNestedType()
    && (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {

    if (allocatedTypeErasure.isLocalType()) {
      ((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
      // request cascade of accesses
    } else {
      // locally propagate, since we already now the desired shape for sure
      currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
      // request cascade of accesses
    }
  }
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

private JavaElement getJavaElement(LocalVariableBinding binding) {
  LocalDeclaration local = binding.declaration;
  JavaElement parent = null;
  ReferenceContext referenceContext = binding.declaringScope.isLambdaSubscope() ? binding.declaringScope.namedMethodScope().referenceContext() : binding.declaringScope.referenceContext();
  if (referenceContext instanceof AbstractMethodDeclaration) {
    AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
    parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
  } else if (referenceContext instanceof TypeDeclaration){
    // Local variable is declared inside an initializer
    TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
    JavaElement type = this.getJavaElementOfCompilationUnit(typeDeclaration, typeDeclaration.binding);
    parent = Util.getUnresolvedJavaElement(local.sourceStart, local.sourceEnd, type);
  }
  if (parent == null) return null;
  return new LocalVariable(
      parent,
      new String(local.name),
      local.declarationSourceStart,
      local.declarationSourceEnd,
      local.sourceStart,
      local.sourceEnd,
      local.type == null ? Signature.createTypeSignature(binding.type.signableName(), true) : Util.typeSignature(local.type),
      binding.declaration.annotations,
      local.modifiers,
      local.getKind() == AbstractVariableDeclaration.PARAMETER);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private JavaElement getJavaElement(LocalVariableBinding binding) {
  LocalDeclaration local = binding.declaration;
  JavaElement parent = null;
  ReferenceContext referenceContext = binding.declaringScope.isLambdaSubscope() ? binding.declaringScope.namedMethodScope().referenceContext() : binding.declaringScope.referenceContext();
  if (referenceContext instanceof AbstractMethodDeclaration) {
    AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
    parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
  } else if (referenceContext instanceof TypeDeclaration){
    // Local variable is declared inside an initializer
    TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
    JavaElement type = this.getJavaElementOfCompilationUnit(typeDeclaration, typeDeclaration.binding);
    parent = Util.getUnresolvedJavaElement(local.sourceStart, local.sourceEnd, type);
  }
  if (parent == null) return null;
  return new LocalVariable(
      parent,
      new String(local.name),
      local.declarationSourceStart,
      local.declarationSourceEnd,
      local.sourceStart,
      local.sourceEnd,
      local.type == null ? Signature.createTypeSignature(binding.type.signableName(), true) : Util.typeSignature(local.type),
      binding.declaration.annotations,
      local.modifiers,
      local.getKind() == AbstractVariableDeclaration.PARAMETER);
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

} else if (existingType instanceof LocalTypeBinding && blockScope.isLambdaSubscope()
    && blockScope.enclosingLambdaScope().enclosingMethodScope() == ((LocalTypeBinding) existingType).scope.methodScope()) {
  blockScope.problemReporter().duplicateNestedType(this);

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

} else if (existingType instanceof LocalTypeBinding && blockScope.isLambdaSubscope()
    && blockScope.enclosingLambdaScope().enclosingMethodScope() == ((LocalTypeBinding) existingType).scope.methodScope()) {
  blockScope.problemReporter().duplicateNestedType(this);

相关文章

微信公众号

最新文章

更多

BlockScope类方法