method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void detachAndStopAllAppenders() { for (Appender<E> a : appenderList) { a.stop(); } appenderList.clear(); } static final long START = System.currentTimeMillis();
void function() { for (Appender<E> a : appenderList) { a.stop(); } appenderList.clear(); } static final long START = System.currentTimeMillis();
/** * Remove and processPriorToRemoval all previously attached appenders. */
Remove and processPriorToRemoval all previously attached appenders
detachAndStopAllAppenders
{ "repo_name": "JPAT-ROSEMARY/SCUBA", "path": "org.jpat.scuba.external.slf4j/logback-1.2.3/logback-core/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java", "license": "mit", "size": 4241 }
[ "ch.qos.logback.core.Appender" ]
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.*;
[ "ch.qos.logback" ]
ch.qos.logback;
866,992
public BufferedImage getZoomedLensImage() { if (model.getState() == DISCARDED) return null; return view.getZoomedLensImage(); }
BufferedImage function() { if (model.getState() == DISCARDED) return null; return view.getZoomedLensImage(); }
/** * Implemented as specified by the {@link ImViewer} interface. * @see ImViewer#getZoomedLensImage() */
Implemented as specified by the <code>ImViewer</code> interface
getZoomedLensImage
{ "repo_name": "jballanc/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java", "license": "gpl-2.0", "size": 99058 }
[ "java.awt.image.BufferedImage" ]
import java.awt.image.BufferedImage;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,913,011
protected boolean showColumnHeaders(Widget widget) { String s = widget.getPropertyValue(PropertyTypeConstants.SHOW_COLUMN_HEADER); if ("true".equals(s)) { return true; } return false; }
boolean function(Widget widget) { String s = widget.getPropertyValue(PropertyTypeConstants.SHOW_COLUMN_HEADER); if ("true".equals(s)) { return true; } return false; }
/** * Returns true if the Column Headers should be shown. * * @param widget The Table (Tree...) * @return boolean True if the Column Headers should be shown */
Returns true if the Column Headers should be shown
showColumnHeaders
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/page/core/com.odcgroup.page.transformmodel/src/main/java/com/odcgroup/page/transformmodel/BaseWidgetTransformer.java", "license": "epl-1.0", "size": 52506 }
[ "com.odcgroup.page.metamodel.PropertyTypeConstants", "com.odcgroup.page.model.Widget" ]
import com.odcgroup.page.metamodel.PropertyTypeConstants; import com.odcgroup.page.model.Widget;
import com.odcgroup.page.metamodel.*; import com.odcgroup.page.model.*;
[ "com.odcgroup.page" ]
com.odcgroup.page;
1,731,380
public CompletableFuture<Void> removeOwnership(NamespaceBundle bundle) { CompletableFuture<Void> result = new CompletableFuture<>(); String key = ServiceUnitZkUtils.path(bundle); localZkCache.getZooKeeper().delete(key, -1, (rc, path, ctx) -> { if (rc == KeeperException.Code.OK.intValue() || rc == KeeperException.Code.NONODE.intValue()) { LOG.info("[{}] Removed zk lock for service unit: {}", key, KeeperException.Code.get(rc)); ownedBundlesCache.synchronous().invalidate(key); ownershipReadOnlyCache.invalidate(key); result.complete(null); } else { LOG.warn("[{}] Failed to delete the namespace ephemeral node. key={}", key, KeeperException.Code.get(rc)); result.completeExceptionally(KeeperException.create(rc)); } }, null); return result; }
CompletableFuture<Void> function(NamespaceBundle bundle) { CompletableFuture<Void> result = new CompletableFuture<>(); String key = ServiceUnitZkUtils.path(bundle); localZkCache.getZooKeeper().delete(key, -1, (rc, path, ctx) -> { if (rc == KeeperException.Code.OK.intValue() rc == KeeperException.Code.NONODE.intValue()) { LOG.info(STR, key, KeeperException.Code.get(rc)); ownedBundlesCache.synchronous().invalidate(key); ownershipReadOnlyCache.invalidate(key); result.complete(null); } else { LOG.warn(STR, key, KeeperException.Code.get(rc)); result.completeExceptionally(KeeperException.create(rc)); } }, null); return result; }
/** * Method to remove the ownership of local broker on the <code>NamespaceBundle</code>, if owned * */
Method to remove the ownership of local broker on the <code>NamespaceBundle</code>, if owned
removeOwnership
{ "repo_name": "ArvinDevel/incubator-pulsar", "path": "pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/OwnershipCache.java", "license": "apache-2.0", "size": 14818 }
[ "java.util.concurrent.CompletableFuture", "org.apache.pulsar.common.naming.NamespaceBundle", "org.apache.zookeeper.KeeperException" ]
import java.util.concurrent.CompletableFuture; import org.apache.pulsar.common.naming.NamespaceBundle; import org.apache.zookeeper.KeeperException;
import java.util.concurrent.*; import org.apache.pulsar.common.naming.*; import org.apache.zookeeper.*;
[ "java.util", "org.apache.pulsar", "org.apache.zookeeper" ]
java.util; org.apache.pulsar; org.apache.zookeeper;
2,142,022
public Boolean isEditableInCurrentContext(BaseModule module) { EnumSet<RoleCode> roleCodes = userService.getCurrentUserRoleCodes(); boolean hasPermissions = module.isLibrary() ? roleCodes.contains(RoleCode.ROLE_ADMIN) || roleCodes.contains(RoleCode.ROLE_LIBRARIAN) : roleCodes.contains(RoleCode.ROLE_AUTHOR) || roleCodes.contains(RoleCode.ROLE_ADMIN); if(module.isNew()) { if(logger.isDebugEnabled()) { logger.debug("isEditableInCurrentContext: New module; hasPermissions = " + hasPermissions); } return hasPermissions; } else { boolean isModuleInProperStateStatus = module.isEditable() || (CollectionUtils.isEmpty(module.getForms()) && roleCodes.contains(RoleCode.ROLE_ADMIN)); // for modules - as long as you are allowed (see logic above) you can modify it // does not have to be a module owner // UserCredentials user = userManager.getCurrentUser(); // boolean isUserModuleAuthor = // module.getAuthor().getUserName().equals(user.getUserName()); if(logger.isDebugEnabled()) { logger.debug("isEditableInCurrentContext: " + "moduleId = " + module.getId() + " isModuleInProgress = " + isModuleInProperStateStatus // + " isUserModuleAuthor = " + isUserModuleAuthor + " hasPermissions = " + hasPermissions); } return hasPermissions && isModuleInProperStateStatus; //&& isUserModuleAuthor; } }
Boolean function(BaseModule module) { EnumSet<RoleCode> roleCodes = userService.getCurrentUserRoleCodes(); boolean hasPermissions = module.isLibrary() ? roleCodes.contains(RoleCode.ROLE_ADMIN) roleCodes.contains(RoleCode.ROLE_LIBRARIAN) : roleCodes.contains(RoleCode.ROLE_AUTHOR) roleCodes.contains(RoleCode.ROLE_ADMIN); if(module.isNew()) { if(logger.isDebugEnabled()) { logger.debug(STR + hasPermissions); } return hasPermissions; } else { boolean isModuleInProperStateStatus = module.isEditable() (CollectionUtils.isEmpty(module.getForms()) && roleCodes.contains(RoleCode.ROLE_ADMIN)); if(logger.isDebugEnabled()) { logger.debug(STR + STR + module.getId() + STR + isModuleInProperStateStatus + STR + hasPermissions); } return hasPermissions && isModuleInProperStateStatus; } }
/** * Determines whether the current entity is open to modifications in the current * context * @param module * @return true when editable */
Determines whether the current entity is open to modifications in the current context
isEditableInCurrentContext
{ "repo_name": "NCIP/edct-formbuilder", "path": "src/main/java/com/healthcit/cacure/businessdelegates/ModuleManager.java", "license": "bsd-3-clause", "size": 11602 }
[ "com.healthcit.cacure.model.BaseModule", "com.healthcit.cacure.model.Role", "java.util.EnumSet", "org.apache.commons.collections.CollectionUtils" ]
import com.healthcit.cacure.model.BaseModule; import com.healthcit.cacure.model.Role; import java.util.EnumSet; import org.apache.commons.collections.CollectionUtils;
import com.healthcit.cacure.model.*; import java.util.*; import org.apache.commons.collections.*;
[ "com.healthcit.cacure", "java.util", "org.apache.commons" ]
com.healthcit.cacure; java.util; org.apache.commons;
2,155,171
public Condition build() { validate(); if (StringUtils.isBlank(condition.id)) { condition.id = UUID.randomUUID().toString(); } condition.rules = Collections.unmodifiableList(condition.rules); return condition; } private class ConditionImpl implements Condition { private String id; private Condition.Junction condition = Junction.AND; private List<SearchNode> rules = new ArrayList<>(3);
Condition function() { validate(); if (StringUtils.isBlank(condition.id)) { condition.id = UUID.randomUUID().toString(); } condition.rules = Collections.unmodifiableList(condition.rules); return condition; } private class ConditionImpl implements Condition { private String id; private Condition.Junction condition = Junction.AND; private List<SearchNode> rules = new ArrayList<>(3);
/** * Indicates the end of building the condition instance * * @return the condition */
Indicates the end of building the condition instance
build
{ "repo_name": "SirmaITT/conservation-space-1.7.0", "path": "docker/sirma-platform/platform/seip-parent/platform/domain-model/domain-model-api/src/main/java/com/sirma/itt/seip/domain/search/tree/ConditionBuilder.java", "license": "lgpl-3.0", "size": 3370 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List", "java.util.UUID", "org.apache.commons.lang3.StringUtils" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; import org.apache.commons.lang3.StringUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
879,147
public static Subscriber getSubscriber(String subscriberName) throws APIManagementException { Connection conn = null; Subscriber subscriber = null; PreparedStatement ps = null; ResultSet result = null; int tenantId; tenantId = APIUtil.getTenantId(subscriberName); String sqlQuery = "SELECT " + " SUBSCRIBER_ID, " + " USER_ID, " + " TENANT_ID, " + " EMAIL_ADDRESS, " + " DATE_SUBSCRIBED " + "FROM " + " AM_SUBSCRIBER " + "WHERE " + " USER_ID = ? " + " AND TENANT_ID = ?"; if (forceCaseInsensitiveComparisons) { sqlQuery = "SELECT " + " SUBSCRIBER_ID, " + " USER_ID, " + " TENANT_ID, " + " EMAIL_ADDRESS, " + " DATE_SUBSCRIBED " + "FROM " + " AM_SUBSCRIBER " + "WHERE " + " LOWER(USER_ID) = LOWER(?) " + " AND TENANT_ID = ?"; } try { conn = APIMgtDBUtil.getConnection(); ps = conn.prepareStatement(sqlQuery); ps.setString(1, subscriberName); ps.setInt(2, tenantId); result = ps.executeQuery(); if (result.next()) { subscriber = new Subscriber(result.getString(APIConstants.SUBSCRIBER_FIELD_EMAIL_ADDRESS)); subscriber.setEmail(result.getString("EMAIL_ADDRESS")); subscriber.setId(result.getInt("SUBSCRIBER_ID")); subscriber.setName(subscriberName); subscriber.setSubscribedDate(result.getDate(APIConstants.SUBSCRIBER_FIELD_DATE_SUBSCRIBED)); subscriber.setTenantId(result.getInt("TENANT_ID")); } } catch (SQLException e) { handleException("Failed to get Subscriber for :" + subscriberName, e); } finally { APIMgtDBUtil.closeAllConnections(ps, conn, result); } return subscriber; }
static Subscriber function(String subscriberName) throws APIManagementException { Connection conn = null; Subscriber subscriber = null; PreparedStatement ps = null; ResultSet result = null; int tenantId; tenantId = APIUtil.getTenantId(subscriberName); String sqlQuery = STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR; if (forceCaseInsensitiveComparisons) { sqlQuery = STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR; } try { conn = APIMgtDBUtil.getConnection(); ps = conn.prepareStatement(sqlQuery); ps.setString(1, subscriberName); ps.setInt(2, tenantId); result = ps.executeQuery(); if (result.next()) { subscriber = new Subscriber(result.getString(APIConstants.SUBSCRIBER_FIELD_EMAIL_ADDRESS)); subscriber.setEmail(result.getString(STR)); subscriber.setId(result.getInt(STR)); subscriber.setName(subscriberName); subscriber.setSubscribedDate(result.getDate(APIConstants.SUBSCRIBER_FIELD_DATE_SUBSCRIBED)); subscriber.setTenantId(result.getInt(STR)); } } catch (SQLException e) { handleException(STR + subscriberName, e); } finally { APIMgtDBUtil.closeAllConnections(ps, conn, result); } return subscriber; }
/** * This method used tot get Subscriber from subscriberId. * * @param subscriberName id * @return Subscriber * @throws APIManagementException if failed to get Subscriber from subscriber id */
This method used tot get Subscriber from subscriberId
getSubscriber
{ "repo_name": "madusankapremaratne/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java", "license": "apache-2.0", "size": 400222 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.Subscriber", "org.wso2.carbon.apimgt.impl.APIConstants", "org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil", "org.wso2.carbon.apimgt.impl.utils.APIUtil" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Subscriber; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil; import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import java.sql.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
1,620,799
// This is a I/O sample response. You will only get this is you are // connected to a Coordinator that is configured to // receive I/O samples from a remote XBee. if (response.getApiId() == ApiId.ZNET_IO_SAMPLE_RESPONSE) { ZNetRxIoSampleResponse ioSample = (ZNetRxIoSampleResponse) response; log.debug("received i/o sample packet. contains analog is " + ioSample.containsAnalog() + ", contains digital is " + ioSample.containsDigital()); // check the value of the input pins log.debug("pin 20 (DO) digital is " + ioSample.isD0On()); log.debug("pin 19 (D1) analog is " + ioSample.getAnalog1()); } }
if (response.getApiId() == ApiId.ZNET_IO_SAMPLE_RESPONSE) { ZNetRxIoSampleResponse ioSample = (ZNetRxIoSampleResponse) response; log.debug(STR + ioSample.containsAnalog() + STR + ioSample.containsDigital()); log.debug(STR + ioSample.isD0On()); log.debug(STR + ioSample.getAnalog1()); } }
/** * Called by XBee API thread when a packet is received */
Called by XBee API thread when a packet is received
processResponse
{ "repo_name": "steveperkins/xbee-api-for-java-1-4", "path": "src/com/rapplogic/xbee/examples/zigbee/ZNetIoSampleExample.java", "license": "gpl-3.0", "size": 2829 }
[ "com.rapplogic.xbee.api.ApiId", "com.rapplogic.xbee.api.zigbee.ZNetRxIoSampleResponse" ]
import com.rapplogic.xbee.api.ApiId; import com.rapplogic.xbee.api.zigbee.ZNetRxIoSampleResponse;
import com.rapplogic.xbee.api.*; import com.rapplogic.xbee.api.zigbee.*;
[ "com.rapplogic.xbee" ]
com.rapplogic.xbee;
2,273,117
public TagParams withImage(@NotNull String image) { requireNonNull(image); this.image = image; return this; }
TagParams function(@NotNull String image) { requireNonNull(image); this.image = image; return this; }
/** * Adds image to this parameters. * * @param image image name * @return this params instance * @throws NullPointerException if {@code image} is null */
Adds image to this parameters
withImage
{ "repo_name": "akervern/che", "path": "infrastructures/docker/docker-client/src/main/java/org/eclipse/che/infrastructure/docker/client/params/TagParams.java", "license": "epl-1.0", "size": 3375 }
[ "java.util.Objects", "javax.validation.constraints.NotNull" ]
import java.util.Objects; import javax.validation.constraints.NotNull;
import java.util.*; import javax.validation.constraints.*;
[ "java.util", "javax.validation" ]
java.util; javax.validation;
2,220,215
public void mouseReleased(MouseEvent inE) { _recalculate = true; if (_drawMode == MODE_DRAG_POINT) { if (Math.abs(_dragToX - _dragFromX) > 2 || Math.abs(_dragToY - _dragFromY) > 2) { movePointToMouse(_dragFromX, _dragFromY, _dragToX, _dragToY ); } _drawMode = MODE_DEFAULT; } else if (_drawMode == MODE_CREATE_MIDPOINT) { _drawMode = MODE_DEFAULT; _app.createPoint(createPointFromClick(_dragToX, _dragToY), _clickedPoint); } else if (_drawMode == MODE_ZOOM_RECT) { if (Math.abs(_dragToX - _dragFromX) > 20 && Math.abs(_dragToY - _dragFromY) > 20) { _mapPosition.zoomToPixels(_dragFromX, _dragToX, _dragFromY, _dragToY, getWidth(), getHeight()); } _drawMode = MODE_DEFAULT; } else if (_drawMode == MODE_MARK_RECTANGLE) { // Reset app mode _app.setCurrentMode(App.AppMode.NORMAL); _drawMode = MODE_DEFAULT; // Call a function to mark the points MarkPointsInRectangleFunction marker = (MarkPointsInRectangleFunction) FunctionLibrary.FUNCTION_MARK_IN_RECTANGLE; double lon1 = MapUtils.getLongitudeFromX(_mapPosition.getXFromPixels(_dragFromX, getWidth())); double lat1 = MapUtils.getLatitudeFromY(_mapPosition.getYFromPixels(_dragFromY, getHeight())); double lon2 = MapUtils.getLongitudeFromX(_mapPosition.getXFromPixels(_dragToX, getWidth())); double lat2 = MapUtils.getLatitudeFromY(_mapPosition.getYFromPixels(_dragToY, getHeight())); // Invalidate rectangle if pixel coords are (-1,-1) if (_dragFromX < 0 || _dragFromY < 0) { lon1 = lon2; lat1 = lat2; } marker.setRectCoords(lon1, lat1, lon2, lat2); marker.begin(); } _dragFromX = _dragFromY = -1; repaint(); }
void function(MouseEvent inE) { _recalculate = true; if (_drawMode == MODE_DRAG_POINT) { if (Math.abs(_dragToX - _dragFromX) > 2 Math.abs(_dragToY - _dragFromY) > 2) { movePointToMouse(_dragFromX, _dragFromY, _dragToX, _dragToY ); } _drawMode = MODE_DEFAULT; } else if (_drawMode == MODE_CREATE_MIDPOINT) { _drawMode = MODE_DEFAULT; _app.createPoint(createPointFromClick(_dragToX, _dragToY), _clickedPoint); } else if (_drawMode == MODE_ZOOM_RECT) { if (Math.abs(_dragToX - _dragFromX) > 20 && Math.abs(_dragToY - _dragFromY) > 20) { _mapPosition.zoomToPixels(_dragFromX, _dragToX, _dragFromY, _dragToY, getWidth(), getHeight()); } _drawMode = MODE_DEFAULT; } else if (_drawMode == MODE_MARK_RECTANGLE) { _app.setCurrentMode(App.AppMode.NORMAL); _drawMode = MODE_DEFAULT; MarkPointsInRectangleFunction marker = (MarkPointsInRectangleFunction) FunctionLibrary.FUNCTION_MARK_IN_RECTANGLE; double lon1 = MapUtils.getLongitudeFromX(_mapPosition.getXFromPixels(_dragFromX, getWidth())); double lat1 = MapUtils.getLatitudeFromY(_mapPosition.getYFromPixels(_dragFromY, getHeight())); double lon2 = MapUtils.getLongitudeFromX(_mapPosition.getXFromPixels(_dragToX, getWidth())); double lat2 = MapUtils.getLatitudeFromY(_mapPosition.getYFromPixels(_dragToY, getHeight())); if (_dragFromX < 0 _dragFromY < 0) { lon1 = lon2; lat1 = lat2; } marker.setRectCoords(lon1, lat1, lon2, lat2); marker.begin(); } _dragFromX = _dragFromY = -1; repaint(); }
/** * Respond to mouse released events * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) */
Respond to mouse released events
mouseReleased
{ "repo_name": "sebastic/GpsPrune", "path": "tim/prune/gui/map/MapCanvas.java", "license": "gpl-2.0", "size": 47916 }
[ "java.awt.event.MouseEvent" ]
import java.awt.event.MouseEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
107,499
public Layer between(int from, int to) { int fromi = searchStartLeft(from); int toi = searchStartRight(to); List<Annotation> list; if (hasOverlaps()) { list = new ArrayList<Annotation>(); for (Annotation annot : annotations.subList(fromi, toi)) if (annot.getEnd() <= to) list.add(annot); } else { if ((toi > 0) && (annotations.get(toi - 1).getEnd() > to)) toi--; if (toi < fromi) list = Collections.emptyList(); else list = annotations.subList(fromi, toi); } return subLayer(list); }
Layer function(int from, int to) { int fromi = searchStartLeft(from); int toi = searchStartRight(to); List<Annotation> list; if (hasOverlaps()) { list = new ArrayList<Annotation>(); for (Annotation annot : annotations.subList(fromi, toi)) if (annot.getEnd() <= to) list.add(annot); } else { if ((toi > 0) && (annotations.get(toi - 1).getEnd() > to)) toi--; if (toi < fromi) list = Collections.emptyList(); else list = annotations.subList(fromi, toi); } return subLayer(list); }
/** * Returns all annotations completely contained in the specified span. * Annotations in the returned layer have start points between from * (inclusive) and to (exclusive), and end points between from and to (both * inclusive). * @param from lower bound of the returned layer * @param to higher bound of the returned layer * @return all annotations completely contained in the specified span */
Returns all annotations completely contained in the specified span. Annotations in the returned layer have start points between from (inclusive) and to (exclusive), and end points between from and to (both inclusive)
between
{ "repo_name": "Bibliome/alvisnlp", "path": "alvisnlp-core/src/main/java/fr/inra/maiage/bibliome/alvisnlp/core/corpus/Layer.java", "license": "apache-2.0", "size": 18737 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,827,652
JSONResponse modifyGroupName(MmtConfig cfg, FansGroup group);
JSONResponse modifyGroupName(MmtConfig cfg, FansGroup group);
/** * modify group name * * @param cfg * @param group * @return */
modify group name
modifyGroupName
{ "repo_name": "cjm0000000/mmt", "path": "mmt-shared/src/main/java/com/github/cjm0000000/mmt/shared/fans/remote/FansGroupAPI.java", "license": "apache-2.0", "size": 1218 }
[ "com.github.cjm0000000.mmt.core.access.JSONResponse", "com.github.cjm0000000.mmt.core.config.MmtConfig", "com.github.cjm0000000.mmt.shared.fans.FansGroup" ]
import com.github.cjm0000000.mmt.core.access.JSONResponse; import com.github.cjm0000000.mmt.core.config.MmtConfig; import com.github.cjm0000000.mmt.shared.fans.FansGroup;
import com.github.cjm0000000.mmt.core.access.*; import com.github.cjm0000000.mmt.core.config.*; import com.github.cjm0000000.mmt.shared.fans.*;
[ "com.github.cjm0000000" ]
com.github.cjm0000000;
1,539,352
protected Map<String, Object> getAuthenticationAttributesAsMultiValuedAttributes(final Map<String, Object> model) { return convertAttributeValuesToMultiValuedObjects(getPrimaryAuthenticationFrom(model).getAttributes()); } /** * Is remember me authentication? * looks at the authentication object to find {@link RememberMeCredential#AUTHENTICATION_ATTRIBUTE_REMEMBER_ME}
Map<String, Object> function(final Map<String, Object> model) { return convertAttributeValuesToMultiValuedObjects(getPrimaryAuthenticationFrom(model).getAttributes()); } /** * Is remember me authentication? * looks at the authentication object to find {@link RememberMeCredential#AUTHENTICATION_ATTRIBUTE_REMEMBER_ME}
/** * Gets authentication attributes. * Single-valued attributes are converted to a collection * so the review can easily loop through all. * * @param model the model * @return the attributes * @see #convertAttributeValuesToMultiValuedObjects(java.util.Map) * @since 4.1.0 */
Gets authentication attributes. Single-valued attributes are converted to a collection so the review can easily loop through all
getAuthenticationAttributesAsMultiValuedAttributes
{ "repo_name": "dodok1/cas", "path": "core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java", "license": "apache-2.0", "size": 14825 }
[ "java.util.Map", "org.apereo.cas.authentication.RememberMeCredential" ]
import java.util.Map; import org.apereo.cas.authentication.RememberMeCredential;
import java.util.*; import org.apereo.cas.authentication.*;
[ "java.util", "org.apereo.cas" ]
java.util; org.apereo.cas;
777,741
public static PrintWriter newPrintWriter(Path self, String charset) throws IOException { return new GroovyPrintWriter(newWriter(self, charset)); }
static PrintWriter function(Path self, String charset) throws IOException { return new GroovyPrintWriter(newWriter(self, charset)); }
/** * Create a new PrintWriter for this file, using specified * charset. * * @param self a Path * @param charset the charset * @return a PrintWriter * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */
Create a new PrintWriter for this file, using specified charset
newPrintWriter
{ "repo_name": "paulk-asert/groovy", "path": "subprojects/groovy-nio/src/main/java/org/apache/groovy/nio/extensions/NioExtensions.java", "license": "apache-2.0", "size": 88073 }
[ "groovy.io.GroovyPrintWriter", "java.io.IOException", "java.io.PrintWriter", "java.nio.file.Path" ]
import groovy.io.GroovyPrintWriter; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Path;
import groovy.io.*; import java.io.*; import java.nio.file.*;
[ "groovy.io", "java.io", "java.nio" ]
groovy.io; java.io; java.nio;
2,350,900
public static boolean fileIsTheOriginal(File existingFile, String hash) { BufferedReader br = null; try { File hashFile = new File(existingFile.getParent()+File.separator+"hash.txt"); if (hashFile.exists()) { br = new BufferedReader(new FileReader(hashFile)); String line; String fname = ""; while ((line = br.readLine()) != null) { String[] keyv = line.split("="); if (keyv != null && keyv.length > 1 && keyv[1] != null) { fname = keyv[0]; if (fname.equals(existingFile.getName()) && hash.equals(keyv[1])) { br.close(); return true; } } } br.close(); } } catch (Exception e) { LOGGER.warn(e.getMessage()); } return false; }
static boolean function(File existingFile, String hash) { BufferedReader br = null; try { File hashFile = new File(existingFile.getParent()+File.separator+STR); if (hashFile.exists()) { br = new BufferedReader(new FileReader(hashFile)); String line; String fname = STR="); if (keyv != null && keyv.length > 1 && keyv[1] != null) { fname = keyv[0]; if (fname.equals(existingFile.getName()) && hash.equals(keyv[1])) { br.close(); return true; } } } br.close(); } } catch (Exception e) { LOGGER.warn(e.getMessage()); } return false; }
/** * Checks if the file with this name has been modified in the meantime. For this we compute the files * hash value and look if it exists in the hash.txt file where we keep them. * @param existingFile * @param targetDirAbsolutePath * @return */
Checks if the file with this name has been modified in the meantime. For this we compute the files hash value and look if it exists in the hash.txt file where we keep them
fileIsTheOriginal
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/dbase/HandleHome.java", "license": "gpl-3.0", "size": 45027 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileReader" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileReader;
import java.io.*;
[ "java.io" ]
java.io;
722,366
Pipeline pipeline = new Pipeline(PipelineRunner.fromOptions(options), options); LOG.debug("Creating {}", pipeline); return pipeline; }
Pipeline pipeline = new Pipeline(PipelineRunner.fromOptions(options), options); LOG.debug(STR, pipeline); return pipeline; }
/** * Constructs a pipeline from the provided options. * * @return The newly created pipeline. */
Constructs a pipeline from the provided options
create
{ "repo_name": "chamikaramj/MyDataflowJavaSDK", "path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/Pipeline.java", "license": "apache-2.0", "size": 13672 }
[ "com.google.cloud.dataflow.sdk.runners.PipelineRunner" ]
import com.google.cloud.dataflow.sdk.runners.PipelineRunner;
import com.google.cloud.dataflow.sdk.runners.*;
[ "com.google.cloud" ]
com.google.cloud;
1,801,177
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException { log.finest("endpointActivation()"); }
void function(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException { log.finest(STR); }
/** * This is called during the activation of a message endpoint. * * @param endpointFactory A message endpoint factory instance. * @param spec An activation spec JavaBean instance. * @throws ResourceException generic exception */
This is called during the activation of a message endpoint
endpointActivation
{ "repo_name": "jpkrohling/cassandra-driver-ra", "path": "resource-adapter/src/main/java/org/jboss/cassandra/ra/CassandraDriverResourceAdapter.java", "license": "apache-2.0", "size": 4600 }
[ "javax.resource.ResourceException", "javax.resource.spi.ActivationSpec", "javax.resource.spi.endpoint.MessageEndpointFactory" ]
import javax.resource.ResourceException; import javax.resource.spi.ActivationSpec; import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.*; import javax.resource.spi.*; import javax.resource.spi.endpoint.*;
[ "javax.resource" ]
javax.resource;
759,475
private JPanel getButtonBar() { if (buttonBar == null) { buttonBar = new JPanel(); buttonBar.setLayout(new FlowLayout(FlowLayout.TRAILING)); buttonBar.add(getLaunchButton(), null); } return buttonBar; }
JPanel function() { if (buttonBar == null) { buttonBar = new JPanel(); buttonBar.setLayout(new FlowLayout(FlowLayout.TRAILING)); buttonBar.add(getLaunchButton(), null); } return buttonBar; }
/** * This method initializes buttonBar * * @return javax.swing.JPanel */
This method initializes buttonBar
getButtonBar
{ "repo_name": "infoplat/SchemaSpy_5.0.0", "path": "src/net/sourceforge/schemaspy/ui/MainFrame.java", "license": "lgpl-2.1", "size": 5454 }
[ "java.awt.FlowLayout", "javax.swing.JPanel" ]
import java.awt.FlowLayout; import javax.swing.JPanel;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
607,075
@Test public void testIntegers() throws InvalidFormatException, IOException { final InputStream stream = ExcelCellReaderTest.class.getResourceAsStream("data/excel-test.xls"); final ExcelCellReader reader = new ExcelCellReader(stream, "roster"); // check that everything in column E (4) is an integer String[] values; while (null != (values = reader.readNext())) { if (values.length > 0) { // skip empty lines if ("line number".equals(values[0])) { // skip header continue; } final String divStr = values[4]; assertTrue(-1 == divStr.indexOf('.'), "Found decimal point line: " + values[0]); } } }
void function() throws InvalidFormatException, IOException { final InputStream stream = ExcelCellReaderTest.class.getResourceAsStream(STR); final ExcelCellReader reader = new ExcelCellReader(stream, STR); String[] values; while (null != (values = reader.readNext())) { if (values.length > 0) { if (STR.equals(values[0])) { continue; } final String divStr = values[4]; assertTrue(-1 == divStr.indexOf('.'), STR + values[0]); } } }
/** * Make sure that integers read in are kept as integers. * * @throws IOException test error * @throws InvalidFormatException test error */
Make sure that integers read in are kept as integers
testIntegers
{ "repo_name": "jpschewe/fll-sw", "path": "src/test/java/fll/util/ExcelCellReaderTest.java", "license": "gpl-2.0", "size": 3680 }
[ "java.io.IOException", "java.io.InputStream", "org.apache.poi.openxml4j.exceptions.InvalidFormatException", "org.junit.jupiter.api.Assertions" ]
import java.io.IOException; import java.io.InputStream; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.junit.jupiter.api.Assertions;
import java.io.*; import org.apache.poi.openxml4j.exceptions.*; import org.junit.jupiter.api.*;
[ "java.io", "org.apache.poi", "org.junit.jupiter" ]
java.io; org.apache.poi; org.junit.jupiter;
1,933,156
public List<WorkingAgreement> search(SortCriteria crit) throws DataAccException { return super.list(WorkingAgreement.class, crit); }
List<WorkingAgreement> function(SortCriteria crit) throws DataAccException { return super.list(WorkingAgreement.class, crit); }
/** * Get all WorkingAgreement objects from database sorted by the given criteria * * @param crit the sorting criteria * @return a list with all existing WorkingAgreement objects * @throws DataAccException on error */
Get all WorkingAgreement objects from database sorted by the given criteria
search
{ "repo_name": "terrex/tntconcept-materials-testing", "path": "src/main/java/com/autentia/intra/dao/hibernate/WorkingAgreementDAO.java", "license": "gpl-2.0", "size": 4486 }
[ "com.autentia.intra.businessobject.WorkingAgreement", "com.autentia.intra.dao.DataAccException", "com.autentia.intra.dao.SortCriteria", "java.util.List" ]
import com.autentia.intra.businessobject.WorkingAgreement; import com.autentia.intra.dao.DataAccException; import com.autentia.intra.dao.SortCriteria; import java.util.List;
import com.autentia.intra.businessobject.*; import com.autentia.intra.dao.*; import java.util.*;
[ "com.autentia.intra", "java.util" ]
com.autentia.intra; java.util;
811,773
public void addSaveSearchListener(ChangeListener l) { searchDAO.addSavedSearchChangeListener(l); }
void function(ChangeListener l) { searchDAO.addSavedSearchChangeListener(l); }
/** * This will add a SaveSearchListener where necessary, to receive * needed events. * * @param l * the SavedSearchListener to be added */
This will add a SaveSearchListener where necessary, to receive needed events
addSaveSearchListener
{ "repo_name": "posborne/mango-movie-manager", "path": "src/com/themangoproject/model/MangoController.java", "license": "mit", "size": 20444 }
[ "javax.swing.event.ChangeListener" ]
import javax.swing.event.ChangeListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
775,880
public static java.util.Set extractBedAvailabilitySet(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.BedAvailabilityVoCollection voCollection) { return extractBedAvailabilitySet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.BedAvailabilityVoCollection voCollection) { return extractBedAvailabilitySet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.emergency.domain.objects.BedAvailability set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.emergency.domain.objects.BedAvailability set from the value object collection
extractBedAvailabilitySet
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/BedAvailabilityVoAssembler.java", "license": "agpl-3.0", "size": 24041 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
145,118
private static int findCrossoverIndex( List<CrossoverPoint> crossovers, double newCrossover) { int size = crossovers.size(); // we start at 1 because the new crossover should never be less than // 0 and all chromosomes start at 0 int i = 1; for( ; i < size; i++) { if(newCrossover < crossovers.get(i).getCentimorganPosition()) { break; } } return i; }
static int function( List<CrossoverPoint> crossovers, double newCrossover) { int size = crossovers.size(); int i = 1; for( ; i < size; i++) { if(newCrossover < crossovers.get(i).getCentimorganPosition()) { break; } } return i; }
/** * Determines where the new crossover should be inserted in the given list * of crossovers. * @param crossovers the list we're going to insert a new crossover in * @param newCrossover the new crossover location in cM * @return the insertion index */
Determines where the new crossover should be inserted in the given list of crossovers
findCrossoverIndex
{ "repo_name": "cgd/drake-genetics", "path": "modules/drake-genetics-server/src/java/org/jax/drakegenetics/server/ReproductionSimulator.java", "license": "gpl-3.0", "size": 13202 }
[ "java.util.List", "org.jax.drakegenetics.shareddata.client.CrossoverPoint" ]
import java.util.List; import org.jax.drakegenetics.shareddata.client.CrossoverPoint;
import java.util.*; import org.jax.drakegenetics.shareddata.client.*;
[ "java.util", "org.jax.drakegenetics" ]
java.util; org.jax.drakegenetics;
299,807
public Message getMessage() { return message; }
Message function() { return message; }
/** * Gets message. * * @return the message */
Gets message
getMessage
{ "repo_name": "iSDP/Telebot", "path": "src/main/java/nl/dead_pixel/telebot/api/types/misc/Update.java", "license": "apache-2.0", "size": 6296 }
[ "nl.dead_pixel.telebot.api.types.chat.Message" ]
import nl.dead_pixel.telebot.api.types.chat.Message;
import nl.dead_pixel.telebot.api.types.chat.*;
[ "nl.dead_pixel.telebot" ]
nl.dead_pixel.telebot;
2,213,105
public String toString() { int max = size() - 1; StringBuffer buf = new StringBuffer(); Enumeration k = keys(); Enumeration e = elements(); buf.append("{"); for (int i = 0; i <= max; i++) { String s1 = k.nextElement().toString(); String s2 = e.nextElement().toString(); buf.append(s1 + "=" + s2); if (i < max) { buf.append(", "); } } buf.append("}"); return buf.toString(); }
String function() { int max = size() - 1; StringBuffer buf = new StringBuffer(); Enumeration k = keys(); Enumeration e = elements(); buf.append("{"); for (int i = 0; i <= max; i++) { String s1 = k.nextElement().toString(); String s2 = e.nextElement().toString(); buf.append(s1 + "=" + s2); if (i < max) { buf.append(STR); } } buf.append("}"); return buf.toString(); }
/** * Returns a rather long string representation of this hashtable. * * @return a string representation of this hashtable. * @since JDK1.0 */
Returns a rather long string representation of this hashtable
toString
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/sun/corba/se/impl/util/IdentityHashtable.java", "license": "apache-2.0", "size": 11650 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,447,448
@Override @SuppressWarnings("unchecked") public void prepareToRead(RecordReader reader, PigSplit split) { this.reader = (LuceneIndexRecordReader<T>) reader; }
@SuppressWarnings(STR) void function(RecordReader reader, PigSplit split) { this.reader = (LuceneIndexRecordReader<T>) reader; }
/** * THIS INVOLVES AN UNCHECKED CAST * Pig gives us a raw type for the RecordReader unfortunately. * However, because {@link #getInputFormat()} is final and delegates * to {@link #getLuceneIndexInputFormat()} we can be reasonably sure * that this record reader is actually a LuceneIndexRecordReader<T> */
THIS INVOLVES AN UNCHECKED CAST Pig gives us a raw type for the RecordReader unfortunately. However, because <code>#getInputFormat()</code> is final and delegates to <code>#getLuceneIndexInputFormat()</code> we can be reasonably sure that this record reader is actually a LuceneIndexRecordReader
prepareToRead
{ "repo_name": "canojim/elephant-bird", "path": "pig-lucene/src/main/java/com/twitter/elephantbird/pig/load/LuceneIndexLoader.java", "license": "apache-2.0", "size": 6575 }
[ "com.twitter.elephantbird.mapreduce.input.LuceneIndexRecordReader", "org.apache.hadoop.mapreduce.RecordReader", "org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit" ]
import com.twitter.elephantbird.mapreduce.input.LuceneIndexRecordReader; import org.apache.hadoop.mapreduce.RecordReader; import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit;
import com.twitter.elephantbird.mapreduce.input.*; import org.apache.hadoop.mapreduce.*; import org.apache.pig.backend.hadoop.executionengine.*;
[ "com.twitter.elephantbird", "org.apache.hadoop", "org.apache.pig" ]
com.twitter.elephantbird; org.apache.hadoop; org.apache.pig;
443,152
public static XMLGregorianCalendar getIssueInstant() { return getIssueInstant(getCurrentTimeZoneID()); }
static XMLGregorianCalendar function() { return getIssueInstant(getCurrentTimeZoneID()); }
/** * Get the current instant of time * * @return */
Get the current instant of time
getIssueInstant
{ "repo_name": "thomasdarimont/keycloak", "path": "saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/XMLTimeUtil.java", "license": "apache-2.0", "size": 7699 }
[ "javax.xml.datatype.XMLGregorianCalendar" ]
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.datatype.*;
[ "javax.xml" ]
javax.xml;
2,855,929
private boolean checkLogForTestSuccess() throws IOException { // Unit failures are not a execution failure, so here the log is expected final Scanner stdOutScanner = new Scanner(stdout); while (stdOutScanner.hasNextLine()) { final String line = stdOutScanner.nextLine(); if (line.contains("test") && line.contains("failed")) { return false; } } return true; }
boolean function() throws IOException { final Scanner stdOutScanner = new Scanner(stdout); while (stdOutScanner.hasNextLine()) { final String line = stdOutScanner.nextLine(); if (line.contains("test") && line.contains(STR)) { return false; } } return true; }
/** * Parses the log of the client side test for test failing message. * * @return <code>true</code> when the client side test parse has succeeded. Otherwise * <code>false</code> * @throws IOException */
Parses the log of the client side test for test failing message
checkLogForTestSuccess
{ "repo_name": "wem/vertx-dart-sockjs", "path": "src/test/java/ch/sourcemotion/vertx/dart/AbstractClientServerTest.java", "license": "mit", "size": 3611 }
[ "java.io.IOException", "java.util.Scanner" ]
import java.io.IOException; import java.util.Scanner;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
458,463
private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 249, 273); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(panelMapa, BorderLayout.CENTER); panelMapa.setLayout(null); //esta linea me la estaba liando,no dejaba redibujar! JMenuBar menuBar = new JMenuBar(); frame.setJMenuBar(menuBar); JMenu menuLoad = new JMenu("Load"); menuBar.add(menuLoad);
void function() { frame = new JFrame(); frame.setBounds(100, 100, 249, 273); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(panelMapa, BorderLayout.CENTER); panelMapa.setLayout(null); JMenuBar menuBar = new JMenuBar(); frame.setJMenuBar(menuBar); JMenu menuLoad = new JMenu("Load"); menuBar.add(menuLoad);
/** * Initialize the contents of the frame. */
Initialize the contents of the frame
initialize
{ "repo_name": "Kenrria/KineticExplorer", "path": "Kartographer/src/MapWindow.java", "license": "mit", "size": 5927 }
[ "java.awt.BorderLayout", "javax.swing.JFrame", "javax.swing.JMenu", "javax.swing.JMenuBar" ]
import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,190,772
static <E> ListIterator<E> listIteratorImpl(List<E> list, int index) { return new AbstractListWrapper<E>(list).listIterator(index); }
static <E> ListIterator<E> listIteratorImpl(List<E> list, int index) { return new AbstractListWrapper<E>(list).listIterator(index); }
/** * Returns an implementation of {@link List#listIterator(int)}. */
Returns an implementation of <code>List#listIterator(int)</code>
listIteratorImpl
{ "repo_name": "eoneil1942/voltdb-4.7fix", "path": "third_party/java/src/com/google_voltpatches/common/collect/Lists.java", "license": "agpl-3.0", "size": 36168 }
[ "java.util.List", "java.util.ListIterator" ]
import java.util.List; import java.util.ListIterator;
import java.util.*;
[ "java.util" ]
java.util;
2,432,554
public static boolean isEmpty(Dictionary coll) { return (coll == null || coll.isEmpty()); }
static boolean function(Dictionary coll) { return (coll == null coll.isEmpty()); }
/** * Null-safe check if the specified Dictionary is empty. * * <p>Null returns true. * * @param coll the collection to check, may be null * @return true if empty or null */
Null-safe check if the specified Dictionary is empty. Null returns true
isEmpty
{ "repo_name": "alibaba/nacos", "path": "common/src/main/java/com/alibaba/nacos/common/utils/MapUtil.java", "license": "apache-2.0", "size": 5091 }
[ "java.util.Dictionary" ]
import java.util.Dictionary;
import java.util.*;
[ "java.util" ]
java.util;
2,383,951
@Override public Integer saveBean(ISerializableLabelBean serializableLabelBean, Map<String, Map<Integer, Integer>> matchesMap) { TListBean listBean = (TListBean)serializableLabelBean; Integer parentList = listBean.getParentList(); if (parentList!=null) { Map<Integer, Integer> listMap = matchesMap.get(ExchangeFieldNames.LIST); listBean.setParentList(listMap.get(parentList)); } Integer projectID = listBean.getProject(); if (projectID!=null) { Map<Integer, Integer> projectMap = matchesMap.get(MergeUtil.mergeKey(SystemFields.INTEGER_PROJECT, null)); listBean.setProject(projectMap.get(projectID)); } Integer ownerID = listBean.getOwner(); if (ownerID!=null) { Map<Integer, Integer> personMap = matchesMap.get(MergeUtil.mergeKey(SystemFields.INTEGER_PERSON, null)); listBean.setOwner(personMap.get(ownerID)); } return ListBL.save(listBean); }
Integer function(ISerializableLabelBean serializableLabelBean, Map<String, Map<Integer, Integer>> matchesMap) { TListBean listBean = (TListBean)serializableLabelBean; Integer parentList = listBean.getParentList(); if (parentList!=null) { Map<Integer, Integer> listMap = matchesMap.get(ExchangeFieldNames.LIST); listBean.setParentList(listMap.get(parentList)); } Integer projectID = listBean.getProject(); if (projectID!=null) { Map<Integer, Integer> projectMap = matchesMap.get(MergeUtil.mergeKey(SystemFields.INTEGER_PROJECT, null)); listBean.setProject(projectMap.get(projectID)); } Integer ownerID = listBean.getOwner(); if (ownerID!=null) { Map<Integer, Integer> personMap = matchesMap.get(MergeUtil.mergeKey(SystemFields.INTEGER_PERSON, null)); listBean.setOwner(personMap.get(ownerID)); } return ListBL.save(listBean); }
/** * Saves a serializableLabelBean into the database * @param serializableLabelBean * @param matchesMap * @return */
Saves a serializableLabelBean into the database
saveBean
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/beans/TListBean.java", "license": "gpl-3.0", "size": 13019 }
[ "com.aurel.track.admin.customize.lists.ListBL", "com.aurel.track.exchange.track.ExchangeFieldNames", "com.aurel.track.fieldType.constants.SystemFields", "com.aurel.track.fieldType.runtime.helpers.MergeUtil", "java.util.Map" ]
import com.aurel.track.admin.customize.lists.ListBL; import com.aurel.track.exchange.track.ExchangeFieldNames; import com.aurel.track.fieldType.constants.SystemFields; import com.aurel.track.fieldType.runtime.helpers.MergeUtil; import java.util.Map;
import com.aurel.track.*; import com.aurel.track.admin.customize.lists.*; import com.aurel.track.exchange.track.*; import java.util.*;
[ "com.aurel.track", "java.util" ]
com.aurel.track; java.util;
735,742
protected void paintDarkTrack(Graphics g0) { Graphics2D g = (Graphics2D) g0; VectorImage img = new VectorImage(); Graphics2D w = img.createGraphics(); w.setRenderingHints(g.getRenderingHints()); w.clipRect(0, 0, getWidth(), getHeight()); super.paintComponent(w); for (Operation op : img.getOperations()) { op.paint((Graphics2D) g); if (op instanceof ImageOperation) { Rectangle r = op.getBounds().getBounds(); if (r.width > getWidth() * .8) { g.setColor(new Color(0, 0, 0, 40)); ((Graphics2D) g).fill(op.getBounds()); } } } } } protected JLabel configurationLabel = new JLabel("Configuration:"); protected JLabel exampleLabel = new JLabel("Example:"); protected JPanel configurationPanel = new JPanel(); protected JPanel examplePanel = new JPanel(); private boolean stretchExampleToFillHoriz = false; private boolean stretchExampleToFillVert = false; private boolean stretchConfigurationToFillHoriz = false; public ShowcaseExampleDemo() { this(false, false, true); } public ShowcaseExampleDemo(boolean stretchExampleToFillHoriz, boolean stretchExampleToFillVert, boolean useRoundedCorners) { this(stretchExampleToFillHoriz, stretchExampleToFillVert, useRoundedCorners, false); } public ShowcaseExampleDemo(boolean stretchExampleToFillHoriz, boolean stretchExampleToFillVert, boolean useRoundedCorners, boolean stretchConfigurationToFillHoriz) { super(); this.stretchExampleToFillHoriz = stretchExampleToFillHoriz; this.stretchExampleToFillVert = stretchExampleToFillVert; this.stretchConfigurationToFillHoriz = stretchConfigurationToFillHoriz; layoutComponents(); Font font = getHeaderLabelFont(); exampleLabel.setFont(font); configurationLabel.setFont(font); QPanelUI panelUI = QPanelUI.createBoxUI(); configurationPanel.setUI(panelUI); if (useRoundedCorners) { examplePanel.setUI(panelUI); } else { panelUI = QPanelUI.createBoxUI(); panelUI.setCornerSize(0); configurationPanel.setUI(panelUI); } exampleLabel.setLabelFor(examplePanel); configurationLabel.setLabelFor(configurationPanel); }
void function(Graphics g0) { Graphics2D g = (Graphics2D) g0; VectorImage img = new VectorImage(); Graphics2D w = img.createGraphics(); w.setRenderingHints(g.getRenderingHints()); w.clipRect(0, 0, getWidth(), getHeight()); super.paintComponent(w); for (Operation op : img.getOperations()) { op.paint((Graphics2D) g); if (op instanceof ImageOperation) { Rectangle r = op.getBounds().getBounds(); if (r.width > getWidth() * .8) { g.setColor(new Color(0, 0, 0, 40)); ((Graphics2D) g).fill(op.getBounds()); } } } } } protected JLabel configurationLabel = new JLabel(STR); protected JLabel exampleLabel = new JLabel(STR); protected JPanel configurationPanel = new JPanel(); protected JPanel examplePanel = new JPanel(); private boolean stretchExampleToFillHoriz = false; private boolean stretchExampleToFillVert = false; private boolean stretchConfigurationToFillHoriz = false; public ShowcaseExampleDemo() { this(false, false, true); } public ShowcaseExampleDemo(boolean stretchExampleToFillHoriz, boolean stretchExampleToFillVert, boolean useRoundedCorners) { this(stretchExampleToFillHoriz, stretchExampleToFillVert, useRoundedCorners, false); } public ShowcaseExampleDemo(boolean stretchExampleToFillHoriz, boolean stretchExampleToFillVert, boolean useRoundedCorners, boolean stretchConfigurationToFillHoriz) { super(); this.stretchExampleToFillHoriz = stretchExampleToFillHoriz; this.stretchExampleToFillVert = stretchExampleToFillVert; this.stretchConfigurationToFillHoriz = stretchConfigurationToFillHoriz; layoutComponents(); Font font = getHeaderLabelFont(); exampleLabel.setFont(font); configurationLabel.setFont(font); QPanelUI panelUI = QPanelUI.createBoxUI(); configurationPanel.setUI(panelUI); if (useRoundedCorners) { examplePanel.setUI(panelUI); } else { panelUI = QPanelUI.createBoxUI(); panelUI.setCornerSize(0); configurationPanel.setUI(panelUI); } exampleLabel.setLabelFor(examplePanel); configurationLabel.setLabelFor(configurationPanel); }
/** * Paint an extra shadow on top of the track. I wish there were an * easier way to do this, but I looked through the WindowsSliderUI and * didn't see a way to customize the track color. */
Paint an extra shadow on top of the track. I wish there were an easier way to do this, but I looked through the WindowsSliderUI and didn't see a way to customize the track color
paintDarkTrack
{ "repo_name": "mickleness/pumpernickel", "path": "src/main/java/com/pump/showcase/demo/ShowcaseExampleDemo.java", "license": "mit", "size": 5569 }
[ "com.pump.graphics.vector.ImageOperation", "com.pump.graphics.vector.Operation", "com.pump.graphics.vector.VectorImage", "com.pump.plaf.QPanelUI", "java.awt.Color", "java.awt.Font", "java.awt.Graphics", "java.awt.Graphics2D", "java.awt.Rectangle", "javax.swing.JLabel", "javax.swing.JPanel" ]
import com.pump.graphics.vector.ImageOperation; import com.pump.graphics.vector.Operation; import com.pump.graphics.vector.VectorImage; import com.pump.plaf.QPanelUI; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import javax.swing.JLabel; import javax.swing.JPanel;
import com.pump.graphics.vector.*; import com.pump.plaf.*; import java.awt.*; import javax.swing.*;
[ "com.pump.graphics", "com.pump.plaf", "java.awt", "javax.swing" ]
com.pump.graphics; com.pump.plaf; java.awt; javax.swing;
1,204,357
void unbind(SocketAddress... localAddresses) throws IOException;
void unbind(SocketAddress... localAddresses) throws IOException;
/** * Unbinds from the specified local addresses and stop to accept incoming * connections. This method returns silently if the default local addresses * are not bound yet. * @throws IOException * if failed to unbind */
Unbinds from the specified local addresses and stop to accept incoming connections. This method returns silently if the default local addresses are not bound yet
unbind
{ "repo_name": "davcamer/clients", "path": "projects-for-testing/mina/core/src/main/java/org/apache/mina/api/IoServer.java", "license": "apache-2.0", "size": 2104 }
[ "java.io.IOException", "java.net.SocketAddress" ]
import java.io.IOException; import java.net.SocketAddress;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,297,703
public IContextProvider<AjaxRequestTarget, Page> getAjaxRequestTargetProvider() { return ajaxRequestTargetProvider; }
IContextProvider<AjaxRequestTarget, Page> function() { return ajaxRequestTargetProvider; }
/** * Returns the provider for {@link AjaxRequestTarget} objects. * * @return the provider for {@link AjaxRequestTarget} objects. */
Returns the provider for <code>AjaxRequestTarget</code> objects
getAjaxRequestTargetProvider
{ "repo_name": "afiantara/apache-wicket-1.5.7", "path": "src/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java", "license": "apache-2.0", "size": 30040 }
[ "org.apache.wicket.Page", "org.apache.wicket.ajax.AjaxRequestTarget", "org.apache.wicket.util.IContextProvider" ]
import org.apache.wicket.Page; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.util.IContextProvider;
import org.apache.wicket.*; import org.apache.wicket.ajax.*; import org.apache.wicket.util.*;
[ "org.apache.wicket" ]
org.apache.wicket;
2,724,539
public static String INSTRUCTION(PlayerData PDI) { //ChatColor.YELLOW + "" return PDI.theme.INSTRUCTION(); }
static String function(PlayerData PDI) { return PDI.theme.INSTRUCTION(); }
/** * Used to give instructions */
Used to give instructions
INSTRUCTION
{ "repo_name": "InspiredOne/Inspired-Nations-v1.0", "path": "Inspired Nations v1.0/src/com/github/InspiredOne/InspiredNations/ToolBox/Tools.java", "license": "gpl-3.0", "size": 11091 }
[ "com.github.InspiredOne" ]
import com.github.InspiredOne;
import com.github.*;
[ "com.github" ]
com.github;
2,800,243
static void setupRecoveryTestConf(Configuration conf) throws IOException { conf.set(DFSConfigKeys.DFS_NAMESERVICES, "ns1"); conf.set(DFSConfigKeys.DFS_HA_NAMENODE_ID_KEY, "nn1"); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, "ns1"), "nn1,nn2"); String baseDir = GenericTestUtils.getTestDir("setupRecoveryTestConf") .getAbsolutePath(); File nameDir = new File(baseDir, "nameR"); File secondaryDir = new File(baseDir, "namesecondaryR"); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys. DFS_NAMENODE_NAME_DIR_KEY, "ns1", "nn1"), nameDir.getCanonicalPath()); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys. DFS_NAMENODE_CHECKPOINT_DIR_KEY, "ns1", "nn1"), secondaryDir.getCanonicalPath()); conf.unset(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY); conf.unset(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_DIR_KEY); FileUtils.deleteQuietly(nameDir); if (!nameDir.mkdirs()) { throw new RuntimeException("failed to make directory " + nameDir.getAbsolutePath()); } FileUtils.deleteQuietly(secondaryDir); if (!secondaryDir.mkdirs()) { throw new RuntimeException("failed to make directory " + secondaryDir.getAbsolutePath()); } }
static void setupRecoveryTestConf(Configuration conf) throws IOException { conf.set(DFSConfigKeys.DFS_NAMESERVICES, "ns1"); conf.set(DFSConfigKeys.DFS_HA_NAMENODE_ID_KEY, "nn1"); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, "ns1"), STR); String baseDir = GenericTestUtils.getTestDir(STR) .getAbsolutePath(); File nameDir = new File(baseDir, "nameR"); File secondaryDir = new File(baseDir, STR); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys. DFS_NAMENODE_NAME_DIR_KEY, "ns1", "nn1"), nameDir.getCanonicalPath()); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys. DFS_NAMENODE_CHECKPOINT_DIR_KEY, "ns1", "nn1"), secondaryDir.getCanonicalPath()); conf.unset(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY); conf.unset(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_DIR_KEY); FileUtils.deleteQuietly(nameDir); if (!nameDir.mkdirs()) { throw new RuntimeException(STR + nameDir.getAbsolutePath()); } FileUtils.deleteQuietly(secondaryDir); if (!secondaryDir.mkdirs()) { throw new RuntimeException(STR + secondaryDir.getAbsolutePath()); } }
/** * Create a test configuration that will exercise the initializeGenericKeys * code path. This is a regression test for HDFS-4279. */
Create a test configuration that will exercise the initializeGenericKeys code path. This is a regression test for HDFS-4279
setupRecoveryTestConf
{ "repo_name": "JingchengDu/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeRecovery.java", "license": "apache-2.0", "size": 22372 }
[ "java.io.File", "java.io.IOException", "org.apache.commons.io.FileUtils", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hdfs.DFSConfigKeys", "org.apache.hadoop.hdfs.DFSUtil", "org.apache.hadoop.test.GenericTestUtils" ]
import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.test.GenericTestUtils;
import java.io.*; import org.apache.commons.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.test.*;
[ "java.io", "org.apache.commons", "org.apache.hadoop" ]
java.io; org.apache.commons; org.apache.hadoop;
2,467,529
@Override public Adapter createCallMediatorOutputConnectorAdapter() { if (callMediatorOutputConnectorItemProvider == null) { callMediatorOutputConnectorItemProvider = new CallMediatorOutputConnectorItemProvider(this); } return callMediatorOutputConnectorItemProvider; } protected CallMediatorEndpointOutputConnectorItemProvider callMediatorEndpointOutputConnectorItemProvider;
Adapter function() { if (callMediatorOutputConnectorItemProvider == null) { callMediatorOutputConnectorItemProvider = new CallMediatorOutputConnectorItemProvider(this); } return callMediatorOutputConnectorItemProvider; } protected CallMediatorEndpointOutputConnectorItemProvider callMediatorEndpointOutputConnectorItemProvider;
/** * This creates an adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.CallMediatorOutputConnector}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>org.wso2.developerstudio.eclipse.gmf.esb.CallMediatorOutputConnector</code>.
createCallMediatorOutputConnectorAdapter
{ "repo_name": "rajeevanv89/developer-studio", "path": "esb/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/EsbItemProviderAdapterFactory.java", "license": "apache-2.0", "size": 286852 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,344,596
public static SQLException createSQLFeatureNotSupportedException() throws SQLException { SQLException newEx; if (Util.isJdbc4()) { newEx = (SQLException) Util.getInstance("java.sql.SQLFeatureNotSupportedException", null, null, null); } else { newEx = new NotImplemented(); } return newEx; }
static SQLException function() throws SQLException { SQLException newEx; if (Util.isJdbc4()) { newEx = (SQLException) Util.getInstance(STR, null, null, null); } else { newEx = new NotImplemented(); } return newEx; }
/** * Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use. */
Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use
createSQLFeatureNotSupportedException
{ "repo_name": "scopej/mysql-connector-j", "path": "src/com/mysql/jdbc/SQLError.java", "license": "gpl-2.0", "size": 82788 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,114,728
private SSLContextHolder createSslContext(X509ExtendedKeyManager keyManager, X509ExtendedTrustManager trustManager, SSLConfiguration sslConfiguration) { trustManager = wrapWithDiagnostics(trustManager, sslConfiguration); // Initialize sslContext try { SSLContext sslContext = SSLContext.getInstance(sslContextAlgorithm(sslConfiguration.supportedProtocols())); sslContext.init(new X509ExtendedKeyManager[]{keyManager}, new X509ExtendedTrustManager[]{trustManager}, null); // check the supported ciphers and log them here to prevent spamming logs on every call supportedCiphers(sslContext.getSupportedSSLParameters().getCipherSuites(), sslConfiguration.cipherSuites(), true); return new SSLContextHolder(sslContext, sslConfiguration); } catch (NoSuchAlgorithmException | KeyManagementException e) { throw new ElasticsearchException("failed to initialize the SSLContext", e); } }
SSLContextHolder function(X509ExtendedKeyManager keyManager, X509ExtendedTrustManager trustManager, SSLConfiguration sslConfiguration) { trustManager = wrapWithDiagnostics(trustManager, sslConfiguration); try { SSLContext sslContext = SSLContext.getInstance(sslContextAlgorithm(sslConfiguration.supportedProtocols())); sslContext.init(new X509ExtendedKeyManager[]{keyManager}, new X509ExtendedTrustManager[]{trustManager}, null); supportedCiphers(sslContext.getSupportedSSLParameters().getCipherSuites(), sslConfiguration.cipherSuites(), true); return new SSLContextHolder(sslContext, sslConfiguration); } catch (NoSuchAlgorithmException KeyManagementException e) { throw new ElasticsearchException(STR, e); } }
/** * Creates an {@link SSLContext} based on the provided configuration and trust/key managers * * @param sslConfiguration the configuration to use for context creation * @param keyManager the key manager to use * @param trustManager the trust manager to use * @return the created SSLContext */
Creates an <code>SSLContext</code> based on the provided configuration and trust/key managers
createSslContext
{ "repo_name": "robin13/elasticsearch", "path": "x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java", "license": "apache-2.0", "size": 41290 }
[ "java.security.KeyManagementException", "java.security.NoSuchAlgorithmException", "javax.net.ssl.SSLContext", "javax.net.ssl.X509ExtendedKeyManager", "javax.net.ssl.X509ExtendedTrustManager", "org.elasticsearch.ElasticsearchException" ]
import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import javax.net.ssl.SSLContext; import javax.net.ssl.X509ExtendedKeyManager; import javax.net.ssl.X509ExtendedTrustManager; import org.elasticsearch.ElasticsearchException;
import java.security.*; import javax.net.ssl.*; import org.elasticsearch.*;
[ "java.security", "javax.net", "org.elasticsearch" ]
java.security; javax.net; org.elasticsearch;
2,410,844
Future<OperationStatusResponse> setOnRoleAsync(String serviceName, String deploymentName, String roleName, IPForwardingSetParameters parameters);
Future<OperationStatusResponse> setOnRoleAsync(String serviceName, String deploymentName, String roleName, IPForwardingSetParameters parameters);
/** * Sets IP Forwarding on a role. * * @param serviceName Required. * @param deploymentName Required. * @param roleName Required. * @param parameters Required. Parameters supplied to the Set IP Forwarding * on role operation. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the * HTTP status code returned for the Get Operation Status operation itself. * If the asynchronous operation succeeded, the response body includes the * HTTP status code for the successful request. If the asynchronous * operation failed, the response body includes the HTTP status code for * the failed request, and also includes error information regarding the * failure. */
Sets IP Forwarding on a role
setOnRoleAsync
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-network/src/main/java/com/microsoft/windowsazure/management/network/IPForwardingOperations.java", "license": "apache-2.0", "size": 16216 }
[ "com.microsoft.windowsazure.core.OperationStatusResponse", "com.microsoft.windowsazure.management.network.models.IPForwardingSetParameters", "java.util.concurrent.Future" ]
import com.microsoft.windowsazure.core.OperationStatusResponse; import com.microsoft.windowsazure.management.network.models.IPForwardingSetParameters; import java.util.concurrent.Future;
import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.management.network.models.*; import java.util.concurrent.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
1,865,756
//------------------------------------------------------< check methods >--- void checkIsAlive() throws RepositoryException { // check session status if (!alive) { throw new RepositoryException("This session has been closed."); } } /** * Returns true if the repository supports the given option. False otherwise. * * @param option Any of the option constants defined by {@link Repository}
void checkIsAlive() throws RepositoryException { if (!alive) { throw new RepositoryException(STR); } } /** * Returns true if the repository supports the given option. False otherwise. * * @param option Any of the option constants defined by {@link Repository}
/** * Performs a sanity check on this session. * * @throws RepositoryException if this session has been rendered invalid * for some reason (e.g. if this session has been closed explicitly by logout) */
Performs a sanity check on this session
checkIsAlive
{ "repo_name": "sdmcraft/jackrabbit", "path": "jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java", "license": "apache-2.0", "size": 39935 }
[ "javax.jcr.Repository", "javax.jcr.RepositoryException" ]
import javax.jcr.Repository; import javax.jcr.RepositoryException;
import javax.jcr.*;
[ "javax.jcr" ]
javax.jcr;
1,953,605
@Test(description = " Delete Text signature using Delete button and verify through soap ", groups = { "smoke" }) public void DeleteTextSignatures() throws HarnessException { _createSignature(app.zGetActiveAccount()); //Click on Mail/signature app.zTreePreferences.zTreeItem(Action.A_LEFTCLICK,TreeItem.MailSignatures); //Signature is created SignatureItem signature = SignatureItem.importFromSOAP(app.zGetActiveAccount(), this.sigName); ZAssert.assertEquals(signature.getName(), this.sigName, "verified Text Signature is created"); FormSignatureNew signew = new FormSignatureNew(app); //Select signature which is to be Delete signew.zClick(Locators.zSignatureListView); signew.zClick("//td[contains(text(),'"+signature.getName()+"')]"); //click Delete button app.zPageSignature.zToolbarPressButton(Button.B_DELETE); //click Save signew.zSubmit(); GeneralUtility.syncDesktopToZcsWithSoap(app.zGetActiveAccount()); app.zPageMail.zWaitForDesktopLoadingSpinner(5000); // To check whether deleted signature is exist app.zGetActiveAccount().soapSend("<GetSignaturesRequest xmlns='urn:zimbraAccount'/>"); String signame = app.zGetActiveAccount().soapSelectValue("//acct:signature[@name='" + this.sigName + "']","name"); ZAssert.assertNull(signame, "Verify signature is deleted"); }
@Test(description = STR, groups = { "smoke" }) void function() throws HarnessException { _createSignature(app.zGetActiveAccount()); app.zTreePreferences.zTreeItem(Action.A_LEFTCLICK,TreeItem.MailSignatures); SignatureItem signature = SignatureItem.importFromSOAP(app.zGetActiveAccount(), this.sigName); ZAssert.assertEquals(signature.getName(), this.sigName, STR); FormSignatureNew signew = new FormSignatureNew(app); signew.zClick(Locators.zSignatureListView); signew.zClick(STR<GetSignaturesRequest xmlns='urn:zimbraAccount'/>STR ZAssert.assertNull(signame, STR); }
/** * Test case :Create signature through soap then delete and verify signature through soap * @Steps: * Create signature through soap * Delete signature using delete button. * Verify signature doesn't exist from soap * @throws HarnessException */
Test case :Create signature through soap then delete and verify signature through soap
DeleteTextSignatures
{ "repo_name": "nico01f/z-pec", "path": "ZimbraSelenium/src/java/com/zimbra/qa/selenium/projects/desktop/tests/preferences/mail/signatures/DeleteTextSignature.java", "license": "mit", "size": 3879 }
[ "com.zimbra.qa.selenium.framework.items.SignatureItem", "com.zimbra.qa.selenium.framework.ui.Action", "com.zimbra.qa.selenium.framework.util.HarnessException", "com.zimbra.qa.selenium.framework.util.ZAssert", "com.zimbra.qa.selenium.projects.desktop.ui.preferences.TreePreferences", "com.zimbra.qa.selenium.projects.desktop.ui.preferences.signature.FormSignatureNew", "com.zimbra.qa.selenium.projects.desktop.ui.preferences.signature.PageSignature", "org.testng.annotations.Test" ]
import com.zimbra.qa.selenium.framework.items.SignatureItem; import com.zimbra.qa.selenium.framework.ui.Action; import com.zimbra.qa.selenium.framework.util.HarnessException; import com.zimbra.qa.selenium.framework.util.ZAssert; import com.zimbra.qa.selenium.projects.desktop.ui.preferences.TreePreferences; import com.zimbra.qa.selenium.projects.desktop.ui.preferences.signature.FormSignatureNew; import com.zimbra.qa.selenium.projects.desktop.ui.preferences.signature.PageSignature; import org.testng.annotations.Test;
import com.zimbra.qa.selenium.framework.items.*; import com.zimbra.qa.selenium.framework.ui.*; import com.zimbra.qa.selenium.framework.util.*; import com.zimbra.qa.selenium.projects.desktop.ui.preferences.*; import com.zimbra.qa.selenium.projects.desktop.ui.preferences.signature.*; import org.testng.annotations.*;
[ "com.zimbra.qa", "org.testng.annotations" ]
com.zimbra.qa; org.testng.annotations;
1,780,295
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { return this.shouldRenderPass((EntitySoulFragment)p_77032_1_, p_77032_2_, p_77032_3_); }
int function(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { return this.shouldRenderPass((EntitySoulFragment)p_77032_1_, p_77032_2_, p_77032_3_); }
/** * Queries whether should render the specified pass or not. */
Queries whether should render the specified pass or not
shouldRenderPass
{ "repo_name": "MagiciansArtificeTeam/Magicians-Artifice", "path": "src/main/java/magiciansartifice/main/core/client/entity/RenderEntitySoulFragment.java", "license": "lgpl-3.0", "size": 4544 }
[ "net.minecraft.entity.EntityLivingBase" ]
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
2,212,389
public Hits search(Query query, String[] indexNames) throws KattaException;
Hits function(Query query, String[] indexNames) throws KattaException;
/** * Searches with a given query in the supplied indexes for an almost unlimited * ({@link Integer#MAX_VALUE}) amount of results. * * If this method might has poor performance try to limit results with * {@link #search(IQuery, String[], int)}. * * @param query * The query to search with. * @param indexNames * A list of index names to search in. * @return A object that capsulates all results. * @throws KattaException */
Searches with a given query in the supplied indexes for an almost unlimited (<code>Integer#MAX_VALUE</code>) amount of results. If this method might has poor performance try to limit results with <code>#search(IQuery, String[], int)</code>
search
{ "repo_name": "sgroschupf/katta", "path": "modules/katta-core/src/main/java/net/sf/katta/lib/lucene/ILuceneClient.java", "license": "apache-2.0", "size": 7066 }
[ "net.sf.katta.util.KattaException", "org.apache.lucene.search.Query" ]
import net.sf.katta.util.KattaException; import org.apache.lucene.search.Query;
import net.sf.katta.util.*; import org.apache.lucene.search.*;
[ "net.sf.katta", "org.apache.lucene" ]
net.sf.katta; org.apache.lucene;
595,099
EntityIdentifier[] searchForEntities(String query, int method, Class type) throws GroupsException;
EntityIdentifier[] searchForEntities(String query, int method, Class type) throws GroupsException;
/** * Find EntityIdentifiers for entities whose name matches the query string according to the * specified method and is of the specified type */
Find EntityIdentifiers for entities whose name matches the query string according to the specified method and is of the specified type
searchForEntities
{ "repo_name": "stalele/uPortal", "path": "uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/IGroupService.java", "license": "apache-2.0", "size": 3458 }
[ "org.apereo.portal.EntityIdentifier" ]
import org.apereo.portal.EntityIdentifier;
import org.apereo.portal.*;
[ "org.apereo.portal" ]
org.apereo.portal;
2,384,514
public void setColor(BoardType newColor) { color = newColor; } public GobanEvent(Goban source, int x, int y, BoardType c) { super(source); points = new Vector<Point>(); addPoint(new Point(x, y)); color = c; }
void function(BoardType newColor) { color = newColor; } public GobanEvent(Goban source, int x, int y, BoardType c) { super(source); points = new Vector<Point>(); addPoint(new Point(x, y)); color = c; }
/** * Insert the method's description here. Creation date: (03/25/00 16:14:16) * * @param newColor * goban.BoardType */
Insert the method's description here. Creation date: (03/25/00 16:14:16)
setColor
{ "repo_name": "cgawron/GoDrive", "path": "src/de/cgawron/go/GobanEvent.java", "license": "mit", "size": 2646 }
[ "de.cgawron.go.Goban", "de.cgawron.go.Point", "java.util.Vector" ]
import de.cgawron.go.Goban; import de.cgawron.go.Point; import java.util.Vector;
import de.cgawron.go.*; import java.util.*;
[ "de.cgawron.go", "java.util" ]
de.cgawron.go; java.util;
361,574
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(DropProcedureType.class)) { case DbchangelogPackage.DROP_PROCEDURE_TYPE__CATALOG_NAME: case DbchangelogPackage.DROP_PROCEDURE_TYPE__PROCEDURE_NAME: case DbchangelogPackage.DROP_PROCEDURE_TYPE__SCHEMA_NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case DbchangelogPackage.DROP_PROCEDURE_TYPE__ANY_ATTRIBUTE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(DropProcedureType.class)) { case DbchangelogPackage.DROP_PROCEDURE_TYPE__CATALOG_NAME: case DbchangelogPackage.DROP_PROCEDURE_TYPE__PROCEDURE_NAME: case DbchangelogPackage.DROP_PROCEDURE_TYPE__SCHEMA_NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case DbchangelogPackage.DROP_PROCEDURE_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": "Treehopper/EclipseAugments", "path": "liquibase-editor/eu.hohenegger.xsd.liquibase.ui/src-gen/org/liquibase/xml/ns/dbchangelog/provider/DropProcedureTypeItemProvider.java", "license": "epl-1.0", "size": 7998 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification", "org.liquibase.xml.ns.dbchangelog.DbchangelogPackage", "org.liquibase.xml.ns.dbchangelog.DropProcedureType" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage; import org.liquibase.xml.ns.dbchangelog.DropProcedureType;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*;
[ "org.eclipse.emf", "org.liquibase.xml" ]
org.eclipse.emf; org.liquibase.xml;
1,615,601
public static String toJsSanitizedContentOrdainer( ContentKind contentKind) { // soydata.VERY_UNSAFE.ordainSanitizedHtml etc are defined in soyutils{,_usegoog}.js. return Preconditions.checkNotNull(KIND_TO_JS_ORDAINER_NAME.get(contentKind)); } // Prevent instantiation. private NodeContentKinds() { }
static String function( ContentKind contentKind) { return Preconditions.checkNotNull(KIND_TO_JS_ORDAINER_NAME.get(contentKind)); } private NodeContentKinds() { }
/** * Given a {@link ContentKind}, returns the corresponding JS SanitizedContent factory function. */
Given a <code>ContentKind</code>, returns the corresponding JS SanitizedContent factory function
toJsSanitizedContentOrdainer
{ "repo_name": "core9/closure-templates", "path": "src/impl/java/com/google/template/soy/data/internalutils/NodeContentKinds.java", "license": "apache-2.0", "size": 5491 }
[ "com.google.common.base.Preconditions", "com.google.template.soy.data.SanitizedContent" ]
import com.google.common.base.Preconditions; import com.google.template.soy.data.SanitizedContent;
import com.google.common.base.*; import com.google.template.soy.data.*;
[ "com.google.common", "com.google.template" ]
com.google.common; com.google.template;
2,408,581
public int getChunkHeightMapMinimum(int par1, int par2) { if (par1 >= -30000000 && par2 >= -30000000 && par1 < 30000000 && par2 < 30000000) { if (!this.chunkExists(par1 >> 4, par2 >> 4)) { return 0; } else { Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par2 >> 4); return chunk.heightMapMinimum; } } else { return 0; } } @SideOnly(Side.CLIENT)
int function(int par1, int par2) { if (par1 >= -30000000 && par2 >= -30000000 && par1 < 30000000 && par2 < 30000000) { if (!this.chunkExists(par1 >> 4, par2 >> 4)) { return 0; } else { Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par2 >> 4); return chunk.heightMapMinimum; } } else { return 0; } } @SideOnly(Side.CLIENT)
/** * Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: * X, Z */
Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: X, Z
getChunkHeightMapMinimum
{ "repo_name": "HATB0T/RuneCraftery", "path": "forge/mcp/src/minecraft/net/minecraft/world/World.java", "license": "lgpl-3.0", "size": 151760 }
[ "net.minecraft.world.chunk.Chunk" ]
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.*;
[ "net.minecraft.world" ]
net.minecraft.world;
282,866
private static void writeValue(ByteBuffer buf, List<String> values) throws BufferOverflowException { if (values.size() == 0) { return; } Iterator<String> iter = values.iterator(); // Since value consists of ASCII chars, it is safe to use UTF-8. Strings.writeUTF8(iter.next(), buf); while (iter.hasNext()) { buf.put(sHeaderValueDelimByte); // Since value consists of ASCII chars, it is safe to use UTF-8. Strings.writeUTF8(iter.next(), buf); } }
static void function(ByteBuffer buf, List<String> values) throws BufferOverflowException { if (values.size() == 0) { return; } Iterator<String> iter = values.iterator(); Strings.writeUTF8(iter.next(), buf); while (iter.hasNext()) { buf.put(sHeaderValueDelimByte); Strings.writeUTF8(iter.next(), buf); } }
/** * Writes the values as a comma-separated list to buf. * * HeadersBuilder advises that values consists of ASCII characters. */
Writes the values as a comma-separated list to buf. HeadersBuilder advises that values consists of ASCII characters
writeValue
{ "repo_name": "kevinko/mahttp", "path": "src/main/com/faveset/mahttpd/Headers.java", "license": "bsd-3-clause", "size": 7105 }
[ "java.nio.BufferOverflowException", "java.nio.ByteBuffer", "java.util.Iterator", "java.util.List" ]
import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.util.Iterator; import java.util.List;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
373,360
public void setRedisPrefix(String redisPrefix) { JodaBeanUtils.notNull(redisPrefix, "redisPrefix"); this._redisPrefix = redisPrefix; }
void function(String redisPrefix) { JodaBeanUtils.notNull(redisPrefix, STR); this._redisPrefix = redisPrefix; }
/** * Sets if set (optional) prefixes all Redis keys with the specified value. * @param redisPrefix the new value of the property, not null */
Sets if set (optional) prefixes all Redis keys with the specified value
setRedisPrefix
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/source/AbstractNonVersionedRedisSourceComponentFactory.java", "license": "apache-2.0", "size": 15320 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,904,153
final NeeoDeviceDetails details = device.getDetails(); if (details == null) { return false; } try { new ThingUID(details.getAdapterName()); return true; } catch (IllegalArgumentException e) { return false; } }
final NeeoDeviceDetails details = device.getDetails(); if (details == null) { return false; } try { new ThingUID(details.getAdapterName()); return true; } catch (IllegalArgumentException e) { return false; } }
/** * Determines if the specified device is an openhab thing or not. The determination is made if the adapter name for * the device is a valid {@link ThingUID} * * @param device a possibly null device * @return true if a thing, false otherwise */
Determines if the specified device is an openhab thing or not. The determination is made if the adapter name for the device is a valid <code>ThingUID</code>
isThing
{ "repo_name": "lewie/openhab2", "path": "addons/binding/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/UidUtils.java", "license": "epl-1.0", "size": 4830 }
[ "org.eclipse.smarthome.core.thing.ThingUID", "org.openhab.binding.neeo.internal.models.NeeoDeviceDetails" ]
import org.eclipse.smarthome.core.thing.ThingUID; import org.openhab.binding.neeo.internal.models.NeeoDeviceDetails;
import org.eclipse.smarthome.core.thing.*; import org.openhab.binding.neeo.internal.models.*;
[ "org.eclipse.smarthome", "org.openhab.binding" ]
org.eclipse.smarthome; org.openhab.binding;
1,612,556
@Override public void removeFromCluster(List<String> containers, CreateEnsembleOptions options) { assertValid(); try { List<String> current = getEnsembleContainers(); for (String c : containers) { if (! current.contains(c)) { throw new EnsembleModificationFailed("Container " + c + " is not part of the ensemble." , EnsembleModificationFailed.Reason.CONTAINERS_NOT_IN_ENSEMBLE); } else { current.remove(c); } } createCluster(current, options); } catch (Exception e) { throw EnsembleModificationFailed.launderThrowable(e); } }
void function(List<String> containers, CreateEnsembleOptions options) { assertValid(); try { List<String> current = getEnsembleContainers(); for (String c : containers) { if (! current.contains(c)) { throw new EnsembleModificationFailed(STR + c + STR , EnsembleModificationFailed.Reason.CONTAINERS_NOT_IN_ENSEMBLE); } else { current.remove(c); } } createCluster(current, options); } catch (Exception e) { throw EnsembleModificationFailed.launderThrowable(e); } }
/** * Removes the containers from the cluster. */
Removes the containers from the cluster
removeFromCluster
{ "repo_name": "alexeev/jboss-fuse-mirror", "path": "fabric/fabric-core/src/main/java/io/fabric8/internal/ZooKeeperClusterServiceImpl.java", "license": "apache-2.0", "size": 26083 }
[ "io.fabric8.api.CreateEnsembleOptions", "io.fabric8.api.EnsembleModificationFailed", "java.util.List" ]
import io.fabric8.api.CreateEnsembleOptions; import io.fabric8.api.EnsembleModificationFailed; import java.util.List;
import io.fabric8.api.*; import java.util.*;
[ "io.fabric8.api", "java.util" ]
io.fabric8.api; java.util;
421,840
public Project getProject() { return project; }
Project function() { return project; }
/** * Returns the project: may be <code>null</code> if not running * inside an Ant project. * * @return The project */
Returns the project: may be <code>null</code> if not running inside an Ant project
getProject
{ "repo_name": "WhiteBearSolutions/WBSAirback", "path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/jasper/JspC.java", "license": "apache-2.0", "size": 50739 }
[ "org.apache.tools.ant.Project" ]
import org.apache.tools.ant.Project;
import org.apache.tools.ant.*;
[ "org.apache.tools" ]
org.apache.tools;
1,316,338
public Component getCurrentComponent() { return (Component) getState().currentComponent; }
Component function() { return (Component) getState().currentComponent; }
/** * Get currently visible component * * @return Currently visible component */
Get currently visible component
getCurrentComponent
{ "repo_name": "alump/FancyLayouts", "path": "fancylayouts-addon/src/main/java/org/vaadin/alump/fancylayouts/FancyPanel.java", "license": "apache-2.0", "size": 11175 }
[ "com.vaadin.ui.Component" ]
import com.vaadin.ui.Component;
import com.vaadin.ui.*;
[ "com.vaadin.ui" ]
com.vaadin.ui;
2,449,170
public void finalizeLayers(final LayoutProvider provider, boolean forRotation, final DrawingInfo progressBarDrawingInfo) { TraceEvent.begin("CompositorView:finalizeLayers"); Layout layout = provider.getActiveLayout(); if (layout == null || mNativeCompositorView == 0) { TraceEvent.end("CompositorView:finalizeLayers"); return; } if (!mPreloadedResources) { // Attempt to prefetch any necessary resources mResourceManager.preloadResources(AndroidResourceType.STATIC, StaticResourcePreloads.getSynchronousResources(getContext()), StaticResourcePreloads.getAsynchronousResources(getContext())); mPreloadedResources = true; } // IMPORTANT: Do not do anything that impacts the compositor layer tree before this line. // If you do, you could inadvertently trigger follow up renders. For further information // see dtrainor@, tedchoc@, or klobag@. // TODO(jscholler): change 1.0f to dpToPx once the native part is fully supporting dp. mRenderHost.getVisibleViewport(mCacheVisibleViewport); mCacheVisibleViewport.right = mCacheVisibleViewport.left + mSurfaceWidth; mCacheVisibleViewport.bottom = mCacheVisibleViewport.top + mSurfaceHeight; provider.getViewportPixel(mCacheViewport); nativeSetLayoutViewport(mNativeCompositorView, mCacheViewport.left, mCacheViewport.top, mCacheViewport.width(), mCacheViewport.height(), mCacheVisibleViewport.left, mCacheVisibleViewport.top, 1.0f); // TODO(changwan): move to treeprovider. updateToolbarLayer(provider, forRotation, progressBarDrawingInfo); SceneLayer sceneLayer = provider.getUpdatedActiveSceneLayer(mCacheViewport, mCacheVisibleViewport, mLayerTitleCache, mTabContentManager, mResourceManager, provider.getFullscreenManager()); nativeSetSceneLayer(mNativeCompositorView, sceneLayer); final LayoutTab[] tabs = layout.getLayoutTabsToRender(); final int tabsCount = tabs != null ? tabs.length : 0; mLastLayerCount = tabsCount; TabModelImpl.flushActualTabSwitchLatencyMetric(); nativeFinalizeLayers(mNativeCompositorView); TraceEvent.end("CompositorView:finalizeLayers"); }
void function(final LayoutProvider provider, boolean forRotation, final DrawingInfo progressBarDrawingInfo) { TraceEvent.begin(STR); Layout layout = provider.getActiveLayout(); if (layout == null mNativeCompositorView == 0) { TraceEvent.end(STR); return; } if (!mPreloadedResources) { mResourceManager.preloadResources(AndroidResourceType.STATIC, StaticResourcePreloads.getSynchronousResources(getContext()), StaticResourcePreloads.getAsynchronousResources(getContext())); mPreloadedResources = true; } mRenderHost.getVisibleViewport(mCacheVisibleViewport); mCacheVisibleViewport.right = mCacheVisibleViewport.left + mSurfaceWidth; mCacheVisibleViewport.bottom = mCacheVisibleViewport.top + mSurfaceHeight; provider.getViewportPixel(mCacheViewport); nativeSetLayoutViewport(mNativeCompositorView, mCacheViewport.left, mCacheViewport.top, mCacheViewport.width(), mCacheViewport.height(), mCacheVisibleViewport.left, mCacheVisibleViewport.top, 1.0f); updateToolbarLayer(provider, forRotation, progressBarDrawingInfo); SceneLayer sceneLayer = provider.getUpdatedActiveSceneLayer(mCacheViewport, mCacheVisibleViewport, mLayerTitleCache, mTabContentManager, mResourceManager, provider.getFullscreenManager()); nativeSetSceneLayer(mNativeCompositorView, sceneLayer); final LayoutTab[] tabs = layout.getLayoutTabsToRender(); final int tabsCount = tabs != null ? tabs.length : 0; mLastLayerCount = tabsCount; TabModelImpl.flushActualTabSwitchLatencyMetric(); nativeFinalizeLayers(mNativeCompositorView); TraceEvent.end(STR); }
/** * Converts the layout into compositor layers. This is to be called on every frame the layout * is changing. * @param provider Provides the layout to be rendered. * @param forRotation Whether or not this is a special draw during a rotation. */
Converts the layout into compositor layers. This is to be called on every frame the layout is changing
finalizeLayers
{ "repo_name": "ds-hwang/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java", "license": "bsd-3-clause", "size": 20155 }
[ "org.chromium.base.TraceEvent", "org.chromium.chrome.browser.compositor.layouts.Layout", "org.chromium.chrome.browser.compositor.layouts.LayoutProvider", "org.chromium.chrome.browser.compositor.layouts.components.LayoutTab", "org.chromium.chrome.browser.compositor.resources.StaticResourcePreloads", "org.chromium.chrome.browser.compositor.scene_layer.SceneLayer", "org.chromium.chrome.browser.tabmodel.TabModelImpl", "org.chromium.chrome.browser.widget.ClipDrawableProgressBar", "org.chromium.ui.resources.AndroidResourceType" ]
import org.chromium.base.TraceEvent; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.LayoutProvider; import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; import org.chromium.chrome.browser.compositor.resources.StaticResourcePreloads; import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer; import org.chromium.chrome.browser.tabmodel.TabModelImpl; import org.chromium.chrome.browser.widget.ClipDrawableProgressBar; import org.chromium.ui.resources.AndroidResourceType;
import org.chromium.base.*; import org.chromium.chrome.browser.compositor.layouts.*; import org.chromium.chrome.browser.compositor.layouts.components.*; import org.chromium.chrome.browser.compositor.resources.*; import org.chromium.chrome.browser.compositor.scene_layer.*; import org.chromium.chrome.browser.tabmodel.*; import org.chromium.chrome.browser.widget.*; import org.chromium.ui.resources.*;
[ "org.chromium.base", "org.chromium.chrome", "org.chromium.ui" ]
org.chromium.base; org.chromium.chrome; org.chromium.ui;
1,873,055
public ActiveTimeProbe getConnectionTimeProbe() { return _connectionTime; }
ActiveTimeProbe function() { return _connectionTime; }
/** * Returns the connection time probe */
Returns the connection time probe
getConnectionTimeProbe
{ "repo_name": "christianchristensen/resin", "path": "modules/resin/src/com/caucho/jca/pool/ConnectionPool.java", "license": "gpl-2.0", "size": 28724 }
[ "com.caucho.env.sample.ActiveTimeProbe" ]
import com.caucho.env.sample.ActiveTimeProbe;
import com.caucho.env.sample.*;
[ "com.caucho.env" ]
com.caucho.env;
2,672,798
void replacePrefabWithSceneNode(long prefabId, long nodeId) throws EntityNotFoundException;
void replacePrefabWithSceneNode(long prefabId, long nodeId) throws EntityNotFoundException;
/** * Replaces the given prefab with a copy of the given scene node. This method modifies the database. * * @param prefabId the id of the prefab to replace * @param nodeId the id of the scene node to replace it with * @throws EntityNotFoundException */
Replaces the given prefab with a copy of the given scene node. This method modifies the database
replacePrefabWithSceneNode
{ "repo_name": "dfki-asr-fitman/c3dwv", "path": "compass-business-impl/src/main/java/de/dfki/asr/compass/business/api/PrefabManager.java", "license": "apache-2.0", "size": 1952 }
[ "de.dfki.asr.compass.business.exception.EntityNotFoundException" ]
import de.dfki.asr.compass.business.exception.EntityNotFoundException;
import de.dfki.asr.compass.business.exception.*;
[ "de.dfki.asr" ]
de.dfki.asr;
2,183,773
@VisibleForTesting public INodesInPath addLastINode(INodesInPath existing, INode inode, boolean checkQuota) throws QuotaExceededException { assert existing.getLastINode() != null && existing.getLastINode().isDirectory(); final int pos = existing.length(); // Disallow creation of /.reserved. This may be created when loading // editlog/fsimage during upgrade since /.reserved was a valid name in older // release. This may also be called when a user tries to create a file // or directory /.reserved. if (pos == 1 && existing.getINode(0) == rootDir && isReservedName(inode)) { throw new HadoopIllegalArgumentException( "File name \"" + inode.getLocalName() + "\" is reserved and cannot " + "be created. If this is during upgrade change the name of the " + "existing file or directory to another name before upgrading " + "to the new release."); } final INodeDirectory parent = existing.getINode(pos - 1).asDirectory(); // The filesystem limits are not really quotas, so this check may appear // odd. It's because a rename operation deletes the src, tries to add // to the dest, if that fails, re-adds the src from whence it came. // The rename code disables the quota when it's restoring to the // original location because a quota violation would cause the the item // to go "poof". The fs limits must be bypassed for the same reason. if (checkQuota) { final String parentPath = existing.getPath(); verifyMaxComponentLength(inode.getLocalNameBytes(), parentPath); verifyMaxDirItems(parent, parentPath); } // always verify inode name verifyINodeName(inode.getLocalNameBytes()); final QuotaCounts counts = inode.computeQuotaUsage(getBlockStoragePolicySuite()); updateCount(existing, pos, counts, checkQuota); boolean isRename = (inode.getParent() != null); boolean added; try { added = parent.addChild(inode, true, existing.getLatestSnapshotId()); } catch (QuotaExceededException e) { updateCountNoQuotaCheck(existing, pos, counts.negation()); throw e; } if (!added) { updateCountNoQuotaCheck(existing, pos, counts.negation()); return null; } else { if (!isRename) { AclStorage.copyINodeDefaultAcl(inode); } addToInodeMap(inode); } return INodesInPath.append(existing, inode, inode.getLocalNameBytes()); }
INodesInPath function(INodesInPath existing, INode inode, boolean checkQuota) throws QuotaExceededException { assert existing.getLastINode() != null && existing.getLastINode().isDirectory(); final int pos = existing.length(); if (pos == 1 && existing.getINode(0) == rootDir && isReservedName(inode)) { throw new HadoopIllegalArgumentException( STRSTR\STR + STR + STR + STR); } final INodeDirectory parent = existing.getINode(pos - 1).asDirectory(); if (checkQuota) { final String parentPath = existing.getPath(); verifyMaxComponentLength(inode.getLocalNameBytes(), parentPath); verifyMaxDirItems(parent, parentPath); } verifyINodeName(inode.getLocalNameBytes()); final QuotaCounts counts = inode.computeQuotaUsage(getBlockStoragePolicySuite()); updateCount(existing, pos, counts, checkQuota); boolean isRename = (inode.getParent() != null); boolean added; try { added = parent.addChild(inode, true, existing.getLatestSnapshotId()); } catch (QuotaExceededException e) { updateCountNoQuotaCheck(existing, pos, counts.negation()); throw e; } if (!added) { updateCountNoQuotaCheck(existing, pos, counts.negation()); return null; } else { if (!isRename) { AclStorage.copyINodeDefaultAcl(inode); } addToInodeMap(inode); } return INodesInPath.append(existing, inode, inode.getLocalNameBytes()); }
/** * Add a child to the end of the path specified by INodesInPath. * @return an INodesInPath instance containing the new INode */
Add a child to the end of the path specified by INodesInPath
addLastINode
{ "repo_name": "f7753/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 57606 }
[ "org.apache.hadoop.HadoopIllegalArgumentException", "org.apache.hadoop.hdfs.protocol.QuotaExceededException" ]
import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
import org.apache.hadoop.*; import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,819,586
private static PeakListRow copyPeakRow(final PeakListRow row) { // Copy the peak list row. final PeakListRow newRow = new SimplePeakListRow(row.getID()); PeakUtils.copyPeakListRowProperties(row, newRow); // Copy the peaks. for (final Feature peak : row.getPeaks()) { final Feature newPeak = new SimpleFeature(peak); PeakUtils.copyPeakProperties(peak, newPeak); newRow.addPeak(peak.getDataFile(), newPeak); } return newRow; }
static PeakListRow function(final PeakListRow row) { final PeakListRow newRow = new SimplePeakListRow(row.getID()); PeakUtils.copyPeakListRowProperties(row, newRow); for (final Feature peak : row.getPeaks()) { final Feature newPeak = new SimpleFeature(peak); PeakUtils.copyPeakProperties(peak, newPeak); newRow.addPeak(peak.getDataFile(), newPeak); } return newRow; }
/** * Create a copy of a peak list row. * * @param row the row to copy. * @return the newly created copy. */
Create a copy of a peak list row
copyPeakRow
{ "repo_name": "photocyte/mzmine2", "path": "src/main/java/net/sf/mzmine/modules/peaklistmethods/basiclearner/PeakListRowLearnerTask.java", "license": "gpl-2.0", "size": 6336 }
[ "net.sf.mzmine.datamodel.Feature", "net.sf.mzmine.datamodel.PeakListRow", "net.sf.mzmine.datamodel.impl.SimpleFeature", "net.sf.mzmine.datamodel.impl.SimplePeakListRow", "net.sf.mzmine.util.PeakUtils" ]
import net.sf.mzmine.datamodel.Feature; import net.sf.mzmine.datamodel.PeakListRow; import net.sf.mzmine.datamodel.impl.SimpleFeature; import net.sf.mzmine.datamodel.impl.SimplePeakListRow; import net.sf.mzmine.util.PeakUtils;
import net.sf.mzmine.datamodel.*; import net.sf.mzmine.datamodel.impl.*; import net.sf.mzmine.util.*;
[ "net.sf.mzmine" ]
net.sf.mzmine;
1,887,353
public ListModel getVoiceList();
ListModel function();
/** * Returns the list of voices of the current synthesizer * * @return the list of voices */
Returns the list of voices of the current synthesizer
getVoiceList
{ "repo_name": "edwardtoday/PolyU_MScST", "path": "COMP5517/JavaSpeech/freetts-1.2.2-src/freetts-1.2.2/demo/JSAPI/Player/PlayerModel.java", "license": "mit", "size": 6013 }
[ "javax.swing.ListModel" ]
import javax.swing.ListModel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
229,844
@Query("from UserGroupJoin ugh where ugh.group = ?1") public Collection<UserGroupJoin> findUsersInGroup(final UserGroup group);
@Query(STR) Collection<UserGroupJoin> function(final UserGroup group);
/** * Get a collection of users in a group. * * @param group * the group to get users for. * @return the users in the group. */
Get a collection of users in a group
findUsersInGroup
{ "repo_name": "phac-nml/irida", "path": "src/main/java/ca/corefacility/bioinformatics/irida/repositories/user/UserGroupJoinRepository.java", "license": "apache-2.0", "size": 1356 }
[ "ca.corefacility.bioinformatics.irida.model.user.group.UserGroup", "ca.corefacility.bioinformatics.irida.model.user.group.UserGroupJoin", "java.util.Collection", "org.springframework.data.jpa.repository.Query" ]
import ca.corefacility.bioinformatics.irida.model.user.group.UserGroup; import ca.corefacility.bioinformatics.irida.model.user.group.UserGroupJoin; import java.util.Collection; import org.springframework.data.jpa.repository.Query;
import ca.corefacility.bioinformatics.irida.model.user.group.*; import java.util.*; import org.springframework.data.jpa.repository.*;
[ "ca.corefacility.bioinformatics", "java.util", "org.springframework.data" ]
ca.corefacility.bioinformatics; java.util; org.springframework.data;
2,483,290
public void write(OutputStream os) { try { // ObjectOutputStream oos = new ObjectOutputStream(os); // oos.writeObject(this); // MatrixWritable.writeMatrix(arg0, arg1)this.hiddenLayers[ 0 ].biasTerms // ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutput d = new DataOutputStream(os); MatrixWritable.writeMatrix(d, inputTrainingData); // d.writeUTF(src_host); //d.write // buf.write // MatrixWritable.writeMatrix(d, this.worker_gradient.getMatrix()); //MatrixWritable.writeMatrix(d, this.parameter_vector); // MatrixWritable. // ObjectOutputStream oos = new ObjectOutputStream(out); } catch (IOException e) { throw new RuntimeException(e); } }
void function(OutputStream os) { try { DataOutput d = new DataOutputStream(os); MatrixWritable.writeMatrix(d, inputTrainingData); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Serializes this to the output stream. * @param os the output stream to write to */
Serializes this to the output stream
write
{ "repo_name": "jpatanooga/Metronome", "path": "src/main/java/tv/floe/metronome/deeplearning/neuralnetwork/core/BaseMultiLayerNeuralNetworkVectorized.java", "license": "apache-2.0", "size": 43318 }
[ "java.io.DataOutput", "java.io.DataOutputStream", "java.io.IOException", "java.io.OutputStream", "org.apache.mahout.math.MatrixWritable" ]
import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream; import org.apache.mahout.math.MatrixWritable;
import java.io.*; import org.apache.mahout.math.*;
[ "java.io", "org.apache.mahout" ]
java.io; org.apache.mahout;
237,677
public static ByteBuffer range(ByteBuffer buffer, int position, int limit) { buffer.clear().position(position).limit(limit); return buffer; }
static ByteBuffer function(ByteBuffer buffer, int position, int limit) { buffer.clear().position(position).limit(limit); return buffer; }
/** * Sets the range of the given buffer. * @param buffer the target buffer * @param position the buffer position * @param limit the buffer limit * @return the given buffer */
Sets the range of the given buffer
range
{ "repo_name": "asakusafw/asakusafw-compiler", "path": "vanilla/runtime/core/src/main/java/com/asakusafw/vanilla/core/util/Buffers.java", "license": "apache-2.0", "size": 7663 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,942,503
private Time getTimeInternal(int columnIndex, Calendar targetCalendar, TimeZone tz, boolean rollForward) throws java.sql.SQLException { checkRowPos(); if (this.isBinaryEncoded) { return getNativeTime(columnIndex, targetCalendar, tz, rollForward); } if (!this.useFastDateParsing) { String timeAsString = getStringInternal(columnIndex, false); return getTimeFromString(timeAsString, targetCalendar, columnIndex, tz, rollForward); } checkColumnBounds(columnIndex); int columnIndexMinusOne = columnIndex - 1; if (this.thisRow.isNull(columnIndexMinusOne)) { this.wasNullFlag = true; return null; } this.wasNullFlag = false; return this.thisRow.getTimeFast(columnIndexMinusOne, targetCalendar, tz, rollForward, this.connection, this); }
Time function(int columnIndex, Calendar targetCalendar, TimeZone tz, boolean rollForward) throws java.sql.SQLException { checkRowPos(); if (this.isBinaryEncoded) { return getNativeTime(columnIndex, targetCalendar, tz, rollForward); } if (!this.useFastDateParsing) { String timeAsString = getStringInternal(columnIndex, false); return getTimeFromString(timeAsString, targetCalendar, columnIndex, tz, rollForward); } checkColumnBounds(columnIndex); int columnIndexMinusOne = columnIndex - 1; if (this.thisRow.isNull(columnIndexMinusOne)) { this.wasNullFlag = true; return null; } this.wasNullFlag = false; return this.thisRow.getTimeFast(columnIndexMinusOne, targetCalendar, tz, rollForward, this.connection, this); }
/** * Get the value of a column in the current row as a java.sql.Time object in * the given timezone * * @param columnIndex * the first column is 1, the second is 2... * @param tz * the Timezone to use * * @return the column value; null if SQL NULL * * @exception java.sql.SQLException * if a database access error occurs */
Get the value of a column in the current row as a java.sql.Time object in the given timezone
getTimeInternal
{ "repo_name": "mwaylabs/mysql-connector-j", "path": "src/com/mysql/jdbc/ResultSetImpl.java", "license": "gpl-2.0", "size": 288724 }
[ "java.sql.SQLException", "java.sql.Time", "java.util.Calendar", "java.util.TimeZone" ]
import java.sql.SQLException; import java.sql.Time; import java.util.Calendar; import java.util.TimeZone;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
1,180,215
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Transformation {\n"); builder.append(" - Solution space: ").append(this.solutionSpace.hashCode()).append("\n"); builder.append(" - Index: ").append(Arrays.toString(transformationJHPL)).append("\n"); builder.append(" - Id: ").append(identifier).append("\n"); builder.append(" - Generalization: ").append(Arrays.toString(getGeneralization())).append("\n"); builder.append(" - Level: ").append(getLevel()).append("\n"); builder.append(" - Properties:\n"); if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyAnonymous())) { builder.append(" * ANONYMOUS: ").append(solutionSpace.getPropertyAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyNotAnonymous())) { builder.append(" * NOT_ANONYMOUS: ").append(solutionSpace.getPropertyNotAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyKAnonymous())) { builder.append(" * K_ANONYMOUS: ").append(solutionSpace.getPropertyKAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyNotKAnonymous())) { builder.append(" * NOT_K_ANONYMOUS: ").append(solutionSpace.getPropertyNotKAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyChecked())) { builder.append(" * CHECKED: ").append(solutionSpace.getPropertyChecked().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyForceSnapshot())) { builder.append(" * FORCE_SNAPSHOT: ").append(solutionSpace.getPropertyForceSnapshot().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyInsufficientUtility())) { builder.append(" * INSUFFICIENT_UTILITY: ").append(solutionSpace.getPropertyInsufficientUtility().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertySuccessorsPruned())) { builder.append(" * SUCCESSORS_PRUNED: ").append(solutionSpace.getPropertySuccessorsPruned().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyVisited())) { builder.append(" * VISITED: ").append(solutionSpace.getPropertyVisited().getDirection()).append("\n"); } builder.append("}"); return builder.toString(); }
String function() { StringBuilder builder = new StringBuilder(); builder.append(STR); builder.append(STR).append(this.solutionSpace.hashCode()).append("\n"); builder.append(STR).append(Arrays.toString(transformationJHPL)).append("\n"); builder.append(STR).append(identifier).append("\n"); builder.append(STR).append(Arrays.toString(getGeneralization())).append("\n"); builder.append(STR).append(getLevel()).append("\n"); builder.append(STR); if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyAnonymous())) { builder.append(STR).append(solutionSpace.getPropertyAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyNotAnonymous())) { builder.append(STR).append(solutionSpace.getPropertyNotAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyKAnonymous())) { builder.append(STR).append(solutionSpace.getPropertyKAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyNotKAnonymous())) { builder.append(STR).append(solutionSpace.getPropertyNotKAnonymous().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyChecked())) { builder.append(STR).append(solutionSpace.getPropertyChecked().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyForceSnapshot())) { builder.append(STR).append(solutionSpace.getPropertyForceSnapshot().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyInsufficientUtility())) { builder.append(STR).append(solutionSpace.getPropertyInsufficientUtility().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertySuccessorsPruned())) { builder.append(STR).append(solutionSpace.getPropertySuccessorsPruned().getDirection()).append("\n"); } if (lattice.hasProperty(transformationJHPL, this.levelJHPL, solutionSpace.getPropertyVisited())) { builder.append(STR).append(solutionSpace.getPropertyVisited().getDirection()).append("\n"); } builder.append("}"); return builder.toString(); }
/** * Returns a string representation */
Returns a string representation
toString
{ "repo_name": "bitraten/arx", "path": "src/main/org/deidentifier/arx/framework/lattice/Transformation.java", "license": "apache-2.0", "size": 11585 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
785,137
private static Map<String,List<ViewRiksdagenVoteDataBallotPartySummary>> createIssueConcernMap(final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotList) { final Map<String,List<ViewRiksdagenVoteDataBallotPartySummary>> concernIssuePartyBallotSummaryMap = new HashMap<>(); for (final ViewRiksdagenVoteDataBallotPartySummary partySummary: partyBallotList) { if (partySummary.getEmbeddedId().getIssue() !=null || partySummary.getEmbeddedId().getConcern() != null ) { final String key = partySummary.getEmbeddedId().getIssue() + partySummary.getEmbeddedId().getConcern(); final List<ViewRiksdagenVoteDataBallotPartySummary> partySummarList = concernIssuePartyBallotSummaryMap.computeIfAbsent(key, k -> new ArrayList<>()); partySummarList.add(partySummary); } } return concernIssuePartyBallotSummaryMap; }
static Map<String,List<ViewRiksdagenVoteDataBallotPartySummary>> function(final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotList) { final Map<String,List<ViewRiksdagenVoteDataBallotPartySummary>> concernIssuePartyBallotSummaryMap = new HashMap<>(); for (final ViewRiksdagenVoteDataBallotPartySummary partySummary: partyBallotList) { if (partySummary.getEmbeddedId().getIssue() !=null partySummary.getEmbeddedId().getConcern() != null ) { final String key = partySummary.getEmbeddedId().getIssue() + partySummary.getEmbeddedId().getConcern(); final List<ViewRiksdagenVoteDataBallotPartySummary> partySummarList = concernIssuePartyBallotSummaryMap.computeIfAbsent(key, k -> new ArrayList<>()); partySummarList.add(partySummary); } } return concernIssuePartyBallotSummaryMap; }
/** * Creates the issue concern map. * * @param partyBallotList * the party ballot list * @return the map */
Creates the issue concern map
createIssueConcernMap
{ "repo_name": "Hack23/cia", "path": "citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java", "license": "apache-2.0", "size": 6899 }
[ "com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPartySummary", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenVoteDataBallotPartySummary; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import com.hack23.cia.model.internal.application.data.committee.impl.*; import java.util.*;
[ "com.hack23.cia", "java.util" ]
com.hack23.cia; java.util;
243,773
public void prepareTaskWorkDir(File path) throws IgniteCheckedException { try { if (path.exists()) throw new IOException("Task local directory already exists: " + path); if (!path.mkdir()) throw new IOException("Failed to create directory: " + path); for (File resource : rsrcSet) { File symLink = new File(path, resource.getName()); try { Files.createSymbolicLink(symLink.toPath(), resource.toPath()); } catch (IOException e) { String msg = "Unable to create symlink \"" + symLink + "\" to \"" + resource + "\"."; if (U.isWindows() && e instanceof FileSystemException) msg += "\n\nAbility to create symbolic links is required!\n" + "On Windows platform you have to grant permission 'Create symbolic links'\n" + "to your user or run the Accelerator as Administrator.\n"; throw new IOException(msg, e); } } } catch (IOException e) { throw new IgniteCheckedException("Unable to prepare local working directory for the task " + "[jobId=" + jobId + ", path=" + path+ ']', e); } }
void function(File path) throws IgniteCheckedException { try { if (path.exists()) throw new IOException(STR + path); if (!path.mkdir()) throw new IOException(STR + path); for (File resource : rsrcSet) { File symLink = new File(path, resource.getName()); try { Files.createSymbolicLink(symLink.toPath(), resource.toPath()); } catch (IOException e) { String msg = STRSTR\STRSTR\"."; if (U.isWindows() && e instanceof FileSystemException) msg += STR + STR + STR; throw new IOException(msg, e); } } } catch (IOException e) { throw new IgniteCheckedException(STR + STR + jobId + STR + path+ ']', e); } }
/** * Prepares working directory for the task. * * <ul> * <li>Creates working directory.</li> * <li>Creates symbolic links to all job resources in working directory.</li> * </ul> * * @param path Path to working directory of the task. * @throws IgniteCheckedException If fails. */
Prepares working directory for the task. Creates working directory. Creates symbolic links to all job resources in working directory.
prepareTaskWorkDir
{ "repo_name": "leveyj/ignite", "path": "modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2JobResourceManager.java", "license": "apache-2.0", "size": 12202 }
[ "java.io.File", "java.io.IOException", "java.nio.file.FileSystemException", "java.nio.file.Files", "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.util.typedef.internal.U" ]
import java.io.File; import java.io.IOException; import java.nio.file.FileSystemException; import java.nio.file.Files; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.util.typedef.internal.U;
import java.io.*; import java.nio.file.*; import org.apache.ignite.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "java.io", "java.nio", "org.apache.ignite" ]
java.io; java.nio; org.apache.ignite;
947,892
private boolean shouldEmitDeprecationWarning( NodeTraversal t, Node n, Node parent) { // In the global scope, there are only two kinds of accesses that should // be flagged for warnings: // 1) Calls of deprecated functions and methods. // 2) Instantiations of deprecated classes. // For now, we just let everything else by. if (t.inGlobalScope()) { if (!((parent.isCall() && parent.getFirstChild() == n) || n.isNew())) { return false; } } // We can always assign to a deprecated property, to keep it up to date. if (n.isGetProp() && n == parent.getFirstChild() && NodeUtil.isAssignmentOp(parent)) { return false; } // Don't warn if the node is just declaring the property, not reading it. if (n.isGetProp() && parent.isExprResult() && n.getJSDocInfo().isDeprecated()) { return false; } return !canAccessDeprecatedTypes(t); }
boolean function( NodeTraversal t, Node n, Node parent) { if (t.inGlobalScope()) { if (!((parent.isCall() && parent.getFirstChild() == n) n.isNew())) { return false; } } if (n.isGetProp() && n == parent.getFirstChild() && NodeUtil.isAssignmentOp(parent)) { return false; } if (n.isGetProp() && parent.isExprResult() && n.getJSDocInfo().isDeprecated()) { return false; } return !canAccessDeprecatedTypes(t); }
/** * Determines whether a deprecation warning should be emitted. * @param t The current traversal. * @param n The node which we are checking. * @param parent The parent of the node which we are checking. */
Determines whether a deprecation warning should be emitted
shouldEmitDeprecationWarning
{ "repo_name": "Medium/closure-compiler", "path": "src/com/google/javascript/jscomp/CheckAccessControls.java", "license": "apache-2.0", "size": 36332 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
1,415,815
public ReadCovariates getCovariatesValues() { return covariates; }
ReadCovariates function() { return covariates; }
/** * Get the ReadCovariates object carrying the mapping from offsets -> covariate key sets * @return a non-null ReadCovariates object */
Get the ReadCovariates object carrying the mapping from offsets -> covariate key sets
getCovariatesValues
{ "repo_name": "magicDGS/gatk", "path": "src/main/java/org/broadinstitute/hellbender/utils/recalibration/ReadRecalibrationInfo.java", "license": "bsd-3-clause", "size": 5473 }
[ "org.broadinstitute.hellbender.utils.recalibration.covariates.ReadCovariates" ]
import org.broadinstitute.hellbender.utils.recalibration.covariates.ReadCovariates;
import org.broadinstitute.hellbender.utils.recalibration.covariates.*;
[ "org.broadinstitute.hellbender" ]
org.broadinstitute.hellbender;
1,870,769
public static String popOptionWithArgument(String name, List<String> args) throws IllegalArgumentException { String val = null; for (Iterator<String> iter = args.iterator(); iter.hasNext(); ) { String cur = iter.next(); if (cur.equals("--")) { // stop parsing arguments when you see -- break; } else if (cur.equals(name)) { iter.remove(); if (!iter.hasNext()) { throw new IllegalArgumentException("option " + name + " requires 1 " + "argument."); } val = iter.next(); iter.remove(); break; } } return val; }
static String function(String name, List<String> args) throws IllegalArgumentException { String val = null; for (Iterator<String> iter = args.iterator(); iter.hasNext(); ) { String cur = iter.next(); if (cur.equals("--")) { break; } else if (cur.equals(name)) { iter.remove(); if (!iter.hasNext()) { throw new IllegalArgumentException(STR + name + STR + STR); } val = iter.next(); iter.remove(); break; } } return val; }
/** * From a list of command-line arguments, remove both an option and the * next argument. * * @param name Name of the option to remove. Example: -foo. * @param args List of arguments. * @return null if the option was not found; the value of the * option otherwise. * @throws IllegalArgumentException if the option's argument is not present */
From a list of command-line arguments, remove both an option and the next argument
popOptionWithArgument
{ "repo_name": "dennishuo/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java", "license": "apache-2.0", "size": 37650 }
[ "java.util.Iterator", "java.util.List" ]
import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,403,559
public void setETag(String eTag) { if (eTag != null) { Assert.isTrue(eTag.startsWith("\"") || eTag.startsWith("W/"), "Invalid eTag, does not start with W/ or \""); Assert.isTrue(eTag.endsWith("\""), "Invalid eTag, does not end with \""); } set(ETAG, eTag); }
void function(String eTag) { if (eTag != null) { Assert.isTrue(eTag.startsWith("\"STRW/STRInvalid eTag, does not start with W/ or \STR\"STRInvalid eTag, does not end with \""); } set(ETAG, eTag); }
/** * Set the (new) entity tag of the body, as specified by the {@code ETag} header. */
Set the (new) entity tag of the body, as specified by the ETag header
setETag
{ "repo_name": "admin-zhx/spring-android", "path": "spring-android-rest-template/src/main/java/org/springframework/http/HttpHeaders.java", "license": "apache-2.0", "size": 34265 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
1,364,772
try { // Alter time to ensure different deployTimes Calendar yesterday = Calendar.getInstance(); yesterday.add(Calendar.DAY_OF_MONTH, -1); cmmnEngineConfiguration.getClock().setCurrentTime(yesterday.getTime()); CmmnDeployment firstDeployment = repositoryService.createDeployment().name("Deployment 1").category("DEF").addClasspathResource("org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn") .deploy(); cmmnEngineConfiguration.getClock().setCurrentTime(Calendar.getInstance().getTime()); CmmnDeployment secondDeployment = repositoryService.createDeployment().name("Deployment 2").category("ABC") .addClasspathResource("org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn").tenantId("myTenant").deploy(); String baseUrl = CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION); assertResultsPresentInDataResponse(baseUrl, firstDeployment.getId(), secondDeployment.getId()); // Check name filtering String url = baseUrl + "?name=" + encode("Deployment 1"); assertResultsPresentInDataResponse(url, firstDeployment.getId()); // Check name-like filtering url = baseUrl + "?nameLike=" + encode("%ment 2"); assertResultsPresentInDataResponse(url, secondDeployment.getId()); // Check category filtering url = baseUrl + "?category=DEF"; assertResultsPresentInDataResponse(url, firstDeployment.getId()); // Check category-not-equals filtering url = baseUrl + "?categoryNotEquals=DEF"; assertResultsPresentInDataResponse(url, secondDeployment.getId()); // Check tenantId filtering url = baseUrl + "?tenantId=myTenant"; assertResultsPresentInDataResponse(url, secondDeployment.getId()); // Check tenantId filtering url = baseUrl + "?tenantId=unexistingTenant"; assertResultsPresentInDataResponse(url); // Check tenantId like filtering url = baseUrl + "?tenantIdLike=" + encode("%enant"); assertResultsPresentInDataResponse(url, secondDeployment.getId()); // Check without tenantId filtering url = baseUrl + "?withoutTenantId=true"; assertResultsPresentInDataResponse(url, firstDeployment.getId()); // Check ordering by name CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + "?sort=name&order=asc"), HttpStatus.SC_OK); JsonNode dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(firstDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(secondDeployment.getId(), dataNode.get(1).get("id").textValue()); // Check ordering by deploy time response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + "?sort=deployTime&order=asc"), HttpStatus.SC_OK); dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(firstDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(secondDeployment.getId(), dataNode.get(1).get("id").textValue()); // Check ordering by tenantId response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + "?sort=tenantId&order=desc"), HttpStatus.SC_OK); dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(secondDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(firstDeployment.getId(), dataNode.get(1).get("id").textValue()); // Check paging response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + "?sort=deployTime&order=asc&start=1&size=1"), HttpStatus.SC_OK); JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent()); closeResponse(response); dataNode = responseNode.get("data"); assertEquals(1L, dataNode.size()); assertEquals(secondDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(2L, responseNode.get("total").longValue()); assertEquals(1L, responseNode.get("start").longValue()); assertEquals(1L, responseNode.get("size").longValue()); } finally { // Always cleanup any created deployments, even if the test failed List<CmmnDeployment> deployments = repositoryService.createDeploymentQuery().list(); for (CmmnDeployment deployment : deployments) { repositoryService.deleteDeployment(deployment.getId(), true); } } }
try { Calendar yesterday = Calendar.getInstance(); yesterday.add(Calendar.DAY_OF_MONTH, -1); cmmnEngineConfiguration.getClock().setCurrentTime(yesterday.getTime()); CmmnDeployment firstDeployment = repositoryService.createDeployment().name(STR).category("DEF").addClasspathResource(STR) .deploy(); cmmnEngineConfiguration.getClock().setCurrentTime(Calendar.getInstance().getTime()); CmmnDeployment secondDeployment = repositoryService.createDeployment().name(STR).category("ABC") .addClasspathResource(STR).tenantId(STR).deploy(); String baseUrl = CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION); assertResultsPresentInDataResponse(baseUrl, firstDeployment.getId(), secondDeployment.getId()); String url = baseUrl + STR + encode(STR); assertResultsPresentInDataResponse(url, firstDeployment.getId()); url = baseUrl + STR + encode(STR); assertResultsPresentInDataResponse(url, secondDeployment.getId()); url = baseUrl + STR; assertResultsPresentInDataResponse(url, firstDeployment.getId()); url = baseUrl + STR; assertResultsPresentInDataResponse(url, secondDeployment.getId()); url = baseUrl + STR; assertResultsPresentInDataResponse(url, secondDeployment.getId()); url = baseUrl + STR; assertResultsPresentInDataResponse(url); url = baseUrl + STR + encode(STR); assertResultsPresentInDataResponse(url, secondDeployment.getId()); url = baseUrl + STR; assertResultsPresentInDataResponse(url, firstDeployment.getId()); CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + STR), HttpStatus.SC_OK); JsonNode dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(firstDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(secondDeployment.getId(), dataNode.get(1).get("id").textValue()); response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + STR), HttpStatus.SC_OK); dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(firstDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(secondDeployment.getId(), dataNode.get(1).get("id").textValue()); response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + STR), HttpStatus.SC_OK); dataNode = objectMapper.readTree(response.getEntity().getContent()).get("data"); closeResponse(response); assertEquals(2L, dataNode.size()); assertEquals(secondDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(firstDeployment.getId(), dataNode.get(1).get("id").textValue()); response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEPLOYMENT_COLLECTION) + STR), HttpStatus.SC_OK); JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent()); closeResponse(response); dataNode = responseNode.get("data"); assertEquals(1L, dataNode.size()); assertEquals(secondDeployment.getId(), dataNode.get(0).get("id").textValue()); assertEquals(2L, responseNode.get("total").longValue()); assertEquals(1L, responseNode.get("start").longValue()); assertEquals(1L, responseNode.get("size").longValue()); } finally { List<CmmnDeployment> deployments = repositoryService.createDeploymentQuery().list(); for (CmmnDeployment deployment : deployments) { repositoryService.deleteDeployment(deployment.getId(), true); } } }
/** * Test getting deployments. GET cmmn-repository/deployments */
Test getting deployments. GET cmmn-repository/deployments
testGetDeployments
{ "repo_name": "yvoswillens/flowable-engine", "path": "modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResourceTest.java", "license": "apache-2.0", "size": 6845 }
[ "com.fasterxml.jackson.databind.JsonNode", "java.util.Calendar", "java.util.List", "org.apache.http.HttpStatus", "org.apache.http.client.methods.CloseableHttpResponse", "org.apache.http.client.methods.HttpGet", "org.flowable.cmmn.api.repository.CmmnDeployment", "org.flowable.cmmn.rest.service.api.CmmnRestUrls" ]
import com.fasterxml.jackson.databind.JsonNode; import java.util.Calendar; import java.util.List; import org.apache.http.HttpStatus; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.flowable.cmmn.api.repository.CmmnDeployment; import org.flowable.cmmn.rest.service.api.CmmnRestUrls;
import com.fasterxml.jackson.databind.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.flowable.cmmn.api.repository.*; import org.flowable.cmmn.rest.service.api.*;
[ "com.fasterxml.jackson", "java.util", "org.apache.http", "org.flowable.cmmn" ]
com.fasterxml.jackson; java.util; org.apache.http; org.flowable.cmmn;
1,929,587
// Waits for the creation of all the FileSearch objects phaser.arriveAndAwaitAdvance(); System.out.printf("%s: Starting.\n",Thread.currentThread().getName()); // 1st Phase: Look for the files File file = new File(initPath); if (file.isDirectory()) { directoryProcess(file); } // If no results, deregister in the phaser and ends if (!checkResults()){ return; } // 2nd Phase: Filter the results filterResults(); // If no results after the filter, deregister in the phaser and ends if (!checkResults()){ return; } // 3rd Phase: Show info showInfo(); phaser.arriveAndDeregister(); System.out.printf("%s: Work completed.\n",Thread.currentThread().getName()); }
phaser.arriveAndAwaitAdvance(); System.out.printf(STR,Thread.currentThread().getName()); File file = new File(initPath); if (file.isDirectory()) { directoryProcess(file); } if (!checkResults()){ return; } filterResults(); if (!checkResults()){ return; } showInfo(); phaser.arriveAndDeregister(); System.out.printf(STR,Thread.currentThread().getName()); }
/** * Main method of the class. See the comments inside to a better description of it */
Main method of the class. See the comments inside to a better description of it
run
{ "repo_name": "xuelvming/Java7ConcurrencyCookbook", "path": "7881_code/Chapter 3/ch3_recipe5/src/com/packtpub/java7/concurrency/chapter3/recipe5/task/FileSearch.java", "license": "mit", "size": 4672 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
486,855
Map getActiveChannels() { return activeChannels; }
Map getActiveChannels() { return activeChannels; }
/** * Returns the collection of stats or <code>null</code> * if no analysis run on the selected ROI shapes. * * @return See above. */
Returns the collection of stats or <code>null</code> if no analysis run on the selected ROI shapes
getAnalysisResults
{ "repo_name": "bramalingam/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerModel.java", "license": "gpl-2.0", "size": 50321 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,753,872
public BigInteger getAsBigInteger() { throw new UnsupportedOperationException(getClass().getSimpleName()); }
BigInteger function() { throw new UnsupportedOperationException(getClass().getSimpleName()); }
/** * convenience method to get this element as a {@link BigInteger}. * * @return get this element as a {@link BigInteger}. * @throws ClassCastException if the element is of not a {@link JsonPrimitive}. * @throws NumberFormatException if the element is not a valid {@link BigInteger}. * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains * more than a single element. * @since 1.2 */
convenience method to get this element as a <code>BigInteger</code>
getAsBigInteger
{ "repo_name": "pablocabillon/GamesOfDronesBackEnd", "path": "src/com/google/gson/JsonElement.java", "license": "epl-1.0", "size": 12170 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
619,375
public RoutingConfiguration routingConfiguration() { return this.routingConfiguration; }
RoutingConfiguration function() { return this.routingConfiguration; }
/** * Get the Routing Configuration indicating the associated and propagated route tables on this connection. * * @return the routingConfiguration value */
Get the Routing Configuration indicating the associated and propagated route tables on this connection
routingConfiguration
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/VpnConnectionInner.java", "license": "mit", "size": 15175 }
[ "com.microsoft.azure.management.network.v2020_04_01.RoutingConfiguration" ]
import com.microsoft.azure.management.network.v2020_04_01.RoutingConfiguration;
import com.microsoft.azure.management.network.v2020_04_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
217,693
public List<String> getAnnotations(String annotation) { if(!annotation.startsWith("@")) { annotation = "@" + annotation; } return new ArrayList<>(annotations.get(annotation)); } public static interface Replacement {
List<String> function(String annotation) { if(!annotation.startsWith("@")) { annotation = "@" + annotation; } return new ArrayList<>(annotations.get(annotation)); } public static interface Replacement {
/** * Gets a list of annotation values for the comment block. * * @param annotation * @return */
Gets a list of annotation values for the comment block
getAnnotations
{ "repo_name": "sk89q/CommandHelper", "path": "src/main/java/com/laytonsmith/PureUtilities/SmartComment.java", "license": "mit", "size": 5127 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
886,719
public static void updateFurnaceBlockState(boolean p_149931_0_, World p_149931_1_, int p_149931_2_, int p_149931_3_, int p_149931_4_) { int l = p_149931_1_.getBlockMetadata(p_149931_2_, p_149931_3_, p_149931_4_); TileEntity tileentity = p_149931_1_.getTileEntity(p_149931_2_, p_149931_3_, p_149931_4_); field_149934_M = true; if (p_149931_0_) { p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.lit_furnace); } else { p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.furnace); } field_149934_M = false; p_149931_1_.setBlockMetadataWithNotify(p_149931_2_, p_149931_3_, p_149931_4_, l, 2); if (tileentity != null) { tileentity.validate(); p_149931_1_.setTileEntity(p_149931_2_, p_149931_3_, p_149931_4_, tileentity); } }
static void function(boolean p_149931_0_, World p_149931_1_, int p_149931_2_, int p_149931_3_, int p_149931_4_) { int l = p_149931_1_.getBlockMetadata(p_149931_2_, p_149931_3_, p_149931_4_); TileEntity tileentity = p_149931_1_.getTileEntity(p_149931_2_, p_149931_3_, p_149931_4_); field_149934_M = true; if (p_149931_0_) { p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.lit_furnace); } else { p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.furnace); } field_149934_M = false; p_149931_1_.setBlockMetadataWithNotify(p_149931_2_, p_149931_3_, p_149931_4_, l, 2); if (tileentity != null) { tileentity.validate(); p_149931_1_.setTileEntity(p_149931_2_, p_149931_3_, p_149931_4_, tileentity); } }
/** * Update which block the furnace is using depending on whether or not it is burning */
Update which block the furnace is using depending on whether or not it is burning
updateFurnaceBlockState
{ "repo_name": "BackSpace47/main", "path": "java/net/RPower/RPowermod/block/BlockoreCrusher.java", "license": "mit", "size": 12219 }
[ "net.minecraft.init.Blocks", "net.minecraft.tileentity.TileEntity", "net.minecraft.world.World" ]
import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World;
import net.minecraft.init.*; import net.minecraft.tileentity.*; import net.minecraft.world.*;
[ "net.minecraft.init", "net.minecraft.tileentity", "net.minecraft.world" ]
net.minecraft.init; net.minecraft.tileentity; net.minecraft.world;
2,291,494
public boolean prepareGradesCsv(String criteria, String directory, boolean isManualExtraction) { boolean success = false; PreparedStatement preparedStatement = null; try { String query = Sql.getSqlGrades(); preparedStatement = createPreparedStatement(preparedStatement, query); preparedStatement.setString(1, "%" + criteria + "%"); success = saveResultsToFile(preparedStatement, directory, Constants.CSV_FILE_GRADES, isManualExtraction); if (success) { log.info("LAP-Extractor :: Grade extraction created successfully for criteria: " + criteria); } else { log.info("LAP-Extractor :: Grade extraction UNSUCCESSFUL for criteria: " + criteria); } } catch (Exception e) { log.error("Error preparing grades csv: " + e, e); } finally { closePreparedStatement(preparedStatement); } return success; }
boolean function(String criteria, String directory, boolean isManualExtraction) { boolean success = false; PreparedStatement preparedStatement = null; try { String query = Sql.getSqlGrades(); preparedStatement = createPreparedStatement(preparedStatement, query); preparedStatement.setString(1, "%" + criteria + "%"); success = saveResultsToFile(preparedStatement, directory, Constants.CSV_FILE_GRADES, isManualExtraction); if (success) { log.info(STR + criteria); } else { log.info(STR + criteria); } } catch (Exception e) { log.error(STR + e, e); } finally { closePreparedStatement(preparedStatement); } return success; }
/** * Create the grades.csv file, store it on file system * * @param criteria the site title search term to use * @param directory the name of the date-specific directory to store the .csv file * @param isManualExtraction is this from a manual extraction? * @return true, if creation and storage successful */
Create the grades.csv file, store it on file system
prepareGradesCsv
{ "repo_name": "Apereo-Learning-Analytics-Initiative/LAP-Sakai-Extractor", "path": "src/main/java/org/sakaiproject/lap/dao/Data.java", "license": "apache-2.0", "size": 12019 }
[ "java.sql.PreparedStatement", "org.sakaiproject.lap.Constants" ]
import java.sql.PreparedStatement; import org.sakaiproject.lap.Constants;
import java.sql.*; import org.sakaiproject.lap.*;
[ "java.sql", "org.sakaiproject.lap" ]
java.sql; org.sakaiproject.lap;
2,430,369
protected final void setEntitySession(String className, String opName, FortEntity entity) throws SecurityException { entity.setContextId(this.contextId); if (this.adminSess != null) { Permission perm = new Permission(className, opName); perm.setContextId(this.contextId); AdminUtil.setEntitySession( this.adminSess, perm, entity, this.contextId ); } }
final void function(String className, String opName, FortEntity entity) throws SecurityException { entity.setContextId(this.contextId); if (this.adminSess != null) { Permission perm = new Permission(className, opName); perm.setContextId(this.contextId); AdminUtil.setEntitySession( this.adminSess, perm, entity, this.contextId ); } }
/** * Set A/RBAC session on entity and perform authorization on behalf of the caller if the {@link #adminSess} is set. * * @param className contains the class name. * @param opName contains operation name. * @param entity contains {@link org.apache.directory.fortress.core.model.FortEntity} instance. * @throws org.apache.directory.fortress.core.SecurityException * in the event of data validation or system error. */
Set A/RBAC session on entity and perform authorization on behalf of the caller if the <code>#adminSess</code> is set
setEntitySession
{ "repo_name": "PennState/directory-fortress-core-1", "path": "src/main/java/org/apache/directory/fortress/core/impl/Manageable.java", "license": "apache-2.0", "size": 8078 }
[ "org.apache.directory.fortress.core.SecurityException", "org.apache.directory.fortress.core.model.FortEntity", "org.apache.directory.fortress.core.model.Permission" ]
import org.apache.directory.fortress.core.SecurityException; import org.apache.directory.fortress.core.model.FortEntity; import org.apache.directory.fortress.core.model.Permission;
import org.apache.directory.fortress.core.*; import org.apache.directory.fortress.core.model.*;
[ "org.apache.directory" ]
org.apache.directory;
740,892
@SuppressWarnings("unchecked") public void testReadString() throws Exception { String key1 = "key1"; String value1 = "value1"; String key2 = "key2"; String value2 = "value2"; String key3 = "key3"; String value3_0 = "one"; boolean value3_1 = true; boolean value3_2 = false; BigDecimal value3_3 = new BigDecimal("2"); BigDecimal value3_4 = new BigDecimal("3.14159265358979323846"); String json = String.format("{ '%s' : '%s', \"%s\" : \"%s\", '%s' : ['%s', %s, %s, %s, %s]} ", key1, value1, key2, value2, key3, value3_0, value3_1, value3_2, value3_3, value3_4); Object o = parseAndRetrieve(json); assertNotNull(o); assertTrue(o instanceof Map); Map<String, Object> m = (Map<String, Object>) o; assertEquals(value1, m.get(key1)); assertEquals(value2, m.get(key2)); List<?> l = (List<?>) m.get(key3); assertEquals(value3_0, l.get(0)); assertEquals(value3_1, l.get(1)); assertEquals(value3_2, l.get(2)); assertEquals(value3_3, l.get(3)); assertEquals(value3_4, l.get(4)); try { parseAndRetrieve("\"halfstring"); fail("Unterminated String should not pass."); } catch (JsonParseException e) { // should fail. } }
@SuppressWarnings(STR) void function() throws Exception { String key1 = "key1"; String value1 = STR; String key2 = "key2"; String value2 = STR; String key3 = "key3"; String value3_0 = "one"; boolean value3_1 = true; boolean value3_2 = false; BigDecimal value3_3 = new BigDecimal("2"); BigDecimal value3_4 = new BigDecimal(STR); String json = String.format(STR%s\STR%s\STR, key1, value1, key2, value2, key3, value3_0, value3_1, value3_2, value3_3, value3_4); Object o = parseAndRetrieve(json); assertNotNull(o); assertTrue(o instanceof Map); Map<String, Object> m = (Map<String, Object>) o; assertEquals(value1, m.get(key1)); assertEquals(value2, m.get(key2)); List<?> l = (List<?>) m.get(key3); assertEquals(value3_0, l.get(0)); assertEquals(value3_1, l.get(1)); assertEquals(value3_2, l.get(2)); assertEquals(value3_3, l.get(3)); assertEquals(value3_4, l.get(4)); try { parseAndRetrieve("\"halfstringSTRUnterminated String should not pass."); } catch (JsonParseException e) { } }
/** * Test for reading Strings. * * FIXME: this is a mess. */
Test for reading Strings
testReadString
{ "repo_name": "TribeMedia/aura", "path": "aura-util/src/test/java/org/auraframework/util/json/JsonStreamReaderTest.java", "license": "apache-2.0", "size": 53516 }
[ "java.math.BigDecimal", "java.util.List", "java.util.Map", "org.auraframework.util.json.JsonStreamReader" ]
import java.math.BigDecimal; import java.util.List; import java.util.Map; import org.auraframework.util.json.JsonStreamReader;
import java.math.*; import java.util.*; import org.auraframework.util.json.*;
[ "java.math", "java.util", "org.auraframework.util" ]
java.math; java.util; org.auraframework.util;
1,948,862
public FeTable getTable(TableName tableName, boolean addColumnPrivilege, Privilege... privilege) throws AnalysisException { try { return getTable(tableName, true, addColumnPrivilege, privilege); } catch (TableLoadingException e) { throw new AnalysisException(e); } }
FeTable function(TableName tableName, boolean addColumnPrivilege, Privilege... privilege) throws AnalysisException { try { return getTable(tableName, true, addColumnPrivilege, privilege); } catch (TableLoadingException e) { throw new AnalysisException(e); } }
/** * Sets the addColumnPrivilege to true to add column-level privilege(s) for a given * table instead of table-level privilege(s). */
Sets the addColumnPrivilege to true to add column-level privilege(s) for a given table instead of table-level privilege(s)
getTable
{ "repo_name": "cloudera/Impala", "path": "fe/src/main/java/org/apache/impala/analysis/Analyzer.java", "license": "apache-2.0", "size": 116695 }
[ "org.apache.impala.authorization.Privilege", "org.apache.impala.catalog.FeTable", "org.apache.impala.catalog.TableLoadingException", "org.apache.impala.common.AnalysisException" ]
import org.apache.impala.authorization.Privilege; import org.apache.impala.catalog.FeTable; import org.apache.impala.catalog.TableLoadingException; import org.apache.impala.common.AnalysisException;
import org.apache.impala.authorization.*; import org.apache.impala.catalog.*; import org.apache.impala.common.*;
[ "org.apache.impala" ]
org.apache.impala;
1,280,551
public static PCollectionView<?> viewFromProto( SideInput sideInput, String localName, PCollection<?> pCollection, RunnerApi.PTransform parDoTransform, RehydratedComponents components) throws IOException { checkArgument( localName != null, "%s.viewFromProto: localName must not be null", ParDoTranslation.class.getSimpleName()); TupleTag<?> tag = new TupleTag<>(localName); WindowMappingFn<?> windowMappingFn = windowMappingFnFromProto(sideInput.getWindowMappingFn()); ViewFn<?, ?> viewFn = viewFnFromProto(sideInput.getViewFn()); WindowingStrategy<?, ?> windowingStrategy = pCollection.getWindowingStrategy().fixDefaults(); Coder<Iterable<WindowedValue<?>>> coder = (Coder) IterableCoder.of( FullWindowedValueCoder.of( pCollection.getCoder(), pCollection.getWindowingStrategy().getWindowFn().windowCoder())); checkArgument( sideInput.getAccessPattern().getUrn().equals(Materializations.ITERABLE_MATERIALIZATION_URN), "Unknown View Materialization URN %s", sideInput.getAccessPattern().getUrn()); PCollectionView<?> view = new RunnerPCollectionView<>( pCollection, (TupleTag<Iterable<WindowedValue<?>>>) tag, (ViewFn<Iterable<WindowedValue<?>>, ?>) viewFn, windowMappingFn, windowingStrategy, coder); return view; }
static PCollectionView<?> function( SideInput sideInput, String localName, PCollection<?> pCollection, RunnerApi.PTransform parDoTransform, RehydratedComponents components) throws IOException { checkArgument( localName != null, STR, ParDoTranslation.class.getSimpleName()); TupleTag<?> tag = new TupleTag<>(localName); WindowMappingFn<?> windowMappingFn = windowMappingFnFromProto(sideInput.getWindowMappingFn()); ViewFn<?, ?> viewFn = viewFnFromProto(sideInput.getViewFn()); WindowingStrategy<?, ?> windowingStrategy = pCollection.getWindowingStrategy().fixDefaults(); Coder<Iterable<WindowedValue<?>>> coder = (Coder) IterableCoder.of( FullWindowedValueCoder.of( pCollection.getCoder(), pCollection.getWindowingStrategy().getWindowFn().windowCoder())); checkArgument( sideInput.getAccessPattern().getUrn().equals(Materializations.ITERABLE_MATERIALIZATION_URN), STR, sideInput.getAccessPattern().getUrn()); PCollectionView<?> view = new RunnerPCollectionView<>( pCollection, (TupleTag<Iterable<WindowedValue<?>>>) tag, (ViewFn<Iterable<WindowedValue<?>>, ?>) viewFn, windowMappingFn, windowingStrategy, coder); return view; }
/** * Create a {@link PCollectionView} from a side input spec and an already-deserialized {@link * PCollection} that should be wired up. */
Create a <code>PCollectionView</code> from a side input spec and an already-deserialized <code>PCollection</code> that should be wired up
viewFromProto
{ "repo_name": "eljefe6a/incubator-beam", "path": "runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java", "license": "apache-2.0", "size": 24446 }
[ "com.google.common.base.Preconditions", "java.io.IOException", "org.apache.beam.sdk.coders.Coder", "org.apache.beam.sdk.coders.IterableCoder", "org.apache.beam.sdk.common.runner.v1.RunnerApi", "org.apache.beam.sdk.transforms.Materializations", "org.apache.beam.sdk.transforms.PTransform", "org.apache.beam.sdk.transforms.ViewFn", "org.apache.beam.sdk.transforms.windowing.WindowMappingFn", "org.apache.beam.sdk.util.WindowedValue", "org.apache.beam.sdk.values.PCollection", "org.apache.beam.sdk.values.PCollectionView", "org.apache.beam.sdk.values.TupleTag", "org.apache.beam.sdk.values.WindowingStrategy" ]
import com.google.common.base.Preconditions; import java.io.IOException; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.IterableCoder; import org.apache.beam.sdk.common.runner.v1.RunnerApi; import org.apache.beam.sdk.transforms.Materializations; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.transforms.ViewFn; import org.apache.beam.sdk.transforms.windowing.WindowMappingFn; import org.apache.beam.sdk.util.WindowedValue; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PCollectionView; import org.apache.beam.sdk.values.TupleTag; import org.apache.beam.sdk.values.WindowingStrategy;
import com.google.common.base.*; import java.io.*; import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.common.runner.v1.*; import org.apache.beam.sdk.transforms.*; import org.apache.beam.sdk.transforms.windowing.*; import org.apache.beam.sdk.util.*; import org.apache.beam.sdk.values.*;
[ "com.google.common", "java.io", "org.apache.beam" ]
com.google.common; java.io; org.apache.beam;
1,507,958
public synchronized void addHeader(String name, String value) { String nameLower = name.toLowerCase(Locale.ENGLISH); List<String> headerValueList = headerNameToValueListMap.get(nameLower); if (null == headerValueList) { headerValueList = new ArrayList<String>(); headerNameToValueListMap.put(nameLower, headerValueList); } headerValueList.add(value); }
synchronized void function(String name, String value) { String nameLower = name.toLowerCase(Locale.ENGLISH); List<String> headerValueList = headerNameToValueListMap.get(nameLower); if (null == headerValueList) { headerValueList = new ArrayList<String>(); headerNameToValueListMap.put(nameLower, headerValueList); } headerValueList.add(value); }
/** * Method to add header values to this instance. * * @param name name of this header * @param value value of this header */
Method to add header values to this instance
addHeader
{ "repo_name": "taugin/cim", "path": "src/upload/org/apache/commons/fileupload/util/FileItemHeadersImpl.java", "license": "apache-2.0", "size": 3216 }
[ "java.util.ArrayList", "java.util.List", "java.util.Locale" ]
import java.util.ArrayList; import java.util.List; import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
7,318
@CommandRoute(command = "achievements", systemCommand = true) public boolean achievementSettingsCommand(User user, Arguments arguments) { return captureSubCommands("achievements", () -> i18n.getString("ChatCommand.achievementSettings.usage"), user, arguments); }
@CommandRoute(command = STR, systemCommand = true) boolean function(User user, Arguments arguments) { return captureSubCommands(STR, () -> i18n.getString(STR), user, arguments); }
/** * Change achievement settings * Usage: !achievements [enable] [more...] */
Change achievement settings Usage: !achievements [enable] [more...]
achievementSettingsCommand
{ "repo_name": "Juraji/Biliomi", "path": "packages/games/achievements/src/main/java/nl/juraji/biliomi/components/achievements/AchievementsComponent.java", "license": "gpl-3.0", "size": 3670 }
[ "nl.juraji.biliomi.model.core.User", "nl.juraji.biliomi.utility.commandrouters.annotations.CommandRoute", "nl.juraji.biliomi.utility.commandrouters.types.Arguments" ]
import nl.juraji.biliomi.model.core.User; import nl.juraji.biliomi.utility.commandrouters.annotations.CommandRoute; import nl.juraji.biliomi.utility.commandrouters.types.Arguments;
import nl.juraji.biliomi.model.core.*; import nl.juraji.biliomi.utility.commandrouters.annotations.*; import nl.juraji.biliomi.utility.commandrouters.types.*;
[ "nl.juraji.biliomi" ]
nl.juraji.biliomi;
1,935,028
@Override public void insertText(String text) throws BadLocationException { final Document doc = getDocument(); styles.removeAttribute("link"); doc.insertString(this.getCaret().getDot(), text, styles); }
void function(String text) throws BadLocationException { final Document doc = getDocument(); styles.removeAttribute("link"); doc.insertString(this.getCaret().getDot(), text, styles); }
/** * Inserts text into the current document. * * @param text the text to insert * @throws BadLocationException if the location is not available for insertion. */
Inserts text into the current document
insertText
{ "repo_name": "joshuairl/toothchat-client", "path": "src/java/org/jivesoftware/spark/ui/ChatInputEditor.java", "license": "apache-2.0", "size": 10340 }
[ "javax.swing.text.BadLocationException", "javax.swing.text.Document" ]
import javax.swing.text.BadLocationException; import javax.swing.text.Document;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
2,666,731
public T setAuthor(String author) { mValues.put(PreviewPrograms.COLUMN_AUTHOR, author); return (T) this; }
T function(String author) { mValues.put(PreviewPrograms.COLUMN_AUTHOR, author); return (T) this; }
/** * Sets the author or artist of this content. * * @param author The author of the program. * @return This Builder object to allow for chaining of calls to builder methods. * @see androidx.tvprovider.media.tv.TvContractCompat.PreviewPrograms#COLUMN_AUTHOR */
Sets the author or artist of this content
setAuthor
{ "repo_name": "AndroidX/androidx", "path": "tvprovider/tvprovider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java", "license": "apache-2.0", "size": 47266 }
[ "androidx.tvprovider.media.tv.TvContractCompat" ]
import androidx.tvprovider.media.tv.TvContractCompat;
import androidx.tvprovider.media.tv.*;
[ "androidx.tvprovider" ]
androidx.tvprovider;
1,982,253
@Override public void stopCellEditing(@Nonnull JTable table, int row, int column) { cellWriterFor(table, row, column).stopCellEditing(table, row, column); }
void function(@Nonnull JTable table, int row, int column) { cellWriterFor(table, row, column).stopCellEditing(table, row, column); }
/** * Stops editing the given cell of the {@code JTable}. This method only supports the following Swing components as * cell editors: * <ul> * <li>{@code JCheckBox}</li> * <li>{@code JComboBox}</li> * <li>{@code JTextComponent}</li> * </ul> * * @param row the row index of the cell. * @param column the column index of the cell. * @throws ActionFailedException if this writer is unable to handle the underlying cell editor. * @see JTableCellWriter#stopCellEditing(JTable, int, int) */
Stops editing the given cell of the JTable. This method only supports the following Swing components as cell editors: JCheckBox JComboBox JTextComponent
stopCellEditing
{ "repo_name": "google/fest", "path": "third_party/fest-swing/src/main/java/org/fest/swing/driver/BasicJTableCellWriter.java", "license": "apache-2.0", "size": 5212 }
[ "javax.annotation.Nonnull", "javax.swing.JTable" ]
import javax.annotation.Nonnull; import javax.swing.JTable;
import javax.annotation.*; import javax.swing.*;
[ "javax.annotation", "javax.swing" ]
javax.annotation; javax.swing;
490,269
default Slice getSlice(int position, int offset, int length) { throw new UnsupportedOperationException(getClass().getName()); }
default Slice getSlice(int position, int offset, int length) { throw new UnsupportedOperationException(getClass().getName()); }
/** * Gets a slice at {@code offset} in the value at {@code position}. */
Gets a slice at offset in the value at position
getSlice
{ "repo_name": "ptkool/presto", "path": "presto-spi/src/main/java/com/facebook/presto/spi/block/Block.java", "license": "apache-2.0", "size": 11517 }
[ "io.airlift.slice.Slice" ]
import io.airlift.slice.Slice;
import io.airlift.slice.*;
[ "io.airlift.slice" ]
io.airlift.slice;
1,929,588
public Range getValueRange() { return this.range; }
Range function() { return this.range; }
/** * Returns the range of y-values. * * @return The range. */
Returns the range of y-values
getValueRange
{ "repo_name": "SOCR/HTML5_WebSite", "path": "SOCR2.8/src/edu/ucla/stat/SOCR/chart/data/SampleXYDataset2.java", "license": "lgpl-3.0", "size": 10747 }
[ "org.jfree.data.Range" ]
import org.jfree.data.Range;
import org.jfree.data.*;
[ "org.jfree.data" ]
org.jfree.data;
1,124,054
public Set<AddressFamilyRoutingPeerConfiguration> getAddressFamilyConfigrations();
Set<AddressFamilyRoutingPeerConfiguration> function();
/** * get the routing configurations specific per AddressFamilyKey * * @return */
get the routing configurations specific per AddressFamilyKey
getAddressFamilyConfigrations
{ "repo_name": "bnitin/bgp-ls", "path": "src/main/java/org/topology/bgp_ls/config/nodes/RoutingPeerConfiguration.java", "license": "apache-2.0", "size": 456 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,021,360
List<DnsCacheEntry> get(String hostname, DnsRecord[] additionals);
List<DnsCacheEntry> get(String hostname, DnsRecord[] additionals);
/** * Return the cached entries for the given hostname. * @param hostname the hostname * @param additionals the additional records * @return the cached entries */
Return the cached entries for the given hostname
get
{ "repo_name": "s-gheldd/netty", "path": "resolver-dns/src/main/java/io/netty/resolver/dns/DnsCache.java", "license": "apache-2.0", "size": 2465 }
[ "io.netty.handler.codec.dns.DnsRecord", "java.util.List" ]
import io.netty.handler.codec.dns.DnsRecord; import java.util.List;
import io.netty.handler.codec.dns.*; import java.util.*;
[ "io.netty.handler", "java.util" ]
io.netty.handler; java.util;
339,858
logger.debug("polling SolarEdge live data {}", handler.getConfiguration()); SolarEdgeCommand ldu; if (handler.getConfiguration().isUsePrivateApi()) { ldu = new LiveDataUpdatePrivateApi(handler); } else { if (handler.getConfiguration().isMeterInstalled()) { ldu = new LiveDataUpdatePublicApi(handler); } else { ldu = new LiveDataUpdateMeterless(handler); } } handler.getWebInterface().enqueueCommand(ldu); }
logger.debug(STR, handler.getConfiguration()); SolarEdgeCommand ldu; if (handler.getConfiguration().isUsePrivateApi()) { ldu = new LiveDataUpdatePrivateApi(handler); } else { if (handler.getConfiguration().isMeterInstalled()) { ldu = new LiveDataUpdatePublicApi(handler); } else { ldu = new LiveDataUpdateMeterless(handler); } } handler.getWebInterface().enqueueCommand(ldu); }
/** * Poll the SolarEdge Webservice one time per call. */
Poll the SolarEdge Webservice one time per call
run
{ "repo_name": "paulianttila/openhab2", "path": "bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeLiveDataPolling.java", "license": "epl-1.0", "size": 2150 }
[ "org.openhab.binding.solaredge.internal.command.LiveDataUpdateMeterless", "org.openhab.binding.solaredge.internal.command.LiveDataUpdatePrivateApi", "org.openhab.binding.solaredge.internal.command.LiveDataUpdatePublicApi", "org.openhab.binding.solaredge.internal.command.SolarEdgeCommand" ]
import org.openhab.binding.solaredge.internal.command.LiveDataUpdateMeterless; import org.openhab.binding.solaredge.internal.command.LiveDataUpdatePrivateApi; import org.openhab.binding.solaredge.internal.command.LiveDataUpdatePublicApi; import org.openhab.binding.solaredge.internal.command.SolarEdgeCommand;
import org.openhab.binding.solaredge.internal.command.*;
[ "org.openhab.binding" ]
org.openhab.binding;
17,732
public void setNumberOfOffspring(ControlParameter numberOfOffspring) { this.numberOfOffspring = numberOfOffspring; }
void function(ControlParameter numberOfOffspring) { this.numberOfOffspring = numberOfOffspring; }
/** * Sets the number of offspring to calculate * * @param numberOfOffspring The number of offspring required */
Sets the number of offspring to calculate
setNumberOfOffspring
{ "repo_name": "filinep/cilib", "path": "library/src/main/java/net/sourceforge/cilib/entity/operators/crossover/real/ParentCentricCrossoverStrategy.java", "license": "gpl-3.0", "size": 8199 }
[ "net.sourceforge.cilib.controlparameter.ControlParameter" ]
import net.sourceforge.cilib.controlparameter.ControlParameter;
import net.sourceforge.cilib.controlparameter.*;
[ "net.sourceforge.cilib" ]
net.sourceforge.cilib;
1,820,026
public boolean containsMeOrNothing(AbstractRobot robot) { AbstractRobot occ = getOccupier(); return occ == null || robot == occ; }
boolean function(AbstractRobot robot) { AbstractRobot occ = getOccupier(); return occ == null robot == occ; }
/** * Check that this zone is not occupied by given robot * * @param robot * that might occupy room * @return true if */
Check that this zone is not occupied by given robot
containsMeOrNothing
{ "repo_name": "eishub/BW4T", "path": "bw4t-server/src/main/java/nl/tudelft/bw4t/server/model/zone/Zone.java", "license": "gpl-3.0", "size": 3077 }
[ "nl.tudelft.bw4t.server.model.robots.AbstractRobot" ]
import nl.tudelft.bw4t.server.model.robots.AbstractRobot;
import nl.tudelft.bw4t.server.model.robots.*;
[ "nl.tudelft.bw4t" ]
nl.tudelft.bw4t;
2,764,617
public @Nullable Interpolator getDragStartItemAlphaAnimationInterpolator() { return mDraggingItemEffectsInfo.alphaInterpolator; }
Interpolator function() { return mDraggingItemEffectsInfo.alphaInterpolator; }
/** * Gets the interpolator which ise used for "drag start alpha" animation. * * @return Interpolator which is used for "drag start alpha" animation */
Gets the interpolator which ise used for "drag start alpha" animation
getDragStartItemAlphaAnimationInterpolator
{ "repo_name": "h6ah4i/android-advancedrecyclerview", "path": "library/src/main/java/com/h6ah4i/android/widget/advrecyclerview/draggable/RecyclerViewDragDropManager.java", "license": "apache-2.0", "size": 83764 }
[ "android.view.animation.Interpolator" ]
import android.view.animation.Interpolator;
import android.view.animation.*;
[ "android.view" ]
android.view;
1,545,232
public Queue<SearchNode<O, T>> createQueue() { return new StackQueue<SearchNode<O, T>>(); }
Queue<SearchNode<O, T>> function() { return new StackQueue<SearchNode<O, T>>(); }
/** * Creates the correct type of queue for this search. This search uses a LIFO stack so that the child nodes most * recently added to the queue are examined first, ensuring that the search always goes deeper if it can. * * @return An empty LIFO stack. */
Creates the correct type of queue for this search. This search uses a LIFO stack so that the child nodes most recently added to the queue are examined first, ensuring that the search always goes deeper if it can
createQueue
{ "repo_name": "rupertlssmith/lojix", "path": "lojix/search/src/main/com/thesett/aima/search/util/uninformed/DepthFirstSearch.java", "license": "apache-2.0", "size": 2934 }
[ "com.thesett.aima.search.SearchNode", "com.thesett.common.util.StackQueue", "java.util.Queue" ]
import com.thesett.aima.search.SearchNode; import com.thesett.common.util.StackQueue; import java.util.Queue;
import com.thesett.aima.search.*; import com.thesett.common.util.*; import java.util.*;
[ "com.thesett.aima", "com.thesett.common", "java.util" ]
com.thesett.aima; com.thesett.common; java.util;
2,751,051
public void clientCompressedUnary() throws Exception { assumeEnoughMemory(); final SimpleRequest expectCompressedRequest = SimpleRequest.newBuilder() .setExpectCompressed(BoolValue.newBuilder().setValue(true)) .setResponseSize(314159) .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[271828]))) .build(); final SimpleRequest expectUncompressedRequest = SimpleRequest.newBuilder() .setExpectCompressed(BoolValue.newBuilder().setValue(false)) .setResponseSize(314159) .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[271828]))) .build(); final SimpleResponse goldenResponse = SimpleResponse.newBuilder() .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[314159]))) .build(); // Send a non-compressed message with expectCompress=true. Servers supporting this test case // should return INVALID_ARGUMENT. try { blockingStub.unaryCall(expectCompressedRequest); fail("expected INVALID_ARGUMENT"); } catch (StatusRuntimeException e) { assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatus().getCode()); } if (metricsExpected()) { assertMetrics("grpc.testing.TestService/UnaryCall", Status.Code.INVALID_ARGUMENT); } assertEquals( goldenResponse, blockingStub.withCompression("gzip").unaryCall(expectCompressedRequest)); if (metricsExpected()) { assertMetrics( "grpc.testing.TestService/UnaryCall", Status.Code.OK, Collections.singleton(expectCompressedRequest), Collections.singleton(goldenResponse)); } assertEquals(goldenResponse, blockingStub.unaryCall(expectUncompressedRequest)); if (metricsExpected()) { assertMetrics( "grpc.testing.TestService/UnaryCall", Status.Code.OK, Collections.singleton(expectUncompressedRequest), Collections.singleton(goldenResponse)); } }
void function() throws Exception { assumeEnoughMemory(); final SimpleRequest expectCompressedRequest = SimpleRequest.newBuilder() .setExpectCompressed(BoolValue.newBuilder().setValue(true)) .setResponseSize(314159) .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[271828]))) .build(); final SimpleRequest expectUncompressedRequest = SimpleRequest.newBuilder() .setExpectCompressed(BoolValue.newBuilder().setValue(false)) .setResponseSize(314159) .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[271828]))) .build(); final SimpleResponse goldenResponse = SimpleResponse.newBuilder() .setPayload(Payload.newBuilder().setBody(ByteString.copyFrom(new byte[314159]))) .build(); try { blockingStub.unaryCall(expectCompressedRequest); fail(STR); } catch (StatusRuntimeException e) { assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatus().getCode()); } if (metricsExpected()) { assertMetrics(STR, Status.Code.INVALID_ARGUMENT); } assertEquals( goldenResponse, blockingStub.withCompression("gzip").unaryCall(expectCompressedRequest)); if (metricsExpected()) { assertMetrics( STR, Status.Code.OK, Collections.singleton(expectCompressedRequest), Collections.singleton(goldenResponse)); } assertEquals(goldenResponse, blockingStub.unaryCall(expectUncompressedRequest)); if (metricsExpected()) { assertMetrics( STR, Status.Code.OK, Collections.singleton(expectUncompressedRequest), Collections.singleton(goldenResponse)); } }
/** * Tests client per-message compression for unary calls. The Java API does not support inspecting * a message's compression level, so this is primarily intended to run against a gRPC C++ server. */
Tests client per-message compression for unary calls. The Java API does not support inspecting a message's compression level, so this is primarily intended to run against a gRPC C++ server
clientCompressedUnary
{ "repo_name": "pieterjanpintens/grpc-java", "path": "interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java", "license": "apache-2.0", "size": 80038 }
[ "com.google.protobuf.BoolValue", "com.google.protobuf.ByteString", "io.grpc.Status", "io.grpc.StatusRuntimeException", "io.grpc.testing.integration.Messages", "java.util.Collections", "org.junit.Assert" ]
import com.google.protobuf.BoolValue; import com.google.protobuf.ByteString; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.testing.integration.Messages; import java.util.Collections; import org.junit.Assert;
import com.google.protobuf.*; import io.grpc.*; import io.grpc.testing.integration.*; import java.util.*; import org.junit.*;
[ "com.google.protobuf", "io.grpc", "io.grpc.testing", "java.util", "org.junit" ]
com.google.protobuf; io.grpc; io.grpc.testing; java.util; org.junit;
1,527,919