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
@Override public void onConfirmation(String callerTag) { Activity parentActivity = getActivity(); AccountManager am = AccountManager.get(parentActivity); AccountManagerCallback<Boolean> callback = (AccountManagerCallback<Boolean>)parentActivity; am.removeAccount(mTargetAccount, callback, new Handler()); }
void function(String callerTag) { Activity parentActivity = getActivity(); AccountManager am = AccountManager.get(parentActivity); AccountManagerCallback<Boolean> callback = (AccountManagerCallback<Boolean>)parentActivity; am.removeAccount(mTargetAccount, callback, new Handler()); }
/** * Performs the removal of the target account. */
Performs the removal of the target account
onConfirmation
{ "repo_name": "PauloSantos13/android", "path": "src/com/owncloud/android/ui/dialog/RemoveAccountDialogFragment.java", "license": "gpl-2.0", "size": 4053 }
[ "android.accounts.AccountManager", "android.accounts.AccountManagerCallback", "android.app.Activity", "android.os.Handler" ]
import android.accounts.AccountManager; import android.accounts.AccountManagerCallback; import android.app.Activity; import android.os.Handler;
import android.accounts.*; import android.app.*; import android.os.*;
[ "android.accounts", "android.app", "android.os" ]
android.accounts; android.app; android.os;
200,436
public void registerView(final Class ownerClass, final Pair<View, View> view) { registerView(ownerClass.getSimpleName(), view); }
void function(final Class ownerClass, final Pair<View, View> view) { registerView(ownerClass.getSimpleName(), view); }
/** * Register view. * * @param ownerClass the owner class * @param view the view */
Register view
registerView
{ "repo_name": "leleuj/cas", "path": "support/cas-server-support-validation-core/src/main/java/org/apereo/cas/web/ServiceValidationViewFactory.java", "license": "apache-2.0", "size": 6533 }
[ "org.apache.commons.lang3.tuple.Pair", "org.springframework.web.servlet.View" ]
import org.apache.commons.lang3.tuple.Pair; import org.springframework.web.servlet.View;
import org.apache.commons.lang3.tuple.*; import org.springframework.web.servlet.*;
[ "org.apache.commons", "org.springframework.web" ]
org.apache.commons; org.springframework.web;
1,047,845
@Override public URL find(String classname) { try { URLConnection con = openClassfile0(classname); InputStream is = con.getInputStream(); if (is != null) { is.close(); return con.getURL(); } } catch (IOException e) {} return null; }
URL function(String classname) { try { URLConnection con = openClassfile0(classname); InputStream is = con.getInputStream(); if (is != null) { is.close(); return con.getURL(); } } catch (IOException e) {} return null; }
/** * Returns the URL. * * @return null if the class file could not be obtained. */
Returns the URL
find
{ "repo_name": "HotswapProjects/HotswapAgent", "path": "hotswap-agent-core/src/main/java/org/hotswap/agent/javassist/URLClassPath.java", "license": "gpl-2.0", "size": 5899 }
[ "java.io.IOException", "java.io.InputStream", "java.net.URLConnection" ]
import java.io.IOException; import java.io.InputStream; import java.net.URLConnection;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,079,418
public void setParameterOptions(List<VOParameterOption> parameterOptions) { this.parameterOptions = parameterOptions; }
void function(List<VOParameterOption> parameterOptions) { this.parameterOptions = parameterOptions; }
/** * Sets the options of the parameter, if the data type is * <code>ENUMERATION</code> * * @param parameterOptions * the parameter options */
Sets the options of the parameter, if the data type is <code>ENUMERATION</code>
setParameterOptions
{ "repo_name": "opetrovski/development", "path": "oscm-extsvc/javasrc/org/oscm/vo/VOParameterDefinition.java", "license": "apache-2.0", "size": 13654 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,885,645
public void testEntireObjectNestedSearch1() throws ApplicationException { InLaw searchObject = new InLaw(); Collection results = getApplicationService().search("gov.nih.nci.cacoresdk.domain.onetoone.multipleassociation.withjoin.InLaw",searchObject ); assertNotNull(results); assertEquals(4,results.size()); for(Iterator i = results.iterator();i.hasNext();) { InLaw result = (InLaw)i.next(); assertNotNull(result); assertNotNull(result.getId()); assertEquals(result.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(result.getName()); } }
void function() throws ApplicationException { InLaw searchObject = new InLaw(); Collection results = getApplicationService().search(STR,searchObject ); assertNotNull(results); assertEquals(4,results.size()); for(Iterator i = results.iterator();i.hasNext();) { InLaw result = (InLaw)i.next(); assertNotNull(result); assertNotNull(result.getId()); assertEquals(result.getId().getRoot(),II_ROOT_GLOBAL_CONSTANT_VALUE); assertNotNull(result.getName()); } }
/** * Uses Nested Search Criteria for search * Verifies that the results are returned * Verifies size of the result set * Verifies that none of the attribute is null * * @throws ApplicationException */
Uses Nested Search Criteria for search Verifies that the results are returned Verifies size of the result set Verifies that none of the attribute is null
testEntireObjectNestedSearch1
{ "repo_name": "NCIP/cacore-sdk", "path": "sdk-toolkit/iso-example-project/junit/src/test/gov/nih/nci/cacoresdk/domain/onetoone/multipleassociation/withjoin/O2OMultipleAssociationWJoinTest.java", "license": "bsd-3-clause", "size": 9118 }
[ "gov.nih.nci.cacoresdk.domain.onetoone.multipleassociation.withjoin.InLaw", "gov.nih.nci.system.applicationservice.ApplicationException", "java.util.Collection", "java.util.Iterator" ]
import gov.nih.nci.cacoresdk.domain.onetoone.multipleassociation.withjoin.InLaw; import gov.nih.nci.system.applicationservice.ApplicationException; import java.util.Collection; import java.util.Iterator;
import gov.nih.nci.cacoresdk.domain.onetoone.multipleassociation.withjoin.*; import gov.nih.nci.system.applicationservice.*; import java.util.*;
[ "gov.nih.nci", "java.util" ]
gov.nih.nci; java.util;
406,473
protected void addContextPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SynapseAPI_context_feature"), getString("_UI_SynapseAPI_context_description"), EsbPackage.Literals.SYNAPSE_API__CONTEXT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR), EsbPackage.Literals.SYNAPSE_API__CONTEXT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Context feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Context feature.
addContextPropertyDescriptor
{ "repo_name": "chanakaudaya/developer-studio", "path": "esb/org.wso2.developerstudio.eclipse.esb.edit/src/org/wso2/developerstudio/eclipse/esb/provider/SynapseAPIItemProvider.java", "license": "apache-2.0", "size": 8406 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.wso2.developerstudio.eclipse.esb.EsbPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.esb.EsbPackage;
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.esb.*;
[ "org.eclipse.emf", "org.wso2.developerstudio" ]
org.eclipse.emf; org.wso2.developerstudio;
2,237,514
public IndexRequest source(byte[] source, XContentType xContentType) { return source(source, 0, source.length, xContentType); }
IndexRequest function(byte[] source, XContentType xContentType) { return source(source, 0, source.length, xContentType); }
/** * Sets the document to index in bytes form. */
Sets the document to index in bytes form
source
{ "repo_name": "nezirus/elasticsearch", "path": "core/src/main/java/org/elasticsearch/action/index/IndexRequest.java", "license": "apache-2.0", "size": 23243 }
[ "org.elasticsearch.common.xcontent.XContentType" ]
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
425,059
public DocumentPreservationPolicy getDocumentPreservationPolicy() { return documentPreservationPolicy; }
DocumentPreservationPolicy function() { return documentPreservationPolicy; }
/** * Gets this XMLBinder's document preservation policy. * @return an instance of DocumentPreservationPolicy * @see org.eclipse.persistence.oxm.documentpreservation.DocumentPreservationPolicy */
Gets this XMLBinder's document preservation policy
getDocumentPreservationPolicy
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/XMLBinder.java", "license": "epl-1.0", "size": 11851 }
[ "org.eclipse.persistence.oxm.documentpreservation.DocumentPreservationPolicy" ]
import org.eclipse.persistence.oxm.documentpreservation.DocumentPreservationPolicy;
import org.eclipse.persistence.oxm.documentpreservation.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,171,883
@Override public void add(Widget w) { add(w, getElement()); children.add(w); }
void function(Widget w) { add(w, getElement()); children.add(w); }
/** * Adds a new child widget to the panel. * * @param w * the widget to be added */
Adds a new child widget to the panel
add
{ "repo_name": "Governance/overlord-commons", "path": "overlord-commons-gwt/src/main/java/org/overlord/commons/gwt/client/local/widgets/AnchorPanel.java", "license": "apache-2.0", "size": 2798 }
[ "com.google.gwt.user.client.ui.Widget" ]
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
2,426,670
public AttachmentInfo attachVolume(String volumeId, String instanceId, String device) throws EC2Exception { Map<String, String> params = new HashMap<String, String>(); params.put("VolumeId", volumeId); params.put("InstanceId", instanceId); params.put("Device", device); HttpGet method = new HttpGet(); AttachVolumeResponse response = makeRequestInt(method, "AttachVolume", params, AttachVolumeResponse.class); return new AttachmentInfo(response.getVolumeId(), response.getInstanceId(), response.getDevice(), response.getStatus(), response.getAttachTime().toGregorianCalendar()); }
AttachmentInfo function(String volumeId, String instanceId, String device) throws EC2Exception { Map<String, String> params = new HashMap<String, String>(); params.put(STR, volumeId); params.put(STR, instanceId); params.put(STR, device); HttpGet method = new HttpGet(); AttachVolumeResponse response = makeRequestInt(method, STR, params, AttachVolumeResponse.class); return new AttachmentInfo(response.getVolumeId(), response.getInstanceId(), response.getDevice(), response.getStatus(), response.getAttachTime().toGregorianCalendar()); }
/** * Attaches an EBS volume to an instance. * * @param volumeId the id of the volume * @param instanceId the id of the instance * @param device the device name for the attached volume * @return the information about this attachment * @throws EC2Exception wraps checked exceptions */
Attaches an EBS volume to an instance
attachVolume
{ "repo_name": "jonnyzzz/maragogype", "path": "tags/v1.7/java/com/xerox/amazonws/ec2/Jec2.java", "license": "apache-2.0", "size": 97485 }
[ "com.xerox.amazonws.typica.jaxb.AttachVolumeResponse", "java.util.HashMap", "java.util.Map", "org.apache.http.client.methods.HttpGet" ]
import com.xerox.amazonws.typica.jaxb.AttachVolumeResponse; import java.util.HashMap; import java.util.Map; import org.apache.http.client.methods.HttpGet;
import com.xerox.amazonws.typica.jaxb.*; import java.util.*; import org.apache.http.client.methods.*;
[ "com.xerox.amazonws", "java.util", "org.apache.http" ]
com.xerox.amazonws; java.util; org.apache.http;
786,852
public void onDragFloatView(View floatView, Point location, Point touch);
void function(View floatView, Point location, Point touch);
/** * Called whenever the floating View is dragged. Float View * properties can be changed here. Also, the upcoming location * of the float View can be altered by setting * <code>location.x</code> and <code>location.y</code>. * * @param floatView The floating View. * @param location The location (top-left; relative to DSLV * top-left) at which the float * View would like to appear, given the current touch location * and the offset provided in {@link DragSortListView#startDrag}. * @param touch The current touch location (relative to DSLV * top-left). * @param pendingScroll */
Called whenever the floating View is dragged. Float View properties can be changed here. Also, the upcoming location of the float View can be altered by setting <code>location.x</code> and <code>location.y</code>
onDragFloatView
{ "repo_name": "Gordon01/vanilla", "path": "src/com/mobeta/android/dslv/DragSortListView.java", "license": "gpl-3.0", "size": 100485 }
[ "android.graphics.Point", "android.view.View" ]
import android.graphics.Point; import android.view.View;
import android.graphics.*; import android.view.*;
[ "android.graphics", "android.view" ]
android.graphics; android.view;
1,252,313
public void switchRemoved(DatapathId switchId);
void function(DatapathId switchId);
/** * Fired when a switch disconnects from the cluster , * @param switchId the datapath Id of the switch */
Fired when a switch disconnects from the cluster
switchRemoved
{ "repo_name": "rizard/switchvisor", "path": "src/main/java/net/floodlightcontroller/core/IOFSwitchListener.java", "license": "apache-2.0", "size": 2233 }
[ "org.projectfloodlight.openflow.types.DatapathId" ]
import org.projectfloodlight.openflow.types.DatapathId;
import org.projectfloodlight.openflow.types.*;
[ "org.projectfloodlight.openflow" ]
org.projectfloodlight.openflow;
2,369,516
@WithinSingleTransaction public void deleteEventById(@Nonnull String id) { delete(getById(id)); }
void function(@Nonnull String id) { delete(getById(id)); }
/** * Delete a particular event. * * @param id * The identifier of the event to delete. */
Delete a particular event
deleteEventById
{ "repo_name": "taverna/taverna-server", "path": "server-webapp/src/main/java/org/taverna/server/master/notification/atom/EventDAO.java", "license": "lgpl-2.1", "size": 5611 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,436,586
boolean removeAll(Collection<?> items);
boolean removeAll(Collection<?> items);
/** * Removes all the specified elements from the set. * * @param items Elements to be removed. * @return True if the set was changed, false otherwise. * @see java.util.Set#removeAll(Collection) * @see #retainAll(java.util.Collection) */
Removes all the specified elements from the set
removeAll
{ "repo_name": "padrig64/ValidationFramework", "path": "validationframework-core/src/main/java/com/google/code/validationframework/api/property/WritableSetProperty.java", "license": "bsd-2-clause", "size": 3250 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,512,509
public static void renameProperty(final String oldKey, final String newKey, final Iterable<Element> elements) { for (final Element element : elements) { Object value = element.removeProperty(oldKey); if (null != value) element.setProperty(newKey, value); } }
static void function(final String oldKey, final String newKey, final Iterable<Element> elements) { for (final Element element : elements) { Object value = element.removeProperty(oldKey); if (null != value) element.setProperty(newKey, value); } }
/** * Renames a property by removing the old key and adding the stored value to the new key. * If property does not exist, nothing occurs. * * @param oldKey the key to rename * @param newKey the key to rename to * @param elements the elements to rename */
Renames a property by removing the old key and adding the stored value to the new key. If property does not exist, nothing occurs
renameProperty
{ "repo_name": "echinopsii/net.echinopsii.3rdparty.blueprints", "path": "blueprints-core/src/main/java/com/tinkerpop/blueprints/util/ElementHelper.java", "license": "bsd-3-clause", "size": 8259 }
[ "com.tinkerpop.blueprints.Element" ]
import com.tinkerpop.blueprints.Element;
import com.tinkerpop.blueprints.*;
[ "com.tinkerpop.blueprints" ]
com.tinkerpop.blueprints;
274,879
///////////////////////////////////////////////////////// // // These methods are called by secondary namenodes // ///////////////////////////////////////////////////////// synchronized BlocksWithLocations getBlocks(DatanodeID datanode, long size) throws IOException { checkSuperuserPrivilege(); DatanodeDescriptor node = getDatanode(datanode); if (node == null) { NameNode.stateChangeLog.warn("BLOCK* NameSystem.getBlocks: " + "Asking for blocks from an unrecorded node " + datanode.getName()); throw new IllegalArgumentException( "Unexpected exception. Got getBlocks message for datanode " + datanode.getName() + ", but there is no info for it"); } int numBlocks = node.numBlocks(); if(numBlocks == 0) { return new BlocksWithLocations(new BlockWithLocations[0]); } Iterator<Block> iter = node.getBlockIterator(); int startBlock = r.nextInt(numBlocks); // starting from a random block // skip blocks for(int i=0; i<startBlock; i++) { iter.next(); } List<BlockWithLocations> results = new ArrayList<BlockWithLocations>(); long totalSize = 0; while(totalSize<size && iter.hasNext()) { totalSize += addBlock(iter.next(), results); } if(totalSize<size) { iter = node.getBlockIterator(); // start from the beginning for(int i=0; i<startBlock&&totalSize<size; i++) { totalSize += addBlock(iter.next(), results); } } return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()])); }
synchronized BlocksWithLocations getBlocks(DatanodeID datanode, long size) throws IOException { checkSuperuserPrivilege(); DatanodeDescriptor node = getDatanode(datanode); if (node == null) { NameNode.stateChangeLog.warn(STR + STR + datanode.getName()); throw new IllegalArgumentException( STR + datanode.getName() + STR); } int numBlocks = node.numBlocks(); if(numBlocks == 0) { return new BlocksWithLocations(new BlockWithLocations[0]); } Iterator<Block> iter = node.getBlockIterator(); int startBlock = r.nextInt(numBlocks); for(int i=0; i<startBlock; i++) { iter.next(); } List<BlockWithLocations> results = new ArrayList<BlockWithLocations>(); long totalSize = 0; while(totalSize<size && iter.hasNext()) { totalSize += addBlock(iter.next(), results); } if(totalSize<size) { iter = node.getBlockIterator(); for(int i=0; i<startBlock&&totalSize<size; i++) { totalSize += addBlock(iter.next(), results); } } return new BlocksWithLocations( results.toArray(new BlockWithLocations[results.size()])); }
/** * return a list of blocks & their locations on <code>datanode</code> whose * total size is <code>size</code> * * @param datanode on which blocks are located * @param size total size of blocks */
return a list of blocks & their locations on <code>datanode</code> whose total size is <code>size</code>
getBlocks
{ "repo_name": "davidl1/hortonworks-extension", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 218585 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.protocol.DatanodeID", "org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations" ]
import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations;
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.protocol.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,232,216
Object putFromLoad(Data key, Object value, long expirationTime, Address callerAddress);
Object putFromLoad(Data key, Object value, long expirationTime, Address callerAddress);
/** * Puts key-value pair (with expiration time) to map which is the result of a load from * map store operation. * * @param key key to put. * @param value to put. * @param expirationTime the expiration time of the key-value pair {@link Long#MAX_VALUE * if the key-value pair should not expire}. * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt>. * @see com.hazelcast.map.impl.operation.PutFromLoadAllOperation */
Puts key-value pair (with expiration time) to map which is the result of a load from map store operation
putFromLoad
{ "repo_name": "mesutcelik/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/RecordStore.java", "license": "apache-2.0", "size": 22355 }
[ "com.hazelcast.cluster.Address", "com.hazelcast.internal.serialization.Data" ]
import com.hazelcast.cluster.Address; import com.hazelcast.internal.serialization.Data;
import com.hazelcast.cluster.*; import com.hazelcast.internal.serialization.*;
[ "com.hazelcast.cluster", "com.hazelcast.internal" ]
com.hazelcast.cluster; com.hazelcast.internal;
2,580,279
public static Date getDateHeader(HttpMessage message, String name, Date defaultValue) { final String value = getHeader(message, name); if (value == null) { return defaultValue; } try { return new HttpHeaderDateFormat().parse(value); } catch (ParseException e) { return defaultValue; } }
static Date function(HttpMessage message, String name, Date defaultValue) { final String value = getHeader(message, name); if (value == null) { return defaultValue; } try { return new HttpHeaderDateFormat().parse(value); } catch (ParseException e) { return defaultValue; } }
/** * Returns the date header value with the specified header name. If * there are more than one header value for the specified header name, the * first value is returned. * * @return the header value or the {@code defaultValue} if there is no such * header or the header value is not a formatted date */
Returns the date header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned
getDateHeader
{ "repo_name": "jroper/netty", "path": "codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java", "license": "apache-2.0", "size": 38204 }
[ "java.text.ParseException", "java.util.Date" ]
import java.text.ParseException; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
2,592,293
void setList(List<FtpCmd> cmdList);
void setList(List<FtpCmd> cmdList);
/** * Passes a list of all known commands, including the not implemented commands. * * @param cmdList The list of all available commands. */
Passes a list of all known commands, including the not implemented commands
setList
{ "repo_name": "lbehnke/hermesftp", "path": "src/main/java/com/apporiented/hermesftp/cmd/CmdListAware.java", "license": "gpl-2.0", "size": 1615 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
587,778
public final void close() { try { if (this.raf != null) { this.raf.close(); this.raf = null; } if (this.fc != null) { this.fc.close(); this.fc = null; } System.gc(); } catch (final IOException ex) { throw new BufferedDataError(ex); } }
final void function() { try { if (this.raf != null) { this.raf.close(); this.raf = null; } if (this.fc != null) { this.fc.close(); this.fc = null; } System.gc(); } catch (final IOException ex) { throw new BufferedDataError(ex); } }
/** * Close the file. */
Close the file
close
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/data/buffer/EncogEGBFile.java", "license": "mit", "size": 19189 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,875,691
@JsonAnyGetter public Map<String, Object> additionalProperties() { return this.additionalProperties; }
Map<String, Object> function() { return this.additionalProperties; }
/** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. * * @return the additionalProperties value. */
Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types
additionalProperties
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAdministrativeUnitInner.java", "license": "mit", "size": 9499 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,842,312
public void setFixedDomainAxisSpace(AxisSpace space, boolean notify) { this.fixedDomainAxisSpace = space; if (notify) { fireChangeEvent(); } }
void function(AxisSpace space, boolean notify) { this.fixedDomainAxisSpace = space; if (notify) { fireChangeEvent(); } }
/** * Sets the fixed domain axis space and, if requested, sends a * {@link PlotChangeEvent} to all registered listeners. * * @param space the space (<code>null</code> permitted). * @param notify notify listeners? * * @see #getFixedDomainAxisSpace() * * @since 1.0.9 */
Sets the fixed domain axis space and, if requested, sends a <code>PlotChangeEvent</code> to all registered listeners
setFixedDomainAxisSpace
{ "repo_name": "SOCR/HTML5_WebSite", "path": "SOCR2.8/src/jfreechart/org/jfree/chart/plot/XYPlot.java", "license": "lgpl-3.0", "size": 181916 }
[ "org.jfree.chart.axis.AxisSpace" ]
import org.jfree.chart.axis.AxisSpace;
import org.jfree.chart.axis.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,701,599
public void testCreateStackedValueList1() { DefaultCategoryDataset d = new DefaultCategoryDataset(); d.addValue(1.0, "s0", "c0"); MyRenderer r = new MyRenderer(); List l = r.createStackedValueList(d, "c0", new int[] { 0 }, 0.0, false); assertEquals(2, l.size()); assertEquals(new Double(0.0), ((Object[]) l.get(0))[1]); assertEquals(new Double(1.0), ((Object[]) l.get(1))[1]); }
void function() { DefaultCategoryDataset d = new DefaultCategoryDataset(); d.addValue(1.0, "s0", "c0"); MyRenderer r = new MyRenderer(); List l = r.createStackedValueList(d, "c0", new int[] { 0 }, 0.0, false); assertEquals(2, l.size()); assertEquals(new Double(0.0), ((Object[]) l.get(0))[1]); assertEquals(new Double(1.0), ((Object[]) l.get(1))[1]); }
/** * A test for the createStackedValueList() method. */
A test for the createStackedValueList() method
testCreateStackedValueList1
{ "repo_name": "JSansalone/JFreeChart", "path": "tests/org/jfree/chart/renderer/category/junit/StackedBarRenderer3DTests.java", "license": "lgpl-2.1", "size": 16428 }
[ "java.util.List", "org.jfree.data.category.DefaultCategoryDataset" ]
import java.util.List; import org.jfree.data.category.DefaultCategoryDataset;
import java.util.*; import org.jfree.data.category.*;
[ "java.util", "org.jfree.data" ]
java.util; org.jfree.data;
907,409
public Document asDocument() throws WeiboException { if (null == responseAsDocument) { try { // it should be faster to read the inputstream directly. // but makes it difficult to troubleshoot this.responseAsDocument = builders.get().parse(new ByteArrayInputStream(asString().getBytes("UTF-8"))); } catch (SAXException saxe) { throw new WeiboException("The response body was not well-formed:\n" + responseAsString, saxe); } catch (IOException ioe) { throw new WeiboException("There's something with the connection.", ioe); } } return responseAsDocument; }
Document function() throws WeiboException { if (null == responseAsDocument) { try { this.responseAsDocument = builders.get().parse(new ByteArrayInputStream(asString().getBytes("UTF-8"))); } catch (SAXException saxe) { throw new WeiboException(STR + responseAsString, saxe); } catch (IOException ioe) { throw new WeiboException(STR, ioe); } } return responseAsDocument; }
/** * Returns the response body as org.w3c.dom.Document.<br> * Disconnects the internal HttpURLConnection silently. * @return response body as org.w3c.dom.Document * @throws WeiboException */
Returns the response body as org.w3c.dom.Document. Disconnects the internal HttpURLConnection silently
asDocument
{ "repo_name": "alexcaisenchuan/wemap", "path": "src/com/weibo/sdk/android/http/Response.java", "license": "apache-2.0", "size": 9912 }
[ "com.weibo.sdk.android.model.WeiboException", "java.io.ByteArrayInputStream", "java.io.IOException", "org.w3c.dom.Document", "org.xml.sax.SAXException" ]
import com.weibo.sdk.android.model.WeiboException; import java.io.ByteArrayInputStream; import java.io.IOException; import org.w3c.dom.Document; import org.xml.sax.SAXException;
import com.weibo.sdk.android.model.*; import java.io.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "com.weibo.sdk", "java.io", "org.w3c.dom", "org.xml.sax" ]
com.weibo.sdk; java.io; org.w3c.dom; org.xml.sax;
1,756,110
String save(File fileArgument) throws IOException { if (config == null) { return "Current application config is null. This is a bug. Contact the administrator."; } if (uri != null) { if (uri.getScheme() != null) { final String configAsAString = config.root().render(configRenderOptions); documentHelper.write(Paths.get(uri.getPath()), Serioulizer.createStream(configAsAString)); } } // rename the existing file with a timestamp final String standardName; if (fileArgument != null) { standardName = fileArgument.getCanonicalPath(); } else { if (uri == null || uri.getScheme() == null || !uri.getScheme().equals("file")) { throw new IOException("uri is null, or uri.scheme is null, or uri.scheme is not 'file' : nowhere to save ..."); } standardName = uri.getPath(); } final String timestampedName; int lastDot = standardName.lastIndexOf('.'); if (lastDot != -1) { timestampedName = standardName.substring(0, lastDot) + getTimeStamp() + standardName.substring(lastDot); } else { timestampedName = standardName + getTimeStamp(); } final File backup = new File(timestampedName); new File(standardName).renameTo(backup); // write the new content to the standard application config filename final File newConfig = new File(standardName); try (Writer fileWriter = new OutputStreamWriter(new FileOutputStream(newConfig), Charsets.UTF_8.name())) { final String configAsAString = config.root().render(configRenderOptions); fileWriter.write(configAsAString); fileWriter.flush(); fileWriter.close(); } return "New configuration saved to \n\t" + newConfig.getCanonicalPath() + "\nPrevious configuration backuped to \n\t" + backup.getCanonicalPath(); } } // end of class ConfigSourceApplication // // helper methods //
String save(File fileArgument) throws IOException { if (config == null) { return STR; } if (uri != null) { if (uri.getScheme() != null) { final String configAsAString = config.root().render(configRenderOptions); documentHelper.write(Paths.get(uri.getPath()), Serioulizer.createStream(configAsAString)); } } final String standardName; if (fileArgument != null) { standardName = fileArgument.getCanonicalPath(); } else { if (uri == null uri.getScheme() == null !uri.getScheme().equals("file")) { throw new IOException(STR); } standardName = uri.getPath(); } final String timestampedName; int lastDot = standardName.lastIndexOf('.'); if (lastDot != -1) { timestampedName = standardName.substring(0, lastDot) + getTimeStamp() + standardName.substring(lastDot); } else { timestampedName = standardName + getTimeStamp(); } final File backup = new File(timestampedName); new File(standardName).renameTo(backup); final File newConfig = new File(standardName); try (Writer fileWriter = new OutputStreamWriter(new FileOutputStream(newConfig), Charsets.UTF_8.name())) { final String configAsAString = config.root().render(configRenderOptions); fileWriter.write(configAsAString); fileWriter.flush(); fileWriter.close(); } return STR + newConfig.getCanonicalPath() + STR + backup.getCanonicalPath(); } } //
/** * this save function variant with a file argument is only here to enable testing * hence the 'package' visibility */
this save function variant with a file argument is only here to enable testing hence the 'package' visibility
save
{ "repo_name": "aequologica/geppaequo", "path": "geppaequo-config/src/main/java/net/aequologica/neo/geppaequo/config/ConfigManager.java", "license": "mit", "size": 20438 }
[ "com.google.common.base.Charsets", "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "java.io.OutputStreamWriter", "java.io.Writer", "java.nio.file.Paths", "net.aequologica.neo.serioulizer.Serioulizer" ]
import com.google.common.base.Charsets; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.file.Paths; import net.aequologica.neo.serioulizer.Serioulizer;
import com.google.common.base.*; import java.io.*; import java.nio.file.*; import net.aequologica.neo.serioulizer.*;
[ "com.google.common", "java.io", "java.nio", "net.aequologica.neo" ]
com.google.common; java.io; java.nio; net.aequologica.neo;
267,989
@SuppressWarnings("deprecation") private boolean checkBlock(ChunkSnapshot chunk, int x, int y, int z) { int type = chunk.getBlockTypeId(x, y, z); if (type != 0) { // AIR int space1 = chunk.getBlockTypeId(x, y + 1, z); int space2 = chunk.getBlockTypeId(x, y + 2, z); if ((space1 == 0 && space2 == 0) || (space1 == Material.PORTAL.getId() && space2 == Material.PORTAL.getId())) { // Now there is a chance that this is a safe spot // Check for safe ground Material mat = Material.getMaterial(type); if (!mat.toString().contains("FENCE") && !mat.toString().contains("DOOR") && !mat.toString().contains("GATE") && !mat.toString().contains("PLATE")) { switch (mat) { // Unsafe case ANVIL: case BARRIER: case BOAT: case CACTUS: case DOUBLE_PLANT: case ENDER_PORTAL: case FIRE: case FLOWER_POT: case LADDER: case LAVA: case LEVER: case LONG_GRASS: case PISTON_EXTENSION: case PISTON_MOVING_PIECE: case PORTAL: case SIGN_POST: case SKULL: case STANDING_BANNER: case STATIONARY_LAVA: case STATIONARY_WATER: case STONE_BUTTON: case TORCH: case TRIPWIRE: case WATER: case WEB: case WOOD_BUTTON: //System.out.println("Block is dangerous " + mat.toString()); break; default: // Safe // System.out.println("Block is safe " + mat.toString()); return true; } } } } return false; }}); } }
@SuppressWarnings(STR) boolean function(ChunkSnapshot chunk, int x, int y, int z) { int type = chunk.getBlockTypeId(x, y, z); if (type != 0) { int space1 = chunk.getBlockTypeId(x, y + 1, z); int space2 = chunk.getBlockTypeId(x, y + 2, z); if ((space1 == 0 && space2 == 0) (space1 == Material.PORTAL.getId() && space2 == Material.PORTAL.getId())) { Material mat = Material.getMaterial(type); if (!mat.toString().contains("FENCE") && !mat.toString().contains("DOOR") && !mat.toString().contains("GATE") && !mat.toString().contains("PLATE")) { switch (mat) { case ANVIL: case BARRIER: case BOAT: case CACTUS: case DOUBLE_PLANT: case ENDER_PORTAL: case FIRE: case FLOWER_POT: case LADDER: case LAVA: case LEVER: case LONG_GRASS: case PISTON_EXTENSION: case PISTON_MOVING_PIECE: case PORTAL: case SIGN_POST: case SKULL: case STANDING_BANNER: case STATIONARY_LAVA: case STATIONARY_WATER: case STONE_BUTTON: case TORCH: case TRIPWIRE: case WATER: case WEB: case WOOD_BUTTON: break; default: return true; } } } } return false; }}); } }
/** * Returns true if the location is a safe one. * @param chunk * @param x * @param y * @param z * @return */
Returns true if the location is a safe one
checkBlock
{ "repo_name": "jaxzin/askyblock", "path": "src/com/wasteofplastic/askyblock/SafeSpotTeleport.java", "license": "gpl-2.0", "size": 12360 }
[ "org.bukkit.ChunkSnapshot", "org.bukkit.Material" ]
import org.bukkit.ChunkSnapshot; import org.bukkit.Material;
import org.bukkit.*;
[ "org.bukkit" ]
org.bukkit;
2,310,909
void updateKnown(TskData.FileKnown newKnownStatus) { known = newKnownStatus; }
void updateKnown(TskData.FileKnown newKnownStatus) { known = newKnownStatus; }
/** * Update the known status for this node * * @param newKnownStatus The new known status */
Update the known status for this node
updateKnown
{ "repo_name": "sleuthkit/autopsy", "path": "Core/src/org/sleuthkit/autopsy/centralrepository/application/NodeData.java", "license": "apache-2.0", "size": 7497 }
[ "org.sleuthkit.datamodel.TskData" ]
import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.datamodel.*;
[ "org.sleuthkit.datamodel" ]
org.sleuthkit.datamodel;
2,839,410
public void remove(File file, JobStorage context) { if (file != null) { remove(context.getContextFilePath(file)); } }
void function(File file, JobStorage context) { if (file != null) { remove(context.getContextFilePath(file)); } }
/** Remove all occurences of the provided File value from the list of values. * * @param file the file to use * @param context the job context */
Remove all occurences of the provided File value from the list of values
remove
{ "repo_name": "daisy/pipeline-issues", "path": "clientlib/java/clientlib-java/src/main/java/org/daisy/pipeline/client/models/Argument.java", "license": "apache-2.0", "size": 24737 }
[ "java.io.File", "org.daisy.pipeline.client.filestorage.JobStorage" ]
import java.io.File; import org.daisy.pipeline.client.filestorage.JobStorage;
import java.io.*; import org.daisy.pipeline.client.filestorage.*;
[ "java.io", "org.daisy.pipeline" ]
java.io; org.daisy.pipeline;
65,324
Optional<E> find(Function<? super E, Boolean> predicate);
Optional<E> find(Function<? super E, Boolean> predicate);
/** * Find an element in this list that satisfies the given predicate. * * @param predicate Predicate to check for * @return Optional containing the first element satisfying * the predicate, or empty Optional if no such element */
Find an element in this list that satisfies the given predicate
find
{ "repo_name": "jpmossin/hlist", "path": "src/main/java/com/github/jpmossin/hlist/HList.java", "license": "mit", "size": 4377 }
[ "java.util.Optional", "java.util.function.Function" ]
import java.util.Optional; import java.util.function.Function;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
1,748,133
protected void close() throws SQLException { try { sessionInput.close(); sessionOutput.close(); clientSocket.close(); setTraceOff(); if (dbtable != null) for (Enumeration e = dbtable.elements() ; e.hasMoreElements() ;) { ((Database) e.nextElement()).close(); } }catch (IOException e) {} // ignore IOException when we are shutting down finally { state = CLOSED; dbtable = null; database = null; } }
void function() throws SQLException { try { sessionInput.close(); sessionOutput.close(); clientSocket.close(); setTraceOff(); if (dbtable != null) for (Enumeration e = dbtable.elements() ; e.hasMoreElements() ;) { ((Database) e.nextElement()).close(); } }catch (IOException e) {} finally { state = CLOSED; dbtable = null; database = null; } }
/** * Close session - close connection sockets and set state to closed * */
Close session - close connection sockets and set state to closed
close
{ "repo_name": "scnakandala/derby", "path": "java/drda/org/apache/derby/impl/drda/Session.java", "license": "apache-2.0", "size": 9491 }
[ "java.io.IOException", "java.sql.SQLException", "java.util.Enumeration" ]
import java.io.IOException; import java.sql.SQLException; import java.util.Enumeration;
import java.io.*; import java.sql.*; import java.util.*;
[ "java.io", "java.sql", "java.util" ]
java.io; java.sql; java.util;
995,127
public NamedSQLQueryDefinition getSQLQuery(String name);
NamedSQLQueryDefinition function(String name);
/** * Get named SQL query metadata. * * @param name The named SQL query name. * @return The meatdata, or null if none found. */
Get named SQL query metadata
getSQLQuery
{ "repo_name": "kevin-chen-hw/LDAE", "path": "com.huawei.soa.ldae/src/main/java/org/hibernate/cfg/Mappings.java", "license": "lgpl-2.1", "size": 27333 }
[ "org.hibernate.engine.spi.NamedSQLQueryDefinition" ]
import org.hibernate.engine.spi.NamedSQLQueryDefinition;
import org.hibernate.engine.spi.*;
[ "org.hibernate.engine" ]
org.hibernate.engine;
819,913
private boolean interruptAndJoinThreads(List<Thread> threads) { // interrupt and wait for all ongoing create threads for(Thread t : threads) { t.interrupt(); } for(Thread t : threads) { try { t.join(); } catch (InterruptedException e) { DataNode.LOG.warn("interruptOngoingCreates: t=" + t, e); return false; } } return true; }
boolean function(List<Thread> threads) { for(Thread t : threads) { t.interrupt(); } for(Thread t : threads) { try { t.join(); } catch (InterruptedException e) { DataNode.LOG.warn(STR + t, e); return false; } } return true; }
/** * Try to interrupt all of the given threads, and join on them. * If interrupted, returns false, indicating some threads may * still be running. */
Try to interrupt all of the given threads, and join on them. If interrupted, returns false, indicating some threads may still be running
interruptAndJoinThreads
{ "repo_name": "Seagate/hadoop-on-lustre", "path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java", "license": "apache-2.0", "size": 74997 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,982,629
@SuppressWarnings("unused") private static JSONObject handleListJobs(String cursor, int count) { throw new RuntimeException("Job listing is not implemented yet."); }
@SuppressWarnings(STR) static JSONObject function(String cursor, int count) { throw new RuntimeException(STR); }
/** * Handle the list_jobs AJAX command. */
Handle the list_jobs AJAX command
handleListJobs
{ "repo_name": "BryceARich/TransactionsMR", "path": "java/src/main/java/com/google/appengine/tools/mapreduce/impl/handlers/StatusHandler.java", "license": "apache-2.0", "size": 10140 }
[ "org.json.JSONObject" ]
import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
472,972
@SuppressWarnings({ "rawtypes", "unchecked" }) private String transform(Object value, Class<?> type) { if (value == null) return null; if (value instanceof String) return (String) value; final Transformer transformer = TransformerFactory .getTransfromer(type); if (transformer == null) return null; return transformer.transform(type, value); }
@SuppressWarnings({ STR, STR }) String function(Object value, Class<?> type) { if (value == null) return null; if (value instanceof String) return (String) value; final Transformer transformer = TransformerFactory .getTransfromer(type); if (transformer == null) return null; return transformer.transform(type, value); }
/** * Transforms an value * * @param value * the raw typed value * @param type * the input type * @return the string representing <tt>value</tt> */
Transforms an value
transform
{ "repo_name": "l2jserver2/l2jserver2", "path": "l2jserver2-common/src/main/java/com/l2jserver/service/configuration/XMLConfigurationService.java", "license": "gpl-3.0", "size": 8607 }
[ "com.l2jserver.util.transformer.Transformer", "com.l2jserver.util.transformer.TransformerFactory" ]
import com.l2jserver.util.transformer.Transformer; import com.l2jserver.util.transformer.TransformerFactory;
import com.l2jserver.util.transformer.*;
[ "com.l2jserver.util" ]
com.l2jserver.util;
25,888
public static List<Pair<String, SourceBuilder>> getSourceBuilders() { List<Pair<String, SourceBuilder>> builders = new ArrayList<Pair<String, SourceBuilder>>(); builders.add(new Pair<String, SourceBuilder>("helloWorldSource", builder())); return builders; }
static List<Pair<String, SourceBuilder>> function() { List<Pair<String, SourceBuilder>> builders = new ArrayList<Pair<String, SourceBuilder>>(); builders.add(new Pair<String, SourceBuilder>(STR, builder())); return builders; }
/** * This is a special function used by the SourceFactory to pull in this class * as a plugin source. */
This is a special function used by the SourceFactory to pull in this class as a plugin source
getSourceBuilders
{ "repo_name": "frankgrimes97/flume", "path": "plugins/flume-plugin-helloworld/src/main/java/helloworld/HelloWorldSource.java", "license": "apache-2.0", "size": 2770 }
[ "com.cloudera.flume.conf.SourceFactory", "com.cloudera.util.Pair", "java.util.ArrayList", "java.util.List" ]
import com.cloudera.flume.conf.SourceFactory; import com.cloudera.util.Pair; import java.util.ArrayList; import java.util.List;
import com.cloudera.flume.conf.*; import com.cloudera.util.*; import java.util.*;
[ "com.cloudera.flume", "com.cloudera.util", "java.util" ]
com.cloudera.flume; com.cloudera.util; java.util;
853,692
public static void openUserCode(Function stub, Configuration parameters) throws Exception { try { FunctionUtils.openFunction(stub, parameters); } catch (Throwable t) { throw new Exception("The user defined 'open(Configuration)' method in " + stub.getClass().toString() + " caused an exception: " + t.getMessage(), t); } }
static void function(Function stub, Configuration parameters) throws Exception { try { FunctionUtils.openFunction(stub, parameters); } catch (Throwable t) { throw new Exception(STR + stub.getClass().toString() + STR + t.getMessage(), t); } }
/** * Opens the given stub using its {@link org.apache.flink.api.common.functions.RichFunction#open(Configuration)} method. If the open call produces * an exception, a new exception with a standard error message is created, using the encountered exception * as its cause. * * @param stub The user code instance to be opened. * @param parameters The parameters supplied to the user code. * * @throws Exception Thrown, if the user code's open method produces an exception. */
Opens the given stub using its <code>org.apache.flink.api.common.functions.RichFunction#open(Configuration)</code> method. If the open call produces an exception, a new exception with a standard error message is created, using the encountered exception as its cause
openUserCode
{ "repo_name": "zhangminglei/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java", "license": "apache-2.0", "size": 55381 }
[ "org.apache.flink.api.common.functions.Function", "org.apache.flink.api.common.functions.util.FunctionUtils", "org.apache.flink.configuration.Configuration" ]
import org.apache.flink.api.common.functions.Function; import org.apache.flink.api.common.functions.util.FunctionUtils; import org.apache.flink.configuration.Configuration;
import org.apache.flink.api.common.functions.*; import org.apache.flink.api.common.functions.util.*; import org.apache.flink.configuration.*;
[ "org.apache.flink" ]
org.apache.flink;
1,792,455
public Builder stepSize(int val) { if (val <= 0) { throw new IllegalArgumentException("stepSize must be greater than 0."); } stepSize = val; return this; } } public AscendingLongList(IntegerSpecification numberSpec, List<FuzzingHeuristic> owners, long seed, Builder builder) throws NoMatchingValuesException { if (numberSpec == null) { this.numberSpec = RequestFactory.INSTANCE.createNumberSpecification(); } else { this.numberSpec = numberSpec; } this.owners = new LinkedList<>(owners); this.owners.add(this); this.seed = seed; Builder matchingBuilder = makeBuilderMatchingSpecification(builder); startInt = matchingBuilder.startInt; size = matchingBuilder.size; stepSize = matchingBuilder.stepSize; }
Builder function(int val) { if (val <= 0) { throw new IllegalArgumentException(STR); } stepSize = val; return this; } } AscendingLongList(IntegerSpecification numberSpec, List<FuzzingHeuristic> owners, long seed, Builder builder) throws NoMatchingValuesException { if (numberSpec == null) { this.numberSpec = RequestFactory.INSTANCE.createNumberSpecification(); } else { this.numberSpec = numberSpec; } this.owners = new LinkedList<>(owners); this.owners.add(this); this.seed = seed; Builder matchingBuilder = makeBuilderMatchingSpecification(builder); startInt = matchingBuilder.startInt; size = matchingBuilder.size; function = matchingBuilder.stepSize; }
/** * Determines the difference between each computed integer that is the number of omitted integers + 1. * Optional, default is 1. * * @param val the difference between each computed integer. * @return this Builder instance. */
Determines the difference between each computed integer that is the number of omitted integers + 1. Optional, default is 1
stepSize
{ "repo_name": "fraunhoferfokus/Fuzzino", "path": "src/main/java/de/fraunhofer/fokus/fuzzing/fuzzino/heuristics/generators/number/AscendingLongList.java", "license": "apache-2.0", "size": 5647 }
[ "de.fraunhofer.fokus.fuzzing.fuzzino.exceptions.NoMatchingValuesException", "de.fraunhofer.fokus.fuzzing.fuzzino.heuristics.FuzzingHeuristic", "de.fraunhofer.fokus.fuzzing.fuzzino.request.IntegerSpecification", "de.fraunhofer.fokus.fuzzing.fuzzino.request.RequestFactory", "java.util.LinkedList", "java.util.List" ]
import de.fraunhofer.fokus.fuzzing.fuzzino.exceptions.NoMatchingValuesException; import de.fraunhofer.fokus.fuzzing.fuzzino.heuristics.FuzzingHeuristic; import de.fraunhofer.fokus.fuzzing.fuzzino.request.IntegerSpecification; import de.fraunhofer.fokus.fuzzing.fuzzino.request.RequestFactory; import java.util.LinkedList; import java.util.List;
import de.fraunhofer.fokus.fuzzing.fuzzino.exceptions.*; import de.fraunhofer.fokus.fuzzing.fuzzino.heuristics.*; import de.fraunhofer.fokus.fuzzing.fuzzino.request.*; import java.util.*;
[ "de.fraunhofer.fokus", "java.util" ]
de.fraunhofer.fokus; java.util;
798,420
public double getYUtoD2(GeoDate t) { if(t == null) return Double.NaN; return getLayer().getYPtoD2(yTransform_.getTransP(t)); }
double function(GeoDate t) { if(t == null) return Double.NaN; return getLayer().getYPtoD2(yTransform_.getTransP(t)); }
/** * Transform time to device coordinate. * @since 3.0 */
Transform time to device coordinate
getYUtoD2
{ "repo_name": "luttero/Maud", "path": "src/gov/noaa/pmel/sgt/CartesianGraph.java", "license": "bsd-3-clause", "size": 28021 }
[ "gov.noaa.pmel.util.GeoDate" ]
import gov.noaa.pmel.util.GeoDate;
import gov.noaa.pmel.util.*;
[ "gov.noaa.pmel" ]
gov.noaa.pmel;
1,323,935
public static void closeParent(Container cont) { Dialog dialog; Frame frame; JFrame jframe; JInternalFrame jintframe; int i; WindowListener[] listeners; WindowEvent event; if (getParentDialog(cont) != null) { dialog = getParentDialog(cont); dialog.setVisible(false); } else if (getParentFrame(cont) != null) { jintframe = getParentInternalFrame(cont); if (jintframe != null) { jintframe.doDefaultCloseAction(); } else { frame = getParentFrame(cont); if (frame instanceof JFrame) { jframe = (JFrame) frame; if (jframe.getDefaultCloseOperation() == JFrame.HIDE_ON_CLOSE) jframe.setVisible(false); else if (jframe.getDefaultCloseOperation() == JFrame.DISPOSE_ON_CLOSE) jframe.dispose(); else if (jframe.getDefaultCloseOperation() == JFrame.EXIT_ON_CLOSE) System.exit(0); // notify listeners listeners = jframe.getWindowListeners(); event = new WindowEvent(jframe, WindowEvent.WINDOW_CLOSED); for (i = 0; i < listeners.length; i++) listeners[i].windowClosed(event); } else { frame.dispose(); } } } }
static void function(Container cont) { Dialog dialog; Frame frame; JFrame jframe; JInternalFrame jintframe; int i; WindowListener[] listeners; WindowEvent event; if (getParentDialog(cont) != null) { dialog = getParentDialog(cont); dialog.setVisible(false); } else if (getParentFrame(cont) != null) { jintframe = getParentInternalFrame(cont); if (jintframe != null) { jintframe.doDefaultCloseAction(); } else { frame = getParentFrame(cont); if (frame instanceof JFrame) { jframe = (JFrame) frame; if (jframe.getDefaultCloseOperation() == JFrame.HIDE_ON_CLOSE) jframe.setVisible(false); else if (jframe.getDefaultCloseOperation() == JFrame.DISPOSE_ON_CLOSE) jframe.dispose(); else if (jframe.getDefaultCloseOperation() == JFrame.EXIT_ON_CLOSE) System.exit(0); listeners = jframe.getWindowListeners(); event = new WindowEvent(jframe, WindowEvent.WINDOW_CLOSED); for (i = 0; i < listeners.length; i++) listeners[i].windowClosed(event); } else { frame.dispose(); } } } }
/** * Closes the parent dialog/frame of this container. * * @param cont the container to close the parent for */
Closes the parent dialog/frame of this container
closeParent
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-core/src/main/java/adams/gui/core/GUIHelper.java", "license": "gpl-3.0", "size": 88762 }
[ "java.awt.Container", "java.awt.Dialog", "java.awt.Frame", "java.awt.event.WindowEvent", "java.awt.event.WindowListener", "javax.swing.JFrame", "javax.swing.JInternalFrame" ]
import java.awt.Container; import java.awt.Dialog; import java.awt.Frame; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JFrame; import javax.swing.JInternalFrame;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
245,471
boolean isBlocked(ForgeDirection side);
boolean isBlocked(ForgeDirection side);
/** * Used to test for FMP microblock blocking internally. * * @return returns if microblocks are blocking this cable path. */
Used to test for FMP microblock blocking internally
isBlocked
{ "repo_name": "Gamoholic/Applied-Energistics-2-API", "path": "parts/IPartHost.java", "license": "mit", "size": 3031 }
[ "net.minecraftforge.common.ForgeDirection" ]
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.*;
[ "net.minecraftforge.common" ]
net.minecraftforge.common;
1,914,476
public Object property(String name, String propname) { Object prop = datasets.get(name).property(propname); if (prop instanceof QDataSet) { return nameFor((QDataSet) prop); } else if (prop instanceof Units) { Units dsu= SemanticOps.getUnits( datasets.get(name) ); for ( Units u: prefUnits ) { if ( u.isConvertibleTo( dsu ) ) { return u.toString(); } } return prop.toString(); } else if ( propname.equals(QDataSet.FILL_VALUE) && this.useFill ) { return this.fill; } else { return prop; } }
Object function(String name, String propname) { Object prop = datasets.get(name).property(propname); if (prop instanceof QDataSet) { return nameFor((QDataSet) prop); } else if (prop instanceof Units) { Units dsu= SemanticOps.getUnits( datasets.get(name) ); for ( Units u: prefUnits ) { if ( u.isConvertibleTo( dsu ) ) { return u.toString(); } } return prop.toString(); } else if ( propname.equals(QDataSet.FILL_VALUE) && this.useFill ) { return this.fill; } else { return prop; } }
/** * returns one of String, int, double, float, int[], double, float[] * @param name * @param propname * @return */
returns one of String, int, double, float, int[], double, float[]
property
{ "repo_name": "autoplot/app", "path": "IdlMatlabSupport/src/org/autoplot/idlsupport/QDataSetBridge.java", "license": "gpl-2.0", "size": 45224 }
[ "org.das2.datum.Units", "org.das2.qds.QDataSet", "org.das2.qds.SemanticOps" ]
import org.das2.datum.Units; import org.das2.qds.QDataSet; import org.das2.qds.SemanticOps;
import org.das2.datum.*; import org.das2.qds.*;
[ "org.das2.datum", "org.das2.qds" ]
org.das2.datum; org.das2.qds;
962,255
List<CoderProvider> getCoderProviders();
List<CoderProvider> getCoderProviders();
/** * Returns a list of {@link CoderProvider coder providers} which * will be registered by default within each {@link CoderRegistry coder registry} instance. * * <p>See {@link CoderProviders} for convenience methods to construct a {@link CoderProvider}. */
Returns a list of <code>CoderProvider coder providers</code> which will be registered by default within each <code>CoderRegistry coder registry</code> instance. See <code>CoderProviders</code> for convenience methods to construct a <code>CoderProvider</code>
getCoderProviders
{ "repo_name": "dhalperi/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderProviderRegistrar.java", "license": "apache-2.0", "size": 1761 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,380,246
void placeAtFirstPossiblePosition( final IGroupMemberNode node, final Set<IVariable<?>> additionalKnownBound, final boolean requiresAllBound) { placeAtPosition(node, getFirstPossiblePosition( node, additionalKnownBound, requiresAllBound)); definitelyProduced.addAll(bindingInfoMap.get(node).getDefinitelyProduced()); }
void placeAtFirstPossiblePosition( final IGroupMemberNode node, final Set<IVariable<?>> additionalKnownBound, final boolean requiresAllBound) { placeAtPosition(node, getFirstPossiblePosition( node, additionalKnownBound, requiresAllBound)); definitelyProduced.addAll(bindingInfoMap.get(node).getDefinitelyProduced()); }
/** * Places the given node at the first possible position in the non-optional * non-minus list of the partition, where the first possible position is * derived from the binding requirements of the node. * * NOTE: requires the node to be contained in the partitions binding info map. */
Places the given node at the first possible position in the non-optional non-minus list of the partition, where the first possible position is derived from the binding requirements of the node
placeAtFirstPossiblePosition
{ "repo_name": "blazegraph/database", "path": "bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/optimizers/ASTJoinGroupPartition.java", "license": "gpl-2.0", "size": 17982 }
[ "com.bigdata.bop.IVariable", "com.bigdata.rdf.sparql.ast.IGroupMemberNode", "java.util.Set" ]
import com.bigdata.bop.IVariable; import com.bigdata.rdf.sparql.ast.IGroupMemberNode; import java.util.Set;
import com.bigdata.bop.*; import com.bigdata.rdf.sparql.ast.*; import java.util.*;
[ "com.bigdata.bop", "com.bigdata.rdf", "java.util" ]
com.bigdata.bop; com.bigdata.rdf; java.util;
424,660
EAttribute getTFBrickDCConfiguration_DriveMode();
EAttribute getTFBrickDCConfiguration_DriveMode();
/** * Returns the meta object for the attribute '{@link org.openhab.binding.tinkerforge.internal.model.TFBrickDCConfiguration#getDriveMode <em>Drive Mode</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Drive Mode</em>'. * @see org.openhab.binding.tinkerforge.internal.model.TFBrickDCConfiguration#getDriveMode() * @see #getTFBrickDCConfiguration() * @generated */
Returns the meta object for the attribute '<code>org.openhab.binding.tinkerforge.internal.model.TFBrickDCConfiguration#getDriveMode Drive Mode</code>'.
getTFBrickDCConfiguration_DriveMode
{ "repo_name": "noushadali/openhab", "path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java", "license": "gpl-3.0", "size": 247420 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,609,283
final IRawStore store = new SimpleMemoryRawStore(); final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setRawRecords(true); metadata.setMaxRecLen(64); final BTree btree = BTree.create(store, metadata); assertEquals(64, btree.getMaxRecLen()); assertTrue(((ILeafData) btree.getRoot()).hasRawRecords()); final byte[] key = new byte[] { 1 }; final byte[] val = new byte[btree.getMaxRecLen() + 1]; r.nextBytes(val); // insert an entry under that key. assertNull(btree.insert(key, val)); // examine the root leaf. final Leaf root = (Leaf) btree.getRoot(); // the addr of the raw record. final long addr = root.getRawRecord(0); assertTrue(addr != IRawStore.NULL); // read the raw record from the store. final ByteBuffer actual = btree.readRawRecord(addr); // verify that the expected data were read. TestCase3.assertEquals(val, actual); }
final IRawStore store = new SimpleMemoryRawStore(); final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setRawRecords(true); metadata.setMaxRecLen(64); final BTree btree = BTree.create(store, metadata); assertEquals(64, btree.getMaxRecLen()); assertTrue(((ILeafData) btree.getRoot()).hasRawRecords()); final byte[] key = new byte[] { 1 }; final byte[] val = new byte[btree.getMaxRecLen() + 1]; r.nextBytes(val); assertNull(btree.insert(key, val)); final Leaf root = (Leaf) btree.getRoot(); final long addr = root.getRawRecord(0); assertTrue(addr != IRawStore.NULL); final ByteBuffer actual = btree.readRawRecord(addr); TestCase3.assertEquals(val, actual); }
/** * Unit test for the insert of a large <code>byte[]</code> value into an * index such that it is represented as a raw record on the backing store * rather than inline within the B+Tree leaf. */
Unit test for the insert of a large <code>byte[]</code> value into an index such that it is represented as a raw record on the backing store rather than inline within the B+Tree leaf
test_insertLargeValue
{ "repo_name": "smalyshev/blazegraph", "path": "bigdata/src/test/com/bigdata/btree/TestRawRecords.java", "license": "gpl-2.0", "size": 10734 }
[ "com.bigdata.btree.data.ILeafData", "com.bigdata.io.TestCase3", "com.bigdata.rawstore.IRawStore", "com.bigdata.rawstore.SimpleMemoryRawStore", "java.nio.ByteBuffer", "java.util.UUID" ]
import com.bigdata.btree.data.ILeafData; import com.bigdata.io.TestCase3; import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; import java.nio.ByteBuffer; import java.util.UUID;
import com.bigdata.btree.data.*; import com.bigdata.io.*; import com.bigdata.rawstore.*; import java.nio.*; import java.util.*;
[ "com.bigdata.btree", "com.bigdata.io", "com.bigdata.rawstore", "java.nio", "java.util" ]
com.bigdata.btree; com.bigdata.io; com.bigdata.rawstore; java.nio; java.util;
2,634,574
//----------// // setWidth // //----------// public void setWidth (int unitWidth) { Rectangle newBox = getBox(); reset(); newBox.width = unitWidth; setBox(newBox); getCenter(); }
void function (int unitWidth) { Rectangle newBox = getBox(); reset(); newBox.width = unitWidth; setBox(newBox); getCenter(); }
/** * Set the system width. * * @param unitWidth the system width, in units */
Set the system width
setWidth
{ "repo_name": "jlpoolen/libreveris", "path": "src/main/omr/score/entity/ScoreSystem.java", "license": "lgpl-3.0", "size": 16629 }
[ "java.awt.Rectangle" ]
import java.awt.Rectangle;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,720,329
public static ClickWatchModelPackage init() { if (isInited) return (ClickWatchModelPackage)EPackage.Registry.INSTANCE.getEPackage(ClickWatchModelPackage.eNS_URI); // Obtain or create and register package ClickWatchModelPackageImpl theClickWatchModelPackage = (ClickWatchModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ClickWatchModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ClickWatchModelPackageImpl()); isInited = true; // Initialize simple dependencies XMLTypePackage.eINSTANCE.eClass(); // Create package meta-data objects theClickWatchModelPackage.createPackageContents(); // Initialize created meta-data theClickWatchModelPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theClickWatchModelPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(ClickWatchModelPackage.eNS_URI, theClickWatchModelPackage); return theClickWatchModelPackage; }
static ClickWatchModelPackage function() { if (isInited) return (ClickWatchModelPackage)EPackage.Registry.INSTANCE.getEPackage(ClickWatchModelPackage.eNS_URI); ClickWatchModelPackageImpl theClickWatchModelPackage = (ClickWatchModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ClickWatchModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ClickWatchModelPackageImpl()); isInited = true; XMLTypePackage.eINSTANCE.eClass(); theClickWatchModelPackage.createPackageContents(); theClickWatchModelPackage.initializePackageContents(); theClickWatchModelPackage.freeze(); EPackage.Registry.INSTANCE.put(ClickWatchModelPackage.eNS_URI, theClickWatchModelPackage); return theClickWatchModelPackage; }
/** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link ClickWatchModelPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */
Creates, registers, and initializes the Package for this model, and for any others upon which it depends. This method is used to initialize <code>ClickWatchModelPackage#eINSTANCE</code> when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
init
{ "repo_name": "markus1978/clickwatch", "path": "core/de.hub.clickwatch.core/src/de/hub/clickwatch/model/impl/ClickWatchModelPackageImpl.java", "license": "apache-2.0", "size": 36214 }
[ "de.hub.clickwatch.model.ClickWatchModelPackage", "org.eclipse.emf.ecore.EPackage", "org.eclipse.emf.ecore.xml.type.XMLTypePackage" ]
import de.hub.clickwatch.model.ClickWatchModelPackage; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import de.hub.clickwatch.model.*; import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.xml.type.*;
[ "de.hub.clickwatch", "org.eclipse.emf" ]
de.hub.clickwatch; org.eclipse.emf;
2,526,118
public static void writeBoolArray(DataOutput out, boolean[] boolArray) throws IOException { WritableUtils.writeVInt(out, boolArray.length); byte b = 0; int i = 0; for(i=0; i<boolArray.length; i++) { if(i % 8 == 0 && i != 0) { out.writeByte(b); b = 0; } b >>= 1; if(boolArray[i]) b |= 0x80; else b &= 0x7F; } if(i % 8 != 0) { for(int j=0; j < 8 - (i % 8); j++) { //shift for the remaining byte b >>=1; b &= 0x7F; } } out.writeByte(b); }
static void function(DataOutput out, boolean[] boolArray) throws IOException { WritableUtils.writeVInt(out, boolArray.length); byte b = 0; int i = 0; for(i=0; i<boolArray.length; i++) { if(i % 8 == 0 && i != 0) { out.writeByte(b); b = 0; } b >>= 1; if(boolArray[i]) b = 0x80; else b &= 0x7F; } if(i % 8 != 0) { for(int j=0; j < 8 - (i % 8); j++) { b >>=1; b &= 0x7F; } } out.writeByte(b); }
/** * Writes a boolean[] to the output. */
Writes a boolean[] to the output
writeBoolArray
{ "repo_name": "enis/gora", "path": "gora-core/src/main/java/org/gora/util/IOUtils.java", "license": "apache-2.0", "size": 15056 }
[ "java.io.DataOutput", "java.io.IOException", "org.apache.hadoop.io.WritableUtils" ]
import java.io.DataOutput; import java.io.IOException; import org.apache.hadoop.io.WritableUtils;
import java.io.*; import org.apache.hadoop.io.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,458,675
private static void checkDatum(final String inhalt) { Datum datum = new Datum("Test-Datum", inhalt); assertEquals(inhalt, datum.getInhalt()); assertTrue(datum + " should be a valid date", datum.isValid()); }
static void function(final String inhalt) { Datum datum = new Datum(STR, inhalt); assertEquals(inhalt, datum.getInhalt()); assertTrue(datum + STR, datum.isValid()); }
/** * Check datum. * * @param inhalt the inhalt */
Check datum
checkDatum
{ "repo_name": "oboehm/gdv.xport", "path": "lib/src/test/java/gdv/xport/feld/DatumTest.java", "license": "apache-2.0", "size": 6549 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
153,287
@Override public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ProducerInfo info = (ProducerInfo) o; info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); BrokerId value[] = new BrokerId[size]; for (int i = 0; i < size; i++) { value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } info.setDispatchAsync(bs.readBoolean()); info.setWindowSize(dataIn.readInt()); }
void function(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ProducerInfo info = (ProducerInfo) o; info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); BrokerId value[] = new BrokerId[size]; for (int i = 0; i < size; i++) { value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } info.setDispatchAsync(bs.readBoolean()); info.setWindowSize(dataIn.readInt()); }
/** * Un-marshal an object instance from the data input stream * * @param o * the object to un-marshal * @param dataIn * the data input stream to build the object from * @throws IOException */
Un-marshal an object instance from the data input stream
tightUnmarshal
{ "repo_name": "tabish121/OpenWire", "path": "openwire-legacy/src/main/java/io/openwire/codec/v3/ProducerInfoMarshaller.java", "license": "apache-2.0", "size": 6086 }
[ "io.openwire.codec.BooleanStream", "io.openwire.codec.OpenWireFormat", "io.openwire.commands.BrokerId", "io.openwire.commands.OpenWireDestination", "io.openwire.commands.ProducerId", "io.openwire.commands.ProducerInfo", "java.io.DataInput", "java.io.IOException" ]
import io.openwire.codec.BooleanStream; import io.openwire.codec.OpenWireFormat; import io.openwire.commands.BrokerId; import io.openwire.commands.OpenWireDestination; import io.openwire.commands.ProducerId; import io.openwire.commands.ProducerInfo; import java.io.DataInput; import java.io.IOException;
import io.openwire.codec.*; import io.openwire.commands.*; import java.io.*;
[ "io.openwire.codec", "io.openwire.commands", "java.io" ]
io.openwire.codec; io.openwire.commands; java.io;
1,853,852
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<ServicePrincipalInner> createAsync(ServicePrincipalCreateParameters parameters) { return createWithResponseAsync(parameters) .flatMap( (Response<ServicePrincipalInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<ServicePrincipalInner> function(ServicePrincipalCreateParameters parameters) { return createWithResponseAsync(parameters) .flatMap( (Response<ServicePrincipalInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); }
/** * Creates a service principal in the directory. * * @param parameters Request parameters for creating a new service principal. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws GraphErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return active Directory service principal information. */
Creates a service principal in the directory
createAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsClientImpl.java", "license": "mit", "size": 83566 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner", "com.azure.resourcemanager.authorization.models.ServicePrincipalCreateParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalInner; import com.azure.resourcemanager.authorization.models.ServicePrincipalCreateParameters;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.authorization.fluent.models.*; import com.azure.resourcemanager.authorization.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
163,303
@Override public FileHandle getRawFileHandle(String fileHandleId) throws SynapseException { return getJSONEntity(getFileEndpoint(), FILE_HANDLE + "/" + fileHandleId, FileHandle.class); }
FileHandle function(String fileHandleId) throws SynapseException { return getJSONEntity(getFileEndpoint(), FILE_HANDLE + "/" + fileHandleId, FileHandle.class); }
/** * Get the raw file handle. Note: Only the creator of a the file handle can * get the raw file handle. * * @param fileHandleId * @return * @throws SynapseException */
Get the raw file handle. Note: Only the creator of a the file handle can get the raw file handle
getRawFileHandle
{ "repo_name": "zimingd/Synapse-Repository-Services", "path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java", "license": "apache-2.0", "size": 229293 }
[ "org.sagebionetworks.client.exceptions.SynapseException", "org.sagebionetworks.repo.model.file.FileHandle" ]
import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.file.FileHandle;
import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.file.*;
[ "org.sagebionetworks.client", "org.sagebionetworks.repo" ]
org.sagebionetworks.client; org.sagebionetworks.repo;
698,364
static ASN1Type getInstance() { return ASN1_ELEMENT; } private Element element; private byte[] encoded; public Asn1Element(byte[] encoded) { byte[] copy = new byte[encoded.length]; System.arraycopy(encoded, 0, copy, 0, copy.length); this.encoded = copy; } public Asn1Element(Element element) { if (element == null) { throw new NullPointerException(); } this.element = element; }
static ASN1Type getInstance() { return ASN1_ELEMENT; } private Element element; private byte[] encoded; public Asn1Element(byte[] encoded) { byte[] copy = new byte[encoded.length]; System.arraycopy(encoded, 0, copy, 0, copy.length); this.encoded = copy; } public Asn1Element(Element element) { if (element == null) { throw new NullPointerException(); } this.element = element; }
/** * It returns an <code>ASN1Type</code> value that contains the ASN.1 * codification rules for an <code>Element</code> with its encoder and * decoder. * <p> * Among other things, this method can be used to declare the types of new * fields in other structures, as for example, in an <code>Asn1DTD</code>. * * @return The value that defines an ASN.1 <code>Element</code> * representation with its encoder/decoder. */
It returns an <code>ASN1Type</code> value that contains the ASN.1 codification rules for an <code>Element</code> with its encoder and decoder. Among other things, this method can be used to declare the types of new fields in other structures, as for example, in an <code>Asn1DTD</code>
getInstance
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/swing/src/main/java/common/javax/swing/text/html/parser/Asn1Element.java", "license": "gpl-2.0", "size": 15771 }
[ "org.apache.harmony.security.asn1.ASN1Type" ]
import org.apache.harmony.security.asn1.ASN1Type;
import org.apache.harmony.security.asn1.*;
[ "org.apache.harmony" ]
org.apache.harmony;
1,189,798
@FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.LastFragment) public Boolean getLastFragment() { return lastFragment; }
@FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.LastFragment) Boolean function() { return lastFragment; }
/** * Message field getter. * @return field value */
Message field getter
getLastFragment
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/ListStatusMsg.java", "license": "gpl-3.0", "size": 27069 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
675,575
public List<ExpressRouteCircuitPeeringInner> peerings() { return this.peerings; }
List<ExpressRouteCircuitPeeringInner> function() { return this.peerings; }
/** * Get the list of peerings. * * @return the peerings value */
Get the list of peerings
peerings
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/ExpressRouteCircuitInner.java", "license": "mit", "size": 13272 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
229,784
public Collection<Node> getTransformedNodes() { return nodes; }
Collection<Node> function() { return nodes; }
/** * Get the nodes with the current transformation applied. */
Get the nodes with the current transformation applied
getTransformedNodes
{ "repo_name": "CURocketry/Ground_Station_GUI", "path": "src/org/openstreetmap/josm/command/TransformNodesCommand.java", "license": "gpl-3.0", "size": 3912 }
[ "java.util.Collection", "org.openstreetmap.josm.data.osm.Node" ]
import java.util.Collection; import org.openstreetmap.josm.data.osm.Node;
import java.util.*; import org.openstreetmap.josm.data.osm.*;
[ "java.util", "org.openstreetmap.josm" ]
java.util; org.openstreetmap.josm;
1,478,443
private void initSortDataRows() throws Exception { measureCount = carbonTable.getMeasureByTableName(tableName).size(); List<CarbonDimension> dimensions = carbonTable.getDimensionByTableName(tableName); noDictionaryColMapping = new boolean[dimensions.size()]; int i = 0; for (CarbonDimension dimension : dimensions) { if (CarbonUtil.hasEncoding(dimension.getEncoder(), Encoding.DICTIONARY)) { i++; continue; } noDictionaryColMapping[i++] = true; noDictionaryCount++; } dimensionColumnCount = dimensions.size(); SortParameters parameters = createSortParameters(); intermediateFileMerger = new SortIntermediateFileMerger(parameters); // TODO: Now it is only supported onheap merge, but we can have unsafe merge // as well by using UnsafeSortDataRows. this.sortDataRows = new SortDataRows(parameters, intermediateFileMerger); try { this.sortDataRows.initialize(); } catch (CarbonSortKeyAndGroupByException e) { LOGGER.error(e); throw new Exception( "Error initializing sort data rows object during compaction: " + e.getMessage()); } }
void function() throws Exception { measureCount = carbonTable.getMeasureByTableName(tableName).size(); List<CarbonDimension> dimensions = carbonTable.getDimensionByTableName(tableName); noDictionaryColMapping = new boolean[dimensions.size()]; int i = 0; for (CarbonDimension dimension : dimensions) { if (CarbonUtil.hasEncoding(dimension.getEncoder(), Encoding.DICTIONARY)) { i++; continue; } noDictionaryColMapping[i++] = true; noDictionaryCount++; } dimensionColumnCount = dimensions.size(); SortParameters parameters = createSortParameters(); intermediateFileMerger = new SortIntermediateFileMerger(parameters); this.sortDataRows = new SortDataRows(parameters, intermediateFileMerger); try { this.sortDataRows.initialize(); } catch (CarbonSortKeyAndGroupByException e) { LOGGER.error(e); throw new Exception( STR + e.getMessage()); } }
/** * create an instance of sort data rows */
create an instance of sort data rows
initSortDataRows
{ "repo_name": "ksimar/incubator-carbondata", "path": "processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java", "license": "apache-2.0", "size": 15014 }
[ "java.util.List", "org.apache.carbondata.core.metadata.encoder.Encoding", "org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension", "org.apache.carbondata.core.util.CarbonUtil", "org.apache.carbondata.processing.sortandgroupby.exception.CarbonSortKeyAndGroupByException", "org.apache.carbondata.processing.sortandgroupby.sortdata.SortDataRows", "org.apache.carbondata.processing.sortandgroupby.sortdata.SortIntermediateFileMerger", "org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters" ]
import java.util.List; import org.apache.carbondata.core.metadata.encoder.Encoding; import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension; import org.apache.carbondata.core.util.CarbonUtil; import org.apache.carbondata.processing.sortandgroupby.exception.CarbonSortKeyAndGroupByException; import org.apache.carbondata.processing.sortandgroupby.sortdata.SortDataRows; import org.apache.carbondata.processing.sortandgroupby.sortdata.SortIntermediateFileMerger; import org.apache.carbondata.processing.sortandgroupby.sortdata.SortParameters;
import java.util.*; import org.apache.carbondata.core.metadata.encoder.*; import org.apache.carbondata.core.metadata.schema.table.column.*; import org.apache.carbondata.core.util.*; import org.apache.carbondata.processing.sortandgroupby.exception.*; import org.apache.carbondata.processing.sortandgroupby.sortdata.*;
[ "java.util", "org.apache.carbondata" ]
java.util; org.apache.carbondata;
624,641
@ServiceMethod(returns = ReturnType.SINGLE) Mono<DomainInner> transferOutAsync(String resourceGroupName, String domainName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<DomainInner> transferOutAsync(String resourceGroupName, String domainName);
/** * Transfer out domain to another registrar. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @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. * @return information about a domain on successful completion of {@link Mono}. */
Transfer out domain to another registrar
transferOutAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java", "license": "mit", "size": 55229 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.appservice.fluent.models.DomainInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.appservice.fluent.models.DomainInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.appservice.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
143,055
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(CountryNameCodeType.class)) { case XALPackage.COUNTRY_NAME_CODE_TYPE__CODE: case XALPackage.COUNTRY_NAME_CODE_TYPE__SCHEME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case XALPackage.COUNTRY_NAME_CODE_TYPE__MIXED: case XALPackage.COUNTRY_NAME_CODE_TYPE__ANY_ATTRIBUTE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(CountryNameCodeType.class)) { case XALPackage.COUNTRY_NAME_CODE_TYPE__CODE: case XALPackage.COUNTRY_NAME_CODE_TYPE__SCHEME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case XALPackage.COUNTRY_NAME_CODE_TYPE__MIXED: case XALPackage.COUNTRY_NAME_CODE_TYPE__ANY_ATTRIBUTE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "markus1978/citygml4emf", "path": "de.hub.citygml.emf.ecore.edit/src/org/oasis/xAL/provider/CountryNameCodeTypeItemProvider.java", "license": "apache-2.0", "size": 8111 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification", "org.oasis.xAL.CountryNameCodeType", "org.oasis.xAL.XALPackage" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.oasis.xAL.CountryNameCodeType; import org.oasis.xAL.XALPackage;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.oasis.*;
[ "org.eclipse.emf", "org.oasis" ]
org.eclipse.emf; org.oasis;
1,829,848
private JSType getJSType(Node n) { JSType jsType = n.getJSType(); if (jsType == null) { // TODO(user): This branch indicates a compiler bug, not worthy of // halting the compilation but we should log this and analyze to track // down why it happens. This is not critical and will be resolved over // time as the type checker is extended. return compiler.getTypeRegistry().getNativeType( JSTypeNative.UNKNOWN_TYPE); } else { return jsType; } } private class Property { final String oldName; String newName; int numOccurrences; boolean skipAmbiguating; JSTypeBitSet relatedTypes = new JSTypeBitSet(intForType.size()); Property(String name) { this.oldName = name; // Properties with this suffix are handled in RenameProperties. if (name.startsWith(SKIP_PREFIX)) { skipAmbiguating = true; } }
JSType function(Node n) { JSType jsType = n.getJSType(); if (jsType == null) { return compiler.getTypeRegistry().getNativeType( JSTypeNative.UNKNOWN_TYPE); } else { return jsType; } } private class Property { final String oldName; String newName; int numOccurrences; boolean skipAmbiguating; JSTypeBitSet relatedTypes = new JSTypeBitSet(intForType.size()); Property(String name) { this.oldName = name; if (name.startsWith(SKIP_PREFIX)) { skipAmbiguating = true; } }
/** * This method gets the JSType from the Node argument and verifies that it is * present. */
This method gets the JSType from the Node argument and verifies that it is present
getJSType
{ "repo_name": "olegshnitko/closure-compiler", "path": "src/com/google/javascript/jscomp/AmbiguateProperties.java", "license": "apache-2.0", "size": 21334 }
[ "com.google.javascript.rhino.Node", "com.google.javascript.rhino.jstype.JSType", "com.google.javascript.rhino.jstype.JSTypeNative" ]
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType; import com.google.javascript.rhino.jstype.JSTypeNative;
import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
1,468,644
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJRootPane(); } return accessibleContext; }
AccessibleContext function() { if (accessibleContext == null) { accessibleContext = new AccessibleJRootPane(); } return accessibleContext; }
/** * Returns the accessible context for the root pane. * * @return the accessible context for the root pane */
Returns the accessible context for the root pane
getAccessibleContext
{ "repo_name": "shannah/cn1", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/swing/src/main/java/common/javax/swing/JRootPane.java", "license": "gpl-2.0", "size": 12287 }
[ "javax.accessibility.AccessibleContext" ]
import javax.accessibility.AccessibleContext;
import javax.accessibility.*;
[ "javax.accessibility" ]
javax.accessibility;
1,210,299
public static byte[] drawableToByteArray(Drawable drawable) { Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); return stream.toByteArray(); }
static byte[] function(Drawable drawable) { Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); return stream.toByteArray(); }
/** * drawable converter to byte array * * @param drawable drawable * @return byte array */
drawable converter to byte array
drawableToByteArray
{ "repo_name": "ChinaSunHZ/ProjectUtils", "path": "app/src/main/java/com/sunhz/projectutils/imageutils/ImageUtils.java", "license": "apache-2.0", "size": 16072 }
[ "android.graphics.Bitmap", "android.graphics.drawable.BitmapDrawable", "android.graphics.drawable.Drawable", "java.io.ByteArrayOutputStream" ]
import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import java.io.ByteArrayOutputStream;
import android.graphics.*; import android.graphics.drawable.*; import java.io.*;
[ "android.graphics", "java.io" ]
android.graphics; java.io;
1,625,350
public final BuilderType setCustomButtonBar(@LayoutRes int resourceId) { getProduct().setCustomButtonBar(resourceId); return self(); }
final BuilderType function(@LayoutRes int resourceId) { getProduct().setCustomButtonBar(resourceId); return self(); }
/** * Sets the custom view, which should be used to show the buttons of the dialog, which is * created by the builder. * * @param resourceId * The resource id of the view, which should be set, as an {@link Integer} value. The * resource id must correspond to a valid layout resource * @return The builder, the method has been called upon, as an instance of the generic type * BuilderType */
Sets the custom view, which should be used to show the buttons of the dialog, which is created by the builder
setCustomButtonBar
{ "repo_name": "michael-rapp/AndroidMaterialDialog", "path": "library/src/main/java/de/mrapp/android/dialog/builder/AbstractButtonBarDialogBuilder.java", "license": "apache-2.0", "size": 16533 }
[ "androidx.annotation.LayoutRes" ]
import androidx.annotation.LayoutRes;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,776,790
EClass getRemoteSwitchCConfiguration();
EClass getRemoteSwitchCConfiguration();
/** * Returns the meta object for class '{@link org.openhab.binding.tinkerforge.internal.model.RemoteSwitchCConfiguration <em>Remote Switch CConfiguration</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Remote Switch CConfiguration</em>'. * @see org.openhab.binding.tinkerforge.internal.model.RemoteSwitchCConfiguration * @generated */
Returns the meta object for class '<code>org.openhab.binding.tinkerforge.internal.model.RemoteSwitchCConfiguration Remote Switch CConfiguration</code>'.
getRemoteSwitchCConfiguration
{ "repo_name": "gregfinley/openhab", "path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java", "license": "epl-1.0", "size": 665067 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
64,047
public StringBuffer format() { // if (QtdVolumes != null && QtdVolumes.compareTo(Env.ZERO) == 0) QtdVolumes = null; if (PesoLiq != null && PesoLiq.compareTo(Env.ZERO) == 0) PesoLiq = null; if (PesoBruto != null && PesoBruto.compareTo(Env.ZERO) == 0) PesoBruto = null; // int sizeQtdVolumes = QtdVolumes == null || QtdVolumes.compareTo(Env.ZERO) == 0 ? 0 : 15; // return new StringBuffer(TipoDeRegistro + PIPE + TextUtil.checkSize (ModalidadeFrete, 1, 1) + PIPE + TextUtil.checkSizeN (CNPJ_CPF, 11, 14, false) + PIPE + TextUtil.checkSize (RazaoSocial, 1, 60, false) + PIPE + TextUtil.checkSizeN (IE, 2, 14, false) + PIPE + TextUtil.checkSize (EnderecoCompleto, 1, 60, false) + PIPE + TextUtil.checkSize (NomeMunicipio, 1, 60, false) + PIPE + TextUtil.checkSize (UF, 2, 2, false) + PIPE + TextUtil.checkSize (PLACA, 1, 8, false) + PIPE + TextUtil.checkSize (SiglaUFPlaca, 2, 2, false) + PIPE + TextUtil.lPad (QtdVolumes, sizeQtdVolumes) + PIPE + TextUtil.checkSize (EspecieVolumes, 1, 60, false) + PIPE + TextUtil.checkSize (MarcaVolumes, 1, 60, false) + PIPE + TextUtil.checkSize (NumDosVolumes, 1, 60, false) + PIPE + TextUtil.toNumeric (PesoLiq, 15, 15, false) + PIPE + TextUtil.toNumeric (PesoBruto, 15, 15, false) + PIPE + TextUtil.EOL_WIN32); }
StringBuffer function() { QtdVolumes = null; if (PesoLiq != null && PesoLiq.compareTo(Env.ZERO) == 0) PesoLiq = null; if (PesoBruto != null && PesoBruto.compareTo(Env.ZERO) == 0) PesoBruto = null; TextUtil.checkSize (ModalidadeFrete, 1, 1) + PIPE + TextUtil.checkSizeN (CNPJ_CPF, 11, 14, false) + PIPE + TextUtil.checkSize (RazaoSocial, 1, 60, false) + PIPE + TextUtil.checkSizeN (IE, 2, 14, false) + PIPE + TextUtil.checkSize (EnderecoCompleto, 1, 60, false) + PIPE + TextUtil.checkSize (NomeMunicipio, 1, 60, false) + PIPE + TextUtil.checkSize (UF, 2, 2, false) + PIPE + TextUtil.checkSize (PLACA, 1, 8, false) + PIPE + TextUtil.checkSize (SiglaUFPlaca, 2, 2, false) + PIPE + TextUtil.lPad (QtdVolumes, sizeQtdVolumes) + PIPE + TextUtil.checkSize (EspecieVolumes, 1, 60, false) + PIPE + TextUtil.checkSize (MarcaVolumes, 1, 60, false) + PIPE + TextUtil.checkSize (NumDosVolumes, 1, 60, false) + PIPE + TextUtil.toNumeric (PesoLiq, 15, 15, false) + PIPE + TextUtil.toNumeric (PesoBruto, 15, 15, false) + PIPE + TextUtil.EOL_WIN32); }
/** * Formata o Registro 50 * * @return */
Formata o Registro 50
format
{ "repo_name": "mgrigioni/oseb", "path": "rdef/src/org/adempierelbr/redf/beans/Registro50.java", "license": "gpl-2.0", "size": 4527 }
[ "org.adempierelbr.util.TextUtil", "org.compiere.util.Env" ]
import org.adempierelbr.util.TextUtil; import org.compiere.util.Env;
import org.adempierelbr.util.*; import org.compiere.util.*;
[ "org.adempierelbr.util", "org.compiere.util" ]
org.adempierelbr.util; org.compiere.util;
2,819,909
public void addPredicates(List<P> predicateList) { this.predicates.addAll(predicateList); }
void function(List<P> predicateList) { this.predicates.addAll(predicateList); }
/** * Add a list of predicates * * @param predicateList the predicaes to be added */
Add a list of predicates
addPredicates
{ "repo_name": "Venom590/gradoop", "path": "gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/matching/common/query/predicates/PredicateCollection.java", "license": "gpl-3.0", "size": 4242 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,110,709
private void doStopDiscovery() { Log.i(TAG, "doStopDiscovery()"); assert(mBusAttachmentState == BusAttachmentState.CONNECTED); mBus.cancelFindAdvertisedName(NAME_PREFIX); mBusAttachmentState = BusAttachmentState.CONNECTED; }
void function() { Log.i(TAG, STR); assert(mBusAttachmentState == BusAttachmentState.CONNECTED); mBus.cancelFindAdvertisedName(NAME_PREFIX); mBusAttachmentState = BusAttachmentState.CONNECTED; }
/** * Implementation of the functionality related to stopping discovery of * remote apps which are hosting chat channels. */
Implementation of the functionality related to stopping discovery of remote apps which are hosting chat channels
doStopDiscovery
{ "repo_name": "FirstBuild/ATTHackathon", "path": "AllJoyn+GreenBean/android/app/src/main/java/org/alljoyn/bus/sample/chat/AllJoynService.java", "license": "mit", "size": 54957 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,045,164
public void setDateCreated(final Date dateCreated) { this.dateCreated = dateCreated; }
void function(final Date dateCreated) { this.dateCreated = dateCreated; }
/** * Set the date the notification was created. * * @param dateCreated the date to set. */
Set the date the notification was created
setDateCreated
{ "repo_name": "mssavai/muzima-api", "path": "src/main/java/com/muzima/api/model/Notification.java", "license": "mpl-2.0", "size": 3911 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,000,269
public static void setup(Component c) { input = new Input(); ListenerGroup lg = new ListenerGroup(); c.addKeyListener(lg); c.addMouseListener(lg); c.addMouseMotionListener(lg); input.originalComponentWidth = c.getWidth(); input.originalComponentHeight = c.getHeight(); c.addComponentListener(new ComponentListener() {
static void function(Component c) { input = new Input(); ListenerGroup lg = new ListenerGroup(); c.addKeyListener(lg); c.addMouseListener(lg); c.addMouseMotionListener(lg); input.originalComponentWidth = c.getWidth(); input.originalComponentHeight = c.getHeight(); c.addComponentListener(new ComponentListener() {
/** * Sets up the input system. * * @param c The GUI component that has the OS focus */
Sets up the input system
setup
{ "repo_name": "Istarnion/Magic2D", "path": "Magic2D/src/magic/input/Input.java", "license": "cc0-1.0", "size": 8523 }
[ "java.awt.Component", "java.awt.event.ComponentListener" ]
import java.awt.Component; import java.awt.event.ComponentListener;
import java.awt.*; import java.awt.event.*;
[ "java.awt" ]
java.awt;
730,878
protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { GuiListWorldSelectionEntry guilistworldselectionentry = this.selectionList.getSelectedWorld(); if (button.id == 2) { if (guilistworldselectionentry != null) { guilistworldselectionentry.deleteWorld(); } } else if (button.id == 1) { if (guilistworldselectionentry != null) { guilistworldselectionentry.joinWorld(); } } else if (button.id == 3) { this.mc.displayGuiScreen(new GuiCreateWorld(this)); } else if (button.id == 4) { if (guilistworldselectionentry != null) { guilistworldselectionentry.editWorld(); } } else if (button.id == 0) { this.mc.displayGuiScreen(this.prevScreen); } else if (button.id == 5 && guilistworldselectionentry != null) { guilistworldselectionentry.recreateWorld(); } } }
void function(GuiButton button) throws IOException { if (button.enabled) { GuiListWorldSelectionEntry guilistworldselectionentry = this.selectionList.getSelectedWorld(); if (button.id == 2) { if (guilistworldselectionentry != null) { guilistworldselectionentry.deleteWorld(); } } else if (button.id == 1) { if (guilistworldselectionentry != null) { guilistworldselectionentry.joinWorld(); } } else if (button.id == 3) { this.mc.displayGuiScreen(new GuiCreateWorld(this)); } else if (button.id == 4) { if (guilistworldselectionentry != null) { guilistworldselectionentry.editWorld(); } } else if (button.id == 0) { this.mc.displayGuiScreen(this.prevScreen); } else if (button.id == 5 && guilistworldselectionentry != null) { guilistworldselectionentry.recreateWorld(); } } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */
Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
actionPerformed
{ "repo_name": "MartyParty21/AwakenDreamsClient", "path": "mcp/src/minecraft/net/minecraft/client/gui/GuiWorldSelection.java", "license": "gpl-3.0", "size": 5914 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
160,785
public ArrayList<PersistentDependency> getDependList() { return _dependList; }
ArrayList<PersistentDependency> function() { return _dependList; }
/** * Gets the depend list. */
Gets the depend list
getDependList
{ "repo_name": "WelcomeHUME/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/ejb/cfg/EjbBean.java", "license": "gpl-2.0", "size": 47328 }
[ "com.caucho.vfs.PersistentDependency", "java.util.ArrayList" ]
import com.caucho.vfs.PersistentDependency; import java.util.ArrayList;
import com.caucho.vfs.*; import java.util.*;
[ "com.caucho.vfs", "java.util" ]
com.caucho.vfs; java.util;
1,407,721
public void setSafe(int index, int start, ArrowBuf buffer) { handleSafe(index); set(index, start, buffer); }
void function(int index, int start, ArrowBuf buffer) { handleSafe(index); set(index, start, buffer); }
/** * Same as {@link #set(int, int, ArrowBuf)} except that it handles the * case when index is greater than or equal to existing * value capacity {@link #getValueCapacity()}. * * @param index position of element * @param start start index of data in the buffer * @param buffer ArrowBuf containing decimal value. */
Same as <code>#set(int, int, ArrowBuf)</code> except that it handles the case when index is greater than or equal to existing value capacity <code>#getValueCapacity()</code>
setSafe
{ "repo_name": "siddharthteotia/arrow", "path": "java/vector/src/main/java/org/apache/arrow/vector/DecimalVector.java", "license": "apache-2.0", "size": 15952 }
[ "io.netty.buffer.ArrowBuf" ]
import io.netty.buffer.ArrowBuf;
import io.netty.buffer.*;
[ "io.netty.buffer" ]
io.netty.buffer;
2,914,842
public static void resizeView(final View pView) { final RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) pView .getLayoutParams(); layoutParams.width = (int) convertDpToPixel(layoutParams.width); layoutParams.height = (int) convertDpToPixel(layoutParams.height); layoutParams.topMargin = (int) convertDpToPixel(layoutParams.topMargin); layoutParams.leftMargin = (int) convertDpToPixel(layoutParams.leftMargin); pView.setLayoutParams(layoutParams); }
static void function(final View pView) { final RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) pView .getLayoutParams(); layoutParams.width = (int) convertDpToPixel(layoutParams.width); layoutParams.height = (int) convertDpToPixel(layoutParams.height); layoutParams.topMargin = (int) convertDpToPixel(layoutParams.topMargin); layoutParams.leftMargin = (int) convertDpToPixel(layoutParams.leftMargin); pView.setLayoutParams(layoutParams); }
/** * Auto Resize View: View, ImageView, TextView, Layout..... * * @param pView * the view */
Auto Resize View: View, ImageView, TextView, Layout....
resizeView
{ "repo_name": "randauto/vothuatviet", "path": "VoThuatViet/src/com/vothuat/viet/utils/LayoutUtil.java", "license": "apache-2.0", "size": 11089 }
[ "android.view.View", "android.widget.RelativeLayout" ]
import android.view.View; import android.widget.RelativeLayout;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
981,502
public static void requestToggleFullScreen(final Window window) { call(application, "requestToggleFullScreen", new Class<?>[]{ Window.class }, new Object[]{ window }); } // -- DEPRECATED API --
static void function(final Window window) { call(application, STR, new Class<?>[]{ Window.class }, new Object[]{ window }); }
/** * Requests that a {@link Window} should animate into or out of full screen mode. * Only {@link Window}s marked as full screenable by {@link FullScreenUtilities#setWindowCanFullScreen(Window, boolean)} can be toggled. * * @param window to animate into or out of full screen mode * * @since Java for Mac OS X 10.7 Update 1 */
Requests that a <code>Window</code> should animate into or out of full screen mode. Only <code>Window</code>s marked as full screenable by <code>FullScreenUtilities#setWindowCanFullScreen(Window, boolean)</code> can be toggled
requestToggleFullScreen
{ "repo_name": "myinon/jmacinator", "path": "src/lib/apple/eawt/Application.java", "license": "gpl-3.0", "size": 39684 }
[ "java.awt.Window" ]
import java.awt.Window;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,869,266
private void calculate() { Value[] vals = getValues(); if (vals.length == 0) { return; } setThirdLabel(vals[2]); if (vals[2].isZero()) { return; } try { Value result = Core.dilution(vals[0], vals[1], vals[2]); if (calcTypeIsVolume()) { ((EditText) findViewById(R.id.editV2)).setText(result .toString()); } else { ((EditText) findViewById(R.id.editC2)).setText(result .toString()); } } catch (NumberFormatException e) { alert(e); } catch (ArithmeticException e) { alert(e); } catch (IllegalArgumentException e) { alert(e.getMessage()); } }
void function() { Value[] vals = getValues(); if (vals.length == 0) { return; } setThirdLabel(vals[2]); if (vals[2].isZero()) { return; } try { Value result = Core.dilution(vals[0], vals[1], vals[2]); if (calcTypeIsVolume()) { ((EditText) findViewById(R.id.editV2)).setText(result .toString()); } else { ((EditText) findViewById(R.id.editC2)).setText(result .toString()); } } catch (NumberFormatException e) { alert(e); } catch (ArithmeticException e) { alert(e); } catch (IllegalArgumentException e) { alert(e.getMessage()); } }
/** * main calculation method: get values, check preconditions, set labels and * result values */
main calculation method: get values, check preconditions, set labels and result values
calculate
{ "repo_name": "kzr-pzr/Dilution", "path": "src/sk/fotopriestor/dilution/MainActivity.java", "license": "mit", "size": 6047 }
[ "android.widget.EditText", "sk.fotopriestor.dilution.core.Core", "sk.fotopriestor.dilution.core.Value" ]
import android.widget.EditText; import sk.fotopriestor.dilution.core.Core; import sk.fotopriestor.dilution.core.Value;
import android.widget.*; import sk.fotopriestor.dilution.core.*;
[ "android.widget", "sk.fotopriestor.dilution" ]
android.widget; sk.fotopriestor.dilution;
1,928,501
@SuppressWarnings("unchecked") protected void rehash( final int newN ) { int i = first, prev = -1, newPrev = -1, t, pos; float k; final float key[] = this.key; final int newMask = newN - 1; final float newKey[] = new float[ newN ]; final boolean newUsed[] = new boolean[ newN ]; final long link[] = this.link; final long newLink[] = new long[ newN ]; first = -1; for( int j = size; j-- != 0; ) { k = key[ i ]; pos = ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( strategy.hashCode(k) ) ) & newMask; while ( newUsed[ pos ] ) pos = ( pos + 1 ) & newMask; newUsed[ pos ] = true; newKey[ pos ] = k; if ( prev != -1 ) { newLink[ newPrev ] ^= ( ( newLink[ newPrev ] ^ ( pos & 0xFFFFFFFFL ) ) & 0xFFFFFFFFL ); newLink[ pos ] ^= ( ( newLink[ pos ] ^ ( ( newPrev & 0xFFFFFFFFL ) << 32 ) ) & 0xFFFFFFFF00000000L ); newPrev = pos; } else { newPrev = first = pos; // Special case of SET(newLink[ pos ], -1, -1); newLink[ pos ] = -1L; } t = i; i = (int) link[ i ]; prev = t; } n = newN; mask = newMask; maxFill = maxFill( n, f ); this.key = newKey; this.used = newUsed; this.link = newLink; this.last = newPrev; if ( newPrev != -1 ) // Special case of SET_NEXT( newLink[ newPrev ], -1 ); newLink[ newPrev ] |= -1 & 0xFFFFFFFFL; }
@SuppressWarnings(STR) void function( final int newN ) { int i = first, prev = -1, newPrev = -1, t, pos; float k; final float key[] = this.key; final int newMask = newN - 1; final float newKey[] = new float[ newN ]; final boolean newUsed[] = new boolean[ newN ]; final long link[] = this.link; final long newLink[] = new long[ newN ]; first = -1; for( int j = size; j-- != 0; ) { k = key[ i ]; pos = ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( strategy.hashCode(k) ) ) & newMask; while ( newUsed[ pos ] ) pos = ( pos + 1 ) & newMask; newUsed[ pos ] = true; newKey[ pos ] = k; if ( prev != -1 ) { newLink[ newPrev ] ^= ( ( newLink[ newPrev ] ^ ( pos & 0xFFFFFFFFL ) ) & 0xFFFFFFFFL ); newLink[ pos ] ^= ( ( newLink[ pos ] ^ ( ( newPrev & 0xFFFFFFFFL ) << 32 ) ) & 0xFFFFFFFF00000000L ); newPrev = pos; } else { newPrev = first = pos; newLink[ pos ] = -1L; } t = i; i = (int) link[ i ]; prev = t; } n = newN; mask = newMask; maxFill = maxFill( n, f ); this.key = newKey; this.used = newUsed; this.link = newLink; this.last = newPrev; if ( newPrev != -1 ) newLink[ newPrev ] = -1 & 0xFFFFFFFFL; }
/** Resizes the set. * * <P>This method implements the basic rehashing strategy, and may be * overriden by subclasses implementing different rehashing strategies (e.g., * disk-based rehashing). However, you should not override this method * unless you understand the internal workings of this class. * * @param newN the new size */
Resizes the set. This method implements the basic rehashing strategy, and may be overriden by subclasses implementing different rehashing strategies (e.g., disk-based rehashing). However, you should not override this method unless you understand the internal workings of this class
rehash
{ "repo_name": "karussell/fastutil", "path": "src/it/unimi/dsi/fastutil/floats/FloatLinkedOpenCustomHashSet.java", "license": "apache-2.0", "size": 35017 }
[ "it.unimi.dsi.fastutil.HashCommon" ]
import it.unimi.dsi.fastutil.HashCommon;
import it.unimi.dsi.fastutil.*;
[ "it.unimi.dsi" ]
it.unimi.dsi;
1,918,121
public VM createClone(Connection c, String newName) throws BadServerResponse, XenAPIException, XmlRpcException, Types.VmBadPowerState, Types.SrFull, Types.OperationNotAllowed { String method_call = "VM.clone"; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(newName)}; Map response = c.dispatch(method_call, method_params); Object result = response.get("Value"); return Types.toVM(result); }
VM function(Connection c, String newName) throws BadServerResponse, XenAPIException, XmlRpcException, Types.VmBadPowerState, Types.SrFull, Types.OperationNotAllowed { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(newName)}; Map response = c.dispatch(method_call, method_params); Object result = response.get("Value"); return Types.toVM(result); }
/** * Clones the specified VM, making a new VM. Clone automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write). This function can only be called when the VM is in the Halted State. * * @param newName The name of the cloned VM * @return The reference of the newly created VM. */
Clones the specified VM, making a new VM. Clone automatically exploits the capabilities of the underlying storage repository in which the VM's disk images are stored (e.g. Copy on Write). This function can only be called when the VM is in the Halted State
createClone
{ "repo_name": "cinderella/incubator-cloudstack", "path": "deps/XenServerJava/com/xensource/xenapi/VM.java", "license": "apache-2.0", "size": 169722 }
[ "com.xensource.xenapi.Types", "java.util.Map", "org.apache.xmlrpc.XmlRpcException" ]
import com.xensource.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
import com.xensource.xenapi.*; import java.util.*; import org.apache.xmlrpc.*;
[ "com.xensource.xenapi", "java.util", "org.apache.xmlrpc" ]
com.xensource.xenapi; java.util; org.apache.xmlrpc;
1,830,785
private void initilaizePaints() { mDrawPaint.setFakeBoldText(false); mDrawPaint.setAntiAlias(true); mDrawPaint.setStyle(Style.FILL); mMonthNumDrawPaint.setFakeBoldText(true); mMonthNumDrawPaint.setAntiAlias(true); mMonthNumDrawPaint.setStyle(Style.FILL); mMonthNumDrawPaint.setTextAlign(Align.CENTER); mMonthNumDrawPaint.setTextSize(mDateTextSize); }
void function() { mDrawPaint.setFakeBoldText(false); mDrawPaint.setAntiAlias(true); mDrawPaint.setStyle(Style.FILL); mMonthNumDrawPaint.setFakeBoldText(true); mMonthNumDrawPaint.setAntiAlias(true); mMonthNumDrawPaint.setStyle(Style.FILL); mMonthNumDrawPaint.setTextAlign(Align.CENTER); mMonthNumDrawPaint.setTextSize(mDateTextSize); }
/** * Initialize the paint instances. */
Initialize the paint instances
initilaizePaints
{ "repo_name": "reallin/TimePicker", "path": "calendarpicker_library/src/net/simonvt/calendarview/CalendarView.java", "license": "apache-2.0", "size": 65292 }
[ "android.graphics.Paint" ]
import android.graphics.Paint;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
628,981
public Builder withLineSeparator(LineSeparator newValue) { this.lineSeparator = newValue; return this; }
Builder function(LineSeparator newValue) { this.lineSeparator = newValue; return this; }
/** * Sets the line separator. * @param newValue the line separator * @return this */
Sets the line separator
withLineSeparator
{ "repo_name": "cocoatomo/asakusafw", "path": "core-project/asakusa-runtime/src/main/java/com/asakusafw/runtime/io/text/csv/CsvTextFormat.java", "license": "apache-2.0", "size": 10179 }
[ "com.asakusafw.runtime.io.text.LineSeparator" ]
import com.asakusafw.runtime.io.text.LineSeparator;
import com.asakusafw.runtime.io.text.*;
[ "com.asakusafw.runtime" ]
com.asakusafw.runtime;
2,525,776
public void setLaborEntryForManualEdit(LaborOriginEntry laborEntryForManualEdit) { this.laborEntryForManualEdit = laborEntryForManualEdit; }
void function(LaborOriginEntry laborEntryForManualEdit) { this.laborEntryForManualEdit = laborEntryForManualEdit; }
/** * Sets the laborEntryForManualEdit attribute value. * * @param laborEntryForManualEdit The laborEntryForManualEdit to set. */
Sets the laborEntryForManualEdit attribute value
setLaborEntryForManualEdit
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/ld/document/web/struts/LaborCorrectionForm.java", "license": "apache-2.0", "size": 10841 }
[ "org.kuali.kfs.module.ld.businessobject.LaborOriginEntry" ]
import org.kuali.kfs.module.ld.businessobject.LaborOriginEntry;
import org.kuali.kfs.module.ld.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
302,546
public File getPreviousDir() { return new File(root, STORAGE_DIR_PREVIOUS); }
File function() { return new File(root, STORAGE_DIR_PREVIOUS); }
/** * Directory {@code previous} contains the previous file system state, * which the system can be rolled back to. * * @return the directory path */
Directory previous contains the previous file system state, which the system can be rolled back to
getPreviousDir
{ "repo_name": "moreus/hadoop", "path": "hadoop-0.23.10/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java", "license": "apache-2.0", "size": 33976 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,521,782
public void notifyChanged(Notification notification) { int featureId = notification.getFeatureID(YElement.class); switch (notification.getEventType()) { case Notification.ADD: handleModelAdd(featureId, notification); break; case Notification.REMOVE: handleModelRemove(featureId, notification); break; case Notification.MOVE: handleModelMove(featureId, notification); break; case Notification.SET: handleModelSet(featureId, notification); break; default: } }
void function(Notification notification) { int featureId = notification.getFeatureID(YElement.class); switch (notification.getEventType()) { case Notification.ADD: handleModelAdd(featureId, notification); break; case Notification.REMOVE: handleModelRemove(featureId, notification); break; case Notification.MOVE: handleModelMove(featureId, notification); break; case Notification.SET: handleModelSet(featureId, notification); break; default: } }
/** * Is called by the emf model element, if state changed. * * @param notification * notification to be processed */
Is called by the emf model element, if state changed
notifyChanged
{ "repo_name": "lunifera/lunifera-ecview", "path": "org.lunifera.ecview.core.common.editparts.emf/src/org/lunifera/ecview/core/common/editpart/emf/ElementEditpart.java", "license": "epl-1.0", "size": 15797 }
[ "org.eclipse.emf.common.notify.Notification", "org.lunifera.ecview.core.common.model.core.YElement" ]
import org.eclipse.emf.common.notify.Notification; import org.lunifera.ecview.core.common.model.core.YElement;
import org.eclipse.emf.common.notify.*; import org.lunifera.ecview.core.common.model.core.*;
[ "org.eclipse.emf", "org.lunifera.ecview" ]
org.eclipse.emf; org.lunifera.ecview;
2,131,571
public void initializeFinished() { if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SYSTEM_CONFIG_FINISHED_0)); } }
void function() { if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SYSTEM_CONFIG_FINISHED_0)); } }
/** * Will be called when configuration of this object is finished.<p> */
Will be called when configuration of this object is finished
initializeFinished
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/configuration/CmsSystemConfiguration.java", "license": "lgpl-2.1", "size": 113574 }
[ "org.opencms.main.CmsLog" ]
import org.opencms.main.CmsLog;
import org.opencms.main.*;
[ "org.opencms.main" ]
org.opencms.main;
2,045,786
public Object getTypedPropertyValue(final RegisteredService registeredService) { switch (getType()) { case SET: return getPropertyValues(registeredService, Set.class); case INTEGER: return getPropertyIntegerValue(registeredService); case LONG: return getPropertyLongValue(registeredService); case BOOLEAN: return getPropertyBooleanValue(registeredService); default: return getPropertyValue(registeredService).getValue(); } } }
Object function(final RegisteredService registeredService) { switch (getType()) { case SET: return getPropertyValues(registeredService, Set.class); case INTEGER: return getPropertyIntegerValue(registeredService); case LONG: return getPropertyLongValue(registeredService); case BOOLEAN: return getPropertyBooleanValue(registeredService); default: return getPropertyValue(registeredService).getValue(); } } }
/** * Gets typed property value. * * @param registeredService the registered service * @return the typed property value */
Gets typed property value
getTypedPropertyValue
{ "repo_name": "fogbeam/cas_mirror", "path": "api/cas-server-core-api-services/src/main/java/org/apereo/cas/services/RegisteredServiceProperty.java", "license": "apache-2.0", "size": 32006 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
593,508
private void checkNameDeprecation(NodeTraversal t, Node n, Node parent) { // Don't bother checking definitions or constructors. if (parent.getType() == Token.FUNCTION || parent.getType() == Token.VAR || parent.getType() == Token.NEW) { return; } Scope.Var var = t.getScope().getVar(n.getString()); JSDocInfo docInfo = var == null ? null : var.getJSDocInfo(); if (docInfo != null && docInfo.isDeprecated() && shouldEmitDeprecationWarning(t, n, parent)) { if (docInfo.getDeprecationReason() != null) { compiler.report( t.makeError(n, DEPRECATED_NAME_REASON, n.getString(), docInfo.getDeprecationReason())); } else { compiler.report( t.makeError(n, DEPRECATED_NAME, n.getString())); } } }
void function(NodeTraversal t, Node n, Node parent) { if (parent.getType() == Token.FUNCTION parent.getType() == Token.VAR parent.getType() == Token.NEW) { return; } Scope.Var var = t.getScope().getVar(n.getString()); JSDocInfo docInfo = var == null ? null : var.getJSDocInfo(); if (docInfo != null && docInfo.isDeprecated() && shouldEmitDeprecationWarning(t, n, parent)) { if (docInfo.getDeprecationReason() != null) { compiler.report( t.makeError(n, DEPRECATED_NAME_REASON, n.getString(), docInfo.getDeprecationReason())); } else { compiler.report( t.makeError(n, DEPRECATED_NAME, n.getString())); } } }
/** * Checks the given NAME node to ensure that access restrictions are obeyed. */
Checks the given NAME node to ensure that access restrictions are obeyed
checkNameDeprecation
{ "repo_name": "JonathanWalsh/Granule-Closure-Compiler", "path": "src/com/google/javascript/jscomp/CheckAccessControls.java", "license": "apache-2.0", "size": 22275 }
[ "com.google.javascript.jscomp.Scope", "com.google.javascript.rhino.JSDocInfo", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token" ]
import com.google.javascript.jscomp.Scope; import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
2,713,101
public static BEDRecord makeBEDRecord(SequenceFeature lsf, boolean makeUcscCompatible) { String chrom = null; int chromStart = -1; int chromEnd = -1; String name = null; int score = 0; String strand = "."; if (lsf instanceof Chromosome) { return null; } else { Chromosome chr = lsf.getChromosome(); if (chr == null) { return null; } if (lsf.getSymbol() == null) { if (lsf.getPrimaryIdentifier() == null) { name = "(Unknown)"; } else { name = lsf.getPrimaryIdentifier(); } } else { name = lsf.getSymbol(); } name = name.replaceAll(" ", "_"); // replace white space in name to under score Location chrLocation = lsf.getChromosomeLocation(); if (chrLocation == null) { return null; } if (makeUcscCompatible) { chrom = UCSC_CHR_PREFIX + chr.getPrimaryIdentifier(); } else { chrom = chr.getPrimaryIdentifier(); } chromStart = chrLocation.getStart().intValue() - 1; // Interbase Coordinate chromEnd = chrLocation.getEnd().intValue(); if (chrLocation.getStrand() != null) { if ("1".equals(chrLocation.getStrand())) { strand = "+"; } else if ("-1".equals(chrLocation.getStrand())) { strand = "-"; } } } return new BEDRecord(chrom, chromStart, chromEnd, name, score, strand); }
static BEDRecord function(SequenceFeature lsf, boolean makeUcscCompatible) { String chrom = null; int chromStart = -1; int chromEnd = -1; String name = null; int score = 0; String strand = "."; if (lsf instanceof Chromosome) { return null; } else { Chromosome chr = lsf.getChromosome(); if (chr == null) { return null; } if (lsf.getSymbol() == null) { if (lsf.getPrimaryIdentifier() == null) { name = STR; } else { name = lsf.getPrimaryIdentifier(); } } else { name = lsf.getSymbol(); } name = name.replaceAll(" ", "_"); Location chrLocation = lsf.getChromosomeLocation(); if (chrLocation == null) { return null; } if (makeUcscCompatible) { chrom = UCSC_CHR_PREFIX + chr.getPrimaryIdentifier(); } else { chrom = chr.getPrimaryIdentifier(); } chromStart = chrLocation.getStart().intValue() - 1; chromEnd = chrLocation.getEnd().intValue(); if (chrLocation.getStrand() != null) { if ("1".equals(chrLocation.getStrand())) { strand = "+"; } else if ("-1".equals(chrLocation.getStrand())) { strand = "-"; } } } return new BEDRecord(chrom, chromStart, chromEnd, name, score, strand); }
/** * Create a BEDRecord from a LocatedSequenceFeature. * * @param lsf the LocatedSequenceFeature * @param makeUcscCompatible if true prefix 'chr' to chromosome names to work with UCSC genome * browser and Galaxy * @return the BEDRecord or null if this lsf has no Chromosome or no Chromosome location */
Create a BEDRecord from a LocatedSequenceFeature
makeBEDRecord
{ "repo_name": "julie-sullivan/phytomine", "path": "bio/tools/main/src/org/intermine/bio/web/export/BEDUtil.java", "license": "lgpl-2.1", "size": 3303 }
[ "org.intermine.bio.io.bed.BEDRecord", "org.intermine.model.bio.Chromosome", "org.intermine.model.bio.Location", "org.intermine.model.bio.SequenceFeature" ]
import org.intermine.bio.io.bed.BEDRecord; import org.intermine.model.bio.Chromosome; import org.intermine.model.bio.Location; import org.intermine.model.bio.SequenceFeature;
import org.intermine.bio.io.bed.*; import org.intermine.model.bio.*;
[ "org.intermine.bio", "org.intermine.model" ]
org.intermine.bio; org.intermine.model;
1,929,969
Symbol access(Symbol sym, int pos, Type site, Name name, boolean qualified) { if (sym.kind >= AMBIGUOUS) return access(sym, pos, site, name, qualified, Type.emptyList); else return sym; }
Symbol access(Symbol sym, int pos, Type site, Name name, boolean qualified) { if (sym.kind >= AMBIGUOUS) return access(sym, pos, site, name, qualified, Type.emptyList); else return sym; }
/** * Same as above, but without type parameters and arguments. */
Same as above, but without type parameters and arguments
access
{ "repo_name": "nileshpatelksy/hello-pod-cast", "path": "archive/FILE/Compiler/java_GJC1.42_src/src/com/sun/tools/javac/v8/comp/Resolve.java", "license": "apache-2.0", "size": 42456 }
[ "com.sun.tools.javac.v8.code.Symbol", "com.sun.tools.javac.v8.code.Type", "com.sun.tools.javac.v8.util.Name" ]
import com.sun.tools.javac.v8.code.Symbol; import com.sun.tools.javac.v8.code.Type; import com.sun.tools.javac.v8.util.Name;
import com.sun.tools.javac.v8.code.*; import com.sun.tools.javac.v8.util.*;
[ "com.sun.tools" ]
com.sun.tools;
2,693,594
public List<String> getLifeCycleServiceList();
List<String> function();
/** * Get the name of all life cycle service. * * @return */
Get the name of all life cycle service
getLifeCycleServiceList
{ "repo_name": "shaolinwu/uimaster", "path": "modules/runtime/src/main/java/org/shaolin/bmdp/runtime/spi/IAppServiceManager.java", "license": "apache-2.0", "size": 2084 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,783,568
@Override protected Dialog onCreateDialog(int id) { switch (id) { case DLG: return createExampleDialog(); default: return null; } }
Dialog function(int id) { switch (id) { case DLG: return createExampleDialog(); default: return null; } }
/** * Called to create a dialog to be shown. */
Called to create a dialog to be shown
onCreateDialog
{ "repo_name": "grepruby/grep-mob", "path": "src/com/greprubyleaveapp/Login.java", "license": "gpl-2.0", "size": 10703 }
[ "android.app.Dialog" ]
import android.app.Dialog;
import android.app.*;
[ "android.app" ]
android.app;
1,299,418
@Override public Status getStatus() { return commandStatus; }
Status function() { return commandStatus; }
/** * Accessor for the status of the command * * @return the command status. */
Accessor for the status of the command
getStatus
{ "repo_name": "jodygarnett/GeoGig", "path": "src/web/api/src/main/java/org/locationtech/geogig/web/api/AbstractWebAPICommand.java", "license": "lgpl-2.1", "size": 5205 }
[ "org.restlet.data.Status" ]
import org.restlet.data.Status;
import org.restlet.data.*;
[ "org.restlet.data" ]
org.restlet.data;
1,919,729
@Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return mInflater.inflate(mLayout, parent, false); }
View function(Context context, Cursor cursor, ViewGroup parent) { return mInflater.inflate(mLayout, parent, false); }
/** * Inflates view(s) from the specified XML file. * * @see android.widget.CursorAdapter#newView(android.content.Context, * android.database.Cursor, ViewGroup) */
Inflates view(s) from the specified XML file
newView
{ "repo_name": "clamburger/trosnoth-server-app", "path": "libs/ActionBarSherlock/src/android/support/v4/widget/ResourceCursorAdapter.java", "license": "apache-2.0", "size": 5479 }
[ "android.content.Context", "android.database.Cursor", "android.view.View", "android.view.ViewGroup" ]
import android.content.Context; import android.database.Cursor; import android.view.View; import android.view.ViewGroup;
import android.content.*; import android.database.*; import android.view.*;
[ "android.content", "android.database", "android.view" ]
android.content; android.database; android.view;
1,156,867
public static void manageCallStateFocus(String aCallState){ switch (aCallState) { case IMXCall.CALL_STATE_CONNECTED: requestAudioFocus(); break; case IMXCall.CALL_STATE_ENDED: releaseAudioFocus(); break; default: break; } }
static void function(String aCallState){ switch (aCallState) { case IMXCall.CALL_STATE_CONNECTED: requestAudioFocus(); break; case IMXCall.CALL_STATE_ENDED: releaseAudioFocus(); break; default: break; } }
/** * Perform the audio focus management according to the VoIP call * states. * @param aCallState voip state */
Perform the audio focus management according to the VoIP call states
manageCallStateFocus
{ "repo_name": "vt0r/vector-android", "path": "vector/src/main/java/im/vector/util/VectorCallSoundManager.java", "license": "apache-2.0", "size": 23125 }
[ "org.matrix.androidsdk.call.IMXCall" ]
import org.matrix.androidsdk.call.IMXCall;
import org.matrix.androidsdk.call.*;
[ "org.matrix.androidsdk" ]
org.matrix.androidsdk;
994,692
private void addAttrVal(String attr, String val, boolean encoded, boolean url) throws Exception { // System.out.println("addAttr " + attr + " = " + val); if (state == stateNeedDn) { // Only version or dn here if (attr.equals("version")) { if (version != null) throwmsg("Repeated version record"); // Should probably parse this. if (!(val.equals("1"))) throwmsg("Invalid LDIF version " + val.toString()); version = val; } else if (attr.equals("dn")) { setDn(makeVal(val, encoded, url)); state = stateHadDn; } else { invalid(); } } else if (state == stateHadDn) { // We might see a control or changetype here if (attr.equals("control")) { setIsContent(false); throwmsg("controls unimplemented"); } else if (attr.equals("changetype")) { setIsContent(false); doChangeType(val); } else { // We presume that we have an attribute value. If we had control records // then we expected a changetype. if (haveControls) throwmsg("Missing changetype"); state = stateNotModRec; // Recurse to process the attribute addAttrVal(attr, val, encoded, url); } } else if (state == stateDeleteRec) { throwmsg("Should have no values for delete"); } else if (state == stateNotModRec) { addAttr(attr, makeVal(val, encoded, url)); } else if (state == stateModrdn) { throwmsg("changetype: mod(r)dn unimplemented"); } else if (state == stateModify) { // We expect ("add"|"delete"|"replace"): <attr-desc> if (encoded || url) { throwmsg("Invalid LDIF mod-spec"); } curChange = new Change(); if (attr.equals("add")) { curChange.changeType = DirContext.ADD_ATTRIBUTE; } else if (attr.equals("replace")) { curChange.changeType = DirContext.REPLACE_ATTRIBUTE; } else if (attr.equals("delete")) { curChange.changeType = DirContext.REMOVE_ATTRIBUTE; } else { throwmsg("Invalid LDIF mod-spec changetype"); } curChange.name = val; // ???????? options state = stateModSpec; } else if (state == stateModSpec) { // Attribute + value to add to current change if ((curChange == null) || (curChange.name == null)) { throwmsg("LDIF software error: No current change"); } if (!curChange.name.equalsIgnoreCase(attr)) { throwmsg("Invalid LDIF mod-spec: attribute name mismatch"); } // Add the value to the change if (curChange.vals == null) { curChange.vals = new Vector(); } curChange.vals.addElement(makeVal(val, encoded, url)); } else { throwmsg("LDIF software error: invalid state " + state); } somedata = true; }
void function(String attr, String val, boolean encoded, boolean url) throws Exception { if (state == stateNeedDn) { if (attr.equals(STR)) { if (version != null) throwmsg(STR); if (!(val.equals("1"))) throwmsg(STR + val.toString()); version = val; } else if (attr.equals("dn")) { setDn(makeVal(val, encoded, url)); state = stateHadDn; } else { invalid(); } } else if (state == stateHadDn) { if (attr.equals(STR)) { setIsContent(false); throwmsg(STR); } else if (attr.equals(STR)) { setIsContent(false); doChangeType(val); } else { if (haveControls) throwmsg(STR); state = stateNotModRec; addAttrVal(attr, val, encoded, url); } } else if (state == stateDeleteRec) { throwmsg(STR); } else if (state == stateNotModRec) { addAttr(attr, makeVal(val, encoded, url)); } else if (state == stateModrdn) { throwmsg(STR); } else if (state == stateModify) { if (encoded url) { throwmsg(STR); } curChange = new Change(); if (attr.equals("add")) { curChange.changeType = DirContext.ADD_ATTRIBUTE; } else if (attr.equals(STR)) { curChange.changeType = DirContext.REPLACE_ATTRIBUTE; } else if (attr.equals(STR)) { curChange.changeType = DirContext.REMOVE_ATTRIBUTE; } else { throwmsg(STR); } curChange.name = val; state = stateModSpec; } else if (state == stateModSpec) { if ((curChange == null) (curChange.name == null)) { throwmsg(STR); } if (!curChange.name.equalsIgnoreCase(attr)) { throwmsg(STR); } if (curChange.vals == null) { curChange.vals = new Vector(); } curChange.vals.addElement(makeVal(val, encoded, url)); } else { throwmsg(STR + state); } somedata = true; }
/** For all record types we expect an optional version spec first. After that comes the dn. After that, for content records we expect attrval-spec. for change record we have optional controls followed by changes. */
For all record types we expect an optional version spec first
addAttrVal
{ "repo_name": "nblair/bw-util", "path": "bw-util-directory/src/main/java/org/bedework/util/directory/ldif/LdifRecord.java", "license": "apache-2.0", "size": 16114 }
[ "java.util.Vector", "javax.naming.directory.DirContext" ]
import java.util.Vector; import javax.naming.directory.DirContext;
import java.util.*; import javax.naming.directory.*;
[ "java.util", "javax.naming" ]
java.util; javax.naming;
1,236,447
Set<Region> getRegions();
Set<Region> getRegions();
/** * Returns set of all regions. * * @return set of regions */
Returns set of all regions
getRegions
{ "repo_name": "VinodKumarS-Huawei/ietf96yang", "path": "core/api/src/main/java/org/onosproject/net/region/RegionService.java", "license": "apache-2.0", "size": 1884 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,010,780
void write(byte[] b, int off, int len) throws IOException;
void write(byte[] b, int off, int len) throws IOException;
/** * Writes <code>len</code> bytes from the specified byte array * starting at offset <code>off</code> to this session buffer. * <p> * If <code>off</code> is negative, or <code>len</code> is negative, or * <code>off+len</code> is greater than the length of the array * <code>b</code>, then an <tt>IndexOutOfBoundsException</tt> is thrown. * * @param b the data. * @param off the start offset in the data. * @param len the number of bytes to write. * @exception IOException if an I/O error occurs. */
Writes <code>len</code> bytes from the specified byte array starting at offset <code>off</code> to this session buffer. If <code>off</code> is negative, or <code>len</code> is negative, or <code>off+len</code> is greater than the length of the array <code>b</code>, then an IndexOutOfBoundsException is thrown
write
{ "repo_name": "alinvasile/httpcore", "path": "httpcore/src/main/java/org/apache/http/io/SessionOutputBuffer.java", "license": "apache-2.0", "size": 4436 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,051,292
public static void SQLFUNCTIONS(String catalogName, String schemaName, String funcName, String options, ResultSet[] rs) throws SQLException { rs[0] = ((EmbedDatabaseMetaData)getDMD()). getFunctions(catalogName, schemaName, funcName); }
static void function(String catalogName, String schemaName, String funcName, String options, ResultSet[] rs) throws SQLException { rs[0] = ((EmbedDatabaseMetaData)getDMD()). getFunctions(catalogName, schemaName, funcName); }
/** * Map SQLFunctions to EmbedDatabaseMetaData.getFunctions * * @param catalogName SYSIBM.SQLFunctions CatalogName varchar(128), * @param schemaName SYSIBM.SQLFunctions SchemaName varchar(128), * @param funcName SYSIBM.SQLFunctions ProcName varchar(128), * @param options SYSIBM.SQLFunctions Options varchar(4000)) * (not used) * @param rs output parameter, the resultset object containing * the result of getFunctions */
Map SQLFunctions to EmbedDatabaseMetaData.getFunctions
SQLFUNCTIONS
{ "repo_name": "scnakandala/derby", "path": "java/engine/org/apache/derby/catalog/SystemProcedures.java", "license": "apache-2.0", "size": 85864 }
[ "java.sql.ResultSet", "java.sql.SQLException", "org.apache.derby.impl.jdbc.EmbedDatabaseMetaData" ]
import java.sql.ResultSet; import java.sql.SQLException; import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;
import java.sql.*; import org.apache.derby.impl.jdbc.*;
[ "java.sql", "org.apache.derby" ]
java.sql; org.apache.derby;
2,376,921
public Collection<String> builtInProfileNamesForLanguage(String lang) { return reset.builtInProfileNamesForLanguage(lang); }
Collection<String> function(String lang) { return reset.builtInProfileNamesForLanguage(lang); }
/** * Currently used by Ruby on Rails */
Currently used by Ruby on Rails
builtInProfileNamesForLanguage
{ "repo_name": "ayondeep/sonarqube", "path": "server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileService.java", "license": "lgpl-3.0", "size": 7929 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
721,297
public static void sendMessageToConsole(final String text) { if ("".equals(text)) { return; } Bukkit.getServer().getConsoleSender().sendMessage(MessageUtils.colorise(text)); }
static void function(final String text) { if ("".equals(text)) { return; } Bukkit.getServer().getConsoleSender().sendMessage(MessageUtils.colorise(text)); }
/** * Send a message to all/console, if it is not empty. * * @param text * The text you'd like to send. Being colorized. */
Send a message to all/console, if it is not empty
sendMessageToConsole
{ "repo_name": "boy0001/ExperienceBankII", "path": "src/main/java/com/empcraft/xpbank/text/MessageUtils.java", "license": "gpl-3.0", "size": 2638 }
[ "org.bukkit.Bukkit" ]
import org.bukkit.Bukkit;
import org.bukkit.*;
[ "org.bukkit" ]
org.bukkit;
468,794
@Test public void testInputBasedRuleKeySourceChange() throws Exception { ProjectFilesystem filesystem = new FakeProjectFilesystem(); SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(ruleResolver); SourcePathResolver pathResolver = new SourcePathResolver(ruleFinder); // Setup a Java library consuming a source generated by a genrule and grab its rule key. BuildRule genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance("//:gen_srcs")) .setOut("Test.java") .setCmd("something") .build(ruleResolver, filesystem); filesystem.writeContentsToPath("class Test {}", genSrc.getPathToOutput()); JavaLibrary library = (JavaLibrary) JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance("//:lib")) .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache originalHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); InputBasedRuleKeyFactory factory = new InputBasedRuleKeyFactory( 0, originalHashCache, pathResolver, ruleFinder); RuleKey originalRuleKey = factory.build(library); // Now change the genrule such that its rule key changes, but it's output stays the same (since // we don't change it). This should *not* affect the input-based rule key of the consuming // java library, since it only cares about the contents of the source. ruleResolver = new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer()); genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance("//:gen_srcs")) .setOut("Test.java") .setCmd("something else") .build(ruleResolver, filesystem); library = (JavaLibrary) JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance("//:lib")) .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache unaffectedHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); factory = new InputBasedRuleKeyFactory( 0, unaffectedHashCache, pathResolver, ruleFinder); RuleKey unaffectedRuleKey = factory.build(library); assertThat(originalRuleKey, equalTo(unaffectedRuleKey)); // Now actually modify the source, which should make the input-based rule key change. ruleResolver = new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer()); genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance("//:gen_srcs")) .setOut("Test.java") .setCmd("something else") .build(ruleResolver, filesystem); filesystem.writeContentsToPath("class Test2 {}", genSrc.getPathToOutput()); library = (JavaLibrary) JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance("//:lib")) .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache affectedHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); factory = new InputBasedRuleKeyFactory( 0, affectedHashCache, pathResolver, ruleFinder); RuleKey affectedRuleKey = factory.build(library); assertThat(originalRuleKey, Matchers.not(equalTo(affectedRuleKey))); }
void function() throws Exception { ProjectFilesystem filesystem = new FakeProjectFilesystem(); SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(ruleResolver); SourcePathResolver pathResolver = new SourcePathResolver(ruleFinder); BuildRule genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance(STRTest.javaSTRsomethingSTRclass Test {}STR .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache originalHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); InputBasedRuleKeyFactory factory = new InputBasedRuleKeyFactory( 0, originalHashCache, pathResolver, ruleFinder); RuleKey originalRuleKey = factory.build(library); ruleResolver = new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer()); genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance(STRTest.javaSTRsomething elseSTR .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache unaffectedHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); factory = new InputBasedRuleKeyFactory( 0, unaffectedHashCache, pathResolver, ruleFinder); RuleKey unaffectedRuleKey = factory.build(library); assertThat(originalRuleKey, equalTo(unaffectedRuleKey)); ruleResolver = new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer()); genSrc = GenruleBuilder.newGenruleBuilder(BuildTargetFactory.newInstance(STRTest.javaSTRsomething elseSTRclass Test2 {}STR .addSrc(new BuildTargetSourcePath(genSrc.getBuildTarget())) .build(ruleResolver, filesystem); FileHashCache affectedHashCache = DefaultFileHashCache.createDefaultFileHashCache(filesystem); factory = new InputBasedRuleKeyFactory( 0, affectedHashCache, pathResolver, ruleFinder); RuleKey affectedRuleKey = factory.build(library); assertThat(originalRuleKey, Matchers.not(equalTo(affectedRuleKey))); }
/** * Tests that input-based rule keys work properly with generated sources. */
Tests that input-based rule keys work properly with generated sources
testInputBasedRuleKeySourceChange
{ "repo_name": "sdwilsh/buck", "path": "test/com/facebook/buck/jvm/java/DefaultJavaLibraryTest.java", "license": "apache-2.0", "size": 62728 }
[ "com.facebook.buck.io.ProjectFilesystem", "com.facebook.buck.model.BuildTargetFactory", "com.facebook.buck.rules.BuildRule", "com.facebook.buck.rules.BuildRuleResolver", "com.facebook.buck.rules.BuildTargetSourcePath", "com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer", "com.facebook.buck.rules.RuleKey", "com.facebook.buck.rules.SourcePathResolver", "com.facebook.buck.rules.SourcePathRuleFinder", "com.facebook.buck.rules.TargetGraph", "com.facebook.buck.rules.keys.InputBasedRuleKeyFactory", "com.facebook.buck.shell.GenruleBuilder", "com.facebook.buck.testutil.FakeProjectFilesystem", "com.facebook.buck.util.cache.DefaultFileHashCache", "com.facebook.buck.util.cache.FileHashCache", "org.hamcrest.Matchers", "org.junit.Assert", "org.junit.Test" ]
import com.facebook.buck.io.ProjectFilesystem; import com.facebook.buck.model.BuildTargetFactory; import com.facebook.buck.rules.BuildRule; import com.facebook.buck.rules.BuildRuleResolver; import com.facebook.buck.rules.BuildTargetSourcePath; import com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer; import com.facebook.buck.rules.RuleKey; import com.facebook.buck.rules.SourcePathResolver; import com.facebook.buck.rules.SourcePathRuleFinder; import com.facebook.buck.rules.TargetGraph; import com.facebook.buck.rules.keys.InputBasedRuleKeyFactory; import com.facebook.buck.shell.GenruleBuilder; import com.facebook.buck.testutil.FakeProjectFilesystem; import com.facebook.buck.util.cache.DefaultFileHashCache; import com.facebook.buck.util.cache.FileHashCache; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test;
import com.facebook.buck.io.*; import com.facebook.buck.model.*; import com.facebook.buck.rules.*; import com.facebook.buck.rules.keys.*; import com.facebook.buck.shell.*; import com.facebook.buck.testutil.*; import com.facebook.buck.util.cache.*; import org.hamcrest.*; import org.junit.*;
[ "com.facebook.buck", "org.hamcrest", "org.junit" ]
com.facebook.buck; org.hamcrest; org.junit;
60,136
static synchronized void startHAServices(InternalCache cache) { if (qrmThread == null) { dispatchedMessagesMap = new ConcurrentHashMap(); qrmThread = new QueueRemovalThread(cache); qrmThread.setName("Queue Removal Thread"); qrmThread.start(); } }
static synchronized void startHAServices(InternalCache cache) { if (qrmThread == null) { dispatchedMessagesMap = new ConcurrentHashMap(); qrmThread = new QueueRemovalThread(cache); qrmThread.setName(STR); qrmThread.start(); } }
/** * Creates the static dispatchedMessagesMap (if not present) and starts the QueuRemovalThread if * not running */
Creates the static dispatchedMessagesMap (if not present) and starts the QueuRemovalThread if not running
startHAServices
{ "repo_name": "smanvi-pivotal/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java", "license": "apache-2.0", "size": 142403 }
[ "java.util.concurrent.ConcurrentHashMap", "org.apache.geode.internal.cache.InternalCache" ]
import java.util.concurrent.ConcurrentHashMap; import org.apache.geode.internal.cache.InternalCache;
import java.util.concurrent.*; import org.apache.geode.internal.cache.*;
[ "java.util", "org.apache.geode" ]
java.util; org.apache.geode;
12,490