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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
private static BigDecimal bigDecimalValue(PropertyValue value, int type) { switch (type) { case SHORT: return BigDecimal.valueOf(value.getShort()); case INT: return BigDecimal.valueOf(value.getInt()); case LONG: return BigDecimal.valueOf(value.getLong()); case FLOAT: return BigDecimal.valueOf(value.getFloat()); default: return BigDecimal.valueOf(value.getDouble()); } }
static BigDecimal function(PropertyValue value, int type) { switch (type) { case SHORT: return BigDecimal.valueOf(value.getShort()); case INT: return BigDecimal.valueOf(value.getInt()); case LONG: return BigDecimal.valueOf(value.getLong()); case FLOAT: return BigDecimal.valueOf(value.getFloat()); default: return BigDecimal.valueOf(value.getDouble()); } }
/** * Converts a value of a lower domain numerical type to BigDecimal. * * @param value value * @param type type * * @return converted value */
Converts a value of a lower domain numerical type to BigDecimal
bigDecimalValue
{ "repo_name": "galpha/gradoop", "path": "gradoop-common/src/main/java/org/gradoop/common/model/impl/properties/PropertyValueUtils.java", "license": "apache-2.0", "size": 20338 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,991,167
public boolean filterByType(MutationAnnotation annotation) { boolean filter = false; for (String type : mutationTypes) { String type1 = annotation.getVariantClassification().toLowerCase(); String type2 = type.toLowerCase(); if(type1.contains(type2) || type2.contains(type1)) { filter = true; break; } } return filter; }
boolean function(MutationAnnotation annotation) { boolean filter = false; for (String type : mutationTypes) { String type1 = annotation.getVariantClassification().toLowerCase(); String type2 = type.toLowerCase(); if(type1.contains(type2) type2.contains(type1)) { filter = true; break; } } return filter; }
/** * If the annotation's variant classification is one of the provided * mutation types, then the mutation is accepted. * * @param annotation mutation annotation instance * @return true if mutation type matches the variant classification */
If the annotation's variant classification is one of the provided mutation types, then the mutation is accepted
filterByType
{ "repo_name": "cBioPortal/cancerhotspots", "path": "service/src/main/java/org/cmo/cancerhotspots/service/internal/MutationAnnotationFilterService.java", "license": "agpl-3.0", "size": 1750 }
[ "org.cmo.cancerhotspots.model.MutationAnnotation" ]
import org.cmo.cancerhotspots.model.MutationAnnotation;
import org.cmo.cancerhotspots.model.*;
[ "org.cmo.cancerhotspots" ]
org.cmo.cancerhotspots;
455,298
private boolean hasInstances(final Context context) { final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); final int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, this .getClass())); return appWidgetIds.length > 0; }
boolean function(final Context context) { final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); final int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, this .getClass())); return appWidgetIds.length > 0; }
/** * Check against {@link AppWidgetManager} if there are any instances of this * widget. */
Check against <code>AppWidgetManager</code> if there are any instances of this widget
hasInstances
{ "repo_name": "olokos/Apollo", "path": "src/com/andrew/apollo/appwidgets/RecentWidgetProvider.java", "license": "apache-2.0", "size": 12036 }
[ "android.appwidget.AppWidgetManager", "android.content.ComponentName", "android.content.Context" ]
import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context;
import android.appwidget.*; import android.content.*;
[ "android.appwidget", "android.content" ]
android.appwidget; android.content;
2,252,721
@Test public void testTableClientMetrics() { Configuration conf = new Configuration(); for (int i = 0; i < tableNames.length; i++) { TableClientMetrics tableClientMetrics = new TableClientMetrics(tableNames[i], conf); tableMetricsSet.put(tableNames[i], tableClientMetrics); tableClientMetrics.changeMetricValue(MUTATION_BATCH_SIZE, mutationBatchSizeCounter[i]); tableClientMetrics.changeMetricValue(UPSERT_MUTATION_BYTES, upsertMutationBytesCounter[i]); tableClientMetrics.changeMetricValue(UPSERT_MUTATION_SQL_COUNTER, upsertMutationSqlCounter[i]); tableClientMetrics.changeMetricValue(DELETE_MUTATION_BYTES, deleteMutationByesCounter[i]); tableClientMetrics.changeMetricValue(DELETE_MUTATION_SQL_COUNTER, deleteMutationSqlCounter[i]); tableClientMetrics.changeMetricValue(MUTATION_SQL_COUNTER, mutationSqlCounter[i]); tableClientMetrics.changeMetricValue(MUTATION_COMMIT_TIME, mutationSqlCommitTimeCounter[i]); tableClientMetrics.changeMetricValue(TASK_END_TO_END_TIME, taskEndToEndTimeCounter[i]); tableClientMetrics.changeMetricValue(COUNT_ROWS_SCANNED, countRowsScannedCounter[i]); tableClientMetrics.changeMetricValue(QUERY_FAILED_COUNTER, queryFailedCounter[i]); tableClientMetrics.changeMetricValue(QUERY_TIMEOUT_COUNTER, queryTimeOutCounter[i]); tableClientMetrics.changeMetricValue(SCAN_BYTES, scanBytesCounter[i]); tableClientMetrics.changeMetricValue(MetricType.SELECT_POINTLOOKUP_SUCCESS_SQL_COUNTER, selectPointLookUpSuccessCounter[i]); tableClientMetrics.changeMetricValue(SELECT_POINTLOOKUP_FAILED_SQL_COUNTER, selectPointLookUpFailedCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SQL_QUERY_TIME, selectSqlQueryTimeCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SCAN_SUCCESS_SQL_COUNTER, selectScanSuccessCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SCAN_FAILED_SQL_COUNTER, selectScanFailedCounter[i]); } verifyMetricsFromTableClientMetrics(); tableMetricsSet.clear(); }
void function() { Configuration conf = new Configuration(); for (int i = 0; i < tableNames.length; i++) { TableClientMetrics tableClientMetrics = new TableClientMetrics(tableNames[i], conf); tableMetricsSet.put(tableNames[i], tableClientMetrics); tableClientMetrics.changeMetricValue(MUTATION_BATCH_SIZE, mutationBatchSizeCounter[i]); tableClientMetrics.changeMetricValue(UPSERT_MUTATION_BYTES, upsertMutationBytesCounter[i]); tableClientMetrics.changeMetricValue(UPSERT_MUTATION_SQL_COUNTER, upsertMutationSqlCounter[i]); tableClientMetrics.changeMetricValue(DELETE_MUTATION_BYTES, deleteMutationByesCounter[i]); tableClientMetrics.changeMetricValue(DELETE_MUTATION_SQL_COUNTER, deleteMutationSqlCounter[i]); tableClientMetrics.changeMetricValue(MUTATION_SQL_COUNTER, mutationSqlCounter[i]); tableClientMetrics.changeMetricValue(MUTATION_COMMIT_TIME, mutationSqlCommitTimeCounter[i]); tableClientMetrics.changeMetricValue(TASK_END_TO_END_TIME, taskEndToEndTimeCounter[i]); tableClientMetrics.changeMetricValue(COUNT_ROWS_SCANNED, countRowsScannedCounter[i]); tableClientMetrics.changeMetricValue(QUERY_FAILED_COUNTER, queryFailedCounter[i]); tableClientMetrics.changeMetricValue(QUERY_TIMEOUT_COUNTER, queryTimeOutCounter[i]); tableClientMetrics.changeMetricValue(SCAN_BYTES, scanBytesCounter[i]); tableClientMetrics.changeMetricValue(MetricType.SELECT_POINTLOOKUP_SUCCESS_SQL_COUNTER, selectPointLookUpSuccessCounter[i]); tableClientMetrics.changeMetricValue(SELECT_POINTLOOKUP_FAILED_SQL_COUNTER, selectPointLookUpFailedCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SQL_QUERY_TIME, selectSqlQueryTimeCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SCAN_SUCCESS_SQL_COUNTER, selectScanSuccessCounter[i]); tableClientMetrics.changeMetricValue(SELECT_SCAN_FAILED_SQL_COUNTER, selectScanFailedCounter[i]); } verifyMetricsFromTableClientMetrics(); tableMetricsSet.clear(); }
/** * This test is for changeMetricValue() Method and getMetricMap() */
This test is for changeMetricValue() Method and getMetricMap()
testTableClientMetrics
{ "repo_name": "apache/phoenix", "path": "phoenix-core/src/test/java/org/apache/phoenix/monitoring/TableClientMetricsTest.java", "license": "apache-2.0", "size": 11406 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,823,282
private void setupJOGL() { log("creating GLCapabilities"); // This call takes about one second to complete, which is // pretty slow... GLCapabilities caps = new GLCapabilities(null ); log("caps: "+caps); caps.setDoubleBuffered(true); caps.setHardwareAccelerated(true); // Build the object that will show the surface. this.emCanvas = new EarthMapCanvas(this, caps); // Associate the canvas with 'this' window. this.add(this.emCanvas, BorderLayout.CENTER); }
void function() { log(STR); GLCapabilities caps = new GLCapabilities(null ); log(STR+caps); caps.setDoubleBuffered(true); caps.setHardwareAccelerated(true); this.emCanvas = new EarthMapCanvas(this, caps); this.add(this.emCanvas, BorderLayout.CENTER); }
/** Initialize the JOGL library, then create a GL canvas and * associate it with this window. */
Initialize the JOGL library, then create a GL canvas and
setupJOGL
{ "repo_name": "smcpeak/earthshape", "path": "src/earthshape/EarthShape.java", "license": "bsd-2-clause", "size": 118405 }
[ "com.jogamp.opengl.GLCapabilities", "java.awt.BorderLayout" ]
import com.jogamp.opengl.GLCapabilities; import java.awt.BorderLayout;
import com.jogamp.opengl.*; import java.awt.*;
[ "com.jogamp.opengl", "java.awt" ]
com.jogamp.opengl; java.awt;
1,285,299
@Override public void run() { // rename the thread we're using for debugging purposes final Thread currentThread = Thread.currentThread(); final String originalName = currentThread.getName(); currentThread.setName(queryIdString + ":foreman"); try { if (!drillbitContext.isForemanOnline()) { throw new ForemanException("Query submission failed since Foreman is shutting down."); } } catch (ForemanException e) { logger.debug("Failure while submitting query", e); queryStateProcessor.addToEventQueue(QueryState.FAILED, e); } queryText = queryRequest.getPlan(); queryStateProcessor.moveToState(QueryState.PLANNING, null); try { injector.injectChecked(queryContext.getExecutionControls(), "run-try-beginning", ForemanException.class); // convert a run query request into action switch (queryRequest.getType()) { case LOGICAL: parseAndRunLogicalPlan(queryRequest.getPlan()); break; case PHYSICAL: parseAndRunPhysicalPlan(queryRequest.getPlan()); break; case SQL: final String sql = queryRequest.getPlan(); // log query id, username and query text before starting any real work. Also, put // them together such that it is easy to search based on query id logger.info("Query text for query with id {} issued by {}: {}", queryIdString, queryContext.getQueryUserName(), sql); runSQL(sql); break; case EXECUTION: runFragment(queryRequest.getFragmentsList()); break; case PREPARED_STATEMENT: runPreparedStatement(queryRequest.getPreparedStatementHandle()); break; default: throw new IllegalStateException(); } injector.injectChecked(queryContext.getExecutionControls(), "run-try-end", ForemanException.class); } catch (ForemanException | UserException e) { queryStateProcessor.moveToState(QueryState.FAILED, e); } catch (OutOfMemoryError | OutOfMemoryException e) { if (FailureUtils.isDirectMemoryOOM(e)) { queryStateProcessor.moveToState(QueryState.FAILED, UserException.memoryError(e).build(logger)); } else { FailureUtils.unrecoverableFailure(e, "Unable to handle out of memory condition in Foreman.", EXIT_CODE_HEAP_OOM); } } catch (Throwable ex) { queryStateProcessor.moveToState(QueryState.FAILED, new ForemanException("Unexpected exception during fragment initialization: " + ex.getMessage(), ex)); } finally { // restore the thread's original name currentThread.setName(originalName); } }
void function() { final Thread currentThread = Thread.currentThread(); final String originalName = currentThread.getName(); currentThread.setName(queryIdString + STR); try { if (!drillbitContext.isForemanOnline()) { throw new ForemanException(STR); } } catch (ForemanException e) { logger.debug(STR, e); queryStateProcessor.addToEventQueue(QueryState.FAILED, e); } queryText = queryRequest.getPlan(); queryStateProcessor.moveToState(QueryState.PLANNING, null); try { injector.injectChecked(queryContext.getExecutionControls(), STR, ForemanException.class); switch (queryRequest.getType()) { case LOGICAL: parseAndRunLogicalPlan(queryRequest.getPlan()); break; case PHYSICAL: parseAndRunPhysicalPlan(queryRequest.getPlan()); break; case SQL: final String sql = queryRequest.getPlan(); logger.info(STR, queryIdString, queryContext.getQueryUserName(), sql); runSQL(sql); break; case EXECUTION: runFragment(queryRequest.getFragmentsList()); break; case PREPARED_STATEMENT: runPreparedStatement(queryRequest.getPreparedStatementHandle()); break; default: throw new IllegalStateException(); } injector.injectChecked(queryContext.getExecutionControls(), STR, ForemanException.class); } catch (ForemanException UserException e) { queryStateProcessor.moveToState(QueryState.FAILED, e); } catch (OutOfMemoryError OutOfMemoryException e) { if (FailureUtils.isDirectMemoryOOM(e)) { queryStateProcessor.moveToState(QueryState.FAILED, UserException.memoryError(e).build(logger)); } else { FailureUtils.unrecoverableFailure(e, STR, EXIT_CODE_HEAP_OOM); } } catch (Throwable ex) { queryStateProcessor.moveToState(QueryState.FAILED, new ForemanException(STR + ex.getMessage(), ex)); } finally { currentThread.setName(originalName); } }
/** * Called by execution pool to do query setup, and kick off remote execution. * * <p>Note that completion of this function is not the end of the Foreman's role * in the query's lifecycle. */
Called by execution pool to do query setup, and kick off remote execution. Note that completion of this function is not the end of the Foreman's role in the query's lifecycle
run
{ "repo_name": "Ben-Zvi/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java", "license": "apache-2.0", "size": 35040 }
[ "org.apache.drill.common.exceptions.UserException", "org.apache.drill.exec.exception.OutOfMemoryException", "org.apache.drill.exec.proto.UserBitShared", "org.apache.drill.exec.server.FailureUtils" ]
import org.apache.drill.common.exceptions.UserException; import org.apache.drill.exec.exception.OutOfMemoryException; import org.apache.drill.exec.proto.UserBitShared; import org.apache.drill.exec.server.FailureUtils;
import org.apache.drill.common.exceptions.*; import org.apache.drill.exec.exception.*; import org.apache.drill.exec.proto.*; import org.apache.drill.exec.server.*;
[ "org.apache.drill" ]
org.apache.drill;
2,424,070
public Error getError() { return error; }
Error function() { return error; }
/** * Get error detail information. * @return Error detail information. */
Get error detail information
getError
{ "repo_name": "lime-company/lime-security-powerauth-webauth", "path": "powerauth-nextstep-model/src/main/java/io/getlime/security/powerauth/lib/nextstep/model/exception/OperationAlreadyFailedException.java", "license": "apache-2.0", "size": 1811 }
[ "io.getlime.core.rest.model.base.entity.Error" ]
import io.getlime.core.rest.model.base.entity.Error;
import io.getlime.core.rest.model.base.entity.*;
[ "io.getlime.core" ]
io.getlime.core;
1,578,877
public List<Movie> executeSavedSearch(String searchLabel) throws SQLException { return searchDAO.executeSavedSearch(searchLabel); }
List<Movie> function(String searchLabel) throws SQLException { return searchDAO.executeSavedSearch(searchLabel); }
/** * This will execute a search that has previously been saved. * * @param searchLabel * the name of the search to execute * @return a list of Movies mathcing the query * @throws java.sql.SQLException * if there was an error executing the SQL in query */
This will execute a search that has previously been saved
executeSavedSearch
{ "repo_name": "posborne/mango-movie-manager", "path": "src/com/themangoproject/model/MangoController.java", "license": "mit", "size": 20444 }
[ "java.sql.SQLException", "java.util.List" ]
import java.sql.SQLException; import java.util.List;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
775,879
// the next iterator has already been determined // this might happen if hasNext() is called multiple if (nextIterator != null) { return true; } while(iterators.hasNext()) { final Iterator<? extends E> childIterator = iterators.next(); if (childIterator.hasNext()) { nextIterator = childIterator; return true; } else { // iterator is exhausted, remove it iterators.remove(); } } return false; }
if (nextIterator != null) { return true; } while(iterators.hasNext()) { final Iterator<? extends E> childIterator = iterators.next(); if (childIterator.hasNext()) { nextIterator = childIterator; return true; } else { iterators.remove(); } } return false; }
/** * Returns {@code true} if any child iterator has remaining elements. * * @return true if this iterator has remaining elements */
Returns true if any child iterator has remaining elements
hasNext
{ "repo_name": "kaiyuanw/DS-TEST", "path": "src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java", "license": "apache-2.0", "size": 5560 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,998,071
public BufferedImage getDisplayedImage(boolean includeROI);
BufferedImage function(boolean includeROI);
/** * Returns the image currently displayed. * * @param includeROI Passed <code>true</code> to add ROI, * <code>false</code> otherwise. * @return See above. */
Returns the image currently displayed
getDisplayedImage
{ "repo_name": "will-moore/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewer.java", "license": "gpl-2.0", "size": 35755 }
[ "java.awt.image.BufferedImage" ]
import java.awt.image.BufferedImage;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
1,023,968
@Test public void testDataflowSideInputReaderBadRead() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); ExecutionContext executionContext = DataflowExecutionContext.withoutSideInputs(); TupleTag<Iterable<WindowedValue<Long>>> tag = new TupleTag<>(); PCollectionView<Long> view = PCollectionViewTesting.testingView( tag, new PCollectionViewTesting.LengthViewFn<Long>(), LONG_CODER); SideInputInfo sideInputInfo = SideInputUtils.createCollectionSideInputInfo( sourceInDefaultWindow(view, 1L, -43255L, 0L, 13L, 1975858L)); sideInputInfo.setTag("not the same tag at all"); DataflowSideInputReader sideInputReader = DataflowSideInputReader.of( Arrays.asList(sideInputInfo), options, executionContext); assertFalse(sideInputReader.contains(view)); }
void function() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); ExecutionContext executionContext = DataflowExecutionContext.withoutSideInputs(); TupleTag<Iterable<WindowedValue<Long>>> tag = new TupleTag<>(); PCollectionView<Long> view = PCollectionViewTesting.testingView( tag, new PCollectionViewTesting.LengthViewFn<Long>(), LONG_CODER); SideInputInfo sideInputInfo = SideInputUtils.createCollectionSideInputInfo( sourceInDefaultWindow(view, 1L, -43255L, 0L, 13L, 1975858L)); sideInputInfo.setTag(STR); DataflowSideInputReader sideInputReader = DataflowSideInputReader.of( Arrays.asList(sideInputInfo), options, executionContext); assertFalse(sideInputReader.contains(view)); }
/** * Tests that when a {@link PCollectionView} is not available in a * {@link DataflowSideInputReader}, it is reflected properly. */
Tests that when a <code>PCollectionView</code> is not available in a <code>DataflowSideInputReader</code>, it is reflected properly
testDataflowSideInputReaderBadRead
{ "repo_name": "dhananjaypatkar/DataflowJavaSDK", "path": "sdk/src/test/java/com/google/cloud/dataflow/sdk/runners/worker/DataflowSideInputReaderTest.java", "license": "apache-2.0", "size": 7350 }
[ "com.google.api.services.dataflow.model.SideInputInfo", "com.google.cloud.dataflow.sdk.options.PipelineOptions", "com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory", "com.google.cloud.dataflow.sdk.testing.PCollectionViewTesting", "com.google.cloud.dataflow.sdk.util.ExecutionContext", "com.google.cloud.dataflow.sdk.util.WindowedValue", "com.google.cloud.dataflow.sdk.values.PCollectionView", "com.google.cloud.dataflow.sdk.values.TupleTag", "java.util.Arrays", "org.junit.Assert" ]
import com.google.api.services.dataflow.model.SideInputInfo; import com.google.cloud.dataflow.sdk.options.PipelineOptions; import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; import com.google.cloud.dataflow.sdk.testing.PCollectionViewTesting; import com.google.cloud.dataflow.sdk.util.ExecutionContext; import com.google.cloud.dataflow.sdk.util.WindowedValue; import com.google.cloud.dataflow.sdk.values.PCollectionView; import com.google.cloud.dataflow.sdk.values.TupleTag; import java.util.Arrays; import org.junit.Assert;
import com.google.api.services.dataflow.model.*; import com.google.cloud.dataflow.sdk.options.*; import com.google.cloud.dataflow.sdk.testing.*; import com.google.cloud.dataflow.sdk.util.*; import com.google.cloud.dataflow.sdk.values.*; import java.util.*; import org.junit.*;
[ "com.google.api", "com.google.cloud", "java.util", "org.junit" ]
com.google.api; com.google.cloud; java.util; org.junit;
2,870,732
public void mergeSubSitemap(final CmsUUID entryId) { CmsRpcAction<CmsSitemapChange> mergeAction = new CmsRpcAction<CmsSitemapChange>() {
void function(final CmsUUID entryId) { CmsRpcAction<CmsSitemapChange> mergeAction = new CmsRpcAction<CmsSitemapChange>() {
/** * Merges a subsitemap at the given id back into this sitemap.<p> * * @param entryId the id of the sub sitemap entry */
Merges a subsitemap at the given id back into this sitemap
mergeSubSitemap
{ "repo_name": "sbonoc/opencms-core", "path": "src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java", "license": "lgpl-2.1", "size": 64474 }
[ "org.opencms.ade.sitemap.shared.CmsSitemapChange", "org.opencms.gwt.client.rpc.CmsRpcAction", "org.opencms.util.CmsUUID" ]
import org.opencms.ade.sitemap.shared.CmsSitemapChange; import org.opencms.gwt.client.rpc.CmsRpcAction; import org.opencms.util.CmsUUID;
import org.opencms.ade.sitemap.shared.*; import org.opencms.gwt.client.rpc.*; import org.opencms.util.*;
[ "org.opencms.ade", "org.opencms.gwt", "org.opencms.util" ]
org.opencms.ade; org.opencms.gwt; org.opencms.util;
1,643,057
SearchResultsDTO searchController(String query, String activeGroupId);
SearchResultsDTO searchController(String query, String activeGroupId);
/** * Searches the controller for the specified query string. * * @param query query * @param activeGroupId the id of the group currently selected in the editor * @return results */
Searches the controller for the specified query string
searchController
{ "repo_name": "mattyb149/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java", "license": "apache-2.0", "size": 87066 }
[ "org.apache.nifi.web.api.dto.search.SearchResultsDTO" ]
import org.apache.nifi.web.api.dto.search.SearchResultsDTO;
import org.apache.nifi.web.api.dto.search.*;
[ "org.apache.nifi" ]
org.apache.nifi;
2,231,400
@Function(attributes = Attribute.NOT_ENUMERABLE) public static double getTime(final Object self) { final NativeDate nd = getNativeDate(self); return (nd != null) ? nd.getTime() : Double.NaN; }
@Function(attributes = Attribute.NOT_ENUMERABLE) static double function(final Object self) { final NativeDate nd = getNativeDate(self); return (nd != null) ? nd.getTime() : Double.NaN; }
/** * ECMA 15.9.5.9 Date.prototype.getTime ( ) * * @param self self reference * @return time */
ECMA 15.9.5.9 Date.prototype.getTime ( )
getTime
{ "repo_name": "md-5/jdk10", "path": "src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDate.java", "license": "gpl-2.0", "size": 45416 }
[ "java.lang.Double" ]
import java.lang.Double;
import java.lang.*;
[ "java.lang" ]
java.lang;
865,653
public Map<String, Variable> getTable() { return table; }
Map<String, Variable> function() { return table; }
/** * Get symbold table * * @return */
Get symbold table
getTable
{ "repo_name": "coolking70/aviator", "path": "src/main/java/com/googlecode/aviator/lexer/SymbolTable.java", "license": "lgpl-3.0", "size": 1949 }
[ "com.googlecode.aviator.lexer.token.Variable", "java.util.Map" ]
import com.googlecode.aviator.lexer.token.Variable; import java.util.Map;
import com.googlecode.aviator.lexer.token.*; import java.util.*;
[ "com.googlecode.aviator", "java.util" ]
com.googlecode.aviator; java.util;
2,909,023
public Iterator iterator() { return new Iterator() { private int index = head; private int lastReturnedIndex = -1;
Iterator function() { return new Iterator() { private int index = head; private int lastReturnedIndex = -1;
/** * Returns an iterator over this buffer's elements. * * @return an iterator over this buffer's elements */
Returns an iterator over this buffer's elements
iterator
{ "repo_name": "leodmurillo/sonar", "path": "plugins/sonar-squid-java-plugin/test-resources/commons-collections-3.2.1/src/org/apache/commons/collections/buffer/UnboundedFifoBuffer.java", "license": "lgpl-3.0", "size": 9873 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
189,428
private void appendPointTaggedText( Coordinate coordinate, int level, Writer writer, PrecisionModel precisionModel) throws IOException { writer.write("POINT "); appendPointText(coordinate, level, writer, precisionModel); }
void function( Coordinate coordinate, int level, Writer writer, PrecisionModel precisionModel) throws IOException { writer.write(STR); appendPointText(coordinate, level, writer, precisionModel); }
/** * Converts a <code>Coordinate</code> to &lt;Point Tagged Text&gt; format, then appends it to * the writer. * * @param coordinate the <code>Coordinate</code> to process * @param writer the output writer to append to * @param precisionModel the <code>PrecisionModel</code> to use to convert from a precise * coordinate to an external coordinate */
Converts a <code>Coordinate</code> to &lt;Point Tagged Text&gt; format, then appends it to the writer
appendPointTaggedText
{ "repo_name": "geotools/geotools", "path": "modules/library/main/src/main/java/org/geotools/geometry/jts/WKTWriter2.java", "license": "lgpl-2.1", "size": 30217 }
[ "java.io.IOException", "java.io.Writer", "org.locationtech.jts.geom.Coordinate", "org.locationtech.jts.geom.PrecisionModel" ]
import java.io.IOException; import java.io.Writer; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.PrecisionModel;
import java.io.*; import org.locationtech.jts.geom.*;
[ "java.io", "org.locationtech.jts" ]
java.io; org.locationtech.jts;
1,266,806
@Override public boolean check(Document doc) throws XMLSignerException { if (doc == null || doc.getChildNodes().getLength() <= 0) { logger.error(xadesMessagesBundle.getString("error.xml.parameter.null", "Document doc")); throw new XMLSignerException( xadesMessagesBundle.getString("error.xml.parameter.null", "Document doc")); } return verify(doc); }
boolean function(Document doc) throws XMLSignerException { if (doc == null doc.getChildNodes().getLength() <= 0) { logger.error(xadesMessagesBundle.getString(STR, STR)); throw new XMLSignerException( xadesMessagesBundle.getString(STR, STR)); } return verify(doc); }
/** * XML signature validation using document. * The file must contains both content and signature * * @param doc document */
XML signature validation using document. The file must contains both content and signature
check
{ "repo_name": "demoiselle/signer", "path": "policy-impl-xades/src/main/java/org/demoiselle/signer/policy/impl/xades/xml/impl/XMLChecker.java", "license": "lgpl-3.0", "size": 44903 }
[ "org.demoiselle.signer.policy.impl.xades.XMLSignerException", "org.w3c.dom.Document" ]
import org.demoiselle.signer.policy.impl.xades.XMLSignerException; import org.w3c.dom.Document;
import org.demoiselle.signer.policy.impl.xades.*; import org.w3c.dom.*;
[ "org.demoiselle.signer", "org.w3c.dom" ]
org.demoiselle.signer; org.w3c.dom;
928,249
private void freeSendBuffers() { synchronized (sendQueue) { sendBuffer = null; lastActiveSendBuffer = null; while (sendQueue.size() > 0) bufferAllocator.put((ByteBuffer)sendQueue.removeFirst()); } }
void function() { synchronized (sendQueue) { sendBuffer = null; lastActiveSendBuffer = null; while (sendQueue.size() > 0) bufferAllocator.put((ByteBuffer)sendQueue.removeFirst()); } }
/** * Free all send buffers (return them to the cached buffer allocator). */
Free all send buffers (return them to the cached buffer allocator)
freeSendBuffers
{ "repo_name": "epicsdeb/caj", "path": "src/com/cosylab/epics/caj/impl/CATransport.java", "license": "gpl-2.0", "size": 27351 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,619,650
public void setNoSql(NoSqlMetadata noSql) { this.m_noSql = noSql; }
void function(NoSqlMetadata noSql) { this.m_noSql = noSql; }
/** * INTERNAL: * Used for OX mapping. */
Used for OX mapping
setNoSql
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/ClassAccessor.java", "license": "epl-1.0", "size": 82197 }
[ "org.eclipse.persistence.internal.jpa.metadata.nosql.NoSqlMetadata" ]
import org.eclipse.persistence.internal.jpa.metadata.nosql.NoSqlMetadata;
import org.eclipse.persistence.internal.jpa.metadata.nosql.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,185,869
void onUpdatedChannels(List<ChannelData> channels);
void onUpdatedChannels(List<ChannelData> channels);
/** * Invokes when the channels have been modified. Updates the values * displayed in the measurement tool. * * @param channels The channels to handle. */
Invokes when the channels have been modified. Updates the values displayed in the measurement tool
onUpdatedChannels
{ "repo_name": "bramalingam/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewer.java", "license": "gpl-2.0", "size": 35470 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,816,173
public static void closeStatement(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { logger.trace("Could not close JDBC Statement", ex); } catch (Throwable ex) { // We don't trust the JDBC driver: It might throw RuntimeException or Error. logger.trace("Unexpected exception on closing JDBC Statement", ex); } } }
static void function(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { logger.trace(STR, ex); } catch (Throwable ex) { logger.trace(STR, ex); } } }
/** * Close the given JDBC Statement and ignore any thrown exception. * This is useful for typical finally blocks in manual JDBC code. * @param stmt the JDBC Statement to close (may be {@code null}) */
Close the given JDBC Statement and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code
closeStatement
{ "repo_name": "Arabidopsis-Information-Portal/intermine", "path": "bio/sources/araport/araport-chado-db/main/src/org/intermine/bio/dataloader/util/JdbcUtils.java", "license": "lgpl-2.1", "size": 2532 }
[ "java.sql.SQLException", "java.sql.Statement" ]
import java.sql.SQLException; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,563,046
public void setObjectType(ObjectType objectType) { this.objectType = objectType; }
void function(ObjectType objectType) { this.objectType = objectType; }
/** * Sets the objectType attribute value. * * @param objectType The objectType to set. */
Sets the objectType attribute value
setObjectType
{ "repo_name": "bhutchinson/kfs", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/businessobject/VoucherSourceAccountingLine.java", "license": "agpl-3.0", "size": 3305 }
[ "org.kuali.kfs.coa.businessobject.ObjectType" ]
import org.kuali.kfs.coa.businessobject.ObjectType;
import org.kuali.kfs.coa.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,679,079
InetSocketAddress getMyAddress();
InetSocketAddress getMyAddress();
/** * Get server address * * @return Address used by this server */
Get server address
getMyAddress
{ "repo_name": "aljoscha/giraph", "path": "src/main/java/org/apache/giraph/comm/MasterServer.java", "license": "apache-2.0", "size": 1139 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
1,754,279
public void setHAlignmentFlags(String alignment) { try { switch (Integer.parseInt(alignment)) { case ComponentConstants.GRAVITY_LEFT: alignH = HorizontalAlignment.Left; break; case ComponentConstants.GRAVITY_CENTER_HORIZONTAL: alignH = HorizontalAlignment.Center; break; case ComponentConstants.GRAVITY_RIGHT: alignH = HorizontalAlignment.Right; break; default: // This error should not happen because the higher level // setter for HorizontalAlignment should screen out illegal inputs. ErrorReporter.reportError(MESSAGES.badValueForHorizontalAlignment(alignment)); } } catch (NumberFormatException e) { // As above, this error should not happen ErrorReporter.reportError(MESSAGES.badValueForHorizontalAlignment(alignment)); } }
void function(String alignment) { try { switch (Integer.parseInt(alignment)) { case ComponentConstants.GRAVITY_LEFT: alignH = HorizontalAlignment.Left; break; case ComponentConstants.GRAVITY_CENTER_HORIZONTAL: alignH = HorizontalAlignment.Center; break; case ComponentConstants.GRAVITY_RIGHT: alignH = HorizontalAlignment.Right; break; default: ErrorReporter.reportError(MESSAGES.badValueForHorizontalAlignment(alignment)); } } catch (NumberFormatException e) { ErrorReporter.reportError(MESSAGES.badValueForHorizontalAlignment(alignment)); } }
/** * Set the layout flags centerH and centerV that govern whether the layout performs * horizontal or vertical centering. Called by the arrangement that uses this layout * @param centering is the string value of the centering property "0", "1", "2", or "3" */
Set the layout flags centerH and centerV that govern whether the layout performs horizontal or vertical centering. Called by the arrangement that uses this layout
setHAlignmentFlags
{ "repo_name": "AppScale/appinventor", "path": "src/com/google/appinventor/client/editor/simple/components/MockHVLayoutBase.java", "license": "mit", "size": 29139 }
[ "com.google.appinventor.client.ErrorReporter", "com.google.appinventor.client.Ode", "com.google.appinventor.components.common.ComponentConstants" ]
import com.google.appinventor.client.ErrorReporter; import com.google.appinventor.client.Ode; import com.google.appinventor.components.common.ComponentConstants;
import com.google.appinventor.client.*; import com.google.appinventor.components.common.*;
[ "com.google.appinventor" ]
com.google.appinventor;
1,107,914
private boolean canMoveModerately( Reference initialization, Reference reference) { // Check if declaration can be inlined without passing // any side-effect causing nodes. Iterator<Node> it; if (NodeUtil.isNameDeclaration(initialization.getParent())) { it = NodeIterators.LocalVarMotion.forVar( compiler, initialization.getNode(), // NAME initialization.getParent(), // VAR/LET/CONST initialization.getGrandparent()); // VAR/LET/CONST container } else if (initialization.getParent().isAssign()) { checkState(initialization.getGrandparent().isExprResult()); it = NodeIterators.LocalVarMotion.forAssign( compiler, initialization.getNode(), // NAME initialization.getParent(), // ASSIGN initialization.getGrandparent(), // EXPR_RESULT initialization.getGrandparent().getParent()); // EXPR container } else { throw new IllegalStateException("Unexpected initialization parent\n" + initialization.getParent().toStringTree()); } Node targetName = reference.getNode(); while (it.hasNext()) { Node curNode = it.next(); if (curNode == targetName) { return true; } } return false; }
boolean function( Reference initialization, Reference reference) { Iterator<Node> it; if (NodeUtil.isNameDeclaration(initialization.getParent())) { it = NodeIterators.LocalVarMotion.forVar( compiler, initialization.getNode(), initialization.getParent(), initialization.getGrandparent()); } else if (initialization.getParent().isAssign()) { checkState(initialization.getGrandparent().isExprResult()); it = NodeIterators.LocalVarMotion.forAssign( compiler, initialization.getNode(), initialization.getParent(), initialization.getGrandparent(), initialization.getGrandparent().getParent()); } else { throw new IllegalStateException(STR + initialization.getParent().toStringTree()); } Node targetName = reference.getNode(); while (it.hasNext()) { Node curNode = it.next(); if (curNode == targetName) { return true; } } return false; }
/** * If the value of a variable is not constant, then it may read or modify * state. Therefore it cannot be moved past anything else that may modify * the value being read or read values that are modified. */
If the value of a variable is not constant, then it may read or modify state. Therefore it cannot be moved past anything else that may modify the value being read or read values that are modified
canMoveModerately
{ "repo_name": "GoogleChromeLabs/chromeos_smart_card_connector", "path": "third_party/closure-compiler/src/src/com/google/javascript/jscomp/InlineVariables.java", "license": "apache-2.0", "size": 25060 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node", "java.util.Iterator" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import java.util.Iterator;
import com.google.common.base.*; import com.google.javascript.rhino.*; import java.util.*;
[ "com.google.common", "com.google.javascript", "java.util" ]
com.google.common; com.google.javascript; java.util;
1,029,107
public boolean onFocusChange(int id, Window window, boolean focus) { return false; } /** * Implement this callback to be alerted when a window corresponding to the * id receives a key event. This callback will occur before the window * handles the event with {@link Window#dispatchKeyEvent(KeyEvent)}. * * @param id * The id of the window, provided as a courtesy. * @param view * The window about to receive the key event. * @param event * The key event. * @return Return true to cancel the window from handling the key event, or * false to let the window handle the key event. * @see {@link Window#dispatchKeyEvent(KeyEvent)}
boolean function(int id, Window window, boolean focus) { return false; } /** * Implement this callback to be alerted when a window corresponding to the * id receives a key event. This callback will occur before the window * handles the event with {@link Window#dispatchKeyEvent(KeyEvent)}. * * @param id * The id of the window, provided as a courtesy. * @param view * The window about to receive the key event. * @param event * The key event. * @return Return true to cancel the window from handling the key event, or * false to let the window handle the key event. * @see {@link Window#dispatchKeyEvent(KeyEvent)}
/** * Implement this callback to be alerted when a window corresponding to the * id is about to have its focus changed. This callback will occur before * the window's focus is changed. * * @param id * The id of the window, provided as a courtesy. * @param view * The window about to be brought to the front. * @param focus * Whether the window is gaining or losing focus. * @return Return true to cancel the window's focus from being changed, or * false to continue. * @see #focus(int) */
Implement this callback to be alerted when a window corresponding to the id is about to have its focus changed. This callback will occur before the window's focus is changed
onFocusChange
{ "repo_name": "fatangare/LogcatViewer", "path": "standOut/src/main/java/wei/mark/standout/StandOutWindow.java", "license": "gpl-3.0", "size": 59607 }
[ "android.view.KeyEvent" ]
import android.view.KeyEvent;
import android.view.*;
[ "android.view" ]
android.view;
658,948
public static void clearMaintenance(Rig rig, org.hibernate.Session db) { if (commsProxies == null) return; for (RigCommunicationProxy proxy : commsProxies) { proxy.clearMaintenance(rig, db); } }
static void function(Rig rig, org.hibernate.Session db) { if (commsProxies == null) return; for (RigCommunicationProxy proxy : commsProxies) { proxy.clearMaintenance(rig, db); } }
/** * Calls clear maintenance operation. * * @param ses session information * @param db database session */
Calls clear maintenance operation
clearMaintenance
{ "repo_name": "sahara-labs/scheduling-server", "path": "RigManagement/src/au/edu/uts/eng/remotelabs/schedserver/rigmanagement/RigManagementActivator.java", "license": "bsd-3-clause", "size": 9897 }
[ "au.edu.uts.eng.remotelabs.schedserver.dataaccess.entities.Rig", "au.edu.uts.eng.remotelabs.schedserver.dataaccess.entities.Session", "au.edu.uts.eng.remotelabs.schedserver.dataaccess.listener.RigCommunicationProxy" ]
import au.edu.uts.eng.remotelabs.schedserver.dataaccess.entities.Rig; import au.edu.uts.eng.remotelabs.schedserver.dataaccess.entities.Session; import au.edu.uts.eng.remotelabs.schedserver.dataaccess.listener.RigCommunicationProxy;
import au.edu.uts.eng.remotelabs.schedserver.dataaccess.entities.*; import au.edu.uts.eng.remotelabs.schedserver.dataaccess.listener.*;
[ "au.edu.uts" ]
au.edu.uts;
36,143
@Test public void testGetNetworkUpdatesIntIntSetOfNetworkUpdateType() { Network network = client.getNetworkUpdates(EnumSet.of(NetworkUpdateType.SHARED_ITEM, NetworkUpdateType.CONNECTION_UPDATE), 1, 5); assertNotNull("Network Updates should never be null.", network); }
void function() { Network network = client.getNetworkUpdates(EnumSet.of(NetworkUpdateType.SHARED_ITEM, NetworkUpdateType.CONNECTION_UPDATE), 1, 5); assertNotNull(STR, network); }
/** * Test method for {@link com.google.code.linkedinapi.client.impl.LinkedInApiJaxbClient#getNetworkUpdates(java.util.Set, int, int)}. */
Test method for <code>com.google.code.linkedinapi.client.impl.LinkedInApiJaxbClient#getNetworkUpdates(java.util.Set, int, int)</code>
testGetNetworkUpdatesIntIntSetOfNetworkUpdateType
{ "repo_name": "shisoft/LinkedIn-J", "path": "core/src/test/java/com/google/code/linkedinapi/client/LinkedInApiClientTest.java", "license": "apache-2.0", "size": 36077 }
[ "com.google.code.linkedinapi.client.enumeration.NetworkUpdateType", "com.google.code.linkedinapi.schema.Network", "java.util.EnumSet" ]
import com.google.code.linkedinapi.client.enumeration.NetworkUpdateType; import com.google.code.linkedinapi.schema.Network; import java.util.EnumSet;
import com.google.code.linkedinapi.client.enumeration.*; import com.google.code.linkedinapi.schema.*; import java.util.*;
[ "com.google.code", "java.util" ]
com.google.code; java.util;
1,616,439
public boolean isAckSeen() { if (lastAckReceivedCSeqNumber == null && lastResponseStatusCode == Response.OK) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug("SIPDialog::isAckSeen:"+ this + "lastAckReceived is null -- returning false"); } return false; } else if (lastResponseMethod == null) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug("SIPDialog::isAckSeen:"+ this + "lastResponse is null -- returning false"); } return false; } else if (lastAckReceivedCSeqNumber == null && lastResponseStatusCode / 100 > 2) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug("SIPDialog::isAckSeen:"+ this + "lastResponse statusCode " + lastResponseStatusCode); } return true; } else { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug("SIPDialog::isAckSeen:lastAckReceivedCSeqNumber = " + lastAckReceivedCSeqNumber + " remoteCSeqNumber = " + this.getRemoteSeqNumber()); } return this.lastAckReceivedCSeqNumber != null && this.lastAckReceivedCSeqNumber >= this .getRemoteSeqNumber(); } }
boolean function() { if (lastAckReceivedCSeqNumber == null && lastResponseStatusCode == Response.OK) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug(STR+ this + STR); } return false; } else if (lastResponseMethod == null) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug(STR+ this + STR); } return false; } else if (lastAckReceivedCSeqNumber == null && lastResponseStatusCode / 100 > 2) { if (logger.isLoggingEnabled( LogWriter.TRACE_DEBUG)) { logger.logDebug(STR+ this + STR + lastResponseStatusCode); } return true; } else { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug(STR + lastAckReceivedCSeqNumber + STR + this.getRemoteSeqNumber()); } return this.lastAckReceivedCSeqNumber != null && this.lastAckReceivedCSeqNumber >= this .getRemoteSeqNumber(); } }
/** * Return true if the dialog has already seen the ack. * * @return flag that records if the ack has been seen. */
Return true if the dialog has already seen the ack
isAckSeen
{ "repo_name": "fhg-fokus-nubomedia/signaling-plane", "path": "modules/lib-sip/src/main/java/gov/nist/javax/sip/stack/SIPDialog.java", "license": "apache-2.0", "size": 170278 }
[ "gov.nist.core.LogWriter", "javax.sip.message.Response" ]
import gov.nist.core.LogWriter; import javax.sip.message.Response;
import gov.nist.core.*; import javax.sip.message.*;
[ "gov.nist.core", "javax.sip" ]
gov.nist.core; javax.sip;
1,082,740
default void preRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String description) throws IOException {}
default void preRequestLock(ObserverContext<MasterCoprocessorEnvironment> ctx, String namespace, TableName tableName, RegionInfo[] regionInfos, String description) throws IOException {}
/** * Called before new LockProcedure is queued. * @param ctx the environment to interact with the framework and master */
Called before new LockProcedure is queued
preRequestLock
{ "repo_name": "apurtell/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java", "license": "apache-2.0", "size": 74501 }
[ "java.io.IOException", "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.client.RegionInfo" ]
import java.io.IOException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
923,164
public WorkspacePatch withTags(Map<String, String> tags) { this.tags = tags; return this; }
WorkspacePatch function(Map<String, String> tags) { this.tags = tags; return this; }
/** * Set the tags property: Resource tags. Optional. * * @param tags the tags value to set. * @return the WorkspacePatch object itself. */
Set the tags property: Resource tags. Optional
withTags
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java", "license": "mit", "size": 10388 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,088,769
public void addNewInstitutionalProposalAttachment() { this.newAttachment.setDocumentStatusCode(AttachmentDocumentStatus.ACTIVE.getCode()); Map<String, String> criteria = new HashMap<String, String>(); criteria.put(Constants.PROPOSAL_NUMBER, this.getInstitutionalProposal().getProposalNumber()); Collection<InstitutionalProposalAttachment> allAttachments = getBusinessObjectService().findMatching(InstitutionalProposalAttachment.class, criteria); setAttachmentNumber(allAttachments); this.syncNewFiles(Collections.singletonList(this.getNewAttachment())); this.getInstitutionalProposal().addAttachment(this.newAttachment); getBusinessObjectService().save(this.newAttachment); this.initNewAttachment(); }
void function() { this.newAttachment.setDocumentStatusCode(AttachmentDocumentStatus.ACTIVE.getCode()); Map<String, String> criteria = new HashMap<String, String>(); criteria.put(Constants.PROPOSAL_NUMBER, this.getInstitutionalProposal().getProposalNumber()); Collection<InstitutionalProposalAttachment> allAttachments = getBusinessObjectService().findMatching(InstitutionalProposalAttachment.class, criteria); setAttachmentNumber(allAttachments); this.syncNewFiles(Collections.singletonList(this.getNewAttachment())); this.getInstitutionalProposal().addAttachment(this.newAttachment); getBusinessObjectService().save(this.newAttachment); this.initNewAttachment(); }
/** * Adds the "new" IPAttachment to the InstitutionalProposal. Before * adding this method executes validation. If the validation fails the attachment is not added. */
Adds the "new" IPAttachment to the InstitutionalProposal. Before adding this method executes validation. If the validation fails the attachment is not added
addNewInstitutionalProposalAttachment
{ "repo_name": "mukadder/kc", "path": "coeus-impl/src/main/java/org/kuali/kra/institutionalproposal/attachments/InstitutionalProposalAttachmentFormBean.java", "license": "agpl-3.0", "size": 7268 }
[ "java.util.Collection", "java.util.Collections", "java.util.HashMap", "java.util.Map", "org.kuali.coeus.common.framework.attachment.AttachmentDocumentStatus", "org.kuali.kra.infrastructure.Constants" ]
import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.kuali.coeus.common.framework.attachment.AttachmentDocumentStatus; import org.kuali.kra.infrastructure.Constants;
import java.util.*; import org.kuali.coeus.common.framework.attachment.*; import org.kuali.kra.infrastructure.*;
[ "java.util", "org.kuali.coeus", "org.kuali.kra" ]
java.util; org.kuali.coeus; org.kuali.kra;
2,599,795
public static WaveData create(InputStream is) { try { return create( AudioSystem.getAudioInputStream(is)); } catch (Exception e) { e.printStackTrace(); return null; } }
static WaveData function(InputStream is) { try { return create( AudioSystem.getAudioInputStream(is)); } catch (Exception e) { e.printStackTrace(); return null; } }
/** * Creates a WaveData container from the specified inputstream * * @param is InputStream to read from * @return WaveData containing data, or null if a failure occured */
Creates a WaveData container from the specified inputstream
create
{ "repo_name": "elanmajkrzak/gamecraft2016", "path": "src/gamecraft_2016/WaveData.java", "license": "mit", "size": 7586 }
[ "java.io.InputStream", "javax.sound.sampled.AudioSystem" ]
import java.io.InputStream; import javax.sound.sampled.AudioSystem;
import java.io.*; import javax.sound.sampled.*;
[ "java.io", "javax.sound" ]
java.io; javax.sound;
1,192,805
public void processZipContent(String zipFilePath, InputStream zipIn, ViewHandlerConfig viewHandlerConfig, HttpServletRequest req, HttpServletResponse resp) { // not yet supported Logger.getLogger(getClass()).warn("reading from ZIP archive not supported by ViewHandler " + this.getClass().getName()); }
void function(String zipFilePath, InputStream zipIn, ViewHandlerConfig viewHandlerConfig, HttpServletRequest req, HttpServletResponse resp) { Logger.getLogger(getClass()).warn(STR + this.getClass().getName()); }
/** * Create the HTML response for viewing the given file contained in a ZIP archive.. * * @param zipFilePath path of the ZIP entry * @param zipIn the InputStream for the file extracted from a ZIP archive * @param req the servlet request * @param resp the servlet response */
Create the HTML response for viewing the given file contained in a ZIP archive.
processZipContent
{ "repo_name": "visik7/webfilesys", "path": "src/main/java/de/webfilesys/viewhandler/GeoTrackViewHandler.java", "license": "gpl-3.0", "size": 21681 }
[ "de.webfilesys.ViewHandlerConfig", "java.io.InputStream", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.log4j.Logger" ]
import de.webfilesys.ViewHandlerConfig; import java.io.InputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger;
import de.webfilesys.*; import java.io.*; import javax.servlet.http.*; import org.apache.log4j.*;
[ "de.webfilesys", "java.io", "javax.servlet", "org.apache.log4j" ]
de.webfilesys; java.io; javax.servlet; org.apache.log4j;
514,196
public List<RectangleNode> getRectangleNodes() { return rectangleNodes; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Coordinate Transformation
List<RectangleNode> function() { return rectangleNodes; }
/** * Returns the set of rectangle nodes in the rectangle overlap graph, sorted by their rectangle's x coordinate. */
Returns the set of rectangle nodes in the rectangle overlap graph, sorted by their rectangle's x coordinate
getRectangleNodes
{ "repo_name": "eNBeWe/elk", "path": "plugins/org.eclipse.elk.alg.common/src/org/eclipse/elk/alg/common/overlaps/RectangleStripOverlapRemover.java", "license": "epl-1.0", "size": 15389 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,980,505
protected Object cacheLoader(Object key) { Object value = get(key); if (value != null) return value; CacheLoader loader = _config.getCacheLoader(); Object arg = null; value = (loader != null) ? loader.load(key) : null; if (value != null) put(key, value); notifyLoad(key); return value; }
Object function(Object key) { Object value = get(key); if (value != null) return value; CacheLoader loader = _config.getCacheLoader(); Object arg = null; value = (loader != null) ? loader.load(key) : null; if (value != null) put(key, value); notifyLoad(key); return value; }
/** * Places an item in the cache from the loader unless the item is in cache already. */
Places an item in the cache from the loader unless the item is in cache already
cacheLoader
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/distcache/AbstractCache.java", "license": "gpl-2.0", "size": 28948 }
[ "javax.cache.CacheLoader" ]
import javax.cache.CacheLoader;
import javax.cache.*;
[ "javax.cache" ]
javax.cache;
62,075
private void unRegistrateMetricsMBean() { if (persistenceMetricsMbeanName == null) return; assert !U.IGNITE_MBEANS_DISABLED; try { cctx.kernalContext().config().getMBeanServer().unregisterMBean(persistenceMetricsMbeanName); persistenceMetricsMbeanName = null; } catch (Throwable e) { U.error(log, "Failed to unregister " + MBEAN_NAME + " MBean.", e); } }
void function() { if (persistenceMetricsMbeanName == null) return; assert !U.IGNITE_MBEANS_DISABLED; try { cctx.kernalContext().config().getMBeanServer().unregisterMBean(persistenceMetricsMbeanName); persistenceMetricsMbeanName = null; } catch (Throwable e) { U.error(log, STR + MBEAN_NAME + STR, e); } }
/** * Unregister metrics MBean. */
Unregister metrics MBean
unRegistrateMetricsMBean
{ "repo_name": "ntikhonov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java", "license": "apache-2.0", "size": 114957 }
[ "org.apache.ignite.internal.util.typedef.internal.U" ]
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.util.typedef.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,859,191
public Iterator<Organisation> iterator(long first, long count) { try { List<Organisation> allOrganisations = securityService.getOrganisations(); return allOrganisations.subList((int) first, (int) Math.min(first + count, allOrganisations.size())).iterator(); } catch (Throwable e) { throw new WebApplicationException(String.format( "Failed to load the organisations from index (%d) to (%d)", first, first + count - 1), e); } }
Iterator<Organisation> function(long first, long count) { try { List<Organisation> allOrganisations = securityService.getOrganisations(); return allOrganisations.subList((int) first, (int) Math.min(first + count, allOrganisations.size())).iterator(); } catch (Throwable e) { throw new WebApplicationException(String.format( STR, first, first + count - 1), e); } }
/** * Retrieves the matching organisations from the database starting with * index <code>first</code> and ending with <code>first+count</code>. * * @param first the index of the first entry to return * @param count the number of the entries to return * * @return the organisations retrieved from the database starting with index * <code>first</code> and ending with <code>first+count</code> * * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(long, long) */
Retrieves the matching organisations from the database starting with index <code>first</code> and ending with <code>first+count</code>
iterator
{ "repo_name": "marcusportmann/mmp-java", "path": "src/mmp-application-wicket/src/main/java/guru/mmp/application/web/template/data/OrganisationDataProvider.java", "license": "apache-2.0", "size": 3624 }
[ "guru.mmp.application.security.Organisation", "guru.mmp.application.web.WebApplicationException", "java.util.Iterator", "java.util.List" ]
import guru.mmp.application.security.Organisation; import guru.mmp.application.web.WebApplicationException; import java.util.Iterator; import java.util.List;
import guru.mmp.application.security.*; import guru.mmp.application.web.*; import java.util.*;
[ "guru.mmp.application", "java.util" ]
guru.mmp.application; java.util;
940,802
protected boolean checkPS(List<ValidationError> errors) { // 6.2.4 and 6.2.5 no PS if (this.xobject.getItem(COSName.getPDFName("PS")) != null) { errors.add(new ValidationError( ValidationConstants.ERROR_GRAPHIC_UNEXPECTED_KEY, "Unexpected 'PS' Key")); return false; } return true; }
boolean function(List<ValidationError> errors) { if (this.xobject.getItem(COSName.getPDFName("PS")) != null) { errors.add(new ValidationError( ValidationConstants.ERROR_GRAPHIC_UNEXPECTED_KEY, STR)); return false; } return true; }
/** * Check if there are no PS entry in the Form XObject dictionary * * @param errors * the list of error to update if the validation fails. * @return true if PS entry is missing, false otherwise */
Check if there are no PS entry in the Form XObject dictionary
checkPS
{ "repo_name": "gbm-bailleul/padaf", "path": "preflight/src/main/java/net/padaf/preflight/graphics/XObjFormValidator.java", "license": "apache-2.0", "size": 9612 }
[ "java.util.List", "net.padaf.preflight.ValidationConstants", "net.padaf.preflight.ValidationResult", "org.apache.pdfbox.cos.COSName" ]
import java.util.List; import net.padaf.preflight.ValidationConstants; import net.padaf.preflight.ValidationResult; import org.apache.pdfbox.cos.COSName;
import java.util.*; import net.padaf.preflight.*; import org.apache.pdfbox.cos.*;
[ "java.util", "net.padaf.preflight", "org.apache.pdfbox" ]
java.util; net.padaf.preflight; org.apache.pdfbox;
2,321,083
public String applyModification() { final String idModification = this.getParam("id"); final String newValue = this.getParam("newValue"); Iterator < ITabController > controller = this.tabControllers.iterator(); while (controller.hasNext()) { ITabController iStemController = controller.next(); iStemController.applyModification(idModification, newValue); } XmlProducer producer = new XmlProducer(); producer.setTarget(new Status(Boolean.TRUE)); producer.setTypesOfTarget(Status.class); return this.xmlProducerWrapper.wrap(producer); }
String function() { final String idModification = this.getParam("id"); final String newValue = this.getParam(STR); Iterator < ITabController > controller = this.tabControllers.iterator(); while (controller.hasNext()) { ITabController iStemController = controller.next(); iStemController.applyModification(idModification, newValue); } XmlProducer producer = new XmlProducer(); producer.setTarget(new Status(Boolean.TRUE)); producer.setTypesOfTarget(Status.class); return this.xmlProducerWrapper.wrap(producer); }
/** * Apply changes made on the attribute that raised an exception. * * @return the result. */
Apply changes made on the attribute that raised an exception
applyModification
{ "repo_name": "GIP-RECIA/esco-grouper-ui", "path": "metier/esco-web/src/main/java/org/esco/grouperui/web/controllers/StemController.java", "license": "apache-2.0", "size": 28998 }
[ "java.util.Iterator", "org.esco.grouperui.web.beans.Status", "org.esco.grouperui.web.plugins.ITabController", "org.esco.grouperui.web.utils.XmlProducer" ]
import java.util.Iterator; import org.esco.grouperui.web.beans.Status; import org.esco.grouperui.web.plugins.ITabController; import org.esco.grouperui.web.utils.XmlProducer;
import java.util.*; import org.esco.grouperui.web.beans.*; import org.esco.grouperui.web.plugins.*; import org.esco.grouperui.web.utils.*;
[ "java.util", "org.esco.grouperui" ]
java.util; org.esco.grouperui;
1,243,330
public static void main(String[] args) throws Exception { ToolRunner.run(HBaseConfiguration.create(), new TagWordStatsMR(), args); } /** * {@inheritDoc}
static void function(String[] args) throws Exception { ToolRunner.run(HBaseConfiguration.create(), new TagWordStatsMR(), args); } /** * {@inheritDoc}
/** * The main. */
The main
main
{ "repo_name": "fozziethebeat/C-Cat", "path": "core/src/main/java/gov/llnl/ontology/mapreduce/stats/TagWordStatsMR.java", "license": "gpl-2.0", "size": 4921 }
[ "org.apache.hadoop.hbase.HBaseConfiguration", "org.apache.hadoop.util.ToolRunner" ]
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
895,270
public void addAll(Collection<String> collection){ this.set.addAll(collection); }
void function(Collection<String> collection){ this.set.addAll(collection); }
/** * Add a set of Comment id to this IdSet. * @param collection : which is a Collection of Strings. */
Add a set of Comment id to this IdSet
addAll
{ "repo_name": "YiluSu/MyApp", "path": "src/model/IdSet.java", "license": "apache-2.0", "size": 890 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
81,427
public Lock getStateReadLock() { return stateLock.readLock(); }
Lock function() { return stateLock.readLock(); }
/** * Retrieve read lock for build state * @return Read lock */
Retrieve read lock for build state
getStateReadLock
{ "repo_name": "aguadev/aguadev", "path": "html/dojo-1.8.3/dwb/src/main/java/org/dtk/resources/build/manager/BuildStatus.java", "license": "mit", "size": 2439 }
[ "java.util.concurrent.locks.Lock" ]
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.*;
[ "java.util" ]
java.util;
357,150
public TreePath[] getExpandedTreePaths() { ArrayList items = new ArrayList(); internalCollectExpandedItems(items, getControl()); ArrayList result = new ArrayList(items.size()); for (Iterator it = items.iterator(); it.hasNext();) { Item item = (Item) it.next(); TreePath treePath = getTreePathFromItem(item); if (treePath != null) { result.add(treePath); } } return (TreePath[]) result.toArray(new TreePath[items.size()]); }
TreePath[] function() { ArrayList items = new ArrayList(); internalCollectExpandedItems(items, getControl()); ArrayList result = new ArrayList(items.size()); for (Iterator it = items.iterator(); it.hasNext();) { Item item = (Item) it.next(); TreePath treePath = getTreePathFromItem(item); if (treePath != null) { result.add(treePath); } } return (TreePath[]) result.toArray(new TreePath[items.size()]); }
/** * Returns a list of tree paths corresponding to expanded nodes in this * viewer's tree, including currently hidden ones that are marked as * expanded but are under a collapsed ancestor. * <p> * This method is typically used when preserving the interesting state of a * viewer; <code>setExpandedElements</code> is used during the restore. * </p> * * @return the array of expanded tree paths * @see #setExpandedElements * * @since 3.2 */
Returns a list of tree paths corresponding to expanded nodes in this viewer's tree, including currently hidden ones that are marked as expanded but are under a collapsed ancestor. This method is typically used when preserving the interesting state of a viewer; <code>setExpandedElements</code> is used during the restore.
getExpandedTreePaths
{ "repo_name": "neelance/jface4ruby", "path": "jface4ruby/src/org/eclipse/jface/viewers/AbstractTreeViewer.java", "license": "epl-1.0", "size": 91053 }
[ "java.util.ArrayList", "java.util.Iterator", "org.eclipse.swt.widgets.Item" ]
import java.util.ArrayList; import java.util.Iterator; import org.eclipse.swt.widgets.Item;
import java.util.*; import org.eclipse.swt.widgets.*;
[ "java.util", "org.eclipse.swt" ]
java.util; org.eclipse.swt;
677,678
public static NabuccoPropertyDescriptor getPropertyDescriptor(String propertyName) { return PropertyCache.getInstance().retrieve(TaskSearchRq.class).getProperty(propertyName); }
static NabuccoPropertyDescriptor function(String propertyName) { return PropertyCache.getInstance().retrieve(TaskSearchRq.class).getProperty(propertyName); }
/** * Getter for the PropertyDescriptor. * * @param propertyName the String. * @return the NabuccoPropertyDescriptor. */
Getter for the PropertyDescriptor
getPropertyDescriptor
{ "repo_name": "NABUCCO/org.nabucco.framework.workflow", "path": "org.nabucco.framework.workflow.facade.message/src/main/gen/org/nabucco/framework/workflow/facade/message/datatype/task/search/TaskSearchRq.java", "license": "epl-1.0", "size": 6004 }
[ "org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor", "org.nabucco.framework.base.facade.datatype.property.PropertyCache" ]
import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor; import org.nabucco.framework.base.facade.datatype.property.PropertyCache;
import org.nabucco.framework.base.facade.datatype.property.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
682,329
private void populatesLanguages(Connection conn, List<AbstractContest> contests) throws SQLException, PersistenceException { if (contests.size() == 0) { return; } Map<Long, Language> languageMap = PersistenceManager.getInstance().getLanguagePersistence().getLanguageMap(); PreparedStatement ps = null; try { Map<Long, AbstractContest> contestMap = new HashMap<Long, AbstractContest>(); List<Long> contestIds = new ArrayList<Long>(); for (AbstractContest contest : contests) { contestIds.add(contest.getId()); contestMap.put(contest.getId(), contest); contest.setLanguages(new ArrayList<Language>()); } ps = conn.prepareStatement(MessageFormat.format(ContestPersistenceImpl.GET_CONTEST_LANGUAGE, new Object[] {Database.createNumberValues(contestIds)})); ResultSet rs = ps.executeQuery(); while (rs.next()) { Long contestId = new Long(rs.getLong(DatabaseConstants.CONTEST_LANGUAGE_CONTEST_ID)); Long languageId = new Long(rs.getLong(DatabaseConstants.CONTEST_LANGUAGE_LANGUAGE_ID)); contestMap.get(contestId).getLanguages().add(languageMap.get(languageId)); } } finally { Database.dispose(ps); } }
void function(Connection conn, List<AbstractContest> contests) throws SQLException, PersistenceException { if (contests.size() == 0) { return; } Map<Long, Language> languageMap = PersistenceManager.getInstance().getLanguagePersistence().getLanguageMap(); PreparedStatement ps = null; try { Map<Long, AbstractContest> contestMap = new HashMap<Long, AbstractContest>(); List<Long> contestIds = new ArrayList<Long>(); for (AbstractContest contest : contests) { contestIds.add(contest.getId()); contestMap.put(contest.getId(), contest); contest.setLanguages(new ArrayList<Language>()); } ps = conn.prepareStatement(MessageFormat.format(ContestPersistenceImpl.GET_CONTEST_LANGUAGE, new Object[] {Database.createNumberValues(contestIds)})); ResultSet rs = ps.executeQuery(); while (rs.next()) { Long contestId = new Long(rs.getLong(DatabaseConstants.CONTEST_LANGUAGE_CONTEST_ID)); Long languageId = new Long(rs.getLong(DatabaseConstants.CONTEST_LANGUAGE_LANGUAGE_ID)); contestMap.get(contestId).getLanguages().add(languageMap.get(languageId)); } } finally { Database.dispose(ps); } }
/** * Populates a Limit with given ResultSet. * * @param rs * @return a Limit instance * @throws SQLException * @throws PersistenceException */
Populates a Limit with given ResultSet
populatesLanguages
{ "repo_name": "ghitza94/zoj", "path": "judge_server/src/main/cn/edu/zju/acm/onlinejudge/persistence/sql/ContestPersistenceImpl.java", "license": "gpl-3.0", "size": 35212 }
[ "cn.edu.zju.acm.onlinejudge.bean.AbstractContest", "cn.edu.zju.acm.onlinejudge.bean.enumeration.Language", "cn.edu.zju.acm.onlinejudge.persistence.PersistenceException", "cn.edu.zju.acm.onlinejudge.util.PersistenceManager", "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.text.MessageFormat", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import cn.edu.zju.acm.onlinejudge.bean.AbstractContest; import cn.edu.zju.acm.onlinejudge.bean.enumeration.Language; import cn.edu.zju.acm.onlinejudge.persistence.PersistenceException; import cn.edu.zju.acm.onlinejudge.util.PersistenceManager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import cn.edu.zju.acm.onlinejudge.bean.*; import cn.edu.zju.acm.onlinejudge.bean.enumeration.*; import cn.edu.zju.acm.onlinejudge.persistence.*; import cn.edu.zju.acm.onlinejudge.util.*; import java.sql.*; import java.text.*; import java.util.*;
[ "cn.edu.zju", "java.sql", "java.text", "java.util" ]
cn.edu.zju; java.sql; java.text; java.util;
2,016,660
private static Pair<String, byte[]> parseEsdsFromParent(ParsableByteArray parent, int position) { parent.setPosition(position + Atom.HEADER_SIZE + 4); // Start of the ES_Descriptor (defined in 14496-1) parent.skipBytes(1); // ES_Descriptor tag parseExpandableClassSize(parent); parent.skipBytes(2); // ES_ID int flags = parent.readUnsignedByte(); if ((flags & 0x80 ) != 0) { parent.skipBytes(2); } if ((flags & 0x40 ) != 0) { parent.skipBytes(parent.readUnsignedShort()); } if ((flags & 0x20 ) != 0) { parent.skipBytes(2); } // Start of the DecoderConfigDescriptor (defined in 14496-1) parent.skipBytes(1); // DecoderConfigDescriptor tag parseExpandableClassSize(parent); // Set the MIME type based on the object type indication (14496-1 table 5). int objectTypeIndication = parent.readUnsignedByte(); String mimeType; switch (objectTypeIndication) { case 0x6B: mimeType = MimeTypes.AUDIO_MPEG; return Pair.create(mimeType, null); case 0x20: mimeType = MimeTypes.VIDEO_MP4V; break; case 0x21: mimeType = MimeTypes.VIDEO_H264; break; case 0x23: mimeType = MimeTypes.VIDEO_H265; break; case 0x40: case 0x66: case 0x67: case 0x68: mimeType = MimeTypes.AUDIO_AAC; break; case 0xA5: mimeType = MimeTypes.AUDIO_AC3; break; case 0xA6: mimeType = MimeTypes.AUDIO_E_AC3; break; case 0xA9: case 0xAC: mimeType = MimeTypes.AUDIO_DTS; return Pair.create(mimeType, null); case 0xAA: case 0xAB: mimeType = MimeTypes.AUDIO_DTS_HD; return Pair.create(mimeType, null); default: mimeType = null; break; } parent.skipBytes(12); // Start of the AudioSpecificConfig. parent.skipBytes(1); // AudioSpecificConfig tag int initializationDataSize = parseExpandableClassSize(parent); byte[] initializationData = new byte[initializationDataSize]; parent.readBytes(initializationData, 0, initializationDataSize); return Pair.create(mimeType, initializationData); }
static Pair<String, byte[]> function(ParsableByteArray parent, int position) { parent.setPosition(position + Atom.HEADER_SIZE + 4); parent.skipBytes(1); parseExpandableClassSize(parent); parent.skipBytes(2); int flags = parent.readUnsignedByte(); if ((flags & 0x80 ) != 0) { parent.skipBytes(2); } if ((flags & 0x40 ) != 0) { parent.skipBytes(parent.readUnsignedShort()); } if ((flags & 0x20 ) != 0) { parent.skipBytes(2); } parent.skipBytes(1); parseExpandableClassSize(parent); int objectTypeIndication = parent.readUnsignedByte(); String mimeType; switch (objectTypeIndication) { case 0x6B: mimeType = MimeTypes.AUDIO_MPEG; return Pair.create(mimeType, null); case 0x20: mimeType = MimeTypes.VIDEO_MP4V; break; case 0x21: mimeType = MimeTypes.VIDEO_H264; break; case 0x23: mimeType = MimeTypes.VIDEO_H265; break; case 0x40: case 0x66: case 0x67: case 0x68: mimeType = MimeTypes.AUDIO_AAC; break; case 0xA5: mimeType = MimeTypes.AUDIO_AC3; break; case 0xA6: mimeType = MimeTypes.AUDIO_E_AC3; break; case 0xA9: case 0xAC: mimeType = MimeTypes.AUDIO_DTS; return Pair.create(mimeType, null); case 0xAA: case 0xAB: mimeType = MimeTypes.AUDIO_DTS_HD; return Pair.create(mimeType, null); default: mimeType = null; break; } parent.skipBytes(12); parent.skipBytes(1); int initializationDataSize = parseExpandableClassSize(parent); byte[] initializationData = new byte[initializationDataSize]; parent.readBytes(initializationData, 0, initializationDataSize); return Pair.create(mimeType, initializationData); }
/** * Returns codec-specific initialization data contained in an esds box. */
Returns codec-specific initialization data contained in an esds box
parseEsdsFromParent
{ "repo_name": "ClubCom/AndroidExoPlayer", "path": "library/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java", "license": "apache-2.0", "size": 53139 }
[ "android.util.Pair", "com.google.android.exoplayer2.util.MimeTypes", "com.google.android.exoplayer2.util.ParsableByteArray" ]
import android.util.Pair; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.ParsableByteArray;
import android.util.*; import com.google.android.exoplayer2.util.*;
[ "android.util", "com.google.android" ]
android.util; com.google.android;
2,444,253
public Buffer getTimeStampBuffer() { if (_timeStampBuffer == null && _timeStamp > 0) _timeStampBuffer = HttpFields.__dateCache.formatBuffer(_timeStamp); return _timeStampBuffer; }
Buffer function() { if (_timeStampBuffer == null && _timeStamp > 0) _timeStampBuffer = HttpFields.__dateCache.formatBuffer(_timeStamp); return _timeStampBuffer; }
/** * Get Request TimeStamp * * @return The time that the request was received. */
Get Request TimeStamp
getTimeStampBuffer
{ "repo_name": "cscotta/miso-java", "path": "jetty/modules/jetty/src/main/java/org/mortbay/jetty/Request.java", "license": "mit", "size": 66858 }
[ "org.mortbay.io.Buffer" ]
import org.mortbay.io.Buffer;
import org.mortbay.io.*;
[ "org.mortbay.io" ]
org.mortbay.io;
1,686,253
@Override @SuppressWarnings("unchecked") public T mapRow(ResultSet rs, int rowNum) throws SQLException { // Validate column count. ResultSetMetaData rsmd = rs.getMetaData(); int nrOfColumns = rsmd.getColumnCount(); if (nrOfColumns != 1) { throw new IncorrectResultSizeJdbcException(1, nrOfColumns); } // Extract column value from JDBC ResultSet. Object result = getColumnValue(rs, 1, this.requiredType); if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) { // Extracted value does not match already: try to convert it. try { return (T) convertValueToRequiredType(result, this.requiredType); } catch (IllegalArgumentException ex) { throw new TypeMismatchDataAccessException( "Type mismatch affecting row number " + rowNum + " and column type '" + rsmd.getColumnTypeName(1) + "': " + ex.getMessage()); } } return (T) result; }
@SuppressWarnings(STR) T function(ResultSet rs, int rowNum) throws SQLException { ResultSetMetaData rsmd = rs.getMetaData(); int nrOfColumns = rsmd.getColumnCount(); if (nrOfColumns != 1) { throw new IncorrectResultSizeJdbcException(1, nrOfColumns); } Object result = getColumnValue(rs, 1, this.requiredType); if (result != null && this.requiredType != null && !this.requiredType.isInstance(result)) { try { return (T) convertValueToRequiredType(result, this.requiredType); } catch (IllegalArgumentException ex) { throw new TypeMismatchDataAccessException( STR + rowNum + STR + rsmd.getColumnTypeName(1) + STR + ex.getMessage()); } } return (T) result; }
/** * Extract a value for the single column in the current row. * <p>Validates that there is only one column selected, * then delegates to {@code getColumnValue()} and also * {@code convertValueToRequiredType}, if necessary. * @see java.sql.ResultSetMetaData#getColumnCount() * @see #getColumnValue(java.sql.ResultSet, int, Class) * @see #convertValueToRequiredType(Object, Class) */
Extract a value for the single column in the current row. Validates that there is only one column selected, then delegates to getColumnValue() and also convertValueToRequiredType, if necessary
mapRow
{ "repo_name": "solmix/datax", "path": "jdbc/src/main/java/org/solmix/datax/jdbc/core/SingleColumnRowMapper.java", "license": "lgpl-2.1", "size": 5674 }
[ "java.sql.ResultSet", "java.sql.ResultSetMetaData", "java.sql.SQLException" ]
import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
39,768
public static JsonObject createJsonObject(ResultSet result, DatabaseTypes[] columnTypes, String[] fieldNames) throws Exception { //Try to create the JSON object try { //Create the JSON object JsonObject obj = new JsonObject(); //Read the data into the object for(int i=0; i<fieldNames.length; i++) { //Add the data to the object if(DatabaseTypes.STRING == columnTypes[i]) obj.addProperty(fieldNames[i], result.getString(i+1)); else if(DatabaseTypes.DOUBLE == columnTypes[i]) obj.addProperty(fieldNames[i], getDouble(result, i+1)); else if(DatabaseTypes.INTEGER == columnTypes[i]) obj.addProperty(fieldNames[i], getInteger(result, i+1)); else if(DatabaseTypes.BOOLEAN == columnTypes[i]) obj.addProperty(fieldNames[i], getBoolean(result, i+1)); else if(DatabaseTypes.LONG == columnTypes[i]) obj.addProperty(fieldNames[i], getLong(result, i+1)); else if(DatabaseTypes.DATE == columnTypes[i]) obj.addProperty(fieldNames[i], getDate(result, i+1)); else if(DatabaseTypes.TIMESTAMP == columnTypes[i]) obj.addProperty(fieldNames[i], getTimestamp(result, i+1)); else throw new Exception("No mapping made for column type " + columnTypes[i]); } //Return the JSON object return obj; } //Failed catch(Exception ex) { throw new Exception("Failed to create the JSON object from the current result set row", ex); } }
static JsonObject function(ResultSet result, DatabaseTypes[] columnTypes, String[] fieldNames) throws Exception { try { JsonObject obj = new JsonObject(); for(int i=0; i<fieldNames.length; i++) { if(DatabaseTypes.STRING == columnTypes[i]) obj.addProperty(fieldNames[i], result.getString(i+1)); else if(DatabaseTypes.DOUBLE == columnTypes[i]) obj.addProperty(fieldNames[i], getDouble(result, i+1)); else if(DatabaseTypes.INTEGER == columnTypes[i]) obj.addProperty(fieldNames[i], getInteger(result, i+1)); else if(DatabaseTypes.BOOLEAN == columnTypes[i]) obj.addProperty(fieldNames[i], getBoolean(result, i+1)); else if(DatabaseTypes.LONG == columnTypes[i]) obj.addProperty(fieldNames[i], getLong(result, i+1)); else if(DatabaseTypes.DATE == columnTypes[i]) obj.addProperty(fieldNames[i], getDate(result, i+1)); else if(DatabaseTypes.TIMESTAMP == columnTypes[i]) obj.addProperty(fieldNames[i], getTimestamp(result, i+1)); else throw new Exception(STR + columnTypes[i]); } return obj; } catch(Exception ex) { throw new Exception(STR, ex); } }
/** * Create a JSON object from a result set row using the column types and the field names. * @param result * @param columnTypes * @param fieldNames * @return * @throws Exception */
Create a JSON object from a result set row using the column types and the field names
createJsonObject
{ "repo_name": "jhertz123/katujo-web-utils", "path": "src/main/java/com/katujo/web/utils/JsonUtils.java", "license": "mit", "size": 22199 }
[ "com.google.gson.JsonObject", "java.sql.ResultSet" ]
import com.google.gson.JsonObject; import java.sql.ResultSet;
import com.google.gson.*; import java.sql.*;
[ "com.google.gson", "java.sql" ]
com.google.gson; java.sql;
1,065,233
public final boolean restartIfRequired() throws IOException, InterruptedException, TimeoutException { try { return ops.restartIfRequired(); } catch (Exception e) { log.error("Unexpected exception during 'restartIfRequired'", e); throw sneakyThrow(e); } } // ---
final boolean function() throws IOException, InterruptedException, TimeoutException { try { return ops.restartIfRequired(); } catch (Exception e) { log.error(STR, e); throw sneakyThrow(e); } }
/** * Restarts the server if required. In domain, restarts the entire host if at least one server requires restart. * @return if the server was in fact restarted; in domain, if the host was restarted */
Restarts the server if required. In domain, restarts the entire host if at least one server requires restart
restartIfRequired
{ "repo_name": "MartinStyk/creaper", "path": "core/src/main/java/org/wildfly/extras/creaper/core/online/operations/admin/Administration.java", "license": "apache-2.0", "size": 5627 }
[ "java.io.IOException", "java.util.concurrent.TimeoutException" ]
import java.io.IOException; import java.util.concurrent.TimeoutException;
import java.io.*; import java.util.concurrent.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,562,125
public Model<Object> getPresentationModel() { return this.presentationModel; }
Model<Object> function() { return this.presentationModel; }
/** * Gets the value for the presentationModel field. * * @return The value for the presentationModel field. */
Gets the value for the presentationModel field
getPresentationModel
{ "repo_name": "lunarray-org/usermanager", "path": "src/main/java/org/lunarray/usermanager/presentation/page/role/UsersRolePage.java", "license": "agpl-3.0", "size": 6376 }
[ "org.lunarray.model.descriptor.model.Model" ]
import org.lunarray.model.descriptor.model.Model;
import org.lunarray.model.descriptor.model.*;
[ "org.lunarray.model" ]
org.lunarray.model;
2,907,547
public RemoteProcessGroupStatus getRemoteProcessGroupStatus(final String remoteProcessGroupId) { final ProcessGroup root = flowController.getGroup(flowController.getRootGroupId()); final RemoteProcessGroup remoteProcessGroup = root.findRemoteProcessGroup(remoteProcessGroupId); // ensure the output port was found if (remoteProcessGroup == null) { throw new ResourceNotFoundException(String.format("Unable to locate remote process group with id '%s'.", remoteProcessGroupId)); } final String groupId = remoteProcessGroup.getProcessGroup().getIdentifier(); final ProcessGroupStatus groupStatus = flowController.getGroupStatus(groupId, NiFiUserUtils.getNiFiUser(), 1); if (groupStatus == null) { throw new ResourceNotFoundException(String.format("Unable to locate group with id '%s'.", groupId)); } final RemoteProcessGroupStatus status = groupStatus.getRemoteProcessGroupStatus().stream().filter(rpgStatus -> remoteProcessGroupId.equals(rpgStatus.getId())).findFirst().orElse(null); if (status == null) { throw new ResourceNotFoundException(String.format("Unable to locate remote process group with id '%s'.", remoteProcessGroupId)); } return status; }
RemoteProcessGroupStatus function(final String remoteProcessGroupId) { final ProcessGroup root = flowController.getGroup(flowController.getRootGroupId()); final RemoteProcessGroup remoteProcessGroup = root.findRemoteProcessGroup(remoteProcessGroupId); if (remoteProcessGroup == null) { throw new ResourceNotFoundException(String.format(STR, remoteProcessGroupId)); } final String groupId = remoteProcessGroup.getProcessGroup().getIdentifier(); final ProcessGroupStatus groupStatus = flowController.getGroupStatus(groupId, NiFiUserUtils.getNiFiUser(), 1); if (groupStatus == null) { throw new ResourceNotFoundException(String.format(STR, groupId)); } final RemoteProcessGroupStatus status = groupStatus.getRemoteProcessGroupStatus().stream().filter(rpgStatus -> remoteProcessGroupId.equals(rpgStatus.getId())).findFirst().orElse(null); if (status == null) { throw new ResourceNotFoundException(String.format(STR, remoteProcessGroupId)); } return status; }
/** * Gets the status for the specified remote process group. * * @param remoteProcessGroupId remote process group id * @return the status for the specified remote process group */
Gets the status for the specified remote process group
getRemoteProcessGroupStatus
{ "repo_name": "zhengsg/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java", "license": "apache-2.0", "size": 73055 }
[ "org.apache.nifi.authorization.user.NiFiUserUtils", "org.apache.nifi.controller.status.ProcessGroupStatus", "org.apache.nifi.controller.status.RemoteProcessGroupStatus", "org.apache.nifi.groups.ProcessGroup", "org.apache.nifi.groups.RemoteProcessGroup", "org.apache.nifi.web.ResourceNotFoundException" ]
import org.apache.nifi.authorization.user.NiFiUserUtils; import org.apache.nifi.controller.status.ProcessGroupStatus; import org.apache.nifi.controller.status.RemoteProcessGroupStatus; import org.apache.nifi.groups.ProcessGroup; import org.apache.nifi.groups.RemoteProcessGroup; import org.apache.nifi.web.ResourceNotFoundException;
import org.apache.nifi.authorization.user.*; import org.apache.nifi.controller.status.*; import org.apache.nifi.groups.*; import org.apache.nifi.web.*;
[ "org.apache.nifi" ]
org.apache.nifi;
618,442
public String getJvmMemMgrRelManagerName() throws SnmpStatusException { return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(mmmName); }
String function() throws SnmpStatusException { return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(mmmName); }
/** * Getter for the "JvmMemMgrRelManagerName" variable. */
Getter for the "JvmMemMgrRelManagerName" variable
getJvmMemMgrRelManagerName
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemMgrPoolRelEntryImpl.java", "license": "mit", "size": 3357 }
[ "com.sun.jmx.snmp.SnmpStatusException" ]
import com.sun.jmx.snmp.SnmpStatusException;
import com.sun.jmx.snmp.*;
[ "com.sun.jmx" ]
com.sun.jmx;
147,740
protected static final Property property( String localName ) { return ResourceFactory.createProperty( thisUri, localName ); } public final static Resource Merger = resource("Merger"); public final static Resource Transformer = resource("Transformer"); public final static Resource DefaultGraphSelector = resource("DefaultGraphSelector"); public final static Resource NamedGraphSelector = resource("NamedGraphSelector"); public final static Resource Transitioner = resource("Transitioner"); public final static Resource Graph = resource("Graph"); public final static Resource UnionGraph = resource("UnionGraph"); public final static Resource DatasetProjGraph = resource("DatasetProjGraph"); public final static Resource InputGraph = resource("InputGraph"); public final static Resource OutputGraph = resource("OutputGraph"); public final static Resource ConstructGraph = resource("ConstructGraph"); public final static Resource TransformGraph = resource("TransformGraph"); public final static Resource IdentityGraph = resource("IdentityGraph"); public final static Resource InferenceGraph = resource("InferenceGraph"); public final static Resource EmptyGraph = resource("EmptyGraph"); public final static Resource UpdatableGraph = resource("UpdatableGraph"); public final static Resource UpdatableFromEventsGraph = resource("UpdatableFromEventsGraph"); public final static Resource UpdatableFromEventsGraph2 = resource("UpdatableFromEventsGraph2"); public final static Resource LoggedGraph = resource("LoggedGraph"); public final static Resource NamedGraph = resource("NamedGraph"); public final static Resource IntegerRange = resource("IntegerRange"); public final static Resource InlineGraph = resource("InlineGraph"); public final static Resource LoadGraph = resource("LoadGraph"); public final static Resource SelectGraph = resource("SelectGraph"); public final static Resource IntegerRangeFromGraph = resource("IntegerRangeFromGraph"); public final static Resource DataflowGraph = resource("DataflowGraph"); public final static Resource DataflowDataset = resource("DataflowDataset"); public final static Resource IncludedGraph = resource("IncludedGraph"); public final static Resource ImportedGraph = resource("ImportedGraph"); public final static Resource TwitterGraph = resource("TwitterGraph"); public final static Resource JmsInputGraph = resource("JmsInputGraph"); public final static Resource Dataset = resource("Dataset"); public final static Resource InlineDataset = resource("InlineDataset"); public final static Resource Update = resource("Update"); public final static Resource UpdateRequest = resource("UpdateRequest"); public final static Resource Dataflow = resource("Dataflow"); //public final static Property isConstructedBy = property("isConstructedBy"); //public final static Property unionOf = property("unionOf"); public final static Property constructQuery = property("constructQuery"); public final static Property hasComponent = property("hasComponent"); public final static Property input = property("input"); public final static Property namedInput = property("namedInput"); public final static Property defaultInput = property("defaultInput"); public final static Property name = property("name"); public final static Property datasetProducer = property("datasetProducer"); public final static Property config = property("config"); public final static Property configTxt = property("configTxt"); public final static Property configType = property("configType"); public final static Property configRoot = property("configRoot"); public final static Property inlineConfig = property("inlineConfig"); //public final static Property source = property("source"); public final static Property id = property("id"); public final static Property from = property("from"); public final static Property fromNamed = property("fromNamed"); //public final static Property ontModelSpec = property("ontModelSpec"); public final static Property reasonerType = property("reasonerType"); public final static Property reasonerConfig = property("reasonerConfig"); public final static Property schema = property("schema"); public final static Property baseGraph = property("baseGraph"); public final static Property addGraph = property("addGraph"); public final static Property deleteGraph = property("deleteGraph"); public final static Property trigger = property("trigger"); public final static Property addConstruct = property("addConstruct"); public final static Property deleteConstruct = property("deleteConstruct"); public final static Property eventsFrom = property("eventsFrom"); public final static Property url = property("url"); public final static Property uri = property("uri"); public final static Property syntax = property("syntax"); public final static Property baseUri = property("baseUri"); public final static Property pollingPeriod = property("pollingPeriod"); public final static Property user = property("user"); public final static Property password = property("password"); public final static Property subject = property("subject"); public final static Property object = property("object"); public final static Property predicate = property("predicate"); public final static Property triple = property("triple"); public final static Property updateOperations = property("updateOperations"); // public final static Resource Exists = resource("Exists"); // public final static Resource NotExists = resource("NotExists"); // public final static Resource Assign = resource("Assign"); // public final static Resource ElementGroup = resource("ElementGroup"); // public final static Resource EmptyElement = resource("EmptyElement"); // public final static Resource FunctionCall = resource("FunctionCall"); // public final static Resource OpCall = resource("FunctionCall"); // public final static Property UnknownExpr = property("UnknownExpr"); // public final static Property element = property("element"); // public final static Property var = property("var"); // public final static Property expr = property("expr"); // public final static Property triple = property("triple"); // // public final static Property functionIRI = property("functionIRI"); // public final static Property functionLabel = property("functionLabel"); // public final static Property opName = property("opName"); public final static Property intervalStart = property("intervalStart"); public final static Property intervalEnd = property("intervalEnd"); // public final static Property resultVariable = property("resultVariable"); public final static Property twitterUsername = property("twitterUsername"); public final static Property tweetNumber = property("tweetNumber"); public final static Property eventType = property("eventType"); public final static Property xCoord = property("xCoord"); public final static Property yCoord = property("yCoord"); //public final static Property reasonerFactory = property("reasonerFactory"); // public final static Property all = ResourceFactory.createProperty(NS + "all");
static final Property function( String localName ) { return ResourceFactory.createProperty( thisUri, localName ); } final static Resource Merger = resource(STR); public final static Resource Transformer = resource(STR); public final static Resource DefaultGraphSelector = resource(STR); public final static Resource NamedGraphSelector = resource(STR); public final static Resource Transitioner = resource(STR); public final static Resource Graph = resource("Graph"); public final static Resource UnionGraph = resource(STR); public final static Resource DatasetProjGraph = resource(STR); public final static Resource InputGraph = resource(STR); public final static Resource OutputGraph = resource(STR); public final static Resource ConstructGraph = resource(STR); public final static Resource TransformGraph = resource(STR); public final static Resource IdentityGraph = resource(STR); public final static Resource InferenceGraph = resource(STR); public final static Resource EmptyGraph = resource(STR); public final static Resource UpdatableGraph = resource(STR); public final static Resource UpdatableFromEventsGraph = resource(STR); public final static Resource UpdatableFromEventsGraph2 = resource(STR); public final static Resource LoggedGraph = resource(STR); public final static Resource NamedGraph = resource(STR); public final static Resource IntegerRange = resource(STR); public final static Resource InlineGraph = resource(STR); public final static Resource LoadGraph = resource(STR); public final static Resource SelectGraph = resource(STR); public final static Resource IntegerRangeFromGraph = resource(STR); public final static Resource DataflowGraph = resource(STR); public final static Resource DataflowDataset = resource(STR); public final static Resource IncludedGraph = resource(STR); public final static Resource ImportedGraph = resource(STR); public final static Resource TwitterGraph = resource(STR); public final static Resource JmsInputGraph = resource(STR); public final static Resource Dataset = resource(STR); public final static Resource InlineDataset = resource(STR); public final static Resource Update = resource(STR); public final static Resource UpdateRequest = resource(STR); public final static Resource Dataflow = resource(STR); public final static Property constructQuery = function(STR); final static Property hasComponent = function(STR); final static Property input = function("input"); final static Property namedInput = function(STR); final static Property defaultInput = function(STR); final static Property name = function("name"); final static Property datasetProducer = function(STR); final static Property config = function(STR); final static Property configTxt = function(STR); final static Property configType = function(STR); final static Property configRoot = function(STR); final static Property inlineConfig = function(STR); final static Property id = function("id"); final static Property from = function("from"); final static Property fromNamed = function(STR); final static Property reasonerType = function(STR); final static Property reasonerConfig = function(STR); final static Property schema = function(STR); final static Property baseGraph = function(STR); final static Property addGraph = function(STR); final static Property deleteGraph = function(STR); final static Property trigger = function(STR); final static Property addConstruct = function(STR); final static Property deleteConstruct = function(STR); final static Property eventsFrom = function(STR); final static Property url = function("url"); final static Property uri = function("uri"); final static Property syntax = function(STR); final static Property baseUri = function(STR); final static Property pollingPeriod = function(STR); final static Property user = function("user"); final static Property password = function(STR); final static Property subject = function(STR); final static Property object = function(STR); final static Property predicate = function(STR); final static Property triple = function(STR); final static Property updateOperations = function(STR); final static Property intervalStart = function(STR); final static Property intervalEnd = function(STR); final static Property twitterUsername = function(STR); final static Property tweetNumber = function(STR); final static Property eventType = function(STR); final static Property xCoord = function(STR); final static Property yCoord = function(STR);
/** * Creates a new property based on the SPINX uri and a local name. * * @param localName the local name of the property * @return the created property */
Creates a new property based on the SPINX uri and a local name
property
{ "repo_name": "miguel76/SWOWS", "path": "swows/src/main/java/org/swows/vocabulary/DF.java", "license": "agpl-3.0", "size": 9891 }
[ "org.apache.jena.rdf.model.Property", "org.apache.jena.rdf.model.Resource", "org.apache.jena.rdf.model.ResourceFactory" ]
import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.*;
[ "org.apache.jena" ]
org.apache.jena;
2,017,327
@Deprecated public boolean setToolbarItem(int id, @NonNull Bitmap icon, @NonNull String description) { Bundle bundle = new Bundle(); bundle.putInt(CustomTabsIntent.KEY_ID, id); bundle.putParcelable(CustomTabsIntent.KEY_ICON, icon); bundle.putString(CustomTabsIntent.KEY_DESCRIPTION, description); Bundle metaBundle = new Bundle(); metaBundle.putBundle(CustomTabsIntent.EXTRA_ACTION_BUTTON_BUNDLE, bundle); try { return mService.updateVisuals(mCallback, metaBundle); } catch (RemoteException e) { return false; } }
boolean function(int id, @NonNull Bitmap icon, @NonNull String description) { Bundle bundle = new Bundle(); bundle.putInt(CustomTabsIntent.KEY_ID, id); bundle.putParcelable(CustomTabsIntent.KEY_ICON, icon); bundle.putString(CustomTabsIntent.KEY_DESCRIPTION, description); Bundle metaBundle = new Bundle(); metaBundle.putBundle(CustomTabsIntent.EXTRA_ACTION_BUTTON_BUNDLE, bundle); try { return mService.updateVisuals(mCallback, metaBundle); } catch (RemoteException e) { return false; } }
/** * Updates the visuals for toolbar items. Will only succeed if a custom tab created using this * session is in the foreground in browser and the given id is valid. * @param id The id for the item to update. * @param icon The new icon of the toolbar item. * @param description Content description of the toolbar item. * @return Whether the update succeeded. * @deprecated Use * CustomTabsSession#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent) */
Updates the visuals for toolbar items. Will only succeed if a custom tab created using this session is in the foreground in browser and the given id is valid
setToolbarItem
{ "repo_name": "CzBiX/Telegram", "path": "TMessagesProj/src/main/java/org/telegram/messenger/support/customtabs/CustomTabsSession.java", "license": "gpl-2.0", "size": 8637 }
[ "android.graphics.Bitmap", "android.os.Bundle", "android.os.RemoteException", "androidx.annotation.NonNull" ]
import android.graphics.Bitmap; import android.os.Bundle; import android.os.RemoteException; import androidx.annotation.NonNull;
import android.graphics.*; import android.os.*; import androidx.annotation.*;
[ "android.graphics", "android.os", "androidx.annotation" ]
android.graphics; android.os; androidx.annotation;
2,260,739
public void loadFile(Resource res,String resourcePath) throws IOException { res.createFile(true); InputStream is = new Info().getClass().getResourceAsStream(resourcePath); IOUtil.copy(is,res,true); }
void function(Resource res,String resourcePath) throws IOException { res.createFile(true); InputStream is = new Info().getClass().getResourceAsStream(resourcePath); IOUtil.copy(is,res,true); }
/** * create xml file from a resource definition * @param res * @param resourcePath * @throws IOException */
create xml file from a resource definition
loadFile
{ "repo_name": "paulklinkenberg/Lucee4", "path": "lucee-java/lucee-core/src/lucee/runtime/schedule/StorageUtil.java", "license": "lgpl-2.1", "size": 14914 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,070,810
public boolean containsJob(JobID jobId) { Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running."); return jobLeaderServices.containsKey(jobId); }
boolean function(JobID jobId) { Preconditions.checkState(JobLeaderService.State.STARTED == state, STR); return jobLeaderServices.containsKey(jobId); }
/** * Check whether the service monitors the given job. * * @param jobId identifying the job * @return True if the given job is monitored; otherwise false */
Check whether the service monitors the given job
containsJob
{ "repo_name": "zohar-mizrahi/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java", "license": "apache-2.0", "size": 13985 }
[ "org.apache.flink.api.common.JobID", "org.apache.flink.util.Preconditions" ]
import org.apache.flink.api.common.JobID; import org.apache.flink.util.Preconditions;
import org.apache.flink.api.common.*; import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
2,753,311
private void verifyOverlayActive() { List<WebElement> activeOverlay = getActiveOverlay(PANELDIALOG_MODAL_CMP); assertNotNull("There should be one overlay active", activeOverlay); assertEquals("Only 1 active overlay should be opened at any point", 1, activeOverlay.size()); }
void function() { List<WebElement> activeOverlay = getActiveOverlay(PANELDIALOG_MODAL_CMP); assertNotNull(STR, activeOverlay); assertEquals(STR, 1, activeOverlay.size()); }
/** * Verify overlay is opened * * @param overlayCmpLocator * @param isActive * @throws InterruptedException */
Verify overlay is opened
verifyOverlayActive
{ "repo_name": "DebalinaDey/AuraDevelopDeb", "path": "aura-components/src/test/java/org/auraframework/components/ui/modalOverlay/PanelModalOverlayUITest.java", "license": "apache-2.0", "size": 14080 }
[ "java.util.List", "org.openqa.selenium.WebElement" ]
import java.util.List; import org.openqa.selenium.WebElement;
import java.util.*; import org.openqa.selenium.*;
[ "java.util", "org.openqa.selenium" ]
java.util; org.openqa.selenium;
2,857,099
public Element getElement() { return element; }
Element function() { return element; }
/** * Returns the DOM4J Element that backs the error. The element is the definitive * representation of the error and can be manipulated directly to change * error contents. * * @return the DOM4J Element. */
Returns the DOM4J Element that backs the error. The element is the definitive representation of the error and can be manipulated directly to change error contents
getElement
{ "repo_name": "citlab/rwx4j", "path": "rwx4j-component/src/main/java/de/tu_berlin/cit/rwx4j/xmpp/packet/StreamError.java", "license": "apache-2.0", "size": 18125 }
[ "org.dom4j.Element" ]
import org.dom4j.Element;
import org.dom4j.*;
[ "org.dom4j" ]
org.dom4j;
1,223,842
@Override public int quantityDroppedWithBonus(int par1, Random par2Random) { return this.quantityDropped(par2Random) + par2Random.nextInt(1); }
int function(int par1, Random par2Random) { return this.quantityDropped(par2Random) + par2Random.nextInt(1); }
/** * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). */
Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive)
quantityDroppedWithBonus
{ "repo_name": "NovaViper/ZeroQuest", "path": "1.7.10-src/common/zeroquest/block/BlockDarkGrainOre.java", "license": "apache-2.0", "size": 1569 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
1,207,321
@Override public void addChild(Container child) { if (!(child instanceof Host)) throw new IllegalArgumentException (sm.getString("standardEngine.notHost")); super.addChild(child); }
void function(Container child) { if (!(child instanceof Host)) throw new IllegalArgumentException (sm.getString(STR)); super.addChild(child); }
/** * Add a child Container, only if the proposed child is an implementation * of Host. * * @param child Child container to be added */
Add a child Container, only if the proposed child is an implementation of Host
addChild
{ "repo_name": "plumer/codana", "path": "tomcat_files/8.0.22/StandardEngine.java", "license": "mit", "size": 15640 }
[ "org.apache.catalina.Container", "org.apache.catalina.Host" ]
import org.apache.catalina.Container; import org.apache.catalina.Host;
import org.apache.catalina.*;
[ "org.apache.catalina" ]
org.apache.catalina;
2,209,319
public RowSorter getSource() { return (RowSorter)super.getSource(); }
RowSorter function() { return (RowSorter)super.getSource(); }
/** * Returns the source of the event as a <code>RowSorter</code>. * * @return the source of the event as a <code>RowSorter</code> */
Returns the source of the event as a <code>RowSorter</code>
getSource
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/javax/swing/event/RowSorterEvent.java", "license": "gpl-2.0", "size": 4945 }
[ "javax.swing.RowSorter" ]
import javax.swing.RowSorter;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,561,334
public boolean truncateTooLongNumber(PhoneNumber number) { if (isValidNumber(number)) { return true; } PhoneNumber numberCopy = new PhoneNumber(); numberCopy.mergeFrom(number); long nationalNumber = number.getNationalNumber(); do { nationalNumber /= 10; numberCopy.setNationalNumber(nationalNumber); if (isPossibleNumberWithReason(numberCopy) == ValidationResult.TOO_SHORT || nationalNumber == 0) { return false; } } while (!isValidNumber(numberCopy)); number.setNationalNumber(nationalNumber); return true; }
boolean function(PhoneNumber number) { if (isValidNumber(number)) { return true; } PhoneNumber numberCopy = new PhoneNumber(); numberCopy.mergeFrom(number); long nationalNumber = number.getNationalNumber(); do { nationalNumber /= 10; numberCopy.setNationalNumber(nationalNumber); if (isPossibleNumberWithReason(numberCopy) == ValidationResult.TOO_SHORT nationalNumber == 0) { return false; } } while (!isValidNumber(numberCopy)); number.setNationalNumber(nationalNumber); return true; }
/** * Attempts to extract a valid number from a phone number that is too long to be valid, and resets * the PhoneNumber object passed in to that valid version. If no valid number could be extracted, * the PhoneNumber object passed in will not be modified. * @param number a PhoneNumber object which contains a number that is too long to be valid. * @return true if a valid phone number can be successfully extracted. */
Attempts to extract a valid number from a phone number that is too long to be valid, and resets the PhoneNumber object passed in to that valid version. If no valid number could be extracted, the PhoneNumber object passed in will not be modified
truncateTooLongNumber
{ "repo_name": "leandrocohn/libphonenumber-7-0.5", "path": "tools/java/java-build/target/test-classes/com/google/i18n/phonenumbers/PhoneNumberUtil.java", "license": "apache-2.0", "size": 161599 }
[ "com.google.i18n.phonenumbers.Phonenumber" ]
import com.google.i18n.phonenumbers.Phonenumber;
import com.google.i18n.phonenumbers.*;
[ "com.google.i18n" ]
com.google.i18n;
1,993,957
public Connection getConnection () throws MapperException { return statementFactory.getConnection (); }
Connection function () throws MapperException { return statementFactory.getConnection (); }
/** * Returns the connection used by this mapper. * @return the connection used by this mapper */
Returns the connection used by this mapper
getConnection
{ "repo_name": "DIKKA/brew-master-pro", "path": "src/ch/ffhs/dikka/brewmaster/mapper/base/AbstractMapper.java", "license": "gpl-2.0", "size": 18498 }
[ "ch.ffhs.dikka.brewmaster.mapper.MapperException", "java.sql.Connection" ]
import ch.ffhs.dikka.brewmaster.mapper.MapperException; import java.sql.Connection;
import ch.ffhs.dikka.brewmaster.mapper.*; import java.sql.*;
[ "ch.ffhs.dikka", "java.sql" ]
ch.ffhs.dikka; java.sql;
1,097,923
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) { if (mutationEvents) { if (!replace) { // MUTATION POST-EVENTS: LCount lc = LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED); if (lc.total > 0) { MutationEvent me = new MutationEventImpl(); me.initMutationEvent( MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED, true, false, null, oldvalue, value, null, (short) 0); dispatchEvent(node, me); } // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified, // if required. (Common to most kinds of mutation) dispatchAggregateEvents(node, savedEnclosingAttr); } // End mutation postprocessing } }
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) { if (mutationEvents) { if (!replace) { LCount lc = LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED); if (lc.total > 0) { MutationEvent me = new MutationEventImpl(); me.initMutationEvent( MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED, true, false, null, oldvalue, value, null, (short) 0); dispatchEvent(node, me); } dispatchAggregateEvents(node, savedEnclosingAttr); } } }
/** * A method to be called when a character data node has been modified */
A method to be called when a character data node has been modified
modifiedCharacterData
{ "repo_name": "BIORIMP/biorimp", "path": "BIO-RIMP/test_data/code/xerces/src/org/apache/xerces/dom/DocumentImpl.java", "license": "gpl-2.0", "size": 50656 }
[ "org.apache.xerces.dom.events.MutationEventImpl", "org.w3c.dom.events.MutationEvent" ]
import org.apache.xerces.dom.events.MutationEventImpl; import org.w3c.dom.events.MutationEvent;
import org.apache.xerces.dom.events.*; import org.w3c.dom.events.*;
[ "org.apache.xerces", "org.w3c.dom" ]
org.apache.xerces; org.w3c.dom;
1,518,340
public int getFuzzyPrefixLength() { FuzzyConfig fuzzyConfig = getQueryConfigHandler().get( ConfigurationKeys.FUZZY_CONFIG); if (fuzzyConfig == null) { return FuzzyQuery.defaultPrefixLength; } else { return fuzzyConfig.getPrefixLength(); } }
int function() { FuzzyConfig fuzzyConfig = getQueryConfigHandler().get( ConfigurationKeys.FUZZY_CONFIG); if (fuzzyConfig == null) { return FuzzyQuery.defaultPrefixLength; } else { return fuzzyConfig.getPrefixLength(); } }
/** * Get the prefix length for fuzzy queries. * * @return Returns the fuzzyPrefixLength. */
Get the prefix length for fuzzy queries
getFuzzyPrefixLength
{ "repo_name": "bighaidao/lucene", "path": "lucene-queryparser/src/main/java/org/apache/lucene/queryParser/standard/StandardQueryParser.java", "license": "apache-2.0", "size": 23450 }
[ "org.apache.lucene.queryParser.standard.config.FuzzyConfig", "org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler", "org.apache.lucene.search.FuzzyQuery" ]
import org.apache.lucene.queryParser.standard.config.FuzzyConfig; import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler; import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.*; import org.apache.lucene.search.*;
[ "org.apache.lucene" ]
org.apache.lucene;
984,937
public void updateChannel(ChannelIF channel) { }
void function(ChannelIF channel) { }
/** * Updates data in database with data from channel object. * * @param channel channel object. */
Updates data in database with data from channel object
updateChannel
{ "repo_name": "nikos/informa", "path": "src/test/java/de/nava/informa/utils/manager/TestPersistenceManagerConfig.java", "license": "epl-1.0", "size": 5933 }
[ "de.nava.informa.core.ChannelIF" ]
import de.nava.informa.core.ChannelIF;
import de.nava.informa.core.*;
[ "de.nava.informa" ]
de.nava.informa;
145,778
public void setLyrics( List<LyricsForm> lyrics ) { this.lyrics = lyrics; }
void function( List<LyricsForm> lyrics ) { this.lyrics = lyrics; }
/** * Set list of lyrics. * * @param lyrics List of lyrics. */
Set list of lyrics
setLyrics
{ "repo_name": "coffeine-009/Virtuoso", "path": "src/main/java/com/thecoffeine/virtuoso/music/view/form/SongForm.java", "license": "mit", "size": 10154 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,489,872
public void testReadEVR_LE() throws Exception { DataInputStream in = new DataInputStream( new BufferedInputStream(new FileInputStream(EVR_LE))); try { ds.readFile(in, null, -1); } finally { try { in.close(); } catch (Exception ignore) {} } }
void function() throws Exception { DataInputStream in = new DataInputStream( new BufferedInputStream(new FileInputStream(EVR_LE))); try { ds.readFile(in, null, -1); } finally { try { in.close(); } catch (Exception ignore) {} } }
/** * A unit test for JUnit * *@exception Exception Description of the Exception */
A unit test for JUnit
testReadEVR_LE
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4che14/tags/DCM4JBOSS_2_5_3/test/java/org/dcm4che/data/DatasetTest.java", "license": "apache-2.0", "size": 19283 }
[ "java.io.BufferedInputStream", "java.io.DataInputStream", "java.io.FileInputStream" ]
import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.FileInputStream;
import java.io.*;
[ "java.io" ]
java.io;
142,592
public ValueReplacer getReplacer() { return new ValueReplacer((TestPlan) ((JMeterTreeNode) getTreeModel().getTestPlan().getArray()[0]) .getTestElement()); }
ValueReplacer function() { return new ValueReplacer((TestPlan) ((JMeterTreeNode) getTreeModel().getTestPlan().getArray()[0]) .getTestElement()); }
/** * Get a ValueReplacer for the test tree. * * @return a ValueReplacer configured for the test tree */
Get a ValueReplacer for the test tree
getReplacer
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-jmeter-3.0/src/core/org/apache/jmeter/gui/GuiPackage.java", "license": "apache-2.0", "size": 29555 }
[ "org.apache.jmeter.engine.util.ValueReplacer", "org.apache.jmeter.gui.tree.JMeterTreeNode", "org.apache.jmeter.testelement.TestPlan" ]
import org.apache.jmeter.engine.util.ValueReplacer; import org.apache.jmeter.gui.tree.JMeterTreeNode; import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.engine.util.*; import org.apache.jmeter.gui.tree.*; import org.apache.jmeter.testelement.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
1,583,336
OperationStatus[] batchMutate(BatchOperation<?> batchOp) throws IOException { boolean initialized = false; Operation op = batchOp.isInReplay() ? Operation.REPLAY_BATCH_MUTATE : Operation.BATCH_MUTATE; startRegionOperation(op); try { while (!batchOp.isDone()) { if (!batchOp.isInReplay()) { checkReadOnly(); } checkResources(); if (!initialized) { this.writeRequestsCount.add(batchOp.operations.length); if (!batchOp.isInReplay()) { doPreBatchMutateHook(batchOp); } initialized = true; } doMiniBatchMutate(batchOp); long newSize = this.getMemstoreSize(); requestFlushIfNeeded(newSize); } } finally { closeRegionOperation(op); } return batchOp.retCodeDetails; }
OperationStatus[] batchMutate(BatchOperation<?> batchOp) throws IOException { boolean initialized = false; Operation op = batchOp.isInReplay() ? Operation.REPLAY_BATCH_MUTATE : Operation.BATCH_MUTATE; startRegionOperation(op); try { while (!batchOp.isDone()) { if (!batchOp.isInReplay()) { checkReadOnly(); } checkResources(); if (!initialized) { this.writeRequestsCount.add(batchOp.operations.length); if (!batchOp.isInReplay()) { doPreBatchMutateHook(batchOp); } initialized = true; } doMiniBatchMutate(batchOp); long newSize = this.getMemstoreSize(); requestFlushIfNeeded(newSize); } } finally { closeRegionOperation(op); } return batchOp.retCodeDetails; }
/** * Perform a batch of mutations. * It supports only Put and Delete mutations and will ignore other types passed. * @param batchOp contains the list of mutations * @return an array of OperationStatus which internally contains the * OperationStatusCode and the exceptionMessage if any. * @throws IOException */
Perform a batch of mutations. It supports only Put and Delete mutations and will ignore other types passed
batchMutate
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java", "license": "apache-2.0", "size": 328407 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,503,254
public Object evaluate(final Reader scriptReader, final String description) throws IOException {
Object function(final Reader scriptReader, final String description) throws IOException {
/** * This method evaluates a piece of ECMAScript. * @param scriptReader a <code>java.io.Reader</code> on the piece of script * @param description description which can be later used (e.g., for error * messages). * @return if no exception is thrown during the call, should return the * value of the last expression evaluated in the script. */
This method evaluates a piece of ECMAScript
evaluate
{ "repo_name": "git-moss/Push2Display", "path": "lib/batik-1.8/sources/org/apache/batik/bridge/RhinoInterpreter.java", "license": "lgpl-3.0", "size": 20723 }
[ "java.io.IOException", "java.io.Reader" ]
import java.io.IOException; import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
1,118,337
@SuppressWarnings("squid:UnusedPrivateMethod") // Sonar doesn't do lambdas private static MetaExpression createExpression(Path folder) { LinkedHashMap<String, MetaExpression> value = new LinkedHashMap<>(); boolean read = Files.isReadable(folder); boolean write = Files.isWritable(folder); value.put("path", fromValue(folder.toString())); value.put("canRead", fromValue(read)); value.put("canWrite", fromValue(write)); value.put("isAccessible", fromValue(read && write && Files.isExecutable(folder))); if (folder.getParent() != null) { value.put("parent", fromValue(folder.getParent().toString())); } return fromValue(value); }
@SuppressWarnings(STR) static MetaExpression function(Path folder) { LinkedHashMap<String, MetaExpression> value = new LinkedHashMap<>(); boolean read = Files.isReadable(folder); boolean write = Files.isWritable(folder); value.put("path", fromValue(folder.toString())); value.put(STR, fromValue(read)); value.put(STR, fromValue(write)); value.put(STR, fromValue(read && write && Files.isExecutable(folder))); if (folder.getParent() != null) { value.put(STR, fromValue(folder.getParent().toString())); } return fromValue(value); }
/** * Build a MetaExpression from a Folder * * @param folder the folder * @return the MetaExpression */
Build a MetaExpression from a Folder
createExpression
{ "repo_name": "XillioQA/xill-platform-3.4", "path": "xill-processor/src/main/java/nl/xillio/xill/plugins/file/constructs/IterateFoldersConstruct.java", "license": "apache-2.0", "size": 2623 }
[ "java.nio.file.Files", "java.nio.file.Path", "java.util.LinkedHashMap", "nl.xillio.xill.api.components.MetaExpression" ]
import java.nio.file.Files; import java.nio.file.Path; import java.util.LinkedHashMap; import nl.xillio.xill.api.components.MetaExpression;
import java.nio.file.*; import java.util.*; import nl.xillio.xill.api.components.*;
[ "java.nio", "java.util", "nl.xillio.xill" ]
java.nio; java.util; nl.xillio.xill;
766,570
return DepartmentRecord.class; } public final TableField<DepartmentRecord, Integer> DEPARTMENT_ID = createField("department_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false).identity(true), this, ""); public final TableField<DepartmentRecord, String> DEPARTMENT_NAME = createField("department_name", org.jooq.impl.SQLDataType.VARCHAR(200).nullable(false), this, ""); public final TableField<DepartmentRecord, Byte> DEPARTMENT_IS_DEL = createField("department_is_del", org.jooq.impl.SQLDataType.TINYINT, this, ""); public final TableField<DepartmentRecord, Integer> COLLEGE_ID = createField("college_id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); public Department() { this(DSL.name("department"), null); } public Department(String alias) { this(DSL.name(alias), DEPARTMENT); } public Department(Name alias) { this(alias, DEPARTMENT); } private Department(Name alias, Table<DepartmentRecord> aliased) { this(alias, aliased, null); } private Department(Name alias, Table<DepartmentRecord> aliased, Field<?>[] parameters) { super(alias, null, aliased, parameters, ""); } /** * {@inheritDoc}
return DepartmentRecord.class; } public final TableField<DepartmentRecord, Integer> DEPARTMENT_ID = createField(STR, org.jooq.impl.SQLDataType.INTEGER.nullable(false).identity(true), this, STRdepartment_nameSTRSTRdepartment_is_delSTRSTRcollege_idSTRSTRdepartmentSTR"); } /** * {@inheritDoc}
/** * The class holding records for this type */
The class holding records for this type
getRecordType
{ "repo_name": "zbeboy/ISY", "path": "src/main/java/top/zbeboy/isy/domain/tables/Department.java", "license": "mit", "size": 4674 }
[ "org.jooq.TableField", "top.zbeboy.isy.domain.tables.records.DepartmentRecord" ]
import org.jooq.TableField; import top.zbeboy.isy.domain.tables.records.DepartmentRecord;
import org.jooq.*; import top.zbeboy.isy.domain.tables.records.*;
[ "org.jooq", "top.zbeboy.isy" ]
org.jooq; top.zbeboy.isy;
1,387,552
boolean isListenerMethod(Method method);
boolean isListenerMethod(Method method);
/** * Determines if the method is a listener method * * @param method The possible listener method. Cannot be null. * @return True if this is a listener method */
Determines if the method is a listener method
isListenerMethod
{ "repo_name": "mrdon/PLUG", "path": "atlassian-plugins-core/src/main/java/com/atlassian/plugin/event/impl/ListenerMethodSelector.java", "license": "bsd-3-clause", "size": 434 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
12,740
protected void assignOrUpdateModelMembers( Role modelRole, SecurityModel securityModel) { if (modelRole == null) { // this should throw an elegant error if either are null String error = "Data problem with access security. KIM Role backing the security model is missing. SecurityModel: " + securityModel; LOG.error(error); throw new RuntimeException(error); } for (SecurityModelMember modelMember : securityModel.getModelMembers()) { updateSecurityModelRoleMember(modelRole, modelMember, modelMember.getMemberTypeCode(), modelMember.getMemberId(), new HashMap<String, String>(0)); createPrincipalSecurityRecords(modelMember.getMemberId(), modelMember.getMemberTypeCode()); } }
void function( Role modelRole, SecurityModel securityModel) { if (modelRole == null) { String error = STR + securityModel; LOG.error(error); throw new RuntimeException(error); } for (SecurityModelMember modelMember : securityModel.getModelMembers()) { updateSecurityModelRoleMember(modelRole, modelMember, modelMember.getMemberTypeCode(), modelMember.getMemberId(), new HashMap<String, String>(0)); createPrincipalSecurityRecords(modelMember.getMemberId(), modelMember.getMemberTypeCode()); } }
/** * Iterates through the model member list and assign members to the model role or updates the membership * * @param securityModel SecurityModel whose member list should be updated */
Iterates through the model member list and assign members to the model role or updates the membership
assignOrUpdateModelMembers
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/sec/document/SecurityModelMaintainableImpl.java", "license": "apache-2.0", "size": 14518 }
[ "java.util.HashMap", "org.kuali.kfs.sec.businessobject.SecurityModel", "org.kuali.kfs.sec.businessobject.SecurityModelMember", "org.kuali.rice.kim.api.role.Role" ]
import java.util.HashMap; import org.kuali.kfs.sec.businessobject.SecurityModel; import org.kuali.kfs.sec.businessobject.SecurityModelMember; import org.kuali.rice.kim.api.role.Role;
import java.util.*; import org.kuali.kfs.sec.businessobject.*; import org.kuali.rice.kim.api.role.*;
[ "java.util", "org.kuali.kfs", "org.kuali.rice" ]
java.util; org.kuali.kfs; org.kuali.rice;
1,089,405
@Nonnull Map<String, List<String>> multipartMultimap();
@Nonnull Map<String, List<String>> multipartMultimap();
/** * Multipart data as multi-value map. * * Only for <code>multipart/form-data</code> request. * * @return Multi-value map. */
Multipart data as multi-value map. Only for <code>multipart/form-data</code> request
multipartMultimap
{ "repo_name": "jooby-project/jooby", "path": "jooby/src/main/java/io/jooby/Context.java", "license": "apache-2.0", "size": 41138 }
[ "java.util.List", "java.util.Map", "javax.annotation.Nonnull" ]
import java.util.List; import java.util.Map; import javax.annotation.Nonnull;
import java.util.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
2,850,255
public List<JobEntryInterface> composeJobEntryInterfaceList() { List<JobEntryInterface> list = new ArrayList<JobEntryInterface>(); for ( JobEntryCopy copy : jobcopies ) { if ( !list.contains( copy.getEntry() ) ) { list.add( copy.getEntry() ); } } return list; }
List<JobEntryInterface> function() { List<JobEntryInterface> list = new ArrayList<JobEntryInterface>(); for ( JobEntryCopy copy : jobcopies ) { if ( !list.contains( copy.getEntry() ) ) { list.add( copy.getEntry() ); } } return list; }
/** * Create a unique list of job entry interfaces * * @return */
Create a unique list of job entry interfaces
composeJobEntryInterfaceList
{ "repo_name": "ma459006574/pentaho-kettle", "path": "engine/src/org/pentaho/di/job/JobMeta.java", "license": "apache-2.0", "size": 85011 }
[ "java.util.ArrayList", "java.util.List", "org.pentaho.di.job.entry.JobEntryCopy", "org.pentaho.di.job.entry.JobEntryInterface" ]
import java.util.ArrayList; import java.util.List; import org.pentaho.di.job.entry.JobEntryCopy; import org.pentaho.di.job.entry.JobEntryInterface;
import java.util.*; import org.pentaho.di.job.entry.*;
[ "java.util", "org.pentaho.di" ]
java.util; org.pentaho.di;
6,072
@Test public final void testAddAll() { String testName = new String("CollectionListe<String>.addAll(Collection<String>)"); System.out.println(testName); ArrayList<String> otherCollection = new ArrayList<String>(); remplissage(otherCollection); collection.addAll(otherCollection); assertNotNull(testName + " instance", collection); assertFalse(testName + " not empty", collection.isEmpty()); assertEquals(testName + " size", elements.length, collection.size()); int i = 0; for (String elt : collection) { assertSame(testName + " elt[" + String.valueOf(i) + "]", elements[i++], elt); } }
final void function() { String testName = new String(STR); System.out.println(testName); ArrayList<String> otherCollection = new ArrayList<String>(); remplissage(otherCollection); collection.addAll(otherCollection); assertNotNull(testName + STR, collection); assertFalse(testName + STR, collection.isEmpty()); assertEquals(testName + STR, elements.length, collection.size()); int i = 0; for (String elt : collection) { assertSame(testName + STR + String.valueOf(i) + "]", elements[i++], elt); } }
/** * Test method for * {@link java.util.AbstractCollection#addAll(java.util.Collection)}. */
Test method for <code>java.util.AbstractCollection#addAll(java.util.Collection)</code>
testAddAll
{ "repo_name": "rpereira-dev/ENSIIE", "path": "UE/S2/ILO/TP Listes & Figures/src/tests/CollectionListeTest.java", "license": "gpl-3.0", "size": 22104 }
[ "java.util.ArrayList", "org.junit.Assert" ]
import java.util.ArrayList; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
366,908
@Test public void testGenieRunningJobs0To15mCounter() { Assert.assertEquals(0, this.stats.getGenieRunningJobs0To15m().get()); final int count = 532; this.stats.setGenieRunningJobs0To15m(count); Assert.assertEquals(count, this.stats.getGenieRunningJobs0To15m().get()); }
void function() { Assert.assertEquals(0, this.stats.getGenieRunningJobs0To15m().get()); final int count = 532; this.stats.setGenieRunningJobs0To15m(count); Assert.assertEquals(count, this.stats.getGenieRunningJobs0To15m().get()); }
/** * Test the counter for Genie running jobs 0 to 15 minutes. */
Test the counter for Genie running jobs 0 to 15 minutes
testGenieRunningJobs0To15mCounter
{ "repo_name": "ZhangboFrank/genie", "path": "genie-server/src/test/java/com/netflix/genie/server/metrics/impl/TestGenieNodeStatisticsImpl.java", "license": "apache-2.0", "size": 7816 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
674,553
public long getNextScheduleTime() throws IOException { Map.Entry<Long, List<LegacyJobLocation>> first = this.index.getFirst(this.store.getPageFile().tx()); return first != null ? first.getKey() : -1l; }
long function() throws IOException { Map.Entry<Long, List<LegacyJobLocation>> first = this.index.getFirst(this.store.getPageFile().tx()); return first != null ? first.getKey() : -1l; }
/** * Returns the next time that a job would be scheduled to run. * * @return time of next scheduled job to run. * * @throws IOException if an error occurs while fetching the time. */
Returns the next time that a job would be scheduled to run
getNextScheduleTime
{ "repo_name": "chirino/activemq", "path": "activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/legacy/LegacyJobSchedulerImpl.java", "license": "apache-2.0", "size": 8613 }
[ "java.io.IOException", "java.util.List", "java.util.Map" ]
import java.io.IOException; import java.util.List; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,274,428
public void setChildren(FileStatus[] listStatus) { this.children = listStatus; }
void function(FileStatus[] listStatus) { this.children = listStatus; }
/** * set children of this object * @param listStatus the list of children */
set children of this object
setChildren
{ "repo_name": "tseen/Federated-HDFS", "path": "tseenliu/FedHDFS-hadoop-src/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java", "license": "apache-2.0", "size": 31710 }
[ "org.apache.hadoop.fs.FileStatus" ]
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
411,517
public static PieDataset readPieDatasetFromXML(InputStream in) throws IOException { PieDataset result = null; SAXParserFactory factory = SAXParserFactory.newInstance(); try { SAXParser parser = factory.newSAXParser(); PieDatasetHandler handler = new PieDatasetHandler(); parser.parse(in, handler); result = handler.getDataset(); } catch (SAXException e) { System.out.println(e.getMessage()); } catch (ParserConfigurationException e2) { System.out.println(e2.getMessage()); } return result; }
static PieDataset function(InputStream in) throws IOException { PieDataset result = null; SAXParserFactory factory = SAXParserFactory.newInstance(); try { SAXParser parser = factory.newSAXParser(); PieDatasetHandler handler = new PieDatasetHandler(); parser.parse(in, handler); result = handler.getDataset(); } catch (SAXException e) { System.out.println(e.getMessage()); } catch (ParserConfigurationException e2) { System.out.println(e2.getMessage()); } return result; }
/** * Reads a {@link PieDataset} from a stream. * * @param in the input stream. * * @return A dataset. * * @throws IOException if there is an I/O error. */
Reads a <code>PieDataset</code> from a stream
readPieDatasetFromXML
{ "repo_name": "apetresc/JFreeChart", "path": "src/main/java/org/jfree/data/xml/DatasetReader.java", "license": "lgpl-2.1", "size": 4697 }
[ "java.io.IOException", "java.io.InputStream", "javax.xml.parsers.ParserConfigurationException", "javax.xml.parsers.SAXParser", "javax.xml.parsers.SAXParserFactory", "org.jfree.data.general.PieDataset", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.jfree.data.general.PieDataset; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import org.jfree.data.general.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.jfree.data", "org.xml.sax" ]
java.io; javax.xml; org.jfree.data; org.xml.sax;
2,672,135
private Subject getClientSubject(SSLSocket socket) { SSLSession session = socket.getSession(); try { Certificate[] certificateChain = session.getPeerCertificates(); if (certificateChain != null && certificateChain.length > 0 && certificateChain[0] instanceof X509Certificate) { X509Certificate cert = (X509Certificate) certificateChain[0]; return new Subject( true, Collections.singleton(cert.getSubjectX500Principal()), Collections.singleton( getCertFactory().generateCertPath( Arrays.asList(certificateChain))), Collections.EMPTY_SET); } } catch (SSLPeerUnverifiedException e) { } catch (CertificateException e) { logger.log(Levels.HANDLED, "get client subject caught exception", e); } return null; }
Subject function(SSLSocket socket) { SSLSession session = socket.getSession(); try { Certificate[] certificateChain = session.getPeerCertificates(); if (certificateChain != null && certificateChain.length > 0 && certificateChain[0] instanceof X509Certificate) { X509Certificate cert = (X509Certificate) certificateChain[0]; return new Subject( true, Collections.singleton(cert.getSubjectX500Principal()), Collections.singleton( getCertFactory().generateCertPath( Arrays.asList(certificateChain))), Collections.EMPTY_SET); } } catch (SSLPeerUnverifiedException e) { } catch (CertificateException e) { logger.log(Levels.HANDLED, STR, e); } return null; }
/** * Returns the read-only <code>Subject</code> associated with the * client host connected to the other end of the connection on the * specified <code>SSLSocket</code>. Returns null if the client is * anonymous. */
Returns the read-only <code>Subject</code> associated with the client host connected to the other end of the connection on the specified <code>SSLSocket</code>. Returns null if the client is anonymous
getClientSubject
{ "repo_name": "cdegroot/river", "path": "src/net/jini/jeri/ssl/SslServerEndpointImpl.java", "license": "apache-2.0", "size": 43846 }
[ "com.sun.jini.logging.Levels", "java.security.cert.Certificate", "java.security.cert.CertificateException", "java.security.cert.X509Certificate", "java.util.Arrays", "java.util.Collections", "javax.net.ssl.SSLPeerUnverifiedException", "javax.net.ssl.SSLSession", "javax.net.ssl.SSLSocket", "javax.security.auth.Subject" ]
import com.sun.jini.logging.Levels; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Collections; import javax.net.ssl.SSLPeerUnverifiedException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.security.auth.Subject;
import com.sun.jini.logging.*; import java.security.cert.*; import java.util.*; import javax.net.ssl.*; import javax.security.auth.*;
[ "com.sun.jini", "java.security", "java.util", "javax.net", "javax.security" ]
com.sun.jini; java.security; java.util; javax.net; javax.security;
947,291
protected void enqueueUIOperation(UIOperation operation) { SoftAssertions.assertNotNull(operation); mOperations.add(operation); }
void function(UIOperation operation) { SoftAssertions.assertNotNull(operation); mOperations.add(operation); }
/** * Enqueues a UIOperation to be executed in UI thread. This method should only be used by a * subclass to support UIOperations not provided by UIViewOperationQueue. */
Enqueues a UIOperation to be executed in UI thread. This method should only be used by a subclass to support UIOperations not provided by UIViewOperationQueue
enqueueUIOperation
{ "repo_name": "hoastoolshop/react-native", "path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java", "license": "bsd-3-clause", "size": 32689 }
[ "com.facebook.react.bridge.SoftAssertions" ]
import com.facebook.react.bridge.SoftAssertions;
import com.facebook.react.bridge.*;
[ "com.facebook.react" ]
com.facebook.react;
2,157,888
public static JTextArea findJTextArea(Container cont, String text, boolean ce, boolean ccs, int index) { return (findJTextArea(cont, new JTextAreaFinder(new JTextComponentOperator.JTextComponentByTextFinder(text, new DefaultStringComparator(ce, ccs))), index)); }
static JTextArea function(Container cont, String text, boolean ce, boolean ccs, int index) { return (findJTextArea(cont, new JTextAreaFinder(new JTextComponentOperator.JTextComponentByTextFinder(text, new DefaultStringComparator(ce, ccs))), index)); }
/** * Searches JTextArea by text. * * @param cont Container to search component in. * @param text Component text. * @param ce Compare text exactly. * @param ccs Compare text case sensitively. * @param index Ordinal component index. * @return JTextArea instance or null if component was not found. * @see ComponentOperator#isCaptionEqual(String, String, boolean, boolean) */
Searches JTextArea by text
findJTextArea
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/JTextAreaOperator.java", "license": "gpl-2.0", "size": 21015 }
[ "java.awt.Container", "javax.swing.JTextArea" ]
import java.awt.Container; import javax.swing.JTextArea;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,341,133
public void addOperator(Operator operator, OutputPort port, PCollection output) { // Apex DAG requires a unique operator name // use the transform's name and make it unique String name = getCurrentTransform().getFullName(); for (int i = 1; this.operators.containsKey(name); i++) { name = getCurrentTransform().getFullName() + i; } this.operators.put(name, operator); this.streams.put(output, (Pair) new ImmutablePair<>( new OutputPortInfo(port, getCurrentTransform()), new ArrayList<>())); }
void function(Operator operator, OutputPort port, PCollection output) { String name = getCurrentTransform().getFullName(); for (int i = 1; this.operators.containsKey(name); i++) { name = getCurrentTransform().getFullName() + i; } this.operators.put(name, operator); this.streams.put(output, (Pair) new ImmutablePair<>( new OutputPortInfo(port, getCurrentTransform()), new ArrayList<>())); }
/** * Add the operator with its output port for the given result {link PCollection}. * @param operator * @param port * @param output */
Add the operator with its output port for the given result {link PCollection}
addOperator
{ "repo_name": "dhalperi/incubator-beam", "path": "runners/apex/src/main/java/org/apache/beam/runners/apex/translation/TranslationContext.java", "license": "apache-2.0", "size": 10077 }
[ "com.datatorrent.api.Operator", "java.util.ArrayList", "org.apache.beam.sdk.values.PCollection", "org.apache.commons.lang3.tuple.ImmutablePair", "org.apache.commons.lang3.tuple.Pair" ]
import com.datatorrent.api.Operator; import java.util.ArrayList; import org.apache.beam.sdk.values.PCollection; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair;
import com.datatorrent.api.*; import java.util.*; import org.apache.beam.sdk.values.*; import org.apache.commons.lang3.tuple.*;
[ "com.datatorrent.api", "java.util", "org.apache.beam", "org.apache.commons" ]
com.datatorrent.api; java.util; org.apache.beam; org.apache.commons;
401,917
TopologyGraph getGraph() { return graph; }
TopologyGraph getGraph() { return graph; }
/** * Returns the backing topology graph. * * @return topology graph */
Returns the backing topology graph
getGraph
{ "repo_name": "jmiserez/onos", "path": "core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/DefaultTopology.java", "license": "apache-2.0", "size": 18093 }
[ "org.onosproject.net.topology.TopologyGraph" ]
import org.onosproject.net.topology.TopologyGraph;
import org.onosproject.net.topology.*;
[ "org.onosproject.net" ]
org.onosproject.net;
997,216
public static <T> Function<T, T> getPassThru() { return Functions.identity(); }
static <T> Function<T, T> function() { return Functions.identity(); }
/** * Alias for identity(). Inlineable. * * @see #identity() */
Alias for identity(). Inlineable
getPassThru
{ "repo_name": "bhav0904/eclipse-collections", "path": "eclipse-collections/src/main/java/org/eclipse/collections/impl/block/factory/Functions.java", "license": "bsd-3-clause", "size": 38985 }
[ "org.eclipse.collections.api.block.function.Function" ]
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.*;
[ "org.eclipse.collections" ]
org.eclipse.collections;
2,601,777
private void removeCrouton(Crouton crouton) { View croutonView = crouton.getView(); ViewGroup croutonParentView = (ViewGroup) croutonView.getParent(); if (croutonParentView != null) { croutonView.startAnimation(crouton.getOutAnimation()); // Remove the Crouton from the queue. Crouton removed = croutonQueue.poll(); // Remove the crouton from the view's parent. croutonParentView.removeView(croutonView); if (removed != null) { removed.detachActivity(); } // Send a message to display the next crouton but delay it by the out // animation duration to make sure it finishes sendMessageDelayed(crouton, Messages.DISPLAY_CROUTON, crouton.getOutAnimation().getDuration()); } }
void function(Crouton crouton) { View croutonView = crouton.getView(); ViewGroup croutonParentView = (ViewGroup) croutonView.getParent(); if (croutonParentView != null) { croutonView.startAnimation(crouton.getOutAnimation()); Crouton removed = croutonQueue.poll(); croutonParentView.removeView(croutonView); if (removed != null) { removed.detachActivity(); } sendMessageDelayed(crouton, Messages.DISPLAY_CROUTON, crouton.getOutAnimation().getDuration()); } }
/** * Removes the {@link Crouton}'s view after it's display * durationInMilliseconds. * * @param crouton * The {@link Crouton} added to a {@link ViewGroup} and should be * removed. */
Removes the <code>Crouton</code>'s view after it's display durationInMilliseconds
removeCrouton
{ "repo_name": "bellycard/Crouton", "path": "library/src/de/neofonie/mobile/app/android/widget/crouton/Manager.java", "license": "apache-2.0", "size": 9229 }
[ "android.view.View", "android.view.ViewGroup" ]
import android.view.View; import android.view.ViewGroup;
import android.view.*;
[ "android.view" ]
android.view;
2,727,189
public void setIncludes(String packages) { StringTokenizer tok = new StringTokenizer(packages, ","); while (tok.hasMoreTokens()) { String p = tok.nextToken(); PackageName pn = new PackageName(); pn.setName(p); addConfiguredInclude(pn); } }
void function(String packages) { StringTokenizer tok = new StringTokenizer(packages, ","); while (tok.hasMoreTokens()) { String p = tok.nextToken(); PackageName pn = new PackageName(); pn.setName(p); addConfiguredInclude(pn); } }
/** * Set the package names to be processed. * * @param packages a comma separated list of packages specs * (may include wildcards). * * @see #addPackage for wildcard information. */
Set the package names to be processed
setIncludes
{ "repo_name": "ModelN/build-management", "path": "mn-build-ant/src/main/java/com/modeln/build/ant/depends/DependencyListTask.java", "license": "mit", "size": 26777 }
[ "java.util.StringTokenizer" ]
import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
806,934
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { if (player.isSneaking()) return false; else { if (!world.isRemote) { TilePlasticOven tilePlasticOven = (TilePlasticOven) world.getBlockTileEntity(x, y, z); if (tilePlasticOven != null) { player.openGui(CivCraftBase.instance, GuiIDs.FURNACE_EASY, world, x, y, z); } } return true; } }
boolean function(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { if (player.isSneaking()) return false; else { if (!world.isRemote) { TilePlasticOven tilePlasticOven = (TilePlasticOven) world.getBlockTileEntity(x, y, z); if (tilePlasticOven != null) { player.openGui(CivCraftBase.instance, GuiIDs.FURNACE_EASY, world, x, y, z); } } return true; } }
/** * Called upon block activation (right click on the block.) */
Called upon block activation (right click on the block.)
onBlockActivated
{ "repo_name": "Morton00000/CivCraft", "path": "common/civcraft/blocks/machines/PlasticOven.java", "license": "gpl-3.0", "size": 9054 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.world.World" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World;
import net.minecraft.entity.player.*; import net.minecraft.world.*;
[ "net.minecraft.entity", "net.minecraft.world" ]
net.minecraft.entity; net.minecraft.world;
317,231
public static boolean isAuthenticated() { SecurityContext securityContext = SecurityContextHolder.getContext(); Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); if (authorities != null) { for (GrantedAuthority authority : authorities) { if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) { return false; } } } return true; }
static boolean function() { SecurityContext securityContext = SecurityContextHolder.getContext(); Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); if (authorities != null) { for (GrantedAuthority authority : authorities) { if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) { return false; } } } return true; }
/** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise */
Check if a user is authenticated
isAuthenticated
{ "repo_name": "northlander/activemft", "path": "src/main/java/co/nordlander/activemft/security/SecurityUtils.java", "license": "apache-2.0", "size": 2673 }
[ "java.util.Collection", "org.springframework.security.core.GrantedAuthority", "org.springframework.security.core.context.SecurityContext", "org.springframework.security.core.context.SecurityContextHolder" ]
import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder;
import java.util.*; import org.springframework.security.core.*; import org.springframework.security.core.context.*;
[ "java.util", "org.springframework.security" ]
java.util; org.springframework.security;
2,194,497
public static void close() { flush(); try { out.close(); isInitialized = false; } catch (IOException e) { e.printStackTrace(); } }
static void function() { flush(); try { out.close(); isInitialized = false; } catch (IOException e) { e.printStackTrace(); } }
/** * Flushes and closes standard output. Once standard output is closed, you can no * longer write bits to it. */
Flushes and closes standard output. Once standard output is closed, you can no longer write bits to it
close
{ "repo_name": "quanhua92/learning-notes", "path": "courses/coursera/algorithms/src/edu/princeton/cs/algs4/BinaryStdOut.java", "license": "apache-2.0", "size": 10049 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,454,359
boolean executeAndShowTextFind(Pattern pattern); } private static class JEditorPaneSearchProvider implements ISearchTextExtensionProvider { private static volatile int LAST_POSITION_DEFAULT = 0; private static final Color HILIT_COLOR = Color.LIGHT_GRAY; private JEditorPane results; private Highlighter selection; private Highlighter.HighlightPainter painter; private int lastPosition = LAST_POSITION_DEFAULT; public JEditorPaneSearchProvider(JEditorPane results) { this.results = results; // prepare highlighter to show text find with search command selection = new DefaultHighlighter(); painter = new DefaultHighlighter.DefaultHighlightPainter(HILIT_COLOR); results.setHighlighter(selection); }
boolean executeAndShowTextFind(Pattern pattern); } private static class JEditorPaneSearchProvider implements ISearchTextExtensionProvider { private static volatile int LAST_POSITION_DEFAULT = 0; private static final Color HILIT_COLOR = Color.LIGHT_GRAY; private JEditorPane results; private Highlighter selection; private Highlighter.HighlightPainter painter; private int lastPosition = LAST_POSITION_DEFAULT; public JEditorPaneSearchProvider(JEditorPane results) { this.results = results; selection = new DefaultHighlighter(); painter = new DefaultHighlighter.DefaultHighlightPainter(HILIT_COLOR); results.setHighlighter(selection); }
/** * Launch find text engine on target component * @return true if there was a match, false otherwise */
Launch find text engine on target component
executeAndShowTextFind
{ "repo_name": "ubikfsabbe/jmeter", "path": "src/components/org/apache/jmeter/visualizers/SearchTextExtension.java", "license": "apache-2.0", "size": 12194 }
[ "java.awt.Color", "java.util.regex.Pattern", "javax.swing.JEditorPane", "javax.swing.text.DefaultHighlighter", "javax.swing.text.Highlighter" ]
import java.awt.Color; import java.util.regex.Pattern; import javax.swing.JEditorPane; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Highlighter;
import java.awt.*; import java.util.regex.*; import javax.swing.*; import javax.swing.text.*;
[ "java.awt", "java.util", "javax.swing" ]
java.awt; java.util; javax.swing;
131,175
private void updateDocumentProvider(IEditorInput input) { IProgressMonitor rememberedProgressMonitor= null; IDocumentProvider provider= getDocumentProvider(); if (provider != null) { provider.removeElementStateListener(fElementStateListener); if (provider instanceof IDocumentProviderExtension2) { IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) provider; rememberedProgressMonitor= extension.getProgressMonitor(); extension.setProgressMonitor(null); } } setDocumentProvider(input); provider= getDocumentProvider(); if (provider != null) { provider.addElementStateListener(fElementStateListener); if (provider instanceof IDocumentProviderExtension2) { IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) provider; extension.setProgressMonitor(rememberedProgressMonitor); } } }
void function(IEditorInput input) { IProgressMonitor rememberedProgressMonitor= null; IDocumentProvider provider= getDocumentProvider(); if (provider != null) { provider.removeElementStateListener(fElementStateListener); if (provider instanceof IDocumentProviderExtension2) { IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) provider; rememberedProgressMonitor= extension.getProgressMonitor(); extension.setProgressMonitor(null); } } setDocumentProvider(input); provider= getDocumentProvider(); if (provider != null) { provider.addElementStateListener(fElementStateListener); if (provider instanceof IDocumentProviderExtension2) { IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) provider; extension.setProgressMonitor(rememberedProgressMonitor); } } }
/** * If there is no explicit document provider set, the implicit one is * re-initialized based on the given editor input. * * @param input the editor input. */
If there is no explicit document provider set, the implicit one is re-initialized based on the given editor input
updateDocumentProvider
{ "repo_name": "xiaguangme/simon_ide_tools", "path": "02.eclipse_enhance/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java", "license": "apache-2.0", "size": 247622 }
[ "org.eclipse.core.runtime.IProgressMonitor", "org.eclipse.ui.IEditorInput" ]
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.ui.IEditorInput;
import org.eclipse.core.runtime.*; import org.eclipse.ui.*;
[ "org.eclipse.core", "org.eclipse.ui" ]
org.eclipse.core; org.eclipse.ui;
1,030,328
public List<String> readUrlNamesForAllLocales(CmsRequestContext context, CmsUUID id) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { return m_driverManager.readUrlNamesForAllLocales(dbc, id); } catch (Exception e) { CmsMessageContainer message = Messages.get().container( Messages.ERR_READ_NEWEST_URLNAME_FOR_ID_1, id.toString()); dbc.report(null, message, e); return null; // will never be reached } finally { dbc.clear(); } }
List<String> function(CmsRequestContext context, CmsUUID id) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { return m_driverManager.readUrlNamesForAllLocales(dbc, id); } catch (Exception e) { CmsMessageContainer message = Messages.get().container( Messages.ERR_READ_NEWEST_URLNAME_FOR_ID_1, id.toString()); dbc.report(null, message, e); return null; } finally { dbc.clear(); } }
/** * Reads the newest URL names of a structure id for all locales.<p> * * @param context the current context * @param id a structure id * * @return the list of URL names for all * @throws CmsException if something goes wrong */
Reads the newest URL names of a structure id for all locales
readUrlNamesForAllLocales
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/db/CmsSecurityManager.java", "license": "lgpl-2.1", "size": 287876 }
[ "java.util.List", "org.opencms.file.CmsRequestContext", "org.opencms.i18n.CmsMessageContainer", "org.opencms.main.CmsException", "org.opencms.util.CmsUUID" ]
import java.util.List; import org.opencms.file.CmsRequestContext; import org.opencms.i18n.CmsMessageContainer; import org.opencms.main.CmsException; import org.opencms.util.CmsUUID;
import java.util.*; import org.opencms.file.*; import org.opencms.i18n.*; import org.opencms.main.*; import org.opencms.util.*;
[ "java.util", "org.opencms.file", "org.opencms.i18n", "org.opencms.main", "org.opencms.util" ]
java.util; org.opencms.file; org.opencms.i18n; org.opencms.main; org.opencms.util;
2,580,143
@Override protected void updateAdapter() { if (!mIsResumed) { return; } List bioText = new ArrayList<>(); if (mArtist != null) { if (mArtist.getBio() == null) { InfoSystem.get().resolve(mArtist, false); } bioText.add(mArtist.getBio()); fillAdapter(new Segment(bioText)); } }
void function() { if (!mIsResumed) { return; } List bioText = new ArrayList<>(); if (mArtist != null) { if (mArtist.getBio() == null) { InfoSystem.get().resolve(mArtist, false); } bioText.add(mArtist.getBio()); fillAdapter(new Segment(bioText)); } }
/** * Update this {@link org.tomahawk.tomahawk_android.fragments.TomahawkFragment}'s {@link * org.tomahawk.tomahawk_android.adapters.TomahawkListAdapter} content */
Update this <code>org.tomahawk.tomahawk_android.fragments.TomahawkFragment</code>'s <code>org.tomahawk.tomahawk_android.adapters.TomahawkListAdapter</code> content
updateAdapter
{ "repo_name": "wenscript/tomahawk-android", "path": "src/org/tomahawk/tomahawk_android/fragments/BiographyFragment.java", "license": "gpl-3.0", "size": 2161 }
[ "java.util.ArrayList", "java.util.List", "org.tomahawk.libtomahawk.infosystem.InfoSystem", "org.tomahawk.tomahawk_android.adapters.Segment" ]
import java.util.ArrayList; import java.util.List; import org.tomahawk.libtomahawk.infosystem.InfoSystem; import org.tomahawk.tomahawk_android.adapters.Segment;
import java.util.*; import org.tomahawk.libtomahawk.infosystem.*; import org.tomahawk.tomahawk_android.adapters.*;
[ "java.util", "org.tomahawk.libtomahawk", "org.tomahawk.tomahawk_android" ]
java.util; org.tomahawk.libtomahawk; org.tomahawk.tomahawk_android;
2,708,939