method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public IterableAssert<T> satisfies(SerializableFunction<Iterable<T>, Void> checkerFn) { new OneSideInputAssert<Iterable<T>>(actualView).satisfies(checkerFn); return this; }
IterableAssert<T> function(SerializableFunction<Iterable<T>, Void> checkerFn) { new OneSideInputAssert<Iterable<T>>(actualView).satisfies(checkerFn); return this; }
/** * Applies a {@link SerializableFunction} to check the elements of the {@code Iterable}. * * <p> Returns this {@code IterableAssert}. */
Applies a <code>SerializableFunction</code> to check the elements of the Iterable. Returns this IterableAssert
satisfies
{ "repo_name": "haocafes/DataflowJavaSDK", "path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/testing/DataflowAssert.java", "license": "apache-2.0", "size": 20065 }
[ "com.google.cloud.dataflow.sdk.transforms.SerializableFunction" ]
import com.google.cloud.dataflow.sdk.transforms.SerializableFunction;
import com.google.cloud.dataflow.sdk.transforms.*;
[ "com.google.cloud" ]
com.google.cloud;
2,240,044
@Override public synchronized Iterator iterator() { return new MyIteratorLinked<E>(); }
synchronized Iterator function() { return new MyIteratorLinked<E>(); }
/** * Override iterator constructor. * @return tag. */
Override iterator constructor
iterator
{ "repo_name": "1Evgeny/java-a-to-z", "path": "chapter_007/src/main/java/by/vorokhobko/synchronizmonitore/DynamicLinkedList.java", "license": "apache-2.0", "size": 5310 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,534,398
private ArrayList<ShapeInfo> ProcessSinglePointModifiers( MilStdSymbol symbol) { Color textColor = null; Color textBackgroundColor = null; String validModifiers = ""; SymbolDef sDef = null; ArrayList<ShapeInfo> modifierShapes = null; int symStd = symbol.getSymbologyStandard(); sDef = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolID(symbol.getSymbolID()),symStd); if(sDef != null) { validModifiers = sDef.getModifiers(); } if(symbol.getTextColor() != null) { textColor = symbol.getTextColor(); } else if(_RendererSettings.getLabelForegroundColor() != null) { textColor = _RendererSettings.getLabelForegroundColor(); } else if(SymbolUtilities.isTacticalGraphic(symbol.getSymbolID()) && symbol.getLineColor() != null) { textColor = symbol.getLineColor(); } else textColor = Color.BLACK; if(symbol.getTextBackgroundColor() != null) { textBackgroundColor = symbol.getTextBackgroundColor(); } Rectangle symbolBounds = symbol.getSymbolExtent(); //grow symbol bounds for outline if present. if(symbol.getOutlineEnabled()) symbolBounds.grow(symbol.getOutlineWidth(), symbol.getOutlineWidth()); modifierShapes = ProcessSPTGModifiers(symbol.getSymbolID(), validModifiers, symbol.getModifierMap(), symbolBounds,_fontRenderContext, _ModifierFont,textColor,textBackgroundColor,symStd); return modifierShapes; }
ArrayList<ShapeInfo> function( MilStdSymbol symbol) { Color textColor = null; Color textBackgroundColor = null; String validModifiers = ""; SymbolDef sDef = null; ArrayList<ShapeInfo> modifierShapes = null; int symStd = symbol.getSymbologyStandard(); sDef = SymbolDefTable.getInstance().getSymbolDef(SymbolUtilities.getBasicSymbolID(symbol.getSymbolID()),symStd); if(sDef != null) { validModifiers = sDef.getModifiers(); } if(symbol.getTextColor() != null) { textColor = symbol.getTextColor(); } else if(_RendererSettings.getLabelForegroundColor() != null) { textColor = _RendererSettings.getLabelForegroundColor(); } else if(SymbolUtilities.isTacticalGraphic(symbol.getSymbolID()) && symbol.getLineColor() != null) { textColor = symbol.getLineColor(); } else textColor = Color.BLACK; if(symbol.getTextBackgroundColor() != null) { textBackgroundColor = symbol.getTextBackgroundColor(); } Rectangle symbolBounds = symbol.getSymbolExtent(); if(symbol.getOutlineEnabled()) symbolBounds.grow(symbol.getOutlineWidth(), symbol.getOutlineWidth()); modifierShapes = ProcessSPTGModifiers(symbol.getSymbolID(), validModifiers, symbol.getModifierMap(), symbolBounds,_fontRenderContext, _ModifierFont,textColor,textBackgroundColor,symStd); return modifierShapes; }
/** * Returns an arraylist representing the ShapeInfo objects used to draw * all of the modifiers. * @param symbol * @return */
Returns an arraylist representing the ShapeInfo objects used to draw all of the modifiers
ProcessSinglePointModifiers
{ "repo_name": "missioncommand/mil-sym-java", "path": "core/JavaRenderer/src/main/java/ArmyC2/C2SD/Rendering/SinglePointRenderer.java", "license": "apache-2.0", "size": 160551 }
[ "java.awt.Color", "java.awt.Rectangle", "java.util.ArrayList" ]
import java.awt.Color; import java.awt.Rectangle; import java.util.ArrayList;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,432,840
@ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, UUID clientRequestId);
@ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, UUID clientRequestId);
/** * Initiates the deletion of the shared private link resource from the search service. * * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this * value from the Azure Resource Manager API or the portal. * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource * group. * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive * Search service within the specified resource group. * @param clientRequestId A client-generated GUID value that identifies this request. If specified, this will be * included in response information as a way to track the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */
Initiates the deletion of the shared private link resource from the search service
delete
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-search/src/main/java/com/azure/resourcemanager/search/fluent/SharedPrivateLinkResourcesClient.java", "license": "mit", "size": 39493 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.*;
[ "com.azure.core" ]
com.azure.core;
1,750,692
private void deleteCollection(HttpServletRequest req, DirContext resources, String path, Hashtable errorList) { if (debug > 1) System.out.println("Delete:" + path); if ((path.toUpperCase().startsWith("/WEB-INF")) || (path.toUpperCase().startsWith("/META-INF"))) { errorList.put(path, new Integer(WebdavStatus.SC_FORBIDDEN)); return; } String ifHeader = req.getHeader("If"); if (ifHeader == null) ifHeader = ""; String lockTokenHeader = req.getHeader("Lock-Token"); if (lockTokenHeader == null) lockTokenHeader = ""; Enumeration _enum = null; try { _enum = resources.list(path); } catch (NamingException e) { errorList.put(path, new Integer (WebdavStatus.SC_INTERNAL_SERVER_ERROR)); return; } while (_enum.hasMoreElements()) { NameClassPair ncPair = (NameClassPair) _enum.nextElement(); String childName = path; if (!childName.equals("/")) childName += "/"; childName += ncPair.getName(); if (isLocked(childName, ifHeader + lockTokenHeader)) { errorList.put(childName, new Integer(WebdavStatus.SC_LOCKED)); } else { try { Object object = resources.lookup(childName); if (object instanceof DirContext) { deleteCollection(req, resources, childName, errorList); } try { resources.unbind(childName); } catch (NamingException e) { if (!(object instanceof DirContext)) { // If it's not a collection, then it's an unknown // error errorList.put (childName, new Integer (WebdavStatus.SC_INTERNAL_SERVER_ERROR)); } } } catch (NamingException e) { errorList.put (childName, new Integer (WebdavStatus.SC_INTERNAL_SERVER_ERROR)); } } } }
void function(HttpServletRequest req, DirContext resources, String path, Hashtable errorList) { if (debug > 1) System.out.println(STR + path); if ((path.toUpperCase().startsWith(STR)) (path.toUpperCase().startsWith(STR))) { errorList.put(path, new Integer(WebdavStatus.SC_FORBIDDEN)); return; } String ifHeader = req.getHeader("If"); if (ifHeader == null) ifHeader = STRLock-TokenSTRSTR/STR/"; childName += ncPair.getName(); if (isLocked(childName, ifHeader + lockTokenHeader)) { errorList.put(childName, new Integer(WebdavStatus.SC_LOCKED)); } else { try { Object object = resources.lookup(childName); if (object instanceof DirContext) { deleteCollection(req, resources, childName, errorList); } try { resources.unbind(childName); } catch (NamingException e) { if (!(object instanceof DirContext)) { errorList.put (childName, new Integer (WebdavStatus.SC_INTERNAL_SERVER_ERROR)); } } } catch (NamingException e) { errorList.put (childName, new Integer (WebdavStatus.SC_INTERNAL_SERVER_ERROR)); } } } }
/** * Deletes a collection. * * @param resources Resources implementation associated with the context * @param path Path to the collection to be deleted * @param errorList Contains the list of the errors which occurred */
Deletes a collection
deleteCollection
{ "repo_name": "c-rainstorm/jerrydog", "path": "src/main/java/org/apache/catalina/servlets/WebdavServlet.java", "license": "gpl-3.0", "size": 108768 }
[ "java.util.Hashtable", "javax.naming.NamingException", "javax.naming.directory.DirContext", "javax.servlet.http.HttpServletRequest" ]
import java.util.Hashtable; import javax.naming.NamingException; import javax.naming.directory.DirContext; import javax.servlet.http.HttpServletRequest;
import java.util.*; import javax.naming.*; import javax.naming.directory.*; import javax.servlet.http.*;
[ "java.util", "javax.naming", "javax.servlet" ]
java.util; javax.naming; javax.servlet;
1,169,751
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (poolName == null) { throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Observable<Response<ResponseBody>> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Observable<ServiceResponse<Void>> function(String resourceGroupName, String accountName, String poolName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (accountName == null) { throw new IllegalArgumentException(STR); } if (poolName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); } Observable<Response<ResponseBody>> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
/** * Delete a capacity pool. * Delete the specified capacity pool. * * @param resourceGroupName The name of the resource group. * @param accountName The name of the NetApp account * @param poolName The name of the capacity pool * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
Delete a capacity pool. Delete the specified capacity pool
deleteWithServiceResponseAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/netapp/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/netapp/v2019_08_01/implementation/PoolsInner.java", "license": "mit", "size": 43442 }
[ "com.google.common.reflect.TypeToken", "com.microsoft.rest.ServiceResponse" ]
import com.google.common.reflect.TypeToken; import com.microsoft.rest.ServiceResponse;
import com.google.common.reflect.*; import com.microsoft.rest.*;
[ "com.google.common", "com.microsoft.rest" ]
com.google.common; com.microsoft.rest;
1,786,287
public void init(SynapseEnvironment env);
void function(SynapseEnvironment env);
/** * Initializes this authenticator instance. * * @param env Current SynapseEnvironment instance containing the global/tenant configuration */
Initializes this authenticator instance
init
{ "repo_name": "kasun32/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/Authenticator.java", "license": "apache-2.0", "size": 2884 }
[ "org.apache.synapse.core.SynapseEnvironment" ]
import org.apache.synapse.core.SynapseEnvironment;
import org.apache.synapse.core.*;
[ "org.apache.synapse" ]
org.apache.synapse;
1,798,165
public synchronized void updatePersistedMasterKey(DelegationKey key) throws IOException { addKey(key); }
synchronized void function(DelegationKey key) throws IOException { addKey(key); }
/** * Add a MasterKey to the list of keys. * * @param key DelegationKey * @throws IOException */
Add a MasterKey to the list of keys
updatePersistedMasterKey
{ "repo_name": "Shmuma/hadoop", "path": "src/hdfs/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenSecretManager.java", "license": "apache-2.0", "size": 9294 }
[ "java.io.IOException", "org.apache.hadoop.security.token.delegation.DelegationKey" ]
import java.io.IOException; import org.apache.hadoop.security.token.delegation.DelegationKey;
import java.io.*; import org.apache.hadoop.security.token.delegation.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
316,762
@Override public void onPause() { Log.i(TAG, "onPause"); super.onPause(); if (Client.isConfigured(this)) { Client.getController().restoreClientState(); } }
void function() { Log.i(TAG, STR); super.onPause(); if (Client.isConfigured(this)) { Client.getController().restoreClientState(); } }
/** * When the user hits the back button the settings need to be updated and * propagated. */
When the user hits the back button the settings need to be updated and propagated
onPause
{ "repo_name": "platzhirsch/security-cam", "path": "client/src/main/java/berlin/reiche/securitas/activities/SettingsActivity.java", "license": "mit", "size": 2032 }
[ "android.util.Log", "berlin.reiche.securitas.Client" ]
import android.util.Log; import berlin.reiche.securitas.Client;
import android.util.*; import berlin.reiche.securitas.*;
[ "android.util", "berlin.reiche.securitas" ]
android.util; berlin.reiche.securitas;
2,709,889
protected void addResource(List<Object> defaults, String bundleName) { ResourceBundle bundle = ResourceBundle.getBundle(bundleName); for (Enumeration<String> keys = bundle.getKeys(); keys.hasMoreElements(); ) { String key = keys.nextElement(); defaults.add(key); defaults.add(bundle.getObject(key)); } }
void function(List<Object> defaults, String bundleName) { ResourceBundle bundle = ResourceBundle.getBundle(bundleName); for (Enumeration<String> keys = bundle.getKeys(); keys.hasMoreElements(); ) { String key = keys.nextElement(); defaults.add(key); defaults.add(bundle.getObject(key)); } }
/** * Adds the all keys/values from the given named resource bundle to the * defaults */
Adds the all keys/values from the given named resource bundle to the defaults
addResource
{ "repo_name": "charlycoste/TreeD", "path": "src/org/jdesktop/swingx/plaf/AbstractComponentAddon.java", "license": "gpl-2.0", "size": 6215 }
[ "java.util.Enumeration", "java.util.List", "java.util.ResourceBundle" ]
import java.util.Enumeration; import java.util.List; import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
169,122
IXmlDocument transformToXmlDocument(InputStream stream, String encoding) throws XmlDocumentCheckedException;
IXmlDocument transformToXmlDocument(InputStream stream, String encoding) throws XmlDocumentCheckedException;
/** * This method transforms the xml document using this style sheet. * * @param stream stream containing the XML document. * @param encoding the encoding of the stream * @return The XML document. * @throws XmlDocumentCheckedException If the XML is invalid. */
This method transforms the xml document using this style sheet
transformToXmlDocument
{ "repo_name": "bclemenzi/java-xml", "path": "src/main/java/com/nfbsoftware/xml/IXslDocument.java", "license": "gpl-2.0", "size": 7481 }
[ "com.nfbsoftware.xml.exception.XmlDocumentCheckedException", "java.io.InputStream" ]
import com.nfbsoftware.xml.exception.XmlDocumentCheckedException; import java.io.InputStream;
import com.nfbsoftware.xml.exception.*; import java.io.*;
[ "com.nfbsoftware.xml", "java.io" ]
com.nfbsoftware.xml; java.io;
2,261,218
@Override public void preInitialise(Context rootContext) { context = rootContext; vrProvider = OpenVRProvider.getInstance(); }
void function(Context rootContext) { context = rootContext; vrProvider = OpenVRProvider.getInstance(); }
/** * Actions that need to be performed before initialization. In this case, the VR provider is retrieved (and this * possibly triggers an initialization if it hasn't been retrieved before). * @param rootContext The root context, that will survive the entire run of the engine */
Actions that need to be performed before initialization. In this case, the VR provider is retrieved (and this possibly triggers an initialization if it hasn't been retrieved before)
preInitialise
{ "repo_name": "Vizaxo/Terasology", "path": "engine/src/main/java/org/terasology/engine/subsystem/openvr/OpenVRInput.java", "license": "apache-2.0", "size": 3479 }
[ "org.terasology.context.Context", "org.terasology.rendering.openvrprovider.OpenVRProvider" ]
import org.terasology.context.Context; import org.terasology.rendering.openvrprovider.OpenVRProvider;
import org.terasology.context.*; import org.terasology.rendering.openvrprovider.*;
[ "org.terasology.context", "org.terasology.rendering" ]
org.terasology.context; org.terasology.rendering;
1,518,934
void finish(Request<?> request) { // Remove from the set of requests currently being processed. synchronized (mCurrentRequests) { mCurrentRequests.remove(request); } if (request.shouldCache()) { synchronized (mWaitingRequests) { String cacheKey = request.getCacheKey(); Queue<Request<?>> waitingRequests = mWaitingRequests.remove(cacheKey); if (waitingRequests != null) { if (VolleyLog.DEBUG) { VolleyLog.v("Releasing %d waiting requests for cacheKey=%s.", waitingRequests.size(), cacheKey); } // Process all queued up requests. They won't be considered as in flight, but // that's not a problem as the cache has been primed by 'request'. mCacheQueue.addAll(waitingRequests); } } } }
void finish(Request<?> request) { synchronized (mCurrentRequests) { mCurrentRequests.remove(request); } if (request.shouldCache()) { synchronized (mWaitingRequests) { String cacheKey = request.getCacheKey(); Queue<Request<?>> waitingRequests = mWaitingRequests.remove(cacheKey); if (waitingRequests != null) { if (VolleyLog.DEBUG) { VolleyLog.v(STR, waitingRequests.size(), cacheKey); } mCacheQueue.addAll(waitingRequests); } } } }
/** * Called from {@link com.android.volley.Request#finish(String)}, indicating that processing of the given request * has finished. * <p/> * <p>Releases waiting requests for <code>request.getCacheKey()</code> if * <code>request.shouldCache()</code>.</p> */
Called from <code>com.android.volley.Request#finish(String)</code>, indicating that processing of the given request has finished. Releases waiting requests for <code>request.getCacheKey()</code> if <code>request.shouldCache()</code>
finish
{ "repo_name": "fossasia/fossasia-companion-android", "path": "app/src/main/java/com/android/volley/RequestQueue.java", "license": "apache-2.0", "size": 10738 }
[ "java.util.Queue" ]
import java.util.Queue;
import java.util.*;
[ "java.util" ]
java.util;
2,695,956
public static Date rollMockClock(int seconds) { return rollMockClockMillis(seconds * 1000); }
static Date function(int seconds) { return rollMockClockMillis(seconds * 1000); }
/** * Advances (or rewinds) the mock clock by the given number of seconds. */
Advances (or rewinds) the mock clock by the given number of seconds
rollMockClock
{ "repo_name": "RaviAjaibSingh/bitcoinj", "path": "core/src/main/java/com/google/bitcoin/core/Utils.java", "license": "apache-2.0", "size": 23278 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
564,317
protected void process(Request request, String repoID, String featurename, String version) { try { switch(request.getMethod()) { case DELETE: request.getResponse().sendJsonMap(deleteFeatureVersion(repoID, featurename, version)); break; case PUT: saveFeatureVersionFile(getRepositoryFolder(repoID, featurename, version), request.getBodyAsMap().toBlocking().last()); updateFeatureVersionContents(request.getVirtualHost(), repoID, featurename, version); request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; case POST: updateFeatureVersionContents(request.getVirtualHost(), repoID, featurename, version); request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; default: request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; } } catch (IOException e) { request.getResponse().setStatusCode(500); request.getResponse().end(e.getMessage()); } }
void function(Request request, String repoID, String featurename, String version) { try { switch(request.getMethod()) { case DELETE: request.getResponse().sendJsonMap(deleteFeatureVersion(repoID, featurename, version)); break; case PUT: saveFeatureVersionFile(getRepositoryFolder(repoID, featurename, version), request.getBodyAsMap().toBlocking().last()); updateFeatureVersionContents(request.getVirtualHost(), repoID, featurename, version); request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; case POST: updateFeatureVersionContents(request.getVirtualHost(), repoID, featurename, version); request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; default: request.getResponse().sendJsonMap(readRepositoryFeatureVersion(repoID, featurename, version)); break; } } catch (IOException e) { request.getResponse().setStatusCode(500); request.getResponse().end(e.getMessage()); } }
/** * Process the feature version * @param request * @param repoID * @param featurename * @param version */
Process the feature version
process
{ "repo_name": "core9/module-features", "path": "src/impl/java/io/core9/plugin/features/FeaturesRepositoryPluginImpl.java", "license": "mit", "size": 10166 }
[ "io.core9.plugin.server.request.Request", "java.io.IOException" ]
import io.core9.plugin.server.request.Request; import java.io.IOException;
import io.core9.plugin.server.request.*; import java.io.*;
[ "io.core9.plugin", "java.io" ]
io.core9.plugin; java.io;
34,755
@Override public void generateDcat(Cache cache, Storage store) throws RepositoryException, MalformedURLException { logger.info("Generate DCAT"); List<URL> urls = cache.retrieveURLList(); for (URL u : urls) { Map<String, Page> page = cache.retrievePage(u); generateDataset(store, null, page); } generateCatalog(store); }
void function(Cache cache, Storage store) throws RepositoryException, MalformedURLException { logger.info(STR); List<URL> urls = cache.retrieveURLList(); for (URL u : urls) { Map<String, Page> page = cache.retrievePage(u); generateDataset(store, null, page); } generateCatalog(store); }
/** * Generate DCAT. * * @param cache * @param store RDF store * @throws RepositoryException * @throws MalformedURLException */
Generate DCAT
generateDcat
{ "repo_name": "Fedict/dcattools", "path": "scrapers/src/main/java/be/fedict/dcat/scrapers/CkanJson.java", "license": "bsd-2-clause", "size": 17143 }
[ "be.fedict.dcat.helpers.Storage", "java.net.MalformedURLException", "java.util.List", "java.util.Map", "org.eclipse.rdf4j.repository.RepositoryException" ]
import be.fedict.dcat.helpers.Storage; import java.net.MalformedURLException; import java.util.List; import java.util.Map; import org.eclipse.rdf4j.repository.RepositoryException;
import be.fedict.dcat.helpers.*; import java.net.*; import java.util.*; import org.eclipse.rdf4j.repository.*;
[ "be.fedict.dcat", "java.net", "java.util", "org.eclipse.rdf4j" ]
be.fedict.dcat; java.net; java.util; org.eclipse.rdf4j;
810,657
private Uri parseWktUri() { if (mPayload.length < 2) { return null; } // payload[0] contains the URI Identifier Code, as per // NFC Forum "URI Record Type Definition" section 3.2.2. int prefixIndex = (mPayload[0] & (byte)0xFF); if (prefixIndex < 0 || prefixIndex >= URI_PREFIX_MAP.length) { return null; } String prefix = URI_PREFIX_MAP[prefixIndex]; String suffix = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length), Charset.forName("UTF-8")); return Uri.parse(prefix + suffix); }
Uri function() { if (mPayload.length < 2) { return null; } int prefixIndex = (mPayload[0] & (byte)0xFF); if (prefixIndex < 0 prefixIndex >= URI_PREFIX_MAP.length) { return null; } String prefix = URI_PREFIX_MAP[prefixIndex]; String suffix = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length), Charset.forName("UTF-8")); return Uri.parse(prefix + suffix); }
/** * Return complete URI of {@link #TNF_WELL_KNOWN}, {@link #RTD_URI} records. * @return complete URI, or null if invalid */
Return complete URI of <code>#TNF_WELL_KNOWN</code>, <code>#RTD_URI</code> records
parseWktUri
{ "repo_name": "jypeitao/NFC2", "path": "ndef-tools-for-android/ndeftools-test/src/android/nfc16/NdefRecord.java", "license": "gpl-3.0", "size": 38168 }
[ "android.net.Uri", "java.nio.charset.Charset", "java.util.Arrays" ]
import android.net.Uri; import java.nio.charset.Charset; import java.util.Arrays;
import android.net.*; import java.nio.charset.*; import java.util.*;
[ "android.net", "java.nio", "java.util" ]
android.net; java.nio; java.util;
549,440
public static List<Object[]> getFieldDebugInfos(final String field, String clientId) { Map<String, List<Object[]>> debugInfo = getDebugInfoMap(clientId); List<Object[]> fieldDebugInfo = debugInfo.get(field); if (fieldDebugInfo == null) { // no field debug-infos yet, create them and store it in the Map fieldDebugInfo = new ArrayList<Object[]>(); debugInfo.put(field, fieldDebugInfo); } return fieldDebugInfo; }
static List<Object[]> function(final String field, String clientId) { Map<String, List<Object[]>> debugInfo = getDebugInfoMap(clientId); List<Object[]> fieldDebugInfo = debugInfo.get(field); if (fieldDebugInfo == null) { fieldDebugInfo = new ArrayList<Object[]>(); debugInfo.put(field, fieldDebugInfo); } return fieldDebugInfo; }
/** * Returns the field's debug-infos from the component's debug-info Map. * ATTENTION: this method is duplicate in UIInput. * @param field * @param clientId * @return */
Returns the field's debug-infos from the component's debug-info Map
getFieldDebugInfos
{ "repo_name": "kulinski/myfaces", "path": "impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DebugPhaseListener.java", "license": "apache-2.0", "size": 12288 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map" ]
import java.util.ArrayList; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,351,743
public String getIncomeClassName() { return new TaxIncomeClassValuesFinder().getKeyLabel(incomeClassCode); }
String function() { return new TaxIncomeClassValuesFinder().getKeyLabel(incomeClassCode); }
/** * Return select read-only label for income class * * @return */
Return select read-only label for income class
getIncomeClassName
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/businessobject/DisbursementVoucherNonResidentAlienTax.java", "license": "agpl-3.0", "size": 10920 }
[ "org.kuali.kfs.fp.businessobject.options.TaxIncomeClassValuesFinder" ]
import org.kuali.kfs.fp.businessobject.options.TaxIncomeClassValuesFinder;
import org.kuali.kfs.fp.businessobject.options.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,827,045
private SourceRoute<Identifier> getRoute(Identifier intermediate, Identifier dest) { SourceRoute route = routes.get(dest); if (route == null) { route = srFactory.getSourceRoute(localAddress,dest); routes.put(dest, route); } return route; }
SourceRoute<Identifier> function(Identifier intermediate, Identifier dest) { SourceRoute route = routes.get(dest); if (route == null) { route = srFactory.getSourceRoute(localAddress,dest); routes.put(dest, route); } return route; }
/** * Produces a route to the destination. A direct route if there is not * a cached multi-hop route. * * @param dest */
Produces a route to the destination. A direct route if there is not a cached multi-hop route
getRoute
{ "repo_name": "barnyard/pi", "path": "freepastry/src/org/mpisws/p2p/transport/sourceroute/manager/simple/SimpleSourceRouteStrategy.java", "license": "apache-2.0", "size": 5209 }
[ "org.mpisws.p2p.transport.sourceroute.SourceRoute" ]
import org.mpisws.p2p.transport.sourceroute.SourceRoute;
import org.mpisws.p2p.transport.sourceroute.*;
[ "org.mpisws.p2p" ]
org.mpisws.p2p;
177,339
public void execute(Input input, Output output, Tracker tracker) { String id = input.ask("Enter id of item that you want to update: "); String name = input.ask("Enter new name of item: "); String desc = input.ask("Enter new description of item: "); try { tracker.update(new Item(tracker.findById(id).getId(), name, desc)); } catch (NullPointerException npe) { System.out.println(String.format("Item with ID %s is not existing in tracker.", id)); } System.out.println(String.format("Item with ID %s updated", id)); } } class MenuTracker { private Input input; private Output output; private Tracker tracker; private List<UserAction> actions = new ArrayList<>(); MenuTracker(Input input, Output output, Tracker tracker) { this.input = input; this.output = output; this.tracker = tracker; }
void function(Input input, Output output, Tracker tracker) { String id = input.ask(STR); String name = input.ask(STR); String desc = input.ask(STR); try { tracker.update(new Item(tracker.findById(id).getId(), name, desc)); } catch (NullPointerException npe) { System.out.println(String.format(STR, id)); } System.out.println(String.format(STR, id)); } } class MenuTracker { private Input input; private Output output; private Tracker tracker; private List<UserAction> actions = new ArrayList<>(); MenuTracker(Input input, Output output, Tracker tracker) { this.input = input; this.output = output; this.tracker = tracker; }
/** * Execute update item. * @param input Input. * @param output Output. * @param tracker Tracker. */
Execute update item
execute
{ "repo_name": "enekein/nzenkin", "path": "chapter_002/src/main/java/ru/job4j/tracker/MenuTracker.java", "license": "apache-2.0", "size": 8284 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,267,212
// new Properties(properties) does not work. // TOO SLOW (especially on a cold container) return (Properties) properties.clone(); // alternative approach that breaks synchronisation into smaller blocks final Properties copy = new Properties(); copy.putAll(properties); return copy; }
final Properties copy = new Properties(); copy.putAll(properties); return copy; }
/** * Get all the properties. A defensive copy of the map is returned. * Is a relatively expensive method to use. * * @return defensive copy of the map is returned. */
Get all the properties. A defensive copy of the map is returned. Is a relatively expensive method to use
getProperties
{ "repo_name": "michaelsembwever/Sesat", "path": "site-spi/src/main/java/no/sesat/search/site/config/SiteConfiguration.java", "license": "lgpl-3.0", "size": 8363 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
141,214
@Override public TimeZone getTimeZone() { return null; }
TimeZone function() { return null; }
/** * Returns the currently used timezone. * * @return the current timezone * @see SimpleDateFormat#getTimeZone() */
Returns the currently used timezone
getTimeZone
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-weka/src/main/java/adams/ml/data/InstancesView.java", "license": "gpl-3.0", "size": 33044 }
[ "java.util.TimeZone" ]
import java.util.TimeZone;
import java.util.*;
[ "java.util" ]
java.util;
2,285,022
public void addLinkStateRequests(LsRequestPacket lsRequestPacket) { if (!linkStateRequests.contains(lsRequestPacket)) { linkStateRequests.add(lsRequestPacket); } }
void function(LsRequestPacket lsRequestPacket) { if (!linkStateRequests.contains(lsRequestPacket)) { linkStateRequests.add(lsRequestPacket); } }
/** * Adds link state request. * * @param lsRequestPacket ls request packet instance */
Adds link state request
addLinkStateRequests
{ "repo_name": "maheshraju-Huawei/actn", "path": "protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/ospfpacket/types/LsRequest.java", "license": "apache-2.0", "size": 7846 }
[ "org.onosproject.ospf.protocol.ospfpacket.subtype.LsRequestPacket" ]
import org.onosproject.ospf.protocol.ospfpacket.subtype.LsRequestPacket;
import org.onosproject.ospf.protocol.ospfpacket.subtype.*;
[ "org.onosproject.ospf" ]
org.onosproject.ospf;
1,385,216
public Dimension getPanelSize();
Dimension function();
/** * Get the size of the panels. * @return Dimension size of the panel */
Get the size of the panels
getPanelSize
{ "repo_name": "NationalSecurityAgency/ghidra", "path": "Ghidra/Framework/Docking/src/main/java/docking/wizard/PanelManager.java", "license": "apache-2.0", "size": 3146 }
[ "java.awt.Dimension" ]
import java.awt.Dimension;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,498,326
ComponentsXmlParser getXmlParser();
ComponentsXmlParser getXmlParser();
/** * Returns the XML parsing information for this bundle. * * @return the bundle XML parser */
Returns the XML parsing information for this bundle
getXmlParser
{ "repo_name": "MHTaleb/Encologim", "path": "lib/JasperReport/src/net/sf/jasperreports/engine/part/PartComponentsBundle.java", "license": "gpl-3.0", "size": 2106 }
[ "net.sf.jasperreports.engine.component.ComponentsXmlParser" ]
import net.sf.jasperreports.engine.component.ComponentsXmlParser;
import net.sf.jasperreports.engine.component.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
992,079
public static File getTableLayoutUpdateLock(KijiURI tableURI) { return new File(getTableDir(tableURI), "layout_update_lock"); } // ----------------------------------------------------------------------------------------------- private final ZooKeeperClient mZKClient; // ----------------------------------------------------------------------------------------------- public TableLayoutMonitor(ZooKeeperClient zkClient) throws KeeperException { this.mZKClient = zkClient; this.mZKClient.createNodeRecursively(ROOT_ZOOKEEPER_PATH); // ZooKeeperClient.retain() should be the last line of the constructor. this.mZKClient.retain(); }
static File function(KijiURI tableURI) { return new File(getTableDir(tableURI), STR); } private final ZooKeeperClient mZKClient; public TableLayoutMonitor(ZooKeeperClient zkClient) throws KeeperException { this.mZKClient = zkClient; this.mZKClient.createNodeRecursively(ROOT_ZOOKEEPER_PATH); this.mZKClient.retain(); }
/** * Reports the path of the ZooKeeper node for table layout update locking. * * @param tableURI Reports the path of the ZooKeeper node used to create locks for table layout * updates. * @return the path of the ZooKeeper node used to create locks for table layout updates. */
Reports the path of the ZooKeeper node for table layout update locking
getTableLayoutUpdateLock
{ "repo_name": "zenoss/kiji-schema", "path": "kiji-schema/src/main/java/org/kiji/schema/layout/impl/TableLayoutMonitor.java", "license": "apache-2.0", "size": 20667 }
[ "java.io.File", "org.apache.zookeeper.KeeperException", "org.kiji.schema.KijiURI" ]
import java.io.File; import org.apache.zookeeper.KeeperException; import org.kiji.schema.KijiURI;
import java.io.*; import org.apache.zookeeper.*; import org.kiji.schema.*;
[ "java.io", "org.apache.zookeeper", "org.kiji.schema" ]
java.io; org.apache.zookeeper; org.kiji.schema;
2,898,654
@InterfaceAudience.Private @Deprecated public static Credentials loadTokens(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
@InterfaceAudience.Private static Credentials function(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
/** * load job token from a file * @deprecated Use {@link Credentials#readTokenStorageFile} instead, * this method is included for compatibility against Hadoop-1. * @param conf * @throws IOException */
load job token from a file
loadTokens
{ "repo_name": "simbadzina/hadoop-fcfs", "path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/TokenCache.java", "license": "apache-2.0", "size": 8398 }
[ "java.io.IOException", "org.apache.hadoop.classification.InterfaceAudience", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.mapred.JobConf", "org.apache.hadoop.security.Credentials" ]
import java.io.IOException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.security.Credentials;
import java.io.*; import org.apache.hadoop.classification.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.mapred.*; import org.apache.hadoop.security.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,634,950
@Test public void testRemoveAddNewResources() throws URISyntaxException { List<ParsedBootOp> postExtensionOps = new ArrayList<>(); ConfigurationExtension instance = ConfigurationExtensionFactory.createConfigurationExtension(Paths.get(this.getClass().getResource("simple_delete_add.yml").toURI())); instance.processOperations(rootRegistration, postExtensionOps); assertFalse(postExtensionOps.isEmpty()); assertEquals(2, postExtensionOps.size()); assertEquals(ADD, postExtensionOps.get(0).operationName); assertEquals(PathAddress.pathAddress("system-property", "aaa"), postExtensionOps.get(0).address); assertTrue(postExtensionOps.get(0).operation.hasDefined("value")); assertEquals("foo", postExtensionOps.get(0).operation.get("value").asString()); assertEquals(ADD, postExtensionOps.get(1).operationName); assertEquals(PathAddress.pathAddress("system-property", "ccc"), postExtensionOps.get(1).address); assertTrue(postExtensionOps.get(1).operation.hasDefined("value")); assertEquals("test", postExtensionOps.get(1).operation.get("value").asString()); }
void function() throws URISyntaxException { List<ParsedBootOp> postExtensionOps = new ArrayList<>(); ConfigurationExtension instance = ConfigurationExtensionFactory.createConfigurationExtension(Paths.get(this.getClass().getResource(STR).toURI())); instance.processOperations(rootRegistration, postExtensionOps); assertFalse(postExtensionOps.isEmpty()); assertEquals(2, postExtensionOps.size()); assertEquals(ADD, postExtensionOps.get(0).operationName); assertEquals(PathAddress.pathAddress(STR, "aaa"), postExtensionOps.get(0).address); assertTrue(postExtensionOps.get(0).operation.hasDefined("value")); assertEquals("foo", postExtensionOps.get(0).operation.get("value").asString()); assertEquals(ADD, postExtensionOps.get(1).operationName); assertEquals(PathAddress.pathAddress(STR, "ccc"), postExtensionOps.get(1).address); assertTrue(postExtensionOps.get(1).operation.hasDefined("value")); assertEquals("test", postExtensionOps.get(1).operation.get("value").asString()); }
/** * Verify removing a resource and adding it again. * @throws URISyntaxException */
Verify removing a resource and adding it again
testRemoveAddNewResources
{ "repo_name": "yersan/wildfly-core", "path": "controller/src/test/java/org/jboss/as/controller/persistence/yaml/YamlConfigurationExtensionTest.java", "license": "lgpl-2.1", "size": 26672 }
[ "java.net.URISyntaxException", "java.nio.file.Paths", "java.util.ArrayList", "java.util.List", "org.jboss.as.controller.ParsedBootOp", "org.jboss.as.controller.PathAddress", "org.jboss.as.controller.persistence.ConfigurationExtension", "org.jboss.as.controller.persistence.ConfigurationExtensionFactory", "org.junit.Assert" ]
import java.net.URISyntaxException; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import org.jboss.as.controller.ParsedBootOp; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.persistence.ConfigurationExtension; import org.jboss.as.controller.persistence.ConfigurationExtensionFactory; import org.junit.Assert;
import java.net.*; import java.nio.file.*; import java.util.*; import org.jboss.as.controller.*; import org.jboss.as.controller.persistence.*; import org.junit.*;
[ "java.net", "java.nio", "java.util", "org.jboss.as", "org.junit" ]
java.net; java.nio; java.util; org.jboss.as; org.junit;
388,488
private Specie createSpecieObject(ResultSet rs, Family family) throws SQLException { Specie specie; specie = new Specie(); specie.setId(rs.getInt(ID_COLUMN)); specie.setName(rs.getString(NAME_COLUMN)); specie.setEnglishName(rs.getString(ENGLISH_NAME_COLUMN)); specie.setMinimumSize(rs.getString(MINIMUM_SIZE_COLUMN)); specie.setMaximumSize(rs.getString(MAXIMUM_SIZE_COLUMN)); specie.setFamily(family); return specie; }
Specie function(ResultSet rs, Family family) throws SQLException { Specie specie; specie = new Specie(); specie.setId(rs.getInt(ID_COLUMN)); specie.setName(rs.getString(NAME_COLUMN)); specie.setEnglishName(rs.getString(ENGLISH_NAME_COLUMN)); specie.setMinimumSize(rs.getString(MINIMUM_SIZE_COLUMN)); specie.setMaximumSize(rs.getString(MAXIMUM_SIZE_COLUMN)); specie.setFamily(family); return specie; }
/** * This method creates a <code>Specie</code> object with the data from * database, and with the given <code>Family object</code> * * @param rs * The <code>ResultSet<code> object to retrieve the data * * @return A new <code>Specie</code> object * * @throws SQLException If an error occur while retrieving data from result set */
This method creates a <code>Specie</code> object with the data from database, and with the given <code>Family object</code>
createSpecieObject
{ "repo_name": "BackupTheBerlios/arara-svn", "path": "core/trunk/src/main/java/net/indrix/arara/dao/SpecieDAO.java", "license": "gpl-2.0", "size": 20922 }
[ "java.sql.ResultSet", "java.sql.SQLException", "net.indrix.arara.vo.Family", "net.indrix.arara.vo.Specie" ]
import java.sql.ResultSet; import java.sql.SQLException; import net.indrix.arara.vo.Family; import net.indrix.arara.vo.Specie;
import java.sql.*; import net.indrix.arara.vo.*;
[ "java.sql", "net.indrix.arara" ]
java.sql; net.indrix.arara;
541,681
public Period getInvalid() { return getInvalidWithServiceResponseAsync().toBlocking().single().body(); }
Period function() { return getInvalidWithServiceResponseAsync().toBlocking().single().body(); }
/** * Get an invalid duration value. * * @return the Period object if successful. */
Get an invalid duration value
getInvalid
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java", "license": "mit", "size": 12592 }
[ "org.joda.time.Period" ]
import org.joda.time.Period;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
844,834
public default GraphTraversal<S, E> is(final Object value) { return this.is(value instanceof P ? (P<E>) value : P.eq((E) value)); }
default GraphTraversal<S, E> function(final Object value) { return this.is(value instanceof P ? (P<E>) value : P.eq((E) value)); }
/** * Filter the <code>E</code> object if it is not {@link P#eq} to the provided value. * * @param value the value that the object must equal. * @return the traversal with an appended {@link IsStep}. */
Filter the <code>E</code> object if it is not <code>P#eq</code> to the provided value
is
{ "repo_name": "rmagen/incubator-tinkerpop", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java", "license": "apache-2.0", "size": 56488 }
[ "org.apache.tinkerpop.gremlin.process.traversal.P" ]
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.*;
[ "org.apache.tinkerpop" ]
org.apache.tinkerpop;
1,089,462
private void parse(final MarkupDocument doc, final String repositoryName, final String commitId, MarkupLanguage lang) { StringWriter writer = new StringWriter(); HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer) {
void function(final MarkupDocument doc, final String repositoryName, final String commitId, MarkupLanguage lang) { StringWriter writer = new StringWriter(); HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer) {
/** * Parses the markup using the specified markup language * * @param doc * @param repositoryName * @param commitId * @param lang */
Parses the markup using the specified markup language
parse
{ "repo_name": "korealerts1/gitblit", "path": "src/main/java/com/gitblit/wicket/MarkupProcessor.java", "license": "apache-2.0", "size": 15708 }
[ "java.io.StringWriter", "org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder", "org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage" ]
import java.io.StringWriter; import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder; import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import java.io.*; import org.eclipse.mylyn.wikitext.core.parser.builder.*; import org.eclipse.mylyn.wikitext.core.parser.markup.*;
[ "java.io", "org.eclipse.mylyn" ]
java.io; org.eclipse.mylyn;
2,394,948
objCDF.getRecord(strId).propName; objCDF.getRecordNode(strId).getAttribute("propName"); * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @return the object representation of a CDF node or <code>null</code> if no such record found. */ public jsx3.lang.Object getRecord(String strRecordId) { String extension = "getRecord(\"" + strRecordId + "\")."; try { java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.lang.Object.class.getName()); } } /** * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data. The following two lines of code evaluate to the same value:
objCDF.getRecord(strId).propName; objCDF.getRecordNode(strId).getAttribute(STR); * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @return the object representation of a CDF node or <code>null</code> if no such record found. */ jsx3.lang.Object function(String strRecordId) { String extension = STRSTR\")."; try { java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException(STR + jsx3.lang.Object.class.getName()); } } /** * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data. The following two lines of code evaluate to the same value:
/** * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data. The following two lines of code evaluate to the same value: objCDF.getRecord(strId).propName; objCDF.getRecordNode(strId).getAttribute("propName"); * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @return the object representation of a CDF node or <code>null</code> if no such record found. */
Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this
getRecord
{ "repo_name": "burris/dwr", "path": "ui/gi/generated/java/jsx3/gui/Table.java", "license": "apache-2.0", "size": 111945 }
[ "org.directwebremoting.io.Context" ]
import org.directwebremoting.io.Context;
import org.directwebremoting.io.*;
[ "org.directwebremoting.io" ]
org.directwebremoting.io;
258,428
public User createUser(String userName) { if (getUsers().containsKey(userName.toLowerCase())) { return null; } User newUser = new User(this, userName); newUser.setGroup(groups.getDefaultGroup(), false); addUser(newUser); setUsersChanged(true); return newUser; }
User function(String userName) { if (getUsers().containsKey(userName.toLowerCase())) { return null; } User newUser = new User(this, userName); newUser.setGroup(groups.getDefaultGroup(), false); addUser(newUser); setUsersChanged(true); return newUser; }
/** * Creates a new User with the given name and adds it to this holder. * * @param userName the username you want * @return null if user already exists. or new User */
Creates a new User with the given name and adds it to this holder
createUser
{ "repo_name": "alistarle/Essentials-Alykraft", "path": "EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java", "license": "gpl-3.0", "size": 37508 }
[ "org.anjocaido.groupmanager.data.User" ]
import org.anjocaido.groupmanager.data.User;
import org.anjocaido.groupmanager.data.*;
[ "org.anjocaido.groupmanager" ]
org.anjocaido.groupmanager;
2,777,218
public void setNwkPdpDeactRetryN3395Value(YangUInt8 nwkPdpDeactRetryN3395Value) throws JNCException { setLeafValue(Epc.NAMESPACE, "nwk-pdp-deact-retry-n3395", nwkPdpDeactRetryN3395Value, childrenNames()); }
void function(YangUInt8 nwkPdpDeactRetryN3395Value) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, nwkPdpDeactRetryN3395Value, childrenNames()); }
/** * Sets the value for child leaf "nwk-pdp-deact-retry-n3395", * using instance of generated typedef class. * @param nwkPdpDeactRetryN3395Value The value to set. * @param nwkPdpDeactRetryN3395Value used during instantiation. */
Sets the value for child leaf "nwk-pdp-deact-retry-n3395", using instance of generated typedef class
setNwkPdpDeactRetryN3395Value
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/interface_/nas/MmeNasSgsnSm.java", "license": "apache-2.0", "size": 38827 }
[ "com.tailf.jnc.YangUInt8" ]
import com.tailf.jnc.YangUInt8;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
562,136
@Test public void allowsNonTransientFields() throws Exception { final String file = "AllowNonTransientFields.java"; new PMDAssert( file, Matchers.is(true), Matchers.not( Matchers.containsString( "Found non-transient, non-static member." ) ) ).validate(); }
void function() throws Exception { final String file = STR; new PMDAssert( file, Matchers.is(true), Matchers.not( Matchers.containsString( STR ) ) ).validate(); }
/** * PMDValidator can allow non-static, non-transient fields. * @throws Exception If something wrong happens inside. */
PMDValidator can allow non-static, non-transient fields
allowsNonTransientFields
{ "repo_name": "vkuchyn/qulice", "path": "qulice-pmd/src/test/java/com/qulice/pmd/PMDValidatorTest.java", "license": "bsd-3-clause", "size": 19126 }
[ "org.hamcrest.Matchers" ]
import org.hamcrest.Matchers;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
474,569
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_IMPORT: try { startActivityForResult(CONTACT_IMPORT_INTENT, CONTACTS_PICKER_CODE); } catch (ActivityNotFoundException e) { Xlog.d(LOG_TAG, e.toString()); } return true; case MENU_DELETE: deleteSelected(); return true; case android.R.id.home: finish(); return true; default: break; } return super.onOptionsItemSelected(item); }
boolean function(MenuItem item) { switch (item.getItemId()) { case MENU_IMPORT: try { startActivityForResult(CONTACT_IMPORT_INTENT, CONTACTS_PICKER_CODE); } catch (ActivityNotFoundException e) { Xlog.d(LOG_TAG, e.toString()); } return true; case MENU_DELETE: deleteSelected(); return true; case android.R.id.home: finish(); return true; default: break; } return super.onOptionsItemSelected(item); }
/** * Overridden to allow for handling of delete and import. */
Overridden to allow for handling of delete and import
onOptionsItemSelected
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Phone/src/com/android/phone/EditFdnContactScreen.java", "license": "gpl-2.0", "size": 27522 }
[ "android.content.ActivityNotFoundException", "android.view.MenuItem", "com.mediatek.xlog.Xlog" ]
import android.content.ActivityNotFoundException; import android.view.MenuItem; import com.mediatek.xlog.Xlog;
import android.content.*; import android.view.*; import com.mediatek.xlog.*;
[ "android.content", "android.view", "com.mediatek.xlog" ]
android.content; android.view; com.mediatek.xlog;
2,358,623
public List<BType> getBuilderList() { if (externalBuilderList == null) { externalBuilderList = new BuilderExternalList<MType, BType, IType>(this); } return externalBuilderList; }
List<BType> function() { if (externalBuilderList == null) { externalBuilderList = new BuilderExternalList<MType, BType, IType>(this); } return externalBuilderList; }
/** * Gets a view of the builder as a list of builders. This returned list is * live and will reflect any changes to the underlying builder. * * @return the builders in the list */
Gets a view of the builder as a list of builders. This returned list is live and will reflect any changes to the underlying builder
getBuilderList
{ "repo_name": "CPB9/mcc", "path": "thirdparty/protobuf/java/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java", "license": "mpl-2.0", "size": 22781 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,299,172
ExternalResourceName getLocation(ModuleComponentArtifactMetaData artifact);
ExternalResourceName getLocation(ModuleComponentArtifactMetaData artifact);
/** * Returns the path for the given artifact. */
Returns the path for the given artifact
getLocation
{ "repo_name": "cams7/gradle-samples", "path": "plugin/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/resolver/ResourcePattern.java", "license": "gpl-2.0", "size": 1862 }
[ "org.gradle.internal.component.external.model.ModuleComponentArtifactMetaData", "org.gradle.internal.resource.ExternalResourceName" ]
import org.gradle.internal.component.external.model.ModuleComponentArtifactMetaData; import org.gradle.internal.resource.ExternalResourceName;
import org.gradle.internal.component.external.model.*; import org.gradle.internal.resource.*;
[ "org.gradle.internal" ]
org.gradle.internal;
1,194,843
Collection<Worker> markWorkersLazy(Predicate<ImmutableWorkerInfo> isLazyWorker, int maxWorkers);
Collection<Worker> markWorkersLazy(Predicate<ImmutableWorkerInfo> isLazyWorker, int maxWorkers);
/** * Check which workers can be marked as lazy */
Check which workers can be marked as lazy
markWorkersLazy
{ "repo_name": "nishantmonu51/druid", "path": "indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunner.java", "license": "apache-2.0", "size": 1750 }
[ "com.google.common.base.Predicate", "java.util.Collection", "org.apache.druid.indexing.worker.Worker" ]
import com.google.common.base.Predicate; import java.util.Collection; import org.apache.druid.indexing.worker.Worker;
import com.google.common.base.*; import java.util.*; import org.apache.druid.indexing.worker.*;
[ "com.google.common", "java.util", "org.apache.druid" ]
com.google.common; java.util; org.apache.druid;
1,686,111
public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action) throws IOException { return dfs.rollingUpgrade(action); }
RollingUpgradeInfo function(RollingUpgradeAction action) throws IOException { return dfs.rollingUpgrade(action); }
/** * Rolling upgrade: prepare/finalize/query. */
Rolling upgrade: prepare/finalize/query
rollingUpgrade
{ "repo_name": "steveloughran/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java", "license": "apache-2.0", "size": 130691 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.protocol.HdfsConstants", "org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo" ]
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
794,346
private void roleComboChanged() { changeCombo(() -> { final KeyNamePair role = roleCombo.getSelectedItem(); if (role == null) { return; } log.info("role changed: {}", role); final Set<KeyNamePair> clients = m_login.setRoleAndGetClients(role); clientCombo.setModel(ListComboBoxModel.ofNullable(clients)); orgCombo.setModel(new ListComboBoxModel<>()); // No Clients if (clients == null || clients.isEmpty()) { statusBar.setStatusLine(txt_RoleError, true); return; } // default final KeyNamePair defaultClient = findDefaultClient(clients); if (defaultClient != null) { clientCombo.setSelectedItem(defaultClient); } }); // clientComboChanged(); }
void function() { changeCombo(() -> { final KeyNamePair role = roleCombo.getSelectedItem(); if (role == null) { return; } log.info(STR, role); final Set<KeyNamePair> clients = m_login.setRoleAndGetClients(role); clientCombo.setModel(ListComboBoxModel.ofNullable(clients)); orgCombo.setModel(new ListComboBoxModel<>()); if (clients == null clients.isEmpty()) { statusBar.setStatusLine(txt_RoleError, true); return; } final KeyNamePair defaultClient = findDefaultClient(clients); if (defaultClient != null) { clientCombo.setSelectedItem(defaultClient); } }); }
/** * Role changed - fill Client List */
Role changed - fill Client List
roleComboChanged
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/client/src/main/java-legacy/org/compiere/apps/ALogin.java", "license": "gpl-2.0", "size": 38228 }
[ "java.util.Set", "org.compiere.swing.ListComboBoxModel", "org.compiere.util.KeyNamePair" ]
import java.util.Set; import org.compiere.swing.ListComboBoxModel; import org.compiere.util.KeyNamePair;
import java.util.*; import org.compiere.swing.*; import org.compiere.util.*;
[ "java.util", "org.compiere.swing", "org.compiere.util" ]
java.util; org.compiere.swing; org.compiere.util;
1,691,222
public boolean isOnSameTeam(Entity entityIn) { if (super.isOnSameTeam(entityIn)) { return true; } else if (entityIn instanceof EntityLivingBase && ((EntityLivingBase)entityIn).getCreatureAttribute() == EnumCreatureAttribute.ILLAGER) { return this.getTeam() == null && entityIn.getTeam() == null; } else { return false; } }
boolean function(Entity entityIn) { if (super.isOnSameTeam(entityIn)) { return true; } else if (entityIn instanceof EntityLivingBase && ((EntityLivingBase)entityIn).getCreatureAttribute() == EnumCreatureAttribute.ILLAGER) { return this.getTeam() == null && entityIn.getTeam() == null; } else { return false; } }
/** * Returns whether this Entity is on the same team as the given Entity. */
Returns whether this Entity is on the same team as the given Entity
isOnSameTeam
{ "repo_name": "Severed-Infinity/technium", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/monster/EntityIllusionIllager.java", "license": "gpl-3.0", "size": 13294 }
[ "net.minecraft.entity.Entity", "net.minecraft.entity.EntityLivingBase", "net.minecraft.entity.EnumCreatureAttribute" ]
import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
2,543,241
static SchedulerException ofError(ErrorInfo errorInfo, SkyKey failedValue) { Preconditions.checkNotNull(errorInfo); return new SchedulerException(errorInfo.getException(), errorInfo, failedValue); }
static SchedulerException ofError(ErrorInfo errorInfo, SkyKey failedValue) { Preconditions.checkNotNull(errorInfo); return new SchedulerException(errorInfo.getException(), errorInfo, failedValue); }
/** * Returns a SchedulerException wrapping an expected error, e.g. an error describing an expected * build failure when trying to evaluate the given value, that should cause Skyframe to produce * useful error information to the user. */
Returns a SchedulerException wrapping an expected error, e.g. an error describing an expected build failure when trying to evaluate the given value, that should cause Skyframe to produce useful error information to the user
ofError
{ "repo_name": "vt09/bazel", "path": "src/main/java/com/google/devtools/build/skyframe/Scheduler.java", "license": "apache-2.0", "size": 2738 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,455,829
public void readStartElement(long startTag, TreeMap<String, String> attributes) throws ContentDecodingException { peekTag(BinaryXMLCodec.XML_DTAG, startTag); advanceParser(); }
void function(long startTag, TreeMap<String, String> attributes) throws ContentDecodingException { peekTag(BinaryXMLCodec.XML_DTAG, startTag); advanceParser(); }
/** * Read the current DOM element and ensure it matches startTag, * otherwise throw ContentDecodingException. Advances parser. * * There are no attributes in the Wire format, so never do anything * with @attributes. */
Read the current DOM element and ensure it matches startTag, otherwise throw ContentDecodingException. Advances parser. There are no attributes in the Wire format, so never do anything with @attributes
readStartElement
{ "repo_name": "ebollens/ccnmp", "path": "javasrc/src/org/ccnx/ccn/impl/encoding/BinaryXMLDecoder.java", "license": "lgpl-2.1", "size": 21355 }
[ "java.util.TreeMap", "org.ccnx.ccn.io.content.ContentDecodingException" ]
import java.util.TreeMap; import org.ccnx.ccn.io.content.ContentDecodingException;
import java.util.*; import org.ccnx.ccn.io.content.*;
[ "java.util", "org.ccnx.ccn" ]
java.util; org.ccnx.ccn;
942,526
public void groupStarted( final ReportEvent event ) { if ( FunctionUtilities.isDefinedGroup( getGroup(), event ) == false ) { return; } final StringBuilder targetBuffer = new StringBuilder(); final String prefix = getAnchorPrefix(); targetBuffer.append( prefix ); targetBuffer.append( getGroup() ); targetBuffer.append( "%3D" ); targetBuffer.append( count ); anchor = targetBuffer.toString(); }
void function( final ReportEvent event ) { if ( FunctionUtilities.isDefinedGroup( getGroup(), event ) == false ) { return; } final StringBuilder targetBuffer = new StringBuilder(); final String prefix = getAnchorPrefix(); targetBuffer.append( prefix ); targetBuffer.append( getGroup() ); targetBuffer.append( "%3D" ); targetBuffer.append( count ); anchor = targetBuffer.toString(); }
/** * Receives notification that a group has started. * * @param event * the event. */
Receives notification that a group has started
groupStarted
{ "repo_name": "EgorZhuk/pentaho-reporting", "path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/function/CreateGroupAnchorsFunction.java", "license": "lgpl-2.1", "size": 4456 }
[ "org.pentaho.reporting.engine.classic.core.event.ReportEvent" ]
import org.pentaho.reporting.engine.classic.core.event.ReportEvent;
import org.pentaho.reporting.engine.classic.core.event.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
2,824,684
public Container getInventory() { return inventory; }
Container function() { return inventory; }
/** * Gets the inventory. * @return The inventory. */
Gets the inventory
getInventory
{ "repo_name": "FurryHead/Server", "path": "src/org/hyperion/rs2/model/Player.java", "license": "mit", "size": 16947 }
[ "org.hyperion.rs2.model.container.Container" ]
import org.hyperion.rs2.model.container.Container;
import org.hyperion.rs2.model.container.*;
[ "org.hyperion.rs2" ]
org.hyperion.rs2;
660,772
private AggregatedMicroserviceRequestsDto getOverallRequestsByCallee() { if (overallRequest == null) { overallRequest = feedbackHandlerClient.requestsByCalleeOverall(project, aggregationInterval, timeRangeFrom, timeRangeTo); } return overallRequest; } /** * Returns an application * * @return {@link ApplicationDto}
AggregatedMicroserviceRequestsDto function() { if (overallRequest == null) { overallRequest = feedbackHandlerClient.requestsByCalleeOverall(project, aggregationInterval, timeRangeFrom, timeRangeTo); } return overallRequest; } /** * Returns an application * * @return {@link ApplicationDto}
/** * Overall request statistics of the current project/service * * @return AggregatedMicroserviceRequestsDto with min, avg and max */
Overall request statistics of the current project/service
getOverallRequestsByCallee
{ "repo_name": "harinigunabalan/PerformanceHat", "path": "cw-feedback-eclipse-costs/src/eu/cloudwave/wp5/feedback/eclipse/costs/core/builders/participants/MicroserviceClientInvocationParticipant.java", "license": "apache-2.0", "size": 10670 }
[ "eu.cloudwave.wp5.common.dto.ApplicationDto", "eu.cloudwave.wp5.common.dto.costs.AggregatedMicroserviceRequestsDto" ]
import eu.cloudwave.wp5.common.dto.ApplicationDto; import eu.cloudwave.wp5.common.dto.costs.AggregatedMicroserviceRequestsDto;
import eu.cloudwave.wp5.common.dto.*; import eu.cloudwave.wp5.common.dto.costs.*;
[ "eu.cloudwave.wp5" ]
eu.cloudwave.wp5;
1,040,061
public boolean isLaterThan(int allowableLateSeconds) { // Note: casting allowable seconds to a long since if use MAX_INTEGER // and then multiple by Time.MS_PER_SEC could end up exceeding what // an integer can handle. return -temporalDifferenceMsec > (long) allowableLateSeconds * Time.MS_PER_SEC; }
boolean function(int allowableLateSeconds) { return -temporalDifferenceMsec > (long) allowableLateSeconds * Time.MS_PER_SEC; }
/** * Returns true if vehicle is later than allowableLateSeconds * * @param allowableLateSeconds * @return */
Returns true if vehicle is later than allowableLateSeconds
isLaterThan
{ "repo_name": "goeuropa/transitime", "path": "transitime/src/main/java/org/transitime/core/TemporalDifference.java", "license": "gpl-3.0", "size": 7991 }
[ "org.transitime.utils.Time" ]
import org.transitime.utils.Time;
import org.transitime.utils.*;
[ "org.transitime.utils" ]
org.transitime.utils;
2,838,347
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, String emailAddress) throws RemoteException { UserServiceInterface userService = adManagerServices.get(session, UserServiceInterface.class); // Create a statement to select users. StatementBuilder statementBuilder = new StatementBuilder() .where("email = :email") .orderBy("id ASC") .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .withBindVariableValue("email", emailAddress); // Retrieve a small amount of users at a time, paging through // until all users have been retrieved. int totalResultSetSize = 0; do { UserPage page = userService.getUsersByStatement(statementBuilder.toStatement()); if (page.getResults() != null) { // Print out some information for each user. totalResultSetSize = page.getTotalResultSetSize(); int i = page.getStartIndex(); for (User user : page.getResults()) { System.out.printf( "%d) User with ID %d and name '%s' was found.%n", i++, user.getId(), user.getName()); } } statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.getOffset() < totalResultSetSize); System.out.printf("Number of results found: %d%n", totalResultSetSize); }
static void function( AdManagerServices adManagerServices, AdManagerSession session, String emailAddress) throws RemoteException { UserServiceInterface userService = adManagerServices.get(session, UserServiceInterface.class); StatementBuilder statementBuilder = new StatementBuilder() .where(STR) .orderBy(STR) .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .withBindVariableValue("email", emailAddress); int totalResultSetSize = 0; do { UserPage page = userService.getUsersByStatement(statementBuilder.toStatement()); if (page.getResults() != null) { totalResultSetSize = page.getTotalResultSetSize(); int i = page.getStartIndex(); for (User user : page.getResults()) { System.out.printf( STR, i++, user.getId(), user.getName()); } } statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.getOffset() < totalResultSetSize); System.out.printf(STR, totalResultSetSize); }
/** * Runs the example. * * @param adManagerServices the services factory. * @param session the session. * @param emailAddress the email address. * @throws ApiException if the API request failed with one or more service errors. * @throws RemoteException if the API request failed due to other errors. */
Runs the example
runExample
{ "repo_name": "googleads/googleads-java-lib", "path": "examples/admanager_axis/src/main/java/admanager/axis/v202202/userservice/GetUserByEmailAddress.java", "license": "apache-2.0", "size": 6600 }
[ "com.google.api.ads.admanager.axis.factory.AdManagerServices", "com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder", "com.google.api.ads.admanager.axis.v202202.User", "com.google.api.ads.admanager.axis.v202202.UserPage", "com.google.api.ads.admanager.axis.v202202.UserServiceInterface", "com.google.api.ads.admanager.lib.client.AdManagerSession", "java.rmi.RemoteException" ]
import com.google.api.ads.admanager.axis.factory.AdManagerServices; import com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder; import com.google.api.ads.admanager.axis.v202202.User; import com.google.api.ads.admanager.axis.v202202.UserPage; import com.google.api.ads.admanager.axis.v202202.UserServiceInterface; import com.google.api.ads.admanager.lib.client.AdManagerSession; import java.rmi.RemoteException;
import com.google.api.ads.admanager.axis.factory.*; import com.google.api.ads.admanager.axis.utils.v202202.*; import com.google.api.ads.admanager.axis.v202202.*; import com.google.api.ads.admanager.lib.client.*; import java.rmi.*;
[ "com.google.api", "java.rmi" ]
com.google.api; java.rmi;
956,478
public List<RemoteHint> getRemoteHints() { return this.remoteHints; }
List<RemoteHint> function() { return this.remoteHints; }
/** * Return all the remote hints that have been read so far by the model * this corresponds to all log lines containing 'PA_REMOTE_CONNECTION' that * were fetched in logs * If logs for the task were not fetched, remote hints won't be stored here * * @return all remote hints read so far */
Return all the remote hints that have been read so far by the model this corresponds to all log lines containing 'PA_REMOTE_CONNECTION' that were fetched in logs If logs for the task were not fetched, remote hints won't be stored here
getRemoteHints
{ "repo_name": "lpellegr/scheduling-portal", "path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/client/model/TasksModel.java", "license": "agpl-3.0", "size": 7128 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,005,912
@Test public void testCloning() throws CloneNotSupportedException { MeanAndStandardDeviation m1 = new MeanAndStandardDeviation(1.2, 3.4); assertFalse(m1 instanceof Cloneable); }
void function() throws CloneNotSupportedException { MeanAndStandardDeviation m1 = new MeanAndStandardDeviation(1.2, 3.4); assertFalse(m1 instanceof Cloneable); }
/** * Immutable class - should not be cloneable. */
Immutable class - should not be cloneable
testCloning
{ "repo_name": "akardapolov/ASH-Viewer", "path": "jfreechart-fse/src/test/java/org/jfree/data/statistics/MeanAndStandardDeviationTest.java", "license": "gpl-3.0", "size": 3765 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,504,882
protected String getValueAsString() { if (itemList.size() == 0) { return ""; } StringBuffer sb = new StringBuffer( itemList.size() * 8 ); Iterator i = itemList.iterator(); if (i.hasNext()) { sb.append(((SVGItem) i.next()).getValueAsString()); } while (i.hasNext()) { sb.append(getItemSeparator()); sb.append(((SVGItem) i.next()).getValueAsString()); } return sb.toString(); }
String function() { if (itemList.size() == 0) { return ""; } StringBuffer sb = new StringBuffer( itemList.size() * 8 ); Iterator i = itemList.iterator(); if (i.hasNext()) { sb.append(((SVGItem) i.next()).getValueAsString()); } while (i.hasNext()) { sb.append(getItemSeparator()); sb.append(((SVGItem) i.next()).getValueAsString()); } return sb.toString(); }
/** * Returns the value of the DOM attribute containing the point list. */
Returns the value of the DOM attribute containing the point list
getValueAsString
{ "repo_name": "Groostav/CMPT880-term-project", "path": "intruder/benchs/batik/batik-1.7/sources/org/apache/batik/dom/svg/SVGOMAnimatedNumberList.java", "license": "apache-2.0", "size": 14268 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,414,784
public void removeUser(User user) { if (!(this == user.getDatabase())) { throw new IllegalArgumentException ("User not associated with this database"); } if (log.isTraceEnabled()) { log.trace("Removing user '" + user.getUsername() + "'"); } synchronized (users) { users.remove(user.getUsername()); } }
void function(User user) { if (!(this == user.getDatabase())) { throw new IllegalArgumentException (STR); } if (log.isTraceEnabled()) { log.trace(STR + user.getUsername() + "'"); } synchronized (users) { users.remove(user.getUsername()); } }
/** * Remove the specified {@link User} from this database. * * @param user User to be removed * * @exception IllegalArgumentException if the specified user is not * associated with this database */
Remove the specified <code>User</code> from this database
removeUser
{ "repo_name": "davcamer/clients", "path": "projects-for-testing/struts/apps/faces-example2/src/main/java/org/apache/struts/webapp/example2/memory/MemoryUserDatabase.java", "license": "apache-2.0", "size": 11909 }
[ "org.apache.struts.webapp.example2.User" ]
import org.apache.struts.webapp.example2.User;
import org.apache.struts.webapp.example2.*;
[ "org.apache.struts" ]
org.apache.struts;
1,124,545
public static void storeGeofenceEnabled(Context context, boolean enable) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(PREFERENCES_GEOFENCE_ENABLED, enable); editor.apply(); }
static void function(Context context, boolean enable) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(PREFERENCES_GEOFENCE_ENABLED, enable); editor.apply(); }
/** * Store if geofencing triggers will show a notification in app preferences. */
Store if geofencing triggers will show a notification in app preferences
storeGeofenceEnabled
{ "repo_name": "Dinvan/TouristAttractions", "path": "Shared/src/main/java/com/example/android/xyztouristattractions/common/Utils.java", "license": "apache-2.0", "size": 8681 }
[ "android.content.Context", "android.content.SharedPreferences", "android.preference.PreferenceManager" ]
import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager;
import android.content.*; import android.preference.*;
[ "android.content", "android.preference" ]
android.content; android.preference;
2,476,171
private void parseUIC4Tags(long uic4offset) throws IOException { long saveLoc = in.getFilePointer(); in.seek(uic4offset); if (in.getFilePointer() + 2 >= in.length()) return; tempZ = 0d; validZ = false; short id = in.readShort(); while (id != 0) { switch (id) { case 28: readStagePositions(); break; case 29: readRationals( new String[] {"cameraXChipOffset", "cameraYChipOffset"}); break; case 37: readStageLabels(); break; case 40: readRationals(new String[] {"UIC4 absoluteZ"}); break; case 41: readAbsoluteZValid(); break; case 46: in.skipBytes(mmPlanes * 8); // TODO break; default: in.skipBytes(4); } id = in.readShort(); } in.seek(saveLoc); if (validZ) zStart = tempZ; }
void function(long uic4offset) throws IOException { long saveLoc = in.getFilePointer(); in.seek(uic4offset); if (in.getFilePointer() + 2 >= in.length()) return; tempZ = 0d; validZ = false; short id = in.readShort(); while (id != 0) { switch (id) { case 28: readStagePositions(); break; case 29: readRationals( new String[] {STR, STR}); break; case 37: readStageLabels(); break; case 40: readRationals(new String[] {STR}); break; case 41: readAbsoluteZValid(); break; case 46: in.skipBytes(mmPlanes * 8); break; default: in.skipBytes(4); } id = in.readShort(); } in.seek(saveLoc); if (validZ) zStart = tempZ; }
/** * UIC4 metadata parser * * UIC4 Table contains per-plane blocks of metadata * stage X/Y positions, * camera chip offsets, * stage labels... * @param long uic4offset: offset of UIC4 table (not tiff-compliant) * @throws IOException */
UIC4 metadata parser UIC4 Table contains per-plane blocks of metadata stage X/Y positions, camera chip offsets, stage labels..
parseUIC4Tags
{ "repo_name": "mtbc/bioformats", "path": "components/bio-formats/src/loci/formats/in/MetamorphReader.java", "license": "gpl-2.0", "size": 58310 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,994,510
public void adjustControlExtrema(ScentedKeywordFilterDataset data) { if (options != null) { double min = data.getMin(); double max = data.getMax(); // Set range slider values. if (options.useRangeSlider()) { rangeSlider.setMin(min); rangeSlider.setMax(max); } // Set single slider values. else { slider.setMin(min); slider.setMax(max); } // Adjust major tick unit. rangeSlider.setMajorTickUnit( (max - min) / (options.getMajorTickCount() - 1)); // Update text values. min_spinner.setNumber(new BigDecimal(min)); max_spinner.setNumber(new BigDecimal(max)); } isAdjustedToExtrema = true; }
void function(ScentedKeywordFilterDataset data) { if (options != null) { double min = data.getMin(); double max = data.getMax(); if (options.useRangeSlider()) { rangeSlider.setMin(min); rangeSlider.setMax(max); } else { slider.setMin(min); slider.setMax(max); } rangeSlider.setMajorTickUnit( (max - min) / (options.getMajorTickCount() - 1)); min_spinner.setNumber(new BigDecimal(min)); max_spinner.setNumber(new BigDecimal(max)); } isAdjustedToExtrema = true; }
/** * Adjusts control extrma for scented keyword filter. * @param data */
Adjusts control extrma for scented keyword filter
adjustControlExtrema
{ "repo_name": "LDAforVisProject/VKPSA", "path": "src/view/components/scentedFilter/scentedKeywordFilter/ScentedKeywordFilter.java", "license": "mit", "size": 10846 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,831,372
public void setCacheManager(CacheManager cacheManager) { this._cacheManager = cacheManager; }
void function(CacheManager cacheManager) { this._cacheManager = cacheManager; }
/** * Sets the cache manager. * @param cacheManager the new value of the property */
Sets the cache manager
setCacheManager
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/source/ConventionSourceComponentFactory.java", "license": "apache-2.0", "size": 15778 }
[ "net.sf.ehcache.CacheManager" ]
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.*;
[ "net.sf.ehcache" ]
net.sf.ehcache;
2,579,190
public boolean write( OutputStream zos, String dirname, String name ) { if ( mModel == null ) return false; if ( ! TDFile.makeMSdir( dirname ) ) { TDLog.Error("mkdir " + dirname + " error"); return false; } // TDLog.v( "mkdir created MSdir " + dirname ); ArrayList< String > files = new ArrayList<>(); String pathname = dirname + "/" + name + ".gltf"; // full pathname String subdir = "c3export/" + name; // TDLog.v( "filepath " + pathname + " subdir " + subdir ); try { // FileOutputStream dos = new FileOutputStream( filepath ); files.add( name + ".gltf" ); TDPath.checkPath( pathname ); FileWriter fw = TDFile.getFileWriter( pathname ); // DistoX-SAF PrintWriter pw = new PrintWriter( fw ); doExport( pw, dirname, subdir, files ); pw.flush(); fw.close(); // compress files in the data output stream (new Archiver()).compressFiles( zos, subdir, files ); } catch ( IOException e ) { TDLog.Error("TopoGL glTF export error " + e ); for ( StackTraceElement ste : e.getStackTrace() ) TDLog.Error(ste.toString() ); return false; } finally { TDFile.deleteMSdir( dirname ); // delete temporary dir } return true; } private class MinMax { float xmin, xmax; float ymin, ymax; float zmin, zmax; MinMax() { xmin = xmax = ymin = ymax = zmin = zmax = 0; }
boolean function( OutputStream zos, String dirname, String name ) { if ( mModel == null ) return false; if ( ! TDFile.makeMSdir( dirname ) ) { TDLog.Error(STR + dirname + STR); return false; } ArrayList< String > files = new ArrayList<>(); String pathname = dirname + "/" + name + ".gltf"; String subdir = STR + name; try { files.add( name + ".gltf" ); TDPath.checkPath( pathname ); FileWriter fw = TDFile.getFileWriter( pathname ); PrintWriter pw = new PrintWriter( fw ); doExport( pw, dirname, subdir, files ); pw.flush(); fw.close(); (new Archiver()).compressFiles( zos, subdir, files ); } catch ( IOException e ) { TDLog.Error(STR + e ); for ( StackTraceElement ste : e.getStackTrace() ) TDLog.Error(ste.toString() ); return false; } finally { TDFile.deleteMSdir( dirname ); } return true; } private class MinMax { float xmin, xmax; float ymin, ymax; float zmin, zmax; MinMax() { xmin = xmax = ymin = ymax = zmin = zmax = 0; }
/** export model to a file * @param zos zip output stream * @param dirname dir pathname * @param name survey name (glTF filename = name.gltf) * @return true if success */
export model to a file
write
{ "repo_name": "marcocorvi/topodroid", "path": "src/com/topodroid/c3out/ExportGltf.java", "license": "gpl-3.0", "size": 35803 }
[ "com.topodroid.DistoX", "com.topodroid.utils.TDFile", "com.topodroid.utils.TDLog", "java.io.FileWriter", "java.io.IOException", "java.io.OutputStream", "java.io.PrintWriter", "java.util.ArrayList" ]
import com.topodroid.DistoX; import com.topodroid.utils.TDFile; import com.topodroid.utils.TDLog; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList;
import com.topodroid.*; import com.topodroid.utils.*; import java.io.*; import java.util.*;
[ "com.topodroid", "com.topodroid.utils", "java.io", "java.util" ]
com.topodroid; com.topodroid.utils; java.io; java.util;
2,681,678
@SuppressWarnings("unused") private void return_empty_list_iterator_guava_exception () { DomainObject domain = null; // dao populate domain ListIterator<String> strings = Objects.firstNonNull( domain != null ? domain.getStrings() : null, ImmutableList.<String>of().listIterator()); //... }
@SuppressWarnings(STR) void function () { DomainObject domain = null; ListIterator<String> strings = Objects.firstNonNull( domain != null ? domain.getStrings() : null, ImmutableList.<String>of().listIterator()); }
/** * Used for exception example */
Used for exception example
return_empty_list_iterator_guava_exception
{ "repo_name": "wq19880601/java-util-examples", "path": "src/test/java/com/levelup/java/collections/ReturnEmptyListIterator.java", "license": "apache-2.0", "size": 2549 }
[ "com.google.common.base.Objects", "com.google.common.collect.ImmutableList", "java.util.ListIterator" ]
import com.google.common.base.Objects; import com.google.common.collect.ImmutableList; import java.util.ListIterator;
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
968,639
private static <OUT> TypeInfoFactory<? super OUT> getClosestFactory(ArrayList<Type> typeHierarchy, Type t) { TypeInfoFactory factory = null; while (factory == null && isClassType(t) && !(typeToClass(t).equals(Object.class))) { typeHierarchy.add(t); factory = getTypeInfoFactory(t); t = typeToClass(t).getGenericSuperclass(); if (t == null) { break; } } return factory; }
static <OUT> TypeInfoFactory<? super OUT> function(ArrayList<Type> typeHierarchy, Type t) { TypeInfoFactory factory = null; while (factory == null && isClassType(t) && !(typeToClass(t).equals(Object.class))) { typeHierarchy.add(t); factory = getTypeInfoFactory(t); t = typeToClass(t).getGenericSuperclass(); if (t == null) { break; } } return factory; }
/** * Traverses the type hierarchy up until a type information factory can be found. * * @param typeHierarchy hierarchy to be filled while traversing up * @param t type for which a factory needs to be found * @return closest type information factory or null if there is no factory in the type hierarchy */
Traverses the type hierarchy up until a type information factory can be found
getClosestFactory
{ "repo_name": "zimmermatt/flink", "path": "flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java", "license": "apache-2.0", "size": 84020 }
[ "java.lang.reflect.Type", "java.util.ArrayList", "org.apache.flink.api.common.typeinfo.TypeInfoFactory", "org.apache.flink.api.java.typeutils.TypeExtractionUtils" ]
import java.lang.reflect.Type; import java.util.ArrayList; import org.apache.flink.api.common.typeinfo.TypeInfoFactory; import org.apache.flink.api.java.typeutils.TypeExtractionUtils;
import java.lang.reflect.*; import java.util.*; import org.apache.flink.api.common.typeinfo.*; import org.apache.flink.api.java.typeutils.*;
[ "java.lang", "java.util", "org.apache.flink" ]
java.lang; java.util; org.apache.flink;
1,466,167
public static long memoryOverhead(long maxOrd) { return RamUsageEstimator.NUM_BYTES_OBJECT_REF + SHALLOW_FIXEDBITSET_SIZE + (maxOrd + 7) / 8; // 1 bit per ord } private final BigArrays bigArrays; private final SortedSetDocValues values; private final int maxOrd; private final HyperLogLogPlusPlus counts; private ObjectArray<FixedBitSet> visitedOrds; OrdinalsCollector(HyperLogLogPlusPlus counts, SortedSetDocValues values, BigArrays bigArrays) { if (values.getValueCount() > Integer.MAX_VALUE) { throw new IllegalArgumentException(); } maxOrd = (int) values.getValueCount(); this.bigArrays = bigArrays; this.counts = counts; this.values = values; visitedOrds = bigArrays.newObjectArray(1); }
static long function(long maxOrd) { return RamUsageEstimator.NUM_BYTES_OBJECT_REF + SHALLOW_FIXEDBITSET_SIZE + (maxOrd + 7) / 8; } private final BigArrays bigArrays; private final SortedSetDocValues values; private final int maxOrd; private final HyperLogLogPlusPlus counts; private ObjectArray<FixedBitSet> visitedOrds; OrdinalsCollector(HyperLogLogPlusPlus counts, SortedSetDocValues values, BigArrays bigArrays) { if (values.getValueCount() > Integer.MAX_VALUE) { throw new IllegalArgumentException(); } maxOrd = (int) values.getValueCount(); this.bigArrays = bigArrays; this.counts = counts; this.values = values; visitedOrds = bigArrays.newObjectArray(1); }
/** * Return an approximate memory overhead per bucket for this collector. */
Return an approximate memory overhead per bucket for this collector
memoryOverhead
{ "repo_name": "jprante/elasticsearch-server", "path": "server/src/main/java/org/elasticsearch/search/aggregations/metrics/cardinality/CardinalityAggregator.java", "license": "apache-2.0", "size": 14795 }
[ "org.apache.lucene.index.SortedSetDocValues", "org.apache.lucene.util.FixedBitSet", "org.apache.lucene.util.RamUsageEstimator", "org.elasticsearch.common.util.BigArrays", "org.elasticsearch.common.util.ObjectArray" ]
import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.ObjectArray;
import org.apache.lucene.index.*; import org.apache.lucene.util.*; import org.elasticsearch.common.util.*;
[ "org.apache.lucene", "org.elasticsearch.common" ]
org.apache.lucene; org.elasticsearch.common;
255,453
@Override protected void onDeop(String target, String sourceNick, String sourceLogin, String sourceHostname, String recipient) { Message message = new Message(service.getString(R.string.message_deop, sourceNick, recipient)); message.setIcon(R.drawable.op); message.setColor(Message.COLOR_BLUE); server.getConversation(target).addMessage(message); Intent intent = Broadcast.createConversationIntent( Broadcast.CONVERSATION_MESSAGE, server.getId(), target ); service.sendBroadcast(intent); }
void function(String target, String sourceNick, String sourceLogin, String sourceHostname, String recipient) { Message message = new Message(service.getString(R.string.message_deop, sourceNick, recipient)); message.setIcon(R.drawable.op); message.setColor(Message.COLOR_BLUE); server.getConversation(target).addMessage(message); Intent intent = Broadcast.createConversationIntent( Broadcast.CONVERSATION_MESSAGE, server.getId(), target ); service.sendBroadcast(intent); }
/** * On Deop */
On Deop
onDeop
{ "repo_name": "pocmo/Yaaic", "path": "app/src/main/java/org/yaaic/irc/IRCConnection.java", "license": "gpl-3.0", "size": 43692 }
[ "android.content.Intent", "org.yaaic.model.Broadcast", "org.yaaic.model.Message" ]
import android.content.Intent; import org.yaaic.model.Broadcast; import org.yaaic.model.Message;
import android.content.*; import org.yaaic.model.*;
[ "android.content", "org.yaaic.model" ]
android.content; org.yaaic.model;
264,059
public void setBackgroundProcessorDelay(int delay) { this.backgroundProcessorDelay = delay; } private static class DisablePersistSessionListener implements LifecycleListener {
void function(int delay) { this.backgroundProcessorDelay = delay; } private static class DisablePersistSessionListener implements LifecycleListener {
/** * Sets the background processor delay in seconds. * @param delay the delay in seconds * @since 1.4.1 */
Sets the background processor delay in seconds
setBackgroundProcessorDelay
{ "repo_name": "xiaoleiPENG/my-project", "path": "spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java", "license": "apache-2.0", "size": 29272 }
[ "org.apache.catalina.LifecycleListener" ]
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.*;
[ "org.apache.catalina" ]
org.apache.catalina;
760,298
@SuppressFBWarnings("IIL_PREPARE_STATEMENT_IN_LOOP") private static void upgradeTable(final Connection connection, final int currentVersion) throws SQLException { LOGGER.info(LOG_UPGRADING_TABLE, DATABASE_NAME, TABLE_NAME, currentVersion, TABLE_VERSION); for (int version = currentVersion; version < TABLE_VERSION; version++) { LOGGER.trace(LOG_UPGRADING_TABLE, DATABASE_NAME, TABLE_NAME, version, version + 1); switch (version) { case 1: version = 2; break; default: throw new IllegalStateException( getMessage(LOG_UPGRADING_TABLE_MISSING, DATABASE_NAME, TABLE_NAME, version, TABLE_VERSION) ); } } MediaTableTablesVersions.setTableVersion(connection, TABLE_NAME, TABLE_VERSION); }
@SuppressFBWarnings(STR) static void function(final Connection connection, final int currentVersion) throws SQLException { LOGGER.info(LOG_UPGRADING_TABLE, DATABASE_NAME, TABLE_NAME, currentVersion, TABLE_VERSION); for (int version = currentVersion; version < TABLE_VERSION; version++) { LOGGER.trace(LOG_UPGRADING_TABLE, DATABASE_NAME, TABLE_NAME, version, version + 1); switch (version) { case 1: version = 2; break; default: throw new IllegalStateException( getMessage(LOG_UPGRADING_TABLE_MISSING, DATABASE_NAME, TABLE_NAME, version, TABLE_VERSION) ); } } MediaTableTablesVersions.setTableVersion(connection, TABLE_NAME, TABLE_VERSION); }
/** * This method <strong>MUST</strong> be updated if the table definition are * altered. The changes for each version in the form of * <code>ALTER TABLE</code> must be implemented here. * * @param connection the {@link Connection} to use * @param currentVersion the version to upgrade <strong>from</strong> * * @throws SQLException */
This method MUST be updated if the table definition are altered. The changes for each version in the form of <code>ALTER TABLE</code> must be implemented here
upgradeTable
{ "repo_name": "UniversalMediaServer/UniversalMediaServer", "path": "src/main/java/net/pms/database/MediaTableThumbnails.java", "license": "gpl-2.0", "size": 8486 }
[ "edu.umd.cs.findbugs.annotations.SuppressFBWarnings", "java.sql.Connection", "java.sql.SQLException" ]
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.sql.Connection; import java.sql.SQLException;
import edu.umd.cs.findbugs.annotations.*; import java.sql.*;
[ "edu.umd.cs", "java.sql" ]
edu.umd.cs; java.sql;
1,365,223
EAttribute getAdditiveExpression_Op();
EAttribute getAdditiveExpression_Op();
/** * Returns the meta object for the attribute '{@link com.euclideanspace.spad.editor.AdditiveExpression#getOp <em>Op</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Op</em>'. * @see com.euclideanspace.spad.editor.AdditiveExpression#getOp() * @see #getAdditiveExpression() * @generated */
Returns the meta object for the attribute '<code>com.euclideanspace.spad.editor.AdditiveExpression#getOp Op</code>'.
getAdditiveExpression_Op
{ "repo_name": "martinbaker/euclideanspace", "path": "com.euclideanspace.spad/src-gen/com/euclideanspace/spad/editor/EditorPackage.java", "license": "agpl-3.0", "size": 593321 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,228,860
@Override public void uninstall() throws UninstallException { final List<File> lombokJarsForWhichCantDeleteSelf = new ArrayList<File>(); StringBuilder newContents = new StringBuilder(); if (eclipseIniPath.exists()) { try { FileInputStream fis = new FileInputStream(eclipseIniPath); try { BufferedReader br = new BufferedReader(new InputStreamReader(fis)); String line; while ((line = br.readLine()) != null) { if (JAVA_AGENT_LINE_MATCHER.matcher(line).matches()) continue; Matcher m = BOOTCLASSPATH_LINE_MATCHER.matcher(line); if (m.matches()) { StringBuilder elemBuilder = new StringBuilder(); elemBuilder.append("-Xbootclasspath/a:"); boolean first = true; for (String elem : m.group(1).split(Pattern.quote(File.pathSeparator))) { if (elem.toLowerCase().endsWith("lombok.jar")) continue; { if (elem.toLowerCase().endsWith("lombok.eclipse.agent.jar")) continue; } if (first) first = false; else elemBuilder.append(File.pathSeparator); elemBuilder.append(elem); } if (!first) newContents.append(elemBuilder.toString()).append(OS_NEWLINE); continue; } newContents.append(line).append(OS_NEWLINE); } br.close(); } finally { fis.close(); } FileOutputStream fos = new FileOutputStream(eclipseIniPath); try { fos.write(newContents.toString().getBytes()); } finally { fos.close(); } } catch (IOException e) { throw new UninstallException("Cannot uninstall lombok from " + name + generateWriteErrorMessage(), e); } } for (File dir : getUninstallDirs()) { File lombokJar = new File(dir, "lombok.jar"); if (lombokJar.exists()) { if (!lombokJar.delete()) { if (OsUtils.getOS() == OsUtils.OS.WINDOWS && Installer.isSelf(lombokJar.getAbsolutePath())) { lombokJarsForWhichCantDeleteSelf.add(lombokJar); } else { throw new UninstallException( "Can't delete " + lombokJar.getAbsolutePath() + generateWriteErrorMessage(), null); } } } { File agentJar = new File(dir, "lombok.eclipse.agent.jar"); if (agentJar.exists()) { agentJar.delete(); } } } if (!lombokJarsForWhichCantDeleteSelf.isEmpty()) { throw new UninstallException(true, String.format( "lombok.jar cannot delete itself on windows.\nHowever, lombok has been uncoupled from your %s.\n" + "You can safely delete this jar file. You can find it at:\n%s", descriptor.getProductName(), lombokJarsForWhichCantDeleteSelf.get(0).getAbsolutePath()), null); } }
@Override void function() throws UninstallException { final List<File> lombokJarsForWhichCantDeleteSelf = new ArrayList<File>(); StringBuilder newContents = new StringBuilder(); if (eclipseIniPath.exists()) { try { FileInputStream fis = new FileInputStream(eclipseIniPath); try { BufferedReader br = new BufferedReader(new InputStreamReader(fis)); String line; while ((line = br.readLine()) != null) { if (JAVA_AGENT_LINE_MATCHER.matcher(line).matches()) continue; Matcher m = BOOTCLASSPATH_LINE_MATCHER.matcher(line); if (m.matches()) { StringBuilder elemBuilder = new StringBuilder(); elemBuilder.append(STR); boolean first = true; for (String elem : m.group(1).split(Pattern.quote(File.pathSeparator))) { if (elem.toLowerCase().endsWith(STR)) continue; { if (elem.toLowerCase().endsWith(STR)) continue; } if (first) first = false; else elemBuilder.append(File.pathSeparator); elemBuilder.append(elem); } if (!first) newContents.append(elemBuilder.toString()).append(OS_NEWLINE); continue; } newContents.append(line).append(OS_NEWLINE); } br.close(); } finally { fis.close(); } FileOutputStream fos = new FileOutputStream(eclipseIniPath); try { fos.write(newContents.toString().getBytes()); } finally { fos.close(); } } catch (IOException e) { throw new UninstallException(STR + name + generateWriteErrorMessage(), e); } } for (File dir : getUninstallDirs()) { File lombokJar = new File(dir, STR); if (lombokJar.exists()) { if (!lombokJar.delete()) { if (OsUtils.getOS() == OsUtils.OS.WINDOWS && Installer.isSelf(lombokJar.getAbsolutePath())) { lombokJarsForWhichCantDeleteSelf.add(lombokJar); } else { throw new UninstallException( STR + lombokJar.getAbsolutePath() + generateWriteErrorMessage(), null); } } } { File agentJar = new File(dir, STR); if (agentJar.exists()) { agentJar.delete(); } } } if (!lombokJarsForWhichCantDeleteSelf.isEmpty()) { throw new UninstallException(true, String.format( STR + STR, descriptor.getProductName(), lombokJarsForWhichCantDeleteSelf.get(0).getAbsolutePath()), null); } }
/** * Uninstalls lombok from this location. * It's a no-op if lombok wasn't there in the first place, * and it will remove a half-succeeded lombok installation as well. * * @throws UninstallException * If there's an obvious I/O problem that is preventing * installation. bugs in the uninstall code will probably throw * other exceptions; this is intentional. */
Uninstalls lombok from this location. It's a no-op if lombok wasn't there in the first place, and it will remove a half-succeeded lombok installation as well
uninstall
{ "repo_name": "openlegacy/lombok", "path": "src/installer/lombok/installer/eclipse/EclipseProductLocation.java", "license": "mit", "size": 14017 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileInputStream", "java.io.FileOutputStream", "java.io.IOException", "java.io.InputStreamReader", "java.util.ArrayList", "java.util.List", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.io.*; import java.util.*; import java.util.regex.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,442,515
public static <T> ProcessState<T> ofResult(T result) { return new ProcessState<>(Type.RESULT, requireNonNull(result, "result is null"), null); }
static <T> ProcessState<T> function(T result) { return new ProcessState<>(Type.RESULT, requireNonNull(result, STR), null); }
/** * Signals that process has produced a result. {@link #process()} will be called again. */
Signals that process has produced a result. <code>#process()</code> will be called again
ofResult
{ "repo_name": "ebyhr/presto", "path": "core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java", "license": "apache-2.0", "size": 13354 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,160,644
@Test void testRenderMyPage3() { // start and render the test page tester.startPage(CommonModelPage.class); // assert rendered page class tester.assertRenderedPage(CommonModelPage.class); FormTester formTester = tester.newFormTester("border:body:form2"); // formTester.setValue("quantity1", "123"); formTester.setValue("quantity2", "44"); formTester.submit(); CommonModelPage page = (CommonModelPage)tester.getLastRenderedPage(); assertEquals(0, page.quantity1); assertEquals(44, page.quantity2); }
void testRenderMyPage3() { tester.startPage(CommonModelPage.class); tester.assertRenderedPage(CommonModelPage.class); FormTester formTester = tester.newFormTester(STR); formTester.setValue(STR, "44"); formTester.submit(); CommonModelPage page = (CommonModelPage)tester.getLastRenderedPage(); assertEquals(0, page.quantity1); assertEquals(44, page.quantity2); }
/** * WICKET-2134: two forms inside a border throw a ConversionException error */
WICKET-2134: two forms inside a border throw a ConversionException error
testRenderMyPage3
{ "repo_name": "mosoft521/wicket", "path": "wicket-core/src/test/java/org/apache/wicket/markup/html/form/panelBorder/TestHomePage_2134.java", "license": "apache-2.0", "size": 3008 }
[ "org.apache.wicket.util.tester.FormTester", "org.junit.jupiter.api.Assertions" ]
import org.apache.wicket.util.tester.FormTester; import org.junit.jupiter.api.Assertions;
import org.apache.wicket.util.tester.*; import org.junit.jupiter.api.*;
[ "org.apache.wicket", "org.junit.jupiter" ]
org.apache.wicket; org.junit.jupiter;
2,571,909
public List<PCollection<T>> getAll() { return pcollections; }
List<PCollection<T>> function() { return pcollections; }
/** * Returns an immutable List of all the {@link PCollection PCollections} in this * {@link PCollectionList}. */
Returns an immutable List of all the <code>PCollection PCollections</code> in this <code>PCollectionList</code>
getAll
{ "repo_name": "tweise/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java", "license": "apache-2.0", "size": 8010 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,539,432
if (computeElements == null) { computeElements = new ArrayList<NamedRelatedResourceRep>(); } return computeElements; }
if (computeElements == null) { computeElements = new ArrayList<NamedRelatedResourceRep>(); } return computeElements; }
/** * List of compute element URLs with name * */
List of compute element URLs with name
getComputeElements
{ "repo_name": "emcvipr/controller-client-java", "path": "models/src/main/java/com/emc/storageos/model/compute/ComputeElementList.java", "license": "apache-2.0", "size": 1101 }
[ "com.emc.storageos.model.NamedRelatedResourceRep", "java.util.ArrayList" ]
import com.emc.storageos.model.NamedRelatedResourceRep; import java.util.ArrayList;
import com.emc.storageos.model.*; import java.util.*;
[ "com.emc.storageos", "java.util" ]
com.emc.storageos; java.util;
2,275,896
public long rebuild(final OProgressListener iProgressListener);
long function(final OProgressListener iProgressListener);
/** * Populate the index with all the existent records. */
Populate the index with all the existent records
rebuild
{ "repo_name": "vivosys/orientdb", "path": "core/src/main/java/com/orientechnologies/orient/core/index/OIndex.java", "license": "apache-2.0", "size": 11709 }
[ "com.orientechnologies.common.listener.OProgressListener" ]
import com.orientechnologies.common.listener.OProgressListener;
import com.orientechnologies.common.listener.*;
[ "com.orientechnologies.common" ]
com.orientechnologies.common;
1,405,040
@Override public void mergeClicked() { view.hide(); final Project project = appContext.getRootProject(); checkState(project != null); final Resource[] resources = appContext.getResources(); checkState(resources != null && resources.length == 1);
void function() { view.hide(); final Project project = appContext.getRootProject(); checkState(project != null); final Resource[] resources = appContext.getResources(); checkState(resources != null && resources.length == 1);
/** * Performs actions when clicking Merge button. */
Performs actions when clicking Merge button
mergeClicked
{ "repo_name": "slemeur/che", "path": "plugins/plugin-svn/che-plugin-svn-ext-ide/src/main/java/org/eclipse/che/plugin/svn/ide/merge/MergePresenter.java", "license": "epl-1.0", "size": 13498 }
[ "com.google.common.base.Preconditions", "org.eclipse.che.ide.api.resources.Project", "org.eclipse.che.ide.api.resources.Resource" ]
import com.google.common.base.Preconditions; import org.eclipse.che.ide.api.resources.Project; import org.eclipse.che.ide.api.resources.Resource;
import com.google.common.base.*; import org.eclipse.che.ide.api.resources.*;
[ "com.google.common", "org.eclipse.che" ]
com.google.common; org.eclipse.che;
1,320,008
String storeName = null; String infoStoreName = null; // remove any existing album stores... if (albumNames != null) { for (int i = 0; i < albumNames.length; i++) { try { // Delete all existing stores containing Image objects as // well as the associated ImageInfo objects // Add the prefixes labels to the info store storeName = album_label + albumNames[i]; infoStoreName = info_label + albumNames[i]; System.out.println("<* ImageAccessor.resetImageRecordStore() *> delete "+storeName); RecordStore.deleteRecordStore(storeName); RecordStore.deleteRecordStore(infoStoreName); } catch (RecordStoreException e) { System.out.println("No record store named " + storeName + " to delete."); System.out.println("...or...No record store named " + infoStoreName + " to delete."); System.out.println("Ignoring Exception: " + e); // ignore any errors... } } } else { // Do nothing for nowimageInfo System.out .println("ImageAccessor::resetImageRecordStore: albumNames array was null. Nothing to delete."); } // Now, create a new default album for testing addMediaData("Tucan Sam", "/images/Tucan.png",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add Penguin addMediaData("Linux Penguin", "/images/Penguin.png",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add Duke addMediaData("Duke (Sun)", "/images/Duke1.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData("UBC Logo", "/images/ubcLogo.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add Gail addMediaData("Gail", "/images/Gail1.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add JG addMediaData("J. Gosling", "/images/Gosling1.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add GK addMediaData("Gregor", "/images/Gregor1.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); // Add KDV addMediaData("Kris", "/images/Kdvolder1.PNG",Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); }
String storeName = null; String infoStoreName = null; if (albumNames != null) { for (int i = 0; i < albumNames.length; i++) { try { storeName = album_label + albumNames[i]; infoStoreName = info_label + albumNames[i]; System.out.println(STR+storeName); RecordStore.deleteRecordStore(storeName); RecordStore.deleteRecordStore(infoStoreName); } catch (RecordStoreException e) { System.out.println(STR + storeName + STR); System.out.println(STR + infoStoreName + STR); System.out.println(STR + e); } } } else { System.out .println(STR); } addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData("Gail", STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData(STR, STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); addMediaData("Kris", STR,Constants.IMAGE_MEDIA, Constants.PNG, default_album_name); }
/** * Reset the album data for MobileMedia. This will delete all existing photo * data from the record store and re-create the default album and photos. * * @throws InvalidImageFormatException * @throws ImagePathNotValidException * @throws InvalidImageDataException * @throws PersistenceMechanismException * */
Reset the album data for MobileMedia. This will delete all existing photo data from the record store and re-create the default album and photos
resetRecordStore
{ "repo_name": "leotizzei/MobileMedia-Cosmos-v7", "path": "src/br/unicamp/ic/sed/mobilemedia/filesystemmgr/impl/ImageMediaAccessor.java", "license": "mit", "size": 5950 }
[ "br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.dt.Constants", "javax.microedition.rms.RecordStore", "javax.microedition.rms.RecordStoreException" ]
import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.dt.Constants; import javax.microedition.rms.RecordStore; import javax.microedition.rms.RecordStoreException;
import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.dt.*; import javax.microedition.rms.*;
[ "br.unicamp.ic", "javax.microedition" ]
br.unicamp.ic; javax.microedition;
1,520,174
public void onCreateAndAssign() { // Check if user has permissions to create labels if (!SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_LABELS)) { throw new WrongValueException(buttonCreateAndAssign, _("you do not have permissions to create new labels")); } // Check LabelType is not null final Comboitem comboitem = cbLabelType.getSelectedItem(); if (comboitem == null || comboitem.getValue() == null) { throw new WrongValueException(cbLabelType, _("please, select an item")); } // Check Label is not null or empty final String labelName = txtLabelName.getValue(); if (labelName == null || labelName.isEmpty()) { throw new WrongValueException(txtLabelName, _("cannot be empty")); } // Label does not exist, create final LabelType labelType = (LabelType) comboitem.getValue(); Label label = getModel().findLabelByNameAndType( labelName, labelType); if (label == null) { label = addLabel(labelName, labelType); } else { // Label is already assigned? if (isAssigned(label)) { throw new WrongValueException(txtLabelName, _("already assigned")); } } try { assignLabel(label); } catch (IllegalArgumentException e) { throw new WrongValueException(txtLabelName, e.getMessage()); } clear(txtLabelName); }
void function() { if (!SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_LABELS)) { throw new WrongValueException(buttonCreateAndAssign, _(STR)); } final Comboitem comboitem = cbLabelType.getSelectedItem(); if (comboitem == null comboitem.getValue() == null) { throw new WrongValueException(cbLabelType, _(STR)); } final String labelName = txtLabelName.getValue(); if (labelName == null labelName.isEmpty()) { throw new WrongValueException(txtLabelName, _(STR)); } final LabelType labelType = (LabelType) comboitem.getValue(); Label label = getModel().findLabelByNameAndType( labelName, labelType); if (label == null) { label = addLabel(labelName, labelType); } else { if (isAssigned(label)) { throw new WrongValueException(txtLabelName, _(STR)); } } try { assignLabel(label); } catch (IllegalArgumentException e) { throw new WrongValueException(txtLabelName, e.getMessage()); } clear(txtLabelName); }
/** * Executed on pressing createAndAssign button Creates a new label for a * type, in case it does not exist, and added it to the list of direct * labels */
Executed on pressing createAndAssign button Creates a new label for a type, in case it does not exist, and added it to the list of direct labels
onCreateAndAssign
{ "repo_name": "bolobr/IEBT-Libreplan", "path": "libreplan-webapp/src/main/java/org/libreplan/web/orders/labels/AssignedLabelsController.java", "license": "agpl-3.0", "size": 6145 }
[ "org.libreplan.business.labels.entities.Label", "org.libreplan.business.labels.entities.LabelType", "org.libreplan.business.users.entities.UserRole", "org.libreplan.web.security.SecurityUtils", "org.zkoss.zk.ui.WrongValueException", "org.zkoss.zul.Comboitem" ]
import org.libreplan.business.labels.entities.Label; import org.libreplan.business.labels.entities.LabelType; import org.libreplan.business.users.entities.UserRole; import org.libreplan.web.security.SecurityUtils; import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zul.Comboitem;
import org.libreplan.business.labels.entities.*; import org.libreplan.business.users.entities.*; import org.libreplan.web.security.*; import org.zkoss.zk.ui.*; import org.zkoss.zul.*;
[ "org.libreplan.business", "org.libreplan.web", "org.zkoss.zk", "org.zkoss.zul" ]
org.libreplan.business; org.libreplan.web; org.zkoss.zk; org.zkoss.zul;
1,387,152
public boolean detectLostPartitions(AffinityTopologyVersion resTopVer, @Nullable DiscoveryEvent discoEvt);
boolean function(AffinityTopologyVersion resTopVer, @Nullable DiscoveryEvent discoEvt);
/** * Checks if there is at least one owner for each partition in the cache topology. * If not, marks such a partition as LOST. * <p> * This method should be called on topology coordinator after all partition messages are received. * * @param resTopVer Exchange result version. * @param discoEvt Discovery event for which we detect lost partitions if {@link EventType#EVT_CACHE_REBALANCE_PART_DATA_LOST} event should be fired. * @return {@code True} if partitions state got updated. */
Checks if there is at least one owner for each partition in the cache topology. If not, marks such a partition as LOST. This method should be called on topology coordinator after all partition messages are received
detectLostPartitions
{ "repo_name": "ptupitsyn/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopology.java", "license": "apache-2.0", "size": 15829 }
[ "org.apache.ignite.events.DiscoveryEvent", "org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.events.*; import org.apache.ignite.internal.processors.affinity.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
2,843,715
@Override public void addArguments(final List<String> arguments) { // no given file means no protein means no arguments if (!this.isFileGiven()) { return; } // always add the file location arguments.add("-f"); arguments.add(this.fileLocation); // set '-ring' and '-center' if they were true if (this.ring) { arguments.add("-ring"); } if (this.center) { arguments.add("-center"); } // add the parameters if given if (!this.rotate.equals("")) { arguments.add("-rotate"); arguments.add(this.rotate); } if (this.fudge >= 0) { arguments.add("-fudge"); arguments.add(Double.toString(this.fudge)); } if (this.verticalShift != 0) { arguments.add("-dm"); arguments.add(Double.toString(this.verticalShift)); } }
void function(final List<String> arguments) { if (!this.isFileGiven()) { return; } arguments.add("-f"); arguments.add(this.fileLocation); if (this.ring) { arguments.add("-ring"); } if (this.center) { arguments.add(STR); } if (!this.rotate.equals(STR-rotateSTR-fudgeSTR-dm"); arguments.add(Double.toString(this.verticalShift)); } }
/** * Add command line arguments of the protein to the given list. * * @param arguments the given list of arguments */
Add command line arguments of the protein to the given list
addArguments
{ "repo_name": "penuts7644/InsaneModel", "path": "src/main/java/nl/bioinf/lscheffer_wvanhelvoirt/insanemodel/model/Protein.java", "license": "gpl-3.0", "size": 6403 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,048,600
//SolrClient solrClient = new ConcurrentUpdateSolrClient(solrUrl, 16, 64); SolrClient solrClient = new HttpSolrClient(solrUrl); return solrClient; }
SolrClient solrClient = new HttpSolrClient(solrUrl); return solrClient; }
/** * This method can be used to obtain a Solr client instance * * @todo Check whether we want to support Solr Cloud setup * @param solrUrl - URL which contain IP/DNS port and collection name * (e.g. "http://localhost:8983/solr/Test") * @return solr client instance */
This method can be used to obtain a Solr client instance
getSolrClient
{ "repo_name": "AKSW/SmartDataWebKG", "path": "tools/warc-solr/src/org/aksw/sdw/search/solr/SolrHandler.java", "license": "apache-2.0", "size": 4504 }
[ "org.apache.solr.client.solrj.SolrClient", "org.apache.solr.client.solrj.impl.HttpSolrClient" ]
import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.*; import org.apache.solr.client.solrj.impl.*;
[ "org.apache.solr" ]
org.apache.solr;
1,818,459
private DataObject updateAnnotationData(SecurityContext ctx, DataObject ann) throws DSOutOfServiceException, DSAccessException { long id; String ioType; if (ann instanceof TagAnnotationData && ann.isDirty()) { TagAnnotationData tag = (TagAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(TagAnnotationData.class).getName(); TagAnnotation ho = (TagAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTextValue(omero.rtypes.rstring(tag.getTagValue())); ho.setDescription(omero.rtypes.rstring(tag.getTagDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof TermAnnotationData && ann.isDirty()) { TermAnnotationData tag = (TermAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(TermAnnotationData.class).getName(); TermAnnotation ho = (TermAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTermValue(omero.rtypes.rstring(tag.getTerm())); ho.setDescription(omero.rtypes.rstring(tag.getTermDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof XMLAnnotationData && ann.isDirty()) { XMLAnnotationData tag = (XMLAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(XMLAnnotationData.class).getName(); XmlAnnotation ho = (XmlAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTextValue(omero.rtypes.rstring(tag.getText())); ho.setDescription(omero.rtypes.rstring(tag.getDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof LongAnnotationData && ann.isDirty()) { LongAnnotationData tag = (LongAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(LongAnnotationData.class).getName(); LongAnnotation ho = (LongAnnotation) gateway.findIObject(ctx, ioType, id); ho.setLongValue(omero.rtypes.rlong(tag.getDataValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof DoubleAnnotationData && ann.isDirty()) { DoubleAnnotationData tag = (DoubleAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(DoubleAnnotationData.class).getName(); DoubleAnnotation ho = (DoubleAnnotation) gateway.findIObject(ctx, ioType, id); ho.setDoubleValue(omero.rtypes.rdouble(tag.getDataValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof BooleanAnnotationData && ann.isDirty()) { BooleanAnnotationData tag = (BooleanAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(BooleanAnnotationData.class).getName(); BooleanAnnotation ho = (BooleanAnnotation) gateway.findIObject(ctx, ioType, id); ho.setBoolValue(omero.rtypes.rbool(tag.getValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof MapAnnotationData && ann.isDirty()) { MapAnnotationData map = (MapAnnotationData) ann; id = map.getId(); ioType = PojoMapper.getModelType(MapAnnotationData.class).getName(); MapAnnotation m = (MapAnnotation) gateway.findIObject(ctx, ioType, id); m.setMapValue((List<NamedValue>) map.getContent()); IObject object = gateway.updateObject(ctx, m, new Parameters()); return PojoMapper.asDataObject(object); } return ann; }
DataObject function(SecurityContext ctx, DataObject ann) throws DSOutOfServiceException, DSAccessException { long id; String ioType; if (ann instanceof TagAnnotationData && ann.isDirty()) { TagAnnotationData tag = (TagAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(TagAnnotationData.class).getName(); TagAnnotation ho = (TagAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTextValue(omero.rtypes.rstring(tag.getTagValue())); ho.setDescription(omero.rtypes.rstring(tag.getTagDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof TermAnnotationData && ann.isDirty()) { TermAnnotationData tag = (TermAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(TermAnnotationData.class).getName(); TermAnnotation ho = (TermAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTermValue(omero.rtypes.rstring(tag.getTerm())); ho.setDescription(omero.rtypes.rstring(tag.getTermDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof XMLAnnotationData && ann.isDirty()) { XMLAnnotationData tag = (XMLAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(XMLAnnotationData.class).getName(); XmlAnnotation ho = (XmlAnnotation) gateway.findIObject(ctx, ioType, id); ho.setTextValue(omero.rtypes.rstring(tag.getText())); ho.setDescription(omero.rtypes.rstring(tag.getDescription())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof LongAnnotationData && ann.isDirty()) { LongAnnotationData tag = (LongAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(LongAnnotationData.class).getName(); LongAnnotation ho = (LongAnnotation) gateway.findIObject(ctx, ioType, id); ho.setLongValue(omero.rtypes.rlong(tag.getDataValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof DoubleAnnotationData && ann.isDirty()) { DoubleAnnotationData tag = (DoubleAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(DoubleAnnotationData.class).getName(); DoubleAnnotation ho = (DoubleAnnotation) gateway.findIObject(ctx, ioType, id); ho.setDoubleValue(omero.rtypes.rdouble(tag.getDataValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof BooleanAnnotationData && ann.isDirty()) { BooleanAnnotationData tag = (BooleanAnnotationData) ann; id = tag.getId(); ioType = PojoMapper.getModelType(BooleanAnnotationData.class).getName(); BooleanAnnotation ho = (BooleanAnnotation) gateway.findIObject(ctx, ioType, id); ho.setBoolValue(omero.rtypes.rbool(tag.getValue())); IObject object = gateway.updateObject(ctx, ho, new Parameters()); return PojoMapper.asDataObject(object); } else if (ann instanceof MapAnnotationData && ann.isDirty()) { MapAnnotationData map = (MapAnnotationData) ann; id = map.getId(); ioType = PojoMapper.getModelType(MapAnnotationData.class).getName(); MapAnnotation m = (MapAnnotation) gateway.findIObject(ctx, ioType, id); m.setMapValue((List<NamedValue>) map.getContent()); IObject object = gateway.updateObject(ctx, m, new Parameters()); return PojoMapper.asDataObject(object); } return ann; }
/** * Updates the passed annotation. * * @param ctx The security context. * @param ann The annotation to update. * @throws DSOutOfServiceException If the connection is broken, or not logged in * @throws DSAccessException If an error occurred while trying to * retrieve data from OMEDS service. */
Updates the passed annotation
updateAnnotationData
{ "repo_name": "simleo/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OmeroMetadataServiceImpl.java", "license": "gpl-2.0", "size": 88736 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,864,628
public PackageDescr read(final InputSource in) throws SAXException, IOException { this.packageDescr = (PackageDescr) this.parser.read( in ); return this.packageDescr; }
PackageDescr function(final InputSource in) throws SAXException, IOException { this.packageDescr = (PackageDescr) this.parser.read( in ); return this.packageDescr; }
/** * Read a <code>RuleSet</code> from an <code>InputSource</code>. * * @param in * The rule-set input-source. * * @return The rule-set. */
Read a <code>RuleSet</code> from an <code>InputSource</code>
read
{ "repo_name": "pperboires/PocDrools", "path": "drools-compiler/src/main/java/org/drools/compiler/xml/XmlPackageReader.java", "license": "apache-2.0", "size": 2519 }
[ "java.io.IOException", "org.drools.lang.descr.PackageDescr", "org.xml.sax.InputSource", "org.xml.sax.SAXException" ]
import java.io.IOException; import org.drools.lang.descr.PackageDescr; import org.xml.sax.InputSource; import org.xml.sax.SAXException;
import java.io.*; import org.drools.lang.descr.*; import org.xml.sax.*;
[ "java.io", "org.drools.lang", "org.xml.sax" ]
java.io; org.drools.lang; org.xml.sax;
2,413,228
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(String resourceGroupName, String accountName) { Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, accountName); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); }
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<Void>, Void> function(String resourceGroupName, String accountName) { Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, accountName); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); }
/** * Deletes a Cognitive Services account from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */
Deletes a Cognitive Services account from the resource group
beginDeleteAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java", "license": "mit", "size": 114340 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.PollerFlux", "java.nio.ByteBuffer" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import java.nio.ByteBuffer;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import java.nio.*;
[ "com.azure.core", "java.nio" ]
com.azure.core; java.nio;
797,759
public ResourceAdapterConfig getResourceAdapter() { return _config.getResourceAdapter(); }
ResourceAdapterConfig function() { return _config.getResourceAdapter(); }
/** * Returns the resource adapter class. */
Returns the resource adapter class
getResourceAdapter
{ "repo_name": "christianchristensen/resin", "path": "modules/resin/src/com/caucho/jca/ra/ResourceArchive.java", "license": "gpl-2.0", "size": 11217 }
[ "com.caucho.jca.cfg.ResourceAdapterConfig" ]
import com.caucho.jca.cfg.ResourceAdapterConfig;
import com.caucho.jca.cfg.*;
[ "com.caucho.jca" ]
com.caucho.jca;
336,216
protected static Set<BaseDisk> getDisks(Collection<DiskImage> diskImages) { Map<Guid, BaseDisk> diskMap = new HashMap<Guid, BaseDisk>(); for (Disk diskImage : diskImages) { diskMap.put(diskImage.getId(), diskImage); } return new HashSet<BaseDisk>(diskMap.values()); }
static Set<BaseDisk> function(Collection<DiskImage> diskImages) { Map<Guid, BaseDisk> diskMap = new HashMap<Guid, BaseDisk>(); for (Disk diskImage : diskImages) { diskMap.put(diskImage.getId(), diskImage); } return new HashSet<BaseDisk>(diskMap.values()); }
/** * Gets a set of disks from disk images. For VM with snapshots, several DiskImage elements may contain the same Disk * * @param diskImages * collection DiskImage objects to get a set of Disks from * @return set of disks of the images collection */
Gets a set of disks from disk images. For VM with snapshots, several DiskImage elements may contain the same Disk
getDisks
{ "repo_name": "jbeecham/ovirt-engine", "path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java", "license": "apache-2.0", "size": 31965 }
[ "java.util.Collection", "java.util.HashMap", "java.util.HashSet", "java.util.Map", "java.util.Set", "org.ovirt.engine.core.common.businessentities.BaseDisk", "org.ovirt.engine.core.common.businessentities.Disk", "org.ovirt.engine.core.common.businessentities.DiskImage", "org.ovirt.engine.core.compat.Guid" ]
import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.ovirt.engine.core.common.businessentities.BaseDisk; import org.ovirt.engine.core.common.businessentities.Disk; import org.ovirt.engine.core.common.businessentities.DiskImage; import org.ovirt.engine.core.compat.Guid;
import java.util.*; import org.ovirt.engine.core.common.businessentities.*; import org.ovirt.engine.core.compat.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
1,648,331
@Column(name = "format", length = 255) @Override public String getFormat() { return (String) get(13); }
@Column(name = STR, length = 255) String function() { return (String) get(13); }
/** * Getter for <code>cattle.volume.format</code>. */
Getter for <code>cattle.volume.format</code>
getFormat
{ "repo_name": "vincent99/cattle", "path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/tables/records/VolumeRecord.java", "license": "apache-2.0", "size": 12791 }
[ "javax.persistence.Column" ]
import javax.persistence.Column;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
2,376,404
@Override protected void initializationComplete(MXMLTreeBuilder builder, IMXMLTagData tag, MXMLNodeInfo info) { super.initializationComplete(builder, tag, info); FlexProject project = builder.getProject(); // If this property is type Array, and it didn't get set to an Array tag, // then create an implicit Array tag and initialize it from the // child tags of the property tag. IDefinition definition = getDefinition(); if (definition != null && definition.getTypeAsDisplayString().equals(IASLanguageConstants.Array)) { if (instanceNode == null || ((!(instanceNode instanceof MXMLArrayNode)) && !instanceNode.getClassReference(project).getQualifiedName().equals(IASLanguageConstants.Array))) { instanceNode = new MXMLArrayNode(this); instanceNode.setClassReference(project, IASLanguageConstants.Array); // TODO Move to MXMLArrayNode ((MXMLArrayNode)instanceNode).initializeFromTag(builder, tag); } } if (instanceNode == null) { // use helpers for parse for bindings, @functions, create correct child node processFragments(builder, tag, info); } }
void function(MXMLTreeBuilder builder, IMXMLTagData tag, MXMLNodeInfo info) { super.initializationComplete(builder, tag, info); FlexProject project = builder.getProject(); IDefinition definition = getDefinition(); if (definition != null && definition.getTypeAsDisplayString().equals(IASLanguageConstants.Array)) { if (instanceNode == null ((!(instanceNode instanceof MXMLArrayNode)) && !instanceNode.getClassReference(project).getQualifiedName().equals(IASLanguageConstants.Array))) { instanceNode = new MXMLArrayNode(this); instanceNode.setClassReference(project, IASLanguageConstants.Array); ((MXMLArrayNode)instanceNode).initializeFromTag(builder, tag); } } if (instanceNode == null) { processFragments(builder, tag, info); } }
/** * This override is called on a property tag such as <label>O<!-- comment * -->K</label>. It concatenates all the text units to get "OK" and uses * that to specify the property value. */
This override is called on a property tag such as OK. It concatenates all the text units to get "OK" and uses that to specify the property value
initializationComplete
{ "repo_name": "adufilie/flex-falcon", "path": "compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java", "license": "apache-2.0", "size": 21311 }
[ "org.apache.flex.compiler.constants.IASLanguageConstants", "org.apache.flex.compiler.definitions.IDefinition", "org.apache.flex.compiler.internal.projects.FlexProject", "org.apache.flex.compiler.mxml.IMXMLTagData" ]
import org.apache.flex.compiler.constants.IASLanguageConstants; import org.apache.flex.compiler.definitions.IDefinition; import org.apache.flex.compiler.internal.projects.FlexProject; import org.apache.flex.compiler.mxml.IMXMLTagData;
import org.apache.flex.compiler.constants.*; import org.apache.flex.compiler.definitions.*; import org.apache.flex.compiler.internal.projects.*; import org.apache.flex.compiler.mxml.*;
[ "org.apache.flex" ]
org.apache.flex;
2,219,314
protected void checkCanCluster (BodyObject initiator, BodyObject target) throws InvocationException { // nothing to do by default }
void function (BodyObject initiator, BodyObject target) throws InvocationException { }
/** * Gives derived classes an opportunity to veto a user's attempt to start a cluster with * another user. If the attempt should be vetoed, this method should throw an {@link * InvocationException} indicating the reason for veto. */
Gives derived classes an opportunity to veto a user's attempt to start a cluster with another user. If the attempt should be vetoed, this method should throw an <code>InvocationException</code> indicating the reason for veto
checkCanCluster
{ "repo_name": "threerings/vilya", "path": "core/src/main/java/com/threerings/whirled/spot/server/SpotSceneManager.java", "license": "lgpl-2.1", "size": 21351 }
[ "com.threerings.crowd.data.BodyObject", "com.threerings.presents.server.InvocationException" ]
import com.threerings.crowd.data.BodyObject; import com.threerings.presents.server.InvocationException;
import com.threerings.crowd.data.*; import com.threerings.presents.server.*;
[ "com.threerings.crowd", "com.threerings.presents" ]
com.threerings.crowd; com.threerings.presents;
2,292,238
private void runQueries() throws Exception { List<String> queries = opts.arguments; // Run the showIndexes query before executing any target query, to store the index metadata List<String> queriesIndex = new ArrayList<String>(); queriesIndex.add("vxquery-xtest/src/test/resources/Queries/XQuery/Indexing/Partition-1/showIndexes.xq"); OutputStream resultStream = new ByteArrayOutputStream(); executeQuery(queriesIndex.get(0), 1, resultStream, indexOpts); ByteArrayOutputStream bos = (ByteArrayOutputStream) resultStream; String result = new String(bos.toByteArray()); String[] collections = result.split("\n"); this.collectionList = Arrays.asList(collections); executeQueries(queries); }
void function() throws Exception { List<String> queries = opts.arguments; List<String> queriesIndex = new ArrayList<String>(); queriesIndex.add(STR); OutputStream resultStream = new ByteArrayOutputStream(); executeQuery(queriesIndex.get(0), 1, resultStream, indexOpts); ByteArrayOutputStream bos = (ByteArrayOutputStream) resultStream; String result = new String(bos.toByteArray()); String[] collections = result.split("\n"); this.collectionList = Arrays.asList(collections); executeQueries(queries); }
/** * Reads the contents of the files passed in the list of arguments to a string. If -showquery argument is passed, output the query as string. Run the query * for the string. * * @throws IOException * @throws SystemException * @throws Exception */
Reads the contents of the files passed in the list of arguments to a string. If -showquery argument is passed, output the query as string. Run the query for the string
runQueries
{ "repo_name": "ecarm002/vxquery", "path": "vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java", "license": "apache-2.0", "size": 18722 }
[ "java.io.ByteArrayOutputStream", "java.io.OutputStream", "java.util.ArrayList", "java.util.Arrays", "java.util.List" ]
import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
777,427
public Timestamp getUpdated(); public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
Timestamp function(); public static final String COLUMNNAME_UpdatedBy = STR;
/** Get Updated. * Date this record was updated */
Get Updated. Date this record was updated
getUpdated
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/I_AD_FieldGroup.java", "license": "gpl-2.0", "size": 5224 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
792,590
public void append(String name, RevTree tree) { append(name, TREE, tree); }
void function(String name, RevTree tree) { append(name, TREE, tree); }
/** * Add a subtree, mode is {@link #TREE}. * * @param name * name of the entry. * @param tree * the ObjectId to store in this entry. */
Add a subtree, mode is <code>#TREE</code>
append
{ "repo_name": "DanielliUrbieta/ProjetoHidraWS", "path": "src/org/eclipse/jgit/lib/TreeFormatter.java", "license": "gpl-2.0", "size": 11217 }
[ "org.eclipse.jgit.revwalk.RevTree" ]
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.*;
[ "org.eclipse.jgit" ]
org.eclipse.jgit;
2,005,748
public TreeUI getUI() { return (TreeUI)ui; }
TreeUI function() { return (TreeUI)ui; }
/** * Returns the L&amp;F object that renders this component. * * @return the <code>TreeUI</code> object that renders this component */
Returns the L&amp;F object that renders this component
getUI
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/JTree.java", "license": "apache-2.0", "size": 215008 }
[ "javax.swing.plaf.TreeUI" ]
import javax.swing.plaf.TreeUI;
import javax.swing.plaf.*;
[ "javax.swing" ]
javax.swing;
1,403,384
private void addRoundFrame() { RoundFrame roundFrame = (RoundFrame) this.contentSystem .createContentItem(RoundFrame.class); roundFrame.placeRandom(); roundFrame.setBackgroundColour(Color.yellow); roundFrame.setBorderColour(Color.white); roundFrame.setRadius(40); }
void function() { RoundFrame roundFrame = (RoundFrame) this.contentSystem .createContentItem(RoundFrame.class); roundFrame.placeRandom(); roundFrame.setBackgroundColour(Color.yellow); roundFrame.setBorderColour(Color.white); roundFrame.setRadius(40); }
/** * Adds the round frame. */
Adds the round frame
addRoundFrame
{ "repo_name": "synergynet/synergynet2.5", "path": "synergynet2.5/src/main/java/apps/contentitemgallery/ContentItemGalleryApp.java", "license": "bsd-3-clause", "size": 14726 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,328,353
private void sendContactToBasket(String ContactId) { SilverTrace.info("yellowpages", "YellowpagesBmEJB.sendContactToBasket()", "root.MSG_GEN_ENTER_METHOD"); SilverTrace.info("yellowpages", "YellowpagesBmEJB.deleteContact()", "root.MSG_GEN_PARAM_VALUE", "ContactId = " + ContactId); ContactPK contactPK = new ContactPK(ContactId, this.space, this.componentId); try { ContactBm contactBm = getContactBm(); // remove all links between this contact and topics contactBm.removeAllFather(contactPK); // add link between this contact and the basket topic contactBm.addFather(contactPK, basketPK); deleteIndex(contactPK); } catch (Exception re) { throw new YellowpagesRuntimeException( "YellowpagesBmEJB.sendContactToBasket()", SilverpeasRuntimeException.ERROR, "yellowpages.EX_SEND_CONTACT_TO_BASKET_FAILED", re); } SilverTrace.info("yellowpages", "YellowpagesBmEJB.sendContactToBasket()", "root.MSG_GEN_EXIT_METHOD"); }
void function(String ContactId) { SilverTrace.info(STR, STR, STR); SilverTrace.info(STR, STR, STR, STR + ContactId); ContactPK contactPK = new ContactPK(ContactId, this.space, this.componentId); try { ContactBm contactBm = getContactBm(); contactBm.removeAllFather(contactPK); contactBm.addFather(contactPK, basketPK); deleteIndex(contactPK); } catch (Exception re) { throw new YellowpagesRuntimeException( STR, SilverpeasRuntimeException.ERROR, STR, re); } SilverTrace.info(STR, STR, STR); }
/** * Send the contact in the basket topic * @param ContactId the id of the contact * @see com.stratelia.webactiv.yellowpages.model.TopicDetail * @exception javax.ejb.FinderException * @exception javax.ejb.CreateException * @exception javax.ejb.NamingException * @exception java.sql.SQLException * @since 1.0 */
Send the contact in the basket topic
sendContactToBasket
{ "repo_name": "stephaneperry/Silverpeas-Components", "path": "yellowpages/yellowpages-ejb/src/main/java/com/stratelia/webactiv/yellowpages/control/ejb/YellowpagesBmEJB.java", "license": "agpl-3.0", "size": 66673 }
[ "com.stratelia.silverpeas.silvertrace.SilverTrace", "com.stratelia.webactiv.util.contact.control.ContactBm", "com.stratelia.webactiv.util.contact.model.ContactPK", "com.stratelia.webactiv.util.exception.SilverpeasRuntimeException", "com.stratelia.webactiv.yellowpages.model.YellowpagesRuntimeException" ]
import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.contact.control.ContactBm; import com.stratelia.webactiv.util.contact.model.ContactPK; import com.stratelia.webactiv.util.exception.SilverpeasRuntimeException; import com.stratelia.webactiv.yellowpages.model.YellowpagesRuntimeException;
import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.contact.control.*; import com.stratelia.webactiv.util.contact.model.*; import com.stratelia.webactiv.util.exception.*; import com.stratelia.webactiv.yellowpages.model.*;
[ "com.stratelia.silverpeas", "com.stratelia.webactiv" ]
com.stratelia.silverpeas; com.stratelia.webactiv;
53,419
public VersionStructure getDocument(String id);
VersionStructure function(String id);
/** * Gets the Document with the specified ID from the CouchDB * * @param id * ID of the document * @return The Document from the CouchDB */
Gets the Document with the specified ID from the CouchDB
getDocument
{ "repo_name": "metafora-project/Development", "path": "src/de/kuei/metafora/gwt/smack/client/versions/VersionsService.java", "license": "bsd-3-clause", "size": 2163 }
[ "de.kuei.metafora.gwt.smack.shared.VersionStructure" ]
import de.kuei.metafora.gwt.smack.shared.VersionStructure;
import de.kuei.metafora.gwt.smack.shared.*;
[ "de.kuei.metafora" ]
de.kuei.metafora;
2,734,725
public static ScriptVariable createOfTypes(Iterable<? extends IType> types) { checkArgument(types!=null); for( IType arg : types) { checkArgument(arg!=null); } return new ScriptVariable(types); }
static ScriptVariable function(Iterable<? extends IType> types) { checkArgument(types!=null); for( IType arg : types) { checkArgument(arg!=null); } return new ScriptVariable(types); }
/** * Creates a script variable with multiple allowable types. * @param types May not be empty, may not contain {@code null}. * @return */
Creates a script variable with multiple allowable types
createOfTypes
{ "repo_name": "BBN-E/Adept", "path": "adept-api/src/main/java/adept/common/ScriptVariable.java", "license": "apache-2.0", "size": 2829 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,033,286
public URL getURL() throws IOException { if (archive == null) { throw new IOException("Must save before accessing contents"); } return URLUtils.toJarURL(archive.getName()); }
URL function() throws IOException { if (archive == null) { throw new IOException(STR); } return URLUtils.toJarURL(archive.getName()); }
/** * Returns a URL pointing to the archive. * * @return a URL corresponding to this archive * @throws IOException if the archive has not yet been saved */
Returns a URL pointing to the archive
getURL
{ "repo_name": "caiusb/vassal", "path": "src/VASSAL/tools/DataArchive.java", "license": "lgpl-2.1", "size": 23191 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
677,982
public Socket getSocket() { return socket; } //~ Inner Classes ---------------------------------------------------------- private static final class LazyInitializer { //~ Static fields/initializers ----------------------------------------- private static final SocketIOSocketProvider INSTANCE; static { try { INSTANCE = new SocketIOSocketProvider(); } catch (final Exception ex) { throw new RuntimeException("Exception while initializing ServerStamperUtils", ex); } } }
Socket function() { return socket; } private static final class LazyInitializer { private static final SocketIOSocketProvider INSTANCE; static { try { INSTANCE = new SocketIOSocketProvider(); } catch (final Exception ex) { throw new RuntimeException(STR, ex); } } }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getSocket
{ "repo_name": "cismet/cids-custom-wuppertal-server", "path": "src/main/java/de/cismet/cids/custom/wunda_blau/search/actions/GetOrbitStacAction.java", "license": "lgpl-3.0", "size": 8128 }
[ "io.socket.client.Socket" ]
import io.socket.client.Socket;
import io.socket.client.*;
[ "io.socket.client" ]
io.socket.client;
1,139,271
private void handleAction(String param1) { Log.d(getClass().getSimpleName(), "Handle action with param: " + param1); while(true) { try { Thread.sleep(5000); } catch (InterruptedException e) { Log.e(getClass().getSimpleName(), "Service error...", e); } SynchronizationEvent event = new SynchronizationEvent(new Date().toString()); bus.post(event); } }
void function(String param1) { Log.d(getClass().getSimpleName(), STR + param1); while(true) { try { Thread.sleep(5000); } catch (InterruptedException e) { Log.e(getClass().getSimpleName(), STR, e); } SynchronizationEvent event = new SynchronizationEvent(new Date().toString()); bus.post(event); } }
/** * Handle action in the provided background thread with the provided * parameters. */
Handle action in the provided background thread with the provided parameters
handleAction
{ "repo_name": "anaselhajjaji/android-samples", "path": "EventBusSample/app/src/main/java/anaware/samples/eventbussample/SynchronizationService.java", "license": "apache-2.0", "size": 1642 }
[ "android.util.Log", "java.util.Date" ]
import android.util.Log; import java.util.Date;
import android.util.*; import java.util.*;
[ "android.util", "java.util" ]
android.util; java.util;
2,350,168
public List<HibernateProperty> getProperties(String category, String type) { // use the <HibernateProperty> to specify the type of objects this // ArrayList will hold List<HibernateProperty> props = new ArrayList<HibernateProperty>(); // get a Set and its Iterator Set<String> keys = _properties.keySet(); Iterator<String> iter = keys.iterator(); while (iter.hasNext()) { // get a key and its HibernateProperty String key = iter.next(); HibernateProperty hp = _properties.get(key); // if the category and type match, add the hp object // to the ArrayList if (hp.getCategory().equals(category) && hp.getType().equals(type)){ props.add(hp); } } // return the ArrayList return props; }
List<HibernateProperty> function(String category, String type) { List<HibernateProperty> props = new ArrayList<HibernateProperty>(); Set<String> keys = _properties.keySet(); Iterator<String> iter = keys.iterator(); while (iter.hasNext()) { String key = iter.next(); HibernateProperty hp = _properties.get(key); if (hp.getCategory().equals(category) && hp.getType().equals(type)){ props.add(hp); } } return props; }
/** * Returns an ArrayList with the properties that match the category and * type passed in. * * @param category * @param type * @return ArrayList */
Returns an ArrayList with the properties that match the category and type passed in
getProperties
{ "repo_name": "lmu-bioinformatics/xmlpipedb", "path": "xmlpipedbutils/src/edu/lmu/xmlpipedb/util/engines/HibernatePropertiesModel.java", "license": "lgpl-3.0", "size": 7429 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "java.util.Set" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,369,747
public void read(final DataInputStream in) throws IOException { maxByte = in.readInt(); maxChar = in.readChar(); changeable = in.readBoolean(); int count = in.readInt(); char2byte = new byte[count]; for (int i = 0; i < count; i++) { char2byte[i] = in.readByte(); } count = in.readInt(); byte2char = new char[count]; for (int i = 0; i < count; i++) { byte2char[i] = in.readChar(); } }
void function(final DataInputStream in) throws IOException { maxByte = in.readInt(); maxChar = in.readChar(); changeable = in.readBoolean(); int count = in.readInt(); char2byte = new byte[count]; for (int i = 0; i < count; i++) { char2byte[i] = in.readByte(); } count = in.readInt(); byte2char = new char[count]; for (int i = 0; i < count; i++) { byte2char[i] = in.readChar(); } }
/** * Reads a configuration of this charset from the input stream. * * @param in The input stream. * * @throws IOException if input error occurred. */
Reads a configuration of this charset from the input stream
read
{ "repo_name": "Neurpheus/neurpheus-utils", "path": "src/main/java/org/neurpheus/core/charset/DynamicCharset.java", "license": "lgpl-3.0", "size": 18333 }
[ "java.io.DataInputStream", "java.io.IOException" ]
import java.io.DataInputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,664,390