_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q169900 | MethodRegistry.addMethod | validation | public static String addMethod(Method m) {
if (methods == null) {
methods = new HashMap<String, Method>();
}
String hashCode = String.valueOf(m.hashCode());
if (!methods.containsKey(hashCode)) {
methods.put(hashCode, m);
}
return String.valueOf(m.hashCode());
} | java | {
"resource": ""
} |
q169901 | FilterProxy.doFilter | validation | public int doFilter(Workspace ws, DataBinder binder, ExecutionContext ctx) throws DataException, ServiceException {
Object returnVal = null;
try {
String methodID = (String) ctx.getCachedObject("filterParameter");
Method m = MethodRegistry.getMethod(methodID);
ParameterMarshaller marshall... | java | {
"resource": ""
} |
q169902 | DbCreator.reduceDatabaseConnection | validation | public void reduceDatabaseConnection() {
synchronized (LOCK) {
int numberOfOpenConnections = OPEN_CONNECTIONS.decrementAndGet();
if (numberOfOpenConnections == 0 && dbConnection != null) {
dbConnection.close();
dbConnection = null;
}
}
} | java | {
"resource": ""
} |
q169903 | DbCreator.consumeDatabase | validation | public void consumeDatabase(DbConsumer dbConsumer) {
SQLiteDatabase db = getDatabaseConnection();
try {
dbConsumer.consume(db);
} finally {
reduceDatabaseConnection();
}
} | java | {
"resource": ""
} |
q169904 | DbCreator.query | validation | public Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy) {
SQLiteDatabase db = getDatabaseConnection();
return new DbClosingCursor(db.query(table, columns, selection, selectionArgs, groupBy, having, orderBy), this);
} | java | {
"resource": ""
} |
q169905 | DbCreator.rawQuery | validation | public Cursor rawQuery(String sql) {
SQLiteDatabase db = getDatabaseConnection();
return new DbClosingCursor(db.rawQuery(sql, null), this);
} | java | {
"resource": ""
} |
q169906 | CliGitRm.buildCommandLine | validation | private List<String> buildCommandLine(GitRmOptions options, File path, List<File> paths) {
List<String> cmdline = new ArrayList<String>();
cmdline.add(JavaGitConfiguration.getGitCommand());
cmdline.add("rm");
if (null != options) {
if (options.isOptCached()) {
cmdline.add("--cached");
... | java | {
"resource": ""
} |
q169907 | GitCheckoutResponse.getAddedFile | validation | public File getAddedFile(int index) {
CheckUtilities.checkIntIndexInListRange(addedFiles, index);
return addedFiles.get(index);
} | java | {
"resource": ""
} |
q169908 | GitCheckoutResponse.getDeletedFile | validation | public File getDeletedFile(int index) {
CheckUtilities.checkIntIndexInListRange(deletedFiles, index);
return deletedFiles.get(index);
} | java | {
"resource": ""
} |
q169909 | GitCheckoutResponse.getModifiedFile | validation | public File getModifiedFile(int index) {
CheckUtilities.checkIntIndexInListRange(modifiedFiles, index);
return modifiedFiles.get(index);
} | java | {
"resource": ""
} |
q169910 | GitFile.getStatus | validation | public Status getStatus() throws IOException, JavaGitException {
GitStatus gitStatus = new GitStatus();
// run git-status command
return gitStatus.getFileStatus(workingTree.getPath(), relativePath);
} | java | {
"resource": ""
} |
q169911 | AbstractInjector.getHead | validation | protected static HeadElement getHead() {
if (head == null) {
final Element element = Document.get().getElementsByTagName("head").getItem(0);
assert element != null : "HTML Head element required";
final HeadElement head = HeadElement.as(element);
AbstractInjector.h... | java | {
"resource": ""
} |
q169912 | Dropzone.getFiles | validation | public ArrayList<File> getFiles() {
//TODO Why ArrayList, change to list when in a proper IDE
final JsArray<FileJS> filesJS = getFilesNative(getElement());
final ArrayList<File> files = new ArrayList<File>();
if (filesJS != null) {
for (int i = 0; i < filesJS.length(); i++) {
files.add(filesJS.get(i));... | java | {
"resource": ""
} |
q169913 | Dropzone.getFilesCount | validation | public int getFilesCount() {
final JsArray<FileJS> files = getFilesNative(getElement());
return files != null ? files.length() : 0;
} | java | {
"resource": ""
} |
q169914 | Glob.matches | validation | public boolean matches(String string) {
String src = string;
final boolean result;
if (_compiledPattern.length == 1) {
// Shortcut for pattern '*', '?' and patterns not containing any wildcard
final GlobPattern pattern = _compiledPattern[0];
if (pattern.getTy... | java | {
"resource": ""
} |
q169915 | LruCache.updateListAfterHit | validation | @Override
protected void updateListAfterHit(CacheEntry<K, V> entry) {
if (entry != null && !entry.equals(_first)) {
if (entry.equals(_last)) {
setLast(entry.getPrevious());
} else {
final CacheEntry<K, V> previous = entry.getPrevious();
... | java | {
"resource": ""
} |
q169916 | InMemoryBasedCacheSupport.removeLast | validation | protected void removeLast() {
final CacheEntry<K, V> entry;
synchronized (_lock) {
if (_last != null) {
entry = _entries.remove(_last.getKey());
setLast(_last.getPrevious());
} else {
entry = null;
}
if (size... | java | {
"resource": ""
} |
q169917 | InMemoryBasedCacheSupport.cleanUpLifetimeExpired | validation | @SuppressWarnings("UnnecessaryUnboxing")
public void cleanUpLifetimeExpired() {
final long currentTime = currentTimeMillis();
// Test whether there could be an element that has to be removed
if (_nearstExpiringTime > 0 && _nearstExpiringTime <= currentTime) {
// Go through all el... | java | {
"resource": ""
} |
q169918 | LfuCache.updateListAfterHit | validation | @Override
protected void updateListAfterHit(CacheEntry<K, V> entry) {
if (entry != null && !entry.equals(_first)) {
if (entry.getHits() > entry.getPrevious().getHits()) {
// Swap the positions
final CacheEntry<K, V> beforePrevious = entry.getPrevious().getPreviou... | java | {
"resource": ""
} |
q169919 | StringUtils.startsWith | validation | public static boolean startsWith(char[] src, char[] find, int startAt) {
int startPos = startAt;
boolean result = true;
// Check ranges
if (src.length < startPos + find.length) {
result = false;
} else {
final int max = find.length;
for (int a... | java | {
"resource": ""
} |
q169920 | GlobusOAuth20ServiceImpl.getAccessToken | validation | @Override
public Token getAccessToken(Token requestToken, Verifier verifier) {
OAuthRequest request
= new ProxyOAuthRequest(this.api.getAccessTokenVerb(),
this.api.getAccessTokenEndpoint(), this.proxyHost, this.proxyPort);
String userpass = this.config.getApiK... | java | {
"resource": ""
} |
q169921 | GlobusOAuth20ServiceImpl.signRequest | validation | @Override
public void signRequest(Token accessToken, OAuthRequest request) {
request.addHeader("Authorization", "Bearer " + accessToken.getToken());
} | java | {
"resource": ""
} |
q169922 | GlobusApi.getAuthorizationUrl | validation | @Override
public String getAuthorizationUrl(OAuthConfig config) {
Preconditions.checkValidUrl(config.getCallback(),
"Must provide a valid url as callback.");
return String.format(AUTHORIZE_URL, config.getApiKey(),
OAuthEncoder.encode(config.getCallback()), SCOPES);
... | java | {
"resource": ""
} |
q169923 | ProjectWizard.performFinish | validation | public boolean performFinish() {
final String containerName = getProjectName();
final IPath location = projectPage.useDefaults() ? null : projectPage.getLocationPath();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try... | java | {
"resource": ""
} |
q169924 | ProjectWizard.doFinish | validation | private void doFinish(String containerName, IPath location, IProgressMonitor monitor) throws CoreException {
// create a sample file
monitor.beginTask("Creating " + containerName, 2);
monitor.worked(1);
final Archetype archetype = new Archetype();
archetype.setGroupId("org.glassmaker");
archetype.setArtif... | java | {
"resource": ""
} |
q169925 | ProjectWizardParametersPage.createControl | validation | public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout(3, false));
createArtifactGroup(composite);
createPropertiesGroup(composite);
setArchetype() ;
validate();
setControl(composite);
} | java | {
"resource": ""
} |
q169926 | ProjectWizardParametersPage.getDefaultJavaPackage | validation | protected String getDefaultJavaPackage() {
return ProjectWizardParametersPage.getDefaultJavaPackage(groupIdCombo.getText().trim(), artifactIdCombo.getText().trim());
} | java | {
"resource": ""
} |
q169927 | ProjectWizardParametersPage.setVisible | validation | public void setVisible(boolean visible) {
super.setVisible(visible);
boolean shouldValidate = false;
if (visible) {
if (groupIdCombo.getText().length() == 0 && groupIdCombo.getItemCount() > 0) {
groupIdCombo.setText(groupIdCombo.getItem(0));
packageCombo.setText(getDefaultJavaPackage());
packa... | java | {
"resource": ""
} |
q169928 | CriteriaQueryBuilder.createQueryDebugString | validation | public String createQueryDebugString() {
// create query
String queryString = createQueryString();
// create list of parameters
List<Object> parameterValues = getQueryParametersAsList();
// create debug string
return QueryLogHelper.createQueryLogMessage(queryString, parameterValues);
} | java | {
"resource": ""
} |
q169929 | CriteriaQueryBuilder.getQueryParametersAsList | validation | private List<Object> getQueryParametersAsList() {
// iterate over all restrictions of this criteria
Iterator<MetaEntry<Criterion>> iter = rootCriteria.getCriterionList().iterator();
// result list
List<Object> result = new ArrayList<Object>();
// loop over all criterion
while(iter.has... | java | {
"resource": ""
} |
q169930 | PaletteView.createPartControl | validation | public void createPartControl(Composite parent) {
viewer = new PaletteViewer();
viewer.createControl(parent);
PaletteRoot root = new PaletteRoot();
String[] category = getCategories();
for(int i=0;i<category.length;i++){
PaletteDrawer group = new PaletteDrawer(category[i]);
IPaletteItem[]... | java | {
"resource": ""
} |
q169931 | PaletteView.addPaletteItem | validation | private void addPaletteItem(String category,IPaletteItem item){
if(items.get(category)==null){
List<IPaletteItem> list = new ArrayList<IPaletteItem>();
items.put(category,list);
}
List<IPaletteItem> list = items.get(category);
list.add(item);
} | java | {
"resource": ""
} |
q169932 | PaletteView.getPaletteItems | validation | private IPaletteItem[] getPaletteItems(String category){
List<IPaletteItem> list = items.get(category);
if(list==null){
return new IPaletteItem[0];
}
return list.toArray(new IPaletteItem[list.size()]);
} | java | {
"resource": ""
} |
q169933 | NewCardTemplatesWizardPage.configureTableResizing | validation | private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
parent.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle area = parent.getClientArea();
Point preferredSize = table.computeSi... | java | {
"resource": ""
} |
q169934 | NewCardTemplatesWizardPage.getSelectedTemplate | validation | private Template getSelectedTemplate() {
Template template = null;
IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
if (selection.size() == 1) {
template = (Template) selection.getFirstElement();
}
return template;
} | java | {
"resource": ""
} |
q169935 | NewCardTemplatesWizardPage.getTemplateString | validation | String getTemplateString() {
String templateString = null;
Template template = getSelectedTemplate();
if (template != null) {
TemplateContextType contextType = GlassmakerUIPlugin.getDefault().getTemplateContextRegistry().getContextType(CardContextType.CONTEXT_TYPE);
IDocument document = new Document();
... | java | {
"resource": ""
} |
q169936 | NewCardTemplatesWizardPage.loadLastSavedPreferences | validation | private void loadLastSavedPreferences() {
fLastSelectedTemplateName = ""; //$NON-NLS-1$
boolean setSelection = false;
String templateName = GlassmakerUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
if (templateName == null || templateName.length() == 0) {
t... | java | {
"resource": ""
} |
q169937 | NewCardTemplatesWizardPage.saveLastSavedPreferences | validation | void saveLastSavedPreferences() {
String templateName = ""; //$NON-NLS-1$
Template template = getSelectedTemplate();
if (template != null) {
templateName = template.getName();
}
GlassmakerUIPlugin.getDefault().getPreferenceStore().setValue("newFileTemplateName", templateName);
GlassmakerUIPlugin.getDef... | java | {
"resource": ""
} |
q169938 | NewCardTemplatesWizardPage.setSelectedTemplate | validation | private void setSelectedTemplate(String templateName) {
Object template = null;
if (templateName != null && templateName.length() > 0) {
// pick the last used template
template = fTemplateStore.findTemplate(templateName, CardContextType.CONTEXT_TYPE);
}
// no record of last used template so just pick fi... | java | {
"resource": ""
} |
q169939 | NewCardTemplatesWizardPage.updateViewerInput | validation | void updateViewerInput() {
Template template = getSelectedTemplate();
if (template != null) {
fPatternViewer.getDocument().set(template.getPattern());
String imageId = "org.glassmaker.ui.templates."+template.getName().replace(" ", "").toLowerCase();
ImageDescriptor desc = imageRegistry.getDescriptor(imageI... | java | {
"resource": ""
} |
q169940 | Restrictions.in | validation | public static Criterion in(String relativePath, Collection<?> values) {
return new InExpression(relativePath, values.toArray());
} | java | {
"resource": ""
} |
q169941 | Restrictions.memberOf | validation | public static Criterion memberOf(String relativePath, Object value) {
return new MemberOfExpression(relativePath, value, false);
} | java | {
"resource": ""
} |
q169942 | Restrictions.notMemberOf | validation | public static Criterion notMemberOf(String relativePath, Object value) {
return new MemberOfExpression(relativePath, value, true);
} | java | {
"resource": ""
} |
q169943 | LoginPreferencePage.createFieldEditors | validation | public void createFieldEditors() {
addField(new StringFieldEditor(PreferenceConstants.CLIENT_ID, "Google API Client Id:", getFieldEditorParent()));
addField(new StringFieldEditor(PreferenceConstants.CLIENT_SECRET, "Google API Client Secret:", getFieldEditorParent()));
} | java | {
"resource": ""
} |
q169944 | StringUtils.getLastPathComponent | validation | public static String getLastPathComponent(String path) {
// find last '.' character
int pos = path.lastIndexOf('.');
// return the last path component
// or the complete path, if no '.' chars were found
return pos >= 0 ? path.substring(pos + 1) : path;
} | java | {
"resource": ""
} |
q169945 | NewCardFileWizardPage.initialPopulateContainerNameField | validation | protected void initialPopulateContainerNameField() {
super.initialPopulateContainerNameField();
IPath fullPath = getContainerFullPath();
IProject project = getProjectFromPath(fullPath);
IPath root = ProjectUtils.getRootContainerForPath(project, fullPath);
if (root != null) {
return;
}
root = ProjectUt... | java | {
"resource": ""
} |
q169946 | NewCardFileWizardPage.validatePage | validation | protected boolean validatePage() {
setMessage(null);
setErrorMessage(null);
if (!super.validatePage()) {
return false;
}
String fileName = getFileName();
IPath fullPath = getContainerFullPath();
if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
// check that filename... | java | {
"resource": ""
} |
q169947 | NewCardFileWizardPage.extensionValidForContentType | validation | private boolean extensionValidForContentType(String fileName) {
boolean valid = false;
IContentType type = getContentType();
// there is currently an extension
if (fileName.lastIndexOf('.') != -1) {
// check what content types are associated with current extension
IContentType[] types = Platform.getConte... | java | {
"resource": ""
} |
q169948 | NewCardFileWizardPage.addDefaultExtension | validation | String addDefaultExtension(String filename) {
StringBuffer newFileName = new StringBuffer(filename);
String ext = "card";
newFileName.append("."); //$NON-NLS-1$
newFileName.append(ext);
return newFileName.toString();
} | java | {
"resource": ""
} |
q169949 | NewCardFileWizardPage.getProjectFromPath | validation | private IProject getProjectFromPath(IPath path) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = null;
if (path != null) {
if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
project = workspace.getRoot().getProject(path.toString());
} else {
project ... | java | {
"resource": ""
} |
q169950 | OAuth2Util.getUserId | validation | public String getUserId(HttpServletRequest request) {
HttpSession session = request.getSession();
return (String) session.getAttribute("userId");
} | java | {
"resource": ""
} |
q169951 | CardEditor.createPage0 | validation | void createPage0() {
try {
textEditor = new StructuredTextEditor();
int index = addPage(textEditor, getEditorInput());
setPageText(index, "Source");
setPartName(textEditor.getTitle());
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", nul... | java | {
"resource": ""
} |
q169952 | CardEditor.doSaveAs | validation | public void doSaveAs() {
IEditorPart editor = getEditor(0);
editor.doSaveAs();
setPageText(0, editor.getTitle());
setInput(editor.getEditorInput());
} | java | {
"resource": ""
} |
q169953 | CardEditor.resourceChanged | validation | public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
... | java | {
"resource": ""
} |
q169954 | CardEditor.showPage | validation | void showPage() {
String editorText = getDocumentProvider().getDocument(textEditor.getEditorInput()).get();
deletePreviewFiles();
File file = toPreviewFile(editorText);
if (file != null) {
PREVIEW_FILES_LIST.add(file);
String s = "file://" + file.getAbsolutePath(); //$NON-NLS-1$
browser.setJavascript... | java | {
"resource": ""
} |
q169955 | QueryLogHelper.createQueryLogMessage | validation | public static String createQueryLogMessage(String query, List<Object> parameterValues) {
// builder for log message
StringBuilder builder = new StringBuilder();
// log the JPQL query string
builder.append("Query: \"");
builder.append(query);
builder.append("\"");
// append paramet... | java | {
"resource": ""
} |
q169956 | QueryLogHelper.objectToString | validation | private static String objectToString(Object obj) {
// handle 'null'
if(obj == null) {
return "null";
}
// enclose Strings in quotes
if(obj instanceof CharSequence) {
return "\""+obj.toString()+"\"";
}
// use toString() for all other objects
return obj.toString();
} | java | {
"resource": ""
} |
q169957 | MirrorTemplate.insertTimelineItem | validation | public TimelineItem insertTimelineItem(TimelineItem item) throws IOException {
return getMirror().timeline().insert(item).execute();
} | java | {
"resource": ""
} |
q169958 | MirrorTemplate.insertTimelineItem | validation | public void insertTimelineItem(TimelineItem item, String attachmentContentType, byte[] attachmentData) throws IOException {
Mirror.Timeline timeline = getMirror().timeline();
timeline.insert(item, new ByteArrayContent(attachmentContentType, attachmentData)).execute();
} | java | {
"resource": ""
} |
q169959 | MirrorTemplate.insertTimelineItem | validation | public void insertTimelineItem(TimelineItem item, String attachmentContentType, InputStream attachmentInputStream) throws IOException {
insertTimelineItem(item, attachmentContentType, ByteStreams.toByteArray(attachmentInputStream));
} | java | {
"resource": ""
} |
q169960 | DefaultIronCacheProvider.validate | validation | private void validate(final CacheResponse response, final String keyword) {
if (!response.getMessage().toLowerCase(Locale.US).startsWith(keyword)) {
throw new IllegalArgumentException(response.getMessage());
}
} | java | {
"resource": ""
} |
q169961 | Order.toQueryString | validation | public String toQueryString(Criteria criteria, CriteriaQueryBuilder queryBuilder) {
String absolutePath = queryBuilder.getAbsolutePath(criteria, relativePath);
return ascending ? absolutePath : absolutePath+" DESC";
} | java | {
"resource": ""
} |
q169962 | GlassmakerUIPlugin.getTemplateStore | validation | public TemplateStore getTemplateStore() {
if (fTemplateStore == null) {
fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "org.eclipse.wst.sse.ui.custom_templates");
try {
fTemplateStore.load();
} catch (IOException e) {
logError("",e);
}
}
ret... | java | {
"resource": ""
} |
q169963 | GlassmakerUIPlugin.getTemplateContextRegistry | validation | public ContextTypeRegistry getTemplateContextRegistry() {
if (fContextTypeRegistry == null) {
ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
registry.addContextType(CardContextType.CONTEXT_TYPE);
fContextTypeRegistry = registry;
}
return fContextTypeRegistry;
} | java | {
"resource": ""
} |
q169964 | CardEditorContributor.getAction | validation | protected IAction getAction(ITextEditor editor, String actionID) {
return (editor == null ? null : editor.getAction(actionID));
} | java | {
"resource": ""
} |
q169965 | AbstractMigratoryMojo.createDBI | validation | private DBI createDBI() throws Exception
{
if (driver != null) {
Class.forName(driver).newInstance();
}
return new DBI(url, user, password);
} | java | {
"resource": ""
} |
q169966 | JDBCEntityDAOSupport.appendLimitAndOffSet | validation | protected void appendLimitAndOffSet(final StringBuilder sql, final Page page) {
sql.append(" LIMIT ").append(page.getPageSize()).append(" OFFSET ").append(page.getOffset());
} | java | {
"resource": ""
} |
q169967 | Datatree.NamedProperty | validation | public static <N> NamedProperty<N> NamedProperty(final N name, final PropertyValue<N> value) {
return new NamedProperty.Impl<>(name, value);
} | java | {
"resource": ""
} |
q169968 | Datatree.NamedProperty | validation | public static <N> NamedProperty<N> NamedProperty(final N name, final String value) {
return NamedProperty(name, Datatree.<N>Literal(value));
} | java | {
"resource": ""
} |
q169969 | Datatree.NamedProperty | validation | public static <N> NamedProperty<N> NamedProperty(final N name, final NestedDocument<N> value) {
return new NamedProperty.Impl<>(name, value);
} | java | {
"resource": ""
} |
q169970 | Datatree.Literal | validation | public static <N> Literal.StringLiteral<N> Literal(final String value) {
return new Literal.StringLiteral<>(value);
} | java | {
"resource": ""
} |
q169971 | Datatree.Literal | validation | public static <N> Literal.UriLiteral<N> Literal(final URI value) {
return new Literal.UriLiteral<>(value);
} | java | {
"resource": ""
} |
q169972 | Datatree.Literal | validation | public static <N> Literal.TypedLiteral<N> Literal(final String value, final QName type) {
return new Literal.TypedLiteral<>(value, type);
} | java | {
"resource": ""
} |
q169973 | Datatree.QName | validation | public static QName QName(String namespaceURI, String localPart, String prefix) {
return new QName(namespaceURI, localPart, prefix);
} | java | {
"resource": ""
} |
q169974 | CORSFilter.init | validation | public void init(final FilterConfig filterConfig)
throws ServletException {
// Get the init params
Properties props = getFilterInitParameters(filterConfig);
// Extract and parse all required CORS filter properties
try {
config = new CORSConfiguration(props);
} catch (CORSConfigurationException ... | java | {
"resource": ""
} |
q169975 | DomainVersionedEntity.created | validation | public void created(final UUID createdByEntityId) {
if (this.entityId != null) {
throw new IllegalStateException("This entity has already been created: entityId = " + entityId);
}
this.entityId = UUID.randomUUID();
this.entityVersion = 1;
this.createdByEntityId = createdByEntityId;
this.updatedByEntityId... | java | {
"resource": ""
} |
q169976 | DomainVersionedEntity.init | validation | protected void init(JsonParser parser) throws IOException {
LoggerFactory.getLogger(getClass()).warn("init(JsonParser parser) invoked to handle field: {}", parser.getCurrentName());
} | java | {
"resource": ""
} |
q169977 | DomainVersionedEntity.updated | validation | public void updated(final UUID lastupdatedByEntityId) {
if (this.entityId == null) {
throw new IllegalStateException("The entity has not yet been created : entityId == null");
}
Assert.notNull(lastupdatedByEntityId, "lastupdatedByEntityId is required");
entityVersion++;
updatedByEntityId = lastupdatedByEnt... | java | {
"resource": ""
} |
q169978 | Server.close | validation | public void close( int port ) {
for (Iterator i = _listeners.keySet().iterator(); i.hasNext(); ) {
Object k = i.next();
Object s = _listeners.get(k);
if (s instanceof SocketHandler) {
SocketHandler sh = (SocketHandler)s;
if (port == -1 || sh.isPort( port )) {
sh.interrupt... | java | {
"resource": ""
} |
q169979 | Server.main | validation | public static final void main( String[] args ) {
if (args.length != 1) {
System.err.println("A single argument -- a port -- is required");
System.exit(1);
}
int port = Integer.valueOf( args[0] ).intValue();
System.out.println(Version.VERSION);
try {
new Server( port );
} catch ... | java | {
"resource": ""
} |
q169980 | Validator.validateOpts | validation | public void validateOpts(Object instance) {
final Set<ConstraintViolation<Object>> set = validator.validate(instance);
final StringBuilder sb = new StringBuilder();
for (ConstraintViolation<Object> violation : set) {
final Path path = violation.getPropertyPath();
fin... | java | {
"resource": ""
} |
q169981 | Validator.validateArgs | validation | public void validateArgs(List<Object> args, Object instance, Method m, Command cmd) {
final Set<ConstraintViolation<Object>> set = validator.validateParameters(instance, m,
args.toArray());
final StringBuilder sb = new StringBuilder();
for (ConstraintViolation<Object> violati... | java | {
"resource": ""
} |
q169982 | Stomp.subscribe | validation | public void subscribe( String name, Listener listener, Map headers ) {
synchronized (_listeners) {
if (listener != null) {
List list = (List)_listeners.get( name );
if (list == null) {
list = new ArrayList();
_listeners.put( name, list );
}
if (!list.contai... | java | {
"resource": ""
} |
q169983 | Stomp.unsubscribe | validation | public void unsubscribe( String name, Listener l ) {
synchronized (_listeners) {
List list = (List)_listeners.get( name );
if (list != null) {
list.remove( l );
if (list.size() == 0) {
unsubscribe( name );
}
}
}
} | java | {
"resource": ""
} |
q169984 | Stomp.unsubscribe | validation | public void unsubscribe( String name, Map header ) {
if (header == null) header = new HashMap();
synchronized( _listeners ) { _listeners.remove( name ); }
header.put( "destination", name );
transmit( Command.UNSUBSCRIBE, header );
} | java | {
"resource": ""
} |
q169985 | Stomp.unsubscribeW | validation | public void unsubscribeW( String name, Map header ) throws InterruptedException {
String receipt = addReceipt( header );
unsubscribe( name, (HashMap)null );
waitOnReceipt( receipt );
} | java | {
"resource": ""
} |
q169986 | Stomp.send | validation | public void send( String dest, String mesg, Map header ) {
if (header == null) header = new HashMap();
header.put( "destination", dest );
transmit( Command.SEND, header, mesg );
} | java | {
"resource": ""
} |
q169987 | Stomp.getNext | validation | public Message getNext( String name ) {
synchronized( _queue ) {
for (int idx = 0; idx < _queue.size(); idx++) {
Message m = (Message)_queue.get(idx);
if (m.headers().get( "destination" ).equals(name)) {
_queue.remove(idx);
return m;
}
}
}
return null;... | java | {
"resource": ""
} |
q169988 | Stomp.hasReceipt | validation | public boolean hasReceipt( String receipt_id ) {
synchronized( _receipts ) {
for (Iterator i=_receipts.iterator(); i.hasNext();) {
String o = (String)i.next();
if (o.equals(receipt_id)) return true;
}
}
return false;
} | java | {
"resource": ""
} |
q169989 | Stomp.clearReceipt | validation | public void clearReceipt( String receipt_id ) {
synchronized( _receipts ) {
for (Iterator i=_receipts.iterator(); i.hasNext();) {
String o = (String)i.next();
if (o.equals(receipt_id)) i.remove();
}
}
} | java | {
"resource": ""
} |
q169990 | EventBusServiceImpl.logDeadEvent | validation | @Subscribe
public void logDeadEvent(final DeadEvent deadEvent) {
final Object event = deadEvent.getEvent();
log.warn("{} : DeadEvent : {} : {}", beanName, event.getClass().getName(), event);
} | java | {
"resource": ""
} |
q169991 | Conversion.convert | validation | public <T> T convert(final Object source, final Class<T> targetclass) {
if (source == null) {
return null;
}
final Class<?> sourceclass = source.getClass();
final SourceTargetPairKey key = new SourceTargetPairKey(sourceclass, targetclass);
Converter converter = cache... | java | {
"resource": ""
} |
q169992 | AbstractDryParser.getPriority | validation | protected Priority getPriority(final int lines) {
if (lines >= highThreshold) {
return Priority.HIGH;
}
else if (lines >= normalThreshold) {
return Priority.NORMAL;
}
else {
return Priority.LOW;
}
} | java | {
"resource": ""
} |
q169993 | Command.execute | validation | public void execute(GNUishParser p) {
if (instance == null) {
instance = Utils.newInstance(className);
}
final Class<?> clazz = instance.getClass();
final Method[] methods = clazz.getDeclaredMethods();
for (Method m : methods) {
m.setAccessible(true);
if (!m.getName().equals(p.getC... | java | {
"resource": ""
} |
q169994 | Command.injectOpts | validation | private void injectOpts(GNUishParser p, Class<?> clazz) {
for (Field f : clazz.getDeclaredFields()) {
f.setAccessible(true);
final CliOption anno = f.getAnnotation(CliOption.class);
if (anno == null) {
continue;
}
String value = p.getShortOpt(anno.shortName());
if (value ... | java | {
"resource": ""
} |
q169995 | Command.adjustArgs | validation | private List<Object> adjustArgs(List<String> args, Method m) {
final List<Object> result = new ArrayList<Object>();
final Class<?>[] types = m.getParameterTypes();
if (m.isVarArgs()) {
types[types.length - 1] = types[types.length - 1].getComponentType();
if (!String.class.isAssignableFrom(types[... | java | {
"resource": ""
} |
q169996 | InternalMigrator.migratePersonality | validation | private List<MigrationResult> migratePersonality(final MetadataManager metadataManager, final String personalityName, final Integer targetVersion, final MigratoryOption [] options)
{
final Integer currentVersion = metadataManager.getCurrentVersion(personalityName);
if (currentVersion == null && !m... | java | {
"resource": ""
} |
q169997 | CORSRequestHandler.tagRequest | validation | public void tagRequest(final HttpServletRequest request) {
final CORSRequestType type = CORSRequestType.detect(request);
switch (type) {
case ACTUAL:
request.setAttribute("cors.isCorsRequest", true);
request.setAttribute("cors.origin", request.getHeader("Origin"));
request.setAttribute("cors... | java | {
"resource": ""
} |
q169998 | CORSRequestHandler.handleActualRequest | validation | public void handleActualRequest(final HttpServletRequest request, final HttpServletResponse response)
throws InvalidCORSRequestException,
CORSOriginDeniedException,
UnsupportedHTTPMethodException {
if (CORSRequestType.detect(request) != CORSRequestType.ACTUAL)
throw new InvalidCORSRequestEx... | java | {
"resource": ""
} |
q169999 | CORSRequestHandler.handlePreflightRequest | validation | public void handlePreflightRequest(final HttpServletRequest request, final HttpServletResponse response)
throws InvalidCORSRequestException,
CORSOriginDeniedException,
UnsupportedHTTPMethodException,
UnsupportedHTTPHeaderException {
if (CORSRequestType.detect(request) != CORSRequest... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.