id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
4898786_0 | @Override
public IMessageReceiver<String> getReceiver() throws MessagingException {
throw new UnsupportedOperationException("Cannot receive messages!");
} |
4898786_1 | @Override
public TcpMessageReceiver getReceiver() throws MessagingException {
if (!receiver.isConnected()) {
receiver.bind();
}
return receiver;
} |
4898786_2 | @Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(string.getBytes());
} |
4898786_3 | public static void createZip(Collection<ItemToArchive> items, File outputFile) throws IOException {
final ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
addFilesToZip(items, zaos);
zaos.finish();
zaos.close();
} |
4898786_4 | public static void unzipToDir(File zipFile, File toDir) throws IOException {
try (FileInputStream fis = new FileInputStream(zipFile)) {
unzipToDir(fis, toDir);
}
} |
4898786_5 | @Override
public QueryAnswer query(Query query) {
QueryRedactor queryRedactor;
switch (query.getType()) {
case FETCH:
queryRedactor = queryRedactorFactory.fetch(query.getEntityID());
break;
case DELETE:
queryRedactor = queryRedactorFactory.delete(query.getEntityID());
break;
default:
return Query... |
4898786_6 | @Override
public QueryAnswer query(Query query) {
QueryRedactor queryRedactor;
switch (query.getType()) {
case FETCH:
queryRedactor = queryRedactorFactory.fetch(query.getEntityID());
break;
case DELETE:
queryRedactor = queryRedactorFactory.delete(query.getEntityID());
break;
default:
return Query... |
4898786_7 | float getFailRate() {
if (sampleCount == 0) {
return 0f;
}
return 1 - ((float) successCount) / sampleCount;
} |
4898786_8 | @Override
public Reply handle() {
String map = Actions.checkpointMapNameForRequest(request);
String key = request.getSelector();
// TODO later migh be a good idea to add it back
//if (!ctx.containsInstance(Instance.InstanceType.MAP, map)) {
//return Replies.createErrorReply("No such map %s", map);
//}
if (key ==... |
4898786_9 | @Override
public Reply handle() {
String map = Actions.checkpointMapNameForRequest(request);
String key = request.getSelector();
// TODO later migh be a good idea to add it back
//if (!ctx.containsInstance(Instance.InstanceType.MAP, map)) {
//return Replies.createErrorReply("No such map %s", map);
//}
if (key ==... |
4908338_0 | @Override
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
HippoBean doc = getContentBean(request);
if (doc == null) {
log.warn("Did not find a content bean for relative content path '{}' for pathInfo '{}'",
request.get... |
4908338_1 | @Override
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
HippoBean doc = getContentBean(request);
if (doc == null) {
log.warn("Did not find a content bean for relative content path '{}' for pathInfo '{}'",
request.get... |
4910671_0 | public void prepareIndex() throws IOException {
boolean indexExists = client.admin().indices().prepareExists(INDEX).execute().actionGet().isExists();
if (indexExists) {
// delete the whole index as during development it is likely that the types will change
//node.client().prepareDeleteByQuery(IN... |
4910671_1 | public void index(Talk...talks) {
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_43, new GermanAnalyzer(Version.LUCENE_43));
IndexWriter writer = null;
try {
writer = new IndexWriter(directory, config);
for (Talk talk: talks) {
logger.info(String.format("Indexing... |
4910671_2 | public void indexDirectory(String path) {
Collection<File> paths = Arrays.asList(new File(path).listFiles());
Collection<Talk> talks = Collections2.transform(paths, new TalkFromFile());
logger.info("Indexing {} talks", talks.size());
index(talks.toArray(new Talk[talks.size()]));
} |
4910671_3 | public void indexDir(String path) {
File [] files = new File(path).listFiles();
AutoDetectParser parser = new AutoDetectParser();
logger.debug("Found {} files in dir", files.length);
List<Talk> talks = new ArrayList<Talk>();
for (File file: files) {
Metadata metadata = new Metadata();
... |
4910671_4 | public void indexDir(String path) {
File [] files = new File(path).listFiles();
AutoDetectParser parser = new AutoDetectParser();
logger.debug("Found {} files in dir", files.length);
List<Talk> talks = new ArrayList<Talk>();
for (File file: files) {
Metadata metadata = new Metadata();
... |
4910671_5 | private List<Result> search(Query query, Optional<Sort> sort) {
IndexSearcher searcher = null;
try {
searcher = new IndexSearcher(DirectoryReader.open(directory));
List<Result> result = new ArrayList<>();
TopDocs topDocs = searcher.search(query, 10, sort.or(Sort.RELEVANCE));
for ... |
4910671_6 | private List<Result> search(Query query, Optional<Sort> sort) {
IndexSearcher searcher = null;
try {
searcher = new IndexSearcher(DirectoryReader.open(directory));
List<Result> result = new ArrayList<>();
TopDocs topDocs = searcher.search(query, 10, sort.or(Sort.RELEVANCE));
for ... |
4910671_7 | private List<Result> search(Query query, Optional<Sort> sort) {
IndexSearcher searcher = null;
try {
searcher = new IndexSearcher(DirectoryReader.open(directory));
List<Result> result = new ArrayList<>();
TopDocs topDocs = searcher.search(query, 10, sort.or(Sort.RELEVANCE));
for ... |
4910671_8 | @Override
public Talk apply(File input) {
Properties props = read(input);
String speakerValue = props.getProperty("speaker");
String title = props.getProperty("title");
String dateValue = props.getProperty("date");
String contents = props.getProperty("content");
String categoriesValue = props.ge... |
4910671_9 | public SearchResponse search(String token) {
return search(token, Collections.<String>emptyList());
} |
4925395_0 | @Override
public void removeOldVersions() {
receptacle.removeOldVersions();
} |
4925395_1 | @Override
public File getFolderForVersionToRun() {
return receptacle.getFolderForVersionToRun();
} |
4925395_2 | @Override
public Version getInstalledVersion() {
return installedDiscovery.getLatestVersion();
} |
4925395_3 | public Properties load() {
try {
Properties properties = new Properties();
fillPropertiesFromClassPath(properties);
fillPropertiesFromFileSystem(properties);
if (properties.isEmpty()) {
throw new ConfigurationFailedException("Could not find configuration file " + properti... |
4925395_4 | public Properties load() {
try {
Properties properties = new Properties();
fillPropertiesFromClassPath(properties);
fillPropertiesFromFileSystem(properties);
if (properties.isEmpty()) {
throw new ConfigurationFailedException("Could not find configuration file " + properti... |
4925395_5 | public Properties load() {
try {
Properties properties = new Properties();
fillPropertiesFromClassPath(properties);
fillPropertiesFromFileSystem(properties);
if (properties.isEmpty()) {
throw new ConfigurationFailedException("Could not find configuration file " + properti... |
4925395_6 | public Properties load() {
try {
Properties properties = new Properties();
fillPropertiesFromClassPath(properties);
fillPropertiesFromFileSystem(properties);
if (properties.isEmpty()) {
throw new ConfigurationFailedException("Could not find configuration file " + properti... |
4925395_7 | public Properties load() {
try {
Properties properties = new Properties();
fillPropertiesFromClassPath(properties);
fillPropertiesFromFileSystem(properties);
if (properties.isEmpty()) {
throw new ConfigurationFailedException("Could not find configuration file " + properti... |
4925395_8 | public void saveConfiguration() throws IOException {
saver.save(properties);
} |
4925395_9 | public void saveConfiguration() throws IOException {
saver.save(properties);
} |
4937246_0 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_1 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_2 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_3 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_4 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_5 | public int maxDistance(String input) {
int rv = calculateDistance(input,
0,
0);
return Math.abs(rv);
} |
4937246_6 | protected double evaluateDistance(String[] commands) {
Location location = new Location(ORIGIN);
for (String command: commands) {
location.applyCommand(command);
}
return location.distance(ORIGIN);
} |
4937246_7 | public double maxDistance(String[] commands) {
return 0;
} |
4937246_8 | public static String getAnswer(String input) {
String returnValue = "Impossible";
int cIndex = -1;
int aIndex = -1;
int tIndex = -1;
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch(c) {
case 'C':
if (cIndex != -1 || aIndex != -1 || tInd... |
4937246_9 | public static String getAnswer(String input) {
String returnValue = "Impossible";
int cIndex = -1;
int aIndex = -1;
int tIndex = -1;
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch(c) {
case 'C':
if (cIndex != -1 || aIndex != -1 || tInd... |
4941867_0 | public static List<ConfigurationKeyPart> parse(String raw) {
return parse(raw, null);
} |
4941867_1 | public Set<Class<?>> getAnnotatedClasses() {
return annotatedClasses;
} |
4941867_2 | public Set<Field> getAnnotatedFields() {
return annotatedFields;
} |
4941867_3 | public Set<Method> getAnnotatedMethods() {
return annotatedMethods;
} |
4941867_4 | public Set<Constructor> getAnnotatedConstructors() {
return annotatedConstructors;
} |
4941867_5 | public Set<Class<?>> getAnnotatedClasses() {
return annotatedClasses;
} |
4941867_6 | @Override
public final T get() {
if (obj == null) {
synchronized (lock) {
if (obj == null) {
obj = create();
}
}
}
return obj;
} |
4941867_7 | protected final Injector getInjector() {
if (injector != null) {
throw new IllegalStateException("Injector already created.");
}
try {
injector = createInjector();
}
catch (Exception e) {
LOG.error("Failed to created injector", e);
throw new ProvisionException("Failed... |
4941867_8 | @Override
public T get() {
return adviceBindings
.stream()
.map(advice -> advice.binding.getProvider().get())
.reduce(delegate.get(),
(advised, advice) -> advice.apply(advised),
(current, next) -> next);
} |
4941867_9 | @Override
public T get() {
return adviceBindings
.stream()
.map(advice -> advice.binding.getProvider().get())
.reduce(delegate.get(),
(advised, advice) -> advice.apply(advised),
(current, next) -> next);
} |
4946769_0 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_1 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_2 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_3 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_4 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_5 | public static String removeExpansions(String input) {
if (input == null) {
return null;
}
String output = input;
while (containsPropertyExpansion(output)) {
output = removeExpansionAt(output, output.indexOf(EXPANSION_START));
}
return output;
} |
4946769_6 | public static String extractXPathPropertyValue(Object property, String pathExpression) {
try {
String value = property instanceof TestProperty ? ((TestProperty) property).getValue() : property
.toString();
if (pathExpression.startsWith("$")) {
return new JsonPathFacade(va... |
4946769_7 | @Override
public String getValue(PropertyExpansionContext context) {
if( context instanceof TestRunContext)
{
TestRunner runner = ((TestRunContext) context).getTestRunner();
if( runner instanceof AbstractTestCaseRunner)
return String.valueOf(((AbstractTestCaseRunner)runner).getResult... |
4946769_8 | @Override
public String getValue(PropertyExpansionContext context) {
if( context instanceof WsdlTestRunContext)
{
TestRunner runner = ((WsdlTestRunContext) context).getTestRunner();
if( runner instanceof AbstractTestCaseRunner) {
List<TestStepResult> resultList = ((AbstractTestCaseRu... |
4946769_9 | @Override
public String getValue(PropertyExpansionContext context) {
if( context instanceof TestCaseRunContext )
{
return String.valueOf( ((TestCaseRunContext)context).getCurrentStepIndex());
}
return null;
} |
4955633_0 | public Builder toBuilder() {
return new Builder(this);
} |
4955633_1 | public static Builder builder(String name) {
return new Builder(name);
} |
4955633_2 | public Builder toBuilder() {
return new Builder(this);
} |
4955633_3 | public static Builder builder(String previousId) {
return new Builder(previousId);
} |
4955633_4 | public Builder toBuilder() {
return new Builder(this);
} |
4955633_5 | public static Builder builder() {
return new Builder();
} |
4955633_6 | public Builder toBuilder() {
return new Builder(this);
} |
4955633_7 | public V messageId(UUID messageId) {
if (messageId == null) {
throw new NullPointerException("Null messageId");
}
this.messageId = messageId.toString();
return self();
} |
4955633_8 | public Message.Type type() {
return type;
} |
4955633_9 | public V messageId(UUID messageId) {
if (messageId == null) {
throw new NullPointerException("Null messageId");
}
this.messageId = messageId.toString();
return self();
} |
4955657_0 | @Override
public Set<I> getAllImplementors() {
return loadImplementors(null, Boolean.TRUE);
} |
4955657_1 | @Override
public Set<I> getAllImplementors() {
return loadImplementors(null, Boolean.TRUE);
} |
4955657_2 | @Override
public Set<I> getAllImplementors() {
return loadImplementors(null, Boolean.TRUE);
} |
4955657_3 | @Override
public Set<PrimitiveImplementor<?>> getAllImplementors() {
return Collections.unmodifiableSet(finder.getAllImplementors());
} |
4959580_0 | @Override
public long getPageCreatedOnRender() {
return -1;
} |
4959580_1 | @Override
public <T> Iterator<Item<T>> getItems(IItemFactory<T> factory, Iterator<IModel<T>> newModels, Iterator<Item<T>> existingItems) {
return ReuseIfModelsEqualStrategy.getInstance().getItems(factory,newModels,existingItems);
} |
4959580_2 | @Override
public <T> Iterator<Item<T>> getItems(IItemFactory<T> factory, Iterator<IModel<T>> newModels, Iterator<Item<T>> existingItems) {
return DefaultItemReuseStrategy.getInstance().getItems(factory,newModels,existingItems);
} |
4992906_0 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_1 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_2 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_3 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_4 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_5 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_6 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_7 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_8 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
4992906_9 | @Override
public Node parse(String fileName, Reader source) throws ParseException {
return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
} |
5002457_0 | public static double evaluate(RSParametersDynamic parameters) {
double Compound;
int FreqParam = parameters.getFreqParam();
double Temperature = parameters.getTemperature();
int RoadSurface = parameters.getRoadSurface();
boolean Stud = parameters.getStud();
double Junc_dist = parameters.getJunc_... |
5002457_1 | public static double evaluate(RSParametersDynamic parameters) {
double Compound;
int FreqParam = parameters.getFreqParam();
double Temperature = parameters.getTemperature();
int RoadSurface = parameters.getRoadSurface();
boolean Stud = parameters.getStud();
double Junc_dist = parameters.getJunc_... |
5002457_2 | public static double evaluate(RSParametersDynamic parameters) {
double Compound;
int FreqParam = parameters.getFreqParam();
double Temperature = parameters.getTemperature();
int RoadSurface = parameters.getRoadSurface();
boolean Stud = parameters.getStud();
double Junc_dist = parameters.getJunc_... |
5002457_3 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5002457_4 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5002457_5 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5002457_6 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5002457_7 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5002457_8 | public static Double getCoeff(String coeff, int freq, String vehicleCategory, int coeffVer) {
int Freq_ind;
switch (freq) {
case 63:
Freq_ind=0;
break;
case 125:
Freq_ind=1;
break;
case 250:
Freq_ind=2;
break;
... |
5002457_9 | public static double evaluate(RSParametersCnossos parameters) {
final int freqParam = parameters.getFreqParam();
final double Temperature = parameters.getTemperature();
final double Ts_stud = parameters.getTs_stud();
final double Pm_stud = parameters.getPm_stud();
final double Junc_dist = parameters... |
5003951_0 | public void write(Writer writer, Map<String, Object> stringObjectMap, Model model) throws IOException {
try {
final Var REQUIRE = Var.intern(RT.CLOJURE_NS, Symbol.create("require"));
final Symbol REFLECTOR = Symbol.create("org.sonatype.maven.polyglot.clojure.dsl.writer");
REQUIRE.invoke(REFL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.