Returns true if the current compilation would succeed with the given fix applied. Note that
calling this method is very expensive as it requires rerunning the entire compile, so it should
be used with restraint.
555478
public static boolean compilesWithFix(Fix fix, VisitorState state) {
    if (fix.isEmpty()) {
      return true;
    }
    JCCompilationUnit compilationUnit = (JCCompilationUnit) state.getPath().getCompilationUnit();
    JavaFileObject modifiedFile = compilationUnit.getSourceFile();
    BasicJavacTask javacTask = (BasicJavacTask) state.context.get(JavacTask.class);
    if (javacTask == null) {
      throw new IllegalArgumentException("No JavacTask in context.");
    }
    Arguments arguments = Arguments.instance(javacTask.getContext());
    List<JavaFileObject> fileObjects = new ArrayList<>(arguments.getFileObjects());
    for (int i = 0; i < fileObjects.size(); i++) {
      final JavaFileObject oldFile = fileObjects.get(i);
      if (modifiedFile.toUri().equals(oldFile.toUri())) {
        DescriptionBasedDiff diff =
            DescriptionBasedDiff.create(compilationUnit, ImportOrganizer.STATIC_FIRST_ORGANIZER);
        diff.handleFix(fix);
        SourceFile fixSource;
        try {
          fixSource =
              new SourceFile(
                  modifiedFile.getName(),
                  modifiedFile.getCharContent(false /*ignoreEncodingErrors*/));
        } catch (IOException e) {
          return false;
        }
        diff.applyDifferences(fixSource);
        fileObjects.set(
            i,
            new SimpleJavaFileObject(sourceURI(modifiedFile.toUri()), Kind.SOURCE) {
              @Override
              public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
                return fixSource.getAsSequence();
              }
            });
        break;
      }
    }
    DiagnosticCollector<JavaFileObject> diagnosticListener = new DiagnosticCollector<>();
    Context context = new Context();
    Options options = Options.instance(context);
    Options originalOptions = Options.instance(javacTask.getContext());
    for (String key : originalOptions.keySet()) {
      String value = originalOptions.get(key);
      if (key.equals("-Xplugin:") && value.startsWith("ErrorProne")) {
        // When using the -Xplugin Error Prone integration, disable Error Prone for speculative
        // recompiles to avoid infinite recurison.
        continue;
      }
      options.put(key, value);
    }
    JavacTask newTask =
        JavacTool.create()
            .getTask(
                CharStreams.nullWriter(),
                state.context.get(JavaFileManager.class),
                diagnosticListener,
                ImmutableList.of(),
                arguments.getClassNames(),
                fileObjects,
                context);
    try {
      newTask.analyze();
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
    return countErrors(diagnosticListener) == 0;
  }
401786
private boolean shouldBundlerRun(String requestedBundler, String currentRunningBundlerID, JavaFXGradlePluginExtension ext, final Logger logger, Map<String, ? super Object> params) {
        if( requestedBundler != null && !"ALL".equalsIgnoreCase(requestedBundler) && !requestedBundler.equalsIgnoreCase(currentRunningBundlerID) ){
            // this is not the specified bundler
            return false;
        }

        if( ext.isSkipJNLP() && "jnlp".equalsIgnoreCase(currentRunningBundlerID) ){
            logger.info("Skipped JNLP-bundling as requested.");
            return false;
        }

        boolean runBundler = true;
        // Workaround for native installer bundle not creating working executable native launcher
        // (this is a comeback of issue 124)
        // https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/205
        // do run application bundler and put the cfg-file to application resources
        if( System.getProperty("os.name").toLowerCase().startsWith("linux") ){
            if( workarounds.isWorkaroundForBug205Needed() ){
                // check if special conditions for this are met (not jnlp, but not linux.app too, because another workaround already works)
                if( !"jnlp".equalsIgnoreCase(requestedBundler) && !"linux.app".equalsIgnoreCase(requestedBundler) && "linux.app".equalsIgnoreCase(currentRunningBundlerID) ){
                    if( !ext.isSkipNativeLauncherWorkaround205() ){
                        logger.info("Detected linux application bundler ('linux.app') needs to run before installer bundlers are executed.");
                        runBundler = true;
                        params.put(CFG_WORKAROUND_MARKER, "true");
                    } else {
                        logger.info("Skipped workaround for native linux installer bundlers.");
                    }
                }
            }
        }
        return runBundler;
    }
1281568
def ShouldRetry(self, exception):
        
        if (self.current_retry_attempt_count < self._max_retry_attempt_count) and self.needsRetry(exception.status_code):
            self.current_retry_attempt_count += 1
            return True
        return False
795435
function () {
					if(paused === true) {
						paused = false;
						node.onChangeWithPriority(options.priority, do_get);
						if(options.run_on_create !== false) {
							if (constraint_solver.semaphore >= 0) {
								node.get(false);
							} else {
								each(node._changeListeners, constraint_solver.add_in_call_stack, constraint_solver);
							}
						}
						return true; // successfully resumed
					}
					return false;
				}
1198764
public function optimizeNot($expr, CompilationContext $compilationContext)
    {
        /*
         * Compile the expression negating the evaluated expression
         */
        if ('not' == $expr['type']) {
            $conditions = $this->optimize($expr['left'], $compilationContext);
            if (false !== $conditions) {
                if (null !== $this->unreachable) {
                    $this->unreachable = !$this->unreachable;
                }
                if (null !== $this->unreachableElse) {
                    $this->unreachableElse = !$this->unreachableElse;
                }

                return '!('.$conditions.')';
            }
        }

        return false;
    }
456670
function isChildCompilerCacheOutdated (mainCompilation, childCompiler) {
  // If the compilation was never run there is no invalid cache
  if (!childCompiler.compilationStartedTimestamp) {
    return false;
  }
  // Check if any dependent file was changed after the last compilation
  const fileTimestamps = mainCompilation.fileTimestamps;
  const isCacheOutOfDate = childCompiler.fileDependencies.some((fileDependency) => {
    const timestamp = fileTimestamps.get(fileDependency);
    // If the timestamp is not known the file is new
    // If the timestamp is larger then the file has changed
    // Otherwise the file is still the same
    return !timestamp || timestamp > childCompiler.compilationStartedTimestamp;
  });
  return isCacheOutOfDate;
}
853121
public boolean compile(Job job) throws IOException {
        boolean result;

        currentJob = job;
        result = compileCurrent();
        currentJob = null;
        return result;
    }
392791
protected boolean shouldApplyThisRuleTo(ClassNode classNode) {
        // TODO Consider caching applyTo, doNotApplyTo and associated WildcardPatterns
        boolean shouldApply = true;

        String applyTo = getApplyToClassNames();
        String doNotApplyTo = getDoNotApplyToClassNames();

        if (applyTo != null  && applyTo.length() > 0) {
            WildcardPattern pattern = new WildcardPattern(applyTo, true);
            shouldApply = pattern.matches(classNode.getNameWithoutPackage()) || pattern.matches(classNode.getName());
        }

        if (shouldApply && doNotApplyTo != null && doNotApplyTo.length() > 0) {
            WildcardPattern pattern = new WildcardPattern(doNotApplyTo, true);
            shouldApply = !pattern.matches(classNode.getNameWithoutPackage()) && !pattern.matches(classNode.getName());
        }

        return shouldApply;
    }
1139997
private boolean includeAllorNoMinifyRunnable(String val) {
        return IncludeOption.ALL.matches(val) || (IncludeOption.RUNNABLE.matches(val) && !IncludeOption.MINIFY.matches(val));
    }
869922
@Override
  public boolean isModified()
  {
    if (_depend == null) {
      return false;
    }
    
    if (_depend.isModified()) {
      if (log.isLoggable(Level.FINE))
        log.fine("class modified: " + _depend);

      return reloadIsModified();
    }
    else if (_sourcePath == null) {
      return false;
    }  
    else if (_sourcePath.getLastModified() != _sourceLastModified) {
      if (log.isLoggable(Level.FINE))
        log.fine("source modified time: " + _sourcePath +
                 " old:" + new Date(_sourceLastModified) +
                 " new:" + new Date(_sourcePath.getLastModified()));

      if (! compileIsModified()) {
        return false;
      }
      
      boolean isModified = reloadIsModified();

      return isModified;
    }
    else if (_sourcePath.length() != _sourceLength) {
      if (log.isLoggable(Level.FINE))
        log.fine("source modified length: " + _sourcePath +
                 " old:" + _sourceLength +
                 " new:" + _sourcePath.length());

      if (! compileIsModified()) {
        return false;
      }

      return reloadIsModified();
    }
    else {
      return false;
    }
  }
1190708
private boolean isResetOp(int seen) {
        return resetOps.get(seen) || OpcodeUtils.isStore(seen) || OpcodeUtils.isReturn(seen)
                || ((OpcodeUtils.isInvoke(seen) && getSigConstantOperand().endsWith(")V")) || (isBranch(seen) && (getBranchOffset() < 0)));
    }
82031
public boolean run(boolean compileTimeView, int maxDepth) throws IOException {
        try {
            // parse each packaged module or classpath archive
            if (apiOnly) {
                finder.parseExportedAPIs(rootArchives.stream());
            } else {
                finder.parse(rootArchives.stream());
            }
            archives.addAll(rootArchives);

            int depth = maxDepth > 0 ? maxDepth : Integer.MAX_VALUE;

            // transitive analysis
            if (depth > 1) {
                if (compileTimeView)
                    transitiveArchiveDeps(depth-1);
                else
                    transitiveDeps(depth-1);
            }

            Set<Archive> archives = archives();

            // analyze the dependencies collected
            analyzer.run(archives, finder.locationToArchive());

            if (writer != null) {
                writer.generateOutput(archives, analyzer);
            }
        } finally {
            finder.shutdown();
        }
        return true;
    }
1006025
def needs_compile(self):
        ''''''
        try:
            source_mtime = os.stat(self.sourcepath).st_mtime
        except OSError:  # no source for this template, so just return
            return False
        try:
            target_mtime = os.stat(self.targetpath).st_mtime
        except OSError: # target doesn't exist, so compile
            return True
        # both source and target exist, so compile if source newer
        return source_mtime > target_mtime
406950
def supported_fixes():
    
    yield ('E101', docstring_summary(reindent.__doc__))

    instance = FixPEP8(filename=None, options=None, contents='')
    for attribute in dir(instance):
        code = re.match('fix_([ew][0-9][0-9][0-9])', attribute)
        if code:
            yield (
                code.group(1).upper(),
                re.sub(r'\s+', ' ',
                       docstring_summary(getattr(instance, attribute).__doc__))
            )

    for (code, function) in sorted(global_fixes()):
        yield (code.upper() + (4 - len(code)) * ' ',
               re.sub(r'\s+', ' ', docstring_summary(function.__doc__)))

    for code in sorted(CODE_TO_2TO3):
        yield (code.upper() + (4 - len(code)) * ' ',
               re.sub(r'\s+', ' ', docstring_summary(fix_2to3.__doc__)))
88328
function compile(patch) {
  var code = "";
  patch.forEach(function(op) {
    var o = "";
    switch (op.op) {
      case "remove":
        o += "delete " + pathToStatement(op.path);
        break;
      case "add":
        o += pathToStatement(op.path) + " = " + JSON.stringify(op.value);
        break;
      case "replace":
        o += pathToStatement(op.path) + " = " + JSON.stringify(op.value);
        break;
      case "move":
        var from = pathToStatement(op.from);
        o += pathToStatement(op.path) + " = " + from + ";\n";
        o += "delete " + from;
        break;
      case "copy":
        o += pathToStatement(op.path) + " = " + from;
        break;
      case "test":
        o +=
          "if (!oo.equal(" +
          pathToStatement(op.path) +
          ", " +
          JSON.stringify(op.value) +
          ") throw new Error()";
        break;
    }
    code += o + ";\n";
  });
  return code;
}
373616
protected boolean shouldUpdateAtAll(I_CmsSearchIndex index) {

        if (I_CmsSearchIndex.REBUILD_MODE_NEVER.equals(index.getRebuildMode())) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_SKIP_REBUILD_FOR_MODE_NEVER_1, index.getName()));
            return false;
        } else {
            return true;
        }

    }
121409
protected function perform()
    {
        if ($this->isQuietModeDisabled()) {
            $this->fixer->disableQuietMode();
        }

        $spl = new SplFileInfo($this->file->path());

        return (bool) $this->fixer->fixFile($spl);
    }