id
stringlengths
7
14
text
stringlengths
1
106k
4298816_9
@Override public List<File> findByCriteria(String criteria, boolean isCaseSens) { return fileDAO.findByCriteria(criteria, isCaseSens); }
4300205_0
@Override public String toString() { return endpointUri.toString(); }
4300205_1
@Override public String toString() { return endpointUri.toString(); }
4300205_2
public Stats getStats() { return new Stats(stats); }
4300205_3
public Stats getStats() { return new Stats(stats); }
4300205_4
public Stats getStats() { return new Stats(stats); }
4300205_5
public Stats getStats() { return new Stats(stats); }
4300205_6
public List<SessionTicketKey> parse(File file) throws IOException { return parseBytes(Files.toByteArray(file)); }
4300205_7
public List<SessionTicketKey> parse(File file) throws IOException { return parseBytes(Files.toByteArray(file)); }
4300205_8
public List<SessionTicketKey> parse(File file) throws IOException { return parseBytes(Files.toByteArray(file)); }
4300205_9
public List<SessionTicketKey> parse(File file) throws IOException { return parseBytes(Files.toByteArray(file)); }
4315362_0
public static <T> Try<T> of(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); try { return success(callable.call()); } catch (Throwable t) { return failure(t); } }
4315362_1
public static <T> Try<T> of(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); try { return success(callable.call()); } catch (Throwable t) { return failure(t); } }
4315362_2
public static <T> Try<T> of(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); try { return success(callable.call()); } catch (Throwable t) { return failure(t); } }
4315362_3
public static <T> Try<T> of(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); try { return success(callable.call()); } catch (Throwable t) { return failure(t); } }
4315362_4
public static <T> Try<T> of(Callable<? extends T> callable) { Objects.requireNonNull(callable, "callable is null"); try { return success(callable.call()); } catch (Throwable t) { return failure(t); } }
4315362_5
public static Try<Void> run(CheckedRunnable runnable) { Objects.requireNonNull(runnable, "runnable is null"); try { runnable.run(); return success(null); // null represents the absence of an value, i.e. Void } catch (Throwable t) { return failure(t); } }
4315362_6
public static Try<Void> run(CheckedRunnable runnable) { Objects.requireNonNull(runnable, "runnable is null"); try { runnable.run(); return success(null); // null represents the absence of an value, i.e. Void } catch (Throwable t) { return failure(t); } }
4315362_7
public static Try<Void> run(CheckedRunnable runnable) { Objects.requireNonNull(runnable, "runnable is null"); try { runnable.run(); return success(null); // null represents the absence of an value, i.e. Void } catch (Throwable t) { return failure(t); } }
4315362_8
public static Try<Void> run(CheckedRunnable runnable) { Objects.requireNonNull(runnable, "runnable is null"); try { runnable.run(); return success(null); // null represents the absence of an value, i.e. Void } catch (Throwable t) { return failure(t); } }
4315362_9
public static <T> Try<T> success(T value) { return new Success<>(value); }
4327427_0
@Override public void startTask(long totalUnits, String task) { if (totalUnits < 0) throw new IllegalArgumentException("Total works units must be positive."); // Calculate the shift. This is inversely related to the number of // leading zeros: if we start off with 33 leading zeros, we need no shift, // because th...
4327427_1
@Override public void worked(long workUnits) { if (workUnits < 0) throw new IllegalArgumentException("Going backwards? (Work units may not be negative)"); // Add up the total number of work units we've worked: totalWorked += workUnits; // And see how that translates to an int int intUnits = (int)(totalWorked >> ...
4327427_2
public String readLine() { return readLines.poll(); }
4327427_3
@Override protected void runProcess() throws Exception { statusString.set("Starting thickness classifier..."); // Change to our process-specific logger log = LoggerFactory.getLogger(getClass().getName() + "." + ProcessManager.uidToString(getUID())); try { super.runProcess(); statusString.set("Completed successf...
4327427_4
public static List<File> parseClassPath(String classPath) { List<File> result = new ArrayList<File>(32); if (classPath == null || classPath.length() == 0) return result; // We can't use split because we can't be sure that the path separator // isn't a metacharacter. (It probably isn't, but let's be safe.) int st...
4327427_5
static String createDicomResultURI(DicomObject dicom) { SpecificCharacterSet sc = dicom.getSpecificCharacterSet(); try { StringBuilder result = new StringBuilder("studyUID="); DicomElement e = dicom.get(Tag.StudyInstanceUID); if (e == null) { // No study ID? Give up logger().debug("No StudyInstanceUID fou...
4327427_6
public static long round(double v) { // Use Math.round to tackle the special cases of +/- Infinity and NaN long result = Math.round(v); // The only special case kicks in if the value is negative and has a // 0.5 part. if (v < 0.0 && (result - v) == 0.5) { return result - 1; } return result; }
4335519_0
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_1
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_2
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_3
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_4
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_5
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_6
@Override public boolean accept(InputFile inputFile) { boolean isJsTs = JavaScriptLanguage.KEY.equals(inputFile.language()) || TypeScriptLanguage.KEY.equals(inputFile.language()); if (isJsTs && SizeAssessor.hasExcessiveSize(inputFile, maxFileSizeKb * 1000)) { LOG.debug("File {} was excluded because of e...
4335519_7
@CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); }
4335519_8
@CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); }
4335519_9
@CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); }
4336113_0
@Override public Set<NATSituation> getTraversaledNATSituations() { return Collections.unmodifiableSet(this.traversaledNATSituations); }
4336113_1
@Override public NATTraversalTechniqueAttribute getAttribute() { return new ReversalAttribute(); }
4336113_2
@Override public Set<NATSituation> getTraversaledNATSituations() { return Collections.unmodifiableSet(this.traversaledNATSituations); }
4336113_3
@Override public NATTraversalTechniqueAttribute getAttribute() { return new DirectconnectionAttribute(); }
4336113_4
public String getTargetId() { return this.targetId; }
4336113_5
public Socket establishConnection() { Socket connectedSocket = this.connectionEstablishment.establishConnection(this.targetId, config); if (null == connectedSocket) { logger.error("socket for target {} is null", this.targetId); } else if (!connectedSocket.isConnected()) { logger.error("socke...
4336113_6
@Override public ConnectionDuration getConnectionDuration() { return this.connectionDuration; }
4336113_7
@Override public ServiceClass getServiceClass() { return this.serviceClass; }
4336113_8
@Override public boolean directConnectionRequired() { return this.directConnectionRequired; }
4336113_9
@Override public List<NATTraversalTechnique> getNATTraversalTechniquesForNATSituation(final NATSituation natSituation) { List<NATTraversalTechnique> natTraversalTechniques = new ArrayList<NATTraversalTechnique>(); // if (!this.isUnknownNATSituation(natSituation)) { natTraversalTechniques.addAll(this.determi...
4338484_0
public Map<String, String> getUsernameAndPassword(String tempToken) { this.vaultConfig.token(tempToken); Vault vault = new Vault(this.vaultConfig); try { final Map<String, String> data = vault.logical().read("cubbyhole/" + cubbyholeName).getData(); final String permToken = data.get("permtoke...
4338484_1
public T propertyByType(Object testInstance, Class<T> type) { Class<?> clazz = testInstance.getClass(); if (isTargetSet(testInstance)) { List<Field> fields = getAllFields(new LinkedList<Field>(), clazz); for (Field field : fields) { if (type.isAssignableFrom(field.getType())) { return (T) new Fiel...
4338484_2
public T propertyByType(Object testInstance, Class<T> type) { Class<?> clazz = testInstance.getClass(); if (isTargetSet(testInstance)) { List<Field> fields = getAllFields(new LinkedList<Field>(), clazz); for (Field field : fields) { if (type.isAssignableFrom(field.getType())) { return (T) new Fiel...
4338484_3
public T propertyByType(Object testInstance, Class<T> type) { Class<?> clazz = testInstance.getClass(); if (isTargetSet(testInstance)) { List<Field> fields = getAllFields(new LinkedList<Field>(), clazz); for (Field field : fields) { if (type.isAssignableFrom(field.getType())) { return (T) new Fiel...
4338484_4
public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } }
4338484_5
public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } }
4338484_6
public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens...
4338484_7
public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens...
4338484_8
public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens...
4340532_0
public List<Accept> getAccepts() { return accepts; }
4340532_1
public List<Accept> getAccepts() { return accepts; }
4340532_2
public List<Accept> getAccepts() { return accepts; }
4340532_3
public List<Accept> getAccepts() { return accepts; }
4340532_4
public List<Accept> getAccepts() { return accepts; }
4340532_5
public List<Accept> getAccepts() { return accepts; }
4340532_6
public List<Accept> getAccepts() { return accepts; }
4340532_7
public List<Accept> getAccepts() { return accepts; }
4340532_8
@Override public void initialise() throws RestAnnotationException { super.initialise(); this.pathRegularExpression = parsePath(); }
4340532_9
@Override public void initialise() throws RestAnnotationException { super.initialise(); this.pathRegularExpression = parsePath(); }
4341250_0
public static ContainsValidEndPointCheck forPool(ServicePool<?> pool) { return new ContainsValidEndPointCheck(pool); }
4341250_1
public static ContainsHealthyEndPointCheck forPool(ServicePool<?> pool) { return new ContainsHealthyEndPointCheck(pool); }
4341250_2
@Override public void start() { // Nothing to do }
4341250_3
@Override public void stop() { ServicePoolProxies.close(_proxy); }
4341250_4
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4341250_5
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4341250_6
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4341250_7
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4341250_8
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4341250_9
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
4346047_0
public Method getMethod() { return method; }
4346047_1
public static ClassLoader getBootstrapClassLoader() { return ClassLoader.getSystemClassLoader().getParent(); }
4346047_2
public static JavaArchive getJavaArchiveFromClass(Class<?> clazz) { URL url = clazz.getResource(clazz.getSimpleName() + ".class"); try { // get a absolute file system path String file = url.getFile(); if (file.startsWith("file:")) { file = file.substring(file.indexOf(":") + 1...
4346047_3
public static JavaArchive getJavaArchiveFromClass(Class<?> clazz) { URL url = clazz.getResource(clazz.getSimpleName() + ".class"); try { // get a absolute file system path String file = url.getFile(); if (file.startsWith("file:")) { file = file.substring(file.indexOf(":") + 1...
4346047_4
public void register(URL proxyUrl, Class<?> testClass, OperationalContext context) { if (urlToContext.get(proxyUrl) != null) { throw new IllegalStateException("The OperatiocalContext was already set for URL: " + proxyUrl); } urlToContext.put(proxyUrl, context); Set<URL> urls = testClassToUrls.ge...
4346047_5
public void register(URL proxyUrl, Class<?> testClass, OperationalContext context) { if (urlToContext.get(proxyUrl) != null) { throw new IllegalStateException("The OperatiocalContext was already set for URL: " + proxyUrl); } urlToContext.put(proxyUrl, context); Set<URL> urls = testClassToUrls.ge...
4346047_6
public Inspection getTransformedInspection() { return transformedInspection; }
4346047_7
public Inspection getTransformedInspection() { return transformedInspection; }
4346047_8
public Inspection getTransformedInspection() { return transformedInspection; }
4346047_9
public Inspection getTransformedInspection() { return transformedInspection; }
4349381_0
public List<FreewaySegmentFluency> getBisonFuteTrafficStatus() throws ApiReseauException { //FreewaySegmentFluency List<FreewaySegmentFluency> freewaySegFluency = new ArrayList<FreewaySegmentFluency>(); List<BasicDataValue> result = appelApi(getUrl(CMD_SEGMENT_FLUENCY)); for(BasicDataValue r: result) { ...
4349381_1
public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) { // http://en.wikipedia.org/wiki/Haversine_formula double dLat = Math.toRadians(p2.getLatitude() - p1.getLatitude()); double dLon = Math.toRadians(p2.getLongitude() - p1.getLongitude()); double lat1 = Math.toRadians(p1.getLatitude()); double lat2 = ...
4349381_2
public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) { // http://en.wikipedia.org/wiki/Haversine_formula double dLat = Math.toRadians(p2.getLatitude() - p1.getLatitude()); double dLon = Math.toRadians(p2.getLongitude() - p1.getLongitude()); double lat1 = Math.toRadians(p1.getLatitude()); double lat2 = ...
4349381_3
public BoundingBox getBoundingBox(GpsPoint center, double distance) { // angular distance in radians on a great circle double radDist = distance / EARTH_RADIUS; double radLat = Math.toRadians(center.getLatitude()); double radLon = Math.toRadians(center.getLongitude()); double minLat = radLat - radDist; double max...
4349381_4
public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) { HttpGet httpRequest = new HttpGet(appendParameterToUrl(GOOGLE_API, p1, p2)); HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = null; GoogleRoutes pl = null; try { response = httpclient.execute(httpRequest); String json...
4349381_5
public static List<Segment> parseSegments(InputStream in) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); Gson gson = new Gson(); return gson.fromJson(reader, new TypeToken<List<Segment>>() {}.getType()); } catch (UnsupportedEnco...
4353723_0
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4353723_1
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4353723_2
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4353723_3
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4353723_4
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4353723_5
static List<String> splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { // Assume we're using JSON IDs List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { ...
4368712_0
public boolean isPrixiable(Injectee injectee) { return !ignoredClass(injectee.getRequiredType()) && isPrixiable(injectee.getParentClassScope()); }