used only with java 7, do not set @Override
960838
public Text replaceWholeText(String content) throws DOMException {
	Text oldText = text;
	Document doc = XMLUtil.getDocument(text);
	Text newText = doc.createTextNode(content);
	Node parent = oldText.getParentNode();
	parent.replaceChild(XMLCaster.toRawNode(newText), XMLCaster.toRawNode(oldText));
	return oldText;
    }
1026458
public void overrideSetting(String name, double value) {
        overrides.put(name, Double.toString(value));
    }
760920
public Printer visitLocalVariableAnnotation(final int typeRef,
            final TypePath typePath, final Label[] start, final Label[] end,
            final int[] index, final String desc, final boolean visible) {
        throw new RuntimeException("Must be overriden");
    }
917098
public MethodDoc overriddenMethod() {

        // Real overriding only.  Static members are simply hidden.
        // Likewise for constructors, but the MethodSymbol.overrides
        // method takes this into account.
        if ((sym.flags() & Flags.STATIC) != 0) {
            return null;
        }

        // Derived from  com.sun.tools.javac.comp.Check.checkOverride .

        ClassSymbol origin = (ClassSymbol)sym.owner;
        for (Type t = env.types.supertype(origin.type);
             t.hasTag(CLASS);
             t = env.types.supertype(t)) {
            ClassSymbol c = (ClassSymbol)t.tsym;
            for (Symbol sym2 : membersOf(c).getSymbolsByName(sym.name)) {
                if (sym.overrides(sym2, origin, env.types, true)) {
                    return env.getMethodDoc((MethodSymbol)sym2);
                }
            }
        }
        return null;
    }
462626
@Override
	public void onEnd(TestContext<Object> context) {
		try {
			System.setErr(oldErr);
			System.setOut(oldOut);
		} catch (SecurityException e) {
			// ignored
		}
	}
1135454
protected boolean overrideToString(MethodBodyCreator creator) {
        Method toString = null;
        final ClassMetadataSource data = reflectionMetadataSource.getClassMetadata(Object.class);
        try {
            toString = data.getMethod("toString", String.class);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return overrideMethod(toString, MethodIdentifier.getIdentifierForMethod(toString), creator);
    }
976094
public void disableAllOverrides(int pathID, String clientUUID, int overrideType) {
        PreparedStatement statement = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            ArrayList<Integer> enabledOverrides = new ArrayList<Integer>();
            enabledOverrides.add(Constants.PLUGIN_REQUEST_HEADER_OVERRIDE_ADD);
            enabledOverrides.add(Constants.PLUGIN_REQUEST_HEADER_OVERRIDE_REMOVE);
            enabledOverrides.add(Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM);
            enabledOverrides.add(Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM_POST_BODY);

            String overridePlaceholders = preparePlaceHolders(enabledOverrides.size());

            statement = sqlConnection.prepareStatement(
                "DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                    " WHERE " + Constants.ENABLED_OVERRIDES_PATH_ID + " = ? " +
                    " AND " + Constants.GENERIC_CLIENT_UUID + " = ? " +
                    " AND " + Constants.ENABLED_OVERRIDES_OVERRIDE_ID +
                    (overrideType == Constants.OVERRIDE_TYPE_RESPONSE ? " NOT" : "") +
                    " IN ( " + overridePlaceholders + " )"
            );
            statement.setInt(1, pathID);
            statement.setString(2, clientUUID);
            for (int i = 3; i <= enabledOverrides.size() + 2; ++i) {
                statement.setInt(i, enabledOverrides.get(i - 3));
            }
            statement.execute();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
235894
public void overrideSetting(String name, int value) {
        overrides.put(name, Integer.toString(value));
    }
1329614
private void addToOverrideMap(ExecutableElement methodElement) {
    String overrideID = stitchOverrideMethodIdentifier(methodElement);
    if (overrideMap.containsKey(overrideID)) {
      overrideMap.get(overrideID).add(stitchMethodIdentifier(methodElement));
    } else {
      HashSet<String> overrideSet = new HashSet<String>();
      overrideSet.add(stitchMethodIdentifier(methodElement));
      overrideMap.put(overrideID, overrideSet);
    }
  }
1350207
private static void failFastOnIncompatibleSubclass(Class<?> clazz) {
        while (clazz != DynamoDBMapper.class) {
            Class<?>[] classOverride = new Class<?>[] {
                    Class.class,
                    Map.class
            };
            Class<?>[] nameOverride = new Class<?>[] {
                    String.class,
                    String.class,
                    Map.class
            };

            for (Method method : clazz.getDeclaredMethods()) {
                if (method.getName().equals("transformAttributes")) {
                    Class<?>[] params = method.getParameterTypes();
                    if (Arrays.equals(params, classOverride)
                            || Arrays.equals(params, nameOverride)) {

                        throw new IllegalStateException(
                                "The deprecated transformAttributes method is "
                                + "no longer supported as of 1.9.0. Use an "
                                + "AttributeTransformer to inject custom "
                                + "attribute transformation logic.");
                    }
                }
            }

            clazz = clazz.getSuperclass();
        }
    }
633129
@Override
	public int doEndTag() throws JspException {

		try {
			String imgSrc = getImgSrcToRender();

			if (null == var) {
				try {
					pageContext.getOut().print(imgSrc);
				} catch (IOException e) {
					throw new JspException(e);
				}
			} else {
				pageContext.setAttribute(var, imgSrc);
			}

			return super.doEndTag();

		} finally {

			// Reset the Thread local for the Jawr context
			ThreadLocalJawrContext.reset();
		}
	}
53093
@Override
  public void exitVersion_set(VersionParser.Version_setContext ctx)
  {
    Object o1 = stack.pop();
    if (strict && (o1 instanceof NamedVersion)) {
      String name = o1.toString();
      // FIXME: There needs to be a better way to identify illegal named versions. Perhaps insist it contains an alphanumeric?
      switch (name.trim()) {
        case "-":
        case "_":
          throw new InvalidRangeRuntimeException("Invalid named version: " + o1);
        default:
          break;
      }
    }
    if (stack.isEmpty()) {
      VersionSet set = new VersionSet((IVersion) o1);
      stack.push(set);
    }
    else {
      VersionSet set = (VersionSet) stack.peek();
      set.add((IVersion) o1);
    }
  }
138194
public void overrideSetting(String name, long value) {
        overrides.put(name, Long.toString(value));
    }
528672
@Override
	@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
	protected void doCheckFunctionOverrides(EObject sourceElement, IResolvedOperation resolved,
			List<IResolvedOperation> allInherited) {
		boolean overrideProblems = false;
		List<IResolvedOperation> exceptionMismatch = null;
		for (final IResolvedOperation inherited: allInherited) {
			if (inherited.getOverrideCheckResult().hasProblems()) {
				overrideProblems = true;
				final EnumSet<OverrideCheckDetails> details = inherited.getOverrideCheckResult().getDetails();
				if (details.contains(OverrideCheckDetails.IS_FINAL)) {
					error(MessageFormat.format(Messages.SARLValidator_43, inherited.getSimpleSignature()),
							sourceElement,
							nameFeature(sourceElement), OVERRIDDEN_FINAL);
				} else if (details.contains(OverrideCheckDetails.REDUCED_VISIBILITY)) {
					error(MessageFormat.format(Messages.SARLValidator_44,
							inherited.getSimpleSignature()),
							sourceElement, nameFeature(sourceElement), OVERRIDE_REDUCES_VISIBILITY);
				} else if (details.contains(OverrideCheckDetails.EXCEPTION_MISMATCH)) {
					if (exceptionMismatch == null) {
						exceptionMismatch = Lists.newArrayListWithCapacity(allInherited.size());
					}
					exceptionMismatch.add(inherited);
				} else if (details.contains(OverrideCheckDetails.RETURN_MISMATCH)) {
					final JvmTypeReference inheritedReturnType = inherited.getOverrideCheckResult().getGivenOperation().getReturnType();
					final LightweightTypeReference resolvedReturnType = inherited.getOverrideCheckResult().getThisOperation().getResolvedReturnType();
					final String signature = inherited.getSimpleSignature();
					final EStructuralFeature sourceReturnTypeFeature = returnTypeFeature(sourceElement);
					// FIXME: The following test is due to the fact that the resource sets of the two types may be different.
					final String resolvedIdentifier = resolvedReturnType.getIdentifier();
					final String inheritedIdentifier = inheritedReturnType.getIdentifier();
					if (!Objects.equal(resolvedIdentifier, inheritedIdentifier)) {
						error(MessageFormat.format(Messages.SARLValidator_45,
								signature,
								resolvedIdentifier,
								inheritedIdentifier),
								sourceElement,
								sourceReturnTypeFeature,
								INCOMPATIBLE_RETURN_TYPE,
								resolvedIdentifier);
					}
				}
			} else if (!isIgnored(RETURN_TYPE_SPECIFICATION_IS_RECOMMENDED, sourceElement)
					&& sourceElement instanceof SarlAction) {
				final SarlAction function = (SarlAction) sourceElement;
				if (function.getReturnType() == null && !inherited.getResolvedReturnType().isPrimitiveVoid()) {
					warning(MessageFormat.format(Messages.SARLValidator_46,
							resolved.getResolvedReturnType().getHumanReadableName()),
							sourceElement,
							returnTypeFeature(sourceElement), RETURN_TYPE_SPECIFICATION_IS_RECOMMENDED,
							inherited.getResolvedReturnType().getIdentifier());
				}
			}
		}
		if (exceptionMismatch != null) {
			createExceptionMismatchError(resolved, sourceElement, exceptionMismatch);
		}
		if (sourceElement instanceof SarlAction) {
			final SarlAction function = (SarlAction) sourceElement;
			if (!overrideProblems && !function.isOverride() && !function.isStatic()
					&& !isIgnored(MISSING_OVERRIDE, sourceElement)) {
				warning(MessageFormat.format(Messages.SARLValidator_47,
						resolved.getSimpleSignature(),
						getDeclaratorName(resolved)),
						function,
						XTEND_FUNCTION__NAME, MISSING_OVERRIDE);
			}
			if (!overrideProblems && function.isOverride() && function.isStatic()) {
				for (final IResolvedOperation inherited: allInherited) {
					error(MessageFormat.format(Messages.SARLValidator_48,
							resolved.getSimpleSignature(),
							getDeclaratorName(resolved),
							resolved.getSimpleSignature(),
							getDeclaratorName(inherited)),
							function, XTEND_FUNCTION__NAME,
							function.getModifiers().indexOf(Messages.SARLValidator_49),
							OBSOLETE_OVERRIDE);
				}
			}
		}
	}
189629
private void overrideAbstractMethods() throws IOException
    {
        for (final ExecutableElement method : El.getEffectiveMethods(superClass))
        {
            if (method.getModifiers().contains(Modifier.ABSTRACT))
            {
                if (
                        method.getAnnotation(Terminal.class) != null || 
                        method.getAnnotation(Rule.class) != null || 
                        method.getAnnotation(Rules.class) != null )
                {
                    implementedAbstractMethods.add(method);
                    MethodCompiler mc = new MethodCompiler()
                    {
                        @Override
                        protected void implement() throws IOException
                        {
                            TypeMirror returnType = method.getReturnType();
                            List<? extends VariableElement> params = method.getParameters();
                            if (returnType.getKind() != TypeKind.VOID && params.size() == 1)
                            {
                                nameArgument(ARG, 1);
                                try
                                {
                                    convert(ARG, returnType);
                                }
                                catch (IllegalConversionException ex)
                                {
                                    throw new IOException("bad conversion with "+method, ex);
                                }
                                treturn();
                            }
                            else
                            {
                                if (returnType.getKind() == TypeKind.VOID && params.size() == 0)
                                {
                                    treturn();
                                }
                                else
                                {
                                    throw new IllegalArgumentException("cannot implement abstract method "+method);
                                }
                            }
                        }
                    };
                    subClass.overrideMethod(mc, method, Modifier.PROTECTED);
                }
            }
        }
    }
617080
@SdkTestInternalApi
    public void setOverrideDate(Date overriddenDate) {
        if (overriddenDate != null) {
            this.overriddenDate = new Date(overriddenDate.getTime());
        } else {
            this.overriddenDate = null;
        }
    }
848069
private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
        ClassNode annotationClassNode = visited.getClassNode();
        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
            if (node instanceof MethodNode) {
                MethodNode origMethod = (MethodNode) node;
                ClassNode cNode = node.getDeclaringClass();
                ClassNode next = cNode;
                outer:
                while (next != null) {
                    Map genericsSpec = createGenericsSpec(next);
                    MethodNode mn = correctToGenericsSpec(genericsSpec, origMethod);
                    if (next != cNode) {
                        ClassNode correctedNext = correctToGenericsSpecRecurse(genericsSpec, next);
                        MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
                        if (found != null) break;
                    }
                    List<ClassNode> ifaces = new ArrayList<ClassNode>();
                    ifaces.addAll(Arrays.asList(next.getInterfaces()));
                    Map updatedGenericsSpec = new HashMap(genericsSpec);
                    while (!ifaces.isEmpty()) {
                        ClassNode origInterface = ifaces.remove(0);
                        if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {
                            updatedGenericsSpec = createGenericsSpec(origInterface, updatedGenericsSpec);
                            ClassNode iNode = correctToGenericsSpecRecurse(updatedGenericsSpec, origInterface);
                            MethodNode found2 = getDeclaredMethodCorrected(updatedGenericsSpec, mn, iNode);
                            if (found2 != null) break outer;
                            ifaces.addAll(Arrays.asList(iNode.getInterfaces()));
                        }
                    }
                    ClassNode superClass = next.getUnresolvedSuperClass();
                    if (superClass!=null) {
                        next =  correctToGenericsSpecRecurse(updatedGenericsSpec, superClass);
                    } else {
                        next = null;
                    }
                }
                if (next == null) {
                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
                            "method from its superclass or interfaces but is annotated with @Override.", visited);
                }
            }
        }
    }