id
stringlengths
7
14
text
stringlengths
1
106k
832679_4
public String getName() { return module + (className != null ? "::" + className : ""); }
832679_5
@Override public String render(OsFamily arg0) { Boolean isHiera = config.getBoolean(PUPPET_HIERA_CLASSES, false); // when we get to the last role, let's cat all the manifests we made together inside a // node default site.pp Builder<Statement> statements = ImmutableList.<Statement> builder(); statements.add(S...
832679_6
@Override public String render(OsFamily arg0) { return exec( "git clone " + (vcsBranch != null ? "-b " + vcsBranch + " " : "") + url + " " + MODULES_DIR + module).render(arg0); }
832679_7
@Override public String render(OsFamily arg0) { return exec( "git clone " + (vcsBranch != null ? "-b " + vcsBranch + " " : "") + url + " " + MODULES_DIR + module).render(arg0); }
832679_8
@Override public Statement apply(Map<String, String> props) { try { return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props); } catch (NoSuchElementException e) { throw new IllegalArgumentException(format("couldn't find pattern: %s in properties %s", MODULE_KEY_PATT...
832679_9
@Override public Statement apply(Map<String, String> props) { try { return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props); } catch (NoSuchElementException e) { throw new IllegalArgumentException(format("couldn't find pattern: %s in properties %s", MODULE_KEY_PATT...
832680_0
public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List<String> result = new ArrayList<>(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); }
832680_1
@Nonnull public static String convertJarFileResourceToJavaClassName( @Nonnull String test ) { return StringUtils.removeEnd( test, ".class" ).replace( "/", "." ); }
832680_2
public static boolean isJavaClassFile( String file ) { return file.endsWith( ".class" ); }
832680_3
public static File replaceForkThreadsInPath( File path, int replacement ) { Deque<String> dirs = new LinkedList<>(); File root = path; while ( !root.exists() ) { dirs.addFirst( replaceThreadNumberPlaceholders( root.getName(), replacement ) ); root = root.getParentFile(); } File r...
832680_4
public static File replaceForkThreadsInPath( File path, int replacement ) { Deque<String> dirs = new LinkedList<>(); File root = path; while ( !root.exists() ) { dirs.addFirst( replaceThreadNumberPlaceholders( root.getName(), replacement ) ); root = root.getParentFile(); } File r...
832680_5
public static String[] getDumpFilesToPrint() { return DUMP_FILES_PRINT.clone(); }
832680_6
public static String[] getDumpFilesToPrint() { return DUMP_FILES_PRINT.clone(); }
832680_7
public static String escapeToPlatformPath( String path ) { if ( IS_OS_WINDOWS && path.length() > MAX_PATH_LENGTH_WINDOWS ) { path = path.startsWith( "\\\\" ) ? "\\\\?\\UNC\\" + path.substring( 2 ) : "\\\\?\\" + path; } return path; }
832680_8
public static void reportExecution( SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( firstForkException == null && !result.isTimeout() && result.isEr...
832680_9
public static void reportExecution( SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( firstForkException == null && !result.isTimeout() && result.isEr...
834344_0
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_1
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_2
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_3
public static String camelToUnderscore(final String input) { String result = input; if (input instanceof String) { result = input.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } return result; }
834344_4
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_5
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_6
public static String canonicalize(final String name) { String result = null; if (name != null) { result = name.toLowerCase().replace(' ', '-').replaceAll("[^a-z0-9-]*", "").replaceAll("-+", "-"); } return result; }
834344_7
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
834344_8
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
834344_9
public static boolean isAlphabetic(final String text) { if (text != null) { return text.matches("^[a-zA-Z]*$"); } return false; }
844592_0
public ExceptionHandlingStrategy makeExceptionHandlingStrategy( final Level logLevel, final PrintStream originalPrintStream) { return new LogPerLineExceptionHandlingStrategy(logLevel); }
844592_1
public ExceptionHandlingStrategy makeExceptionHandlingStrategy( final Level logLevel, final PrintStream originalPrintStream) { return new LogPerLineExceptionHandlingStrategy(logLevel); }
846296_0
public SourceTemplate(Writer writer, String className, List<BsonDocumentObjectElement> annotatedElements) { this.writer = writer; this.className = className; this.annotatedElements = annotatedElements; }
851175_0
public Dimension getDimensionX() { return getDimension(xDimIndex); }
851175_1
static boolean rasterDimMatches(Modis35DimKey rasterDim, String rasterDimNameString) { String[] rasterDimNames = rasterDimNameString.split(","); if (rasterDim.getRank() == rasterDimNames.length) { boolean dimsMatch = true; for (int j = 0; j < rasterDim.getRank(); j++) { if (!rasterDi...
851175_2
@Override public ProductReader createReaderInstance() { return new MfgMSAProductReader(this); }
851175_3
static boolean mfgAlbedoFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Albedo_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{4}_[0-9]{3}_[0-9]{3}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not match nami...
851175_4
static boolean mfgAncillaryFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Ancillary_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{4}_[0-9]{3}_[0-9]{3}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not matc...
851175_5
static boolean mfgStaticInputFileNameMatches(String fileName) { if (!(fileName.matches("MSA_Static_L2.0_V[0-9].[0-9]{2}_[0-9]{3}_[0-9]{1}.(?i)(hdf)"))) { throw new IllegalArgumentException("Input file name '" + fileName + "' does not match naming convention...
851175_6
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_7
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_8
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
851175_9
@Override public void close() { if (extractDir != null) { FileUtils.deleteTree(extractDir); extractDir = null; } }
859322_0
public static byte[] execute(URL url, InputStream input, String encoding) throws IOException { byte[] bytes; try { StringBuilder sb = new StringBuilder(); UnicodeReader reader = new UnicodeReader(input, encoding); try { char[] cbuf = new char[32]; int r; while ((r = reader.read(cbuf, 0, 3...
859322_1
public Object getProperty(String key) { return eppc.getProperty(key); }
860694_0
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_1
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_2
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_3
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_4
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_5
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_6
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_7
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_8
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860694_9
public static void zipDir(final File zipFile, final File srcDir, final String prefix) throws IOException { ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile)); try { addZipPrefixes(srcDir, out, prefix); addZipDir(srcDir, out, prefix); } finally { // C...
860937_0
@Override public DoubleVector applyToElements(DoubleFunction func) { SparseDoubleVector newVec = new SparseDoubleVector(this.dimension, func.apply(this.defaultValue)); // apply function to all non-empty entries for (Map.Entry<Integer, Double> entry : this.elements.entrySet()) { newVec.elements.put(entry...
860937_1
@Override public DoubleVector add(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vectors are not the same."); return this.addUnsafe(vector); }
860937_2
@Override public DoubleVector subtract(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vector are not the same."); return this.subtractUnsafe(vector); }
860937_3
@Override public DoubleVector multiply(double scalar) { final double val = scalar; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return val * value; } @Override public double applyDerivative(double value) { throw new UnsupportedOpera...
860937_4
@Override public DoubleVector divide(double scalar) { Preconditions.checkArgument(scalar != 0, "Scalar cannot be 0."); final double factor = scalar; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return value / factor; } @Override public ...
860937_5
@Override public DoubleVector pow(int x) { final int p = x; return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.pow(value, p); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException();...
860937_6
@Override public DoubleVector abs() { return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.abs(value); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_7
@Override public DoubleVector sqrt() { return this.applyToElements(new DoubleFunction() { @Override public double apply(double value) { return Math.sqrt(value); } @Override public double applyDerivative(double value) { throw new UnsupportedOperationException(); } }); }
860937_8
@Override public double sum() { double sum = 0.0; Iterator<DoubleVectorElement> itr = this.iterate(); while (itr.hasNext()) { sum += itr.next().getValue(); } return sum; }
860937_9
@Override public double dot(DoubleVector vector) { Preconditions.checkArgument(this.dimension == vector.getDimension(), "Dimensions of two vectors are not equal."); return this.dotUnsafe(vector); }
862445_0
@Override public Iterator<Document> iterator() { if (inputStream != null) { throw new IllegalStateException("already fetched inputStream!"); } return new MultiXmlDocumentIterator(); }
870849_0
public static RuntimeException exceptionWithFriendlyMessageFor(Exception e) { Throwable cause = getRootCause(e); String message = cause.getMessage(); if (message == null) { message = cause.getClass().getSimpleName(); } if (cause instanceof JSchException) { message = "SSH: " + message...
870849_1
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_2
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_3
public int[] match(CharSequence filePath) { Matcher matcher = pattern.matcher(filePath); if (matcher.find()) { for (int i = 0; i < matchingLetters.length; ++i) { matchingLetters[i] = matcher.start(i + 1); } return matchingLetters; } else { return null; } }
870849_4
public List<TagSummary> getAll() { final RevWalk revWalk = new RevWalk(repository); List<TagSummary> tagSummaries = newArrayList(transform(repository.getTags().values(), new TagSummaryFactory(revWalk))); sort(tagSummaries, SORT_BY_TIME_AND_NAME); return tagSummaries; }
870849_5
public List<TagSummary> getAll() { final RevWalk revWalk = new RevWalk(repository); List<TagSummary> tagSummaries = newArrayList(transform(repository.getTags().values(), new TagSummaryFactory(revWalk))); sort(tagSummaries, SORT_BY_TIME_AND_NAME); return tagSummaries; }
870849_6
Intent cloneLauncherForWebBrowseIntent(Uri uri) { Matcher matcher = projectPathPattern.matcher(uri.getPath()); matcher.find(); return cloneLauncherIntentFor("git://github.com" + matcher.group() + ".git"); }
870849_7
Intent cloneLauncherForWebBrowseIntent(Uri uri) { Matcher matcher = projectPathPattern.matcher(uri.getPath()); matcher.find(); return cloneLauncherIntentFor("git://github.com" + matcher.group() + ".git"); }
876766_0
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); ...
876766_1
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); ...
876766_2
@Override public void execute() throws MojoExecutionException, MojoFailureException { client = new DefaultHttpClient(); if (hasProxy()) { enableAxisProxy(); configureHttpClientProxy(); } initializeConfluenceTemplate(); boolean isVersion30AndAbove = isConfluenceVersion30andAbove(); ...
884758_0
public static GrizzlyExecutorService createInstance() { return createInstance(ThreadPoolConfig.DEFAULT); }
88960_10
public void setOptions(Map<String, String> options) { this.options.clear(); this.options.putAll(options); }
88960_11
@VisibleForTesting Map<String, String> getOptions() { return options; }
88960_12
public void setFile(File file) { this.file = file; }
88960_13
public void setFile(File file) { this.file = file; }
88960_14
public void setFile(File file) { this.file = file; }
88960_15
public void setFile(File file) { this.file = file; }
88960_16
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_17
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_18
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_19
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_20
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_21
public String getEdition() { return (String) lintFunc.get("edition", lintFunc); }
88960_22
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_23
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_24
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_25
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_26
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_27
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_28
public String report(String javaScript) { return report(javaScript, false); }
88960_29
public String report(String javaScript) { return report(javaScript, false); }
88960_30
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_31
public void resetOptions() { options.clear(); }
88960_32
public JSLintResult lint(String systemId, Reader reader) throws IOException { return lint(systemId, Util.readerToString(reader)); }
88960_33
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">" + NEWLINE); List<Issue> issues = result.getIssues(); for (Issue issue : issues) { sb.append("<issue"); sb.append(attr("line", Integer.to...
88960_34
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">" + NEWLINE); List<Issue> issues = result.getIssues(); for (Issue issue : issues) { sb.append("<issue"); sb.append(attr("line", Integer.to...
88960_35
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">\n"); for (Issue issue : result.getIssues()) { sb.append("<error"); sb.append(attr("line", Integer.toString(issue.getLine()))); sb.app...