method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Override public Object clone() throws CloneNotSupportedException { XYSeriesCollection clone = (XYSeriesCollection) super.clone(); clone.data = (List) ObjectUtilities.deepClone(this.data); clone.intervalDelegate = (IntervalXYDelegate) this.intervalDelegate.clone(); return clone; }
Object function() throws CloneNotSupportedException { XYSeriesCollection clone = (XYSeriesCollection) super.clone(); clone.data = (List) ObjectUtilities.deepClone(this.data); clone.intervalDelegate = (IntervalXYDelegate) this.intervalDelegate.clone(); return clone; }
/** * Returns a clone of this instance. * * @return A clone. * * @throws CloneNotSupportedException if there is a problem. */
Returns a clone of this instance
clone
{ "repo_name": "hongliangpan/manydesigns.cn", "path": "trunk/portofino-chart/jfreechat.src/org/jfree/data/xy/XYSeriesCollection.java", "license": "lgpl-3.0", "size": 24333 }
[ "java.util.List", "org.jfree.util.ObjectUtilities" ]
import java.util.List; import org.jfree.util.ObjectUtilities;
import java.util.*; import org.jfree.util.*;
[ "java.util", "org.jfree.util" ]
java.util; org.jfree.util;
2,044,973
void corruptData() throws IOException;
void corruptData() throws IOException;
/** * Corrupt the block file of the replica. * @throws FileNotFoundException if the block file does not exist. * @throws IOException if I/O error. */
Corrupt the block file of the replica
corruptData
{ "repo_name": "leechoongyon/HadoopSourceAnalyze", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/FsDatasetTestUtils.java", "license": "apache-2.0", "size": 8308 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,693,514
@Test public void testT1RV9D1_T1LV2D4() { test_id = getTestId("T1RV9D1", "T1LV2D4", "144"); String src = selectTRVD("T1RV9D1"); String dest = selectTLVD("T1LV2D4"); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(Failure2, checkResult_Failure2(src, dest, result)); GraphicalEditor editor = getActiveEditor(); if (editor != null) { validateOrGenerateResults(editor, generateResults); } }
void function() { test_id = getTestId(STR, STR, "144"); String src = selectTRVD(STR); String dest = selectTLVD(STR); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(Failure2, checkResult_Failure2(src, dest, result)); GraphicalEditor editor = getActiveEditor(); if (editor != null) { validateOrGenerateResults(editor, generateResults); } }
/** * Perform the test for the given matrix column (T1RV9D1) and row (T1LV2D4). * */
Perform the test for the given matrix column (T1RV9D1) and row (T1LV2D4)
testT1RV9D1_T1LV2D4
{ "repo_name": "jason-rhodes/bridgepoint", "path": "src/org.xtuml.bp.als.oal.test/src/org/xtuml/bp/als/oal/test/SingleDimensionFixedArrayAssigmentTest_16_Generics.java", "license": "apache-2.0", "size": 186177 }
[ "org.xtuml.bp.ui.graphics.editor.GraphicalEditor" ]
import org.xtuml.bp.ui.graphics.editor.GraphicalEditor;
import org.xtuml.bp.ui.graphics.editor.*;
[ "org.xtuml.bp" ]
org.xtuml.bp;
572,972
protected String getUserHighestRole(SilverCrawlerSessionController sessionController) { String[] profiles = sessionController.getUserRoles(); return ProfileHelper.getBestProfile(profiles); }
String function(SilverCrawlerSessionController sessionController) { String[] profiles = sessionController.getUserRoles(); return ProfileHelper.getBestProfile(profiles); }
/** * Return user's highest role * * @param sessionController * * @return */
Return user's highest role
getUserHighestRole
{ "repo_name": "stephaneperry/Silverpeas-Components", "path": "silvercrawler/silvercrawler-war/src/main/java/com/silverpeas/silvercrawler/servlets/handlers/FunctionHandler.java", "license": "agpl-3.0", "size": 2806 }
[ "com.silverpeas.silvercrawler.control.ProfileHelper", "com.silverpeas.silvercrawler.control.SilverCrawlerSessionController" ]
import com.silverpeas.silvercrawler.control.ProfileHelper; import com.silverpeas.silvercrawler.control.SilverCrawlerSessionController;
import com.silverpeas.silvercrawler.control.*;
[ "com.silverpeas.silvercrawler" ]
com.silverpeas.silvercrawler;
1,175,452
public double potentialValue(State s);
double function(State s);
/** * Returns the reward potential from the given state. * Note: the potential function should always return 0 for terminal states. * @param s the input state for which to get the reward potential. * @return the reward potential from the given state. */
Returns the reward potential from the given state. Note: the potential function should always return 0 for terminal states
potentialValue
{ "repo_name": "nakulgopalan/burlap_pomdp_additions", "path": "src/burlap/behavior/singleagent/shaping/potential/PotentialFunction.java", "license": "lgpl-3.0", "size": 682 }
[ "burlap.oomdp.core.State" ]
import burlap.oomdp.core.State;
import burlap.oomdp.core.*;
[ "burlap.oomdp.core" ]
burlap.oomdp.core;
1,953,361
public Bank getBank(Resources res) { Bank bank; if (mBankName.equals("UCB_CZ")) { bank = new UniCreditBank(res); } else if (mBankName.equals("TB")) { bank = new TestingBank(res); } else { // Default bank bank = new RaiffeisenBank(res); } return bank; }
Bank function(Resources res) { Bank bank; if (mBankName.equals(STR)) { bank = new UniCreditBank(res); } else if (mBankName.equals("TB")) { bank = new TestingBank(res); } else { bank = new RaiffeisenBank(res); } return bank; }
/** * Get the bank by its ID. * * @param res * Resources. * @return Returns Bank object. */
Get the bank by its ID
getBank
{ "repo_name": "jtyr/currencyrates", "path": "src/cz/tyr/android/currencyrates/BankHelper.java", "license": "apache-2.0", "size": 2334 }
[ "android.content.res.Resources", "cz.tyr.android.currencyrates.bank.RaiffeisenBank", "cz.tyr.android.currencyrates.bank.TestingBank", "cz.tyr.android.currencyrates.bank.UniCreditBank" ]
import android.content.res.Resources; import cz.tyr.android.currencyrates.bank.RaiffeisenBank; import cz.tyr.android.currencyrates.bank.TestingBank; import cz.tyr.android.currencyrates.bank.UniCreditBank;
import android.content.res.*; import cz.tyr.android.currencyrates.bank.*;
[ "android.content", "cz.tyr.android" ]
android.content; cz.tyr.android;
592,814
public List<AccessScope> access() { return this.access; }
List<AccessScope> function() { return this.access; }
/** * Get the authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task. * * @return the access value */
Get the authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task
access
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/batch/microsoft-azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/AuthenticationTokenSettings.java", "license": "mit", "size": 1827 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
292,185
@Override protected URI getUrlForId(final String id) { return UriBuilder.fromPath("/application/") .path(id) .build(); }
URI function(final String id) { return UriBuilder.fromPath(STR) .path(id) .build(); }
/** * Construct the request URL for this test given a specific resource ID. * * @param id The ID to use. * @return The resource URL. */
Construct the request URL for this test given a specific resource ID
getUrlForId
{ "repo_name": "kangaroo-server/kangaroo", "path": "kangaroo-server-authz/src/test/java/net/krotscheck/kangaroo/authz/admin/v1/resource/AbstractServiceTest.java", "license": "apache-2.0", "size": 26802 }
[ "javax.ws.rs.core.UriBuilder" ]
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.*;
[ "javax.ws" ]
javax.ws;
583,350
public static void downloadAndRespond(Context context, Uri uri, Messenger messenger) { sendPath(DownloadUtils.downloadFile(context, uri), messenger); } static final int OFFLINE_TEST_IMAGE = R.raw.dougs; static final String OFFLINE_FILENAME = "dougs.jpg";
static void function(Context context, Uri uri, Messenger messenger) { sendPath(DownloadUtils.downloadFile(context, uri), messenger); } static final int OFFLINE_TEST_IMAGE = R.raw.dougs; static final String OFFLINE_FILENAME = STR;
/** * Download a file to the Android file system, then respond with * the file location using the provided Messenger. */
Download a file to the Android file system, then respond with the file location using the provided Messenger
downloadAndRespond
{ "repo_name": "ridethepenguin/coursera", "path": "POSA-14/W6-A5-ThreadedDownloads-StartedServices/src/edu/vuum/mocca/DownloadUtils.java", "license": "gpl-2.0", "size": 8982 }
[ "android.content.Context", "android.net.Uri", "android.os.Messenger" ]
import android.content.Context; import android.net.Uri; import android.os.Messenger;
import android.content.*; import android.net.*; import android.os.*;
[ "android.content", "android.net", "android.os" ]
android.content; android.net; android.os;
2,452,885
private void appendCodeBits(List<String> codeBits) { boolean isFirst = true; for (String codeBit : codeBits) { if (isFirst) { jsCodeBuilder.append("\n"); jsCodeBuilder.indent().append(" {"); isFirst = false; } else { jsCodeBuilder.append(",\n"); jsCodeBuilder.indent().append(" "); } jsCodeBuilder.append(codeBit); } jsCodeBuilder.append("}"); }
void function(List<String> codeBits) { boolean isFirst = true; for (String codeBit : codeBits) { if (isFirst) { jsCodeBuilder.append("\n"); jsCodeBuilder.indent().append(STR); isFirst = false; } else { jsCodeBuilder.append(",\n"); jsCodeBuilder.indent().append(" "); } jsCodeBuilder.append(codeBit); } jsCodeBuilder.append("}"); }
/** * Private helper for visitGoogMsgNode(). * Appends given code bits to Js code builder. * @param codeBits Code bits. */
Private helper for visitGoogMsgNode(). Appends given code bits to Js code builder
appendCodeBits
{ "repo_name": "core9/closure-templates", "path": "src/impl/java/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java", "license": "apache-2.0", "size": 24855 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,520,597
public void addExtClasspath(Path... paths) { if (paths == null) { throw new NullPointerException(); } this.startingState = null; Collections.addAll(this.extPaths, paths); }
void function(Path... paths) { if (paths == null) { throw new NullPointerException(); } this.startingState = null; Collections.addAll(this.extPaths, paths); }
/** * Adds paths to the extensions classpath, and cancels the effect * of any previous call to {@link #setStartingState(State)}. * * @param paths a varargs of {@link Path}s, * the paths to be added to the extensions * classpath. * @throws NullPointerException if {@code paths == null}. */
Adds paths to the extensions classpath, and cancels the effect of any previous call to <code>#setStartingState(State)</code>
addExtClasspath
{ "repo_name": "pietrobraione/jbse", "path": "src/main/java/jbse/jvm/EngineParameters.java", "license": "gpl-3.0", "size": 46515 }
[ "java.nio.file.Path", "java.util.Collections" ]
import java.nio.file.Path; import java.util.Collections;
import java.nio.file.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
1,181,196
protected Set<Path> computePath(DeviceId src, DeviceId dst, List<Constraint> constraints) { if (pathService == null) { return ImmutableSet.of(); } Set<Path> paths = pathService.getPaths(src, dst, weight(constraints)); log.info("paths in computePath ::" + paths); if (!paths.isEmpty()) { return paths; } return ImmutableSet.of(); }
Set<Path> function(DeviceId src, DeviceId dst, List<Constraint> constraints) { if (pathService == null) { return ImmutableSet.of(); } Set<Path> paths = pathService.getPaths(src, dst, weight(constraints)); log.info(STR + paths); if (!paths.isEmpty()) { return paths; } return ImmutableSet.of(); }
/** * Computes a path between two devices. * * @param src ingress device * @param dst egress device * @param constraints path constraints * @return computed path based on constraints */
Computes a path between two devices
computePath
{ "repo_name": "osinstom/onos", "path": "apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java", "license": "apache-2.0", "size": 56695 }
[ "com.google.common.collect.ImmutableSet", "java.util.List", "java.util.Set", "org.onosproject.net.DeviceId", "org.onosproject.net.Path", "org.onosproject.net.intent.Constraint" ]
import com.google.common.collect.ImmutableSet; import java.util.List; import java.util.Set; import org.onosproject.net.DeviceId; import org.onosproject.net.Path; import org.onosproject.net.intent.Constraint;
import com.google.common.collect.*; import java.util.*; import org.onosproject.net.*; import org.onosproject.net.intent.*;
[ "com.google.common", "java.util", "org.onosproject.net" ]
com.google.common; java.util; org.onosproject.net;
1,493,207
public static <T> ExprVectorProcessor<T> makeLongMathProcessor( Expr.VectorInputBindingInspector inspector, Expr left, Expr right, Supplier<LongOutLongsInFunctionVectorProcessor> longOutLongsInProcessor, Supplier<LongOutLongDoubleInFunctionVectorProcessor> longOutLongDoubleInProcessor, Supplier<LongOutDoubleLongInFunctionVectorProcessor> longOutDoubleLongInProcessor, Supplier<LongOutDoublesInFunctionVectorProcessor> longOutDoublesInProcessor ) { final ExprType leftType = left.getOutputType(inspector); final ExprType rightType = right.getOutputType(inspector); ExprVectorProcessor<?> processor = null; if (leftType == ExprType.LONG) { if (rightType == null || rightType == ExprType.LONG) { processor = longOutLongsInProcessor.get(); } else if (rightType == ExprType.DOUBLE) { processor = longOutLongDoubleInProcessor.get(); } } else if (leftType == ExprType.DOUBLE) { if (rightType == ExprType.LONG) { processor = longOutDoubleLongInProcessor.get(); } else if (rightType == null || rightType == ExprType.DOUBLE) { processor = longOutDoublesInProcessor.get(); } } else if (leftType == null) { if (rightType == ExprType.LONG) { processor = longOutLongsInProcessor.get(); } else if (rightType == ExprType.DOUBLE) { processor = longOutDoublesInProcessor.get(); } } if (processor == null) { throw Exprs.cannotVectorize(); } return (ExprVectorProcessor<T>) processor; }
static <T> ExprVectorProcessor<T> function( Expr.VectorInputBindingInspector inspector, Expr left, Expr right, Supplier<LongOutLongsInFunctionVectorProcessor> longOutLongsInProcessor, Supplier<LongOutLongDoubleInFunctionVectorProcessor> longOutLongDoubleInProcessor, Supplier<LongOutDoubleLongInFunctionVectorProcessor> longOutDoubleLongInProcessor, Supplier<LongOutDoublesInFunctionVectorProcessor> longOutDoublesInProcessor ) { final ExprType leftType = left.getOutputType(inspector); final ExprType rightType = right.getOutputType(inspector); ExprVectorProcessor<?> processor = null; if (leftType == ExprType.LONG) { if (rightType == null rightType == ExprType.LONG) { processor = longOutLongsInProcessor.get(); } else if (rightType == ExprType.DOUBLE) { processor = longOutLongDoubleInProcessor.get(); } } else if (leftType == ExprType.DOUBLE) { if (rightType == ExprType.LONG) { processor = longOutDoubleLongInProcessor.get(); } else if (rightType == null rightType == ExprType.DOUBLE) { processor = longOutDoublesInProcessor.get(); } } else if (leftType == null) { if (rightType == ExprType.LONG) { processor = longOutLongsInProcessor.get(); } else if (rightType == ExprType.DOUBLE) { processor = longOutDoublesInProcessor.get(); } } if (processor == null) { throw Exprs.cannotVectorize(); } return (ExprVectorProcessor<T>) processor; }
/** * Make a 2 argument, math processor with the following type rules * long, long -> long * long, double -> long * double, long -> long * double, double -> long */
Make a 2 argument, math processor with the following type rules long, long -> long long, double -> long double, long -> long double, double -> long
makeLongMathProcessor
{ "repo_name": "gianm/druid", "path": "core/src/main/java/org/apache/druid/math/expr/vector/VectorMathProcessors.java", "license": "apache-2.0", "size": 57342 }
[ "java.util.function.Supplier", "org.apache.druid.math.expr.Expr", "org.apache.druid.math.expr.ExprType", "org.apache.druid.math.expr.Exprs" ]
import java.util.function.Supplier; import org.apache.druid.math.expr.Expr; import org.apache.druid.math.expr.ExprType; import org.apache.druid.math.expr.Exprs;
import java.util.function.*; import org.apache.druid.math.expr.*;
[ "java.util", "org.apache.druid" ]
java.util; org.apache.druid;
242,232
protected boolean swiftUploadMetadataFile(SwiftTO swift, File srcFile, String containerName, String uniqueName) throws IOException { File uniqDir = _storage.createUniqDir(); String metaFileName = uniqDir.getAbsolutePath() + File.separator + _tmpltpp; _storage.create(uniqDir.getAbsolutePath(), _tmpltpp); long virtualSize = getVirtualSize(srcFile, getTemplateFormat(srcFile.getName())); File metaFile = swiftWriteMetadataFile(metaFileName, uniqueName, srcFile.getName(), srcFile.length(), virtualSize); SwiftUtil.putObject(swift, metaFile, containerName, _tmpltpp); metaFile.delete(); uniqDir.delete(); return true; }
boolean function(SwiftTO swift, File srcFile, String containerName, String uniqueName) throws IOException { File uniqDir = _storage.createUniqDir(); String metaFileName = uniqDir.getAbsolutePath() + File.separator + _tmpltpp; _storage.create(uniqDir.getAbsolutePath(), _tmpltpp); long virtualSize = getVirtualSize(srcFile, getTemplateFormat(srcFile.getName())); File metaFile = swiftWriteMetadataFile(metaFileName, uniqueName, srcFile.getName(), srcFile.length(), virtualSize); SwiftUtil.putObject(swift, metaFile, containerName, _tmpltpp); metaFile.delete(); uniqDir.delete(); return true; }
/** * Creates a template.properties for Swift with its correct unique name * * @param swift The swift object * @param srcFile Source file on the staging NFS * @param containerName Destination container @return true on successful write * @param uniqueName Unique name identifying the template */
Creates a template.properties for Swift with its correct unique name
swiftUploadMetadataFile
{ "repo_name": "resmo/cloudstack", "path": "services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java", "license": "apache-2.0", "size": 133847 }
[ "com.cloud.agent.api.to.SwiftTO", "com.cloud.utils.SwiftUtil", "java.io.File", "java.io.IOException" ]
import com.cloud.agent.api.to.SwiftTO; import com.cloud.utils.SwiftUtil; import java.io.File; import java.io.IOException;
import com.cloud.agent.api.to.*; import com.cloud.utils.*; import java.io.*;
[ "com.cloud.agent", "com.cloud.utils", "java.io" ]
com.cloud.agent; com.cloud.utils; java.io;
149,186
public void streamingFromServer(io.grpc.benchmarks.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver<io.grpc.benchmarks.proto.Messages.SimpleResponse> responseObserver) { asyncServerStreamingCall( getChannel().newCall(getStreamingFromServerMethod(), getCallOptions()), request, responseObserver); }
void function(io.grpc.benchmarks.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver<io.grpc.benchmarks.proto.Messages.SimpleResponse> responseObserver) { asyncServerStreamingCall( getChannel().newCall(getStreamingFromServerMethod(), getCallOptions()), request, responseObserver); }
/** * <pre> * Single-sided unbounded streaming from server to client * The server repeatedly returns the client payload as-is * </pre> */
<code> Single-sided unbounded streaming from server to client The server repeatedly returns the client payload as-is </code>
streamingFromServer
{ "repo_name": "zhangkun83/grpc-java", "path": "benchmarks/src/generated/main/grpc/io/grpc/benchmarks/proto/BenchmarkServiceGrpc.java", "license": "apache-2.0", "size": 27241 }
[ "io.grpc.stub.ClientCalls", "io.grpc.stub.ServerCalls" ]
import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls;
import io.grpc.stub.*;
[ "io.grpc.stub" ]
io.grpc.stub;
1,224,601
@ExporterProperty( value=PROPERTY_SIZE_PAGE_TO_CONTENT, booleanDefault=false ) public Boolean isSizePageToContent();
@ExporterProperty( value=PROPERTY_SIZE_PAGE_TO_CONTENT, booleanDefault=false ) Boolean function();
/** * Flag which specifies if the size of each page should be increased to accommodate its content. * @see #PROPERTY_SIZE_PAGE_TO_CONTENT */
Flag which specifies if the size of each page should be increased to accommodate its content
isSizePageToContent
{ "repo_name": "MHTaleb/Encologim", "path": "lib/JasperReport/src/net/sf/jasperreports/export/PdfReportConfiguration.java", "license": "gpl-3.0", "size": 8891 }
[ "net.sf.jasperreports.export.annotations.ExporterProperty" ]
import net.sf.jasperreports.export.annotations.ExporterProperty;
import net.sf.jasperreports.export.annotations.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
786,336
public String toString (Instantiation inst, Vector<Symbol> used) { String s = " "; if (operator!=null) s += operator + " "; s += slot + " " + value; if (inst!=null && value.isVariable() && (used==null || !used.contains(value))) { Symbol v = inst.get (value); if (v != null) { s = String.format ("%-35s", s); s += "["+value+" <- "+v+"]"; } if (used != null) used.add (value); } return s; }
String function (Instantiation inst, Vector<Symbol> used) { String s = " "; if (operator!=null) s += operator + " "; s += slot + " " + value; if (inst!=null && value.isVariable() && (used==null !used.contains(value))) { Symbol v = inst.get (value); if (v != null) { s = String.format ("%-35s", s); s += "["+value+STR+v+"]"; } if (used != null) used.add (value); } return s; }
/** * Gets a string representation of the slot condition with an instantiation if provided. * * @return the string */
Gets a string representation of the slot condition with an instantiation if provided
toString
{ "repo_name": "automenta/actrj", "path": "src/main/java/actr/model/SlotCondition.java", "license": "mit", "size": 3110 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
884,404
@Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO) String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
@Operation(desc = STR, impact = MBeanOperationInfo.INFO) String[] listRemoteAddresses(@Parameter(desc = STR, name = STR) String ipAddress) throws Exception;
/** * Lists the addresses of the clients connected to this address which matches the specified IP address. */
Lists the addresses of the clients connected to this address which matches the specified IP address
listRemoteAddresses
{ "repo_name": "lburgazzoli/apache-activemq-artemis", "path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java", "license": "apache-2.0", "size": 41234 }
[ "javax.management.MBeanOperationInfo" ]
import javax.management.MBeanOperationInfo;
import javax.management.*;
[ "javax.management" ]
javax.management;
429,005
public LegendItem getLegendItem(int datasetIndex, int series) { XYPlot xyplot = getPlot(); if (xyplot == null) { return null; } XYDataset dataset = xyplot.getDataset(datasetIndex); if (dataset == null) { return null; } String label = this.legendItemLabelGenerator.generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel(dataset, series); } Shape shape = lookupLegendShape(series); Paint paint = lookupSeriesPaint(series); LegendItem item = new LegendItem(label, paint); item.setToolTipText(toolTipText); item.setURLText(urlText); item.setLabelFont(lookupLegendTextFont(series)); Paint labelPaint = lookupLegendTextPaint(series); if (labelPaint != null) { item.setLabelPaint(labelPaint); } item.setSeriesKey(dataset.getSeriesKey(series)); item.setSeriesIndex(series); item.setDataset(dataset); item.setDatasetIndex(datasetIndex); if (getTreatLegendShapeAsLine()) { item.setLineVisible(true); item.setLine(shape); item.setLinePaint(paint); item.setShapeVisible(false); } else { Paint outlinePaint = lookupSeriesOutlinePaint(series); Stroke outlineStroke = lookupSeriesOutlineStroke(series); item.setOutlinePaint(outlinePaint); item.setOutlineStroke(outlineStroke); } return item; }
LegendItem function(int datasetIndex, int series) { XYPlot xyplot = getPlot(); if (xyplot == null) { return null; } XYDataset dataset = xyplot.getDataset(datasetIndex); if (dataset == null) { return null; } String label = this.legendItemLabelGenerator.generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel(dataset, series); } Shape shape = lookupLegendShape(series); Paint paint = lookupSeriesPaint(series); LegendItem item = new LegendItem(label, paint); item.setToolTipText(toolTipText); item.setURLText(urlText); item.setLabelFont(lookupLegendTextFont(series)); Paint labelPaint = lookupLegendTextPaint(series); if (labelPaint != null) { item.setLabelPaint(labelPaint); } item.setSeriesKey(dataset.getSeriesKey(series)); item.setSeriesIndex(series); item.setDataset(dataset); item.setDatasetIndex(datasetIndex); if (getTreatLegendShapeAsLine()) { item.setLineVisible(true); item.setLine(shape); item.setLinePaint(paint); item.setShapeVisible(false); } else { Paint outlinePaint = lookupSeriesOutlinePaint(series); Stroke outlineStroke = lookupSeriesOutlineStroke(series); item.setOutlinePaint(outlinePaint); item.setOutlineStroke(outlineStroke); } return item; }
/** * Returns a default legend item for the specified series. Subclasses * should override this method to generate customised items. * * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * * @return A legend item for the series. */
Returns a default legend item for the specified series. Subclasses should override this method to generate customised items
getLegendItem
{ "repo_name": "JSansalone/JFreeChart", "path": "source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java", "license": "lgpl-2.1", "size": 73289 }
[ "java.awt.Paint", "java.awt.Shape", "java.awt.Stroke", "org.jfree.chart.LegendItem", "org.jfree.chart.plot.XYPlot", "org.jfree.data.xy.XYDataset" ]
import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import org.jfree.chart.LegendItem; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset;
import java.awt.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*;
[ "java.awt", "org.jfree.chart", "org.jfree.data" ]
java.awt; org.jfree.chart; org.jfree.data;
1,283,980
default AdvancedSchedulerEndpointBuilder pollStrategy( PollingConsumerPollStrategy pollStrategy) { doSetProperty("pollStrategy", pollStrategy); return this; }
default AdvancedSchedulerEndpointBuilder pollStrategy( PollingConsumerPollStrategy pollStrategy) { doSetProperty(STR, pollStrategy); return this; }
/** * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing * you to provide your custom implementation to control error handling * usually occurred during the poll operation before an Exchange have * been created and being routed in Camel. * * The option is a: * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. * * Group: consumer (advanced) */
A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. The option is a: <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. Group: consumer (advanced)
pollStrategy
{ "repo_name": "adessaigne/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SchedulerEndpointBuilderFactory.java", "license": "apache-2.0", "size": 27870 }
[ "org.apache.camel.spi.PollingConsumerPollStrategy" ]
import org.apache.camel.spi.PollingConsumerPollStrategy;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
397,165
public static TableViewer createTableViewer(Composite container, int style) { TableViewer viewer = new TableViewer(container, style); fixOSXTableBug(viewer.getTable()); return viewer; }
static TableViewer function(Composite container, int style) { TableViewer viewer = new TableViewer(container, style); fixOSXTableBug(viewer.getTable()); return viewer; }
/** * Returns a table viewer. Implements hacks for fixing OSX bugs. * @param parent * @param style * @return */
Returns a table viewer. Implements hacks for fixing OSX bugs
createTableViewer
{ "repo_name": "jgaupp/arx", "path": "src/gui/org/deidentifier/arx/gui/view/SWTUtil.java", "license": "apache-2.0", "size": 24763 }
[ "org.eclipse.jface.viewers.TableViewer", "org.eclipse.swt.widgets.Composite" ]
import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Composite;
import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.jface", "org.eclipse.swt" ]
org.eclipse.jface; org.eclipse.swt;
2,008,929
public RegionId region() { String r = get(REGION, null); return r == null ? null : regionId(r); }
RegionId function() { String r = get(REGION, null); return r == null ? null : regionId(r); }
/** * Returns the identifier of the backing region. This will be * null if there is no backing region. * * @return backing region identifier */
Returns the identifier of the backing region. This will be null if there is no backing region
region
{ "repo_name": "gkatsikas/onos", "path": "core/api/src/main/java/org/onosproject/net/config/basics/BasicUiTopoLayoutConfig.java", "license": "apache-2.0", "size": 7333 }
[ "org.onosproject.net.region.RegionId" ]
import org.onosproject.net.region.RegionId;
import org.onosproject.net.region.*;
[ "org.onosproject.net" ]
org.onosproject.net;
746,210
public List<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> getValidationResults(String orderId) throws Exception { MozuClient<List<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult>> client = com.mozu.api.clients.commerce.orders.OrderValidationResultClient.getValidationResultsClient( orderId); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); }
List<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> function(String orderId) throws Exception { MozuClient<List<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult>> client = com.mozu.api.clients.commerce.orders.OrderValidationResultClient.getValidationResultsClient( orderId); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); }
/** * Retrieves a list of the validation results associated with the order. * <p><pre><code> * OrderValidationResult ordervalidationresult = new OrderValidationResult(); * OrderValidationResult orderValidationResult = ordervalidationresult.getValidationResults( orderId); * </code></pre></p> * @param orderId Unique identifier of the order. * @return List<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> * @see com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult */
Retrieves a list of the validation results associated with the order. <code><code> OrderValidationResult ordervalidationresult = new OrderValidationResult(); OrderValidationResult orderValidationResult = ordervalidationresult.getValidationResults( orderId); </code></code>
getValidationResults
{ "repo_name": "lakshmi-nair/mozu-java", "path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/orders/OrderValidationResultResource.java", "license": "mit", "size": 4216 }
[ "com.mozu.api.MozuClient", "java.util.List" ]
import com.mozu.api.MozuClient; import java.util.List;
import com.mozu.api.*; import java.util.*;
[ "com.mozu.api", "java.util" ]
com.mozu.api; java.util;
2,586,137
public void setReportDir(File dir) { // check report dir exists? reportDir = dir; }
void function(File dir) { reportDir = dir; }
/** * Set the report directory. * @param dir the report directory * @see #getReportDir */
Set the report directory
setReportDir
{ "repo_name": "otmarjr/jtreg-fork", "path": "dist-with-aspectj/jtreg/lib/javatest/com/sun/javatest/FileParameters.java", "license": "gpl-2.0", "size": 20962 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
940,131
public static Map<String, Tier> getTiers(int tenantId) throws APIManagementException { return getTiersFromPolicies(PolicyConstants.POLICY_LEVEL_SUB, tenantId); }
static Map<String, Tier> function(int tenantId) throws APIManagementException { return getTiersFromPolicies(PolicyConstants.POLICY_LEVEL_SUB, tenantId); }
/** * Returns a map of API availability tiers of the tenant as defined in the underlying governance * registry. * * @return a Map of tier names and Tier objects - possibly empty * @throws APIManagementException if an error occurs when loading tiers from the registry */
Returns a map of API availability tiers of the tenant as defined in the underlying governance registry
getTiers
{ "repo_name": "ruks/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java", "license": "apache-2.0", "size": 564037 }
[ "java.util.Map", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.Tier", "org.wso2.carbon.apimgt.api.model.policy.PolicyConstants" ]
import java.util.Map; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Tier; import org.wso2.carbon.apimgt.api.model.policy.PolicyConstants;
import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.api.model.policy.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
889,279
public T caseDocumentTemplate(DocumentTemplate object) { return null; }
T function(DocumentTemplate object) { return null; }
/** * Returns the result of interpreting the object as an instance of '<em>Document Template</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * * @param object * the target of the switch. * @return the result of interpreting the object as an instance of '<em>Document Template</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */
Returns the result of interpreting the object as an instance of 'Document Template'. This implementation returns null; returning a non-null result will terminate the switch.
caseDocumentTemplate
{ "repo_name": "ObeoNetwork/M2Doc", "path": "plugins/org.obeonetwork.m2doc/src-gen/org/obeonetwork/m2doc/template/util/TemplateSwitch.java", "license": "epl-1.0", "size": 27479 }
[ "org.obeonetwork.m2doc.template.DocumentTemplate" ]
import org.obeonetwork.m2doc.template.DocumentTemplate;
import org.obeonetwork.m2doc.template.*;
[ "org.obeonetwork.m2doc" ]
org.obeonetwork.m2doc;
1,738,408
private NodeBuilder getVersionLabelsFor(String historyRelPath) throws CommitFailedException { NodeBuilder history = resolve(versionStorageNode, historyRelPath); if (!history.exists()) { throw new CommitFailedException(CommitFailedException.VERSION, VersionExceptionCode.UNEXPECTED_REPOSITORY_EXCEPTION.ordinal(), "Version history does not exist: " + PathUtils.concat( VERSION_STORE_PATH, historyRelPath)); } return history.child(JCR_VERSIONLABELS); }
NodeBuilder function(String historyRelPath) throws CommitFailedException { NodeBuilder history = resolve(versionStorageNode, historyRelPath); if (!history.exists()) { throw new CommitFailedException(CommitFailedException.VERSION, VersionExceptionCode.UNEXPECTED_REPOSITORY_EXCEPTION.ordinal(), STR + PathUtils.concat( VERSION_STORE_PATH, historyRelPath)); } return history.child(JCR_VERSIONLABELS); }
/** * Returns the jcr:versionLabels node of the version history referenced * by the given path. * * @param historyRelPath relative path from the jcr:versionStorage node * to the history node. * @return the jcr:versionLabels node. * @throws CommitFailedException if there is no version history at the * given path. */
Returns the jcr:versionLabels node of the version history referenced by the given path
getVersionLabelsFor
{ "repo_name": "ieb/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java", "license": "apache-2.0", "size": 25050 }
[ "org.apache.jackrabbit.oak.api.CommitFailedException", "org.apache.jackrabbit.oak.commons.PathUtils", "org.apache.jackrabbit.oak.spi.state.NodeBuilder" ]
import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.api.*; import org.apache.jackrabbit.oak.commons.*; import org.apache.jackrabbit.oak.spi.state.*;
[ "org.apache.jackrabbit" ]
org.apache.jackrabbit;
666,372
ChannelHandler removeLast(); /** * Replaces the specified {@link ChannelHandler} with a new handler in this pipeline. * * @param oldHandler the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return itself * @throws NoSuchElementException * if the specified old handler does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler, new name, or new handler is * {@code null}
ChannelHandler removeLast(); /** * Replaces the specified {@link ChannelHandler} with a new handler in this pipeline. * * @param oldHandler the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return itself * @throws NoSuchElementException * if the specified old handler does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler, new name, or new handler is * {@code null}
/** * Removes the last {@link ChannelHandler} in this pipeline. * * @return the removed handler * * @throws NoSuchElementException * if this pipeline is empty */
Removes the last <code>ChannelHandler</code> in this pipeline
removeLast
{ "repo_name": "taojiaenx/netty-source-study", "path": "transport/src/main/java/io/netty/channel/ChannelPipeline.java", "license": "apache-2.0", "size": 39100 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
2,131,068
public static boolean arrayContains(Object[] array, Object el) { return Arrays.asList(array).contains(el); }
static boolean function(Object[] array, Object el) { return Arrays.asList(array).contains(el); }
/** * Checks to see if an array of objects contains a given element * * @param array The array to check * @param el The element to look for in this array * * @return True if this array contains the element, else false. * */
Checks to see if an array of objects contains a given element
arrayContains
{ "repo_name": "Hunsu/CategoryChanger", "path": "src/org/wikiutils/CollectionUtils.java", "license": "apache-2.0", "size": 3935 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
194,153
protected String getNamespace(HasMetadata entity) { String answer = KubernetesHelper.getNamespace(entity); if (Strings.isNullOrBlank(answer)) { answer = getNamespace(); } // lest make sure the namespace exists applyNamespace(answer); return answer; }
String function(HasMetadata entity) { String answer = KubernetesHelper.getNamespace(entity); if (Strings.isNullOrBlank(answer)) { answer = getNamespace(); } applyNamespace(answer); return answer; }
/** * Returns the namespace defined in the entity or the configured namespace */
Returns the namespace defined in the entity or the configured namespace
getNamespace
{ "repo_name": "zmhassan/fabric8", "path": "components/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/Controller.java", "license": "apache-2.0", "size": 50253 }
[ "io.fabric8.kubernetes.api.model.HasMetadata", "io.fabric8.utils.Strings" ]
import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.utils.Strings;
import io.fabric8.kubernetes.api.model.*; import io.fabric8.utils.*;
[ "io.fabric8.kubernetes", "io.fabric8.utils" ]
io.fabric8.kubernetes; io.fabric8.utils;
1,023,639
public Builder setDefaultCopts(List<String> defaultCopts) { this.defaultCopts = defaultCopts; return this; }
Builder function(List<String> defaultCopts) { this.defaultCopts = defaultCopts; return this; }
/** * Sets the default value of copts. Rule-level copts will append to this. */
Sets the default value of copts. Rule-level copts will append to this
setDefaultCopts
{ "repo_name": "kamalmarhubi/bazel", "path": "src/main/java/com/google/devtools/build/lib/packages/Package.java", "license": "apache-2.0", "size": 50763 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,287,583
public static java.util.Set extractAttendanceRequiringContractingSet(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.AttendanceRequiringContractingVoCollection voCollection) { return extractAttendanceRequiringContractingSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.AttendanceRequiringContractingVoCollection voCollection) { return extractAttendanceRequiringContractingSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.emergency.domain.objects.AttendanceRequiringContracting set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.emergency.domain.objects.AttendanceRequiringContracting set from the value object collection
extractAttendanceRequiringContractingSet
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/AttendanceRequiringContractingVoAssembler.java", "license": "agpl-3.0", "size": 22362 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
414,958
public List<Element> getReportElements() { if(reportElements == null) reportElements = new ArrayList<Element>(); return reportElements; }
List<Element> function() { if(reportElements == null) reportElements = new ArrayList<Element>(); return reportElements; }
/** * get report elements * @return */
get report elements
getReportElements
{ "repo_name": "harryhoch/DeepPhe", "path": "src/edu/pitt/dbmi/deep/phe/model/Report.java", "license": "apache-2.0", "size": 5234 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,997,436
public OffsetDateTime getUpdatedOn() { return updatedOn; }
OffsetDateTime function() { return updatedOn; }
/** * Get the UTC time at which secret was last updated. * * @return the last updated UTC time. */
Get the UTC time at which secret was last updated
getUpdatedOn
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/models/SecretProperties.java", "license": "mit", "size": 9877 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
2,632,106
private Plugin startPlugin(final Class<? extends Plugin> pluginClass, final Cooja argGUI, final Simulation argSimulation, final Mote argMote, boolean activate) throws PluginConstructionException { // Check that plugin class is registered if (!pluginClasses.contains(pluginClass)) { throw new PluginConstructionException("Tool class not registered: " + pluginClass); } // Construct plugin depending on plugin type int pluginType = pluginClass.getAnnotation(PluginType.class).value(); Plugin plugin; try { if (pluginType == PluginType.MOTE_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException("No GUI argument for mote plugin"); } if (argSimulation == null) { throw new PluginConstructionException("No simulation argument for mote plugin"); } if (argMote == null) { throw new PluginConstructionException("No mote argument for mote plugin"); } plugin = pluginClass.getConstructor(new Class[] { Mote.class, Simulation.class, Cooja.class }) .newInstance(argMote, argSimulation, argGUI); } else if (pluginType == PluginType.SIM_PLUGIN || pluginType == PluginType.SIM_STANDARD_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException("No GUI argument for simulation plugin"); } if (argSimulation == null) { throw new PluginConstructionException("No simulation argument for simulation plugin"); } plugin = pluginClass.getConstructor(new Class[] { Simulation.class, Cooja.class }) .newInstance(argSimulation, argGUI); } else if (pluginType == PluginType.COOJA_PLUGIN || pluginType == PluginType.COOJA_STANDARD_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException("No GUI argument for GUI plugin"); } plugin = pluginClass.getConstructor(new Class[] { Cooja.class }) .newInstance(argGUI); } else { throw new PluginConstructionException("Bad plugin type: " + pluginType); } } catch (PluginRequiresVisualizationException e) { PluginConstructionException ex = new PluginConstructionException("Tool class requires visualization: " + pluginClass.getName()); ex.initCause(e); throw ex; } catch (Exception e) { PluginConstructionException ex = new PluginConstructionException("Construction error for tool of class: " + pluginClass.getName()); ex.initCause(e); throw ex; } if (activate) { plugin.startPlugin(); } // Add to active plugins list startedPlugins.add(plugin); updateGUIComponentState(); // Show plugin if visualizer type if (activate && plugin.getCooja() != null) { cooja.showPlugin(plugin); } return plugin; }
Plugin function(final Class<? extends Plugin> pluginClass, final Cooja argGUI, final Simulation argSimulation, final Mote argMote, boolean activate) throws PluginConstructionException { if (!pluginClasses.contains(pluginClass)) { throw new PluginConstructionException(STR + pluginClass); } int pluginType = pluginClass.getAnnotation(PluginType.class).value(); Plugin plugin; try { if (pluginType == PluginType.MOTE_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException(STR); } if (argSimulation == null) { throw new PluginConstructionException(STR); } if (argMote == null) { throw new PluginConstructionException(STR); } plugin = pluginClass.getConstructor(new Class[] { Mote.class, Simulation.class, Cooja.class }) .newInstance(argMote, argSimulation, argGUI); } else if (pluginType == PluginType.SIM_PLUGIN pluginType == PluginType.SIM_STANDARD_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException(STR); } if (argSimulation == null) { throw new PluginConstructionException(STR); } plugin = pluginClass.getConstructor(new Class[] { Simulation.class, Cooja.class }) .newInstance(argSimulation, argGUI); } else if (pluginType == PluginType.COOJA_PLUGIN pluginType == PluginType.COOJA_STANDARD_PLUGIN) { if (argGUI == null) { throw new PluginConstructionException(STR); } plugin = pluginClass.getConstructor(new Class[] { Cooja.class }) .newInstance(argGUI); } else { throw new PluginConstructionException(STR + pluginType); } } catch (PluginRequiresVisualizationException e) { PluginConstructionException ex = new PluginConstructionException(STR + pluginClass.getName()); ex.initCause(e); throw ex; } catch (Exception e) { PluginConstructionException ex = new PluginConstructionException(STR + pluginClass.getName()); ex.initCause(e); throw ex; } if (activate) { plugin.startPlugin(); } startedPlugins.add(plugin); updateGUIComponentState(); if (activate && plugin.getCooja() != null) { cooja.showPlugin(plugin); } return plugin; }
/** * Starts given plugin. If visualized, the plugin is also shown. * * @see PluginType * @param pluginClass Plugin class * @param argGUI Plugin GUI argument * @param argSimulation Plugin simulation argument * @param argMote Plugin mote argument * @return Started plugin * @throws PluginConstructionException At errors */
Starts given plugin. If visualized, the plugin is also shown
startPlugin
{ "repo_name": "andreaazzara/pyot", "path": "contiki-tres/tools/cooja/java/org/contikios/cooja/Cooja.java", "license": "gpl-3.0", "size": 159349 }
[ "org.contikios.cooja.VisPlugin" ]
import org.contikios.cooja.VisPlugin;
import org.contikios.cooja.*;
[ "org.contikios.cooja" ]
org.contikios.cooja;
528,764
private Queue<ReadFuture> getWaitingReadFutures() { Queue<ReadFuture> waitingReadyReadFutures = (Queue<ReadFuture>) getAttribute(WAITING_READ_FUTURES_KEY); if (waitingReadyReadFutures == null) { waitingReadyReadFutures = new ConcurrentLinkedQueue<ReadFuture>(); Queue<ReadFuture> oldWaitingReadyReadFutures = (Queue<ReadFuture>) setAttributeIfAbsent( WAITING_READ_FUTURES_KEY, waitingReadyReadFutures); if (oldWaitingReadyReadFutures != null) { waitingReadyReadFutures = oldWaitingReadyReadFutures; } } return waitingReadyReadFutures; } /** * {@inheritDoc}
Queue<ReadFuture> function() { Queue<ReadFuture> waitingReadyReadFutures = (Queue<ReadFuture>) getAttribute(WAITING_READ_FUTURES_KEY); if (waitingReadyReadFutures == null) { waitingReadyReadFutures = new ConcurrentLinkedQueue<ReadFuture>(); Queue<ReadFuture> oldWaitingReadyReadFutures = (Queue<ReadFuture>) setAttributeIfAbsent( WAITING_READ_FUTURES_KEY, waitingReadyReadFutures); if (oldWaitingReadyReadFutures != null) { waitingReadyReadFutures = oldWaitingReadyReadFutures; } } return waitingReadyReadFutures; } /** * {@inheritDoc}
/** * TODO Add method documentation */
TODO Add method documentation
getWaitingReadFutures
{ "repo_name": "jeffmaury/mina", "path": "mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java", "license": "apache-2.0", "size": 39656 }
[ "java.util.Queue", "java.util.concurrent.ConcurrentLinkedQueue", "org.apache.mina.core.future.ReadFuture" ]
import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import org.apache.mina.core.future.ReadFuture;
import java.util.*; import java.util.concurrent.*; import org.apache.mina.core.future.*;
[ "java.util", "org.apache.mina" ]
java.util; org.apache.mina;
58,083
@Override public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(ScxmlPackage.Literals.SCXML_PARAM_TYPE__SCXML_EXTRA_CONTENT); childrenFeatures.add(ScxmlPackage.Literals.SCXML_PARAM_TYPE__ANY_ATTRIBUTE); } return childrenFeatures; }
Collection<? extends EStructuralFeature> function(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(ScxmlPackage.Literals.SCXML_PARAM_TYPE__SCXML_EXTRA_CONTENT); childrenFeatures.add(ScxmlPackage.Literals.SCXML_PARAM_TYPE__ANY_ATTRIBUTE); } return childrenFeatures; }
/** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This specifies how to implement <code>#getChildren</code> and is used to deduce an appropriate feature for an <code>org.eclipse.emf.edit.command.AddCommand</code>, <code>org.eclipse.emf.edit.command.RemoveCommand</code> or <code>org.eclipse.emf.edit.command.MoveCommand</code> in <code>#createCommand</code>.
getChildrenFeatures
{ "repo_name": "glefur/scxml-designer", "path": "plugins/org.w3c.scxml.edit/src-gen/org/w3/_2005/_07/scxml/provider/ScxmlParamTypeItemProvider.java", "license": "epl-1.0", "size": 7572 }
[ "java.util.Collection", "org.eclipse.emf.ecore.EStructuralFeature", "org.w3._2005._07.scxml.ScxmlPackage" ]
import java.util.Collection; import org.eclipse.emf.ecore.EStructuralFeature; import org.w3._2005._07.scxml.ScxmlPackage;
import java.util.*; import org.eclipse.emf.ecore.*; import org.w3.*;
[ "java.util", "org.eclipse.emf", "org.w3" ]
java.util; org.eclipse.emf; org.w3;
1,201,987
public static void write(InputStream is, OutputStream os) { try { int read = 0; byte[] buffer = new byte[8096]; while ((read = is.read(buffer)) > 0) { os.write(buffer, 0, read); } } catch(IOException e) { throw new UnexpectedException(e); } finally { try { is.close(); } catch(Exception e) { // } try { os.close(); } catch(Exception e) { // } } }
static void function(InputStream is, OutputStream os) { try { int read = 0; byte[] buffer = new byte[8096]; while ((read = is.read(buffer)) > 0) { os.write(buffer, 0, read); } } catch(IOException e) { throw new UnexpectedException(e); } finally { try { is.close(); } catch(Exception e) { try { os.close(); } catch(Exception e) { } }
/** * Copy an stream to another one. */
Copy an stream to another one
write
{ "repo_name": "lafayette/JBTT", "path": "framework/framework/src/play/libs/IO.java", "license": "mit", "size": 9861 }
[ "java.io.IOException", "java.io.InputStream", "java.io.OutputStream" ]
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
999,827
public static Intent createGetContentIntent() { // Implicitly allow the user to select a particular kind of data final Intent intent = new Intent(Intent.ACTION_GET_CONTENT); // The MIME data type filter intent.setType("*/*"); // Only return URIs that can be opened with ContentResolver intent.addCategory(Intent.CATEGORY_OPENABLE); return intent; }
static Intent function() { final Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("*/*"); intent.addCategory(Intent.CATEGORY_OPENABLE); return intent; }
/** * Get the Intent for selecting content to be used in an Intent Chooser. * * @return The intent for opening a file with Intent.createChooser() * @author paulburke */
Get the Intent for selecting content to be used in an Intent Chooser
createGetContentIntent
{ "repo_name": "mobilejazz/coltrane", "path": "library/src/main/java/com/mobilejazz/coltrane/library/utils/FileUtils.java", "license": "apache-2.0", "size": 14266 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
638,942
public static DeleteTableRequest buildDeleteTableRequest(final TableName tableName) { DeleteTableRequest.Builder builder = DeleteTableRequest.newBuilder(); builder.setTableName(ProtobufUtil.toProtoTableName(tableName)); return builder.build(); }
static DeleteTableRequest function(final TableName tableName) { DeleteTableRequest.Builder builder = DeleteTableRequest.newBuilder(); builder.setTableName(ProtobufUtil.toProtoTableName(tableName)); return builder.build(); }
/** * Creates a protocol buffer DeleteTableRequest * * @param tableName * @return a DeleteTableRequest */
Creates a protocol buffer DeleteTableRequest
buildDeleteTableRequest
{ "repo_name": "lilonglai/hbase-0.96.2", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java", "license": "apache-2.0", "size": 57605 }
[ "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.protobuf.generated.MasterProtos" ]
import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.protobuf.generated.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,842,545
public void buildDidFinish(@NonNull MirroredIndex index, @Nullable Throwable error);
void function(@NonNull MirroredIndex index, @Nullable Throwable error);
/** * Build of the local index has just finished. * * @param index The index having been built. * @param error `null` if success, otherwise indicates the error. */
Build of the local index has just finished
buildDidFinish
{ "repo_name": "algolia/algoliasearch-client-android", "path": "algoliasearch/src/offline/java/com/algolia/search/saas/BuildListener.java", "license": "mit", "size": 1973 }
[ "android.support.annotation.NonNull", "android.support.annotation.Nullable" ]
import android.support.annotation.NonNull; import android.support.annotation.Nullable;
import android.support.annotation.*;
[ "android.support" ]
android.support;
1,893,089
char[] declarationSignature= fProposal.getDeclarationSignature(); String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(declarationSignature)); IType type= fJavaProject.findType(typeName); if (type != null) { String name= String.valueOf(fProposal.getName()); String[] parameters= Signature.getParameterTypes(String.valueOf(SignatureUtil.fix83600(fProposal.getSignature()))); for (int i= 0; i < parameters.length; i++) { parameters[i]= SignatureUtil.getLowerBound(parameters[i]); } boolean isConstructor= fProposal.isConstructor(); return findMethod(name, parameters, isConstructor, type); } return null; }
char[] declarationSignature= fProposal.getDeclarationSignature(); String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(declarationSignature)); IType type= fJavaProject.findType(typeName); if (type != null) { String name= String.valueOf(fProposal.getName()); String[] parameters= Signature.getParameterTypes(String.valueOf(SignatureUtil.fix83600(fProposal.getSignature()))); for (int i= 0; i < parameters.length; i++) { parameters[i]= SignatureUtil.getLowerBound(parameters[i]); } boolean isConstructor= fProposal.isConstructor(); return findMethod(name, parameters, isConstructor, type); } return null; }
/** * Resolves the member described by the receiver and returns it if found. * Returns <code>null</code> if no corresponding member can be found. * * @return the resolved member or <code>null</code> if none is found * @throws JavaModelException if accessing the java model fails */
Resolves the member described by the receiver and returns it if found. Returns <code>null</code> if no corresponding member can be found
resolveMember
{ "repo_name": "kumattau/JDTPatch", "path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/ui/text/java/MethodProposalInfo.java", "license": "epl-1.0", "size": 9955 }
[ "org.eclipse.jdt.core.IType", "org.eclipse.jdt.core.Signature", "org.eclipse.jdt.internal.corext.template.java.SignatureUtil" ]
import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.internal.corext.template.java.SignatureUtil;
import org.eclipse.jdt.core.*; import org.eclipse.jdt.internal.corext.template.java.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
217,051
@ServiceMethod(returns = ReturnType.SINGLE) RoleDefinitionInner createOrUpdate(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition);
@ServiceMethod(returns = ReturnType.SINGLE) RoleDefinitionInner createOrUpdate(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition);
/** * Creates or updates a role definition. * * @param scope The scope of the role definition. * @param roleDefinitionId The ID of the role definition. * @param roleDefinition The values for the role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return role definition. */
Creates or updates a role definition
createOrUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java", "license": "mit", "size": 15940 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.authorization.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
272,438
@Override public void releaseSnapshot( StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> snapshotToRelease) { CopyOnWriteStateMapSnapshot<K, N, S> copyOnWriteStateMapSnapshot = (CopyOnWriteStateMapSnapshot<K, N, S>) snapshotToRelease; Preconditions.checkArgument( copyOnWriteStateMapSnapshot.isOwner(this), "Cannot release snapshot which is owned by a different state map."); releaseSnapshot(copyOnWriteStateMapSnapshot.getSnapshotVersion()); }
void function( StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> snapshotToRelease) { CopyOnWriteStateMapSnapshot<K, N, S> copyOnWriteStateMapSnapshot = (CopyOnWriteStateMapSnapshot<K, N, S>) snapshotToRelease; Preconditions.checkArgument( copyOnWriteStateMapSnapshot.isOwner(this), STR); releaseSnapshot(copyOnWriteStateMapSnapshot.getSnapshotVersion()); }
/** * Releases a snapshot for this {@link CopyOnWriteStateMap}. This method should be called once a * snapshot is no more needed, so that the {@link CopyOnWriteStateMap} can stop considering this * snapshot for copy-on-write, thus avoiding unnecessary object creation. * * @param snapshotToRelease the snapshot to release, which was previously created by this state * map. */
Releases a snapshot for this <code>CopyOnWriteStateMap</code>. This method should be called once a snapshot is no more needed, so that the <code>CopyOnWriteStateMap</code> can stop considering this snapshot for copy-on-write, thus avoiding unnecessary object creation
releaseSnapshot
{ "repo_name": "apache/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/CopyOnWriteStateMap.java", "license": "apache-2.0", "size": 41331 }
[ "org.apache.flink.util.Preconditions" ]
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
1,863,860
void removeOwner(PerunSession perunSession, Facility facility, Owner owner) throws InternalErrorException, OwnerAlreadyRemovedException;
void removeOwner(PerunSession perunSession, Facility facility, Owner owner) throws InternalErrorException, OwnerAlreadyRemovedException;
/** * Remove owner of the facility * * @param perunSession * @param facility * @param owner * * @throws InternalErrorException * @throws OwnerAlreadyRemovedException */
Remove owner of the facility
removeOwner
{ "repo_name": "Simcsa/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/FacilitiesManagerBl.java", "license": "bsd-2-clause", "size": 39157 }
[ "cz.metacentrum.perun.core.api.Facility", "cz.metacentrum.perun.core.api.Owner", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException", "cz.metacentrum.perun.core.api.exceptions.OwnerAlreadyRemovedException" ]
import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.Owner; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentrum.perun.core.api.exceptions.OwnerAlreadyRemovedException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
2,848,407
@Test public void testBinaryToHexDigitMsb0_bits() { assertEquals( '0', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, false, false})); assertEquals( '1', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, false, true})); assertEquals( '2', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, true, false})); assertEquals( '3', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, true, true})); assertEquals( '4', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, false, false})); assertEquals( '5', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, false, true})); assertEquals( '6', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, true, false})); assertEquals( '7', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, true, true})); assertEquals( '8', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, false, false})); assertEquals( '9', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, false, true})); assertEquals( 'a', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, true, false})); assertEquals( 'b', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, true, true})); assertEquals( 'c', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, false, false})); assertEquals( 'd', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, false, true})); assertEquals( 'e', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, true, false})); assertEquals( 'f', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, true, true})); assertThrows(IllegalArgumentException.class, () -> Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{})); }
void function() { assertEquals( '0', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, false, false})); assertEquals( '1', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, false, true})); assertEquals( '2', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, true, false})); assertEquals( '3', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, false, true, true})); assertEquals( '4', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, false, false})); assertEquals( '5', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, false, true})); assertEquals( '6', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, true, false})); assertEquals( '7', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{false, true, true, true})); assertEquals( '8', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, false, false})); assertEquals( '9', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, false, true})); assertEquals( 'a', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, true, false})); assertEquals( 'b', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, false, true, true})); assertEquals( 'c', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, false, false})); assertEquals( 'd', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, false, true})); assertEquals( 'e', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, true, false})); assertEquals( 'f', Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{true, true, true, true})); assertThrows(IllegalArgumentException.class, () -> Conversion.binaryToHexDigitMsb0_4bits(new boolean[]{})); }
/** * Tests {@link Conversion#binaryToHexDigitMsb0_4bits(boolean[])}. */
Tests <code>Conversion#binaryToHexDigitMsb0_4bits(boolean[])</code>
testBinaryToHexDigitMsb0_bits
{ "repo_name": "britter/commons-lang", "path": "src/test/java/org/apache/commons/lang3/ConversionTest.java", "license": "apache-2.0", "size": 98910 }
[ "org.junit.jupiter.api.Assertions" ]
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.*;
[ "org.junit.jupiter" ]
org.junit.jupiter;
2,861,618
protected void setInstancesFromURL(URL u) { try { Reader r = new BufferedReader(new InputStreamReader(u.openStream())); setInstances(new Instances(r)); r.close(); } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Couldn't read from URL:\n" + u, "Load Instances", JOptionPane.ERROR_MESSAGE); } }
void function(URL u) { try { Reader r = new BufferedReader(new InputStreamReader(u.openStream())); setInstances(new Instances(r)); r.close(); } catch (Exception ex) { JOptionPane.showMessageDialog(this, STR + u, STR, JOptionPane.ERROR_MESSAGE); } }
/** * Loads instances from a URL. * * @param u the URL to load from. */
Loads instances from a URL
setInstancesFromURL
{ "repo_name": "paolopavan/cfr", "path": "src/weka/gui/SetInstancesPanel.java", "license": "gpl-3.0", "size": 8160 }
[ "java.io.BufferedReader", "java.io.InputStreamReader", "java.io.Reader", "javax.swing.JOptionPane" ]
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.Reader; import javax.swing.JOptionPane;
import java.io.*; import javax.swing.*;
[ "java.io", "javax.swing" ]
java.io; javax.swing;
915,167
public SqlNode parse(String sql) { try { SqlParser parser = SqlParser.create(sql, config); return parser.parseStmt(); } catch (SqlParseException e) { throw new SqlParserException("SQL parse failed. " + e.getMessage(), e); } }
SqlNode function(String sql) { try { SqlParser parser = SqlParser.create(sql, config); return parser.parseStmt(); } catch (SqlParseException e) { throw new SqlParserException(STR + e.getMessage(), e); } }
/** * Parses a SQL statement into a {@link SqlNode}. The {@link SqlNode} is not yet validated. * * @param sql a sql string to parse * @return a parsed sql node * @throws SqlParserException if an exception is thrown when parsing the statement */
Parses a SQL statement into a <code>SqlNode</code>. The <code>SqlNode</code> is not yet validated
parse
{ "repo_name": "greghogan/flink", "path": "flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/calcite/CalciteParser.java", "license": "apache-2.0", "size": 4657 }
[ "org.apache.calcite.sql.SqlNode", "org.apache.calcite.sql.parser.SqlParseException", "org.apache.calcite.sql.parser.SqlParser", "org.apache.flink.table.api.SqlParserException" ]
import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParseException; import org.apache.calcite.sql.parser.SqlParser; import org.apache.flink.table.api.SqlParserException;
import org.apache.calcite.sql.*; import org.apache.calcite.sql.parser.*; import org.apache.flink.table.api.*;
[ "org.apache.calcite", "org.apache.flink" ]
org.apache.calcite; org.apache.flink;
2,736,602
@CalledByNative private void requestRemotePlaybackControl() { if (mDebug) Log.i(TAG, "requestRemotePlaybackControl"); RemoteMediaPlayerController.instance().requestRemotePlaybackControl(mMediaStateListener); }
void function() { if (mDebug) Log.i(TAG, STR); RemoteMediaPlayerController.instance().requestRemotePlaybackControl(mMediaStateListener); }
/** * Called when a lower layer requests control of a video that is being cast. */
Called when a lower layer requests control of a video that is being cast
requestRemotePlaybackControl
{ "repo_name": "Bysmyyr/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java", "license": "bsd-3-clause", "size": 13522 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,893,374
List<Facility> getFacilitiesByPerunBean(PerunSession sess, User user);
List<Facility> getFacilitiesByPerunBean(PerunSession sess, User user);
/** * Returns list of facilities connected with a user * * @param sess * @param user * @return list of facilities connected with user * @throws InternalErrorException */
Returns list of facilities connected with a user
getFacilitiesByPerunBean
{ "repo_name": "mvocu/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/FacilitiesManagerBl.java", "license": "bsd-2-clause", "size": 34798 }
[ "cz.metacentrum.perun.core.api.Facility", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.User", "java.util.List" ]
import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import java.util.List;
import cz.metacentrum.perun.core.api.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
350,183
@Test public void testCompactionConfigurationOnlineChange() throws IOException { String strPrefix = "hbase.hstore.compaction."; Store s = r1.getStore(COLUMN_FAMILY1); if (!(s instanceof HStore)) { LOG.error("Can't test the compaction configuration of HStore class. " + "Got a different implementation other than HStore"); return; } HStore hstore = (HStore)s; // Set the new compaction ratio to a different value. double newCompactionRatio = hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio() + 0.1; conf.setFloat(strPrefix + "ratio", (float)newCompactionRatio); // Notify all the observers, which includes the Store object. rs1.getConfigurationManager().notifyAllObservers(conf); // Check if the compaction ratio got updated in the Compaction Configuration assertEquals(newCompactionRatio, hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio(), 0.00001); // Check if the off peak compaction ratio gets updated. double newOffPeakCompactionRatio = hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak() + 0.1; conf.setFloat(strPrefix + "ratio.offpeak", (float)newOffPeakCompactionRatio); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newOffPeakCompactionRatio, hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak(), 0.00001); // Check if the throttle point gets updated. long newThrottlePoint = hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint() + 10; conf.setLong("hbase.regionserver.thread.compaction.throttle", newThrottlePoint); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newThrottlePoint, hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint()); // Check if the minFilesToCompact gets updated. int newMinFilesToCompact = hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact() + 1; conf.setLong(strPrefix + "min", newMinFilesToCompact); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMinFilesToCompact, hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact()); // Check if the maxFilesToCompact gets updated. int newMaxFilesToCompact = hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact() + 1; conf.setLong(strPrefix + "max", newMaxFilesToCompact); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMaxFilesToCompact, hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact()); // Check OffPeak hours is updated in an online fashion. conf.setLong(CompactionConfiguration.HBASE_HSTORE_OFFPEAK_START_HOUR, 6); conf.setLong(CompactionConfiguration.HBASE_HSTORE_OFFPEAK_END_HOUR, 7); rs1.getConfigurationManager().notifyAllObservers(conf); assertFalse(hstore.getOffPeakHours().isOffPeakHour(4)); // Check if the minCompactSize gets updated. long newMinCompactSize = hstore.getStoreEngine().getCompactionPolicy().getConf().getMinCompactSize() + 1; conf.setLong(strPrefix + "min.size", newMinCompactSize); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMinCompactSize, hstore.getStoreEngine().getCompactionPolicy().getConf().getMinCompactSize()); // Check if the maxCompactSize gets updated. long newMaxCompactSize = hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxCompactSize() - 1; conf.setLong(strPrefix + "max.size", newMaxCompactSize); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMaxCompactSize, hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxCompactSize()); // Check if majorCompactionPeriod gets updated. long newMajorCompactionPeriod = hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionPeriod() + 10; conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, newMajorCompactionPeriod); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMajorCompactionPeriod, hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionPeriod()); // Check if majorCompactionJitter gets updated. float newMajorCompactionJitter = hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionJitter() + 0.02F; conf.setFloat("hbase.hregion.majorcompaction.jitter", newMajorCompactionJitter); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMajorCompactionJitter, hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionJitter(), 0.00001); }
void function() throws IOException { String strPrefix = STR; Store s = r1.getStore(COLUMN_FAMILY1); if (!(s instanceof HStore)) { LOG.error(STR + STR); return; } HStore hstore = (HStore)s; double newCompactionRatio = hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio() + 0.1; conf.setFloat(strPrefix + "ratio", (float)newCompactionRatio); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newCompactionRatio, hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatio(), 0.00001); double newOffPeakCompactionRatio = hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak() + 0.1; conf.setFloat(strPrefix + STR, (float)newOffPeakCompactionRatio); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newOffPeakCompactionRatio, hstore.getStoreEngine().getCompactionPolicy().getConf().getCompactionRatioOffPeak(), 0.00001); long newThrottlePoint = hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint() + 10; conf.setLong(STR, newThrottlePoint); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newThrottlePoint, hstore.getStoreEngine().getCompactionPolicy().getConf().getThrottlePoint()); int newMinFilesToCompact = hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact() + 1; conf.setLong(strPrefix + "min", newMinFilesToCompact); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMinFilesToCompact, hstore.getStoreEngine().getCompactionPolicy().getConf().getMinFilesToCompact()); int newMaxFilesToCompact = hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact() + 1; conf.setLong(strPrefix + "max", newMaxFilesToCompact); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMaxFilesToCompact, hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact()); conf.setLong(CompactionConfiguration.HBASE_HSTORE_OFFPEAK_START_HOUR, 6); conf.setLong(CompactionConfiguration.HBASE_HSTORE_OFFPEAK_END_HOUR, 7); rs1.getConfigurationManager().notifyAllObservers(conf); assertFalse(hstore.getOffPeakHours().isOffPeakHour(4)); long newMinCompactSize = hstore.getStoreEngine().getCompactionPolicy().getConf().getMinCompactSize() + 1; conf.setLong(strPrefix + STR, newMinCompactSize); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMinCompactSize, hstore.getStoreEngine().getCompactionPolicy().getConf().getMinCompactSize()); long newMaxCompactSize = hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxCompactSize() - 1; conf.setLong(strPrefix + STR, newMaxCompactSize); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMaxCompactSize, hstore.getStoreEngine().getCompactionPolicy().getConf().getMaxCompactSize()); long newMajorCompactionPeriod = hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionPeriod() + 10; conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, newMajorCompactionPeriod); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMajorCompactionPeriod, hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionPeriod()); float newMajorCompactionJitter = hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionJitter() + 0.02F; conf.setFloat(STR, newMajorCompactionJitter); rs1.getConfigurationManager().notifyAllObservers(conf); assertEquals(newMajorCompactionJitter, hstore.getStoreEngine().getCompactionPolicy().getConf().getMajorCompactionJitter(), 0.00001); }
/** * Test that the configurations in the CompactionConfiguration class change * properly. * * @throws IOException */
Test that the configurations in the CompactionConfiguration class change properly
testCompactionConfigurationOnlineChange
{ "repo_name": "grokcoder/pbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java", "license": "apache-2.0", "size": 9296 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.regionserver.compactions.CompactionConfiguration", "org.junit.Assert" ]
import java.io.IOException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.regionserver.compactions.CompactionConfiguration; import org.junit.Assert;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.compactions.*; import org.junit.*;
[ "java.io", "org.apache.hadoop", "org.junit" ]
java.io; org.apache.hadoop; org.junit;
289,825
@Nullable public static boolean[] readBooleanArray(DataInput in) throws IOException { int len = in.readInt(); if (len == -1) return null; // Value "-1" indicates null. boolean[] res = new boolean[len]; for (int i = 0; i < len; i++) res[i] = in.readBoolean(); return res; }
@Nullable static boolean[] function(DataInput in) throws IOException { int len = in.readInt(); if (len == -1) return null; boolean[] res = new boolean[len]; for (int i = 0; i < len; i++) res[i] = in.readBoolean(); return res; }
/** * Reads boolean array from input stream accounting for <tt>null</tt> values. * * @param in Stream to read from. * @return Read byte array, possibly <tt>null</tt>. * @throws IOException If read failed. */
Reads boolean array from input stream accounting for null values
readBooleanArray
{ "repo_name": "WilliamDo/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 325083 }
[ "java.io.DataInput", "java.io.IOException", "org.jetbrains.annotations.Nullable" ]
import java.io.DataInput; import java.io.IOException; import org.jetbrains.annotations.Nullable;
import java.io.*; import org.jetbrains.annotations.*;
[ "java.io", "org.jetbrains.annotations" ]
java.io; org.jetbrains.annotations;
1,202,677
@Path("{clusterName}/config_groups") public ConfigGroupService getConfigGroupService(@Context javax.ws.rs.core.Request request, @PathParam("clusterName") String clusterName) { hasPermission(Request.Type.valueOf(request.getMethod()), clusterName); return new ConfigGroupService(clusterName); }
@Path(STR) ConfigGroupService function(@Context javax.ws.rs.core.Request request, @PathParam(STR) String clusterName) { hasPermission(Request.Type.valueOf(request.getMethod()), clusterName); return new ConfigGroupService(clusterName); }
/** * Gets the config group service * * @param request the request * @param clusterName the cluster name * * @return the config group service */
Gets the config group service
getConfigGroupService
{ "repo_name": "zouzhberk/ambaridemo", "path": "demo-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java", "license": "apache-2.0", "size": 23921 }
[ "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.Context" ]
import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Context;
import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "javax.ws" ]
javax.ws;
2,841,097
protected static <C,V> Table<Directional<String>, C, V> sortTableByRowKeys(Table<Directional<String>, C, V> table, List<String> rowKeys) { final ImmutableTable.Builder<Directional<String>, C, V> builder = ImmutableTable.builder(); // Iterate over the keys in the given order, and append any matching rows to the builder for (String rowKeyValue : rowKeys) { for (Directional<String> rowKey : table.rowKeySet()) { if (Objects.equals(rowKeyValue, rowKey.getValue())) { table.row(rowKey).forEach((columnKey,value) -> builder.put(rowKey, columnKey, value)); } } } final Set<String> knownKeys = Sets.newHashSet(rowKeys); for (Directional<String> rowKey : table.rowKeySet()) { // Append any rows that were not previously matched, in the same order as they appear if (!knownKeys.contains(rowKey.getValue())) { table.row(rowKey).forEach((columnKey,value) -> builder.put(rowKey, columnKey, value)); } } return builder.build(); }
static <C,V> Table<Directional<String>, C, V> function(Table<Directional<String>, C, V> table, List<String> rowKeys) { final ImmutableTable.Builder<Directional<String>, C, V> builder = ImmutableTable.builder(); for (String rowKeyValue : rowKeys) { for (Directional<String> rowKey : table.rowKeySet()) { if (Objects.equals(rowKeyValue, rowKey.getValue())) { table.row(rowKey).forEach((columnKey,value) -> builder.put(rowKey, columnKey, value)); } } } final Set<String> knownKeys = Sets.newHashSet(rowKeys); for (Directional<String> rowKey : table.rowKeySet()) { if (!knownKeys.contains(rowKey.getValue())) { table.row(rowKey).forEach((columnKey,value) -> builder.put(rowKey, columnKey, value)); } } return builder.build(); }
/** * Given a table, sort the rows such that the row keys appear in the same order * as the given list. Any additional rows should be appended after these in the same * order that they appeared. * * @param table the table to sort * @param rowKeys list of row keys to match * @return a sorted table */
Given a table, sort the rows such that the row keys appear in the same order as the given list. Any additional rows should be appended after these in the same order that they appeared
sortTableByRowKeys
{ "repo_name": "aihua/opennms", "path": "features/flows/elastic/src/main/java/org/opennms/netmgt/flows/elastic/TableUtils.java", "license": "agpl-3.0", "size": 3072 }
[ "com.google.common.collect.ImmutableTable", "com.google.common.collect.Sets", "com.google.common.collect.Table", "java.util.List", "java.util.Objects", "java.util.Set", "org.opennms.netmgt.flows.api.Directional" ]
import com.google.common.collect.ImmutableTable; import com.google.common.collect.Sets; import com.google.common.collect.Table; import java.util.List; import java.util.Objects; import java.util.Set; import org.opennms.netmgt.flows.api.Directional;
import com.google.common.collect.*; import java.util.*; import org.opennms.netmgt.flows.api.*;
[ "com.google.common", "java.util", "org.opennms.netmgt" ]
com.google.common; java.util; org.opennms.netmgt;
2,486,383
void addConnectionListener( IEventListener<ComConnector.ConnectionStatus> connectionListener );
void addConnectionListener( IEventListener<ComConnector.ConnectionStatus> connectionListener );
/** * Add a connection listener to the connector. This listener will receive * updates for status changes from the connector. * * @param connectionListener the connectionListener listener to add */
Add a connection listener to the connector. This listener will receive updates for status changes from the connector
addConnectionListener
{ "repo_name": "atennert/de.atennert.eoconnector", "path": "src/main/java/de/atennert/connector/IEnOceanConnector.java", "license": "apache-2.0", "size": 3352 }
[ "de.atennert.connector.distribution.IEventListener", "de.atennert.connector.reader.ComConnector" ]
import de.atennert.connector.distribution.IEventListener; import de.atennert.connector.reader.ComConnector;
import de.atennert.connector.distribution.*; import de.atennert.connector.reader.*;
[ "de.atennert.connector" ]
de.atennert.connector;
1,739,491
void addPermission(ItemStack itemStack, SecurityPermissions permission);
void addPermission(ItemStack itemStack, SecurityPermissions permission);
/** * add a permission to the item stack. * * @param itemStack card * @param permission to be added permission */
add a permission to the item stack
addPermission
{ "repo_name": "Zerrens/InterstellarOres", "path": "src/main/java/appeng/api/implementations/items/IBiometricCard.java", "license": "gpl-3.0", "size": 1667 }
[ "net.minecraft.item.ItemStack" ]
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
[ "net.minecraft.item" ]
net.minecraft.item;
52,641
@Override public synchronized TemporalDatum createTemporalDatum(final String code) throws FactoryException { final TemporalDatum datum; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof TemporalDatum) { datum = (TemporalDatum) cached; } else { datum = getBackingStore().createTemporalDatum(code); } put(key, datum); return datum; }
synchronized TemporalDatum function(final String code) throws FactoryException { final TemporalDatum datum; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof TemporalDatum) { datum = (TemporalDatum) cached; } else { datum = getBackingStore().createTemporalDatum(code); } put(key, datum); return datum; }
/** * Returns a temporal datum from a code. * * @throws FactoryException if the object creation failed. */
Returns a temporal datum from a code
createTemporalDatum
{ "repo_name": "geotools/geotools", "path": "modules/library/referencing/src/main/java/org/geotools/referencing/factory/BufferedAuthorityFactory.java", "license": "lgpl-2.1", "size": 44519 }
[ "org.opengis.referencing.FactoryException", "org.opengis.referencing.datum.TemporalDatum" ]
import org.opengis.referencing.FactoryException; import org.opengis.referencing.datum.TemporalDatum;
import org.opengis.referencing.*; import org.opengis.referencing.datum.*;
[ "org.opengis.referencing" ]
org.opengis.referencing;
2,407,002
public CashDrawer getByCampusCode(String campusCode);
CashDrawer function(String campusCode);
/** * Retrieves the CashDrawer instance associated with the given campus code, if any. If autocreate is true, * and no CashDrawer for the given campus exists, getByCampusCode will return a newly-created * (non-persisted) CashDrawer instance. * * @param campusCode The campus code used to retrieve the cash drawer. * @return CashDrawer instance or null */
Retrieves the CashDrawer instance associated with the given campus code, if any. If autocreate is true, and no CashDrawer for the given campus exists, getByCampusCode will return a newly-created (non-persisted) CashDrawer instance
getByCampusCode
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/service/CashDrawerService.java", "license": "agpl-3.0", "size": 5104 }
[ "org.kuali.kfs.fp.businessobject.CashDrawer" ]
import org.kuali.kfs.fp.businessobject.CashDrawer;
import org.kuali.kfs.fp.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
525,383
public static void copySimpleProperties(Object origin, Object destination) { try { Object[] empty = new Object[]{}; PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(origin.getClass()); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor.getReadMethod() != null && propertyDescriptor.getWriteMethod() != null) { Object value = propertyDescriptor.getReadMethod().invoke(origin, empty); if (value != null) { propertyDescriptor.getWriteMethod().invoke(destination, value); } } } } catch (Exception e) { throw new RuntimeException("Unexpected error while copying properties.", e); } }
static void function(Object origin, Object destination) { try { Object[] empty = new Object[]{}; PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(origin.getClass()); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor.getReadMethod() != null && propertyDescriptor.getWriteMethod() != null) { Object value = propertyDescriptor.getReadMethod().invoke(origin, empty); if (value != null) { propertyDescriptor.getWriteMethod().invoke(destination, value); } } } } catch (Exception e) { throw new RuntimeException(STR, e); } }
/** * This method uses simple getter/setter methods to copy object values from a original object to destination object * * @param origin original object * @param destination destination object */
This method uses simple getter/setter methods to copy object values from a original object to destination object
copySimpleProperties
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-cam/src/main/java/org/kuali/kfs/module/cam/util/ObjectValueUtils.java", "license": "agpl-3.0", "size": 2355 }
[ "java.beans.PropertyDescriptor", "org.apache.commons.beanutils.PropertyUtils" ]
import java.beans.PropertyDescriptor; import org.apache.commons.beanutils.PropertyUtils;
import java.beans.*; import org.apache.commons.beanutils.*;
[ "java.beans", "org.apache.commons" ]
java.beans; org.apache.commons;
421,447
public ZonedDateTimeStream until(int amount, final ChronoUnit unit) { Objects.requireNonNull(unit); setUntil(getFrom().plus(amount, unit)); return this; }
ZonedDateTimeStream function(int amount, final ChronoUnit unit) { Objects.requireNonNull(unit); setUntil(getFrom().plus(amount, unit)); return this; }
/** * Set the exclusive end point of the stream, using a relative duration. * * @param amount The number of units to use when calculating the duration of the stream. May be negative. * @param unit The non-null unit the amount is denominated in. * @return A non-null ZonedDateTimeStream. * @throws java.time.temporal.UnsupportedTemporalTypeException if the unit is not supported. * @see ChronoUnit */
Set the exclusive end point of the stream, using a relative duration
until
{ "repo_name": "tginsberg/java-timestream", "path": "src/main/java/com/ginsberg/timestream/ZonedDateTimeStream.java", "license": "mit", "size": 6518 }
[ "java.time.temporal.ChronoUnit", "java.util.Objects" ]
import java.time.temporal.ChronoUnit; import java.util.Objects;
import java.time.temporal.*; import java.util.*;
[ "java.time", "java.util" ]
java.time; java.util;
1,932,855
@Override public Object clone() throws CloneNotSupportedException { CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } // after setting up all the subplots, the shared range axis may need // reconfiguring ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; }
Object function() throws CloneNotSupportedException { CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result; }
/** * Returns a clone of the plot. * * @return A clone. * * @throws CloneNotSupportedException this class will not throw this * exception, but subclasses (if any) might. */
Returns a clone of the plot
clone
{ "repo_name": "sebkur/JFreeChart", "path": "src/main/java/org/jfree/chart/plot/CombinedRangeCategoryPlot.java", "license": "lgpl-3.0", "size": 20836 }
[ "java.util.Iterator", "java.util.List", "org.jfree.chart.axis.ValueAxis", "org.jfree.util.ObjectUtilities" ]
import java.util.Iterator; import java.util.List; import org.jfree.chart.axis.ValueAxis; import org.jfree.util.ObjectUtilities;
import java.util.*; import org.jfree.chart.axis.*; import org.jfree.util.*;
[ "java.util", "org.jfree.chart", "org.jfree.util" ]
java.util; org.jfree.chart; org.jfree.util;
1,865,934
public IType primitiveBoolean() { return getType(Boolean.TYPE); }
IType function() { return getType(Boolean.TYPE); }
/** * Retrieves the {@link IType} for the primitive boolean. * * @return The external form of the primitive boolean */
Retrieves the <code>IType</code> for the primitive boolean
primitiveBoolean
{ "repo_name": "gameduell/eclipselink.runtime", "path": "jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/tools/TypeHelper.java", "license": "epl-1.0", "size": 19729 }
[ "org.eclipse.persistence.jpa.jpql.tools.spi.IType" ]
import org.eclipse.persistence.jpa.jpql.tools.spi.IType;
import org.eclipse.persistence.jpa.jpql.tools.spi.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
354,772
@Test public void testLong2Long() { try { Message message = senderSession.createMessage(); message.setLongProperty("prop", 127L); Assert.assertEquals(127L, message.getLongProperty("prop")); } catch (JMSException e) { fail(e); } }
void function() { try { Message message = senderSession.createMessage(); message.setLongProperty("prop", 127L); Assert.assertEquals(127L, message.getLongProperty("prop")); } catch (JMSException e) { fail(e); } }
/** * if a property is set as a <code>long</code>, * it can also be read as a <code>long</code>. */
if a property is set as a <code>long</code>, it can also be read as a <code>long</code>
testLong2Long
{ "repo_name": "cshannon/activemq-artemis", "path": "tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java", "license": "apache-2.0", "size": 43771 }
[ "javax.jms.JMSException", "javax.jms.Message", "org.junit.Assert" ]
import javax.jms.JMSException; import javax.jms.Message; import org.junit.Assert;
import javax.jms.*; import org.junit.*;
[ "javax.jms", "org.junit" ]
javax.jms; org.junit;
11,437
Resources resources = context.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float px = dp * (metrics.densityDpi/160f); return px; }
Resources resources = context.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float px = dp * (metrics.densityDpi/160f); return px; }
/** * This method convets dp unit to equivalent device specific value in pixels. * * @param dp A value in dp(Device independent pixels) unit. Which we need to convert into pixels * @param context Context to get resources and device specific display metrics * @return A float value to represent Pixels equivalent to dp according to device */
This method convets dp unit to equivalent device specific value in pixels
convertDpToPixel
{ "repo_name": "nspeeD/RfidAccessReader", "path": "src/com/speed/rfidaccessreader/utils/DpsConverter.java", "license": "apache-2.0", "size": 1341 }
[ "android.content.res.Resources", "android.util.DisplayMetrics" ]
import android.content.res.Resources; import android.util.DisplayMetrics;
import android.content.res.*; import android.util.*;
[ "android.content", "android.util" ]
android.content; android.util;
1,767,702
@Override protected void applyImpl( KFAnimationFrame stateA, KFAnimationFrame stateB, float interpolationValue, Opacity modifiable) { if (stateB == null) { modifiable.setOpacity(stateA.getData()[0]); return; } modifiable.setOpacity( interpolateValue(stateA.getData()[0], stateB.getData()[0], interpolationValue)); }
void function( KFAnimationFrame stateA, KFAnimationFrame stateB, float interpolationValue, Opacity modifiable) { if (stateB == null) { modifiable.setOpacity(stateA.getData()[0]); return; } modifiable.setOpacity( interpolateValue(stateA.getData()[0], stateB.getData()[0], interpolationValue)); }
/** * Applies the current state, given by interpolationValue, to the Opacity object. * @param stateA Initial state * @param stateB End state * @param interpolationValue Progress [0..1] between stateA and stateB * @param modifiable The Opacity to apply the values to */
Applies the current state, given by interpolationValue, to the Opacity object
applyImpl
{ "repo_name": "marmelroy/Keyframes", "path": "android/keyframes/src/main/java/com/facebook/keyframes/model/keyframedmodels/KeyFramedOpacity.java", "license": "bsd-3-clause", "size": 2697 }
[ "com.facebook.keyframes.model.KFAnimationFrame" ]
import com.facebook.keyframes.model.KFAnimationFrame;
import com.facebook.keyframes.model.*;
[ "com.facebook.keyframes" ]
com.facebook.keyframes;
1,574,952
private void registerWrites() { Iterator<Connection> it = writingCons.iterator(); while (it.hasNext()) { Connection c = it.next(); it.remove(); SelectionKey sk = c.channel.keyFor(writeSelector); try { if (sk == null) { try { c.channel.register(writeSelector, SelectionKey.OP_WRITE, c); } catch (ClosedChannelException e) { // ignore: the client went away. if (LOG.isTraceEnabled()) LOG.trace("ignored", e); } } else { sk.interestOps(SelectionKey.OP_WRITE); } } catch (CancelledKeyException e) { // ignore: the client went away. if (LOG.isTraceEnabled()) LOG.trace("ignored", e); } } }
void function() { Iterator<Connection> it = writingCons.iterator(); while (it.hasNext()) { Connection c = it.next(); it.remove(); SelectionKey sk = c.channel.keyFor(writeSelector); try { if (sk == null) { try { c.channel.register(writeSelector, SelectionKey.OP_WRITE, c); } catch (ClosedChannelException e) { if (LOG.isTraceEnabled()) LOG.trace(STR, e); } } else { sk.interestOps(SelectionKey.OP_WRITE); } } catch (CancelledKeyException e) { if (LOG.isTraceEnabled()) LOG.trace(STR, e); } } }
/** * Take the list of the connections that want to write, and register them * in the selector. */
Take the list of the connections that want to write, and register them in the selector
registerWrites
{ "repo_name": "andrewmains12/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java", "license": "apache-2.0", "size": 94923 }
[ "java.nio.channels.CancelledKeyException", "java.nio.channels.ClosedChannelException", "java.nio.channels.SelectionKey", "java.util.Iterator" ]
import java.nio.channels.CancelledKeyException; import java.nio.channels.ClosedChannelException; import java.nio.channels.SelectionKey; import java.util.Iterator;
import java.nio.channels.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
83,685
private void runBuild(ClassLoader coreLoader) throws BuildException { if (!readyToRun) { return; } final Project project = new Project(); project.setCoreLoader(coreLoader); Throwable error = null; try { addBuildListeners(project); addInputHandler(project); PrintStream err = System.err; PrintStream out = System.out; InputStream in = System.in; // use a system manager that prevents from System.exit() // only in JDK > 1.1 SecurityManager oldsm = null; if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0) && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { oldsm = System.getSecurityManager(); //SecurityManager can not be installed here for backwards //compatibility reasons (PD). Needs to be loaded prior to //ant class if we are going to implement it. //System.setSecurityManager(new NoExitSecurityManager()); } try { if (allowInput) { project.setDefaultInputStream(System.in); } //System.setIn(new DemuxInputStream(project)); //System.setOut(new PrintStream(new DemuxOutputStream(project, false))); //System.setErr(new PrintStream(new DemuxOutputStream(project, true))); if (!projectHelp) { project.fireBuildStarted(); } // set the thread priorities if (threadPriority != null) { try { project.log("Setting Ant's thread priority to " + threadPriority,Project.MSG_VERBOSE); Thread.currentThread().setPriority(threadPriority.intValue()); } catch (SecurityException swallowed) { //we cannot set the priority here. project.log("A security manager refused to set the -nice value"); } } project.init(); project.setUserProperty("ant.version", getAntVersion()); // set user-define properties Enumeration e = definedProps.keys(); while (e.hasMoreElements()) { String arg = (String) e.nextElement(); String value = (String) definedProps.get(arg); project.setUserProperty(arg, value); } project.setUserProperty("ant.file", buildFile.getAbsolutePath()); project.setKeepGoingMode(keepGoingMode); ProjectHelper.configureProject(project, buildFile); project.setBasedir(definedProps.getProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY)); if (projectHelp) { printDescription(project); printTargets(project, msgOutputLevel > Project.MSG_INFO); return; } // make sure that we have a target to execute if (targets.size() == 0) { if (project.getDefaultTarget() != null) { targets.addElement(project.getDefaultTarget()); } } project.executeTargets(targets); } finally { // put back the original security manager //The following will never eval to true. (PD) if (oldsm != null) { System.setSecurityManager(oldsm); } System.setOut(out); System.setErr(err); System.setIn(in); } } catch (RuntimeException exc) { error = exc; throw exc; } catch (Error err) { error = err; throw err; } finally { if (!projectHelp) { project.fireBuildFinished(error); } else if (error != null) { project.log(error.toString(), Project.MSG_ERR); } } }
void function(ClassLoader coreLoader) throws BuildException { if (!readyToRun) { return; } final Project project = new Project(); project.setCoreLoader(coreLoader); Throwable error = null; try { addBuildListeners(project); addInputHandler(project); PrintStream err = System.err; PrintStream out = System.out; InputStream in = System.in; SecurityManager oldsm = null; if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0) && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { oldsm = System.getSecurityManager(); } try { if (allowInput) { project.setDefaultInputStream(System.in); } if (!projectHelp) { project.fireBuildStarted(); } if (threadPriority != null) { try { project.log(STR + threadPriority,Project.MSG_VERBOSE); Thread.currentThread().setPriority(threadPriority.intValue()); } catch (SecurityException swallowed) { project.log(STR); } } project.init(); project.setUserProperty(STR, getAntVersion()); Enumeration e = definedProps.keys(); while (e.hasMoreElements()) { String arg = (String) e.nextElement(); String value = (String) definedProps.get(arg); project.setUserProperty(arg, value); } project.setUserProperty(STR, buildFile.getAbsolutePath()); project.setKeepGoingMode(keepGoingMode); ProjectHelper.configureProject(project, buildFile); project.setBasedir(definedProps.getProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY)); if (projectHelp) { printDescription(project); printTargets(project, msgOutputLevel > Project.MSG_INFO); return; } if (targets.size() == 0) { if (project.getDefaultTarget() != null) { targets.addElement(project.getDefaultTarget()); } } project.executeTargets(targets); } finally { if (oldsm != null) { System.setSecurityManager(oldsm); } System.setOut(out); System.setErr(err); System.setIn(in); } } catch (RuntimeException exc) { error = exc; throw exc; } catch (Error err) { error = err; throw err; } finally { if (!projectHelp) { project.fireBuildFinished(error); } else if (error != null) { project.log(error.toString(), Project.MSG_ERR); } } }
/** * Executes the build. If the constructor for this instance failed * (e.g. returned after issuing a warning), this method returns * immediately. * * @param coreLoader The classloader to use to find core classes. * May be <code>null</code>, in which case the * system classloader is used. * * @exception BuildException if the build fails */
Executes the build. If the constructor for this instance failed (e.g. returned after issuing a warning), this method returns immediately
runBuild
{ "repo_name": "neoautus/lucidj", "path": "extras/AntInstaller/AntInstaller-beta0.8/src/org/tp23/antinstaller/antmod/Main.java", "license": "apache-2.0", "size": 41286 }
[ "java.io.InputStream", "java.io.PrintStream", "java.util.Enumeration", "org.apache.tools.ant.BuildException", "org.apache.tools.ant.Project", "org.apache.tools.ant.ProjectHelper", "org.apache.tools.ant.util.JavaEnvUtils", "org.tp23.antinstaller.PropertiesFileRenderer" ]
import java.io.InputStream; import java.io.PrintStream; import java.util.Enumeration; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.util.JavaEnvUtils; import org.tp23.antinstaller.PropertiesFileRenderer;
import java.io.*; import java.util.*; import org.apache.tools.ant.*; import org.apache.tools.ant.util.*; import org.tp23.antinstaller.*;
[ "java.io", "java.util", "org.apache.tools", "org.tp23.antinstaller" ]
java.io; java.util; org.apache.tools; org.tp23.antinstaller;
464,050
public void open() throws IOException { checkOpened(); }
void function() throws IOException { checkOpened(); }
/** * Optional call to open the underlying {@link DataSource}. * * <p>Calling this method does nothing if the {@link DataSource} is already open. Calling this * method is optional, since the read and skip methods will automatically open the underlying * {@link DataSource} if it's not open already. * * @throws IOException If an error occurs opening the {@link DataSource}. */
Optional call to open the underlying <code>DataSource</code>. Calling this method does nothing if the <code>DataSource</code> is already open. Calling this method is optional, since the read and skip methods will automatically open the underlying <code>DataSource</code> if it's not open already
open
{ "repo_name": "google/ExoPlayer", "path": "library/datasource/src/main/java/com/google/android/exoplayer2/upstream/DataSourceInputStream.java", "license": "apache-2.0", "size": 3113 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,120,424
public ResponseCtx evaluate(AbstractRequestCtx requestCtx, String xacmlRequest) { if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_REQUEST)) { log.debug("XACML Request : " + xacmlRequest); } ResponseCtx xacmlResponse; if ((xacmlResponse = (ResponseCtx) getFromCache(xacmlRequest, false)) != null) { if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) { log.debug("XACML Response : " + xacmlResponse); } return xacmlResponse; } xacmlResponse = pdp.evaluate(requestCtx); addToCache(xacmlRequest, xacmlResponse, false); if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) { log.debug("XACML Response : " + xacmlResponse); } return xacmlResponse; }
ResponseCtx function(AbstractRequestCtx requestCtx, String xacmlRequest) { if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_REQUEST)) { log.debug(STR + xacmlRequest); } ResponseCtx xacmlResponse; if ((xacmlResponse = (ResponseCtx) getFromCache(xacmlRequest, false)) != null) { if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) { log.debug(STR + xacmlResponse); } return xacmlResponse; } xacmlResponse = pdp.evaluate(requestCtx); addToCache(xacmlRequest, xacmlResponse, false); if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) { log.debug(STR + xacmlResponse); } return xacmlResponse; }
/** * Evaluates the given XACML request and returns the Response * * @param requestCtx Balana Object model for request * @param xacmlRequest Balana Object model for request * @return ResponseCtx Balana Object model for response */
Evaluates the given XACML request and returns the Response
evaluate
{ "repo_name": "nuwandi-is/identity-framework", "path": "components/entitlement/org.wso2.carbon.identity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/pdp/EntitlementEngine.java", "license": "apache-2.0", "size": 25630 }
[ "org.wso2.balana.ctx.AbstractRequestCtx", "org.wso2.balana.ctx.ResponseCtx", "org.wso2.carbon.identity.base.IdentityConstants", "org.wso2.carbon.identity.core.util.IdentityUtil" ]
import org.wso2.balana.ctx.AbstractRequestCtx; import org.wso2.balana.ctx.ResponseCtx; import org.wso2.carbon.identity.base.IdentityConstants; import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.balana.ctx.*; import org.wso2.carbon.identity.base.*; import org.wso2.carbon.identity.core.util.*;
[ "org.wso2.balana", "org.wso2.carbon" ]
org.wso2.balana; org.wso2.carbon;
576,762
public ManagedConnection getManagedConnection() { return mc; }
ManagedConnection function() { return mc; }
/** * for tests only */
for tests only
getManagedConnection
{ "repo_name": "jbertram/activemq-artemis", "path": "artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java", "license": "apache-2.0", "size": 49831 }
[ "javax.resource.spi.ManagedConnection" ]
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.*;
[ "javax.resource" ]
javax.resource;
746,354
Map getCollectionCount(SecurityContext ctx, Class rootNodeType, String property, List ids, Parameters options) throws DSOutOfServiceException, DSAccessException { try { IMetadataPrx service = gw.getMetadataService(ctx); IContainerPrx svc = gw.getPojosService(ctx); if (TagAnnotationData.class.equals(rootNodeType)) { return service.getTaggedObjectsCount(ids, options); } String p = convertProperty(rootNodeType, property); if (p == null) return null; return PojoMapper.asDataObjects(svc.getCollectionCount( PojoMapper.getModelType(rootNodeType).getName(), p, ids, options)); } catch (Throwable t) { handleException(t, "Cannot count the collection."); } return new HashMap(); }
Map getCollectionCount(SecurityContext ctx, Class rootNodeType, String property, List ids, Parameters options) throws DSOutOfServiceException, DSAccessException { try { IMetadataPrx service = gw.getMetadataService(ctx); IContainerPrx svc = gw.getPojosService(ctx); if (TagAnnotationData.class.equals(rootNodeType)) { return service.getTaggedObjectsCount(ids, options); } String p = convertProperty(rootNodeType, property); if (p == null) return null; return PojoMapper.asDataObjects(svc.getCollectionCount( PojoMapper.getModelType(rootNodeType).getName(), p, ids, options)); } catch (Throwable t) { handleException(t, STR); } return new HashMap(); }
/** * Counts the number of items in a collection for a given object. * Returns a map which key is the passed rootNodeID and the value is * the number of items contained in this object and * maps the result calling {@link PojoMapper#asDataObjects(Map)}. * * @param ctx The security context. * @param rootNodeType The type of container. * @param property One of the properties defined by this class. * @param ids The identifiers of the objects. * @param options Options to retrieve the data. * @param rootNodeIDs Set of root node IDs. * @return See above. * @throws DSOutOfServiceException If the connection is broken, or logged in * @throws DSAccessException If an error occurred while trying to * retrieve data from OMERO service. * @see IPojos#getCollectionCount(String, String, List, Map) */
Counts the number of items in a collection for a given object. Returns a map which key is the passed rootNodeID and the value is the number of items contained in this object and maps the result calling <code>PojoMapper#asDataObjects(Map)</code>
getCollectionCount
{ "repo_name": "dominikl/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java", "license": "gpl-2.0", "size": 262766 }
[ "java.util.HashMap", "java.util.List", "java.util.Map" ]
import java.util.HashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
165,038
protected void putIfAbsent(Region aReg, boolean allowInvalidate) { // get a key Object key = null; if (TestConfig.tab().getRandGen().nextInt(1, 100) <= 50) { // get existing key key = ParRegUtil.getExistingKey(aReg, uniqueKeys, numThreadsInClients, isThinClient || isEmptyClient); if (key == null) { // could not get an existing key so get a new key key = getNewKey(); Log.getLogWriter().info("In putIfAbsent, targeting new key " + key); } else { Log.getLogWriter().info("In putIfAbsent, targeting existing key " + key); } } else { // get a new key key = getNewKey(); Log.getLogWriter().info("In putIfAbsent, targeting new key " + key); } // get a value Log.getLogWriter().info("Getting value for putIfAbsent"); BaseValueHolder objToPut = null; if (allowInvalidate) { if (TestConfig.tab().getRandGen().nextInt(1, 100) <= 50) { // get non-null value) objToPut = getValueForKey(key); } } else { // do not allow invalidate objToPut = getValueForKey(key); } // do the operation boolean containsKey = aReg.containsKey(key); Boolean containsKeyOnServer = isBridgeClient ? aReg.containsKeyOnServer(key) : null; Log.getLogWriter().info("Calling putIfAbsent with key " + key + ", value " + TestHelper.toString(objToPut) + ", containsKey " + containsKey + ", containsKeyOnServer " + containsKeyOnServer); BaseValueHolder returnValue = PdxTest.toValueHolder(aReg.putIfAbsent(key, objToPut)); Log.getLogWriter().info("Done calling putIfAbsent with key " + key + ", value " + TestHelper.toString(objToPut) + ", return value is " + TestHelper.toString(returnValue)); // validation // returnValue can only be checked for serial tests if (isSerialExecution) { // validate return value Object expectedValue = regionSnapshot.get(key); if (((expectedValue == null) && (returnValue != null)) || ((returnValue == null) && (expectedValue != null)) || ((expectedValue != null) && (!expectedValue.equals(returnValue.myValue)))) { throw new TestException("Expected return value " + TestHelper.toString(returnValue) + " to be ValueHolder with myValue field " + TestHelper.toString(expectedValue)); } // update the snapshot boolean opOccurred = isBridgeClient ? !containsKeyOnServer : !containsKey; if (opOccurred) { // create occurred if (objToPut == null) { regionSnapshot.put(key, null); } else { regionSnapshot.put(key, objToPut.myValue); } } } }
void function(Region aReg, boolean allowInvalidate) { Object key = null; if (TestConfig.tab().getRandGen().nextInt(1, 100) <= 50) { key = ParRegUtil.getExistingKey(aReg, uniqueKeys, numThreadsInClients, isThinClient isEmptyClient); if (key == null) { key = getNewKey(); Log.getLogWriter().info(STR + key); } else { Log.getLogWriter().info(STR + key); } } else { key = getNewKey(); Log.getLogWriter().info(STR + key); } Log.getLogWriter().info(STR); BaseValueHolder objToPut = null; if (allowInvalidate) { if (TestConfig.tab().getRandGen().nextInt(1, 100) <= 50) { objToPut = getValueForKey(key); } } else { objToPut = getValueForKey(key); } boolean containsKey = aReg.containsKey(key); Boolean containsKeyOnServer = isBridgeClient ? aReg.containsKeyOnServer(key) : null; Log.getLogWriter().info(STR + key + STR + TestHelper.toString(objToPut) + STR + containsKey + STR + containsKeyOnServer); BaseValueHolder returnValue = PdxTest.toValueHolder(aReg.putIfAbsent(key, objToPut)); Log.getLogWriter().info(STR + key + STR + TestHelper.toString(objToPut) + STR + TestHelper.toString(returnValue)); if (isSerialExecution) { Object expectedValue = regionSnapshot.get(key); if (((expectedValue == null) && (returnValue != null)) ((returnValue == null) && (expectedValue != null)) ((expectedValue != null) && (!expectedValue.equals(returnValue.myValue)))) { throw new TestException(STR + TestHelper.toString(returnValue) + STR + TestHelper.toString(expectedValue)); } boolean opOccurred = isBridgeClient ? !containsKeyOnServer : !containsKey; if (opOccurred) { if (objToPut == null) { regionSnapshot.put(key, null); } else { regionSnapshot.put(key, objToPut.myValue); } } } }
/** Do a putIfAbsent. This can randomly make this operation: * - function as a get (key is present) * - function as a create (key not present and value to put is non-null) * - function as an create/invalidate (key not present and value to put is null) * @param aReg The region to call putIfAbsent on. * allowInvalidate True if this call is allowed to randomly * choose to make this operation function as an invalidate, * false otherwise. */
Do a putIfAbsent. This can randomly make this operation: - function as a get (key is present) - function as a create (key not present and value to put is non-null) - function as an create/invalidate (key not present and value to put is null)
putIfAbsent
{ "repo_name": "papicella/snappy-store", "path": "tests/core/src/main/java/parReg/ParRegTest.java", "license": "apache-2.0", "size": 239462 }
[ "com.gemstone.gemfire.cache.Region" ]
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
2,063,014
public static void pack(File source,final String basePath, final String replacePath, OutputStream output, boolean compress) throws IOException { log.debug("Packing "+source+" repacing "+basePath+" with "+replacePath); final ZipOutputStream zout = new ZipOutputStream(output); if ( compress ) { zout.setLevel(ZipOutputStream.DEFLATED); } else { zout.setLevel(ZipOutputStream.STORED); } final byte[] buffer = new byte[1024 * 100]; try { recurse(source, new RecurseAction() {
static void function(File source,final String basePath, final String replacePath, OutputStream output, boolean compress) throws IOException { log.debug(STR+source+STR+basePath+STR+replacePath); final ZipOutputStream zout = new ZipOutputStream(output); if ( compress ) { zout.setLevel(ZipOutputStream.DEFLATED); } else { zout.setLevel(ZipOutputStream.STORED); } final byte[] buffer = new byte[1024 * 100]; try { recurse(source, new RecurseAction() {
/** * pack a segment into the zip * @param compress * * @param addsi * @return * @throws IOException */
pack a segment into the zip
pack
{ "repo_name": "hackbuteer59/sakai", "path": "search/search-util/src/java/org/sakaiproject/search/util/FileUtils.java", "license": "apache-2.0", "size": 9478 }
[ "java.io.File", "java.io.IOException", "java.io.OutputStream", "java.util.zip.ZipOutputStream" ]
import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.zip.ZipOutputStream;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,710,422
void recoverCreate(Collection<File> dataDirs, Collection<File> editsDirs) throws IOException { Collection<File> tempDataDirs = new ArrayList<File>(dataDirs); Collection<File> tempEditsDirs = new ArrayList<File>(editsDirs); this.storageDirs = new ArrayList<StorageDirectory>(); setStorageDirectories(tempDataDirs, tempEditsDirs); for (Iterator<StorageDirectory> it = dirIterator(); it.hasNext();) { StorageDirectory sd = it.next(); boolean isAccessible = true; try { // create directories if don't exist yet if(!sd.getRoot().mkdirs()) { // do nothing, directory is already created } } catch(SecurityException se) { isAccessible = false; } if(!isAccessible) throw new InconsistentFSStateException(sd.getRoot(), "cannot access checkpoint directory."); StorageState curState; try { curState = sd.analyzeStorage(HdfsConstants.StartupOption.REGULAR); // sd is locked but not opened switch(curState) { case NON_EXISTENT: // fail if any of the configured checkpoint dirs are inaccessible throw new InconsistentFSStateException(sd.getRoot(), "checkpoint directory does not exist or is not accessible."); case NOT_FORMATTED: break; // it's ok since initially there is no current and VERSION case NORMAL: break; default: // recovery is possible sd.doRecover(curState); } } catch (IOException ioe) { sd.unlock(); throw ioe; } } }
void recoverCreate(Collection<File> dataDirs, Collection<File> editsDirs) throws IOException { Collection<File> tempDataDirs = new ArrayList<File>(dataDirs); Collection<File> tempEditsDirs = new ArrayList<File>(editsDirs); this.storageDirs = new ArrayList<StorageDirectory>(); setStorageDirectories(tempDataDirs, tempEditsDirs); for (Iterator<StorageDirectory> it = dirIterator(); it.hasNext();) { StorageDirectory sd = it.next(); boolean isAccessible = true; try { if(!sd.getRoot().mkdirs()) { } } catch(SecurityException se) { isAccessible = false; } if(!isAccessible) throw new InconsistentFSStateException(sd.getRoot(), STR); StorageState curState; try { curState = sd.analyzeStorage(HdfsConstants.StartupOption.REGULAR); switch(curState) { case NON_EXISTENT: throw new InconsistentFSStateException(sd.getRoot(), STR); case NOT_FORMATTED: break; case NORMAL: break; default: sd.doRecover(curState); } } catch (IOException ioe) { sd.unlock(); throw ioe; } } }
/** * Analyze checkpoint directories. * Create directories if they do not exist. * Recover from an unsuccessful checkpoint is necessary. * * @param dataDirs * @param editsDirs * @throws IOException */
Analyze checkpoint directories. Create directories if they do not exist. Recover from an unsuccessful checkpoint is necessary
recoverCreate
{ "repo_name": "leonhong/hadoop-common", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java", "license": "apache-2.0", "size": 22977 }
[ "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "org.apache.hadoop.hdfs.server.common.HdfsConstants", "org.apache.hadoop.hdfs.server.common.InconsistentFSStateException" ]
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.apache.hadoop.hdfs.server.common.HdfsConstants; import org.apache.hadoop.hdfs.server.common.InconsistentFSStateException;
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.common.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,357,546
public Property getDuration() { return duration; }
Property function() { return duration; }
/** * Returns the duration of the event or task. * * @return the duration property */
Returns the duration of the event or task
getDuration
{ "repo_name": "accesstest3/cfunambol", "path": "common/pim-framework/src/main/java/com/funambol/common/pim/calendar/CalendarContent.java", "license": "agpl-3.0", "size": 41388 }
[ "com.funambol.common.pim.common.Property" ]
import com.funambol.common.pim.common.Property;
import com.funambol.common.pim.common.*;
[ "com.funambol.common" ]
com.funambol.common;
167,196
public MLocator getLocator() { if (getM_Locator_ID()==0) return null; return m_mLocator.getMLocator(getValue(), null); }
MLocator function() { if (getM_Locator_ID()==0) return null; return m_mLocator.getMLocator(getValue(), null); }
/** * Returns Editor value in the form of the selected locator * @return */
Returns Editor value in the form of the selected locator
getLocator
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiereTrunk/client/src/org/compiere/grid/ed/VLocator.java", "license": "gpl-2.0", "size": 16904 }
[ "org.compiere.model.MLocator" ]
import org.compiere.model.MLocator;
import org.compiere.model.*;
[ "org.compiere.model" ]
org.compiere.model;
25,753
public static void createFile(File file, String contents, String charSet) throws SVNException { createEmptyFile(file); if (contents == null || contents.length() == 0) { return; } OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(file); if (charSet != null) { os.write(contents.getBytes(charSet)); } else { os.write(contents.getBytes()); } } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot write to file ''{0}'': {1}", new Object[] {file, ioe.getMessage()}); SVNErrorManager.error(err, ioe, Level.FINE, SVNLogType.DEFAULT); } catch (SVNException svne) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot write to file ''{0}''", file); SVNErrorManager.error(err, svne, Level.FINE, SVNLogType.DEFAULT); } finally { SVNFileUtil.closeFile(os); } }
static void function(File file, String contents, String charSet) throws SVNException { createEmptyFile(file); if (contents == null contents.length() == 0) { return; } OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(file); if (charSet != null) { os.write(contents.getBytes(charSet)); } else { os.write(contents.getBytes()); } } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, STR, new Object[] {file, ioe.getMessage()}); SVNErrorManager.error(err, ioe, Level.FINE, SVNLogType.DEFAULT); } catch (SVNException svne) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, STR, file); SVNErrorManager.error(err, svne, Level.FINE, SVNLogType.DEFAULT); } finally { SVNFileUtil.closeFile(os); } }
/** * An internal method for ASCII bytes to write only! * * @param file * @param contents * @throws SVNException */
An internal method for ASCII bytes to write only
createFile
{ "repo_name": "zwobit/exist", "path": "extensions/svn/src/org/exist/versioning/svn/internal/wc/SVNFileUtil.java", "license": "lgpl-2.1", "size": 52882 }
[ "java.io.File", "java.io.IOException", "java.io.OutputStream", "java.util.logging.Level", "org.tmatesoft.svn.core.SVNErrorCode", "org.tmatesoft.svn.core.SVNErrorMessage", "org.tmatesoft.svn.core.SVNException", "org.tmatesoft.svn.util.SVNLogType" ]
import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.logging.Level; import org.tmatesoft.svn.core.SVNErrorCode; import org.tmatesoft.svn.core.SVNErrorMessage; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.util.SVNLogType;
import java.io.*; import java.util.logging.*; import org.tmatesoft.svn.core.*; import org.tmatesoft.svn.util.*;
[ "java.io", "java.util", "org.tmatesoft.svn" ]
java.io; java.util; org.tmatesoft.svn;
1,900,514
public void addPath(GeneralPath path, int style, boolean autoAdjustStroke) { addCommand(new PDFShapeCmd(path, style, autoAdjustStroke)); }
void function(GeneralPath path, int style, boolean autoAdjustStroke) { addCommand(new PDFShapeCmd(path, style, autoAdjustStroke)); }
/** * set the current path * * @param path * the path * @param style * the style: PDFShapeCmd.STROKE, PDFShapeCmd.FILL, * @param autoAdjustStroke * PDFShapeCmd.BOTH, PDFShapeCmd.CLIP, or some combination. */
set the current path
addPath
{ "repo_name": "Bennyz1/PDFrenderer", "path": "src/com/sun/pdfview/PDFPage.java", "license": "lgpl-2.1", "size": 28249 }
[ "java.awt.geom.GeneralPath" ]
import java.awt.geom.GeneralPath;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
698,213
@Override protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); }
void function(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); }
/** * Disable TRACE method to avoid TRACE vulnerability. */
Disable TRACE method to avoid TRACE vulnerability
doTrace
{ "repo_name": "legend-hua/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java", "license": "apache-2.0", "size": 16351 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,964,775
public List<CsarFile> getAll() throws PersistenceException { Session session = HibernateUtil.getSession(); Transaction tx = null; List<CsarFile> csarFileList = null; try { tx = session.beginTransaction(); csarFileList = session.createQuery("from CsarFile").list(); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx.rollback(); } throw new PersistenceException(e); } finally { session.close(); } return csarFileList; }
List<CsarFile> function() throws PersistenceException { Session session = HibernateUtil.getSession(); Transaction tx = null; List<CsarFile> csarFileList = null; try { tx = session.beginTransaction(); csarFileList = session.createQuery(STR).list(); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx.rollback(); } throw new PersistenceException(e); } finally { session.close(); } return csarFileList; }
/** * Gets all CSAR files. * * @return List of CSAR files. * @throws PersistenceException * upon problems committing the underlying transaction */
Gets all CSAR files
getAll
{ "repo_name": "CloudCycle2/CSAR_Repository", "path": "src/main/java/org/opentosca/csarrepo/model/repository/CsarFileRepository.java", "license": "apache-2.0", "size": 3745 }
[ "java.util.List", "org.hibernate.HibernateException", "org.hibernate.Session", "org.hibernate.Transaction", "org.opentosca.csarrepo.exception.PersistenceException", "org.opentosca.csarrepo.model.CsarFile" ]
import java.util.List; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.opentosca.csarrepo.exception.PersistenceException; import org.opentosca.csarrepo.model.CsarFile;
import java.util.*; import org.hibernate.*; import org.opentosca.csarrepo.exception.*; import org.opentosca.csarrepo.model.*;
[ "java.util", "org.hibernate", "org.opentosca.csarrepo" ]
java.util; org.hibernate; org.opentosca.csarrepo;
1,718,615
protected AlertDialog getDialog(boolean full) { WebView wv = new WebView(mContext); // wv.setBackgroundColor(0); // transparent wv.loadDataWithBaseURL(null, getLog(full), "text/html", "UTF-8", null); AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder.setTitle(
AlertDialog function(boolean full) { WebView wv = new WebView(mContext); wv.loadDataWithBaseURL(null, getLog(full), STR, "UTF-8", null); AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder.setTitle(
/** * Create a dialog containing (parts of the) change log. * * @param full * If this is {@code true} the full change log is displayed. * Otherwise only changes for versions newer than the last * version are displayed. * * @return A dialog containing the (partial) change log. */
Create a dialog containing (parts of the) change log
getDialog
{ "repo_name": "sachin1092/The-Weather-App", "path": "app/src/main/java/com/sachinshinde/theweatherapp/utils/ChangeLog.java", "license": "apache-2.0", "size": 15326 }
[ "android.app.AlertDialog", "android.webkit.WebView" ]
import android.app.AlertDialog; import android.webkit.WebView;
import android.app.*; import android.webkit.*;
[ "android.app", "android.webkit" ]
android.app; android.webkit;
1,925,104
public static LongList getQueueIDList() { PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); LongList result = getQueueIDList(adapter); adapter.close(); return result; }
static LongList function() { PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); LongList result = getQueueIDList(adapter); adapter.close(); return result; }
/** * Loads the IDs of the FeedItems in the queue. This method should be preferred over * {@link #getQueue()} if the FeedItems of the queue are not needed. * * @return A list of IDs sorted by the same order as the queue. The caller can wrap the returned * list in a {@link de.danoeh.antennapod.core.util.QueueAccess} object for easier access to the queue's properties. */
Loads the IDs of the FeedItems in the queue. This method should be preferred over <code>#getQueue()</code> if the FeedItems of the queue are not needed
getQueueIDList
{ "repo_name": "TomHennen/AntennaPod", "path": "core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java", "license": "mit", "size": 37122 }
[ "de.danoeh.antennapod.core.util.LongList" ]
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.*;
[ "de.danoeh.antennapod" ]
de.danoeh.antennapod;
1,237,836
public Set<String> getFieldNames() { return fields.keySet(); }
Set<String> function() { return fields.keySet(); }
/** * Gets the field name collection. * * @return the field names */
Gets the field name collection
getFieldNames
{ "repo_name": "ryokdy/java-sdk", "path": "kintone-sdk/src/main/java/com/cybozu/kintone/database/Record.java", "license": "apache-2.0", "size": 13833 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
276,592
@Test public void testModelEqualsHashcode() throws Exception { Logger.getLogger(getClass()).debug("TEST " + name.getMethodName()); EqualsHashcodeTester tester = new EqualsHashcodeTester(object); tester.include("name"); tester.include("description"); tester.include("organization"); tester.include("terminology"); tester.include("branch"); tester.include("public"); tester.include("teamBased"); tester.include("editingEnabled"); tester.include("automationsEnabled"); tester.include("feedbackEmail"); // Set up objects tester.proxy(Set.class, 1, s1); tester.proxy(Set.class, 2, s2); tester.proxy(Map.class, 1, m1); tester.proxy(Map.class, 2, m2); assertTrue(tester.testIdentityFieldEquals()); assertTrue(tester.testNonIdentityFieldEquals()); assertTrue(tester.testIdentityFieldNotEquals()); assertTrue(tester.testIdentityFieldHashcode()); assertTrue(tester.testNonIdentityFieldHashcode()); assertTrue(tester.testIdentityFieldDifferentHashcode()); }
void function() throws Exception { Logger.getLogger(getClass()).debug(STR + name.getMethodName()); EqualsHashcodeTester tester = new EqualsHashcodeTester(object); tester.include("name"); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); tester.proxy(Set.class, 1, s1); tester.proxy(Set.class, 2, s2); tester.proxy(Map.class, 1, m1); tester.proxy(Map.class, 2, m2); assertTrue(tester.testIdentityFieldEquals()); assertTrue(tester.testNonIdentityFieldEquals()); assertTrue(tester.testIdentityFieldNotEquals()); assertTrue(tester.testIdentityFieldHashcode()); assertTrue(tester.testNonIdentityFieldHashcode()); assertTrue(tester.testIdentityFieldDifferentHashcode()); }
/** * Test equals and hascode methods. * * @throws Exception the exception */
Test equals and hascode methods
testModelEqualsHashcode
{ "repo_name": "WestCoastInformatics/UMLS-Terminology-Server", "path": "jpa-model/src/test/java/com/wci/umls/server/jpa/ProjectJpaUnitTest.java", "license": "apache-2.0", "size": 6587 }
[ "com.wci.umls.server.helpers.EqualsHashcodeTester", "java.util.Map", "java.util.Set", "org.apache.log4j.Logger", "org.junit.Assert" ]
import com.wci.umls.server.helpers.EqualsHashcodeTester; import java.util.Map; import java.util.Set; import org.apache.log4j.Logger; import org.junit.Assert;
import com.wci.umls.server.helpers.*; import java.util.*; import org.apache.log4j.*; import org.junit.*;
[ "com.wci.umls", "java.util", "org.apache.log4j", "org.junit" ]
com.wci.umls; java.util; org.apache.log4j; org.junit;
289,146
@Override public String toString(){ if(SanityManager.DEBUG){ return "offset: "+offset+"\n"+ "fetchFirst:"+fetchFirst+"\n"+ super.toString(); }else{ return ""; } }
String function(){ if(SanityManager.DEBUG){ return STR+offset+"\n"+ STR+fetchFirst+"\n"+ super.toString(); }else{ return ""; } }
/** * Convert this object to a String. See comments in QueryTreeNode.java * for how this should be done for tree printing. * * @return This object as a String */
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing
toString
{ "repo_name": "splicemachine/spliceengine", "path": "db-engine/src/main/java/com/splicemachine/db/impl/sql/compile/RowCountNode.java", "license": "agpl-3.0", "size": 9651 }
[ "com.splicemachine.db.iapi.services.sanity.SanityManager" ]
import com.splicemachine.db.iapi.services.sanity.SanityManager;
import com.splicemachine.db.iapi.services.sanity.*;
[ "com.splicemachine.db" ]
com.splicemachine.db;
1,113,227
boolean result = true; Document documentForValidation = getDocumentForValidation(); AccountingDocument accountingDocument = (AccountingDocument) documentForValidation; result = !hasPendingLedgerEntry(accountingDocument); return result; }
boolean result = true; Document documentForValidation = getDocumentForValidation(); AccountingDocument accountingDocument = (AccountingDocument) documentForValidation; result = !hasPendingLedgerEntry(accountingDocument); return result; }
/** * Validates that the accounting lines in the accounting document does not have * any pending labor ledger entries with the same emplID, periodCode, accountNumber, objectCode * <strong>Expects an accounting document as the first a parameter</strong> * * @see org.kuali.kfs.validation.Validation#validate(java.lang.Object[]) */
Validates that the accounting lines in the accounting document does not have any pending labor ledger entries with the same emplID, periodCode, accountNumber, objectCode Expects an accounting document as the first a parameter
validate
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-ld/src/main/java/org/kuali/kfs/module/ld/document/validation/impl/SalaryExpenseTransferPendingLegerEntryValidation.java", "license": "agpl-3.0", "size": 5357 }
[ "org.kuali.kfs.krad.document.Document", "org.kuali.kfs.sys.document.AccountingDocument" ]
import org.kuali.kfs.krad.document.Document; import org.kuali.kfs.sys.document.AccountingDocument;
import org.kuali.kfs.krad.document.*; import org.kuali.kfs.sys.document.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,748,164
protected Node exitComponent(Token node) throws ParseException { return node; }
Node function(Token node) throws ParseException { return node; }
/** * Called when exiting a parse tree node. * * @param node the node being exited * * @return the node to add to the parse tree, or * null if no parse tree should be created * * @throws ParseException if the node analysis discovered errors */
Called when exiting a parse tree node
exitComponent
{ "repo_name": "richb-hanover/mibble-2.9.2", "path": "src/java/net/percederberg/mibble/asn1/Asn1Analyzer.java", "license": "gpl-2.0", "size": 275483 }
[ "net.percederberg.grammatica.parser.Node", "net.percederberg.grammatica.parser.ParseException", "net.percederberg.grammatica.parser.Token" ]
import net.percederberg.grammatica.parser.Node; import net.percederberg.grammatica.parser.ParseException; import net.percederberg.grammatica.parser.Token;
import net.percederberg.grammatica.parser.*;
[ "net.percederberg.grammatica" ]
net.percederberg.grammatica;
447,404
Metadata m = null; try { if (null != metadata) { m = metadata; } else { m = RestConfiguration.getFactory().getMetadata(); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw Error.get(RestMetadataConstants.ERR_CANT_GET_METADATA, e.getMessage()); } return m; }
Metadata m = null; try { if (null != metadata) { m = metadata; } else { m = RestConfiguration.getFactory().getMetadata(); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw Error.get(RestMetadataConstants.ERR_CANT_GET_METADATA, e.getMessage()); } return m; }
/** * Returns the metadata. If no metadata is set on the command uses * MetadataManager#getMetadata() method. * * @return * @throws Exception */
Returns the metadata. If no metadata is set on the command uses MetadataManager#getMetadata() method
getMetadata
{ "repo_name": "snehagunta/lightblue-rest", "path": "metadata/src/main/java/com/redhat/lightblue/rest/metadata/hystrix/AbstractRestCommand.java", "license": "gpl-3.0", "size": 4434 }
[ "com.redhat.lightblue.metadata.Metadata", "com.redhat.lightblue.rest.RestConfiguration", "com.redhat.lightblue.rest.metadata.RestMetadataConstants", "com.redhat.lightblue.util.Error" ]
import com.redhat.lightblue.metadata.Metadata; import com.redhat.lightblue.rest.RestConfiguration; import com.redhat.lightblue.rest.metadata.RestMetadataConstants; import com.redhat.lightblue.util.Error;
import com.redhat.lightblue.metadata.*; import com.redhat.lightblue.rest.*; import com.redhat.lightblue.rest.metadata.*; import com.redhat.lightblue.util.*;
[ "com.redhat.lightblue" ]
com.redhat.lightblue;
2,063,066
public void setHandler(MessageHandler handler) { this.handler = handler; }
void function(MessageHandler handler) { this.handler = handler; }
/** * Sets the handler. * * @param handler the new handler */
Sets the handler
setHandler
{ "repo_name": "solemichael/omni", "path": "src/main/java/org/omni/service/quartz/job/InnerJob.java", "license": "apache-2.0", "size": 1426 }
[ "org.omni.service.message.MessageHandler" ]
import org.omni.service.message.MessageHandler;
import org.omni.service.message.*;
[ "org.omni.service" ]
org.omni.service;
1,229,478
public YangString getMobilityEventsMmeValue() throws JNCException { return (YangString)getValue("mobility-events-mme"); }
YangString function() throws JNCException { return (YangString)getValue(STR); }
/** * Gets the value for child leaf "mobility-events-mme". * @return The value of the leaf. */
Gets the value for child leaf "mobility-events-mme"
getMobilityEventsMmeValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/csl/AgwCslOper.java", "license": "apache-2.0", "size": 28765 }
[ "com.tailf.jnc.YangString" ]
import com.tailf.jnc.YangString;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
2,648,832
@NotNull String getLatestMinecraftVersion() throws RequestTypeNotAvailableException, NotSuccessfullyQueriedException;
@NotNull String getLatestMinecraftVersion() throws RequestTypeNotAvailableException, NotSuccessfullyQueriedException;
/** * Get the latest version's game version (such as "CB 1.7.2-R0.3" or "1.9"). * * @return latest version's game version. * @throws RequestTypeNotAvailableException If the provider doesn't support the request type * @throws NotSuccessfullyQueriedException If the provider has not been queried successfully before */
Get the latest version's game version (such as "CB 1.7.2-R0.3" or "1.9")
getLatestMinecraftVersion
{ "repo_name": "GeorgH93/Bukkit_Bungee_PluginLib", "path": "pcgf_pluginlib-common/src/at/pcgamingfreaks/Updater/UpdateProviders/UpdateProvider.java", "license": "gpl-3.0", "size": 7213 }
[ "org.jetbrains.annotations.NotNull" ]
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
2,421,296
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; }
void function(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; }
/** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */
Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms and legs can swing at most
setRotationAngles
{ "repo_name": "trixmot/mod1", "path": "build/tmp/recompileMc/sources/net/minecraft/client/model/ModelCreeper.java", "license": "lgpl-2.1", "size": 3622 }
[ "net.minecraft.entity.Entity", "net.minecraft.util.MathHelper" ]
import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper;
import net.minecraft.entity.*; import net.minecraft.util.*;
[ "net.minecraft.entity", "net.minecraft.util" ]
net.minecraft.entity; net.minecraft.util;
2,556,168
Header getHeader();
Header getHeader();
/** * Returns the value of the '<em><b>Header</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Header</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Header</em>' containment reference. * @see #setHeader(Header) * @see org.eclipse.papyrus.RobotMLLibraries.RobotML_ModelLibrary.RobotML_DataTypes.sensor_datatypes.Sensor_datatypesPackage#getCarLikeOdometry_Header() * @model containment="true" required="true" ordered="false" * @generated */
Returns the value of the 'Header' containment reference. If the meaning of the 'Header' containment reference isn't clear, there really should be more of a description here...
getHeader
{ "repo_name": "RobotML/RobotML-SDK-Juno", "path": "plugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotMLLibraries/RobotML_ModelLibrary/RobotML_DataTypes/sensor_datatypes/CarLikeOdometry.java", "license": "epl-1.0", "size": 9178 }
[ "org.eclipse.papyrus.RobotMLLibraries" ]
import org.eclipse.papyrus.RobotMLLibraries;
import org.eclipse.papyrus.*;
[ "org.eclipse.papyrus" ]
org.eclipse.papyrus;
1,006,532
public String[] getDisplayChoices() { if (displayChoices == null) { ResourceBundle b = interview.getResourceBundle(); if (b == null) return choices; else { displayChoices = new String[choices.length]; for (int i = 0; i < choices.length; i++) { String c = choices[i]; try { displayChoices[i] = (c == null ? null : b.getString(key + "." + c)); } catch (MissingResourceException e) { displayChoices[i] = c; } } } } return displayChoices; }
String[] function() { if (displayChoices == null) { ResourceBundle b = interview.getResourceBundle(); if (b == null) return choices; else { displayChoices = new String[choices.length]; for (int i = 0; i < choices.length; i++) { String c = choices[i]; try { displayChoices[i] = (c == null ? null : b.getString(key + "." + c)); } catch (MissingResourceException e) { displayChoices[i] = c; } } } } return displayChoices; }
/** * Get the display values for the set of legal responses for this question. * The display values will typically be different from the standard values * if they have been localized. * @return The display values for the set of possible responses for this question. * @see #setChoices * @see #getDisplayChoices */
Get the display values for the set of legal responses for this question. The display values will typically be different from the standard values if they have been localized
getDisplayChoices
{ "repo_name": "Distrotech/icedtea6-1.12", "path": "src/jtreg/com/sun/interview/ChoiceQuestion.java", "license": "gpl-2.0", "size": 11876 }
[ "java.util.MissingResourceException", "java.util.ResourceBundle" ]
import java.util.MissingResourceException; import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
1,954,917
public static long getLongParameter(PortletRequest request, String name, long defaultVal) { if (request.getParameter(name) == null) { return defaultVal; } try { return getRequiredLongParameter(request, name); } catch (PortletRequestBindingException ex) { return defaultVal; } }
static long function(PortletRequest request, String name, long defaultVal) { if (request.getParameter(name) == null) { return defaultVal; } try { return getRequiredLongParameter(request, name); } catch (PortletRequestBindingException ex) { return defaultVal; } }
/** * Get a long parameter, with a fallback value. Never throws an exception. * Can pass a distinguished value as default to enable checks of whether it was supplied. * @param request current portlet request * @param name the name of the parameter * @param defaultVal the default value to use as fallback */
Get a long parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied
getLongParameter
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/web/portlet/bind/PortletRequestUtils.java", "license": "unlicense", "size": 24504 }
[ "javax.portlet.PortletRequest" ]
import javax.portlet.PortletRequest;
import javax.portlet.*;
[ "javax.portlet" ]
javax.portlet;
2,462,291
public static boolean isJobDirValid(Path jobDirPath, FileSystem fs) throws IOException { FileStatus[] contents = fs.listStatus(jobDirPath); int matchCount = 0; if (contents != null && contents.length >= 2) { for (FileStatus status : contents) { if ("job.xml".equals(status.getPath().getName())) { ++matchCount; } if ("job.split".equals(status.getPath().getName())) { ++matchCount; } } if (matchCount == 2) { return true; } } return false; }
static boolean function(Path jobDirPath, FileSystem fs) throws IOException { FileStatus[] contents = fs.listStatus(jobDirPath); int matchCount = 0; if (contents != null && contents.length >= 2) { for (FileStatus status : contents) { if (STR.equals(status.getPath().getName())) { ++matchCount; } if (STR.equals(status.getPath().getName())) { ++matchCount; } } if (matchCount == 2) { return true; } } return false; }
/** * Checks if the job directory is clean and has all the required components * for (re) starting the job */
Checks if the job directory is clean and has all the required components for (re) starting the job
isJobDirValid
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java", "license": "apache-2.0", "size": 39030 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileStatus", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
210,085
@Override public void operatorUnregistered(OperatorDescription description) { String groupKey = description.getGroup(); String[] groupKeys = groupKey.split("\\."); GroupTree group = this; for (int i = 0; i < groupKeys.length && group != null; i++) { group = group.getSubGroup(groupKeys[i]); } if (group != null) { group.removeOperatorDescription(description); } }
void function(OperatorDescription description) { String groupKey = description.getGroup(); String[] groupKeys = groupKey.split("\\."); GroupTree group = this; for (int i = 0; i < groupKeys.length && group != null; i++) { group = group.getSubGroup(groupKeys[i]); } if (group != null) { group.removeOperatorDescription(description); } }
/** * This method will be called by the {@link OperatorService}, whenever an {@link Operator} has * been unregistered. */
This method will be called by the <code>OperatorService</code>, whenever an <code>Operator</code> has been unregistered
operatorUnregistered
{ "repo_name": "boob-sbcm/3838438", "path": "src/main/java/com/rapidminer/tools/GroupTreeRoot.java", "license": "agpl-3.0", "size": 5022 }
[ "com.rapidminer.operator.OperatorDescription" ]
import com.rapidminer.operator.OperatorDescription;
import com.rapidminer.operator.*;
[ "com.rapidminer.operator" ]
com.rapidminer.operator;
2,854,384
public boolean removeStat(int col) { if (col < 0 || col >= cols.size()) { return false; } else { // detach before removing a column detach(); Stat stat = cols.remove(col); raw.removeColumn(stat.getName()); stats.remove(stat); for (Entry<Stat,Integer> se : stats.entrySet()) { if (se.getValue() >= col) { se.setValue(se.getValue() - 1); } } return true; } }
boolean function(int col) { if (col < 0 col >= cols.size()) { return false; } else { detach(); Stat stat = cols.remove(col); raw.removeColumn(stat.getName()); stats.remove(stat); for (Entry<Stat,Integer> se : stats.entrySet()) { if (se.getValue() >= col) { se.setValue(se.getValue() - 1); } } return true; } }
/** * Remove a stat-column, by column index * @param col */
Remove a stat-column, by column index
removeStat
{ "repo_name": "manuel-freire/mn2", "path": "lib-manynets/src/main/java/edu/umd/cs/hcil/manynets/model/TableWrapper.java", "license": "lgpl-3.0", "size": 16539 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,280,392
public void addClasspath(File f) { classpath.add(f); }
void function(File f) { classpath.add(f); }
/** * Adds a jar file or class folder to the classpath * used for compilation. */
Adds a jar file or class folder to the classpath used for compilation
addClasspath
{ "repo_name": "kohsuke/sorcerer", "path": "core/src/main/java/org/jvnet/sorcerer/Analyzer.java", "license": "mit", "size": 8687 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
190,179
public void setToolbar(@NonNull Activity activity, @NonNull Toolbar toolbar) { setToolbar(activity, toolbar, false); }
void function(@NonNull Activity activity, @NonNull Toolbar toolbar) { setToolbar(activity, toolbar, false); }
/** * Sets the toolbar which should be used in combination with the drawer * This will handle the ActionBarDrawerToggle for you. * Do not set this if you are in a sub activity and want to handle the back arrow on your own * * @param activity * @param toolbar the toolbar which is used in combination with the drawer */
Sets the toolbar which should be used in combination with the drawer This will handle the ActionBarDrawerToggle for you. Do not set this if you are in a sub activity and want to handle the back arrow on your own
setToolbar
{ "repo_name": "MaTriXy/MaterialDrawer", "path": "library/src/main/java/com/mikepenz/materialdrawer/Drawer.java", "license": "apache-2.0", "size": 36601 }
[ "android.app.Activity", "androidx.annotation.NonNull", "androidx.appcompat.widget.Toolbar" ]
import android.app.Activity; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar;
import android.app.*; import androidx.annotation.*; import androidx.appcompat.widget.*;
[ "android.app", "androidx.annotation", "androidx.appcompat" ]
android.app; androidx.annotation; androidx.appcompat;
768,934