id
stringlengths
7
14
text
stringlengths
1
106k
2689039_1
public T getMax() { return mMax; }
2689039_2
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("min", getMin()) .add("max", getMax()) .toString(); }
2689039_3
public long getAge() { return (new Date()).getTime() - mBirthdate.getTime(); }
2689039_4
public long getAge() { return (new Date()).getTime() - mBirthdate.getTime(); }
2689039_5
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("value", mValue) .add("birthdate", mBirthdate) .toString(); }
2689039_6
public String getName() { return mName; }
2689039_7
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("timestamp", getTimestamp()) .add("name", getName()) .add("extras", getExtras()) .toString(); }
2689039_8
@Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeString(getName()); }
2689039_9
@Override public MessageKey getKey() { if(super.getKey() == null) { HashMap<String, Object> key = new HashMap<>(); key.put(NAME_KEY, getName()); setKey(new MessageKey(key)); } return super.getKey(); }
2694049_0
SshServer getServer() { return server; }
2694049_1
SshServer getServer() { return server; }
2694049_2
public Command create() { return new EchoCommand(); }
2698192_0
@Override public String getMessage(final String code) { checkNotNull(code); for (ResourceBundle bundle : bundles) { try { return bundle.getString(code); } catch (MissingResourceException e) { log.trace(e.toString(), e); } } throw new ResourceNotFoundException(code); }
2698192_1
@Override public String getMessage(final String code) { checkNotNull(code); for (ResourceBundle bundle : bundles) { try { return bundle.getString(code); } catch (MissingResourceException e) { log.trace(e.toString(), e); } } throw new ResourceNotFoundException(code); }
2698192_2
public static String explain(final Throwable throwable) { checkNotNull(throwable); StringBuilder buff = new StringBuilder(); explain(buff, throwable); Throwable cause = throwable; while ((cause = cause.getCause()) != null) { buff.append(", caused by: "); explain(buff, cause); } return buff.toStrin...
2698192_3
public static String explain(final Throwable throwable) { checkNotNull(throwable); StringBuilder buff = new StringBuilder(); explain(buff, throwable); Throwable cause = throwable; while ((cause = cause.getCause()) != null) { buff.append(", caused by: "); explain(buff, cause); } return buff.toStrin...
2698192_4
public static String explain(final Throwable throwable) { checkNotNull(throwable); StringBuilder buff = new StringBuilder(); explain(buff, throwable); Throwable cause = throwable; while ((cause = cause.getCause()) != null) { buff.append(", caused by: "); explain(buff, cause); } return buff.toStrin...
2698192_5
public static String explain(final Throwable throwable) { checkNotNull(throwable); StringBuilder buff = new StringBuilder(); explain(buff, throwable); Throwable cause = throwable; while ((cause = cause.getCause()) != null) { buff.append(", caused by: "); explain(buff, cause); } return buff.toStrin...
2698192_6
public static <T extends Throwable> T composite(final T root, final Throwable... suppressed) throws T { checkNotNull(suppressed); for (Throwable t : suppressed) { root.addSuppressed(t); } throw root; }
2698192_7
public Time asSeconds() { return seconds(toSeconds()); }
2698192_8
public int toMillisI() { return (int) toMillis(); }
2698192_9
public static ByteSize bytes(final long value) { return new ByteSize(value, BYTES); }
2708082_0
public int newVariable() { int v = incrementVariableCounter(); watches_.resize(2 * v + 2); implies_.resize(2 * v.value() + 2); assignment_.put(v, Boolean.kUndefined); return v; }
2708082_1
public boolean addClause(TIntList ps) { assert 0 == trailMarker(); if (!ok_) return false; // Check if clause is satisfied and remove false/duplicated literals: ps.sort(); int lit = kUndefinedLiteral; int j = 0; for (int i = 0; i < ps.size(); i++) { if (valueLit(ps.get(i)) == Boolean...
2708082_2
public boolean learnClause(int... ps) { Arrays.sort(ps); switch (ps.length) { case 0: return (ok_ = false); case 1: dynUncheckedEnqueue(ps[0]); return (ok_ = propagate()); default: Clause cr = new Clause(ps); learnts.add(cr); ...
2708082_3
boolean addEmptyClause() { temporary_add_vector_.resetQuick(); return addClause(temporary_add_vector_); }
2708082_4
boolean initPropagator() { touched_variables_.resetQuick(); return !ok_; }
2708082_5
public void cancelUntil(int level) { if (trailMarker() > level) { for (int c = trail_.size() - 1; c >= trail_markers_.get(level); c--) { int x = var(trail_.get(c)); assignment_.put(x, Boolean.kUndefined); } qhead_ = trail_markers_.get(level); trail_.remove(tra...
2708082_6
Boolean valueVar(int x) { return assignment_.get(x); }
2708082_7
Boolean valueLit(int l) { Boolean b = assignment_.get(var(l)); return b == Boolean.kUndefined ? Boolean.kUndefined : xor(b, sign(l)); }
2708082_8
int nClauses() { return clauses.size(); }
2708082_9
public int nLearnt() { return learnts.size(); }
2708789_0
@Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { // why not using println? because it makes testing harder, *nix and // windows think different about new line as in \n vs \r\n System.out.print("Hello World!"); ...
2710254_0
@Override public void startService() throws LeaseManagementException { createLeaseManagementZNode(); createCurrentTSOZNode(); startAndWait(); }
2710254_1
public long set(long key, long value) { final int index = index(key); int oldestIndex = 0; long oldestValue = Long.MAX_VALUE; for (int i = 0; i < associativity; ++i) { int currIndex = 2 * (index + i); if (cache[currIndex] == key) { oldestValue = 0; oldestIndex = c...
2710254_2
public void loadSettings(String resourcePath, String defaultResourcePath, Object bean) { try { Map properties = loadSettings(resourcePath, defaultResourcePath); BeanUtils.populate(bean, properties); } catch (IllegalAccessException | InvocationTargetException | IOException e) { throw new ...
2710254_3
public void loadSettings(String resourcePath, String defaultResourcePath, Object bean) { try { Map properties = loadSettings(resourcePath, defaultResourcePath); BeanUtils.populate(bean, properties); } catch (IllegalAccessException | InvocationTargetException | IOException e) { throw new ...
2710254_4
public void executeActionsOnHBase(Configuration hbaseConf) throws IOException { HBaseLogin.loginIfNeeded(mainConfig.loginFlags); try (HBaseAdmin hBaseAdmin = new HBaseAdmin(hbaseConf)) { byte[][] tableFamilies; byte[][] splitKeys = new byte[0][0]; String tableName; LOG.info("----...
2710254_5
public void executeActionsOnHBase(Configuration hbaseConf) throws IOException { HBaseLogin.loginIfNeeded(mainConfig.loginFlags); try (HBaseAdmin hBaseAdmin = new HBaseAdmin(hbaseConf)) { byte[][] tableFamilies; byte[][] splitKeys = new byte[0][0]; String tableName; LOG.info("----...
2710254_6
public void executeActionsOnHBase(Configuration hbaseConf) throws IOException { HBaseLogin.loginIfNeeded(mainConfig.loginFlags); try (HBaseAdmin hBaseAdmin = new HBaseAdmin(hbaseConf)) { byte[][] tableFamilies; byte[][] splitKeys = new byte[0][0]; String tableName; LOG.info("----...
2710254_7
public void executeActionsOnHBase(Configuration hbaseConf) throws IOException { HBaseLogin.loginIfNeeded(mainConfig.loginFlags); try (HBaseAdmin hBaseAdmin = new HBaseAdmin(hbaseConf)) { byte[][] tableFamilies; byte[][] splitKeys = new byte[0][0]; String tableName; LOG.info("----...
2710254_8
@Inject public HBaseTimestampStorage(Configuration hbaseConfig, HBaseTimestampStorageConfig config) throws IOException { this.table = new HTable(hbaseConfig, config.getTableName()); this.cfName = config.getFamilyName().getBytes(UTF_8); }
2719141_0
public Property getProperty( String name ) { for ( Iterator propertyIterator = this.getProperties().iterator(); propertyIterator.hasNext(); ) { Property property = (Property) propertyIterator.next(); if ( property.getName().equals( name ) ) { return property; } } ...
2719141_1
public Security getSecurity() { return this.security; }
2719141_2
public Security getSecurity() { return this.security; }
2719141_3
public Agent getAgent( String id ) { for ( Iterator agentIterator = this.getAgents().iterator(); agentIterator.hasNext(); ) { Agent agent = (Agent) agentIterator.next(); if ( agent.getId().equals( id ) ) { return agent; } } return null; }
2719141_4
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2719141_5
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2719141_6
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2719141_7
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2719141_8
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2719141_9
public Environment getEnvironment( String name ) { for ( Iterator environmentIterator = this.getEnvironments().iterator(); environmentIterator.hasNext(); ) { Environment environment = (Environment) environmentIterator.next(); if ( environment.getName().equals( name ) ) { retu...
2737689_0
public static void configureProtocolHandler() { final String pkgs = System.getProperty("java.protocol.handler.pkgs"); String newValue = "org.mapfish.print.url"; if (pkgs != null && !pkgs.contains(newValue)) { newValue = newValue + "|" + pkgs; } else if (pkgs != null) { newValue = pkgs; ...
2737689_1
public static void configureProtocolHandler() { final String pkgs = System.getProperty("java.protocol.handler.pkgs"); String newValue = "org.mapfish.print.url"; if (pkgs != null && !pkgs.contains(newValue)) { newValue = newValue + "|" + pkgs; } else if (pkgs != null) { newValue = pkgs; ...
2737689_2
@Override public String getContentType() { return getFullContentType().replace(";base64", ""); }
2737689_3
@Override public void validate(final List<Throwable> validationErrors, final Configuration configuration) { if (this.host == null) { validationErrors.add(new IllegalStateException("The parameter 'host' is required.")); } }
2737689_4
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2737689_5
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2737689_6
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2737689_7
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2737689_8
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2737689_9
@Override public ClientHttpRequest createRequest( final URI uri, final HttpMethod httpMethod) { return new ConfigFileResolvingRequest(uri, httpMethod); }
2740148_0
public String[] getContext(CharSequence sb, int position) { /* * String preceding the eos character in the eos token. */ String prefix; /* * Space delimited token preceding token containing eos character. */ String previous; /* * String following the eos character in the eos token. */ Stri...
2740148_1
public String[] getContext(CharSequence sb, int position) { /* * String preceding the eos character in the eos token. */ String prefix; /* * Space delimited token preceding token containing eos character. */ String previous; /* * String following the eos character in the eos token. */ Stri...
2740148_2
public FMeasure getFMeasure() { return fmeasure; }
2740148_3
public FMeasure getFMeasure() { return fmeasure; }
2740148_4
public List<Integer> getPositions(String s) { return getPositions(s.toCharArray()); }
2740148_5
public static SentenceModel train(String languageCode, ObjectStream<SentenceSample> samples, boolean useTokenEnd, Dictionary abbreviations, TrainingParameters mlParams) throws IOException { SentenceDetectorFactory sdFactory = new SentenceDetectorFactory( languageCode, useTokenEnd, abbreviations, null); ...
2740148_6
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; }
2740148_7
@Override public String toString() { StringBuilder chunkString = new StringBuilder(); for (int ci = 0; ci < preds.size(); ci++) { chunkString.append(sentence.get(ci)).append(" ").append(tags.get(ci)) .append(" ").append(preds.get(ci)).append("\n"); } return chunkString.toString(); }
2740148_8
public String nicePrint() { Span[] spans = getPhrasesAsSpanList(); StringBuilder result = new StringBuilder(" "); for (int tokenIndex = 0; tokenIndex < sentence.size(); tokenIndex++) { for (Span span : spans) { if (span.getStart() == tokenIndex) { result.append("[").append(span.getType()).append...
2740148_9
public Span[] getPhrasesAsSpanList() { return phrasesAsSpanList(getSentence(), getTags(), getPreds()); }
2740607_0
public String getDeploymentPath() { return deployDetails.getArtifactPath(); }
2740607_1
public File getFile() { return deployDetails.getFile(); }
2740607_2
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_3
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_4
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_5
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_6
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_7
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); String runType = runner.getRunType(); Map<String, String> runnerParameters = runner.getRunnerParameters(); if (RunTypeUtils.isAntWithExtractorActivated(runType, runnerParameters)) { Str...
2740607_8
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); Map<String, String> runnerParameters = runner.getRunnerParameters(); String runType = runner.getRunType(); if (RunTypeUtils.isGradleWithExtractorActivated(runType, runnerParameters)) { ...
2740607_9
@Override public void beforeRunnerStart(@NotNull BuildRunnerContext runner) { super.beforeRunnerStart(runner); Map<String, String> runnerParameters = runner.getRunnerParameters(); String runType = runner.getRunType(); if (RunTypeUtils.isGradleWithExtractorActivated(runType, runnerParameters)) { ...
2742247_0
protected String stripJvmRoute(String sessionId){ String jvmRoute = this.getJvmRoute(); if (sessionId == null){ return null; } String newSessionId = sessionId; if ( jvmRoute != null && jvmRoute.length() > 0 && sessionId.endsWith(jvmRoute) ){ // -1 is the dot delimiter and jvmRoute le...
2742247_1
protected String stripDotSuffix(String sessionId){ if (sessionId == null){ return null; } int index = sessionId.indexOf("."); if (index > 0) { sessionId = sessionId.substring(0, index); } return sessionId; }
2742247_2
@Override public Session createEmptySession(){ return this.getNewSession(); }
2742247_3
public String getCacheName(){ return this.cache.getName(); }
2747986_2
public int findInboxReadyMaxSequenceNoByCpa(MessageDVO data) throws DAOException { List l = super.find( "find_inbox_ready_max_sequence_no_by_cpa", new Object[] { data.getCpaId(), data.getService(), data.getAction(), data.getConvId() }); Iterator i = l.iterator(); if (i.hasNex...
2747986_3
public List findMessageByCpa(MessageDVO data, int numberOfMessage) throws DAOException { List parameters = new ArrayList(); String sql = super.getFinder("find_message_by_cpa"); parameters.add(data.getCpaId()); parameters.add(data.getService()); parameters.add(data.getAction()); if (data.getConvId() != n...
2747986_4
public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equa...
2747986_5
public int findNumberOfMessagesByHistory(MessageDVO data) throws DAOException { try { List parameters = new ArrayList(); String sql = super.getFinder("find_number_of_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += ...
2747986_7
public MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) throws ConnectionException { return createMessage(from, to, cc, subject, soapMessage, createSession()); }
2747986_8
public MimeMessage createMessage(String from, String to, String cc, String subject, SOAPMessage soapMessage) throws ConnectionException { return createMessage(from, to, cc, subject, soapMessage, createSession()); }
2747986_9
private Collection getPayloads(String regex){ // Get all directories without "~" symbol. Collection dirs = this.getRepositorySystem().getFiles(false, regex); // Use array list is the fastest. Collection payloads = new ArrayList(); Iterator itr = dirs.iterator(); while(itr.hasNext()){ try{ PackagedPayl...
2752522_0
public static Object getValue(Object object, String jsonPath) { // let's make sure we have a feature Feature feature = extractFeature(object, jsonPath); if (feature instanceof MongoFeature) { // no a nested element mongo feature MongoFeature mongoFeature = (MongoFeature) feature; ret...
2752522_1
public static BasicDBObject convert(SimpleFeatureType ft) { BasicDBObject ftDBO = new BasicDBObject(KEY_typeName, ft.getTypeName()); Map<String, String> ftUserData = typeCheck(ft.getUserData()); if (!ftUserData.isEmpty()) { ftDBO.put(KEY_userData, new BasicDBObject(ftUserData)); } // for geo...
2752522_2
public static String extractFilesNameFromUrl(String url) throws MalformedURLException { final URL urlObject = new URL(url); String path = urlObject.getPath(); int lastSeparatorIndex = path.lastIndexOf("/"); return path.substring(lastSeparatorIndex > -1 ? lastSeparatorIndex + 1 : 0, path.length()); }
2752522_3
@Override public void close() { client.close(); }
2752522_4
@Override public void close() { client.close(); }
2752522_5
@Override public void close() { client.close(); }
2752522_6
@Override public void close() { client.close(); }