method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Override public void handleSelection( String selection, boolean selectionValid, @SelectionType int type, float x, float y) { if (mIsAccessibilityModeEnabled) return; if (!selection.isEmpty()) { ContextualSearchUma.logSelectionIsValid(selectionValid); if (selectionValid && mSearchPanel != null) { mSearchPanel.updateBasePageSelectionYPx(y); if (!mSearchPanel.isShowing()) { mSearchPanel.getPanelMetrics().onSelectionEstablished(selection); } showSelectionAsSearchInBar(selection); if (type == SelectionType.LONG_PRESS) { mInternalStateController.enter(InternalState.LONG_PRESS_RECOGNIZED); } else if (type == SelectionType.RESOLVING_LONG_PRESS) { mInternalStateController.enter(InternalState.RESOLVING_LONG_PRESS_RECOGNIZED); } } else { hideContextualSearch(StateChangeReason.INVALID_SELECTION); } } }
void function( String selection, boolean selectionValid, @SelectionType int type, float x, float y) { if (mIsAccessibilityModeEnabled) return; if (!selection.isEmpty()) { ContextualSearchUma.logSelectionIsValid(selectionValid); if (selectionValid && mSearchPanel != null) { mSearchPanel.updateBasePageSelectionYPx(y); if (!mSearchPanel.isShowing()) { mSearchPanel.getPanelMetrics().onSelectionEstablished(selection); } showSelectionAsSearchInBar(selection); if (type == SelectionType.LONG_PRESS) { mInternalStateController.enter(InternalState.LONG_PRESS_RECOGNIZED); } else if (type == SelectionType.RESOLVING_LONG_PRESS) { mInternalStateController.enter(InternalState.RESOLVING_LONG_PRESS_RECOGNIZED); } } else { hideContextualSearch(StateChangeReason.INVALID_SELECTION); } } }
/** * Notifies this class that the selection has changed. This may be due to the user moving the * selection handles after a long-press, or after a Tap gesture has called selectWordAroundCaret * to expand the selection to a whole word. */
Notifies this class that the selection has changed. This may be due to the user moving the selection handles after a long-press, or after a Tap gesture has called selectWordAroundCaret to expand the selection to a whole word
handleSelection
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java", "license": "bsd-3-clause", "size": 85866 }
[ "org.chromium.chrome.browser.compositor.bottombar.OverlayPanel", "org.chromium.chrome.browser.contextualsearch.ContextualSearchInternalStateController", "org.chromium.chrome.browser.contextualsearch.ContextualSearchSelectionController" ]
import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; import org.chromium.chrome.browser.contextualsearch.ContextualSearchInternalStateController; import org.chromium.chrome.browser.contextualsearch.ContextualSearchSelectionController;
import org.chromium.chrome.browser.compositor.bottombar.*; import org.chromium.chrome.browser.contextualsearch.*;
[ "org.chromium.chrome" ]
org.chromium.chrome;
1,720,761
public void updateSharedObjectStatistics(String path, String name) throws ScopeNotFoundException, SharedObjectException;
void function(String path, String name) throws ScopeNotFoundException, SharedObjectException;
/** * Update informations about a shared object in a given scope. * * @param path Path to scope that contains the shared object. * @param name Name of shared object to update. * @throws ScopeNotFoundException if the given scope doesn't exist * @throws SharedObjectException if no shared object with the given name exists */
Update informations about a shared object in a given scope
updateSharedObjectStatistics
{ "repo_name": "cwpenhale/red5-mobileconsole", "path": "red5_server/src/main/java/org/red5/server/api/statistics/IStatisticsService.java", "license": "apache-2.0", "size": 3904 }
[ "org.red5.server.exception.ScopeNotFoundException", "org.red5.server.exception.SharedObjectException" ]
import org.red5.server.exception.ScopeNotFoundException; import org.red5.server.exception.SharedObjectException;
import org.red5.server.exception.*;
[ "org.red5.server" ]
org.red5.server;
1,141,842
// just for test public static Converter getXMLConverter(String direction) { if (Converter.DIRECTION_POSITIVE.equals(direction)) { return new Xml2Xliff(); } else { return new Xliff2Xml(); } } private class XmlPositiveCustomizer implements ServiceTrackerCustomizer {
static Converter function(String direction) { if (Converter.DIRECTION_POSITIVE.equals(direction)) { return new Xml2Xliff(); } else { return new Xliff2Xml(); } } private class XmlPositiveCustomizer implements ServiceTrackerCustomizer {
/** * Gets the xML converter. * @param direction * the direction * @return the xML converter */
Gets the xML converter
getXMLConverter
{ "repo_name": "heartsome/translationstudio8", "path": "hsconverter/net.heartsome.cat.converter.inx/src/net/heartsome/cat/converter/inx/Activator.java", "license": "gpl-2.0", "size": 6946 }
[ "net.heartsome.cat.converter.Converter", "net.heartsome.cat.converter.xml.Xliff2Xml", "net.heartsome.cat.converter.xml.Xml2Xliff", "org.osgi.util.tracker.ServiceTrackerCustomizer" ]
import net.heartsome.cat.converter.Converter; import net.heartsome.cat.converter.xml.Xliff2Xml; import net.heartsome.cat.converter.xml.Xml2Xliff; import org.osgi.util.tracker.ServiceTrackerCustomizer;
import net.heartsome.cat.converter.*; import net.heartsome.cat.converter.xml.*; import org.osgi.util.tracker.*;
[ "net.heartsome.cat", "org.osgi.util" ]
net.heartsome.cat; org.osgi.util;
2,819,264
private void transferCopyEntities(String toolId, String fromContext, String toContext) { // offer to all EntityProducers for (Iterator i = entityManager.getEntityProducers().iterator(); i.hasNext(); ) { EntityProducer ep = (EntityProducer) i.next(); if (ep instanceof EntityTransferrer) { try { EntityTransferrer et = (EntityTransferrer) ep; // if this producer claims this tool id if (ArrayUtil.contains(et.myToolIds(), toolId)) { et.transferCopyEntities(fromContext, toContext, new ArrayList()); } } catch (Throwable t) { LOG.warn(this + ".transferCopyEntities: Error encountered while asking EntityTransfer to transferCopyEntities from: " + fromContext + " to: " + toContext, t); } } } }
void function(String toolId, String fromContext, String toContext) { for (Iterator i = entityManager.getEntityProducers().iterator(); i.hasNext(); ) { EntityProducer ep = (EntityProducer) i.next(); if (ep instanceof EntityTransferrer) { try { EntityTransferrer et = (EntityTransferrer) ep; if (ArrayUtil.contains(et.myToolIds(), toolId)) { et.transferCopyEntities(fromContext, toContext, new ArrayList()); } } catch (Throwable t) { LOG.warn(this + STR + fromContext + STR + toContext, t); } } } }
/** * Transfer a copy of all entites from another context for any entity * producer that claims this tool id. * * @param toolId The tool id. * @param fromContext The context to import from. * @param toContext The context to import into. */
Transfer a copy of all entites from another context for any entity producer that claims this tool id
transferCopyEntities
{ "repo_name": "payten/nyu-sakai-10.4", "path": "webservices/cxf/src/java/org/sakaiproject/webservices/SakaiScript.java", "license": "apache-2.0", "size": 180693 }
[ "java.util.ArrayList", "java.util.Iterator", "org.sakaiproject.entity.api.EntityProducer", "org.sakaiproject.entity.api.EntityTransferrer", "org.sakaiproject.util.ArrayUtil" ]
import java.util.ArrayList; import java.util.Iterator; import org.sakaiproject.entity.api.EntityProducer; import org.sakaiproject.entity.api.EntityTransferrer; import org.sakaiproject.util.ArrayUtil;
import java.util.*; import org.sakaiproject.entity.api.*; import org.sakaiproject.util.*;
[ "java.util", "org.sakaiproject.entity", "org.sakaiproject.util" ]
java.util; org.sakaiproject.entity; org.sakaiproject.util;
2,453,908
protected void setTemporalFilterCapabilities(TemporalCapabilitiesType temporalCapabilities, org.n52.sos.ogc.filter.FilterCapabilities sosFilterCaps) { // set TemporalOperands if (!sosFilterCaps.getTemporalOperands().isEmpty()) { TemporalOperandsType tempOperands = temporalCapabilities.addNewTemporalOperands(); for (QName operand : sosFilterCaps.getTemporalOperands()) { tempOperands.addTemporalOperand(operand); } } // set TemporalOperators if (!sosFilterCaps.getTempporalOperators().isEmpty()) { TemporalOperatorsType temporalOps = temporalCapabilities.addNewTemporalOperators(); Set<TimeOperator> keys = sosFilterCaps.getTempporalOperators().keySet(); for (TimeOperator temporalOperator : keys) { TemporalOperatorType operator = temporalOps.addNewTemporalOperator(); operator.setName(getEnum4TemporalOperator(temporalOperator)); TemporalOperandsType bboxGeomOps = operator.addNewTemporalOperands(); for (QName operand : sosFilterCaps.getTempporalOperators().get(temporalOperator)) { bboxGeomOps.addTemporalOperand(operand); } } } }
void function(TemporalCapabilitiesType temporalCapabilities, org.n52.sos.ogc.filter.FilterCapabilities sosFilterCaps) { if (!sosFilterCaps.getTemporalOperands().isEmpty()) { TemporalOperandsType tempOperands = temporalCapabilities.addNewTemporalOperands(); for (QName operand : sosFilterCaps.getTemporalOperands()) { tempOperands.addTemporalOperand(operand); } } if (!sosFilterCaps.getTempporalOperators().isEmpty()) { TemporalOperatorsType temporalOps = temporalCapabilities.addNewTemporalOperators(); Set<TimeOperator> keys = sosFilterCaps.getTempporalOperators().keySet(); for (TimeOperator temporalOperator : keys) { TemporalOperatorType operator = temporalOps.addNewTemporalOperator(); operator.setName(getEnum4TemporalOperator(temporalOperator)); TemporalOperandsType bboxGeomOps = operator.addNewTemporalOperands(); for (QName operand : sosFilterCaps.getTempporalOperators().get(temporalOperator)) { bboxGeomOps.addTemporalOperand(operand); } } } }
/** * Sets the TemporalFilterCapabilities. * * !!! Modify method addicted to your implementation !!! * * @param temporalCapabilities * TemporalCapabilities. * @param sosFilterCaps */
Sets the TemporalFilterCapabilities. !!! Modify method addicted to your implementation !!
setTemporalFilterCapabilities
{ "repo_name": "impulze/SOS", "path": "coding/sos-v100/src/main/java/org/n52/sos/encode/sos/v1/GetCapabilitiesResponseEncoder.java", "license": "gpl-2.0", "size": 20630 }
[ "java.util.Set", "javax.xml.namespace.QName", "net.opengis.ogc.TemporalCapabilitiesType", "net.opengis.ogc.TemporalOperandsType", "net.opengis.ogc.TemporalOperatorType", "net.opengis.ogc.TemporalOperatorsType", "net.opengis.sos.x10.FilterCapabilitiesDocument", "org.n52.sos.ogc.filter.FilterConstants" ...
import java.util.Set; import javax.xml.namespace.QName; import net.opengis.ogc.TemporalCapabilitiesType; import net.opengis.ogc.TemporalOperandsType; import net.opengis.ogc.TemporalOperatorType; import net.opengis.ogc.TemporalOperatorsType; import net.opengis.sos.x10.FilterCapabilitiesDocument; import org.n52.sos.ogc.filter.FilterConstants;
import java.util.*; import javax.xml.namespace.*; import net.opengis.ogc.*; import net.opengis.sos.x10.*; import org.n52.sos.ogc.filter.*;
[ "java.util", "javax.xml", "net.opengis.ogc", "net.opengis.sos", "org.n52.sos" ]
java.util; javax.xml; net.opengis.ogc; net.opengis.sos; org.n52.sos;
582,360
public static String cleanupStr(String name, boolean allowDottedKeys) { if (name == null) { return null; } Pattern pattern; if (!allowDottedKeys) { pattern = DOT_SLASH_UNDERSCORE_PAT; } else { pattern = SLASH_UNDERSCORE_PAT; } String clean = pattern.matcher(name).replaceAll("_"); clean = SPACE_PAT.matcher(clean).replaceAll(""); clean = org.apache.commons.lang.StringUtils.chomp(clean, "."); clean = org.apache.commons.lang.StringUtils.chomp(clean, "_"); return clean; }
static String function(String name, boolean allowDottedKeys) { if (name == null) { return null; } Pattern pattern; if (!allowDottedKeys) { pattern = DOT_SLASH_UNDERSCORE_PAT; } else { pattern = SLASH_UNDERSCORE_PAT; } String clean = pattern.matcher(name).replaceAll("_"); clean = SPACE_PAT.matcher(clean).replaceAll(STR.STR_"); return clean; }
/** * Replaces all . and / with _ and removes all spaces and double/single quotes. * Chomps any trailing . or _ character. * * @param allowDottedKeys whether we remove the dots or not. */
Replaces all . and / with _ and removes all spaces and double/single quotes. Chomps any trailing . or _ character
cleanupStr
{ "repo_name": "kevinconaway/jmxtrans", "path": "jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/StringUtils.java", "license": "mit", "size": 2405 }
[ "java.util.regex.Pattern" ]
import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
13,299
@Test public void testTokenInvalidGrantTypePassword() { Client c = authContext.getClient(); // Build the entity. Form f = new Form(); f.param("client_id", IdUtil.toString(c.getId())); f.param("client_secret", c.getClientSecret()); f.param("grant_type", "password"); Entity postEntity = Entity.entity(f, MediaType.APPLICATION_FORM_URLENCODED_TYPE); Response r = target("/oauth2/token").request().post(postEntity); // Assert various response-specific parameters. assertEquals(Status.BAD_REQUEST.getStatusCode(), r.getStatus()); assertEquals(MediaType.APPLICATION_JSON_TYPE, r.getMediaType()); // Validate the query parameters received. ErrorResponse entity = r.readEntity(ErrorResponse.class); assertEquals("invalid_grant", entity.getError()); assertNotNull(entity.getErrorDescription()); }
void function() { Client c = authContext.getClient(); Form f = new Form(); f.param(STR, IdUtil.toString(c.getId())); f.param(STR, c.getClientSecret()); f.param(STR, STR); Entity postEntity = Entity.entity(f, MediaType.APPLICATION_FORM_URLENCODED_TYPE); Response r = target(STR).request().post(postEntity); assertEquals(Status.BAD_REQUEST.getStatusCode(), r.getStatus()); assertEquals(MediaType.APPLICATION_JSON_TYPE, r.getMediaType()); ErrorResponse entity = r.readEntity(ErrorResponse.class); assertEquals(STR, entity.getError()); assertNotNull(entity.getErrorDescription()); }
/** * Assert that an invalid token type errors. */
Assert that an invalid token type errors
testTokenInvalidGrantTypePassword
{ "repo_name": "kangaroo-server/kangaroo", "path": "kangaroo-server-authz/src/test/java/net/krotscheck/kangaroo/authz/oauth2/rfc6749/Section440ClientCredentialsTest.java", "license": "apache-2.0", "size": 15485 }
[ "javax.ws.rs.client.Entity", "javax.ws.rs.core.Form", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "net.krotscheck.kangaroo.authz.common.database.entity.Client", "net.krotscheck.kangaroo.common.exception.ErrorResponseBuilder", "net.krotscheck.kangaroo.common.hibernate.id.IdUtil", "org.ju...
import javax.ws.rs.client.Entity; import javax.ws.rs.core.Form; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import net.krotscheck.kangaroo.authz.common.database.entity.Client; import net.krotscheck.kangaroo.common.exception.ErrorResponseBuilder; import net.krotscheck.kangaroo.common.hibernate.id.IdUtil; import org.junit.Assert;
import javax.ws.rs.client.*; import javax.ws.rs.core.*; import net.krotscheck.kangaroo.authz.common.database.entity.*; import net.krotscheck.kangaroo.common.exception.*; import net.krotscheck.kangaroo.common.hibernate.id.*; import org.junit.*;
[ "javax.ws", "net.krotscheck.kangaroo", "org.junit" ]
javax.ws; net.krotscheck.kangaroo; org.junit;
690,068
public static <T> int[] where(int[] d, Condition<T> c) { TIntArrayList retVal = new TIntArrayList(); int len = d.length; for (int i = 0; i < len; i++) { if (c.eval(d[i])) { retVal.add(i); } } return retVal.toArray(); }
static <T> int[] function(int[] d, Condition<T> c) { TIntArrayList retVal = new TIntArrayList(); int len = d.length; for (int i = 0; i < len; i++) { if (c.eval(d[i])) { retVal.add(i); } } return retVal.toArray(); }
/** * Scans the specified values and applies the {@link Condition} to each * value, returning the indexes of the values where the condition evaluates * to true. * * @param values the values to test * @param c the condition used to test each value * @return */
Scans the specified values and applies the <code>Condition</code> to each value, returning the indexes of the values where the condition evaluates to true
where
{ "repo_name": "UniKnow/htm.java", "path": "src/main/java/org/numenta/nupic/util/ArrayUtils.java", "license": "gpl-3.0", "size": 52874 }
[ "gnu.trove.list.array.TIntArrayList" ]
import gnu.trove.list.array.TIntArrayList;
import gnu.trove.list.array.*;
[ "gnu.trove.list" ]
gnu.trove.list;
1,492,879
public static void setCesped(final BufferedImage pisoCesped) { Recursos.cesped = pisoCesped; }
static void function(final BufferedImage pisoCesped) { Recursos.cesped = pisoCesped; }
/** * Establece el sprite del cesped. <br> * * @param pisoCesped * Sprite del cesped. <br> */
Establece el sprite del cesped.
setCesped
{ "repo_name": "JavaATR/jrpg-2017b-cliente", "path": "src/main/resources/recursos/Recursos.java", "license": "mit", "size": 38422 }
[ "java.awt.image.BufferedImage" ]
import java.awt.image.BufferedImage;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,158,702
public static void openCautionDialog(Shell shell, String title, String description, String reason, List<String> errorList) { LOGGER.debug("shell:" + shell + "messasge:" + reason + "errorList:" + errorList); org.eclipse.jface.dialogs.ErrorDialog.openError(shell, title, description, ErrorDialog.createMultiStatus(IStatus.WARNING, reason, errorList)); }
static void function(Shell shell, String title, String description, String reason, List<String> errorList) { LOGGER.debug(STR + shell + STR + reason + STR + errorList); org.eclipse.jface.dialogs.ErrorDialog.openError(shell, title, description, ErrorDialog.createMultiStatus(IStatus.WARNING, reason, errorList)); }
/** * It displays an error dialog warning icon.<br/> * View (only if Exception is passed) and trace error message.<br/> * * @param shell * Shell * @param title * Title * @param description * The top message * @param reason * Error message * @param errorList * List */
It displays an error dialog warning icon. View (only if Exception is passed) and trace error message
openCautionDialog
{ "repo_name": "azkaoru/migration-tool", "path": "src/tubame.knowhow/src/tubame/knowhow/plugin/ui/dialog/ErrorDialog.java", "license": "apache-2.0", "size": 6423 }
[ "java.util.List", "org.eclipse.core.runtime.IStatus", "org.eclipse.swt.widgets.Shell" ]
import java.util.List; import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.widgets.Shell;
import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.swt.widgets.*;
[ "java.util", "org.eclipse.core", "org.eclipse.swt" ]
java.util; org.eclipse.core; org.eclipse.swt;
1,838,247
private void addMetadataFailure(ParsingEvent event, String description, String details) { resultCollector.addFailure(event.getName(), "metadata", getClass().getSimpleName(), description, details); }
void function(ParsingEvent event, String description, String details) { resultCollector.addFailure(event.getName(), STR, getClass().getSimpleName(), description, details); }
/** * Add a metadata failure to the result collector. * @param event The event to add a failure for. * @param description Description of the failure. * Should start with the requirement that failed to validate, e.g. C1-1:. * @param details Details of the failure. */
Add a metadata failure to the result collector
addMetadataFailure
{ "repo_name": "statsbiblioteket/newspaper-batch-metadata-checker", "path": "newspaper-batch-metadata-checker-checkers/src/main/java/dk/statsbiblioteket/newspaper/metadatachecker/ModsXPathEventHandler.java", "license": "apache-2.0", "size": 17304 }
[ "dk.statsbiblioteket.medieplatform.autonomous.iterator.common.ParsingEvent" ]
import dk.statsbiblioteket.medieplatform.autonomous.iterator.common.ParsingEvent;
import dk.statsbiblioteket.medieplatform.autonomous.iterator.common.*;
[ "dk.statsbiblioteket.medieplatform" ]
dk.statsbiblioteket.medieplatform;
547,835
private void removePropertiesNotServed() throws Exception { LOG.logInfo( "remove properties that are listed within igeo_lookupdefinition table but not served by WFS anymore ..." ); // get properties that are listed at igeo_lookupdefinition but not served by the WFS anymore List<DBFeatureProperty> toBeRemoved = findPropertiesNotServed(); DBConnectionPool pool = DBConnectionPool.getInstance(); Connection conn = null; PreparedStatement stmt1 = null; Statement stmt2 = null; LOG.logInfo( "delete property from lookup table not served by WFS " ); try { conn = pool.acquireConnection( dbDriver, dbURL, dbUser, dbPassword ); stmt1 = conn.prepareStatement( "delete from igeo_lookupdefinition where id = ?" ); stmt2 = conn.createStatement(); // remove not served properties from map and database for ( DBFeatureProperty dbFeatureProperty : toBeRemoved ) { String key = dbFeatureProperty.namespace + ':' + dbFeatureProperty.featureType + '.' + dbFeatureProperty.property; LOG.logInfo( "delete property: " + key ); dbFeatureProps.remove( key ); stmt1.setInt( 1, dbFeatureProperty.id ); stmt1.execute(); stmt2.execute( "drop table " + dbFeatureProperty.dictionaryTable + " CASCADE CONSTRAINTS PURGE" ); } conn.commit(); } catch ( Exception e ) { LOG.logError( toString(), e ); throw e; } finally { if ( stmt1 != null ) { stmt1.close(); } if ( conn != null ) { pool.releaseConnection( conn, dbDriver, dbURL, dbUser, dbPassword ); } } }
void function() throws Exception { LOG.logInfo( STR ); List<DBFeatureProperty> toBeRemoved = findPropertiesNotServed(); DBConnectionPool pool = DBConnectionPool.getInstance(); Connection conn = null; PreparedStatement stmt1 = null; Statement stmt2 = null; LOG.logInfo( STR ); try { conn = pool.acquireConnection( dbDriver, dbURL, dbUser, dbPassword ); stmt1 = conn.prepareStatement( STR ); stmt2 = conn.createStatement(); for ( DBFeatureProperty dbFeatureProperty : toBeRemoved ) { String key = dbFeatureProperty.namespace + ':' + dbFeatureProperty.featureType + '.' + dbFeatureProperty.property; LOG.logInfo( STR + key ); dbFeatureProps.remove( key ); stmt1.setInt( 1, dbFeatureProperty.id ); stmt1.execute(); stmt2.execute( STR + dbFeatureProperty.dictionaryTable + STR ); } conn.commit(); } catch ( Exception e ) { LOG.logError( toString(), e ); throw e; } finally { if ( stmt1 != null ) { stmt1.close(); } if ( conn != null ) { pool.releaseConnection( conn, dbDriver, dbURL, dbUser, dbPassword ); } } }
/** * remove properties that are listed within igeo_lookupdefinition table but not served by WFS anymore * * @throws Exception */
remove properties that are listed within igeo_lookupdefinition table but not served by WFS anymore
removePropertiesNotServed
{ "repo_name": "lat-lon/deegree2-base", "path": "deegree2-dictionary/src/main/java/org/deegree/igeo/tools/DictionaryUpdater.java", "license": "lgpl-2.1", "size": 28099 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.Statement", "java.util.List", "org.deegree.io.DBConnectionPool" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.Statement; import java.util.List; import org.deegree.io.DBConnectionPool;
import java.sql.*; import java.util.*; import org.deegree.io.*;
[ "java.sql", "java.util", "org.deegree.io" ]
java.sql; java.util; org.deegree.io;
1,184,316
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) { return null; } if (parser.currentToken() == XContentParser.Token.START_OBJECT) { return GeoJsonParser.parse(parser, shapeMapper); } else if (parser.currentToken() == XContentParser.Token.VALUE_STRING) { return GeoWKTParser.parse(parser, shapeMapper); } throw new ElasticsearchParseException("shape must be an object consisting of type and coordinates"); } /** * Create a new {@link ShapeBuilder} from {@link XContent}
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) { return null; } if (parser.currentToken() == XContentParser.Token.START_OBJECT) { return GeoJsonParser.parse(parser, shapeMapper); } else if (parser.currentToken() == XContentParser.Token.VALUE_STRING) { return GeoWKTParser.parse(parser, shapeMapper); } throw new ElasticsearchParseException(STR); } /** * Create a new {@link ShapeBuilder} from {@link XContent}
/** * Create a new {@link ShapeBuilder} from {@link XContent} * @param parser parser to read the GeoShape from * @param shapeMapper document field mapper reference required for spatial parameters relevant * to the shape construction process (e.g., orientation) * todo: refactor to place build specific parameters in the SpatialContext * @return {@link ShapeBuilder} read from the parser or null * if the parsers current token has been <code>null</code> * @throws IOException if the input could not be read */
Create a new <code>ShapeBuilder</code> from <code>XContent</code>
parse
{ "repo_name": "s1monw/elasticsearch", "path": "server/src/main/java/org/elasticsearch/common/geo/parsers/ShapeParser.java", "license": "apache-2.0", "size": 3241 }
[ "org.elasticsearch.ElasticsearchParseException", "org.elasticsearch.common.geo.builders.ShapeBuilder", "org.elasticsearch.common.xcontent.XContent", "org.elasticsearch.common.xcontent.XContentParser" ]
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.*; import org.elasticsearch.common.geo.builders.*; import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch", "org.elasticsearch.common" ]
org.elasticsearch; org.elasticsearch.common;
2,884,671
protected void setVariableRegistry(ServiceReference<VariableRegistry> ref) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "setVariableRegistry", ref); variableRegistryRef.setReference(ref); }
void function(ServiceReference<VariableRegistry> ref) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, STR, ref); variableRegistryRef.setReference(ref); }
/** * Declarative Services method for setting the VariableRegistry service reference. * * @param ref reference to the service */
Declarative Services method for setting the VariableRegistry service reference
setVariableRegistry
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jca.1.7/src/com/ibm/ws/jca17/processor/service/AdministeredObjectResourceFactoryBuilder.java", "license": "epl-1.0", "size": 19887 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent", "com.ibm.wsspi.kernel.service.location.VariableRegistry", "org.osgi.framework.ServiceReference" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import com.ibm.wsspi.kernel.service.location.VariableRegistry; import org.osgi.framework.ServiceReference;
import com.ibm.websphere.ras.*; import com.ibm.wsspi.kernel.service.location.*; import org.osgi.framework.*;
[ "com.ibm.websphere", "com.ibm.wsspi", "org.osgi.framework" ]
com.ibm.websphere; com.ibm.wsspi; org.osgi.framework;
2,309,613
public final MetaProperty<ExternalId> settlementRegion() { return _settlementRegion; }
final MetaProperty<ExternalId> function() { return _settlementRegion; }
/** * The meta-property for the {@code settlementRegion} property. * @return the meta-property, not null */
The meta-property for the settlementRegion property
settlementRegion
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/convention/FXForwardAndSwapConvention.java", "license": "apache-2.0", "size": 14688 }
[ "com.opengamma.id.ExternalId", "org.joda.beans.MetaProperty" ]
import com.opengamma.id.ExternalId; import org.joda.beans.MetaProperty;
import com.opengamma.id.*; import org.joda.beans.*;
[ "com.opengamma.id", "org.joda.beans" ]
com.opengamma.id; org.joda.beans;
2,018,671
public Name name() { return this.name; }
Name function() { return this.name; }
/** * Get iotHub type. * * @return the name value */
Get iotHub type
name
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/iothub/mgmt-v2019_03_22_preview/src/main/java/com/microsoft/azure/management/iothub/v2019_03_22_preview/implementation/UserSubscriptionQuotaInner.java", "license": "mit", "size": 3745 }
[ "com.microsoft.azure.management.iothub.v2019_03_22_preview.Name" ]
import com.microsoft.azure.management.iothub.v2019_03_22_preview.Name;
import com.microsoft.azure.management.iothub.v2019_03_22_preview.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,276,583
public void promptSelection(Screen screen, String question, DialogOption[] options, int defaultValue, int dialogId);
void function(Screen screen, String question, DialogOption[] options, int defaultValue, int dialogId);
/** * Prompt a selection of different options to the user * @param screen the alert dialog owner Screen * @param question the message that describe the selection * @param options An array of DialogOption objects * @param defaultValue The default value for this selection * @param dialogId the dialog id related to the type of selection dialog * to be prompted */
Prompt a selection of different options to the user
promptSelection
{ "repo_name": "zhangdakun/funasyn", "path": "externals/java-sdk/client/src/main/java/com/funambol/client/ui/DisplayManager.java", "license": "agpl-3.0", "size": 6522 }
[ "com.funambol.client.controller.DialogOption" ]
import com.funambol.client.controller.DialogOption;
import com.funambol.client.controller.*;
[ "com.funambol.client" ]
com.funambol.client;
85,480
public Builder addAllExpand(List<String> elements) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.addAll(elements); return this; }
Builder function(List<String> elements) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.addAll(elements); return this; }
/** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link * ConnectionTokenCreateParams#expand} for the field documentation. */
Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>ConnectionTokenCreateParams#expand</code> for the field documentation
addAllExpand
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/terminal/ConnectionTokenCreateParams.java", "license": "mit", "size": 4675 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,982,946
private void getFieldPaths(Node node, String path, List<String> paths) { if (node.children.isEmpty()) { paths.add(path); return; } for (Entry<String, Node> entry : node.children.entrySet()) { String childPath = path.isEmpty() ? entry.getKey() : path + "." + entry.getKey(); getFieldPaths(entry.getValue(), childPath, paths); } }
void function(Node node, String path, List<String> paths) { if (node.children.isEmpty()) { paths.add(path); return; } for (Entry<String, Node> entry : node.children.entrySet()) { String childPath = path.isEmpty() ? entry.getKey() : path + "." + entry.getKey(); getFieldPaths(entry.getValue(), childPath, paths); } }
/** * Gathers all field paths in a sub-tree. */
Gathers all field paths in a sub-tree
getFieldPaths
{ "repo_name": "endlessm/chromium-browser", "path": "third_party/protobuf/java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java", "license": "bsd-3-clause", "size": 10545 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
980,109
TypeDefinitionSetRegistry<?> definitionSets();
TypeDefinitionSetRegistry<?> definitionSets();
/** * The registry that contains the Definition Sets present on the context. * @return The definition set registry. */
The registry that contains the Definition Sets present on the context
definitionSets
{ "repo_name": "jomarko/kie-wb-common", "path": "kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-api/kie-wb-common-stunner-core-api/src/main/java/org/kie/workbench/common/stunner/core/api/DefinitionManager.java", "license": "apache-2.0", "size": 1763 }
[ "org.kie.workbench.common.stunner.core.registry.definition.TypeDefinitionSetRegistry" ]
import org.kie.workbench.common.stunner.core.registry.definition.TypeDefinitionSetRegistry;
import org.kie.workbench.common.stunner.core.registry.definition.*;
[ "org.kie.workbench" ]
org.kie.workbench;
2,742,451
public void clickHelpButton() { try { drone.find(By.cssSelector(DASHLET_HELP_BUTTON)).click(); } catch (NoSuchElementException nse) { logger.error("Unable to find the help icon.", nse); throw new PageOperationException("Unable to click the Help icon"); } }
void function() { try { drone.find(By.cssSelector(DASHLET_HELP_BUTTON)).click(); } catch (NoSuchElementException nse) { logger.error(STR, nse); throw new PageOperationException(STR); } }
/** * Clicks on help button */
Clicks on help button
clickHelpButton
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/share-po/src/main/java/org/alfresco/po/share/dashlet/MyDiscussionsDashlet.java", "license": "lgpl-3.0", "size": 22707 }
[ "org.alfresco.webdrone.exception.PageOperationException", "org.openqa.selenium.By", "org.openqa.selenium.NoSuchElementException" ]
import org.alfresco.webdrone.exception.PageOperationException; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException;
import org.alfresco.webdrone.exception.*; import org.openqa.selenium.*;
[ "org.alfresco.webdrone", "org.openqa.selenium" ]
org.alfresco.webdrone; org.openqa.selenium;
407,864
public void setMetadataMaintenance(final MaintenanceInformation newValue) { checkWritePermission(metadataMaintenance); metadataMaintenance = newValue; }
void function(final MaintenanceInformation newValue) { checkWritePermission(metadataMaintenance); metadataMaintenance = newValue; }
/** * Sets information about the frequency of metadata updates, and the scope of those updates. * * @param newValue the new metadata maintenance. * * @see org.apache.sis.metadata.iso.identification.AbstractIdentification#setResourceMaintenances(Collection) */
Sets information about the frequency of metadata updates, and the scope of those updates
setMetadataMaintenance
{ "repo_name": "apache/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java", "license": "apache-2.0", "size": 75665 }
[ "org.opengis.metadata.maintenance.MaintenanceInformation" ]
import org.opengis.metadata.maintenance.MaintenanceInformation;
import org.opengis.metadata.maintenance.*;
[ "org.opengis.metadata" ]
org.opengis.metadata;
2,709,080
public Separator getSeparator() { return separator; }
Separator function() { return separator; }
/** * Return the item separator. * * @return The item separator. */
Return the item separator
getSeparator
{ "repo_name": "bit3/jsass", "path": "src/main/java/io/bit3/jsass/type/SassList.java", "license": "mit", "size": 4827 }
[ "io.bit3.jsass.Separator" ]
import io.bit3.jsass.Separator;
import io.bit3.jsass.*;
[ "io.bit3.jsass" ]
io.bit3.jsass;
2,407,659
public Field getBaseAmountField() { return baseAmountField; }
Field function() { return baseAmountField; }
/** * Gets the baseAmountField attribute. * @return Returns the baseAmountField. * * KRAD Conversion: Retrieving the field */
Gets the baseAmountField attribute
getBaseAmountField
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/sys/document/web/AccountingLineViewCurrentBaseAmount.java", "license": "agpl-3.0", "size": 14624 }
[ "org.kuali.rice.kns.web.ui.Field" ]
import org.kuali.rice.kns.web.ui.Field;
import org.kuali.rice.kns.web.ui.*;
[ "org.kuali.rice" ]
org.kuali.rice;
919,620
return any; } /** * Sets the value of the any property. * * @param value * allowed object is * {@link Object } * {@link Element }
return any; } /** * Sets the value of the any property. * * @param value * allowed object is * {@link Object } * {@link Element }
/** * Gets the value of the any property. * * @return * possible object is * {@link Object } * {@link Element } * */
Gets the value of the any property
getAny
{ "repo_name": "lvweiwolf/poi-3.16", "path": "src/java/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java", "license": "apache-2.0", "size": 3482 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
372,675
public static <E> Funnel<Iterable<? extends E>> sequentialFunnel(Funnel<E> elementFunnel) { return new SequentialFunnel<E>(elementFunnel); } private static class SequentialFunnel<E> implements Funnel<Iterable<? extends E>>, Serializable { private final Funnel<E> elementFunnel; SequentialFunnel(Funnel<E> elementFunnel) { this.elementFunnel = Preconditions.checkNotNull(elementFunnel); }
static <E> Funnel<Iterable<? extends E>> function(Funnel<E> elementFunnel) { return new SequentialFunnel<E>(elementFunnel); } private static class SequentialFunnel<E> implements Funnel<Iterable<? extends E>>, Serializable { private final Funnel<E> elementFunnel; SequentialFunnel(Funnel<E> elementFunnel) { this.elementFunnel = Preconditions.checkNotNull(elementFunnel); }
/** * Returns a funnel that processes an {@code Iterable} by funneling its elements in iteration * order with the specified funnel. No separators are added between the elements. * * @since 15.0 */
Returns a funnel that processes an Iterable by funneling its elements in iteration order with the specified funnel. No separators are added between the elements
sequentialFunnel
{ "repo_name": "Allive1/pinpoint", "path": "thirdparty/google-guava/src/main/java/com/google/common/hash/Funnels.java", "license": "apache-2.0", "size": 7055 }
[ "com.google.common.base.Preconditions", "java.io.Serializable" ]
import com.google.common.base.Preconditions; import java.io.Serializable;
import com.google.common.base.*; import java.io.*;
[ "com.google.common", "java.io" ]
com.google.common; java.io;
2,047,383
default boolean skipTransform(List<List<Transmutation>> input) { return false; } /** * Async transformation * <p/> * <p/> {@link Transform}s are observed on the specified {@link Scheduler}
default boolean skipTransform(List<List<Transmutation>> input) { return false; } /** * Async transformation * <p/> * <p/> {@link Transform}s are observed on the specified {@link Scheduler}
/** * Override this method for any {@link Transform} that needs to not run when certain conditions are met * <p/> * <p/> This method analyzes the full dataset */
Override this method for any <code>Transform</code> that needs to not run when certain conditions are met This method analyzes the full dataset
skipTransform
{ "repo_name": "salesforce/pyplyn", "path": "plugin-api/src/main/java/com/salesforce/pyplyn/model/Transform.java", "license": "bsd-3-clause", "size": 2023 }
[ "io.reactivex.Scheduler", "java.util.List" ]
import io.reactivex.Scheduler; import java.util.List;
import io.reactivex.*; import java.util.*;
[ "io.reactivex", "java.util" ]
io.reactivex; java.util;
1,137,721
private void parseSentences(AnnotationSet annotationSet) throws ExecutionInterruptedException { List<Annotation> sentences = gate.Utils.inDocumentOrder(annotationSet.get(inputSentenceType)); int sentencesDone = 0; int nbrSentences = sentences.size(); for (Annotation sentence : sentences) { parseOneSentence(annotationSet, sentence, sentencesDone, nbrSentences); sentencesDone++; checkInterruption(); } sentencesDone++; fireProgressChanged(100 * sentencesDone / nbrSentences); }
void function(AnnotationSet annotationSet) throws ExecutionInterruptedException { List<Annotation> sentences = gate.Utils.inDocumentOrder(annotationSet.get(inputSentenceType)); int sentencesDone = 0; int nbrSentences = sentences.size(); for (Annotation sentence : sentences) { parseOneSentence(annotationSet, sentence, sentencesDone, nbrSentences); sentencesDone++; checkInterruption(); } sentencesDone++; fireProgressChanged(100 * sentencesDone / nbrSentences); }
/** * Find all the Sentence annotations and iterate through them, parsing one * sentence at a time and storing the result in the output AS. (Sentences are * scanned for Tokens. You have to run the ANNIE tokenizer and splitter before * this PR.) * @throws ExecutionInterruptedException */
Find all the Sentence annotations and iterate through them, parsing one sentence at a time and storing the result in the output AS. (Sentences are scanned for Tokens. You have to run the ANNIE tokenizer and splitter before this PR.)
parseSentences
{ "repo_name": "masterucm1617/botzzaroni", "path": "BotzzaroniDev/GATE_Developer_8.4/plugins/Stanford_CoreNLP/src/gate/stanford/Parser.java", "license": "gpl-3.0", "size": 26555 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,640,298
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { meta = (SingleThreaderMeta) smi; data = (SingleThreaderData) sdi; Object[] row = getRow(); if ( row == null ) { if ( data.batchCount > 0 ) { data.batchCount = 0; return execOneIteration(); } setOutputDone(); return false; } if ( first ) { first = false; data.startTime = System.currentTimeMillis(); } // Add the row to the producer... // data.rowProducer.putRow( getInputRowMeta(), row ); data.batchCount++; if ( getStepMeta().isDoingErrorHandling() ) { data.errorBuffer.add( row ); } boolean countWindow = data.batchSize > 0 && data.batchCount >= data.batchSize; boolean timeWindow = data.batchTime > 0 && ( System.currentTimeMillis() - data.startTime ) > data.batchTime; if ( countWindow || timeWindow ) { data.batchCount = 0; boolean more = execOneIteration(); if ( !more ) { setOutputDone(); return false; } data.startTime = System.currentTimeMillis(); } return true; }
boolean function( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { meta = (SingleThreaderMeta) smi; data = (SingleThreaderData) sdi; Object[] row = getRow(); if ( row == null ) { if ( data.batchCount > 0 ) { data.batchCount = 0; return execOneIteration(); } setOutputDone(); return false; } if ( first ) { first = false; data.startTime = System.currentTimeMillis(); } data.batchCount++; if ( getStepMeta().isDoingErrorHandling() ) { data.errorBuffer.add( row ); } boolean countWindow = data.batchSize > 0 && data.batchCount >= data.batchSize; boolean timeWindow = data.batchTime > 0 && ( System.currentTimeMillis() - data.startTime ) > data.batchTime; if ( countWindow timeWindow ) { data.batchCount = 0; boolean more = execOneIteration(); if ( !more ) { setOutputDone(); return false; } data.startTime = System.currentTimeMillis(); } return true; }
/** * Process rows in batches of N rows. The sub-transformation will execute in a single thread. */
Process rows in batches of N rows. The sub-transformation will execute in a single thread
processRow
{ "repo_name": "rfellows/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/steps/singlethreader/SingleThreader.java", "license": "apache-2.0", "size": 12945 }
[ "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.trans.step.StepDataInterface", "org.pentaho.di.trans.step.StepMetaInterface" ]
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepMetaInterface;
import org.pentaho.di.core.exception.*; import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,415,045
public boolean hasExtension(String elementName, String namespace) { if (elementName == null) { return hasExtension(namespace); } String key = XmppStringUtils.generateKey(elementName, namespace); synchronized (packetExtensions) { return packetExtensions.containsKey(key); } }
boolean function(String elementName, String namespace) { if (elementName == null) { return hasExtension(namespace); } String key = XmppStringUtils.generateKey(elementName, namespace); synchronized (packetExtensions) { return packetExtensions.containsKey(key); } }
/** * Check if a stanza(/packet) extension with the given element and namespace exists. * <p> * The argument <code>elementName</code> may be null. * </p> * * @param elementName * @param namespace * @return true if a stanza(/packet) extension exists, false otherwise. */
Check if a stanza(/packet) extension with the given element and namespace exists. The argument <code>elementName</code> may be null.
hasExtension
{ "repo_name": "vanitasvitae/smack-omemo", "path": "smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java", "license": "apache-2.0", "size": 17532 }
[ "org.jxmpp.util.XmppStringUtils" ]
import org.jxmpp.util.XmppStringUtils;
import org.jxmpp.util.*;
[ "org.jxmpp.util" ]
org.jxmpp.util;
845,882
public int getplaylistID() { return Dispatch.get(this, "playlistID").toInt(); }
int function() { return Dispatch.get(this, STR).toInt(); }
/** * Wrapper for calling the ActiveX-Method with input-parameter(s). * * @return the result is of type int */
Wrapper for calling the ActiveX-Method with input-parameter(s)
getplaylistID
{ "repo_name": "cpesch/MetaMusic", "path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITPlaylist.java", "license": "gpl-2.0", "size": 9268 }
[ "com.jacob.com.Dispatch" ]
import com.jacob.com.Dispatch;
import com.jacob.com.*;
[ "com.jacob.com" ]
com.jacob.com;
2,373,415
private static ArrowHeadEnumType.Enum convertArrowHead(String gpmlArrowHead) throws ConverterException { ArrowHeadEnumType.Enum mimArrowHead = null; BidiMap arrowHash = getGpmlToMimVisArrowHeadMap(); if (arrowHash.get(gpmlArrowHead) != null) { mimArrowHead = (ArrowHeadEnumType.Enum) arrowHash .get(gpmlArrowHead); } else { // Removed users should be using the Validator Plugin to avoid this // type of error. // mimArrowHead = ArrowHeadEnumType.LINE; ConverterException ce = new ConverterException( "Pathway contains an arrow not supported in MIM: " + gpmlArrowHead); Logger.log.info("Pathway contains an arrow not supported in MIM: " + gpmlArrowHead); throw ce; } return mimArrowHead; }
static ArrowHeadEnumType.Enum function(String gpmlArrowHead) throws ConverterException { ArrowHeadEnumType.Enum mimArrowHead = null; BidiMap arrowHash = getGpmlToMimVisArrowHeadMap(); if (arrowHash.get(gpmlArrowHead) != null) { mimArrowHead = (ArrowHeadEnumType.Enum) arrowHash .get(gpmlArrowHead); } else { ConverterException ce = new ConverterException( STR + gpmlArrowHead); Logger.log.info(STR + gpmlArrowHead); throw ce; } return mimArrowHead; }
/** * Convert arrow head. * * @param gpmlArrowHead * the GPML arrow head * @throws ConverterException * If the diagram is using non-MIM arrowheads * @return the MIM arrow head type */
Convert arrow head
convertArrowHead
{ "repo_name": "mkutmon/pv-mim-plugin", "path": "src/gov/nih/nci/lmp/mimGpml/ExporterHelper.java", "license": "apache-2.0", "size": 31428 }
[ "gov.nih.nci.lmp.mim.mimVisLevel1.ArrowHeadEnumType", "org.apache.commons.collections.BidiMap", "org.pathvisio.core.debug.Logger", "org.pathvisio.core.model.ConverterException" ]
import gov.nih.nci.lmp.mim.mimVisLevel1.ArrowHeadEnumType; import org.apache.commons.collections.BidiMap; import org.pathvisio.core.debug.Logger; import org.pathvisio.core.model.ConverterException;
import gov.nih.nci.lmp.mim.*; import org.apache.commons.collections.*; import org.pathvisio.core.debug.*; import org.pathvisio.core.model.*;
[ "gov.nih.nci", "org.apache.commons", "org.pathvisio.core" ]
gov.nih.nci; org.apache.commons; org.pathvisio.core;
2,453,502
@Override public Iterator<Tag> iterator() { return tags.values().iterator(); }
Iterator<Tag> function() { return tags.values().iterator(); }
/** * Returns an iterator over this compound tag. * * @return An iterator over this compound tag. */
Returns an iterator over this compound tag
iterator
{ "repo_name": "skunkiferous/SMEdit", "path": "jo_plugin/src/main/java/jo/sm/plugins/ship/imp/nbt/Tag.java", "license": "apache-2.0", "size": 53231 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,253,747
List<ClusterMember> getInactiveMembersWithStaleHeartbeat(Map params);
List<ClusterMember> getInactiveMembersWithStaleHeartbeat(Map params);
/** * Get all inactive members not being updating heartbeat for specified limit * * @param params Parameters for SQL query * @return List of inactive members */
Get all inactive members not being updating heartbeat for specified limit
getInactiveMembersWithStaleHeartbeat
{ "repo_name": "craftercms/studio", "path": "src/main/java/org/craftercms/studio/api/v2/dal/ClusterDAO.java", "license": "gpl-3.0", "size": 5211 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
706,190
protected void writeSocket(boolean commandEnd) throws IOException { if (pos > 4) { buf[0] = (byte) (pos - 4); buf[1] = (byte) ((pos - 4) >>> 8); buf[2] = (byte) ((pos - 4) >>> 16); buf[3] = this.sequence.incrementAndGet(); checkMaxAllowedLength(pos - 4); out.write(buf, 0, pos); cmdLength += pos - 4; if (logger.isTraceEnabled()) { if (permitTrace) { logger.trace( "send: {}\n{}", serverThreadLog, LoggerHelper.hex(buf, 0, pos, maxQuerySizeToLog)); } else { logger.trace("send: content length={} {} com=<hidden>", pos - 4, serverThreadLog); } } // if last com fill the max size, must send an empty com to indicate command end. if (commandEnd && pos == maxPacketLength) { writeEmptyPacket(); } pos = 4; } }
void function(boolean commandEnd) throws IOException { if (pos > 4) { buf[0] = (byte) (pos - 4); buf[1] = (byte) ((pos - 4) >>> 8); buf[2] = (byte) ((pos - 4) >>> 16); buf[3] = this.sequence.incrementAndGet(); checkMaxAllowedLength(pos - 4); out.write(buf, 0, pos); cmdLength += pos - 4; if (logger.isTraceEnabled()) { if (permitTrace) { logger.trace( STR, serverThreadLog, LoggerHelper.hex(buf, 0, pos, maxQuerySizeToLog)); } else { logger.trace(STR, pos - 4, serverThreadLog); } } if (commandEnd && pos == maxPacketLength) { writeEmptyPacket(); } pos = 4; } }
/** * Flush the internal buf. * * @param commandEnd command end * @throws IOException id connection error occur. */
Flush the internal buf
writeSocket
{ "repo_name": "MariaDB/mariadb-connector-j", "path": "src/main/java/org/mariadb/jdbc/client/socket/impl/PacketWriter.java", "license": "lgpl-2.1", "size": 24317 }
[ "java.io.IOException", "org.mariadb.jdbc.util.log.LoggerHelper" ]
import java.io.IOException; import org.mariadb.jdbc.util.log.LoggerHelper;
import java.io.*; import org.mariadb.jdbc.util.log.*;
[ "java.io", "org.mariadb.jdbc" ]
java.io; org.mariadb.jdbc;
395,991
public static char getc() { BufferedReader inp = new BufferedReader(new InputStreamReader(System.in)); if (lb_index >= lb_fill_degree) { if (lb_index != 0) { lb_index = 0; lb_fill_degree = 0; return ('\n'); } else { try { linebuf = inp.readLine(); lb_fill_degree = linebuf.length(); } catch(NumberFormatException e) { System.out.println("c was no Char, assigning '0'"); } catch(IOException e) { System.out.println("readChar: Input error"); System.exit(1); } } } if (linebuf.length() == 0) { return (char) (-1); } else { return(linebuf.charAt(lb_index++)); } }
static char function() { BufferedReader inp = new BufferedReader(new InputStreamReader(System.in)); if (lb_index >= lb_fill_degree) { if (lb_index != 0) { lb_index = 0; lb_fill_degree = 0; return ('\n'); } else { try { linebuf = inp.readLine(); lb_fill_degree = linebuf.length(); } catch(NumberFormatException e) { System.out.println(STR); } catch(IOException e) { System.out.println(STR); System.exit(1); } } } if (linebuf.length() == 0) { return (char) (-1); } else { return(linebuf.charAt(lb_index++)); } }
/** * Read a char from a buffered input line * ATTENTION: before calling any other method from this class, the * buffer should be emptied by getc to avoid unintended results * when getc is next called (Access of old buffer) * * getc() returns (char) (-1) when an empty line is read. */
Read a char from a buffered input line buffer should be emptied by getc to avoid unintended results when getc is next called (Access of old buffer) getc() returns (char) (-1) when an empty line is read
getc
{ "repo_name": "rumpelstilzchen/DDD", "path": "src/simpleIO/KbdInput.java", "license": "gpl-3.0", "size": 9437 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStreamReader" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;
import java.io.*;
[ "java.io" ]
java.io;
1,734,168
public void checkSkipReadForFixLengthPart(AbstractPagedInputView source) throws IOException { // skip if there is no enough size. // Note: Use currentSegmentLimit instead of segmentSize. int available = source.getCurrentSegmentLimit() - source.getCurrentPositionInSegment(); if (available < getSerializedRowFixedPartLength()) { source.advance(); } }
void function(AbstractPagedInputView source) throws IOException { int available = source.getCurrentSegmentLimit() - source.getCurrentPositionInSegment(); if (available < getSerializedRowFixedPartLength()) { source.advance(); } }
/** * We need skip bytes to read when the remain bytes of current segment is not * enough to write binary row fixed part. See {@link BinaryRowData}. */
We need skip bytes to read when the remain bytes of current segment is not enough to write binary row fixed part. See <code>BinaryRowData</code>
checkSkipReadForFixLengthPart
{ "repo_name": "tzulitai/flink", "path": "flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/typeutils/BinaryRowDataSerializer.java", "license": "apache-2.0", "size": 12813 }
[ "java.io.IOException", "org.apache.flink.runtime.memory.AbstractPagedInputView" ]
import java.io.IOException; import org.apache.flink.runtime.memory.AbstractPagedInputView;
import java.io.*; import org.apache.flink.runtime.memory.*;
[ "java.io", "org.apache.flink" ]
java.io; org.apache.flink;
795,379
public static Offset<Long> within(Long value) { return Offset.offset(value); }
static Offset<Long> function(Long value) { return Offset.offset(value); }
/** * Assertions entry point for Long {@link Offset} to use with isCloseTo assertions. * <p/> * Typical usage : * * <pre><code class='java'> assertThat(5l).isCloseTo(7l, within(2l));</code></pre> */
Assertions entry point for Long <code>Offset</code> to use with isCloseTo assertions. Typical usage : <code> assertThat(5l).isCloseTo(7l, within(2l));</code></code>
within
{ "repo_name": "michal-lipski/assertj-core", "path": "src/main/java/org/assertj/core/api/AssertionsForClassTypes.java", "license": "apache-2.0", "size": 55611 }
[ "org.assertj.core.data.Offset" ]
import org.assertj.core.data.Offset;
import org.assertj.core.data.*;
[ "org.assertj.core" ]
org.assertj.core;
1,163,350
public CreateIndexRequestBuilder prepareCreate(String index, Settings.Builder settingsBuilder) { return prepareCreate(index, -1, settingsBuilder); }
CreateIndexRequestBuilder function(String index, Settings.Builder settingsBuilder) { return prepareCreate(index, -1, settingsBuilder); }
/** * Creates a new {@link CreateIndexRequestBuilder} with the settings obtained from {@link #indexSettings()}, augmented * by the given builder */
Creates a new <code>CreateIndexRequestBuilder</code> with the settings obtained from <code>#indexSettings()</code>, augmented by the given builder
prepareCreate
{ "repo_name": "Stacey-Gammon/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java", "license": "apache-2.0", "size": 103107 }
[ "org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder", "org.elasticsearch.common.settings.Settings" ]
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.action.admin.indices.create.*; import org.elasticsearch.common.settings.*;
[ "org.elasticsearch.action", "org.elasticsearch.common" ]
org.elasticsearch.action; org.elasticsearch.common;
1,406,938
public void checkCompatibleEdition(TFile war, ModuleDetails installingModuleDetails);
void function(TFile war, ModuleDetails installingModuleDetails);
/** * This checks to see if the module that is being installed is compatible with the war. * If not module edition is specfied then it will just return. However, if an edition is specified and it doesn't match * then an error is thrown. * @param war a valid war file or exploded directory from a war * @param installingModuleDetails */
This checks to see if the module that is being installed is compatible with the war. If not module edition is specfied then it will just return. However, if an edition is specified and it doesn't match then an error is thrown
checkCompatibleEdition
{ "repo_name": "daniel-he/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/module/tool/WarHelper.java", "license": "lgpl-3.0", "size": 2965 }
[ "de.schlichtherle.truezip.file.TFile", "org.alfresco.service.cmr.module.ModuleDetails" ]
import de.schlichtherle.truezip.file.TFile; import org.alfresco.service.cmr.module.ModuleDetails;
import de.schlichtherle.truezip.file.*; import org.alfresco.service.cmr.module.*;
[ "de.schlichtherle.truezip", "org.alfresco.service" ]
de.schlichtherle.truezip; org.alfresco.service;
443,899
if (closed) { throw new IOException("Stream closed"); } } public OpenJDK7InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); if (in == null || inf == null) { throw new NullPointerException(); } else if (size <= 0) { throw new IllegalArgumentException("buffer size <= 0"); } this.inf = inf; buf = new byte[size]; } public OpenJDK7InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 512); } protected boolean usesDefaultInflater = false; public OpenJDK7InflaterInputStream(InputStream in) { this(in, new Inflater()); usesDefaultInflater = true; } private byte[] singleByteBuf = new byte[1];
if (closed) { throw new IOException(STR); } } public OpenJDK7InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); if (in == null inf == null) { throw new NullPointerException(); } else if (size <= 0) { throw new IllegalArgumentException(STR); } this.inf = inf; buf = new byte[size]; } public OpenJDK7InflaterInputStream(InputStream in, Inflater inf) { this(in, inf, 512); } protected boolean usesDefaultInflater = false; public OpenJDK7InflaterInputStream(InputStream in) { this(in, new Inflater()); usesDefaultInflater = true; } private byte[] singleByteBuf = new byte[1];
/** * Check to make sure that this stream has not been closed */
Check to make sure that this stream has not been closed
ensureOpen
{ "repo_name": "iipc/webarchive-commons", "path": "src/main/java/org/archive/util/zip/OpenJDK7InflaterInputStream.java", "license": "apache-2.0", "size": 10120 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
344,666
public ServiceCall<Void> responseDoubleAsync(String scenario, final ServiceCallback<Void> serviceCallback) { return ServiceCall.createWithHeaders(responseDoubleWithServiceResponseAsync(scenario), serviceCallback); }
ServiceCall<Void> function(String scenario, final ServiceCallback<Void> serviceCallback) { return ServiceCall.createWithHeaders(responseDoubleWithServiceResponseAsync(scenario), serviceCallback); }
/** * Get a response with header value "value": 7e120 or -3.0. * * @param scenario Send a post request with header values "scenario": "positive" or "negative" * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */
Get a response with header value "value": 7e120 or -3.0
responseDoubleAsync
{ "repo_name": "yugangw-msft/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/implementation/HeadersImpl.java", "license": "mit", "size": 118072 }
[ "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
397,212
@Test public void testProximityEnabled() { assertFalse(Settings.isProximityEnabled()); Settings.setProximityEnabled(true); assertTrue(Settings.isProximityEnabled()); }
void function() { assertFalse(Settings.isProximityEnabled()); Settings.setProximityEnabled(true); assertTrue(Settings.isProximityEnabled()); }
/** * This method test if changing the default proximityEnabled value in Settings works * * @throws IOException * @throws XmlPullParserException */
This method test if changing the default proximityEnabled value in Settings works
testProximityEnabled
{ "repo_name": "onaio/OpenMapKit", "path": "app/src/androidTest/java/org/redcross/openmapkit/SettingsTest.java", "license": "bsd-3-clause", "size": 6657 }
[ "junit.framework.Assert" ]
import junit.framework.Assert;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
362,929
public void sendSummaryMail( final MailMessage mailMessage, final UUID project, final int releaseId) { final UUID locationId = UUID.fromString("224e92b2-8d13-4c14-b120-13d877c516f8"); //$NON-NLS-1$ final ApiResourceVersion apiVersion = new ApiResourceVersion("3.1-preview.1"); //$NON-NLS-1$ final Map<String, Object> routeValues = new HashMap<String, Object>(); routeValues.put("project", project); //$NON-NLS-1$ routeValues.put("releaseId", releaseId); //$NON-NLS-1$ final VssRestRequest httpRequest = super.createRequest(HttpMethod.POST, locationId, routeValues, apiVersion, mailMessage, VssMediaTypes.APPLICATION_JSON_TYPE, VssMediaTypes.APPLICATION_JSON_TYPE); super.sendRequest(httpRequest); }
void function( final MailMessage mailMessage, final UUID project, final int releaseId) { final UUID locationId = UUID.fromString(STR); final ApiResourceVersion apiVersion = new ApiResourceVersion(STR); final Map<String, Object> routeValues = new HashMap<String, Object>(); routeValues.put(STR, project); routeValues.put(STR, releaseId); final VssRestRequest httpRequest = super.createRequest(HttpMethod.POST, locationId, routeValues, apiVersion, mailMessage, VssMediaTypes.APPLICATION_JSON_TYPE, VssMediaTypes.APPLICATION_JSON_TYPE); super.sendRequest(httpRequest); }
/** * [Preview API 3.1-preview.1] * * @param mailMessage * * @param project * Project ID * @param releaseId * */
[Preview API 3.1-preview.1]
sendSummaryMail
{ "repo_name": "Microsoft/vso-httpclient-java", "path": "Rest/alm-releasemanagement-client/src/main/generated/com/microsoft/alm/visualstudio/services/releasemanagement/webapi/ReleaseHttpClientBase.java", "license": "mit", "size": 186198 }
[ "com.microsoft.alm.client.HttpMethod", "com.microsoft.alm.client.VssMediaTypes", "com.microsoft.alm.client.VssRestRequest", "com.microsoft.alm.visualstudio.services.releasemanagement.webapi.MailMessage", "com.microsoft.alm.visualstudio.services.webapi.ApiResourceVersion", "java.util.HashMap", "java.util...
import com.microsoft.alm.client.HttpMethod; import com.microsoft.alm.client.VssMediaTypes; import com.microsoft.alm.client.VssRestRequest; import com.microsoft.alm.visualstudio.services.releasemanagement.webapi.MailMessage; import com.microsoft.alm.visualstudio.services.webapi.ApiResourceVersion; import java.util.HashMap; import java.util.Map; import java.util.UUID;
import com.microsoft.alm.client.*; import com.microsoft.alm.visualstudio.services.releasemanagement.webapi.*; import com.microsoft.alm.visualstudio.services.webapi.*; import java.util.*;
[ "com.microsoft.alm", "java.util" ]
com.microsoft.alm; java.util;
321,894
public void close() { synchronized (loadingTables_) { if (loadingTables_.get(tblName_) == tblTask_) loadingTables_.remove(tblName_); } } } private static final Logger LOG = Logger.getLogger(TableLoadingMgr.class); // A thread safe blocking deque that is used to prioritize the loading of table // metadata. The CatalogServer has a background thread that will always add unloaded // tables to the tail of the deque. However, a call to prioritizeLoad() will add // tables to the head of the deque. The next table to load is always taken from the // head of the deque. May contain the same table multiple times, but a second // attempt to load the table metadata will be a no-op. private final LinkedBlockingDeque<TTableName> tableLoadingDeque_ = new LinkedBlockingDeque<TTableName>(); // A thread safe HashSet of table names that are in the tableLoadingDeque_. Used to // efficiently check for existence of items in the deque. // Updates may lead/lag updates to the tableLoadingDeque_ - they are added to this set // immediately before being added to the deque and removed immediately after removing // from the deque. The fact the updates are not synchronized shouldn't impact // functionality since this set is only used for efficient lookups. private final Set<TTableName> tableLoadingSet_ = Collections.synchronizedSet(new HashSet<TTableName>()); // Map of table name to a FutureTask associated with the table load. Used to // prevent duplicate loads of the same table. private final ConcurrentHashMap<TTableName, FutureTask<Table>> loadingTables_ = new ConcurrentHashMap<TTableName, FutureTask<Table>>(); // Map of table name to the cache directives that are being waited on for that table. // Once all directives have completed, the table's metadata will be refreshed and // the table will be removed from this map. // A caching operation may take a long time to complete, so to maximize query // throughput it is preferable to allow the user to continue to run queries against // the table while a cache request completes in the background. private final Map<TTableName, List<Long>> pendingTableCacheDirs_ = Maps.newHashMap(); // The number of parallel threads to use to load table metadata. Should be set to a // value that provides good throughput while not putting too much stress on the // metastore. private final int numLoadingThreads_; // Pool of numLoadingThreads_ threads that loads table metadata. If additional tasks // are submitted to the pool after it is full, they will be queued and executed when // the next thread becomes available. There is no hard upper limit on the number of // pending tasks (no work will be rejected, but memory consumption is unbounded). private final ExecutorService tblLoadingPool_; // Thread that incrementally refreshes tables in the background. Used to update a // table's metadata after a long running operation completes, such as marking a // table as cached. There is no hard upper limit on the number of pending tasks // (no work will be rejected, but memory consumption is unbounded). If this thread // dies it will be automatically restarted. // The tables to process are read from the resfreshThreadWork_ queue. ExecutorService asyncRefreshThread_ = Executors.newSingleThreadExecutor(); // Tables for the async refresh thread to process. Synchronization must be handled // externally. private final LinkedBlockingQueue<TTableName> refreshThreadWork_ = new LinkedBlockingQueue<TTableName>(); private final CatalogServiceCatalog catalog_; private final TableLoader tblLoader_; public TableLoadingMgr(CatalogServiceCatalog catalog, int numLoadingThreads) { catalog_ = catalog; tblLoader_ = new TableLoader(catalog_); numLoadingThreads_ = numLoadingThreads; tblLoadingPool_ = Executors.newFixedThreadPool(numLoadingThreads_); // Start the background table loading threads. startTableLoadingThreads();
void function() { synchronized (loadingTables_) { if (loadingTables_.get(tblName_) == tblTask_) loadingTables_.remove(tblName_); } } } private static final Logger LOG = Logger.getLogger(TableLoadingMgr.class); private final LinkedBlockingDeque<TTableName> tableLoadingDeque_ = new LinkedBlockingDeque<TTableName>(); private final Set<TTableName> tableLoadingSet_ = Collections.synchronizedSet(new HashSet<TTableName>()); private final ConcurrentHashMap<TTableName, FutureTask<Table>> loadingTables_ = new ConcurrentHashMap<TTableName, FutureTask<Table>>(); private final Map<TTableName, List<Long>> pendingTableCacheDirs_ = Maps.newHashMap(); private final int numLoadingThreads_; private final ExecutorService tblLoadingPool_; ExecutorService asyncRefreshThread_ = Executors.newSingleThreadExecutor(); private final LinkedBlockingQueue<TTableName> refreshThreadWork_ = new LinkedBlockingQueue<TTableName>(); private final CatalogServiceCatalog catalog_; private final TableLoader tblLoader_; public TableLoadingMgr(CatalogServiceCatalog catalog, int numLoadingThreads) { catalog_ = catalog; tblLoader_ = new TableLoader(catalog_); numLoadingThreads_ = numLoadingThreads; tblLoadingPool_ = Executors.newFixedThreadPool(numLoadingThreads_); startTableLoadingThreads();
/** * Cleans up the in-flight load request matching the given table name. Will not * cancel the load if it is still in progress, frees a slot should another * load for the same table come in. Can be called multiple times. */
Cleans up the in-flight load request matching the given table name. Will not cancel the load if it is still in progress, frees a slot should another load for the same table come in. Can be called multiple times
close
{ "repo_name": "ImpalaToGo/ImpalaToGo", "path": "fe/src/main/java/com/cloudera/impala/catalog/TableLoadingMgr.java", "license": "apache-2.0", "size": 14475 }
[ "com.cloudera.impala.thrift.TTableName", "com.google.common.collect.Maps", "java.util.Collections", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "java.util.concurrent.ConcurrentHashMap", "java.util.concurrent.ExecutorService", "java.util.concurrent.Executors", "java.u...
import com.cloudera.impala.thrift.TTableName; import com.google.common.collect.Maps; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.FutureTask; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.LinkedBlockingQueue; import org.apache.log4j.Logger;
import com.cloudera.impala.thrift.*; import com.google.common.collect.*; import java.util.*; import java.util.concurrent.*; import org.apache.log4j.*;
[ "com.cloudera.impala", "com.google.common", "java.util", "org.apache.log4j" ]
com.cloudera.impala; com.google.common; java.util; org.apache.log4j;
593,513
double programDoesNotEnd() throws IllegalStateException, IOException;
double programDoesNotEnd() throws IllegalStateException, IOException;
/** * May be invoked during <code>JuniperProgram.run(...)</code> method * implementation if the sensors data need to be reported before a monitored * program ends (before a final call of <code>programEnds()</code> method). * * @return a duration of this method in seconds (an overhead of the method * to be subtracted from surrounding measurements) * @throws IllegalStateException if the method is invoked before * <code>*Starts()</code> method * @throws IOException if there is an HTTP error when connecting or sending * to the monitoring service */
May be invoked during <code>JuniperProgram.run(...)</code> method implementation if the sensors data need to be reported before a monitored program ends (before a final call of <code>programEnds()</code> method)
programDoesNotEnd
{ "repo_name": "juniper-project/sched-advisor", "path": "sched-advisor-monitoring-agent/src/main/java/eu/juniper/sa/monitoring/sensor/ProgramInstanceSensorInterface.java", "license": "bsd-3-clause", "size": 3770 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,210,182
org.hl7.rim.Act getSource(); void setSource(org.hl7.rim.Act source);
org.hl7.rim.Act getSource(); void setSource(org.hl7.rim.Act source);
/** Sets the property source. @see #getSource */
Sets the property source
setSource
{ "repo_name": "markusgumbel/dshl7", "path": "hl7-javasig/gencode/org/hl7/rim/ActRelationship.java", "license": "apache-2.0", "size": 26117 }
[ "org.hl7.rim.Act" ]
import org.hl7.rim.Act;
import org.hl7.rim.*;
[ "org.hl7.rim" ]
org.hl7.rim;
1,711,766
public int truncate(WALPointer low, WALPointer high);
int function(WALPointer low, WALPointer high);
/** * Gives a hint to WAL manager to clear entries logged before the given pointer. Some entries before the * the given pointer will be kept because there is a configurable WAL history size. Those entries may be used * for partial partition rebalancing. * * @param low Pointer since which WAL will be truncated. If null, WAL will be truncated from the oldest segment. * @param high Pointer for which it is safe to clear the log. * @return Number of deleted WAL segments. */
Gives a hint to WAL manager to clear entries logged before the given pointer. Some entries before the the given pointer will be kept because there is a configurable WAL history size. Those entries may be used for partial partition rebalancing
truncate
{ "repo_name": "nizhikov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/IgniteWriteAheadLogManager.java", "license": "apache-2.0", "size": 9066 }
[ "org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer" ]
import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer;
import org.apache.ignite.internal.processors.cache.persistence.wal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
106,222
Actor getActor(String actorId, String opaque);
Actor getActor(String actorId, String opaque);
/** * Get actor. * * @param actorId Actor id as in {@link Actor#getActorId()}. * @param opaque Service implementation specific value associated with the * actor, or {@code null} if not used (see {@link Actor#getOpaque()}). * * @return The actor, or {@code null} if not found. */
Get actor
getActor
{ "repo_name": "boylesoftware/thymes2", "path": "src/main/java/org/bsworks/x2/services/auth/ActorAuthenticationService.java", "license": "apache-2.0", "size": 688 }
[ "org.bsworks.x2.Actor" ]
import org.bsworks.x2.Actor;
import org.bsworks.x2.*;
[ "org.bsworks.x2" ]
org.bsworks.x2;
808,185
public void setScissor(@IntRange(from = 0) int left, @IntRange(from = 0) int bottom, @IntRange(from = 0) int width, @IntRange(from = 0) int height) { nSetScissor(getNativeObject(), left, bottom, width, height); }
void function(@IntRange(from = 0) int left, @IntRange(from = 0) int bottom, @IntRange(from = 0) int width, @IntRange(from = 0) int height) { nSetScissor(getNativeObject(), left, bottom, width, height); }
/** * Set up a custom scissor rectangle; by default this encompasses the View. * * @param left left coordinate of the scissor box * @param bottom bottom coordinate of the scissor box * @param width width of the scissor box * @param height height of the scissor box */
Set up a custom scissor rectangle; by default this encompasses the View
setScissor
{ "repo_name": "google/filament", "path": "android/filament-android/src/main/java/com/google/android/filament/MaterialInstance.java", "license": "apache-2.0", "size": 22777 }
[ "androidx.annotation.IntRange" ]
import androidx.annotation.IntRange;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
2,490,000
public boolean verifyByPolling(long timeout, long period) { try { long start = System.currentTimeMillis(); boolean success; do { success = verifyState(); if (success) { return true; } TimeUnit.MILLISECONDS.sleep(period); } while ((System.currentTimeMillis() - start) <= timeout); } catch (Exception e) { LOG.error("Exception in verifier", e); } return false; }
boolean function(long timeout, long period) { try { long start = System.currentTimeMillis(); boolean success; do { success = verifyState(); if (success) { return true; } TimeUnit.MILLISECONDS.sleep(period); } while ((System.currentTimeMillis() - start) <= timeout); } catch (Exception e) { LOG.error(STR, e); } return false; }
/** * Verify the cluster by periodically polling the cluster status and verify. * The method will be blocked at most {@code timeout}. * Return true if the verify succeed, otherwise return false. * @param timeout * @param period polling interval * @return */
Verify the cluster by periodically polling the cluster status and verify. The method will be blocked at most timeout. Return true if the verify succeed, otherwise return false
verifyByPolling
{ "repo_name": "lei-xia/helix", "path": "helix-core/src/main/java/org/apache/helix/tools/ClusterVerifiers/ZkHelixClusterVerifier.java", "license": "apache-2.0", "size": 14264 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,894,586
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtils.writePaint(this.paint, stream); SerialUtils.writePaint(this.backgroundPaint, stream); SerialUtils.writePaint(this.outlinePaint, stream); SerialUtils.writeStroke(this.outlineStroke, stream); }
void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtils.writePaint(this.paint, stream); SerialUtils.writePaint(this.backgroundPaint, stream); SerialUtils.writePaint(this.outlinePaint, stream); SerialUtils.writeStroke(this.outlineStroke, stream); }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */
Provides serialization support
writeObject
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/chart/annotations/XYTextAnnotation.java", "license": "lgpl-2.1", "size": 20796 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "org.jfree.chart.util.SerialUtils" ]
import java.io.IOException; import java.io.ObjectOutputStream; import org.jfree.chart.util.SerialUtils;
import java.io.*; import org.jfree.chart.util.*;
[ "java.io", "org.jfree.chart" ]
java.io; org.jfree.chart;
683,677
public Pair<Integer, Integer> getPlotSize(int maxWidth, int maxHeight, IContext context) { int x = maxWidth, y = maxHeight; IExtent extent = context.getSpace(); if (extent instanceof GridExtent) { int dx = ((GridExtent) extent).getXCells(); int dy = ((GridExtent) extent).getYCells(); double image_aspect_ratio = (double)dx / (double)dy; // largest side of image must fit within corresponding side of viewport if (dx > dy) { x = maxWidth; y = (int)(((double)x) / image_aspect_ratio); if (y > maxHeight) { // reduce further double fc = (double)maxHeight/(double)y; x = (int)((double)x*fc); y = (int)((double)y*fc); } } else { y = maxHeight; x = (int)(((double)y) * image_aspect_ratio); if (x > maxWidth) { // reduce further double fc = (double)maxWidth/(double)x; x = (int)((double)x*fc); y = (int)((double)y*fc); } } } return new Pair<Integer, Integer>(x, y); }
Pair<Integer, Integer> function(int maxWidth, int maxHeight, IContext context) { int x = maxWidth, y = maxHeight; IExtent extent = context.getSpace(); if (extent instanceof GridExtent) { int dx = ((GridExtent) extent).getXCells(); int dy = ((GridExtent) extent).getYCells(); double image_aspect_ratio = (double)dx / (double)dy; if (dx > dy) { x = maxWidth; y = (int)(((double)x) / image_aspect_ratio); if (y > maxHeight) { double fc = (double)maxHeight/(double)y; x = (int)((double)x*fc); y = (int)((double)y*fc); } } else { y = maxHeight; x = (int)(((double)y) * image_aspect_ratio); if (x > maxWidth) { double fc = (double)maxWidth/(double)x; x = (int)((double)x*fc); y = (int)((double)y*fc); } } } return new Pair<Integer, Integer>(x, y); }
/** * Define the plot size for the given state, context and plot type, ensuring * that the resulting plot fits maximally within the given viewport. * * @param maxWidth * @param maxHeight * @param state * @param context * @return */
Define the plot size for the given state, context and plot type, ensuring that the resulting plot fits maximally within the given viewport
getPlotSize
{ "repo_name": "Dana-Kath/thinklab", "path": "plugins/org.integratedmodelling.thinklab.modelling/src/org/integratedmodelling/modelling/visualization/VisualizationFactory.java", "license": "gpl-3.0", "size": 24505 }
[ "org.integratedmodelling.corescience.interfaces.IContext", "org.integratedmodelling.corescience.interfaces.IExtent", "org.integratedmodelling.geospace.extents.GridExtent", "org.integratedmodelling.utils.Pair" ]
import org.integratedmodelling.corescience.interfaces.IContext; import org.integratedmodelling.corescience.interfaces.IExtent; import org.integratedmodelling.geospace.extents.GridExtent; import org.integratedmodelling.utils.Pair;
import org.integratedmodelling.corescience.interfaces.*; import org.integratedmodelling.geospace.extents.*; import org.integratedmodelling.utils.*;
[ "org.integratedmodelling.corescience", "org.integratedmodelling.geospace", "org.integratedmodelling.utils" ]
org.integratedmodelling.corescience; org.integratedmodelling.geospace; org.integratedmodelling.utils;
1,319,022
public void registerDocumentSource(Class<? extends DocumentSource> documentSourceClass) { this.documentSourceClass = documentSourceClass; }
void function(Class<? extends DocumentSource> documentSourceClass) { this.documentSourceClass = documentSourceClass; }
/** * Sets the class used by CSSBox for obtaining documents based on their URLs. * @param documentSourceClass the new document source class */
Sets the class used by CSSBox for obtaining documents based on their URLs
registerDocumentSource
{ "repo_name": "bonashen/CSSBox", "path": "src/main/java/org/fit/cssbox/layout/BrowserConfig.java", "license": "lgpl-3.0", "size": 7390 }
[ "org.fit.cssbox.io.DocumentSource" ]
import org.fit.cssbox.io.DocumentSource;
import org.fit.cssbox.io.*;
[ "org.fit.cssbox" ]
org.fit.cssbox;
1,678,583
void setRating(final Plot plot, final UUID rater, final int value);
void setRating(final Plot plot, final UUID rater, final int value);
/** * Set a rating for a plot * @param plot * @param rater * @param value */
Set a rating for a plot
setRating
{ "repo_name": "SilverCory/PlotSquared", "path": "Core/src/main/java/com/intellectualcrafters/plot/database/AbstractDB.java", "license": "gpl-3.0", "size": 10403 }
[ "com.intellectualcrafters.plot.object.Plot" ]
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.*;
[ "com.intellectualcrafters.plot" ]
com.intellectualcrafters.plot;
1,313,435
private void assertStringIsOrIsNotFound(boolean expected, String searchIn, String searchForRegex, String failureMsg, int... flags) { Pattern p; if (flags != null && flags.length > 0) { // OR all flags together into a single int value int ordFlags = 0; for (int i = 0; i < flags.length; i++) { ordFlags = ordFlags | flags[i]; } p = Pattern.compile(searchForRegex, ordFlags); } else { p = Pattern.compile(searchForRegex); } Matcher m = p.matcher(searchIn); if (expected) { assertTrue(failureMsg + " Did not find pattern [" + searchForRegex + "] in provided string [" + searchIn + "]", m.find()); } else { assertFalse(failureMsg + " Found pattern [" + searchForRegex + "] in provided string [" + searchIn + "] but should not have.", m.find()); } }
void function(boolean expected, String searchIn, String searchForRegex, String failureMsg, int... flags) { Pattern p; if (flags != null && flags.length > 0) { int ordFlags = 0; for (int i = 0; i < flags.length; i++) { ordFlags = ordFlags flags[i]; } p = Pattern.compile(searchForRegex, ordFlags); } else { p = Pattern.compile(searchForRegex); } Matcher m = p.matcher(searchIn); if (expected) { assertTrue(failureMsg + STR + searchForRegex + STR + searchIn + "]", m.find()); } else { assertFalse(failureMsg + STR + searchForRegex + STR + searchIn + STR, m.find()); } }
/** * Looks for the provided regex within the provided string. If the regex isn't found, the provided failure message is included * in the failed assertion. Any flags that are provided should be flags provided by the {@code java.util.regex.Pattern} class * to use in compiling the regex. * * @param expected * If true, the regex is expected to be found. Otherwise the regex is not expected to be found. * @param searchIn * @param searchForRegex * @param failureMsg * @param flags */
Looks for the provided regex within the provided string. If the regex isn't found, the provided failure message is included in the failed assertion. Any flags that are provided should be flags provided by the java.util.regex.Pattern class to use in compiling the regex
assertStringIsOrIsNotFound
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.security.social/test/com/ibm/ws/security/social/web/SelectionPageGeneratorTest.java", "license": "epl-1.0", "size": 68661 }
[ "java.util.regex.Matcher", "java.util.regex.Pattern", "org.junit.Assert" ]
import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Assert;
import java.util.regex.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
1,519,302
@SuppressWarnings("unused") public static Marshaller createMarshaller() throws JAXBException { return createMarshaller(null, true, null); }
@SuppressWarnings(STR) static Marshaller function() throws JAXBException { return createMarshaller(null, true, null); }
/** * Creates a {@link Marshaller} to write JAXB objects into XML. * * @return created marshaller * @throws JAXBException if a problem with JAXB occurred */
Creates a <code>Marshaller</code> to write JAXB objects into XML
createMarshaller
{ "repo_name": "OpenEstate/OpenEstate-IO", "path": "Kyero/src/main/java/org/openestate/io/kyero/KyeroUtils.java", "license": "apache-2.0", "size": 21471 }
[ "javax.xml.bind.JAXBException", "javax.xml.bind.Marshaller" ]
import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller;
import javax.xml.bind.*;
[ "javax.xml" ]
javax.xml;
1,792,658
public void addAll(Collection<T> items){ outstandingCount.addAndGet(items.size()); queue.addAll(items); }
void function(Collection<T> items){ outstandingCount.addAndGet(items.size()); queue.addAll(items); }
/** * Add several items to the queue, increasing the work count. * */
Add several items to the queue, increasing the work count
addAll
{ "repo_name": "HitTheSticks/alamode", "path": "src/com/htssoft/alamode/threading/FinishableQueue.java", "license": "bsd-2-clause", "size": 2135 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
474,518
@Nonnull public SocialIdentityProviderRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) { return buildRequest(getOptions(requestOptions)); }
SocialIdentityProviderRequest function(@Nullable final com.microsoft.graph.options.Option... requestOptions) { return buildRequest(getOptions(requestOptions)); }
/** * Creates the request * * @param requestOptions the options for this request * @return the SocialIdentityProviderRequest instance */
Creates the request
buildRequest
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/SocialIdentityProviderRequestBuilder.java", "license": "mit", "size": 2445 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,107,675
@ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<IoTSecurityAggregatedRecommendationInner> listAsync( String resourceGroupName, String solutionName) { final Integer top = null; return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, solutionName, top), nextLink -> listNextSinglePageAsync(nextLink)); }
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<IoTSecurityAggregatedRecommendationInner> function( String resourceGroupName, String solutionName) { final Integer top = null; return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, solutionName, top), nextLink -> listNextSinglePageAsync(nextLink)); }
/** * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param solutionName The name of the IoT Security solution. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of IoT Security solution aggregated recommendations. */
Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution
listAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java", "license": "mit", "size": 29503 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedFlux", "com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.security.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,436,614
public void setBasicAuth(String username, String password, AuthScope scope, boolean preemtive) { UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password); setCredentials(scope, credentials); setAuthenticationPreemptive(preemtive); }
void function(String username, String password, AuthScope scope, boolean preemtive) { UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password); setCredentials(scope, credentials); setAuthenticationPreemptive(preemtive); }
/** * Sets basic authentication for the request. You should pass in your AuthScope for security. It * should be like this setBasicAuth("username","password", new AuthScope("host",port,AuthScope.ANY_REALM)) * * @param username Basic Auth username * @param password Basic Auth password * @param scope an AuthScope object * @param preemtive sets authorization in preemtive manner */
Sets basic authentication for the request. You should pass in your AuthScope for security. It should be like this setBasicAuth("username","password", new AuthScope("host",port,AuthScope.ANY_REALM))
setBasicAuth
{ "repo_name": "JuMiGe/CopyOfNetEase", "path": "libs/AyncHttpClinet/src/main/java/com/loopj/android/http/AsyncHttpClient.java", "license": "lgpl-3.0", "size": 67757 }
[ "org.apache.http.auth.AuthScope", "org.apache.http.auth.UsernamePasswordCredentials" ]
import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.auth.*;
[ "org.apache.http" ]
org.apache.http;
1,756,001
public String toString(TBase<?, ?> base) throws TException { return toString(base, UTF8); }
String function(TBase<?, ?> base) throws TException { return toString(base, UTF8); }
/** * Serialize the Thrift object into a Java string, using the UTF8 * charset encoding. * * @param base The object to serialize * @return Serialized object as a String */
Serialize the Thrift object into a Java string, using the UTF8 charset encoding
toString
{ "repo_name": "carpedm20/pinpoint", "path": "thrift/src/main/java/com/navercorp/pinpoint/thrift/io/HeaderTBaseSerializer.java", "license": "apache-2.0", "size": 3514 }
[ "org.apache.thrift.TBase", "org.apache.thrift.TException" ]
import org.apache.thrift.TBase; import org.apache.thrift.TException;
import org.apache.thrift.*;
[ "org.apache.thrift" ]
org.apache.thrift;
2,653,906
@SuppressWarnings("null") @SuppressFBWarnings("NP_NONNULL_RETURN_VIOLATION") private @NotNull IntegratorMode getIntegratorMode(ValueMap properties) { IntegratorMode mode = null; Collection<IntegratorMode> integratorModes = urlHandlerConfig.getIntegratorModes(); String modeString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_MODE, String.class); if (StringUtils.isNotEmpty(modeString)) { for (IntegratorMode candidate : integratorModes) { if (StringUtils.equals(modeString, candidate.getId())) { mode = candidate; break; } } } // fallback to first mode defined in configuration if (mode == null && !integratorModes.isEmpty()) { mode = integratorModes.iterator().next(); } return mode; }
@SuppressWarnings("null") @SuppressFBWarnings(STR) @NotNull IntegratorMode function(ValueMap properties) { IntegratorMode mode = null; Collection<IntegratorMode> integratorModes = urlHandlerConfig.getIntegratorModes(); String modeString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_MODE, String.class); if (StringUtils.isNotEmpty(modeString)) { for (IntegratorMode candidate : integratorModes) { if (StringUtils.equals(modeString, candidate.getId())) { mode = candidate; break; } } } if (mode == null && !integratorModes.isEmpty()) { mode = integratorModes.iterator().next(); } return mode; }
/** * Read integrator mode from content container. Defaults to first integrator mode defined. * @param properties Content container * @return Integrator mode */
Read integrator mode from content container. Defaults to first integrator mode defined
getIntegratorMode
{ "repo_name": "cnagel/wcm-io-handler", "path": "url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java", "license": "apache-2.0", "size": 7618 }
[ "edu.umd.cs.findbugs.annotations.SuppressFBWarnings", "io.wcm.handler.url.integrator.IntegratorMode", "io.wcm.handler.url.integrator.IntegratorNameConstants", "java.util.Collection", "org.apache.commons.lang3.StringUtils", "org.apache.sling.api.resource.ValueMap", "org.jetbrains.annotations.NotNull" ]
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.wcm.handler.url.integrator.IntegratorMode; import io.wcm.handler.url.integrator.IntegratorNameConstants; import java.util.Collection; import org.apache.commons.lang3.StringUtils; import org.apache.sling.api.resource.ValueMap; import org.jetbrains.annotations.NotNull;
import edu.umd.cs.findbugs.annotations.*; import io.wcm.handler.url.integrator.*; import java.util.*; import org.apache.commons.lang3.*; import org.apache.sling.api.resource.*; import org.jetbrains.annotations.*;
[ "edu.umd.cs", "io.wcm.handler", "java.util", "org.apache.commons", "org.apache.sling", "org.jetbrains.annotations" ]
edu.umd.cs; io.wcm.handler; java.util; org.apache.commons; org.apache.sling; org.jetbrains.annotations;
317,919
private void warnAboutNamespaceAliasing(Name nameObj, Ref ref) { compiler.report( JSError.make(ref.node, UNSAFE_NAMESPACE_WARNING, nameObj.getFullName())); }
void function(Name nameObj, Ref ref) { compiler.report( JSError.make(ref.node, UNSAFE_NAMESPACE_WARNING, nameObj.getFullName())); }
/** * Reports a warning because a namespace was aliased. * * @param nameObj A namespace that is being aliased * @param ref The reference that forced the alias */
Reports a warning because a namespace was aliased
warnAboutNamespaceAliasing
{ "repo_name": "dlochrie/closure-compiler", "path": "src/com/google/javascript/jscomp/CollapseProperties.java", "license": "apache-2.0", "size": 41692 }
[ "com.google.javascript.jscomp.GlobalNamespace" ]
import com.google.javascript.jscomp.GlobalNamespace;
import com.google.javascript.jscomp.*;
[ "com.google.javascript" ]
com.google.javascript;
613,761
@Override public Class[] accepts() { return new Class[]{Collection.class}; }
Class[] function() { return new Class[]{Collection.class}; }
/** * Returns the class that the consumer accepts. * * @return adams.flow.core.Unknown.class */
Returns the class that the consumer accepts
accepts
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-core/src/main/java/adams/flow/condition/bool/HasSize.java", "license": "gpl-3.0", "size": 4067 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
654,174
@Test public void testSetMin_1() throws Exception { PeriodicData fixture = new PeriodicData(); fixture.setMin(1.0); fixture.setSampleSize(1); fixture.setPeriod(1); fixture.setPageId(""); fixture.setMax(1.0); fixture.setMean(1.0); fixture.setJobId(1); fixture.setTimestamp(new Date()); double min = 1.0; fixture.setMin(min); }
void function() throws Exception { PeriodicData fixture = new PeriodicData(); fixture.setMin(1.0); fixture.setSampleSize(1); fixture.setPeriod(1); fixture.setPageId(""); fixture.setMax(1.0); fixture.setMean(1.0); fixture.setJobId(1); fixture.setTimestamp(new Date()); double min = 1.0; fixture.setMin(min); }
/** * Run the void setMin(double) method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 1:34 PM */
Run the void setMin(double) method test
testSetMin_1
{ "repo_name": "intuit/Tank", "path": "data_model/src/test/java/com/intuit/tank/project/PeriodicDataTest.java", "license": "epl-1.0", "size": 13960 }
[ "com.intuit.tank.project.PeriodicData", "java.util.Date" ]
import com.intuit.tank.project.PeriodicData; import java.util.Date;
import com.intuit.tank.project.*; import java.util.*;
[ "com.intuit.tank", "java.util" ]
com.intuit.tank; java.util;
944,185
public native void setDataSource(FileDescriptor fd) throws IOException, IllegalArgumentException, IllegalStateException;
native void function(FileDescriptor fd) throws IOException, IllegalArgumentException, IllegalStateException;
/** * Sets the data source (FileDescriptor) to use. It is the caller's * responsibility to close the file descriptor. It is safe to do so as soon as * this call returns. * * @param fd the FileDescriptor for the file you want to play * @throws IllegalStateException if it is called in an invalid state */
Sets the data source (FileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns
setDataSource
{ "repo_name": "menggang20/meiShi-master", "path": "vitamio/src/main/java/io/vov/vitamio/MediaPlayer.java", "license": "apache-2.0", "size": 52680 }
[ "java.io.FileDescriptor", "java.io.IOException" ]
import java.io.FileDescriptor; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,656,768
void update(CenterConfigDTO config);
void update(CenterConfigDTO config);
/** * update config center * * @param config center config */
update config center
update
{ "repo_name": "shardingjdbc/sharding-jdbc", "path": "shardingsphere-ui/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/CenterConfigService.java", "license": "apache-2.0", "size": 2606 }
[ "org.apache.shardingsphere.ui.common.dto.CenterConfigDTO" ]
import org.apache.shardingsphere.ui.common.dto.CenterConfigDTO;
import org.apache.shardingsphere.ui.common.dto.*;
[ "org.apache.shardingsphere" ]
org.apache.shardingsphere;
2,079,698
protected void checkPermission(@NotNull String resource, @NotNull String action, @Nullable String shareKey) { subjectAclService.checkPermission(resource, action, getId(), shareKey); }
void function(@NotNull String resource, @NotNull String action, @Nullable String shareKey) { subjectAclService.checkPermission(resource, action, getId(), shareKey); }
/** * Check the permission (action on a resource). If a key is provided and is valid, the permission check is by-passed. * If the provided key is not valid, permission check is applied. * @param resource * @param action * @param shareKey */
Check the permission (action on a resource). If a key is provided and is valid, the permission check is by-passed. If the provided key is not valid, permission check is applied
checkPermission
{ "repo_name": "meek0/mica2", "path": "mica-rest/src/main/java/org/obiba/mica/AbstractGitPersistableResource.java", "license": "gpl-3.0", "size": 5909 }
[ "javax.annotation.Nullable", "javax.validation.constraints.NotNull" ]
import javax.annotation.Nullable; import javax.validation.constraints.NotNull;
import javax.annotation.*; import javax.validation.constraints.*;
[ "javax.annotation", "javax.validation" ]
javax.annotation; javax.validation;
1,392,575
@Deprecated public static <T> FindMultiExecutor<T> findAllAsync(Class<T> modelClass, long... ids) { return findAllAsync(modelClass, false, ids); }
static <T> FindMultiExecutor<T> function(Class<T> modelClass, long... ids) { return findAllAsync(modelClass, false, ids); }
/** * This method is deprecated and will be removed in the future releases. * Handle async db operation in your own logic instead. */
This method is deprecated and will be removed in the future releases. Handle async db operation in your own logic instead
findAllAsync
{ "repo_name": "LitePalFramework/LitePal", "path": "core/src/main/java/org/litepal/Operator.java", "license": "apache-2.0", "size": 59913 }
[ "org.litepal.crud.async.FindMultiExecutor" ]
import org.litepal.crud.async.FindMultiExecutor;
import org.litepal.crud.async.*;
[ "org.litepal.crud" ]
org.litepal.crud;
1,072,889
private void drawGrass(Graphics2D buffer, Rectangle2D rect, TexturePaint grassTexture) { // draw the grass everywhere if (grassTexture == null) { buffer.setPaint(GRASS_COLOR); // no need to set the stroke } else { buffer.setPaint(grassTexture); // no need to set the stroke } buffer.fill(rect); }
void function(Graphics2D buffer, Rectangle2D rect, TexturePaint grassTexture) { if (grassTexture == null) { buffer.setPaint(GRASS_COLOR); } else { buffer.setPaint(grassTexture); } buffer.fill(rect); }
/** * Paint the rectangle with the grass picture. * * @param buffer the image buffer * @param rect the rectangle * @param grassTexture the grass texture */
Paint the rectangle with the grass picture
drawGrass
{ "repo_name": "bowzheng/AIM4_delay", "path": "src/main/java/aim4/gui/Canvas.java", "license": "gpl-3.0", "size": 43302 }
[ "java.awt.Graphics2D", "java.awt.TexturePaint", "java.awt.geom.Rectangle2D" ]
import java.awt.Graphics2D; import java.awt.TexturePaint; import java.awt.geom.Rectangle2D;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,812,272
@Override() public java.lang.Class<?> getJavaClass( ) { return org.opennms.netmgt.config.nsclient.Wpms.class; }
@Override() java.lang.Class<?> function( ) { return org.opennms.netmgt.config.nsclient.Wpms.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "tharindum/opennms_dashboard", "path": "protocols/nsclient/src/main/java/org/opennms/netmgt/config/nsclient/descriptors/WpmsDescriptor.java", "license": "gpl-2.0", "size": 5994 }
[ "org.opennms.netmgt.config.nsclient.Wpms" ]
import org.opennms.netmgt.config.nsclient.Wpms;
import org.opennms.netmgt.config.nsclient.*;
[ "org.opennms.netmgt" ]
org.opennms.netmgt;
1,010,037
protected ISchedulingRule getSchedulingRule(SVNTeamProvider provider) { IResourceRuleFactory ruleFactory = provider.getRuleFactory(); HashSet rules = new HashSet(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i = 0; i < resources.length; i++) { IResource[] pathResources = SVNWorkspaceRoot.getResourcesFor( new Path(resources[i].getLocation().toOSString()), false); for (IResource pathResource : pathResources) { IProject resourceProject = pathResource.getProject(); rules.add(ruleFactory.modifyRule(resourceProject)); if (resourceProject.getLocation() != null) { // Add nested projects for (IProject project : projects) { if (project.getLocation() != null) { if (!project.getLocation().equals(resourceProject.getLocation()) && resourceProject.getLocation().isPrefixOf(project.getLocation())) { rules.add(ruleFactory.modifyRule(project)); } } } } } } return MultiRule.combine((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()])); }
ISchedulingRule function(SVNTeamProvider provider) { IResourceRuleFactory ruleFactory = provider.getRuleFactory(); HashSet rules = new HashSet(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i = 0; i < resources.length; i++) { IResource[] pathResources = SVNWorkspaceRoot.getResourcesFor( new Path(resources[i].getLocation().toOSString()), false); for (IResource pathResource : pathResources) { IProject resourceProject = pathResource.getProject(); rules.add(ruleFactory.modifyRule(resourceProject)); if (resourceProject.getLocation() != null) { for (IProject project : projects) { if (project.getLocation() != null) { if (!project.getLocation().equals(resourceProject.getLocation()) && resourceProject.getLocation().isPrefixOf(project.getLocation())) { rules.add(ruleFactory.modifyRule(project)); } } } } } } return MultiRule.combine((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()])); }
/** * Retgurn the scheduling rule to be obtained before work begins on the given provider. By * default, it is the provider's project. This can be changed by subclasses. * * @param provider * @return */
Retgurn the scheduling rule to be obtained before work begins on the given provider. By default, it is the provider's project. This can be changed by subclasses
getSchedulingRule
{ "repo_name": "subclipse/subclipse", "path": "bundles/subclipse.ui/src/org/tigris/subversion/subclipse/ui/operations/RepositoryProviderOperation.java", "license": "epl-1.0", "size": 9089 }
[ "java.util.HashSet", "org.eclipse.core.resources.IProject", "org.eclipse.core.resources.IResource", "org.eclipse.core.resources.IResourceRuleFactory", "org.eclipse.core.resources.ResourcesPlugin", "org.eclipse.core.runtime.Path", "org.eclipse.core.runtime.jobs.ISchedulingRule", "org.eclipse.core.runti...
import java.util.HashSet; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceRuleFactory; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.MultiRule; import org.tigris.subversion.subclipse.core.SVNTeamProvider; import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot;
import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.*; import org.tigris.subversion.subclipse.core.*; import org.tigris.subversion.subclipse.core.resources.*;
[ "java.util", "org.eclipse.core", "org.tigris.subversion" ]
java.util; org.eclipse.core; org.tigris.subversion;
1,942,035
public boolean publishStyle(File sldFile) { return publishStyle(sldFile, null); }
boolean function(File sldFile) { return publishStyle(sldFile, null); }
/** * Store and publish a Style. * * @param sldFile the File containing the SLD document. * * @return <TT>true</TT> if the operation completed successfully. */
Store and publish a Style
publishStyle
{ "repo_name": "oscarfonts/geoserver-manager", "path": "src/main/java/it/geosolutions/geoserver/rest/manager/GeoServerRESTStyleManager.java", "license": "mit", "size": 30199 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,751,727
@Test public void testProductUsageReportWithNullMonthAndYearGet() throws Exception { request.setParameter("lang", Locale.getDefault().toString()); String resultString = reportController.productUsage(null, null, map, request); Assert.assertNotNull(resultString); Assert.assertEquals("report.usageByProduct", resultString); String reportName = (String) map.get("usageReportName"); Assert.assertEquals("productUsage", reportName); Report report = (Report) map.get("report"); Assert.assertTrue(report.getTitle().contains("Monthly Usage by Product")); Calendar cal = Calendar.getInstance(); String month = Integer.toString(cal.get(Calendar.MONTH) + 1); String year = Integer.toString(cal.get(Calendar.YEAR)); Map<String, Object> reportParams = report.getParams(); String monthParam = (String) reportParams.get("month"); String yearParam = (String) reportParams.get("year"); Assert.assertEquals(month, monthParam); Assert.assertEquals(year, yearParam); }
void function() throws Exception { request.setParameter("lang", Locale.getDefault().toString()); String resultString = reportController.productUsage(null, null, map, request); Assert.assertNotNull(resultString); Assert.assertEquals(STR, resultString); String reportName = (String) map.get(STR); Assert.assertEquals(STR, reportName); Report report = (Report) map.get(STR); Assert.assertTrue(report.getTitle().contains(STR)); Calendar cal = Calendar.getInstance(); String month = Integer.toString(cal.get(Calendar.MONTH) + 1); String year = Integer.toString(cal.get(Calendar.YEAR)); Map<String, Object> reportParams = report.getParams(); String monthParam = (String) reportParams.get("month"); String yearParam = (String) reportParams.get("year"); Assert.assertEquals(month, monthParam); Assert.assertEquals(year, yearParam); }
/** * Author: vinayv Description: Test to generate and validate Product Usage Report with Null Month and Year using GET. */
Author: vinayv Description: Test to generate and validate Product Usage Report with Null Month and Year using GET
testProductUsageReportWithNullMonthAndYearGet
{ "repo_name": "backbrainer/cpbm-customization", "path": "citrix.cpbm.custom.portal/src/test/java/fragment/web/AbstractReportControllerTest.java", "license": "bsd-2-clause", "size": 35433 }
[ "com.vmops.model.Report", "java.util.Calendar", "java.util.Locale", "java.util.Map", "org.junit.Assert" ]
import com.vmops.model.Report; import java.util.Calendar; import java.util.Locale; import java.util.Map; import org.junit.Assert;
import com.vmops.model.*; import java.util.*; import org.junit.*;
[ "com.vmops.model", "java.util", "org.junit" ]
com.vmops.model; java.util; org.junit;
882,068
public VirtualMachineScaleSetIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); } this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); return this; }
VirtualMachineScaleSetIpConfiguration function(IpVersion privateIpAddressVersion) { if (this.innerProperties() == null) { this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); } this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); return this; }
/** * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. * * @param privateIpAddressVersion the privateIpAddressVersion value to set. * @return the VirtualMachineScaleSetIpConfiguration object itself. */
Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'
withPrivateIpAddressVersion
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpConfiguration.java", "license": "mit", "size": 12249 }
[ "com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetIpConfigurationProperties" ]
import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetIpConfigurationProperties;
import com.azure.resourcemanager.compute.fluent.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,485,379
public List<ChatMessage> getChannelMessages(ChatChannel channel, String context, Date date, int start, int max, boolean sortAsc) throws PermissionException;
List<ChatMessage> function(ChatChannel channel, String context, Date date, int start, int max, boolean sortAsc) throws PermissionException;
/** * gets all the messages from the Channel after the passed date, * limited to returning the the default maximum number of messages (100), * use {@link #getChannelMessagesCount(ChatChannel, String, Date)} to find the total number of messages * * @param channel the ChatChannel to get messages for * @param context [OPTIONAL] Context of channel and messages to return (only used if the channel is null) * @param date [OPTIONAL] Date that the messages need to be newer than, includes all messages if null * @param start The item to start on (supports paging) * @param max The maximum number of items to return, uses the default maximum if above the default max or < 0, returns none if set to 0 * @param sortAsc Boolean to sort the records in ascending order * @return List of ChatMessages */
gets all the messages from the Channel after the passed date, limited to returning the the default maximum number of messages (100), use <code>#getChannelMessagesCount(ChatChannel, String, Date)</code> to find the total number of messages
getChannelMessages
{ "repo_name": "harfalm/Sakai-10.1", "path": "chat/chat-api/api/src/java/org/sakaiproject/chat2/model/ChatManager.java", "license": "apache-2.0", "size": 9820 }
[ "java.util.Date", "java.util.List", "org.sakaiproject.exception.PermissionException" ]
import java.util.Date; import java.util.List; import org.sakaiproject.exception.PermissionException;
import java.util.*; import org.sakaiproject.exception.*;
[ "java.util", "org.sakaiproject.exception" ]
java.util; org.sakaiproject.exception;
1,418,065
All other headers defined by HTTP/1.1 are end-to-end headers. * </pre> * * @param headerName the header name * @return true if this header is a hop-by-hop header and should be removed when proxying, otherwise false */ public static boolean shouldRemoveHopByHopHeader(String headerName) { return SHOULD_NOT_PROXY_HOP_BY_HOP_HEADERS.contains(headerName.toLowerCase(Locale.US)); }
All other headers defined by HTTP/1.1 are end-to-end headers. * </pre> * * @param headerName the header name * @return true if this header is a hop-by-hop header and should be removed when proxying, otherwise false */ static boolean function(String headerName) { return SHOULD_NOT_PROXY_HOP_BY_HOP_HEADERS.contains(headerName.toLowerCase(Locale.US)); }
/** * Determines if the specified header should be removed from the proxied response because it is a hop-by-hop header, as defined by the * HTTP 1.1 spec in section 13.5.1. The comparison is case-insensitive, so "Connection" will be treated the same as "connection" or "CONNECTION". * From http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.5.1 : * <pre> The following HTTP/1.1 headers are hop-by-hop headers: - Connection - Keep-Alive - Proxy-Authenticate - Proxy-Authorization - TE - Trailers [LittleProxy note: actual header name is Trailer] - Transfer-Encoding [LittleProxy note: this header is not normally removed when proxying, since the proxy does not re-chunk responses. The exception is when an HttpObjectAggregator is enabled, which aggregates chunked content and removes the 'Transfer-Encoding: chunked' header itself.] - Upgrade All other headers defined by HTTP/1.1 are end-to-end headers. * </pre> * * @param headerName the header name * @return true if this header is a hop-by-hop header and should be removed when proxying, otherwise false */
Determines if the specified header should be removed from the proxied response because it is a hop-by-hop header, as defined by the HTTP 1.1 spec in section 13.5.1. The comparison is case-insensitive, so "Connection" will be treated the same as "connection" or "CONNECTION". From HREF : <code> </code>
shouldRemoveHopByHopHeader
{ "repo_name": "adamfisk/LittleProxy", "path": "src/main/java/org/littleshoot/proxy/impl/ProxyUtils.java", "license": "apache-2.0", "size": 29527 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
660,224
@Test public void testNotEqualNotTheSameMembersFirstMore() throws Exception { ECReports reportTwoTags = getECReports(ECREPORTS_NULLGROUP_TWOTAGS); ECReports reportOneTag = getECReports(ECREPORTS_NULLGROUP_ONETAG); ECReportOutputSpec outputSpec = EasyMock.createMock(ECReportOutputSpec.class); EasyMock.expect(outputSpec.isIncludeEPC()).andReturn(true); EasyMock.expect(outputSpec.isIncludeTag()).andReturn(true); EasyMock.expect(outputSpec.isIncludeRawHex()).andReturn(true); EasyMock.replay(outputSpec); ECReportSpec spec = EasyMock.createMock(ECReportSpec.class); EasyMock.expect(spec.getOutput()).andReturn(outputSpec).atLeastOnce(); EasyMock.replay(spec); ECReportsHelper helper = new ECReportsHelper(); Assert.assertFalse(invokeHelper(helper, reportTwoTags, reportOneTag, spec)); EasyMock.verify(spec); EasyMock.verify(outputSpec); }
void function() throws Exception { ECReports reportTwoTags = getECReports(ECREPORTS_NULLGROUP_TWOTAGS); ECReports reportOneTag = getECReports(ECREPORTS_NULLGROUP_ONETAG); ECReportOutputSpec outputSpec = EasyMock.createMock(ECReportOutputSpec.class); EasyMock.expect(outputSpec.isIncludeEPC()).andReturn(true); EasyMock.expect(outputSpec.isIncludeTag()).andReturn(true); EasyMock.expect(outputSpec.isIncludeRawHex()).andReturn(true); EasyMock.replay(outputSpec); ECReportSpec spec = EasyMock.createMock(ECReportSpec.class); EasyMock.expect(spec.getOutput()).andReturn(outputSpec).atLeastOnce(); EasyMock.replay(spec); ECReportsHelper helper = new ECReportsHelper(); Assert.assertFalse(invokeHelper(helper, reportTwoTags, reportOneTag, spec)); EasyMock.verify(spec); EasyMock.verify(outputSpec); }
/** * test equal reports - not the same members. * @throws Exception test failure. */
test equal reports - not the same members
testNotEqualNotTheSameMembersFirstMore
{ "repo_name": "tavlima/fosstrak-ale", "path": "fc-server/src/test/java/org/fosstrak/ale/server/util/test/ECReportsHelperTest.java", "license": "lgpl-2.1", "size": 10478 }
[ "junit.framework.Assert", "org.easymock.EasyMock", "org.fosstrak.ale.server.util.ECReportsHelper", "org.fosstrak.ale.xsd.ale.epcglobal.ECReportOutputSpec", "org.fosstrak.ale.xsd.ale.epcglobal.ECReportSpec", "org.fosstrak.ale.xsd.ale.epcglobal.ECReports" ]
import junit.framework.Assert; import org.easymock.EasyMock; import org.fosstrak.ale.server.util.ECReportsHelper; import org.fosstrak.ale.xsd.ale.epcglobal.ECReportOutputSpec; import org.fosstrak.ale.xsd.ale.epcglobal.ECReportSpec; import org.fosstrak.ale.xsd.ale.epcglobal.ECReports;
import junit.framework.*; import org.easymock.*; import org.fosstrak.ale.server.util.*; import org.fosstrak.ale.xsd.ale.epcglobal.*;
[ "junit.framework", "org.easymock", "org.fosstrak.ale" ]
junit.framework; org.easymock; org.fosstrak.ale;
1,617,615
public void destroyingApplication(JPAApplInfo applInfo) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "destroyingApplication : " + applInfo.getApplName()); applInfo.closeAllScopeModules(); applList.remove(applInfo.getApplName()); // d643462 if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "Current application list : " + getSortedAppNames()); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "destroyingApplication : " + applInfo.getApplName()); }
void function(JPAApplInfo applInfo) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, STR + applInfo.getApplName()); applInfo.closeAllScopeModules(); applList.remove(applInfo.getApplName()); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, STR + getSortedAppNames()); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, STR + applInfo.getApplName()); }
/** * Process application "destroying" event. */
Process application "destroying" event
destroyingApplication
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/AbstractJPAComponent.java", "license": "epl-1.0", "size": 17753 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent;
import com.ibm.websphere.ras.*;
[ "com.ibm.websphere" ]
com.ibm.websphere;
1,002,013
public int getRunStart(Set<? extends Attribute> attributes);
int function(Set<? extends Attribute> attributes);
/** * Returns the index of the first character of the run * with respect to the given {@code attributes} containing the current character. * * @param attributes a set of the desired attributes. * @return the index of the first character of the run */
Returns the index of the first character of the run with respect to the given attributes containing the current character
getRunStart
{ "repo_name": "flyzsd/java-code-snippets", "path": "ibm.jdk8/src/java/text/AttributedCharacterIterator.java", "license": "mit", "size": 10166 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,814,597
public String callInterceptorExceptionOperation(PreOrPostInterceptorException preOrPost){ try { getClient().interceptorCheckedExceptionOperation(getCtx(), preOrPost); } catch (SimpleException se) { return se.getReason(); } return "No exception was thrown"; } public static final class CougarClientExecutionContext extends ExecutionContextImpl{ private GeoLocationDetails geoLocationDetails = null;
String function(PreOrPostInterceptorException preOrPost){ try { getClient().interceptorCheckedExceptionOperation(getCtx(), preOrPost); } catch (SimpleException se) { return se.getReason(); } return STR; } public static final class CougarClientExecutionContext extends ExecutionContextImpl{ private GeoLocationDetails geoLocationDetails = null;
/** * Wrapper method for the interceptorCheckedException baseline operation. Will call the operation requesting either a pre or post exception, catch the response exception and return the exception message * @param preOrPost * @return String * */
Wrapper method for the interceptorCheckedException baseline operation. Will call the operation requesting either a pre or post exception, catch the response exception and return the exception message
callInterceptorExceptionOperation
{ "repo_name": "betfair/cougar", "path": "cougar-test/cougar-client-code-tests/src/main/java/com/betfair/cougar/tests/clienttests/CougarClientWrapper.java", "license": "apache-2.0", "size": 10991 }
[ "com.betfair.baseline.v2.enumerations.PreOrPostInterceptorException", "com.betfair.baseline.v2.exception.SimpleException", "com.betfair.cougar.api.ExecutionContextImpl", "com.betfair.cougar.api.geolocation.GeoLocationDetails" ]
import com.betfair.baseline.v2.enumerations.PreOrPostInterceptorException; import com.betfair.baseline.v2.exception.SimpleException; import com.betfair.cougar.api.ExecutionContextImpl; import com.betfair.cougar.api.geolocation.GeoLocationDetails;
import com.betfair.baseline.v2.enumerations.*; import com.betfair.baseline.v2.exception.*; import com.betfair.cougar.api.*; import com.betfair.cougar.api.geolocation.*;
[ "com.betfair.baseline", "com.betfair.cougar" ]
com.betfair.baseline; com.betfair.cougar;
990,671
@Override public Value eval(Env env) { Value qThis = env.getThis(); QuercusClass parent = qThis.getQuercusClass().getTraitParent(env, _traitName); return parent.getConstant(env, _name); }
Value function(Env env) { Value qThis = env.getThis(); QuercusClass parent = qThis.getQuercusClass().getTraitParent(env, _traitName); return parent.getConstant(env, _name); }
/** * Evaluates the expression. * * @param env the calling environment. * * @return the expression value. */
Evaluates the expression
eval
{ "repo_name": "smba/oak", "path": "quercus/src/main/java/com/caucho/quercus/expr/TraitParentClassConstExpr.java", "license": "lgpl-3.0", "size": 2711 }
[ "com.caucho.quercus.env.Env", "com.caucho.quercus.env.QuercusClass", "com.caucho.quercus.env.Value" ]
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.QuercusClass; import com.caucho.quercus.env.Value;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
1,138,455
public void globalSampling(@Nullable Boolean val) throws IgniteCheckedException;
void function(@Nullable Boolean val) throws IgniteCheckedException;
/** * Enables, disables or clears sampling flag. * * @param val {@code True} to turn on sampling, {@code false} to turn it off, {@code null} to clear sampling state. * @throws IgniteCheckedException If failed. */
Enables, disables or clears sampling flag
globalSampling
{ "repo_name": "agura/incubator-ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java", "license": "apache-2.0", "size": 5291 }
[ "org.apache.ignite.IgniteCheckedException", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.IgniteCheckedException; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
2,579,010
public static WeaponType get(Item item) { for (WeaponType type : values()) { if (item.getType().category == type.category) { return type; } } System.err.println("Unhandled weapon type -[id=" + item.getType().category + ", item=" + item.getName() + "]."); return null; }
static WeaponType function(Item item) { for (WeaponType type : values()) { if (item.getType().category == type.category) { return type; } } System.err.println(STR + item.getType().category + STR + item.getName() + "]."); return null; }
/** * Gets the weapon type for the given item. * @param item The item. * @return The weapon type. */
Gets the weapon type for the given item
get
{ "repo_name": "Sundays211/VirtueRS3", "path": "src/main/java/org/virtue/game/entity/combat/impl/range/ammo/WeaponType.java", "license": "mit", "size": 2423 }
[ "org.virtue.game.entity.player.inv.Item" ]
import org.virtue.game.entity.player.inv.Item;
import org.virtue.game.entity.player.inv.*;
[ "org.virtue.game" ]
org.virtue.game;
2,899,825
public void setDomainCrosshairVisible(boolean flag) { if (this.domainCrosshairVisible != flag) { this.domainCrosshairVisible = flag; notifyListeners(new PlotChangeEvent(this)); } }
void function(boolean flag) { if (this.domainCrosshairVisible != flag) { this.domainCrosshairVisible = flag; notifyListeners(new PlotChangeEvent(this)); } }
/** * Sets the flag indicating whether or not the domain crosshair is visible. * * @param flag the new value of the flag. */
Sets the flag indicating whether or not the domain crosshair is visible
setDomainCrosshairVisible
{ "repo_name": "raedle/univis", "path": "lib/jfreechart-1.0.1/src/org/jfree/chart/plot/ContourPlot.java", "license": "lgpl-2.1", "size": 60766 }
[ "org.jfree.chart.event.PlotChangeEvent" ]
import org.jfree.chart.event.PlotChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,557,221
public ServiceFuture<ServiceEndpointPolicyInner> updateAsync(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback<ServiceEndpointPolicyInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); }
ServiceFuture<ServiceEndpointPolicyInner> function(String resourceGroupName, String serviceEndpointPolicyName, final ServiceCallback<ServiceEndpointPolicyInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName), serviceCallback); }
/** * Updates service Endpoint Policies. * * @param resourceGroupName The name of the resource group. * @param serviceEndpointPolicyName The name of the service endpoint policy. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Updates service Endpoint Policies
updateAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java", "license": "mit", "size": 81753 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,382,381
public void dumpData(int nRecords) throws SPSSFileException, IOException { dumpData(nRecords, new FileFormatInfo()); }
void function(int nRecords) throws SPSSFileException, IOException { dumpData(nRecords, new FileFormatInfo()); }
/** * Dumps the file data to the console (for debugging purposes) * * @param nRecords * the number of records to dump (0 for all) * @throws IOException * @throws SPSSFileException */
Dumps the file data to the console (for debugging purposes)
dumpData
{ "repo_name": "mikera/clj-spss", "path": "src/main/java/org/opendatafoundation/data/spss/SPSSFile.java", "license": "lgpl-3.0", "size": 61082 }
[ "java.io.IOException", "org.opendatafoundation.data.FileFormatInfo" ]
import java.io.IOException; import org.opendatafoundation.data.FileFormatInfo;
import java.io.*; import org.opendatafoundation.data.*;
[ "java.io", "org.opendatafoundation.data" ]
java.io; org.opendatafoundation.data;
1,887,809
protected void processCloudletUpdate(SimEvent ev) { BaseSchedulingAlgorithm scheduler = getScheduler(Parameters.getSchedulingAlgorithm()); scheduler.setCloudletList(getCloudletList()); scheduler.setVmList(getVmsCreatedList()); try { scheduler.run(); } catch (Exception e) { Log.printLine("Error in configuring scheduler_method"); e.printStackTrace(); } List scheduledList = scheduler.getScheduledList(); for (Iterator it = scheduledList.iterator(); it.hasNext();) { Cloudlet cloudlet = (Cloudlet) it.next(); int vmId = cloudlet.getVmId(); double delay = 0.0; if(Parameters.getOverheadParams().getQueueDelay()!=null){ delay = Parameters.getOverheadParams().getQueueDelay(cloudlet); } schedule(getVmsToDatacentersMap().get(vmId), delay, CloudSimTags.CLOUDLET_SUBMIT, cloudlet); } getCloudletList().removeAll(scheduledList); getCloudletSubmittedList().addAll(scheduledList); cloudletsSubmitted += scheduledList.size(); }
void function(SimEvent ev) { BaseSchedulingAlgorithm scheduler = getScheduler(Parameters.getSchedulingAlgorithm()); scheduler.setCloudletList(getCloudletList()); scheduler.setVmList(getVmsCreatedList()); try { scheduler.run(); } catch (Exception e) { Log.printLine(STR); e.printStackTrace(); } List scheduledList = scheduler.getScheduledList(); for (Iterator it = scheduledList.iterator(); it.hasNext();) { Cloudlet cloudlet = (Cloudlet) it.next(); int vmId = cloudlet.getVmId(); double delay = 0.0; if(Parameters.getOverheadParams().getQueueDelay()!=null){ delay = Parameters.getOverheadParams().getQueueDelay(cloudlet); } schedule(getVmsToDatacentersMap().get(vmId), delay, CloudSimTags.CLOUDLET_SUBMIT, cloudlet); } getCloudletList().removeAll(scheduledList); getCloudletSubmittedList().addAll(scheduledList); cloudletsSubmitted += scheduledList.size(); }
/** * Update a cloudlet (job) * * @param ev a simEvent object */
Update a cloudlet (job)
processCloudletUpdate
{ "repo_name": "Farisllwaah/WorkflowSim-1.0", "path": "sources/org/workflowsim/WorkflowScheduler.java", "license": "lgpl-3.0", "size": 13622 }
[ "java.util.Iterator", "java.util.List", "org.cloudbus.cloudsim.Cloudlet", "org.cloudbus.cloudsim.Log", "org.cloudbus.cloudsim.core.CloudSimTags", "org.cloudbus.cloudsim.core.SimEvent", "org.workflowsim.scheduling.BaseSchedulingAlgorithm", "org.workflowsim.utils.Parameters" ]
import java.util.Iterator; import java.util.List; import org.cloudbus.cloudsim.Cloudlet; import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.core.CloudSimTags; import org.cloudbus.cloudsim.core.SimEvent; import org.workflowsim.scheduling.BaseSchedulingAlgorithm; import org.workflowsim.utils.Parameters;
import java.util.*; import org.cloudbus.cloudsim.*; import org.cloudbus.cloudsim.core.*; import org.workflowsim.scheduling.*; import org.workflowsim.utils.*;
[ "java.util", "org.cloudbus.cloudsim", "org.workflowsim.scheduling", "org.workflowsim.utils" ]
java.util; org.cloudbus.cloudsim; org.workflowsim.scheduling; org.workflowsim.utils;
1,625,085
public JsonObject toJson() throws IOException { JsonObject options = new JsonObject(); if (this.pageLoadStrategy != null) { options.addProperty(CapabilityType.PAGE_LOAD_STRATEGY, this.pageLoadStrategy); } return options; }
JsonObject function() throws IOException { JsonObject options = new JsonObject(); if (this.pageLoadStrategy != null) { options.addProperty(CapabilityType.PAGE_LOAD_STRATEGY, this.pageLoadStrategy); } return options; }
/** * Converts this instance to its JSON representation. * * @return The JSON representation of the options. * @throws IOException If an error occurred while reading the Edge extension files. */
Converts this instance to its JSON representation
toJson
{ "repo_name": "s2oBCN/selenium", "path": "java/client/src/org/openqa/selenium/edge/EdgeOptions.java", "license": "apache-2.0", "size": 3365 }
[ "com.google.gson.JsonObject", "java.io.IOException", "org.openqa.selenium.remote.CapabilityType" ]
import com.google.gson.JsonObject; import java.io.IOException; import org.openqa.selenium.remote.CapabilityType;
import com.google.gson.*; import java.io.*; import org.openqa.selenium.remote.*;
[ "com.google.gson", "java.io", "org.openqa.selenium" ]
com.google.gson; java.io; org.openqa.selenium;
240,602
public Font getValueFont() { return this.valueFont; }
Font function() { return this.valueFont; }
/** * Returns the font for the value label. * * @return The font (never <code>null</code>). * * @see #setValueFont(Font) */
Returns the font for the value label
getValueFont
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/plot/MeterPlot.java", "license": "lgpl-2.1", "size": 44826 }
[ "java.awt.Font" ]
import java.awt.Font;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,719,088
public synchronized WindowListener[] getWindowListeners() { return (WindowListener[]) AWTEventMulticaster.getListeners(windowListener, WindowListener.class); }
synchronized WindowListener[] function() { return (WindowListener[]) AWTEventMulticaster.getListeners(windowListener, WindowListener.class); }
/** * Returns an array of all the window listeners registered on this window. * * @since 1.4 */
Returns an array of all the window listeners registered on this window
getWindowListeners
{ "repo_name": "aosm/gcc_40", "path": "libjava/java/awt/Window.java", "license": "gpl-2.0", "size": 24595 }
[ "java.awt.event.WindowListener" ]
import java.awt.event.WindowListener;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,002,130
public void resolve( final DocumentContext process, final LayoutElement currentNode, final StyleKey key ) { final LayoutStyle layoutContext = currentNode.getLayoutStyle(); final CSSValue value = layoutContext.getValue( key ); final CSSConstant result; if ( FontStretch.WIDER.equals( value ) ) { // ask the parent ... final CSSConstant parentStretch = queryParent( currentNode.getParentLayoutElement() ); result = FontStretch.getByOrder( FontStretch.getOrder( parentStretch ) + 1 ); } else if ( FontStretch.NARROWER.equals( value ) ) { // ask the parent ... final CSSConstant parentStretch = queryParent( currentNode.getParentLayoutElement() ); result = FontStretch.getByOrder( FontStretch.getOrder( parentStretch ) - 1 ); } else if ( value instanceof CSSConstant ) { final CSSConstant stretch = (CSSConstant) lookupValue( (CSSConstant) value ); if ( stretch != null ) { result = stretch; } else { result = FontStretch.NORMAL; } } else { result = FontStretch.NORMAL; } layoutContext.setValue( key, result ); }
void function( final DocumentContext process, final LayoutElement currentNode, final StyleKey key ) { final LayoutStyle layoutContext = currentNode.getLayoutStyle(); final CSSValue value = layoutContext.getValue( key ); final CSSConstant result; if ( FontStretch.WIDER.equals( value ) ) { final CSSConstant parentStretch = queryParent( currentNode.getParentLayoutElement() ); result = FontStretch.getByOrder( FontStretch.getOrder( parentStretch ) + 1 ); } else if ( FontStretch.NARROWER.equals( value ) ) { final CSSConstant parentStretch = queryParent( currentNode.getParentLayoutElement() ); result = FontStretch.getByOrder( FontStretch.getOrder( parentStretch ) - 1 ); } else if ( value instanceof CSSConstant ) { final CSSConstant stretch = (CSSConstant) lookupValue( (CSSConstant) value ); if ( stretch != null ) { result = stretch; } else { result = FontStretch.NORMAL; } } else { result = FontStretch.NORMAL; } layoutContext.setValue( key, result ); }
/** * Resolves a single property. * * @param currentNode */
Resolves a single property
resolve
{ "repo_name": "EgorZhuk/pentaho-reporting", "path": "libraries/libcss/src/main/java/org/pentaho/reporting/libraries/css/resolver/values/computed/fonts/FontStretchResolveHandler.java", "license": "lgpl-2.1", "size": 3895 }
[ "org.pentaho.reporting.libraries.css.dom.DocumentContext", "org.pentaho.reporting.libraries.css.dom.LayoutElement", "org.pentaho.reporting.libraries.css.dom.LayoutStyle", "org.pentaho.reporting.libraries.css.keys.font.FontStretch", "org.pentaho.reporting.libraries.css.model.StyleKey", "org.pentaho.reporti...
import org.pentaho.reporting.libraries.css.dom.DocumentContext; import org.pentaho.reporting.libraries.css.dom.LayoutElement; import org.pentaho.reporting.libraries.css.dom.LayoutStyle; import org.pentaho.reporting.libraries.css.keys.font.FontStretch; import org.pentaho.reporting.libraries.css.model.StyleKey; import org.pentaho.reporting.libraries.css.values.CSSConstant; import org.pentaho.reporting.libraries.css.values.CSSValue;
import org.pentaho.reporting.libraries.css.dom.*; import org.pentaho.reporting.libraries.css.keys.font.*; import org.pentaho.reporting.libraries.css.model.*; import org.pentaho.reporting.libraries.css.values.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
2,536,367
public double getUpperMargin() { return this.upperMargin; } /** * Sets the upper margin for the axis and sends an {@link AxisChangeEvent}
double function() { return this.upperMargin; } /** * Sets the upper margin for the axis and sends an {@link AxisChangeEvent}
/** * Returns the upper margin for the axis. * * @return The margin. * * @see #getLowerMargin() * @see #setUpperMargin(double) */
Returns the upper margin for the axis
getUpperMargin
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/jfreechart-1.0.5/source/org/jfree/chart/axis/CategoryAxis.java", "license": "gpl-2.0", "size": 49059 }
[ "org.jfree.chart.event.AxisChangeEvent" ]
import org.jfree.chart.event.AxisChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,423,272
public void killAll() { if ( steps == null ) { return; } int nrStepsFinished = 0; for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "Trans.Log.LookingAtStep" ) + sid.step.getStepname() ); } // If thr is a mapping, this is cause for an endless loop // while ( sid.step.isRunning() ) { sid.step.stopAll(); try { Thread.sleep( 20 ); } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, "Trans.Log.TransformationErrors" ) + e.toString() ); return; } } if ( !sid.step.isRunning() ) { nrStepsFinished++; } } if ( nrStepsFinished == steps.size() ) { setFinished( true ); } }
void function() { if ( steps == null ) { return; } int nrStepsFinished = 0; for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, STR ) + sid.step.getStepname() ); } sid.step.stopAll(); try { Thread.sleep( 20 ); } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, STR ) + e.toString() ); return; } } if ( !sid.step.isRunning() ) { nrStepsFinished++; } } if ( nrStepsFinished == steps.size() ) { setFinished( true ); } }
/** * Attempts to stops all running steps and subtransformations. If all steps have finished, the transformation is * marked as Finished. */
Attempts to stops all running steps and subtransformations. If all steps have finished, the transformation is marked as Finished
killAll
{ "repo_name": "AndreyBurikhin/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 190705 }
[ "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.trans.step.StepMetaDataCombi" ]
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.step.StepMetaDataCombi;
import org.pentaho.di.i18n.*; import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,358,853
public void setObject(int parameterIndex, Object value, int targetSqlType) throws SQLException { validateStatement(); statement_.setObject(parameterIndex, value, targetSqlType); }
void function(int parameterIndex, Object value, int targetSqlType) throws SQLException { validateStatement(); statement_.setObject(parameterIndex, value, targetSqlType); }
/** * Sets the object <i>value</i> at the specified <i>parameterIndex</i>. * This parameter is used by the internal statement to populate the rowset via the execute method. * @param parameterIndex The parameter index (1-based). * @param value The Object value. * @param targetSqlType The SQL type. * @exception SQLException If a database error occurs. **/
Sets the object value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method
setObject
{ "repo_name": "piguangming/jt400", "path": "cvsroot/src/com/ibm/as400/access/AS400JDBCRowSet.java", "license": "epl-1.0", "size": 311708 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,810,428
public RegressionResults regress(int numberOfRegressors) throws ModelSpecificationException { if (this.nobs <= numberOfRegressors) { throw new ModelSpecificationException( LocalizedFormats.NOT_ENOUGH_DATA_FOR_NUMBER_OF_PREDICTORS, this.nobs, numberOfRegressors); } if( numberOfRegressors > this.nvars ){ throw new ModelSpecificationException( LocalizedFormats.TOO_MANY_REGRESSORS, numberOfRegressors, this.nvars); } tolset(); singcheck(); double[] beta = this.regcf(numberOfRegressors); ss(); double[] cov = this.cov(numberOfRegressors); int rnk = 0; for (int i = 0; i < this.lindep.length; i++) { if (!this.lindep[i]) { ++rnk; } } boolean needsReorder = false; for (int i = 0; i < numberOfRegressors; i++) { if (this.vorder[i] != i) { needsReorder = true; break; } } if (!needsReorder) { return new RegressionResults( beta, new double[][]{cov}, true, this.nobs, rnk, this.sumy, this.sumsqy, this.sserr, this.hasIntercept, false); } else { double[] betaNew = new double[beta.length]; double[] covNew = new double[cov.length]; int[] newIndices = new int[beta.length]; for (int i = 0; i < nvars; i++) { for (int j = 0; j < numberOfRegressors; j++) { if (this.vorder[j] == i) { betaNew[i] = beta[ j]; newIndices[i] = j; } } } int idx1 = 0; int idx2; int _i; int _j; for (int i = 0; i < beta.length; i++) { _i = newIndices[i]; for (int j = 0; j <= i; j++, idx1++) { _j = newIndices[j]; if (_i > _j) { idx2 = _i * (_i + 1) / 2 + _j; } else { idx2 = _j * (_j + 1) / 2 + _i; } covNew[idx1] = cov[idx2]; } } return new RegressionResults( betaNew, new double[][]{covNew}, true, this.nobs, rnk, this.sumy, this.sumsqy, this.sserr, this.hasIntercept, false); } }
RegressionResults function(int numberOfRegressors) throws ModelSpecificationException { if (this.nobs <= numberOfRegressors) { throw new ModelSpecificationException( LocalizedFormats.NOT_ENOUGH_DATA_FOR_NUMBER_OF_PREDICTORS, this.nobs, numberOfRegressors); } if( numberOfRegressors > this.nvars ){ throw new ModelSpecificationException( LocalizedFormats.TOO_MANY_REGRESSORS, numberOfRegressors, this.nvars); } tolset(); singcheck(); double[] beta = this.regcf(numberOfRegressors); ss(); double[] cov = this.cov(numberOfRegressors); int rnk = 0; for (int i = 0; i < this.lindep.length; i++) { if (!this.lindep[i]) { ++rnk; } } boolean needsReorder = false; for (int i = 0; i < numberOfRegressors; i++) { if (this.vorder[i] != i) { needsReorder = true; break; } } if (!needsReorder) { return new RegressionResults( beta, new double[][]{cov}, true, this.nobs, rnk, this.sumy, this.sumsqy, this.sserr, this.hasIntercept, false); } else { double[] betaNew = new double[beta.length]; double[] covNew = new double[cov.length]; int[] newIndices = new int[beta.length]; for (int i = 0; i < nvars; i++) { for (int j = 0; j < numberOfRegressors; j++) { if (this.vorder[j] == i) { betaNew[i] = beta[ j]; newIndices[i] = j; } } } int idx1 = 0; int idx2; int _i; int _j; for (int i = 0; i < beta.length; i++) { _i = newIndices[i]; for (int j = 0; j <= i; j++, idx1++) { _j = newIndices[j]; if (_i > _j) { idx2 = _i * (_i + 1) / 2 + _j; } else { idx2 = _j * (_j + 1) / 2 + _i; } covNew[idx1] = cov[idx2]; } } return new RegressionResults( betaNew, new double[][]{covNew}, true, this.nobs, rnk, this.sumy, this.sumsqy, this.sserr, this.hasIntercept, false); } }
/** * Conducts a regression on the data in the model, using a subset of regressors. * * @param numberOfRegressors many of the regressors to include (either in canonical * order, or in the current reordered state) * @return RegressionResults the structure holding all regression results * @exception ModelSpecificationException - thrown if number of observations is * less than the number of variables or number of regressors requested * is greater than the regressors in the model */
Conducts a regression on the data in the model, using a subset of regressors
regress
{ "repo_name": "martingwhite/astor", "path": "examples/math_5/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java", "license": "gpl-2.0", "size": 39479 }
[ "org.apache.commons.math3.exception.util.LocalizedFormats" ]
import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.exception.util.*;
[ "org.apache.commons" ]
org.apache.commons;
1,998,139
public Map<String, Texture> getTextures() { return this.textures; }
Map<String, Texture> function() { return this.textures; }
/** * Returns the bound textures. * * @return The bound textures */
Returns the bound textures
getTextures
{ "repo_name": "kayahr/threedee", "path": "threedee-core/src/main/java/de/ailis/threedee/scene/Model.java", "license": "mit", "size": 18625 }
[ "de.ailis.threedee.assets.Texture", "java.util.Map" ]
import de.ailis.threedee.assets.Texture; import java.util.Map;
import de.ailis.threedee.assets.*; import java.util.*;
[ "de.ailis.threedee", "java.util" ]
de.ailis.threedee; java.util;
802,304
Set<String> imports = new HashSet<String>(); if (domain.getAttributes() != null) { for (AttributeEntity attr : domain.getAttributes()) { if (DataType.String.equals(attr.getDataType())) { if (attr.getMax() != null || attr.getMin() != null) { imports.add("import javax.validation.constraints.Size;"); } if (!attr.isNullable()) { imports.add("import org.hibernate.validator.constraints.NotBlank;"); } } else if (DataType.Date.equals(attr.getDataType()) || DataType.Time.equals(attr.getDataType()) || DataType.Timestamp.equals(attr.getDataType())) { imports.add("import java.util.Date;"); imports.add("import javax.persistence.Temporal;"); imports.add("import javax.persistence.TemporalType;"); } else if (DataType.Enum.equals(attr.getDataType())) { imports.add("import javax.persistence.EnumType;"); imports.add("import javax.persistence.Enumerated;"); } else if (DataType.BigDecimal.equals(attr.getDataType())) { imports.add("import java.math.BigDecimal;"); } if (attr.getPattern() != null) { imports.add("import javax.validation.constraints.Pattern;"); } if (!DataType.String.equals(attr.getDataType())) { if (!attr.isNullable()) { imports.add("import javax.validation.constraints.NotNull;"); } if (attr.getMax() != null) { imports.add("import javax.validation.constraints.Max;"); } if (attr.getMin() != null) { imports.add("import javax.validation.constraints.Min;"); } } } } return imports; }
Set<String> imports = new HashSet<String>(); if (domain.getAttributes() != null) { for (AttributeEntity attr : domain.getAttributes()) { if (DataType.String.equals(attr.getDataType())) { if (attr.getMax() != null attr.getMin() != null) { imports.add(STR); } if (!attr.isNullable()) { imports.add(STR); } } else if (DataType.Date.equals(attr.getDataType()) DataType.Time.equals(attr.getDataType()) DataType.Timestamp.equals(attr.getDataType())) { imports.add(STR); imports.add(STR); imports.add(STR); } else if (DataType.Enum.equals(attr.getDataType())) { imports.add(STR); imports.add(STR); } else if (DataType.BigDecimal.equals(attr.getDataType())) { imports.add(STR); } if (attr.getPattern() != null) { imports.add(STR); } if (!DataType.String.equals(attr.getDataType())) { if (!attr.isNullable()) { imports.add(STR); } if (attr.getMax() != null) { imports.add(STR); } if (attr.getMin() != null) { imports.add(STR); } } } } return imports; }
/** * Imports for Java-Entities Bean Validation and DataTypes for EntityGeneration. * @param domain - definition of domain. * @return Set of Java imports */
Imports for Java-Entities Bean Validation and DataTypes for EntityGeneration
gatherEntityImports
{ "repo_name": "witchpou/lj-projectbuilder", "path": "ljprojectbuilder/generator/src/main/java/de/starwit/generator/generator/EntityImports.java", "license": "apache-2.0", "size": 2130 }
[ "de.starwit.ljprojectbuilder.entity.AttributeEntity", "de.starwit.ljprojectbuilder.entity.DataType", "java.util.HashSet", "java.util.Set" ]
import de.starwit.ljprojectbuilder.entity.AttributeEntity; import de.starwit.ljprojectbuilder.entity.DataType; import java.util.HashSet; import java.util.Set;
import de.starwit.ljprojectbuilder.entity.*; import java.util.*;
[ "de.starwit.ljprojectbuilder", "java.util" ]
de.starwit.ljprojectbuilder; java.util;
2,738,794
public Long createForLoad(ConvenioDeuda o, LogFile output) throws Exception { // Obtenemos el valor del id autogenerado a insertar. long id = 0; if(getMigId() == -1){ id = this.getLastId(output.getPath(), output.getNameFile())+1; // Id Preseteado (Inicialmente usado para la migracion de CdM) // Archivo con una unica linea: // 54378| long idPreset = this.getLastId(output.getPath(), "idConvenioDeuda.set"); if(id <= idPreset){ id = idPreset; } setMigId(id); }else{ id = getNextId(output.getPath(), output.getNameFile()); } //long id = getNextId(output.getPath(), output.getNameFile()); DecimalFormat decimalFormat = new DecimalFormat("0.0000000000"); // Estrucura de la linea: // id|idconvenio|iddeuda|capitaloriginal|capitalenplan|actualizacion|actenplan|totalenplan|fechapago|saldoenplan|fecvendeuda|usuario|fechaultmdf|estado StringBuffer line = new StringBuffer(); line.append(id); line.append("|"); line.append(o.getConvenio().getId()); line.append("|"); line.append(o.getIdDeuda()); line.append("|"); line.append(decimalFormat.format(o.getCapitalOriginal())); line.append("|"); line.append(decimalFormat.format(o.getCapitalEnPlan())); line.append("|"); line.append(decimalFormat.format(o.getActualizacion())); line.append("|"); line.append(decimalFormat.format(o.getActEnPlan())); line.append("|"); line.append(decimalFormat.format(o.getTotalEnPlan())); line.append("|"); if(o.getFechaPago()!=null){ line.append(DateUtil.formatDate(o.getFechaPago(), "yyyy-MM-dd")); } // Si es null no se inserta nada, viene el proximo pipe. line.append("|"); line.append(decimalFormat.format(o.getSaldoEnPlan())); line.append("|"); if(o.getFecVenDeuda()!=null){ line.append(DateUtil.formatDate(o.getFecVenDeuda(), "yyyy-MM-dd")); } // Si es null no se inserta nada, viene el proximo pipe. line.append("|"); line.append(DemodaUtil.currentUserContext().getUserName()); line.append("|"); line.append("2010-01-01 00:00:00"); line.append("|"); line.append("1"); line.append("|"); output.addline(line.toString()); // Seteamos el id generado en el bean. o.setId(id); return id; }
Long function(ConvenioDeuda o, LogFile output) throws Exception { long id = 0; if(getMigId() == -1){ id = this.getLastId(output.getPath(), output.getNameFile())+1; long idPreset = this.getLastId(output.getPath(), STR); if(id <= idPreset){ id = idPreset; } setMigId(id); }else{ id = getNextId(output.getPath(), output.getNameFile()); } DecimalFormat decimalFormat = new DecimalFormat(STR); StringBuffer line = new StringBuffer(); line.append(id); line.append(" "); line.append(o.getConvenio().getId()); line.append(" "); line.append(o.getIdDeuda()); line.append(" "); line.append(decimalFormat.format(o.getCapitalOriginal())); line.append(" "); line.append(decimalFormat.format(o.getCapitalEnPlan())); line.append(" "); line.append(decimalFormat.format(o.getActualizacion())); line.append(" "); line.append(decimalFormat.format(o.getActEnPlan())); line.append(" "); line.append(decimalFormat.format(o.getTotalEnPlan())); line.append(" "); if(o.getFechaPago()!=null){ line.append(DateUtil.formatDate(o.getFechaPago(), STR)); } line.append(" "); line.append(decimalFormat.format(o.getSaldoEnPlan())); line.append(" "); if(o.getFecVenDeuda()!=null){ line.append(DateUtil.formatDate(o.getFecVenDeuda(), STR)); } line.append(" "); line.append(DemodaUtil.currentUserContext().getUserName()); line.append(" "); line.append(STR); line.append(" "); line.append("1"); line.append(" "); output.addline(line.toString()); o.setId(id); return id; }
/** * Inserta una linea con los datos del ConvenioDeuda para luego realizar un load desde Informix. * (la linea se inserta en el archivo pasado como parametro a traves del LogFile) * @param convenioDeuda, output - El ConvenioDeuda a crear y el Archivo al que se le agrega la linea. * @return long - El id generado. * @throws Exception */
Inserta una linea con los datos del ConvenioDeuda para luego realizar un load desde Informix. (la linea se inserta en el archivo pasado como parametro a traves del LogFile)
createForLoad
{ "repo_name": "avdata99/SIAT", "path": "siat-1.0-SOURCE/src/buss/src/ar/gov/rosario/siat/gde/buss/dao/ConvenioDeudaDAO.java", "license": "gpl-3.0", "size": 12747 }
[ "ar.gov.rosario.siat.gde.buss.bean.ConvenioDeuda", "coop.tecso.demoda.buss.helper.LogFile", "coop.tecso.demoda.iface.helper.DateUtil", "coop.tecso.demoda.iface.helper.DemodaUtil", "java.text.DecimalFormat" ]
import ar.gov.rosario.siat.gde.buss.bean.ConvenioDeuda; import coop.tecso.demoda.buss.helper.LogFile; import coop.tecso.demoda.iface.helper.DateUtil; import coop.tecso.demoda.iface.helper.DemodaUtil; import java.text.DecimalFormat;
import ar.gov.rosario.siat.gde.buss.bean.*; import coop.tecso.demoda.buss.helper.*; import coop.tecso.demoda.iface.helper.*; import java.text.*;
[ "ar.gov.rosario", "coop.tecso.demoda", "java.text" ]
ar.gov.rosario; coop.tecso.demoda; java.text;
2,273,101