id stringlengths 7 14 | text stringlengths 1 37.2k |
|---|---|
4001968_2 | public java.util.Map<String, AnnotationProperty> getProperties() {
return properties;
} |
4016036_0 | public List<DeltaSQLStatementSnapshot> getDeltaSqlStatementSnapshots() {
return deltaSQLStatementSnapshots;
} |
4021268_10 | public String getName()
{
return name;
} |
4023244_0 | public static boolean implementsInterface(final Class type, final Class interfaceClass)
{
return interfaceClass.isAssignableFrom(type);
} |
4024302_13 | public void onStart() {
if (target instanceof HazelcastInstanceAware) {
((HazelcastInstanceAware) target).setHazelcastInstance(hazelcastInstance);
}
if (target instanceof SliceLifecycleListener) {
((SliceLifecycleListener) target).onStart();
}
} |
4026983_1 | public String toJson() {
return new Gson().toJson(this);
} |
4031229_11 | public static File getFileOutputDir(final URI baseUri, final File outputDir, final TestRunCoverageStatistics runStats) {
final URI relativeTestUri = baseUri.relativize(runStats.test);
return new File(outputDir, relativeTestUri.toString()).getParentFile().getAbsoluteFile();
} |
4057303_5 | public T getAssociatedInstance(final String typeId) throws DempsyException {
if(LOGGER.isTraceEnabled())
LOGGER.trace("Trying to find " + clazz.getSimpleName() + " associated with the transport \"{}\"", typeId);
T ret = null;
synchronized(registered) {
ret = registered.get(typeId);
... |
4060867_7 | public void getVideos(HttpServletRequest request, HttpServletResponse response) throws Exception {
XMLBuilder builder = createXMLBuilder(request, response, true);
builder.add("videos", true);
builder.endAll();
response.getWriter().print(builder);
} |
4090170_0 | public void generate(Schema schema, Writer output) throws IOException {
final VelocityContext context = new VelocityContext();
context.put("schema", schema);
context.put("this", this);
engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output);
} |
4101951_1 | public List<DtoProperty> getProperties() {
if (properties == null) {
properties = list();
final List<PropConfig> pcs = getPropertiesConfig();
if (getDomainType() != null) {
addPropertiesFromDomainObject(pcs);
addChainedPropertiesFromDomainObject(pcs);
}
addLeftOverExtensionProperties(p... |
4103388_44 | @Override
public OsisWrapper getOsisText(final String version, final String reference) {
return getOsisText(version, reference, new ArrayList<LookupOption>(0), null, NONE);
} |
4106766_6 | @Override
public User get(String username) throws Exception {
return Optional.ofNullable(dynamoDBMapper.load(User.class, username))
.orElseThrow(() -> new Exception(String.format("User for username %s was not found", username)));
} |
4112450_11 | public boolean parse(String input) {
String[] split = input.split(" ");
if(split.length != 4) {
if(LOGGER.isInfoEnabled())
LOGGER.info("Could not parse '"+input+"': 4 tokens expected");
return false;
}
String u = split[0];
try {
units = Units.valueOf(u.toLow... |
4114494_1 | public int getClassId() {
return classId;
} |
4117239_0 | public Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) {
super(input, output, frozen);
} |
4120901_37 | public boolean filter(File file) {
return file.getParentFile().getAbsolutePath().contains(springHadoopWorkflowDirectoryName);
} |
4129770_0 | public void forUnitTest() {
} |
4131741_2 | @Override
public final boolean preHandle(
final HttpServletRequest request,
final HttpServletResponse response,
final Object handler) throws Exception {
this.assignCacheControlHeader(request, response, handler);
return super.preHandle(request, response, handler);
} |
4138309_2 | public static Event<?> fromJson(String json) throws IOException {
return JSONUtil.toObject(json, new TypeReference<Event<?>>() {});
} |
4139627_0 | @Override
public StartLetterCountMP clone() throws CloneNotSupportedException
{
return (StartLetterCountMP)super.clone();
} |
4159017_99 | ; |
4167742_80 | @Override
public AlertType checkValue(BigDecimal value, BigDecimal warn, BigDecimal error) {
boolean isHighValueWorse = isTheValueBeingHighWorse(warn, error);
if (isBeyondThreshold(value, error, isHighValueWorse)) {
return AlertType.ERROR;
} else if (isBeyondThreshold(value, warn, isHighVa... |
4169493_3 | public void escapeColNames() throws Exception
{
ArrayList<String> newColNames = new ArrayList<String>();
for (String s : this.colNames)
{
newColNames.add(NameConvention.escapeEntityNameStrict(s));
this.colNames = newColNames;
}
} |
4180644_100 | @Override
public List<DrugGroup> getDrugGroupByName(String name) throws DAOException {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class);
criteria.add(Restrictions.like("name", name));
criteria.add(Restrictions.like("retired", false));
List<DrugGroup> patients = new ArrayList<Dr... |
4182801_87 | @Override
public int format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) throws IOException {
ensureNoWidth(width);
ensureNoPrecision(precision);
ensureNoFlags(flags);
return new Conditional(formatter, value, formatString... |
4189503_130 | @Override
public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Object> params, PatientCalculationContext context) {
Program program = (params != null && params.containsKey("program")) ? (Program) params.get("program") : null;
return passing(Calculations.activeEnrollment(program, Filters.alive... |
4193864_175 | void handleSubscriptions() {
Set<FeedProvider> requiredSubscriptions = buildRequiredSubscriptions();
List<FeedProvider> newSubscriptions = new ArrayList<FeedProvider>();
List<FeedProvider> removedSubscriptions = new ArrayList<FeedProvider>();
Set<FeedProvider> set = new TreeSet<FeedProvider>(FEED_COMPAR... |
4195698_13 | protected static void copyDirectory(final File srcDir, final File destDir)
throws IOException {
if (srcDir == null) {
throw new NullPointerException("Source must not be null");
}
if (destDir == null) {
throw new NullPointerException("Destination must not be null");
}
if (srcDir.exists() == false) {
throw n... |
4214268_3 | public static long bin2long(byte[] array, int offset) {
return ((array[offset + 0] & 0xffL) << 56) + ((array[offset + 1] & 0xffL) << 48)
+ ((array[offset + 2] & 0xffL) << 40) + ((array[offset + 3] & 0xffL) << 32)
+ ((array[offset + 4] & 0xffL) << 24) + ((array[offset + 5] & 0xffL) << 16)
+ ((array[o... |
4233818_4 | public DependencyA getDependencyA() {
return dependencyA;
} |
4237245_15 | public synchronized E elementAt(int index) {
if (index >= elementCount) {
throw new ArrayIndexOutOfBoundsException(index + " >= "
+ elementCount);
}
return (E) elementData[index];
} |
4238016_112 | @Override
public String getHtml(IMacroContext macroContext) {
return "<span class=\"text-error\">{{" + macroContext.getMacroName() + "/}}</span>"; //$NON-NLS-1$ //$NON-NLS-2$
} |
4242485_127 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BrowserOperatingSystemMapping other = (BrowserOperatingSystemMapping) obj;
if (browserId != other.browserId) {
return false;
... |
4256066_0 | @Override
public Void convert(final HttpClientResponse response, final InputStream inputStream)
throws IOException
{
switch(response.getStatusCode())
{
case 201:
case 204:
LOG.debug("Return code is %d, finishing.", response.getStatusCode());
return null;
case 200:
try (f... |
4265123_11 | public FieldDeclaration generateAttribute(Classifier clazz, AST ast,
Property property) {
Type type = property.getType();
logger.log(Level.FINE, "Class: " + clazz.getName() + " - "
+ "Property: " + property.getName() + " - "
+ "Property Upper: " + property.getUpper() + " - "
+ "Property Lower: " + property... |
4265955_13 | @Override
public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException {
return new CSVFeatureSource(this).getReader();
} |
4276349_2 | @Provides
@Singleton
AnnouncementConfig getAnnouncementConfig(final Config config)
{
final AnnouncementConfig baseConfig = config.getBean(AnnouncementConfig.class);
return new AnnouncementConfig(baseConfig) {
@Override
public String getServiceName() {
return ObjectUtils.toString(sup... |
4276357_6 | @Override
public ThriftStructMetadata build()
{
// this code assumes that metadata is clean
metadataErrors.throwIfHasErrors();
// builder constructor injection
ThriftMethodInjection builderMethodInjection = buildBuilderConstructorInjections();
// constructor injection (or factory method for builde... |
4288215_27 | @Override
public boolean logout() throws LoginException {
LOG.debug("logout");
subject.getPrincipals().clear();
return true;
} |
4291387_17 | void addOrChangeProperty(final String name, final Object newValue, final Configuration config) {
// We do not want to abort the operation due to failed validation on one property
try {
if (!config.containsKey(name)) {
logger.debug("adding property key [{}], value [{}]", name, newValue);
... |
4298283_0 | public static void initializeRGBChannels(Jp2_channels channels) throws KduException {
final int numColours = 3;
channels.Init(numColours);
// channels.Set_colour_mapping(0, 0, 0);
// channels.Set_colour_mapping(1, 0, 1);
// channels.Set_colour_mapping(2, 0, 2);
Method setColourMapping;
Objec... |
4298401_4 | public static void clearCachedResources() {
clientStaticResources.invalidateAll();
} |
4298676_0 | @Override
@Transactional(readOnly = true)
public List<Customer> findAll() {
SQLQuery allCustomersQuery = qdslTemplate.newSqlQuery().from(qCustomer)
.leftJoin(qCustomer._addressCustomerRef, qAddress);
return qdslTemplate.query(allCustomersQuery, new CustomerListExtractor(), customerAddressProjection);
} |
4298816_47 | public static void listFilesRecursive(File path, List<File> filesArray) {
if (path.exists()) {
File[] files = path.listFiles();
if (files == null) {
Log.fatal("Could not list file " + path.toString() + " you may not have read permissions, skipping it");
Log.stderr("Could not ... |
4300205_7 | public List<SessionTicketKey> parse(File file) throws IOException {
return parseBytes(Files.toByteArray(file));
} |
4315362_26 | @SuppressWarnings("unchecked")
public <U> Try<U> flatMap(CheckedFunction<? super T, ? extends Try<? extends U>> mapper) {
Objects.requireNonNull(mapper, "mapper is null");
if (isSuccess()) {
try {
return (Try<U>) mapper.apply(get());
} catch (Throwable t) {
return failure... |
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... |
4335519_191 | public ExpressionStack execute(ExpressionTree expression, ProgramStateConstraints constraints) {
Deque<SymbolicValue> newStack = copy();
Kind kind = ((JavaScriptTree) expression).getKind();
switch (kind) {
case LOGICAL_COMPLEMENT:
SymbolicValue negatedValue = newStack.pop();
newStack.push(LogicalN... |
4336113_33 | @Override
public AttributeType getType() {
return NATSTUNAttributeType.NAT_BEHAVIOR;
} |
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;
checkSecretsRegisteredByTok... |
4340532_4 | public List<Accept> getAccepts() {
return accepts;
} |
4341250_102 | @Override
public int getNumActiveInstances(ServiceEndPoint endPoint) {
checkNotNull(endPoint);
return _pool.getNumActive(endPoint);
} |
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.g... |
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++) {
... |
4368712_128 | @POST
@Template(name = "/index.ftl")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Viewable create(@Valid @BeanParam FeedRequestBean request) {
String[] urlArray = createUrls(request.getUrls()).stream().toArray(String[]::new);
CombinedFeed feed = new CombinedFeed.CombinedFeedBuilder(null, urlArray)
... |
4368907_40 | @Override
public void validate(String s) throws ValidationError {
try {
xv.validate(s);
} catch (SAXParseException e) {
final String name = e.getSystemId();
final String msg = e.getMessage();
final int line = e.getLineNumber();
final int column = e.getColumnNumber();
... |
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.for... |
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;
} |
4389698_31 | @Override
public int read(char[] cbuf, int off, int len) throws IOException {
try {
return reader.read(cbuf, off, len);
} catch (IOException e) {
return handleIOException(e);
}
} |
4390160_3 | public int getSize() {
return array.length;
} |
4398263_37 | public <RequestType extends ConversationsRequest> Request create(RequestType request) {
if (request instanceof ReviewsRequest) {
return createFromReviewRequest((ReviewsRequest) request);
} else if (request instanceof QuestionAndAnswerRequest) {
return createFromQuestionAndAnswerRequest((Question... |
4399205_10 | 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(n... |
4406463_75 | public void setXmlToParse(String xml) throws SAXException, IOException, ParserConfigurationException {
// Create a parsable document out of the xml string
DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
documentFactory.setNamespaceAware(false);
DocumentBuilder builder = documentFacto... |
4408504_1 | public InChI generateInchi(IAtomContainer atc)
throws IOException, CDKException {
String workingDir=System.getProperty("user.dir")+
System.getProperty("file.separator");
return generateInchi(atc,workingDir);
} |
4416959_338 | public boolean isRootClass()
{
return parentModel == null;
} |
4421246_0 | @Override
public QueryResult getResult() throws Exception {
return this.getResult(false);
} |
4437408_1 | @Override
public String toString() {
return "latitude: " + this.latitude + ", longitude: " + this.longitude;
} |
4449830_4 | @Override
public String toString() {
return String.format("%s[%s (%s)]", getClass().getSimpleName(), getName(), getMRL());
} |
4484894_1 | public boolean setException(Throwable e) {
return super.setException(e);
} |
4494450_40 | public IParserNode getLastChild()
{
final IParserNode lastChild = getChild( numChildren() - 1 );
return lastChild != null
&& lastChild.numChildren() > 0 ? lastChild.getLastChild()
: lastChild;
} |
4514536_390 | public void saveNamedClusterRep( NamedCluster namedCluster, NamedClusterService namedClusterService, Repository rep,
IMetaStore metaStore, ObjectId id_job, ObjectId objectId, LogChannelInterface logChannelInterface )
throws KettleException {
if ( namedCluster != null ) {
String namedClusterName = namedC... |
4522462_26 | public static AbstractResource createResource(Class<?> resourceClass) {
final Class<?> annotatedResourceClass = getAnnotatedResourceClass(resourceClass);
final Path rPathAnnotation = annotatedResourceClass.getAnnotation(Path.class);
final boolean isRootResourceClass = (null != rPathAnnotation);
final b... |
4536629_11 | @Override
public AuthenticatedPrincipal authenticate(String username, String password) {
ResourceOwner user = resourceOwnerRepository.findByUsername(username);
if (user == null) {
return null;
}
// Validate password
if (!user.checkPassword(password)) {
return null;
}
return new AuthenticatedPri... |
4541580_83 | public static String wordWrap(final String value, final int len)
{
if (len < 0 || value.length() <= len)
return value;
BreakIterator bi = BreakIterator.getWordInstance(currentLocale());
bi.setText(value);
return value.substring(0, bi.following(len));
} |
4544259_1 | @Override
public void updateBundleRepositoryDescriptor(String name) throws Exception {
if (repositories.get(name) == null) {
throw new IllegalArgumentException("Repository " + name + " doesn't exist");
}
if (repositories.get(name).getLocation() != null && !repositories.get(name).getLocation().isEmpt... |
4544982_100 | @Nullable
public Symbol getSymbol(String name, Kind... kinds) {
List<Kind> kindList = Arrays.asList(kinds);
List<Symbol> result = new ArrayList<>();
for (Symbol s : symbols) {
if (s.called(name)) {
if (kindList.isEmpty() || kindList.contains(s.kind())) {
result.add(s);
} else if (s.is(Kind... |
4546290_35 | @Override
public void beforeUpdate(Record record, Record originalRecord, Repository repository, FieldTypes fieldTypes,
RecordEvent recordEvent) throws RepositoryException, InterruptedException {
Collection<IndexInfo> indexInfos = indexesInfo.getIndexInfos();
if (indexInfos.size() > 0) {
TypeMana... |
4546424_51 | @GET
@Path (REST_API_VIDEOS)
@Produces (MediaType.APPLICATION_JSON)
public Response findVideos() {
if (isDebugEnabled) {
S_LOGGER.debug("Entered into AdminService.findVideos()");
}
try {
List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class);
if (videoL... |
4570530_3 | public boolean areThereImportsWithoutExports() {
boolean allImportsHaveExports = false;
for (String importedBeanName : imports.keySet()) {
if (!exports.containsKey(importedBeanName)) {
allImportsHaveExports = true;
String location = imports.get(importedBeanName).get(0).getLo... |
4576305_28 | @Override
public CheckResult check() {
try {
start();
CheckResult failure = connection.failure.get();
if (failure != null) return failure;
return CheckResult.OK;
} catch (Throwable e) {
Call.propagateIfFatal(e);
return CheckResult.failed(e);
}
} |
4581618_0 | public static IType removeQualifiers(IType type) {
while (type instanceof IQualifierType) {
type = ((IQualifierType) type).getType();
}
return type;
} |
4586516_11 | @Override
public Response toResponse(NotAuthorizedException exception) {
return getDefaultBuilder(exception, Response.Status.UNAUTHORIZED, determineBestMediaType()).build();
} |
4597158_1 | public static <V, E> double clusteringCoefficient(Graph<V, E> graph)
{
long numPaths = 0, numClosed = 0;
List<V> path = new ArrayList<V>(2);
for(V one : graph.getVertices())
{
path.clear();
path.add(null);
path.add(null);
path.add(null);
path.set(0, one);
for(V two : graph.getNeighbors(one))
{... |
4597760_91 | @Override
public FileContent getContent() throws FileSystemException {
return new DecoratedFileContent( super.getContent() ) {
@Override public InputStream getInputStream() throws FileSystemException {
return annotator.getInputStream( super.getInputStream(), annotationsFile.getContent().getInputStream() );
... |
4600110_2 | public static FsSettings fromJson(String json) throws IOException {
return prettyMapper.readValue(json, FsSettings.class);
} |
4603135_103 | public void publish(String subject, java.util.List<? extends java.io.Serializable> events) throws Exception {
publish(subject, new EventList(events));
} |
4604367_49 | public NestedAxis(final Axis parentAxis, final Axis childAxis) {
super(parentAxis.getCursor());
mParentAxis = checkNotNull(parentAxis);
mChildAxis = checkNotNull(childAxis);
mIsFirst = true;
} |
4605969_0 | public static Point2D.Double convertToLatLon(double x, double y) {
return convertToLatLon(x, y, new Point2D.Double());
} |
4606342_196 | public static boolean runSPOnSingleVM(NodeEntity node, Callable<Void> call) {
if (node.getMoId() == null) {
logger.info("VC vm does not exist for node: " + node.getVmName());
return false;
}
VcVirtualMachine vcVm = VcCache.getIgnoreMissing(node.getMoId());
if (vcVm == null) {
// cannot fin... |
4610430_20 | @Override
public String getReverseRoute(
Class<?> controllerClass,
String controllerMethodName) {
Optional<Map<String, Object>> parameterMap = Optional.empty();
return getReverseRoute(controllerClass, controllerMethodName, parameterMap);
} |
4614129_29 | @Override
public CardApplicationDisconnectResponse cardApplicationDisconnect(CardApplicationDisconnect request) {
dApplicationDisconnectResponse response = WSHelper.makeResponse(CardApplicationDisconnectResponse.class,
Helper.makeResultOK());
{
ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(req... |
4624158_14 | public SuccessResponse escalateAlert(String identifier, EscalateAlertToNextRequest body, String identifierType) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'identifier' is set
if (identifier == null) {
throw new ApiException(400, "Missing the required parameter 'i... |
4643211_0 | public CountTimestampSamplesWritable(long count, long epochMilliseconds, List<Long> samples) {
this.countTimestampWritable = new CountTimestampWritable(count, epochMilliseconds);
this.samples = samples;
} |
4646950_7 | public MutableCapabilities getCapabilities() {
sauceOptions = getSauceOptions();
setBrowserOptions(browserName);
capabilities.setCapability(sauceOptionsTag, sauceOptions);
capabilities.setCapability(CapabilityType.BROWSER_NAME, browserName);
capabilities.setCapability(CapabilityType.PLATFORM_NAME, ... |
4653065_0 | public static byte[] getMessageWithUdhInBytes(String s, byte dataCoding) {
final int udhLength = ((byte)s.charAt(0))+1;
final byte[] udh = s.substring(0, udhLength).getBytes();
final byte[] content = DataCodingSpecification.getMessageInBytes(s.substring(udhLength), dataCoding);
final byte[] contentWithU... |
4664478_9 | public void afterProjectsRead(final MavenSession session)
throws MavenExecutionException
{
try {
final int totalModules = session.getProjects().size();
logger.info("Inspecting build with total of " + totalModules + " modules...");
int stagingGoalsFoundInModules = 0;
// check do we need to do anyt... |
4665987_17 | @Override
public void updated(final String pid, final Dictionary config) throws ConfigurationException {
deleted(pid);
if (config == null) {
return;
}
Dictionary<String, Object> loadedConfig = externalConfigLoader.resolve(config);
String seFilter = getStringEncryptorFilter(loadedConfig);
... |
4668183_0 | @Nonnull
public T get(String id) throws IllegalArgumentException {
T t = map.get(id);
if (t == null) {
throw new IllegalArgumentException("Unknown id <" + id + ">");
}
return t;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.