TODO(user), remove once we merge jdk8 specific's with core
5981
@Nullable
  private static <T> TreePath findEnclosingMethodOrLambdaOrInitializer(TreePath path) {
    while (path != null) {
      if (path.getLeaf() instanceof MethodTree) {
        return path;
      }
      TreePath parent = path.getParentPath();
      if (parent != null) {
        if (parent.getLeaf() instanceof ClassTree) {
          if (path.getLeaf() instanceof BlockTree) {
            // this is a class or instance initializer block
            return path;
          }
          if (path.getLeaf() instanceof VariableTree
              && ((VariableTree) path.getLeaf()).getInitializer() != null) {
            // this is a field with an inline initializer
            return path;
          }
        }
        if (parent.getLeaf() instanceof LambdaExpressionTree) {
          return parent;
        }
      }
      path = parent;
    }
    return null;
  }
1136472
@Override
	public void removeByC_C_T_ST(long classNameId, long classPK, int type,
		int status) {
		for (CPAttachmentFileEntry cpAttachmentFileEntry : findByC_C_T_ST(
				classNameId, classPK, type, status, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(cpAttachmentFileEntry);
		}
	}
796958
public void mergeWith(Core o) {
    o.num = this.num = (num < o.num ? num : o.num);
  }
55285
public static void remove() {

        final String current = System.getProperties().getProperty(HANDLER_PKGS, "");

        // Only one
        if (current.equals(PKG)) {
            System.getProperties().put(HANDLER_PKGS, "");
            return;
        }

        // Middle
        String token = "|" + PKG + "|";
        int idx = current.indexOf(token);
        if (idx > -1) {
            final String removed = current.substring(0, idx) + "|" + current.substring(idx + token.length());
            System.getProperties().put(HANDLER_PKGS, removed);
            return;
        }

        // Beginning
        token = PKG + "|";
        idx = current.indexOf(token);
        if (idx > -1) {
            final String removed = current.substring(idx + token.length());
            System.getProperties().put(HANDLER_PKGS, removed);
            return;
        }

        // End
        token = "|" + PKG;
        idx = current.indexOf(token);
        if (idx > -1) {
            final String removed = current.substring(0, idx);
            System.getProperties().put(HANDLER_PKGS, removed);
            return;
        }

    }
258213
private boolean cleanupInventory() {
		boolean modified = false;
		modified |= removeUnreadable();
		modified |= recreateMismatching();
		modified |= importConfigurations();
		return modified;
	}
587344
@SuppressWarnings("unchecked")
	protected void removeCurrentTypeConversion() {
		final IStructuredSelection selection = this.list.getStructuredSelection();
		final String[] types = new String[selection.size()];
		final Iterator<ConversionMapping> iter = selection.iterator();
		int i = 0;
		while (iter.hasNext()) {
			types[i] = iter.next().getSource();
			i++;
		}
		removeTypeConversions(types);
	}
521692
def cleanup(arctic_lib, symbol, version_ids, versions_coll, shas_to_delete=None, pointers_cfgs=None):
    
    pointers_cfgs = set(pointers_cfgs) if pointers_cfgs else set()
    collection = arctic_lib.get_top_level_collection()
    version_ids = list(version_ids)

    # Iterate versions to check if they are created only with fw pointers, parent pointers (old), or mixed
    # Keep in mind that the version is not yet inserted.
    all_symbol_pointers_cfgs = _get_symbol_pointer_cfgs(symbol, versions_coll)
    all_symbol_pointers_cfgs.update(pointers_cfgs)

    # All the versions of the symbol have been created with old arctic or with disabled forward pointers.
    # Preserves backwards compatibility and regression for old pointers implementation.
    if all_symbol_pointers_cfgs == {FwPointersCfg.DISABLED} or not all_symbol_pointers_cfgs:
        _cleanup_parent_pointers(collection, symbol, version_ids)
        return

    # All the versions of the symbol we wish to delete have been created with forward pointers
    if FwPointersCfg.DISABLED not in all_symbol_pointers_cfgs:
        _cleanup_fw_pointers(collection, symbol, version_ids, versions_coll,
                             shas_to_delete=shas_to_delete, do_clean=True)
        return

    # Reaching here means the symbol has versions with mixed forward pointers and legacy/parent pointer configurations
    _cleanup_mixed(symbol, collection, version_ids, versions_coll)
1079468
function cleanUpOldExecutable(next) {
        fs.unlink(nodeCompiler.releasePath, function(err) {
          if (err) {
            if (err.code === 'ENOENT') {
              next();
            } else {
              throw err;
            }
          } else {
            next();
          }
        });
      }
262799
public Datatype.Builder removeStandardMethodUnderrides(StandardMethod key) {
    Objects.requireNonNull(key);
    standardMethodUnderrides.remove(key);
    return (Datatype.Builder) this;
  }
14132
function destroy(oListener) {
		for (var n in mTargets) {
			var oTargetConfig = mTargets[n];
			for (var i = 0; i < oTargetConfig.listeners.length; i++) {
				if (oTargetConfig.listeners[i] === oListener) {
					oTargetConfig.listeners.splice(i, 1);
					oTargetConfig.configurations.splice(i, 1);
				}
			}
			if (oTargetConfig.listeners && oTargetConfig.listeners.length === 0) {
				delete mTargets[n];
				oTargetConfig.object._observer = undefined;
			}
		}
	}
144135
function remove(oTarget, oListener, oConfiguration) {
		oConfiguration = oConfiguration || getConfiguration(oTarget, oListener);
		updateConfiguration(oTarget, oListener, oConfiguration, true);
	}
1229168
public void removeTangoArchiveListener(ITangoArchiveListener listener, String attrName)
            throws DevFailed {
        synchronized (moni) {
            TangoArchive tangoArchive;
            String key = deviceName+"/"+attrName;
            if ((tangoArchive = tango_archive_source.get(key)) != null)
                tangoArchive.removeTangoArchiveListener(listener);
        }
    }
309136
private static boolean isJDK_N_OrHigher(int n) {
        List<String> versionList = new ArrayList<String>();
        // this code should work at least until JDK 10 (assuming n parameter is
        // always 6 or more)
        for (int i = 0; i < 5; i++) {
            //Till JDK 1.8 versioning is 1.x after 10 its will JDK N.x
            if(n + i<10)
            versionList.add("1." + (n + i));
            else
            versionList.add((n + i)+".");
        }

        String javaVersion = System.getProperty("java.version");
        if (javaVersion == null) {
            return false;
        }
        for (String v : versionList) {
            if (javaVersion.startsWith(v))
                return true;
        }
        return false;
    }
730159
public void removeGlobals ()
    {
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String name = i.next();
            if (name.indexOf('.') == -1) {
                i.remove();
            } else if (name.startsWith("java.lang")) {
                i.remove();
            }
        }
    }
601454
@SuppressWarnings({"unchecked", "rawtypes"})
    @Override
    public C merge(final C other) {
        return (C) ConfigurationUtils.defaultMerge((ConfigurationComponent) this, (ConfigurationComponent) other);
    }
928281
public final ConfigurationModuleBuilder merge(final ConfigurationModule d) {
    if (d == null) {
      throw new NullPointerException("If merge() was passed a static final field that is initialized to non-null, " +
          "then this is almost certainly caused by a circular class dependency.");
    }
    try {
      d.assertStaticClean();
    } catch (final ClassHierarchyException e) {
      throw new ClassHierarchyException(ReflectionUtilities.getFullName(getClass()) +
          ": detected attempt to merge with ConfigurationModule that has had set() called on it", e);
    }
    final ConfigurationModuleBuilder c = deepCopy();
    final ConfigurationModuleBuilder builder = d.getBuilder();
    try {
      c.b.addConfiguration(builder.b.build());
    } catch (final BindException e) {
      throw new ClassHierarchyException(e);
    }
    c.reqDecl.addAll(builder.reqDecl);
    c.optDecl.addAll(builder.optDecl);
    c.reqUsed.addAll(builder.reqUsed);
    c.optUsed.addAll(builder.optUsed);
    c.setOpts.addAll(builder.setOpts);
    c.map.putAll(builder.map);
    c.freeImpls.putAll(builder.freeImpls);
    c.freeParams.putAll(builder.freeParams);
    c.lateBindClazz.putAll(builder.lateBindClazz);

    return c;
  }
978144
private void finalization() {
        Map<String, Object> dataModel = newHashMap();
        dataModel.put("cppFormatter", new SourceFormatter());
        Set<ClassModel> dependencies = newHashSet();
        for (Java4CppType type : context.getClassesAlreadyDone()) {
            Class<?> clazz = type.getRawClass();
            if (isValid(clazz)) {
                dependencies.add(context.getClassModel(clazz));
            }
        }
        dataModel.put("classes", dependencies);
        dataModel.put("symbols", context.getFileManager().getSymbols().getSymbols());

        context.getTemplateManager().processGlobalTemplates(dataModel);

        context.getTemplateManager().copyFiles();
    }