id
stringlengths
7
14
text
stringlengths
1
106k
4368712_1
public boolean isPrixiable(Injectee injectee) { return !ignoredClass(injectee.getRequiredType()) && isPrixiable(injectee.getParentClassScope()); }
4368712_2
public boolean isPrixiable(Injectee injectee) { return !ignoredClass(injectee.getRequiredType()) && isPrixiable(injectee.getParentClassScope()); }
4368712_3
public boolean isPrixiable(Injectee injectee) { return !ignoredClass(injectee.getRequiredType()) && isPrixiable(injectee.getParentClassScope()); }
4368712_4
public boolean isPrixiable(Injectee injectee) { return !ignoredClass(injectee.getRequiredType()) && isPrixiable(injectee.getParentClassScope()); }
4368712_5
public Constructor<T> getConstructor() { return constructor.get(); }
4368712_6
public Constructor<T> getConstructor() { return constructor.get(); }
4368712_7
public Constructor<T> getConstructor() { return constructor.get(); }
4368712_8
public Constructor<T> getConstructor() { return constructor.get(); }
4368712_9
public Constructor<T> getConstructor() { return constructor.get(); }
4368907_0
@Override public XBELDocument unmarshal(final String str) throws JAXBException, IOException { try { validator.validate(str); } catch (SAXException e) { throw new JAXBException(e); } return super.unmarshal(str); }
4368907_1
public static StackTraceElement myFrame() { final Thread me = currentThread(); StackTraceElement[] se = getAllStackTraces().get(me); for (int i = 0; i < se.length; i++) { String sClass = se[i].getClassName(); if (!sClass.equals(CLASS)) continue; String method = se[i].getMethodName();...
4368907_2
protected static boolean validateRegExp(String pattern, String value) throws PatternSyntaxException { Pattern re = patternCache.get(pattern); if (re == null) { re = compile(pattern, MULTILINE | DOTALL); patternCache.put(pattern, re); } return (re.matcher(value).matches()); }
4368907_3
protected static boolean validateRegExp(String pattern, String value) throws PatternSyntaxException { Pattern re = patternCache.get(pattern); if (re == null) { re = compile(pattern, MULTILINE | DOTALL); patternCache.put(pattern, re); } return (re.matcher(value).matches()); }
4368907_4
protected static boolean validateRegExp(String pattern, String value) throws PatternSyntaxException { Pattern re = patternCache.get(pattern); if (re == null) { re = compile(pattern, MULTILINE | DOTALL); patternCache.put(pattern, re); } return (re.matcher(value).matches()); }
4368907_5
@Override public Document convert(BELDocument bd) { if (bd == null) { return null; } final Header header = dhc.convert(bd.getDocumentHeader()); // handle annotation definitions Set<BELAnnotationDefinition> badlist = bd.getAnnotationDefinitions(); List<AnnotationDefinition> adlist = null;...
4368907_6
public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; }
4368907_7
public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; }
4368907_8
public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; }
4368907_9
public List<BELParseErrorException> getSyntaxErrors() { return syntaxErrors; }
4376619_0
@Override public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException { return exceptionClassToSkip.isAssignableFrom(t.getClass()); }
4376619_1
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { ZipInputStream zis = new ZipInputStream(new BufferedInputStream(inputResource.getInputStream())); File targetDirectoryAsFile = new File(targetDirectory); if(!targetDirectoryAsFile.exists()) { FileUtils.forc...
4376619_2
public JobExecution launch(JobLaunchRequest request) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException, NoSuchJobException { Job job = jobRegistry.getJob(request.getJobName()); JobParametersBuilder builder = new JobParametersBuild...
4376619_3
@Override public String generateFileName(Message<?> message) { Assert.notNull(message.getPayload()); Assert.isInstanceOf(String.class, message.getPayload()); String payload = (String) message.getPayload(); return ProductImportUtils.extractImportId(payload)+".xml"; }
4376619_5
public void validate(T value) throws ValidationException { Set<ConstraintViolation<T>> violations = validator.validate(value); if(!violations.isEmpty()) { throw new ValidationException("Validation failed for " + value + ": " + violationsToString(violations)); } }
4376619_6
public void validate(T value) throws ValidationException { Set<ConstraintViolation<T>> violations = validator.validate(value); if(!violations.isEmpty()) { throw new ValidationException("Validation failed for " + value + ": " + violationsToString(violations)); } }
4376619_7
public void validate(T value) throws ValidationException { Set<ConstraintViolation<T>> violations = validator.validate(value); if(!violations.isEmpty()) { throw new ValidationException("Validation failed for " + value + ": " + violationsToString(violations)); } }
4387088_0
static void backupAllBooks() { BooksDbAdapter booksDbAdapter = BooksDbAdapter.getInstance(); List<String> bookUIDs = booksDbAdapter.getAllBookUIDs(); Context context = GnuCashApplication.getAppContext(); for (String bookUID : bookUIDs) { String backupFile = getBookBackupFileUri(bookUID); ...
4387088_1
public static List<File> getBackupList(String bookUID) { File[] backupFiles = new File(getBackupFolderPath(bookUID)).listFiles(); Arrays.sort(backupFiles); List<File> backupFilesList = Arrays.asList(backupFiles); Collections.reverse(backupFilesList); return backupFilesList; }
4387088_2
public static List<File> getBackupList(String bookUID) { File[] backupFiles = new File(getBackupFolderPath(bookUID)).listFiles(); Arrays.sort(backupFiles); List<File> backupFilesList = Arrays.asList(backupFiles); Collections.reverse(backupFilesList); return backupFilesList; }
4389698_0
public String max(BinaryTree<String> tree) { return tree.match(new BinaryTree.MatchBlock<String, String>() { @Override public String _case(Node<String> x) { final String maxLeft = max(x.left); final String maxRight = max(x.right); return maxString(maxString(maxLeft, maxRigh...
4389698_1
public BinaryTree<String> createExample() { // START SNIPPET: sampleTree BinaryTree<String> empty = BinaryTree.<String>_EmptyTree(); return _Node("hello", _Node("goodbye", empty, empty), _Node("whatever", empty, _Node("foo", empty, empty))); // END SNIPPET: sampleTree }
4389698_2
public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return ...
4389698_3
public boolean isApprovedV2(TPSReportStatus status) { return status instanceof TPSReportStatus.Approved; }
4389698_4
public String message(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlock<String>() { @Override public String _case(Pending x) { return "Pending"; } @Override public String _case(Approved x) { return "Approved by " + x.approver...
4389698_5
public void notify(TPSReportStatus status, final StatusNotifier notifier) { status._switch(new TPSReportStatus.SwitchBlock() { @Override public void _case(Denied x) { notifier.notifyDenied(); } @Override public void _case(Approved x) { ...
4389698_6
public void notifyDenied(TPSReportStatus status, final StatusNotifier notifier) { status._switch(new SwitchBlockWithDefault() { @Override public void _case(Denied x) { notifier.notifyDenied(); } @Override protected void _default(TPSReportStatus x) { ...
4389698_7
public IntBinaryTree createExample() { // START SNIPPET: sampleTree IntBinaryTree tree = _Node(42, _Node(12, _EmptyTree(), _EmptyTree()), _Node(103, _EmptyTree(), _Node(110, _EmptyTree(), _EmptyTree()))); // END SNIPPET: sampleTree return tree; }
4389698_8
public Integer max(IntBinaryTree tree) { return tree.match(new IntBinaryTree.MatchBlock<Integer>() { @Override public Integer _case(Node x) { final Integer maxLeft = max(x.left); final int l = maxLeft == null ? Integer.MIN_VALUE : maxLeft; final Integer maxRight = max(x.right)...
4389698_9
public Function sampleFunction() { // START SNIPPET: sampleFunction Function sampleFunction = _Function(_Int(), "addTwo", asList(_Arg(_Int(), "x"), _Arg(_Int(), "y")), asList(_Return(_Add(_Variable("x"), _Variable("y"))))); // END SNIPPET: sampleFunction return sampleFunctio...
4390160_0
public boolean containsAndAdd(byte[] id) { HashCode code = HASH_FUNC.hashBytes(id); int index = Math.abs(code.asInt()) & sizeMask; byte[] oldId = array.getAndSet(index, id); return Arrays.equals(id, oldId); }
4390160_1
public int getSize() { return array.length(); }
4390160_2
public boolean containsAndAdd(Element element) { ByteBuffer eBytes = element.getByteBuffer(); HashCode code = HASH_FUNC.hashBytes(eBytes.array()); int index = code.asInt() & sizeMask; boolean seen = true; ByteBuffer buffer = array[index]; synchronized(buffer) { if (!buffer.equals(eBytes)) { seen =...
4390160_3
public int getSize() { return array.length; }
4398263_0
static String getFeatureConfigUrl(String remoteFeatureName, String remoteFileName) { BVSDK bvsdk = BVSDK.getInstance(); String amazonS3Url = bvsdk.getBvWorkerData().getRootApiUrls().getNotificationConfigUrl(); String clientId = bvsdk.getBvUserProvidedData().getBvConfig().getClientId(); return amazonS3Ur...
4398263_1
static String getFeatureConfigUrl(String remoteFeatureName, String remoteFileName) { BVSDK bvsdk = BVSDK.getInstance(); String amazonS3Url = bvsdk.getBvWorkerData().getRootApiUrls().getNotificationConfigUrl(); String clientId = bvsdk.getBvUserProvidedData().getBvConfig().getClientId(); return amazonS3Ur...
4398263_2
public Profile getProfile() { return profile; }
4398263_3
public Profile getProfile() { return profile; }
4398263_4
@Override public String toString() { return "ShopperProfile{" + "profile=" + profile + '}'; }
4398263_5
public Profile getProfile() { return profile; }
4398263_6
static boolean isEmpty(String input) { return input == null || input.isEmpty(); }
4398263_7
static String componentsSeparatedBy(@NonNull List list, String splitBy) { return componentsSeparatedBy(list, splitBy, false); }
4398263_8
static String componentsSeparatedByWithEscapes(@NonNull List list, String splitBy) { return componentsSeparatedBy(list, splitBy, true); }
4398263_9
public static BVSDK getInstance() { confirmBVSDKCreated(); return singleton; }
4399205_0
private void printHelp() { String header = "Sign and timestamp a Windows executable file, a Microsoft Installer (MSI) or a script (PowerShell, VBScript, JScript, WSF).\n\n"; String footer ="\n" + "Examples:\n\n" + " Signing with a PKCS#12 keystore and timestamping:\n\n" + "...
4399205_1
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_2
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_3
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_4
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_5
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_6
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_7
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_8
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4399205_9
void execute(String... args) throws SignerException, ParseException { DefaultParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help") || args.length == 0) { printHelp(); return; } SignerHelper helper = new SignerHelper(ne...
4406463_0
public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); }
4406463_1
public void defaults(double best, double worst) { threshold1 = worst; threshold5 = best; threshold2 = worst + ((best - worst) / 4); threshold3 = worst + ((best - worst) / 4) * 2; threshold4 = worst + ((best - worst) / 4) * 3; }
4406463_2
public void addAlternative(Alternative alternative) throws PlanningException { if (!isAlternativeNameUnique(alternative.getName())) { throw new PlanningException("A unique name must be provided for the alternative."); } if (!isAlternativeNameValid(alternative.getName())) { String msg = Strin...
4406463_3
public void addAlternative(Alternative alternative) throws PlanningException { if (!isAlternativeNameUnique(alternative.getName())) { throw new PlanningException("A unique name must be provided for the alternative."); } if (!isAlternativeNameValid(alternative.getName())) { String msg = Strin...
4406463_4
public void addAlternative(Alternative alternative) throws PlanningException { if (!isAlternativeNameUnique(alternative.getName())) { throw new PlanningException("A unique name must be provided for the alternative."); } if (!isAlternativeNameValid(alternative.getName())) { String msg = Strin...
4406463_5
@Override public boolean isCompletelySpecified(List<ValidationError> errors) { boolean noError = true; if (this.children.size() == 0) { errors.add(new ValidationError("Node " + this.getName() + " has no Children.", this)); noError = false; } if (this.hasDuplicates(errors)) { noError...
4406463_6
public void removeValues(List<Alternative> list, int record) { for (Alternative a : list) { Values v = getValues(a.getName()); // maybe this alternative has no values at all - e.g. because it was // just created if ((v != null) // there is a Values object && (v.getList()....
4406463_7
public int removeLooseValues(List<String> alternatives, int records) { int number = 0; Iterator<String> it = valueMap.keySet().iterator(); List<String> namesToRemove = new ArrayList<String>(); while (it.hasNext()) { String altName = it.next(); if (!alternatives.contains(altName)) { ...
4406463_8
public boolean validateAndSetRestriction(String restriction) { if (p.matcher(restriction).matches()) { setRestriction(restriction); return true; } else { return false; } }
4406463_9
public boolean validateAndSetRestriction(String restriction) { if (p.matcher(restriction).matches()) { setRestriction(restriction); return true; } else { return false; } }
4408504_0
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4408504_1
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4408504_2
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4408504_3
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4408504_4
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4408504_5
public InChI generateInchi(IAtomContainer atc) throws IOException, CDKException { String workingDir=System.getProperty("user.dir")+ System.getProperty("file.separator"); return generateInchi(atc,workingDir); }
4416959_0
@Override public EntityManager create(final String persistenceUnitName) { return getEntityManagerFactory(persistenceUnitName).createEntityManager(); }
4416959_1
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_2
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_3
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_4
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_5
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_6
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_7
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_8
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4416959_9
@Override public void addTransactionCommitAdvice(MethodAdviceReceiver receiver) { for (final Method m : receiver.getInterface().getMethods()) { if (m.getAnnotation(CommitAfter.class) != null) { PersistenceContext annotation = receiver.getMethodAnnotation(m, Persis...
4421246_0
@Override public QueryResult getResult() throws Exception { return this.getResult(false); }
4437408_0
@Override public String toString() { return "latitude: " + this.latitude + ", longitude: " + this.longitude; }
4437408_1
@Override public String toString() { return "latitude: " + this.latitude + ", longitude: " + this.longitude; }
4437408_2
public static double longitudeToMetersX(double longitude) { return WGS84.EQUATORIALRADIUS * java.lang.Math.toRadians(longitude); }
4437408_3
public static double latitudeToMetersY(double latitude) { return WGS84.EQUATORIALRADIUS * java.lang.Math.log(java.lang.Math.tan(java.lang.Math.PI / 4 + 0.5 * java.lang.Math.toRadians(latitude))); }
4437408_4
public GeoCoordinate center() { return new GeoCoordinate(this.minLatitudeE6 + (int) Math.round((this.maxLatitudeE6 - this.minLatitudeE6) / 2.0d), this.minLongitudeE6 + (int) Math.round((this.maxLongitudeE6 - this.minLongitudeE6) / 2.0d)); }
4437408_5
public void expandToInclude(GeoCoordinate gc) { expandToInclude(gc.getLatitudeE6(), gc.getLongitudeE6()); }
4437408_6
public void expandToInclude(GeoCoordinate gc) { expandToInclude(gc.getLatitudeE6(), gc.getLongitudeE6()); }
4437408_7
public double distance(Rect otherRect) { if (overlaps(otherRect)) { return 0; } int dLat1, dLat2; int dLon1, dLon2; if (this.maxLatitudeE6 < otherRect.minLatitudeE6) { dLat1 = this.maxLatitudeE6; dLat2 = otherRect.minLatitudeE6; } else if (this.minLatitudeE6 > otherRect.maxLatitudeE6) { dLat1 = this.minLa...
4437408_8
public static boolean overlaps(int minLon1, int maxLon1, int minLat1, int maxLat1, int minLon2, int maxLon2, int minLat2, int maxLat2) { return !(minLon1 > maxLon2 || minLon2 > maxLon1 || minLat1 > maxLat2 || minLat2 > maxLat1); }
4437408_9
public static byte[] getFiveBytes(long value) { if (value < 0) { throw new IllegalArgumentException("negative value not allowed: " + value); } else if (value > 1099511627775L) { throw new IllegalArgumentException("value out of range: " + value); } return new byte[] { (byte) (value >> 32), (byte) (value >> 24), ...