make Suro compilable and runnable under Java 6.
346053
private static void closeAndIgnoreError(Socket socket) {
        if(socket == null) return;

        try{
            socket.close();
        }catch(IOException e) {
            log.warn(String.format("Failed to close the client socket on port %d: %s. Exception ignored.", socket.getPort(), e.getMessage()), e);
        }
    }
247688
@Override
    // thanks to
    // http://binkley.blogspot.fr/2009/04/jumping-work-queue-in-executor.html
    // for backward compat to SDK 8 (JDK 5)
    protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) {
        // makes findbugs happy, there must be some @Nullable
        // annotation in JDK..
        if (runnable == null) {
            return null;
        }
        return new PriorityFuture<T>(runnable, ((PriorityRunnable) runnable).getPriority(), value);
    }
68434
def run(self, *args):
        """"""

        params = self.parser.parse_args(args)

        code = self.unify(params.matching, params.sources,
                          params.fast_matching, params.no_strict,
                          params.interactive, params.recovery)

        return code
593574
public Runnable wrap(final Runnable r) {
    return new Runnable() {
      @Override
      public void run() {
        Context previous = attach();
        try {
          r.run();
        } finally {
          detach(previous);
        }
      }
    };
  }
1139997
private boolean includeAllorNoMinifyRunnable(String val) {
        return IncludeOption.ALL.matches(val) || (IncludeOption.RUNNABLE.matches(val) && !IncludeOption.MINIFY.matches(val));
    }
1130525
public static Callable<Object> callable(Runnable task) {
        if (task == null)
            throw new NullPointerException();
        return new RunnableAdapter<Object>(task, null);
    }
1206376
public static Runnable buildRunnableWithLogging(String runnableName,
            Runnable runnable, Object... params) {
        return () -> {
            JMLog.debug(log, runnableName, System.currentTimeMillis(), params);
            runnable.run();
        };
    }
1296576
def autorun():
    '''
    
    '''
    def wrapper(cls):

        import inspect
        if inspect.getmodule(cls).__name__ == "__main__":
            cls().run()
        return cls

    return wrapper
815550
public static MutableBoolean stop(boolean forceJvmToStop) {
		if (stop != null) {
			new Exception("LCCore already stopped", stop).printStackTrace(System.err);
			return new MutableBoolean(true);
		}
		stop = new Exception("LCCore stop requested here");
		MutableBoolean stopped = new MutableBoolean(false);
		new Thread("Stopping LCCore") {
			@Override
			public void run() {
				synchronized (toDoInMainThread) {
					toDoInMainThread.notify();
				}
				if (instance != null) instance.stop();
				if (forceJvmToStop) {
					System.out.println("Stop JVM.");
					System.exit(0);
				}
				synchronized (stopped) {
					stopped.set(true);
					stopped.notifyAll();
				}
			}
		}.start();
		return stopped;
	}
131516
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        if ( isSkip() )
        {
            getLog().info( "skipping execute as per configuraion" );
            return;
        }
        if ( killAfter != -1 )
        {
            getLog().warn( "Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6." );
        }

        arguments = new String[] {outputParentDirectory.getAbsolutePath(), outputDirectory.getAbsolutePath(), filterClassPackage};

        if ( getLog().isDebugEnabled() )
        {
            StringBuffer msg = new StringBuffer( "Invoking : " );
            msg.append( mainClass );
            msg.append( ".main(" );
            for ( int i = 0; i < arguments.length; i++ )
            {
                if ( i > 0 )
                {
                    msg.append( ", " );
                }
                msg.append( arguments[i] );
            }
            msg.append( ")" );
            getLog().debug( msg );
        }

        final Log log = getLog();
        IsolatedThreadGroup threadGroup = new IsolatedThreadGroup( mainClass /* name */);
        Thread bootstrapThread = new Thread( threadGroup, new Runnable()
        {
            public void run()
            {
            	long current = System.currentTimeMillis();
                try
                {   
                	
                    Method main =
                        Thread.currentThread().getContextClassLoader().loadClass( mainClass ).getMethod( "main",
                                                                                                         new Class[] { String[].class } );
                    if ( !main.isAccessible() )
                    {
                        getLog().debug( "Setting accessibility to true in order to invoke main()." );
                        main.setAccessible( true );
                    }
                    if ( !Modifier.isStatic( main.getModifiers() ) )
                    {
                        throw new MojoExecutionException( "Can't call main(String[])-method because it is not static." );
                    }
                    main.invoke( null, new Object[] { arguments } );
                }
                catch ( NoSuchMethodException e )
                { // just pass it on
                    Thread.currentThread().getThreadGroup().uncaughtException( Thread.currentThread(),
                                                                               new Exception(
                                                                                              "The specified mainClass doesn't contain a main method with appropriate signature.",
                                                                                              e ) );
                }
                catch ( Exception e )
                { // just pass it on
                    Thread.currentThread().getThreadGroup().uncaughtException( Thread.currentThread(), e );
                } finally {
                	log.info("JProtobuf pre compile done time took: " + (System.currentTimeMillis() - current) + "ms");
                }
            }
        }, mainClass + ".main()" );
        bootstrapThread.setContextClassLoader( getClassLoader() );
        setSystemProperties();

        bootstrapThread.start();
        joinNonDaemonThreads( threadGroup );
        // It's plausible that spontaneously a non-daemon thread might be created as we try and shut down,
        // but it's too late since the termination condition (only daemon threads) has been triggered.
        if ( keepAlive )
        {
            getLog().warn( "Warning: keepAlive is now deprecated and obsolete. Do you need it? Please comment on MEXEC-6." );
            waitFor( 0 );
        }

        if ( cleanupDaemonThreads )
        {

            terminateThreads( threadGroup );

            try
            {
                threadGroup.destroy();
            }
            catch ( IllegalThreadStateException e )
            {
                getLog().warn( "Couldn't destroy threadgroup " + threadGroup, e );
            }
        }

        if ( originalSystemProperties != null )
        {
            System.setProperties( originalSystemProperties );
        }

        synchronized ( threadGroup )
        {
            if ( threadGroup.uncaughtException != null )
            {
                throw new MojoExecutionException( "An exception occured while executing the Java class. "
                    + threadGroup.uncaughtException.getMessage(), threadGroup.uncaughtException );
            }
        }

        registerSourceRoots();
    }
336025
public static void run(final RunType runInto, final JRebirthRunnable runnable, final long... timeout) {
        switch (runInto) {
            case JAT:
                runIntoJAT(runnable);
                break;
            case JAT_SYNC:
                runIntoJATSync(runnable, timeout);
                break;
            case JIT:
                runIntoJIT(runnable);
                break;
            case JIT_SYNC:
                runIntoJITSync(runnable, timeout);
                break;
            case JTP:
                runIntoJTP(runnable);
                break;
            case JTP_SYNC:
                runIntoJTPSync(runnable, timeout);
                break;
            case SAME:
            default:
                runnable.run();
        }
    }
28446
public void runnable(Runnable runnable) {
		initStartTotal();
		long startInvokation = System.currentTimeMillis();
		runnable.run();
		invoked(System.currentTimeMillis() - startInvokation);
	}
273607
@SuppressWarnings("static-method")
	protected Runnable createTask(Runnable runnable) {
		if (runnable instanceof JanusRunnable) {
			return runnable;
		}
		return new JanusRunnable(runnable);
	}
186796
def run_fn_atomically(self, request):
        """"""
        fn = serializer.loads_fn(request[Msgs.info])
        args, kwargs = request[Msgs.args], request[Msgs.kwargs]
        with self.mutate_safely():
            self.reply(fn(self.state, *args, **kwargs))
416648
public Runnable asRunnable() {
        return new Runnable() {
            @Override
            public void run() {
                try {
                    callable.call();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
    }
1290510
def run(**kwargs):
    """"""
    paths = kwargs.pop('paths', ())
    action = kwargs.pop('action')
    plugin = kwargs.pop('plugin')
    junit_xml = kwargs.pop('junit_xml')
    use_tracked_files = kwargs.pop('use_tracked_files')
    quiet = kwargs.pop('quiet')

    colorama.init(strip=kwargs.pop('no_color'))

    git_dir = current_git_dir()

    if git_dir is None:
        output(NOT_GIT_REPO_MSG)
        exit(1)

    repo_root = os.path.dirname(git_dir)

    files = []
    if paths:
        # We want to look at files in their current state if paths are passed through
        kwargs['include_unstaged_changes'] = True

        # If paths were provided get all the files for each path
        for path in paths:
            for f in list_files(path):
                f = os.path.relpath(f, repo_root)
                if not f.startswith('..'):  # Don't include files outside the repo root.
                    files.append(f)
    elif use_tracked_files:
        # If the use tracked files flag was passed, get a list of all the tracked files
        out, err, code = git.ls_files()
        files = out.splitlines()

        if kwargs.get('include_untracked'):
            out, err, code = git.ls_files(o=True, exclude_standard=True)
            files += out.splitlines()

    if files or paths:
        kwargs['files'] = files

    config = get_config(repo_root)
    runner = Runner(config.cwd, **kwargs)
    results = ResultCollection()

    if runner.unstaged_changes and not quiet:
        output(UNSTAGED_CHANGES_MSG, end='\n\n')

    processes = list(config.actions) + list(config.plugins)
    processes.sort(key=lambda x: x.name)  # Sort the list of processes for consistent results

    if plugin:
        try:
            processes = [config.plugins.get(plugin)]
        except config.plugins.DoesNotExist as e:
            output('{}\nAvailable plugins:'.format(e.message))

            for p in config.plugins:
                output(p.name)
            exit(1)

    if action:
        try:
            processes = [config.actions.get(action)]
        except config.actions.DoesNotExist as e:
            output('{}\nAvailable actions:'.format(e.message))

            for a in config.actions:
                output(a.name)
            exit(1)

    for process in processes:
        result, message = runner.run_process(process)
        results.append(result)

        if not quiet:
            output(message)

    if junit_xml:
        with open(junit_xml, 'w+') as f:
            f.write('{}'.format(results.dump_junit()))

    if not quiet:
        output(results.dump())
        output('#{{bright}}{}\nCompleted in: {}s'.format(''.ljust(79, '-'), round(results.execution_time, 2)))

    if results.has_error:
        exit(1)
    elif results.has_failure:
        exit(2)
318299
public static <E extends Throwable> @NonNull Runnable rethrowRunnable(final @NonNull ThrowingRunnable<E> runnable) {
    return runnable;
  }