id
stringlengths
7
14
text
stringlengths
1
106k
1072630_1
;
1072630_2
public <T> Iterable<T> mapPaths(final Iterable<Path> paths, final PathMapper<T> pathMapper) { assert paths != null; assert pathMapper != null; IterationController.IterationMode mode = getIterationControl(pathMapper); switch (mode) { case EAGER: case EAGER_STOP_ON_NULL: List<T...
1072630_3
public <T> Iterable<T> mapPaths(final Iterable<Path> paths, final PathMapper<T> pathMapper) { assert paths != null; assert pathMapper != null; IterationController.IterationMode mode = getIterationControl(pathMapper); switch (mode) { case EAGER: case EAGER_STOP_ON_NULL: List<T...
1076094_0
public IncomingMessageFormDefinition getByCode(String formCode) { logger.debug("variable passed to getByCode: " + formCode); try { Criterion code = Restrictions.eq("formCode", formCode); IncomingMessageFormDefinition definition = (IncomingMessageFormDefinition)this.getSessionFactory().getCu...
1076094_1
public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); ...
1076094_2
public GatewayResponse getMostRecentResponseByMessageId(Long messageId) { logger.debug("variable passed to getMostRecentResponseByRequestId: " + messageId); try { GatewayResponse response = null; String query = "from GatewayResponseImpl g where g.gatewayRequest.messageRequest.id = :reqI...
1076094_3
public List<GatewayRequest> getByStatusAndSchedule(MStatus status, Date schedule) { logger.debug("variables passed to getByStatusAndSchedule. status: " + status + "And schedule: " + schedule); try { List<GatewayRequest> allbystatandSdule; Criteria criteria = this.getSessionFactory().getCurrentS...
1076094_4
public Language getByCode(String code) { logger.debug("variable passed to getByCode: " + code); try { Language lang = (Language) this.getSessionFactory().getCurrentSession().createCriteria(LanguageImpl.class).add(Restrictions.eq("code", code)).uniqueResult(); logger.debug(lang); ...
1076094_5
public Language getByCode(String code) { logger.debug("variable passed to getByCode: " + code); try { Language lang = (Language) this.getSessionFactory().getCurrentSession().createCriteria(LanguageImpl.class).add(Restrictions.eq("code", code)).uniqueResult(); logger.debug(lang); ...
1076094_6
public MessageTemplate getTemplateByLangNotifMType(Language lang, NotificationType notif, MessageType type) { logger.debug("variables passed to getTemplateByLangNotifMType. language: " + lang + "And NotificationType: " + notif + "And MessageType: " + type); try { MessageTemplate template = (Mess...
1076094_7
public IMPService createIMPService(){ return (IMPService)context.getBean("impService"); }
1076094_8
public IncomingMessageParser createIncomingMessageParser(){ return (IncomingMessageParser)context.getBean("imParser"); }
1076094_9
public IncomingMessageFormValidator createIncomingMessageFormValidator(){ return (IncomingMessageFormValidator)context.getBean("imFormValidator"); }
1076159_0
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_1
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_2
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_3
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_4
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_5
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_6
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_7
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_8
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076159_9
public static <T> Instantiator<T> createInstantiator( Class<T> klass, InstantiatorModule... modules) { Errors errors = new Errors(); for (Instantiator<T> instantiator : createInstantiator(errors, klass, modules)) { return instantiator; } errors.throwIfHasErrors(); // The following program should not b...
1076632_0
public User newUser(WebStaff webStaff) { User user = new User(); user.setSystemId(identifierGenerator.generateStaffId()); user.setGender(MotechConstants.GENDER_UNKNOWN_OPENMRS); PersonName name = new PersonName(webStaff.getFirstName(), null, webStaff.getLastName()); user.addName(name); String ph...
1076632_1
public MotechUserTypes userTypes() { return motechUsers.types(); }
1076632_2
@Override public void execute() { long start = System.currentTimeMillis(); log.info("Message Program Task - Update Enrolled Programs for all Patients"); Integer batchSize = null; String batchSizeProperty = taskDefinition.getProperty(MotechConstants.TASK_PROPERTY_BATCH_SIZE); if (batchSizeProperty != null) { try ...
1076632_3
@Override public void execute() { long start = System.currentTimeMillis(); log.info("executing task"); String timeOffsetString = this.taskDefinition .getProperty(MotechConstants.TASK_PROPERTY_TIME_OFFSET); Boolean sendImmediate = Boolean.valueOf(taskDefinition .getProperty(MotechConstants.TASK_PROPERTY_SEND_I...
1076632_4
public Patient build() { if (registrantType == RegistrantType.CHILD_UNDER_FIVE) { return buildChild(); } else { return buildPatient(); } }
1076632_5
public List<Patient> getAllDuplicatePatients() { return motechDAO.getAllDuplicatePatients(); }
1076632_6
public Facility facilityFor(Patient patient) { return motechDAO.facilityFor(patient); }
1076632_7
public MotechConfiguration getConfigurationFor(String name) { return motechDAO.getConfiguration(name); }
1076632_8
public DefaultedExpectedEncounterAlert getDefaultedEncounterAlertFor(ExpectedEncounter expectedEncounter) { return motechDAO.getDefaultedEncounterAlertFor(expectedEncounter); }
1076632_9
public DefaultedExpectedObsAlert getDefaultedObsAlertFor(ExpectedObs expectedObs) { return motechDAO.getDefaultedObsAlertFor(expectedObs); }
1077753_0
public static List<String> statementsFrom(Reader reader) throws IOException { SQLFile file = new SQLFile(); file.parse(reader); return file.getStatements(); }
1077753_1
public static List<String> statementsFrom(Reader reader) throws IOException { SQLFile file = new SQLFile(); file.parse(reader); return file.getStatements(); }
1079636_0
public static boolean isClassAccessChange(final int oldAccess, final int newAccess) { if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; // 13.4.1 #1 } else if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return tru...
1079636_1
public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; // 13.4.7 } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; // 13.4.9 #1 } else { fina...
1079636_2
public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; // 13.4.7 } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; // 13.4.16 #2 ...
1079636_3
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_4
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_5
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_6
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_7
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_8
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1079636_9
protected boolean isClassConsidered( final String className ) { // Fix case where class names are reported with '.' final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude....
1081751_0
@Nonnull public final T get() { return value; }
1081751_1
@Nonnull public static XProperties from(@Nonnull @NonNull final String absolutePath) throws IOException { final Resource resource = new PathMatchingResourcePatternResolver() .getResource(absolutePath); try (final InputStream in = resource.getInputStream()) { final XProperties xprops ...
1081751_2
@Override public synchronized void load(@Nonnull final Reader reader) throws IOException { final ResourcePatternResolver loader = new PathMatchingResourcePatternResolver(); try (final CharArrayWriter writer = new CharArrayWriter()) { try (final BufferedReader lines = new BufferedRead...
1081751_3
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081751_4
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081751_5
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081751_6
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081751_7
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081751_8
@Nullable @Override public synchronized Object get(final Object key) { final Object value = super.get(key); if (null == value || !(value instanceof String)) return value; return substitutor.replace((String) value); }
1081751_9
@Nullable @Override public String getProperty(final String key) { final String value = super.getProperty(key); if (null == value) return null; return substitutor.replace(value); }
1081991_1
public static File findFile(File rootDir, final String fileName) { FilenameFilter filter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals(fileName); } }; return findFile(rootDir, filter); }
1081991_2
public static File findFile(File rootDir, final String fileName) { FilenameFilter filter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals(fileName); } }; return findFile(rootDir, filter); }
1081991_3
public static File findFile(File rootDir, final String fileName) { FilenameFilter filter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals(fileName); } }; return findFile(rootDir, filter); }
1081991_4
public static File findFile(File rootDir, final String fileName) { FilenameFilter filter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals(fileName); } }; return findFile(rootDir, filter); }
1081991_5
public static File findFile(File rootDir, final String fileName) { FilenameFilter filter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals(fileName); } }; return findFile(rootDir, filter); }
1081991_6
public URI buildWar() { if (option.getName() == null) { option.name(UUID.randomUUID().toString()); } processClassPath(); try { File webResourceDir = getWebResourceDir(); File probeWar = new File(tempDir, option.getName() + ".war"); ZipBuilder builder = new ZipBuilder(prob...
1081991_7
public URI buildWar() { if (option.getName() == null) { option.name(UUID.randomUUID().toString()); } processClassPath(); try { File webResourceDir = getWebResourceDir(); File probeWar = new File(tempDir, option.getName() + ".war"); ZipBuilder builder = new ZipBuilder(prob...
1081991_8
@Override public Object remoteCall(final Class<?> serviceType, final String methodName, final Class<?>[] methodParams, String filter, final RelativeTimeout timeout, final Object... actualParams) throws NoSuchServiceException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { LOG...
1081991_9
public void loadSystemProperties(String configurationKey) { String propertyRef = getProperty(configurationKey); if (propertyRef == null) { return; } if (propertyRef.startsWith("env:")) { propertyRef = propertyRef.substring(4); propertyRef = System.getenv(propertyRef); } i...
1089023_0
@Override public void subscribe(Completable.Observer subscriber) { completionSignal.subscribe(subscriber); }
1090553_0
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_1
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_2
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_3
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_4
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_5
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_6
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_7
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_8
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1090553_9
public Result getMembership(RegionAssociable subject) { checkNotNull(subject); int minimumPriority = Integer.MIN_VALUE; Result result = Result.NO_REGIONS; Set<ProtectedRegion> ignoredRegions = Sets.newHashSet(); for (ProtectedRegion region : getApplicable()) { // Don't consider lower priorit...
1091655_0
public String getMBeanName() { return mBeanName; }
1091655_1
public String getMBeanName() { return mBeanName; }
1091655_2
public String getMBeanName() { return mBeanName; }
1091655_3
public String getMBeanName() { return mBeanName; }
1091655_4
public String getMBeanName() { return mBeanName; }
1091655_5
public String getMBeanName() { return mBeanName; }
1091655_6
public String getMBeanName() { return mBeanName; }
1091655_7
public String getMBeanName() { return mBeanName; }
1091966_0
public Request read(InputStream in) throws IOException { String header = null; String body = null; byte[] headerBytes = new byte[headerLength]; int n = in.read(headerBytes); if (n > 0) { header = new String(headerBytes, encoding); log.debug("header: #{}# ", header); int lengt...
1091966_1
public Object service(String declaringClassCanonicalName, String methodName, Object[] arguments, String rootPath, boolean useRootRelativePath) throws Exception { log.debug("declaringClassCanonicalName: {}, methodName: {}, arguments: {}, rootPath: {}, useRootRelativePath: {}", new Object[]{declar...
1091966_2
private void escape(StringBuilder sb, JsonNode node, String name) { if (node.isArray()) { sb.append("\\["); Iterator<JsonNode> iterator = node.iterator(); int n = 0; while (iterator.hasNext()) { if (n > 0) { sb.append(","); } n++; ...
1091966_3
public String map(String uri) { for (Mapping mapping : mappings) { Matcher matcher = mapping.from.matcher(uri); if (matcher.matches()) { String result = mapping.to; log.debug("uri: {}, mapping to: {}", uri, result); for (int i = 1; i <= matcher.groupCount(); i++) ...
1091966_4
public String map(String uri) { for (Mapping mapping : mappings) { Matcher matcher = mapping.from.matcher(uri); if (matcher.matches()) { String result = mapping.to; log.debug("uri: {}, mapping to: {}", uri, result); for (int i = 1; i <= matcher.groupCount(); i++) ...
1095208_0
@Override public void recycle () { data.clear(); classMap.clear(); }
1095208_1
public void readBootRecord (URL bootUrl) { Document document = getDocument(bootUrl); XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); try { // first grab the Competition XPathExpression exp = xPath.compile("/powertac-bootstrap-data/config/competition"); No...
1095208_2
public void evaluateTariffs () { allocations.clear(); HashSet<Tariff> newTariffs = new LinkedHashSet<>(getTariffRepo() .findRecentActiveTariffs(tariffEvalDepth, customerInfo.getPowerType())); // make sure all superseding tariffs are in the set addSupersedingTarif...
1095208_3
public void evaluateTariffs () { allocations.clear(); HashSet<Tariff> newTariffs = new LinkedHashSet<>(getTariffRepo() .findRecentActiveTariffs(tariffEvalDepth, customerInfo.getPowerType())); // make sure all superseding tariffs are in the set addSupersedingTarif...
1095208_4
public void evaluateTariffs () { allocations.clear(); HashSet<Tariff> newTariffs = new LinkedHashSet<>(getTariffRepo() .findRecentActiveTariffs(tariffEvalDepth, customerInfo.getPowerType())); // make sure all superseding tariffs are in the set addSupersedingTarif...
1095208_5
public RegulationCapacity (TariffSubscription subscription, double upRegulationCapacity, double downRegulationCapacity) { super(); this.subscription = subscription; if (upRegulationCapacity < 0.0) { if (upRegulationCapacity < -epsilon) log.warn("upRe...
1095208_6
public double getUpRegulationCapacity () { return upRegulationCapacity; }
1095208_7
public double getDownRegulationCapacity () { return downRegulationCapacity; }
1095208_8
@Override public void postEconomicControl (EconomicControlEvent event) { int tsIndex = event.getTimeslotIndex(); int current = timeslotRepo.currentTimeslot().getSerialNumber(); if (tsIndex < current) { log.warn("attempt to save old economic control for ts " + tsIndex + " during timeslot " + curre...
1095208_9
@Override public RegulationAccumulator getRegulationCapacity (BalancingOrder order) { Tariff tariff = tariffRepo.findTariffById(order.getTariffId()); if (null == tariff) { // broker error, most likely log.warn("Null tariff " + order.getTariffId() + " for balancing order"); return new RegulationAccumulat...
1097987_0
@Override public float lengthNorm(String fieldName, int numTerms) { if (numTerms < 20) { // this shouldn't be possible, but be safe. if (numTerms <= 0) return 0; return ARR[numTerms]; return -0.00606f * numTerms + 0.35f; } //else return (float) (1.0 / Math.s...
1107344_0
static void printHelp(PrintWriter out) { out.println("Usage:"); out.println(" vark [-f FILE] [options] [targets...]"); out.println(); out.println("Options:"); IArgKeyList keys = Launch.factory().createArgKeyList(); for (IArgKey key : AardvarkOptions.getArgKeys()) { keys.register(key); } keys....