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
static ConfigDef getConfigDefFromTransformation(String key, Class<?> transformationCls) { if (transformationCls == null || !Transformation.class.isAssignableFrom(transformationCls)) { throw new ConfigException(key, String.valueOf(transformationCls), "Not a Transformation"); } try { return (transformationCls.asSubclass(Transformation.class).newInstance()).config(); } catch (Exception e) { throw new ConfigException(key, String.valueOf(transformationCls), "Error getting config definition from Transformation: " + e.getMessage()); } } static final class TransformationClassRecommender implements ConfigDef.Recommender { private final Plugins plugins; TransformationClassRecommender(Plugins plugins) { this.plugins = plugins; }
static ConfigDef getConfigDefFromTransformation(String key, Class<?> transformationCls) { if (transformationCls == null !Transformation.class.isAssignableFrom(transformationCls)) { throw new ConfigException(key, String.valueOf(transformationCls), STR); } try { return (transformationCls.asSubclass(Transformation.class).newInstance()).config(); } catch (Exception e) { throw new ConfigException(key, String.valueOf(transformationCls), STR + e.getMessage()); } } static final class TransformationClassRecommender implements ConfigDef.Recommender { private final Plugins plugins; TransformationClassRecommender(Plugins plugins) { this.plugins = plugins; }
/** * Return {@link ConfigDef} from {@code transformationCls}, which is expected to be a non-null {@code Class<Transformation>}, * by instantiating it and invoking {@link Transformation#config()}. */
Return <code>ConfigDef</code> from transformationCls, which is expected to be a non-null Class, by instantiating it and invoking <code>Transformation#config()</code>
getConfigDefFromTransformation
{ "repo_name": "wangcy6/storm_app", "path": "frame/kafka-0.11.0/kafka-0.11.0.1-src/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectorConfig.java", "license": "apache-2.0", "size": 12276 }
[ "org.apache.kafka.common.config.ConfigDef", "org.apache.kafka.common.config.ConfigException", "org.apache.kafka.connect.runtime.isolation.Plugins", "org.apache.kafka.connect.transforms.Transformation" ]
import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.connect.runtime.isolation.Plugins; import org.apache.kafka.connect.transforms.Transformation;
import org.apache.kafka.common.config.*; import org.apache.kafka.connect.runtime.isolation.*; import org.apache.kafka.connect.transforms.*;
[ "org.apache.kafka" ]
org.apache.kafka;
2,217,051
private static PathFragment trimTail(PathFragment path, PathFragment tail) { return path.subFragment(0, path.segmentCount() - tail.segmentCount()); }
static PathFragment function(PathFragment path, PathFragment tail) { return path.subFragment(0, path.segmentCount() - tail.segmentCount()); }
/** * Returns the root-part of a given path by trimming off the end specified by * a given tail. Assumes that the tail is known to match, and simply relies on * the segment lengths. */
Returns the root-part of a given path by trimming off the end specified by a given tail. Assumes that the tail is known to match, and simply relies on the segment lengths
trimTail
{ "repo_name": "whuwxl/bazel", "path": "src/main/java/com/google/devtools/build/lib/actions/Artifact.java", "license": "apache-2.0", "size": 32709 }
[ "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
1,037,441
public List<String> getContextRegisters() { return contextRegisters; }
List<String> function() { return contextRegisters; }
/** * Get a list of context registers tracked during data gathering * @return list of context registers */
Get a list of context registers tracked during data gathering
getContextRegisters
{ "repo_name": "NationalSecurityAgency/ghidra", "path": "Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/DataGatheringParams.java", "license": "apache-2.0", "size": 5150 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,720,375
public final boolean contains(float x, float y) { return new RectF(currBounds).contains(x, y); }
final boolean function(float x, float y) { return new RectF(currBounds).contains(x, y); }
/** * Check if the current bounds of the drawable contain the specified point. Great for tap detection! * * @param x x-coordinate * @param y y-coordinate * @return True if the coordinates are within the drawables' bounds, otherwise False */
Check if the current bounds of the drawable contain the specified point. Great for tap detection
contains
{ "repo_name": "greyski/TextDrawable", "path": "TextDrawable/src/main/java/com/fleksy/textdrawable/BaseDrawable.java", "license": "apache-2.0", "size": 10517 }
[ "android.graphics.RectF" ]
import android.graphics.RectF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
550,284
public View getNextFocusBackward() { return null; }
View function() { return null; }
/** * Get the view to be focused on a Shift + TAB click. If you return null, the default key event * processing will occur instead of attempting to focus. * @return The view to gain focus. */
Get the view to be focused on a Shift + TAB click. If you return null, the default key event processing will occur instead of attempting to focus
getNextFocusBackward
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/KeyboardNavigationListener.java", "license": "bsd-3-clause", "size": 2025 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,833,292
public void setPriceLastPO (BigDecimal PriceLastPO) { set_ValueNoCheck (COLUMNNAME_PriceLastPO, PriceLastPO); }
void function (BigDecimal PriceLastPO) { set_ValueNoCheck (COLUMNNAME_PriceLastPO, PriceLastPO); }
/** Set Last PO Price. @param PriceLastPO Price of the last purchase order for the product */
Set Last PO Price
setPriceLastPO
{ "repo_name": "itzamnamx/AdempiereFS", "path": "base/src/org/compiere/model/X_M_Product_PO.java", "license": "gpl-2.0", "size": 14483 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
973,681
@Test public void testValidateEndDate() { try { for(String emptyValue : ParameterSets.getEmptyValues()) { Assert.assertNull(CampaignValidators.validateEndDate(emptyValue)); } try { CampaignValidators.validateEndDate("Invalid value."); fail("The campaign end date was an invalid value."); } catch(ValidationException e) { // Passed. } Map<DateTime, String> dateToString = ParameterSets.getDateToString(); for(DateTime date : dateToString.keySet()) { Assert.assertEquals(date, CampaignValidators.validateEndDate(dateToString.get(date))); } Map<DateTime, String> dateTimeToString = ParameterSets.getDateTimeToString(); for(DateTime date : dateTimeToString.keySet()) { Assert.assertEquals(date, CampaignValidators.validateEndDate(dateTimeToString.get(date))); } } catch(ValidationException e) { fail("A validation exception was thrown: " + e.getMessage()); } }
void function() { try { for(String emptyValue : ParameterSets.getEmptyValues()) { Assert.assertNull(CampaignValidators.validateEndDate(emptyValue)); } try { CampaignValidators.validateEndDate(STR); fail(STR); } catch(ValidationException e) { } Map<DateTime, String> dateToString = ParameterSets.getDateToString(); for(DateTime date : dateToString.keySet()) { Assert.assertEquals(date, CampaignValidators.validateEndDate(dateToString.get(date))); } Map<DateTime, String> dateTimeToString = ParameterSets.getDateTimeToString(); for(DateTime date : dateTimeToString.keySet()) { Assert.assertEquals(date, CampaignValidators.validateEndDate(dateTimeToString.get(date))); } } catch(ValidationException e) { fail(STR + e.getMessage()); } }
/** * Test the end date validator. */
Test the end date validator
testValidateEndDate
{ "repo_name": "HaiJiaoXinHeng/server-1", "path": "test/org/ohmage/validator/CampaignValidatorsTest.java", "license": "apache-2.0", "size": 10535 }
[ "java.util.Map", "org.joda.time.DateTime", "org.junit.Assert", "org.ohmage.exception.ValidationException", "org.ohmage.test.ParameterSets" ]
import java.util.Map; import org.joda.time.DateTime; import org.junit.Assert; import org.ohmage.exception.ValidationException; import org.ohmage.test.ParameterSets;
import java.util.*; import org.joda.time.*; import org.junit.*; import org.ohmage.exception.*; import org.ohmage.test.*;
[ "java.util", "org.joda.time", "org.junit", "org.ohmage.exception", "org.ohmage.test" ]
java.util; org.joda.time; org.junit; org.ohmage.exception; org.ohmage.test;
292,269
@Override public HddsProtos.NodeState getNodeState(DatanodeDetails dd) { return null; }
HddsProtos.NodeState function(DatanodeDetails dd) { return null; }
/** * Returns the node state of a specific node. * * @param dd - DatanodeDetails * @return Healthy/Stale/Dead. */
Returns the node state of a specific node
getNodeState
{ "repo_name": "littlezhou/hadoop", "path": "hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java", "license": "apache-2.0", "size": 15911 }
[ "org.apache.hadoop.hdds.protocol.DatanodeDetails", "org.apache.hadoop.hdds.protocol.proto.HddsProtos" ]
import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.protocol.*; import org.apache.hadoop.hdds.protocol.proto.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,030,258
public CollectionEntry getCollectionEntry(PersistentCollection coll) { return (CollectionEntry) collectionEntries.get(coll); }
CollectionEntry function(PersistentCollection coll) { return (CollectionEntry) collectionEntries.get(coll); }
/** * Get the collection entry for a persistent collection */
Get the collection entry for a persistent collection
getCollectionEntry
{ "repo_name": "raedle/univis", "path": "lib/hibernate-3.1.3/src/org/hibernate/engine/StatefulPersistenceContext.java", "license": "lgpl-2.1", "size": 41008 }
[ "org.hibernate.collection.PersistentCollection" ]
import org.hibernate.collection.PersistentCollection;
import org.hibernate.collection.*;
[ "org.hibernate.collection" ]
org.hibernate.collection;
1,783,201
@Test public void testReportCounter_withJSONAndCountOnlyRequestAndReportPrefixNoContent() throws Exception { final StatsDClient client = Mockito.mock(StatsDClient.class); StatsdExtractedMetricsReporterConfiguration cfg = new StatsdExtractedMetricsReporterConfiguration("host", 8125, "prefix"); cfg.addMetricConfig(new StatsdMetricConfig("path.to.field", StatsdMetricType.COUNTER, new JsonContentReference(new String[]{"path","field"}, JsonContentType.INTEGER), true)); StatsdExtractedMetricsReporter reporter = new StatsdExtractedMetricsReporter(cfg); reporter.setStatsdClient(client); reporter.reportCounter(new StatsdMetricConfig("path.to.field", new JsonContentReference(new String[]{"prefix"}, JsonContentType.STRING), StatsdMetricType.COUNTER, new JsonContentReference(new String[]{"key"}, JsonContentType.INTEGER), false), new JSONObject("{\"prefix\":\"\",\"key\":123}")); Mockito.verify(client).incrementCounter("path.to.field"); }
void function() throws Exception { final StatsDClient client = Mockito.mock(StatsDClient.class); StatsdExtractedMetricsReporterConfiguration cfg = new StatsdExtractedMetricsReporterConfiguration("host", 8125, STR); cfg.addMetricConfig(new StatsdMetricConfig(STR, StatsdMetricType.COUNTER, new JsonContentReference(new String[]{"path","field"}, JsonContentType.INTEGER), true)); StatsdExtractedMetricsReporter reporter = new StatsdExtractedMetricsReporter(cfg); reporter.setStatsdClient(client); reporter.reportCounter(new StatsdMetricConfig(STR, new JsonContentReference(new String[]{STR}, JsonContentType.STRING), StatsdMetricType.COUNTER, new JsonContentReference(new String[]{"key"}, JsonContentType.INTEGER), false), new JSONObject("{\"prefix\":\"\",\"key\":123}")); Mockito.verify(client).incrementCounter(STR); }
/** * Test case for {@link StatsdExtractedMetricsReporter#reportCounter(StatsdMetricConfig, JSONObject)} being provided valid input but request to report no delta but count (with prefix but no content) */
Test case for <code>StatsdExtractedMetricsReporter#reportCounter(StatsdMetricConfig, JSONObject)</code> being provided valid input but request to report no delta but count (with prefix but no content)
testReportCounter_withJSONAndCountOnlyRequestAndReportPrefixNoContent
{ "repo_name": "ottogroup/flink-operator-library", "path": "src/test/java/com/ottogroup/bi/streaming/operator/json/statsd/StatsdExtractedMetricsReporterTest.java", "license": "apache-2.0", "size": 58212 }
[ "com.ottogroup.bi.streaming.operator.json.JsonContentReference", "com.ottogroup.bi.streaming.operator.json.JsonContentType", "com.timgroup.statsd.StatsDClient", "org.apache.sling.commons.json.JSONObject", "org.mockito.Mockito" ]
import com.ottogroup.bi.streaming.operator.json.JsonContentReference; import com.ottogroup.bi.streaming.operator.json.JsonContentType; import com.timgroup.statsd.StatsDClient; import org.apache.sling.commons.json.JSONObject; import org.mockito.Mockito;
import com.ottogroup.bi.streaming.operator.json.*; import com.timgroup.statsd.*; import org.apache.sling.commons.json.*; import org.mockito.*;
[ "com.ottogroup.bi", "com.timgroup.statsd", "org.apache.sling", "org.mockito" ]
com.ottogroup.bi; com.timgroup.statsd; org.apache.sling; org.mockito;
2,243,266
public SubResource managedDisk() { return this.managedDisk; }
SubResource function() { return this.managedDisk; }
/** * Get the managedDisk. * * @return the managedDisk value */
Get the managedDisk
managedDisk
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/compute/v2019_11_01/ImageDisk.java", "license": "mit", "size": 6919 }
[ "com.microsoft.azure.SubResource" ]
import com.microsoft.azure.SubResource;
import com.microsoft.azure.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
752,733
protected Path schemeWalk(String userPath, Map<String,Object> attributes, String filePath, int offset) { int length = filePath.length(); if (length <= offset || filePath.charAt(offset) != '(') return super.schemeWalk(userPath, attributes, filePath, offset); MergePath mergePath = new MergePath(); mergePath.setUserPath(userPath); int head = ++offset; int tail = head; while (tail < length) { int ch = filePath.charAt(tail); if (ch == ')') { if (head + 1 != tail) { String subPath = filePath.substring(head, tail); if (subPath.startsWith("(") && subPath.endsWith(")")) subPath = subPath.substring(1, subPath.length() - 1); mergePath.addMergePath(Vfs.lookup(subPath)); } if (tail + 1 == length) return mergePath; else return mergePath.fsWalk(userPath, attributes, filePath.substring(tail + 1)); } else if (ch == ';') { String subPath = filePath.substring(head, tail); if (subPath.startsWith("(") && subPath.endsWith(")")) subPath = subPath.substring(1, subPath.length() - 1); mergePath.addMergePath(Vfs.lookup(subPath)); head = ++tail; } else if (ch == '(') { int depth = 1; for (tail++; tail < length; tail++) { if (filePath.charAt(tail) == '(') depth++; else if (filePath.charAt(tail) == ')') { tail++; depth--; if (depth == 0) break; } } if (depth != 0) return new NotFoundPath(getSchemeMap(), filePath); } else tail++; } return new NotFoundPath(getSchemeMap(), filePath); }
Path function(String userPath, Map<String,Object> attributes, String filePath, int offset) { int length = filePath.length(); if (length <= offset filePath.charAt(offset) != '(') return super.schemeWalk(userPath, attributes, filePath, offset); MergePath mergePath = new MergePath(); mergePath.setUserPath(userPath); int head = ++offset; int tail = head; while (tail < length) { int ch = filePath.charAt(tail); if (ch == ')') { if (head + 1 != tail) { String subPath = filePath.substring(head, tail); if (subPath.startsWith("(") && subPath.endsWith(")")) subPath = subPath.substring(1, subPath.length() - 1); mergePath.addMergePath(Vfs.lookup(subPath)); } if (tail + 1 == length) return mergePath; else return mergePath.fsWalk(userPath, attributes, filePath.substring(tail + 1)); } else if (ch == ';') { String subPath = filePath.substring(head, tail); if (subPath.startsWith("(") && subPath.endsWith(")")) subPath = subPath.substring(1, subPath.length() - 1); mergePath.addMergePath(Vfs.lookup(subPath)); head = ++tail; } else if (ch == '(') { int depth = 1; for (tail++; tail < length; tail++) { if (filePath.charAt(tail) == '(') depth++; else if (filePath.charAt(tail) == ')') { tail++; depth--; if (depth == 0) break; } } if (depth != 0) return new NotFoundPath(getSchemeMap(), filePath); } else tail++; } return new NotFoundPath(getSchemeMap(), filePath); }
/** * schemeWalk is called by Path for a scheme lookup like file:/tmp/foo * * @param userPath the user's lookup() path * @param attributes the user's attributes * @param filePath the actual lookup() path * @param offset offset into filePath */
schemeWalk is called by Path for a scheme lookup like file:/tmp/foo
schemeWalk
{ "repo_name": "CleverCloud/Quercus", "path": "resin/src/main/java/com/caucho/vfs/MergePath.java", "license": "gpl-2.0", "size": 17450 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
219,286
public static Method findReadMethod(Object o, String name) { Class[] params; Method result; result = null; params = new Class[1]; params[0] = Element.class; try { result = o.getClass().getMethod(name, params); } catch (Exception e) { result = null; } return result; }
static Method function(Object o, String name) { Class[] params; Method result; result = null; params = new Class[1]; params[0] = Element.class; try { result = o.getClass().getMethod(name, params); } catch (Exception e) { result = null; } return result; }
/** * returns the method with the given name that has the same signature as * <code>readFromXML()</code> of the <code>XMLSerialiation</code> class. * simplifies the adding of custom methods. * * @param o the object to inspect * @param name the name of the method to return * @return either <code>null</code> if no method was found or a reference * @see XMLSerialization#readFromXML(Element) */
returns the method with the given name that has the same signature as <code>readFromXML()</code> of the <code>XMLSerialiation</code> class. simplifies the adding of custom methods
findReadMethod
{ "repo_name": "dsibournemouth/autoweka", "path": "weka-3.7.7/src/main/java/weka/core/xml/XMLSerializationMethodHandler.java", "license": "gpl-3.0", "size": 8394 }
[ "java.lang.reflect.Method", "org.w3c.dom.Element" ]
import java.lang.reflect.Method; import org.w3c.dom.Element;
import java.lang.reflect.*; import org.w3c.dom.*;
[ "java.lang", "org.w3c.dom" ]
java.lang; org.w3c.dom;
730,279
public final MetaProperty<Double> annualizationFactor() { return _annualizationFactor; }
final MetaProperty<Double> function() { return _annualizationFactor; }
/** * The meta-property for the {@code annualizationFactor} property. * @return the meta-property, not null */
The meta-property for the annualizationFactor property
annualizationFactor
{ "repo_name": "DevStreet/FinanceAnalytics", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/swap/FloatingVarianceSwapLeg.java", "license": "apache-2.0", "size": 11943 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,550,820
@Override public void enterGenericInterfaceMethodDeclaration(@NotNull PJParser.GenericInterfaceMethodDeclarationContext ctx) { }
@Override public void enterGenericInterfaceMethodDeclaration(@NotNull PJParser.GenericInterfaceMethodDeclarationContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitBreakRule
{ "repo_name": "Diolor/PJ", "path": "src/main/java/com/lorentzos/pj/PJBaseListener.java", "license": "mit", "size": 73292 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
782,644
public List<RMNodeSourceEvent> getExistingNodeSourcesList() { return getRMInitialState().getNodeSource(); } /** * {@inheritDoc}
List<RMNodeSourceEvent> function() { return getRMInitialState().getNodeSource(); } /** * {@inheritDoc}
/** * Gives list of existing Node Sources * * @return list of existing Node Sources */
Gives list of existing Node Sources
getExistingNodeSourcesList
{ "repo_name": "marcocast/scheduling", "path": "rm/rm-server/src/main/java/org/ow2/proactive/resourcemanager/core/RMCore.java", "license": "agpl-3.0", "size": 97022 }
[ "java.util.List", "org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent" ]
import java.util.List; import org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent;
import java.util.*; import org.ow2.proactive.resourcemanager.common.event.*;
[ "java.util", "org.ow2.proactive" ]
java.util; org.ow2.proactive;
1,820,221
public ReflogWriter log(final String refName, final ReflogEntry entry) throws IOException { return log(refName, entry.getOldId(), entry.getNewId(), entry.getWho(), entry.getComment()); }
ReflogWriter function(final String refName, final ReflogEntry entry) throws IOException { return log(refName, entry.getOldId(), entry.getNewId(), entry.getWho(), entry.getComment()); }
/** * Write the given {@link ReflogEntry} entry to the ref's log * * @param refName * * @param entry * @return this writer * @throws IOException */
Write the given <code>ReflogEntry</code> entry to the ref's log
log
{ "repo_name": "forge/plugin-undo", "path": "src/main/jgit/org/jboss/forge/jgit/storage/file/ReflogWriter.java", "license": "epl-1.0", "size": 8884 }
[ "java.io.IOException", "org.jboss.forge.jgit.storage.file.ReflogEntry", "org.jboss.forge.jgit.storage.file.ReflogWriter" ]
import java.io.IOException; import org.jboss.forge.jgit.storage.file.ReflogEntry; import org.jboss.forge.jgit.storage.file.ReflogWriter;
import java.io.*; import org.jboss.forge.jgit.storage.file.*;
[ "java.io", "org.jboss.forge" ]
java.io; org.jboss.forge;
612,840
public void setApprovalProcessDefinitionNameOrId(final String processDefinitionNameOrId) { if (approval == null) { approval = new ApprovalRequest(); } approval.setProcessDefinitionNameOrId(processDefinitionNameOrId); }
void function(final String processDefinitionNameOrId) { if (approval == null) { approval = new ApprovalRequest(); } approval.setProcessDefinitionNameOrId(processDefinitionNameOrId); }
/** * The developer name or ID of the process definition. * * @param processDefinitionNameOrId */
The developer name or ID of the process definition
setApprovalProcessDefinitionNameOrId
{ "repo_name": "acartapanis/camel", "path": "components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java", "license": "apache-2.0", "size": 24193 }
[ "org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest" ]
import org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest;
import org.apache.camel.component.salesforce.api.dto.approval.*;
[ "org.apache.camel" ]
org.apache.camel;
1,793,674
public List<ParticipantRune> getRunes() { if(runes == null) { runes = new ArrayList<>(); for(final com.robrua.orianna.type.dto.match.Rune rune : data.getParticipant().getRunes()) { runes.add(new ParticipantRune(rune)); } } return Collections.unmodifiableList(runes); }
List<ParticipantRune> function() { if(runes == null) { runes = new ArrayList<>(); for(final com.robrua.orianna.type.dto.match.Rune rune : data.getParticipant().getRunes()) { runes.add(new ParticipantRune(rune)); } } return Collections.unmodifiableList(runes); }
/** * List of rune information * * @return list of rune information */
List of rune information
getRunes
{ "repo_name": "sagiyemi/Orianna", "path": "src/com/robrua/orianna/type/core/match/Participant.java", "license": "mit", "size": 8967 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,232,877
public void createLoader() { if (this.loader == null) { this.loader = new Loader(this); } this.classLoader = new InjectedClassLoader(Thread.currentThread().getContextClassLoader(), loader); } /** * Gets the {@link se.jkrau.mclib.loader.Loader} for this MCLib injection.<br /><br /> * <p/> * <strong>Warning:</strong> There is no use case of getting the loader! But use at your own risk anyways. * * @return {@link se.jkrau.mclib.loader.Loader}
void function() { if (this.loader == null) { this.loader = new Loader(this); } this.classLoader = new InjectedClassLoader(Thread.currentThread().getContextClassLoader(), loader); } /** * Gets the {@link se.jkrau.mclib.loader.Loader} for this MCLib injection.<br /><br /> * <p/> * <strong>Warning:</strong> There is no use case of getting the loader! But use at your own risk anyways. * * @return {@link se.jkrau.mclib.loader.Loader}
/** * Creates the {@link se.jkrau.mclib.loader.Loader} with all the arguments provided so far.<br /><br /> * <p/> * <strong>Warning: Without invoking this method, any injected crafts will not take effect!</strong><br /> * <strong>Warning:</strong> Any new craft calls will require this method to be invoked again! */
Creates the <code>se.jkrau.mclib.loader.Loader</code> with all the arguments provided so far. Warning: Without invoking this method, any injected crafts will not take effect! Warning: Any new craft calls will require this method to be invoked again
createLoader
{ "repo_name": "SuperSpyTX/MCLib", "path": "src/se/jkrau/mclib/MCLib.java", "license": "mit", "size": 6736 }
[ "se.jkrau.mclib.loader.InjectedClassLoader", "se.jkrau.mclib.loader.Loader" ]
import se.jkrau.mclib.loader.InjectedClassLoader; import se.jkrau.mclib.loader.Loader;
import se.jkrau.mclib.loader.*;
[ "se.jkrau.mclib" ]
se.jkrau.mclib;
1,884,947
public void setStyleName(String styleName) { this.styleName = styleName; section.requestSectionRefresh(); } } public abstract static class StaticRow<CELLTYPE extends StaticCell> { private Map<Column<?, ?>, CELLTYPE> cells = new HashMap<Column<?, ?>, CELLTYPE>(); private StaticSection<?> section; private Map<Set<Column<?, ?>>, CELLTYPE> cellGroups = new HashMap<Set<Column<?, ?>>, CELLTYPE>(); private String styleName = null;
void function(String styleName) { this.styleName = styleName; section.requestSectionRefresh(); } } public abstract static class StaticRow<CELLTYPE extends StaticCell> { private Map<Column<?, ?>, CELLTYPE> cells = new HashMap<Column<?, ?>, CELLTYPE>(); private StaticSection<?> section; private Map<Set<Column<?, ?>>, CELLTYPE> cellGroups = new HashMap<Set<Column<?, ?>>, CELLTYPE>(); private String styleName = null;
/** * Sets a custom style name for this cell. * * @param styleName * the style name to set or null to not use any style * name */
Sets a custom style name for this cell
setStyleName
{ "repo_name": "synes/vaadin", "path": "client/src/com/vaadin/client/widgets/Grid.java", "license": "apache-2.0", "size": 301824 }
[ "com.vaadin.client.widgets.Grid", "java.util.HashMap", "java.util.Map", "java.util.Set" ]
import com.vaadin.client.widgets.Grid; import java.util.HashMap; import java.util.Map; import java.util.Set;
import com.vaadin.client.widgets.*; import java.util.*;
[ "com.vaadin.client", "java.util" ]
com.vaadin.client; java.util;
329,657
private static String getLabel(ArgumentComponent argumentComponent, Token token) { StringBuilder sb = new StringBuilder(); // Does the component begin here? if (argumentComponent.getBegin() == token.getBegin()) { sb.append("B-"); } else { sb.append("I-"); } sb.append(argumentComponent.getClass().getSimpleName()); return sb.toString(); }
static String function(ArgumentComponent argumentComponent, Token token) { StringBuilder sb = new StringBuilder(); if (argumentComponent.getBegin() == token.getBegin()) { sb.append("B-"); } else { sb.append("I-"); } sb.append(argumentComponent.getClass().getSimpleName()); return sb.toString(); }
/** * Returns a label for the annotated token * * @param argumentComponent covering argument component * @param token token * @return BIO label */
Returns a label for the annotated token
getLabel
{ "repo_name": "habernal/emnlp2015", "path": "code/experiments/src/main/java/de/tudarmstadt/ukp/experiments/argumentation/sequence/ArgumentLabelSequenceCreator.java", "license": "apache-2.0", "size": 4072 }
[ "de.tudarmstadt.ukp.dkpro.argumentation.types.ArgumentComponent", "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token" ]
import de.tudarmstadt.ukp.dkpro.argumentation.types.ArgumentComponent; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import de.tudarmstadt.ukp.dkpro.argumentation.types.*; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.*;
[ "de.tudarmstadt.ukp" ]
de.tudarmstadt.ukp;
2,208,443
public int toResizeDirection() { switch (this) { case RIGHT: return IResizeShapeContext.DIRECTION_EAST; case LEFT: return IResizeShapeContext.DIRECTION_WEST; case TOP_LEFT: return IResizeShapeContext.DIRECTION_NORTH_WEST; case TOP: return IResizeShapeContext.DIRECTION_NORTH; case TOP_RIGHT: return IResizeShapeContext.DIRECTION_NORTH_EAST; case BOTTOM_LEFT: return IResizeShapeContext.DIRECTION_SOUTH_WEST; case BOTTOM: return IResizeShapeContext.DIRECTION_SOUTH; case BOTTOM_RIGHT: return IResizeShapeContext.DIRECTION_SOUTH_EAST; default: return IResizeShapeContext.DIRECTION_UNSPECIFIED; } } } public static class BBox { private Integer x1 = null; private Integer y1 = null; private Integer x2 = null; private Integer y2 = null; private int paddingX = 0; private int paddingY = 0; public BBox(int paddingX, int paddingY) { this.paddingX = paddingX; this.paddingY = paddingY; } public BBox(IRectangle initialBounds, int paddingX, int paddingY) { if (initialBounds != null) { this.x1 = getX1(initialBounds); this.y1 = getY1(initialBounds); this.x2 = getX2(initialBounds); this.y2 = getY2(initialBounds); } this.paddingX = paddingX; this.paddingY = paddingY; }
int function() { switch (this) { case RIGHT: return IResizeShapeContext.DIRECTION_EAST; case LEFT: return IResizeShapeContext.DIRECTION_WEST; case TOP_LEFT: return IResizeShapeContext.DIRECTION_NORTH_WEST; case TOP: return IResizeShapeContext.DIRECTION_NORTH; case TOP_RIGHT: return IResizeShapeContext.DIRECTION_NORTH_EAST; case BOTTOM_LEFT: return IResizeShapeContext.DIRECTION_SOUTH_WEST; case BOTTOM: return IResizeShapeContext.DIRECTION_SOUTH; case BOTTOM_RIGHT: return IResizeShapeContext.DIRECTION_SOUTH_EAST; default: return IResizeShapeContext.DIRECTION_UNSPECIFIED; } } } public static class BBox { private Integer x1 = null; private Integer y1 = null; private Integer x2 = null; private Integer y2 = null; private int paddingX = 0; private int paddingY = 0; public BBox(int paddingX, int paddingY) { this.paddingX = paddingX; this.paddingY = paddingY; } public BBox(IRectangle initialBounds, int paddingX, int paddingY) { if (initialBounds != null) { this.x1 = getX1(initialBounds); this.y1 = getY1(initialBounds); this.x2 = getX2(initialBounds); this.y2 = getY2(initialBounds); } this.paddingX = paddingX; this.paddingY = paddingY; }
/** * Translate the sector to a resize direction. * * @return */
Translate the sector to a resize direction
toResizeDirection
{ "repo_name": "camunda/camunda-eclipse-plugin", "path": "org.camunda.bpm.modeler/src/org/camunda/bpm/modeler/core/layout/util/LayoutUtil.java", "license": "epl-1.0", "size": 45536 }
[ "org.eclipse.graphiti.datatypes.IRectangle", "org.eclipse.graphiti.features.context.IResizeShapeContext" ]
import org.eclipse.graphiti.datatypes.IRectangle; import org.eclipse.graphiti.features.context.IResizeShapeContext;
import org.eclipse.graphiti.datatypes.*; import org.eclipse.graphiti.features.context.*;
[ "org.eclipse.graphiti" ]
org.eclipse.graphiti;
949,797
Locale getLocale() { return (this.locale); }
Locale getLocale() { return (this.locale); }
/** * <p>Return the <code>Locale</code> we object we are wrapping.</p> */
Return the <code>Locale</code> we object we are wrapping
getLocale
{ "repo_name": "codelibs/cl-struts", "path": "contrib/struts-faces/core-library/src/java/org/apache/struts/faces/util/MessagesMap.java", "license": "apache-2.0", "size": 6714 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
784,733
private JMenu makeMenu(String name, char mnemonic) { JMenu menu = new JMenu(name); menu.setMnemonic(mnemonic); return menu; }
JMenu function(String name, char mnemonic) { JMenu menu = new JMenu(name); menu.setMnemonic(mnemonic); return menu; }
/** * Make individual menu. * * @param name the menu name * @param mnemonic the shortcut key * @return the instance of <code>JMenu</code> */
Make individual menu
makeMenu
{ "repo_name": "halayudha/bearded-octo-bugfixes", "path": "BestPeerDevelop/sg/edu/nus/gui/bootstrap/MenuBar.java", "license": "gpl-3.0", "size": 11827 }
[ "javax.swing.JMenu" ]
import javax.swing.JMenu;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,031,187
@Method(selector = "send:") public void send (NSDictionary<NSString, NSString> parameters);
@Method(selector = "send:") void function (NSDictionary<NSString, NSString> parameters);
/** Queue tracking information with the given parameter values. * * @param parameters A map from parameter names to parameter values which will be set just for this piece of tracking * information, or {@code null} for none. */
Queue tracking information with the given parameter values
send
{ "repo_name": "dzungpv/robovm-ios-bindings", "path": "google-analytics/src/org/robovm/bindings/googleanalytics/GAITracker.java", "license": "apache-2.0", "size": 1662 }
[ "org.robovm.apple.foundation.NSDictionary", "org.robovm.apple.foundation.NSString", "org.robovm.objc.annotation.Method" ]
import org.robovm.apple.foundation.NSDictionary; import org.robovm.apple.foundation.NSString; import org.robovm.objc.annotation.Method;
import org.robovm.apple.foundation.*; import org.robovm.objc.annotation.*;
[ "org.robovm.apple", "org.robovm.objc" ]
org.robovm.apple; org.robovm.objc;
536,086
protected GenericArtifact getAPIArtifact(APIIdentifier apiIdentifier) throws APIManagementException { return APIUtil.getAPIArtifact(apiIdentifier, registry); }
GenericArtifact function(APIIdentifier apiIdentifier) throws APIManagementException { return APIUtil.getAPIArtifact(apiIdentifier, registry); }
/** * To get the API artifact from the registry * * @param apiIdentifier API den * @return API artifact, if the relevant artifact exists * @throws APIManagementException API Management Exception. */
To get the API artifact from the registry
getAPIArtifact
{ "repo_name": "wso2/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java", "license": "apache-2.0", "size": 501725 }
[ "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.APIIdentifier", "org.wso2.carbon.apimgt.impl.utils.APIUtil", "org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact" ]
import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact;
import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.governance.api.generic.dataobjects.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,106,751
public Semaphore getSemaphore() { return this.sem; }
Semaphore function() { return this.sem; }
/** * Returns the waiting semaphore of the request. * * @return The waiting semaphore of the request. */
Returns the waiting semaphore of the request
getSemaphore
{ "repo_name": "mF2C/COMPSs", "path": "compss/runtime/engine/src/main/java/es/bsc/compss/types/request/ap/IsObjectHereRequest.java", "license": "apache-2.0", "size": 2216 }
[ "java.util.concurrent.Semaphore" ]
import java.util.concurrent.Semaphore;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,857,191
public static <T0, T1> T1 thread( T0 t, Function<T0, T1> f){ return f.apply(t); }
static <T0, T1> T1 function( T0 t, Function<T0, T1> f){ return f.apply(t); }
/** * t is applied to f */
t is applied to f
thread
{ "repo_name": "stefanvstein/stonehorse.candy", "path": "src/main/java/stonehorse/candy/Threading.java", "license": "mit", "size": 26339 }
[ "java.util.function.Function" ]
import java.util.function.Function;
import java.util.function.*;
[ "java.util" ]
java.util;
2,844,436
public static byte[] compress(byte[] uncompressedData) { byte[] data; // create a temporary byte array big enough to hold the compressed data // with the worst compression (the length of the initial (uncompressed) data) byte[] temp = new byte[uncompressedData.length]; // compress Deflater compresser = new Deflater(); compresser.setInput(uncompressedData); compresser.finish(); int cdl = compresser.deflate(temp); // create a new array with the size of the compressed data (cdl) data = new byte[cdl]; System.arraycopy(temp, 0, data, 0, cdl); return data; }
static byte[] function(byte[] uncompressedData) { byte[] data; byte[] temp = new byte[uncompressedData.length]; Deflater compresser = new Deflater(); compresser.setInput(uncompressedData); compresser.finish(); int cdl = compresser.deflate(temp); data = new byte[cdl]; System.arraycopy(temp, 0, data, 0, cdl); return data; }
/** * Compresses a byte array using the ZLIB compression library. * * @param uncompressedData the compressed byte array * @return the compressed byte array */
Compresses a byte array using the ZLIB compression library
compress
{ "repo_name": "tomas-pluskal/masscascade", "path": "MassCascadeCore/src/main/java/uk/ac/ebi/masscascade/utilities/ScanUtils.java", "license": "gpl-3.0", "size": 12663 }
[ "java.util.zip.Deflater" ]
import java.util.zip.Deflater;
import java.util.zip.*;
[ "java.util" ]
java.util;
1,771,679
return Tassel5HDF5Constants.BLOCK_SIZE; }
return Tassel5HDF5Constants.BLOCK_SIZE; }
/** * Returns the size of HDF5 block * @return */
Returns the size of HDF5 block
getBlockSize
{ "repo_name": "yzhnasa/TASSEL-iRods", "path": "src/net/maizegenetics/dna/tag/AbstractTagsHDF5.java", "license": "mit", "size": 5903 }
[ "net.maizegenetics.util.Tassel5HDF5Constants" ]
import net.maizegenetics.util.Tassel5HDF5Constants;
import net.maizegenetics.util.*;
[ "net.maizegenetics.util" ]
net.maizegenetics.util;
1,346,234
public void testCallable2() throws Exception { Callable c = Executors.callable(new NoOpRunnable(), one); assertSame(one, c.call()); }
void function() throws Exception { Callable c = Executors.callable(new NoOpRunnable(), one); assertSame(one, c.call()); }
/** * callable(Runnable, result) returns result when called */
callable(Runnable, result) returns result when called
testCallable2
{ "repo_name": "google/desugar_jdk_libs", "path": "jdk11/src/libcore/ojluni/src/test/java/util/concurrent/tck/ExecutorsTest.java", "license": "gpl-2.0", "size": 23797 }
[ "java.util.concurrent.Callable", "java.util.concurrent.Executors" ]
import java.util.concurrent.Callable; import java.util.concurrent.Executors;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,312,084
@Deprecated public void writeUnknownGroup(final int fieldNumber, final MessageLite value) throws IOException { writeGroup(fieldNumber, value); }
void function(final int fieldNumber, final MessageLite value) throws IOException { writeGroup(fieldNumber, value); }
/** * Write a group represented by an {@link UnknownFieldSet}. * * @deprecated UnknownFieldSet now implements MessageLite, so you can just * call {@link #writeGroup}. */
Write a group represented by an <code>UnknownFieldSet</code>
writeUnknownGroup
{ "repo_name": "BozhkoAlexander/mtasa-blue", "path": "vendor/google-breakpad/src/third_party/protobuf/protobuf/java/src/main/java/com/google/protobuf/CodedOutputStream.java", "license": "gpl-3.0", "size": 38057 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
737,776
public void copyFileToStateDir(String name, File f);
void function(String name, File f);
/** * Copies the file to the State Directory * * @param name name of the file to write * @param f source file */
Copies the file to the State Directory
copyFileToStateDir
{ "repo_name": "fredizzimo/keyboardlayout", "path": "smac/src/aeatk/ca/ubc/cs/beta/aeatk/state/StateFactory.java", "license": "gpl-2.0", "size": 2654 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,805,891
@Override protected void SerializePayload(OutputStream o) throws IOException { DataOutputStream dos = new DataOutputStream(o); dos.writeInt(v.length); for (int i : v) { dos.writeInt(i); } }
void function(OutputStream o) throws IOException { DataOutputStream dos = new DataOutputStream(o); dos.writeInt(v.length); for (int i : v) { dos.writeInt(i); } }
/** * Serializes the integer array to the <code>OutputStream</code>. * * @param o The <code>OutputStream</code> to serialize this integer * array to. * @throws IOException if the output operation generates an exception. */
Serializes the integer array to the <code>OutputStream</code>
SerializePayload
{ "repo_name": "skunkiferous/SMEdit", "path": "jo_plugin/src/main/java/jo/sm/plugins/ship/imp/nbt/Tag.java", "license": "apache-2.0", "size": 53231 }
[ "java.io.DataOutputStream", "java.io.IOException", "java.io.OutputStream" ]
import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,253,749
boolean gtk_places_sidebar_get_local_only(GtkPlacesSidebar sidebar);
boolean gtk_places_sidebar_get_local_only(GtkPlacesSidebar sidebar);
/** * Returns the value previously set with gtk_places_sidebar_set_local_only(). * * @param sidebar a places sidebar * @return TRUE if the sidebar will only show local files. */
Returns the value previously set with gtk_places_sidebar_set_local_only()
gtk_places_sidebar_get_local_only
{ "repo_name": "Ccook/gtk-java-bindings", "path": "src/main/java/com/github/ccook/gtk/library/object/widget/container/bin/scrolledwindow/GtkPlacesSidebarLibrary.java", "license": "apache-2.0", "size": 11211 }
[ "com.github.ccook.gtk.model.object.widget.container.bin.scrolledwindow.GtkPlacesSidebar" ]
import com.github.ccook.gtk.model.object.widget.container.bin.scrolledwindow.GtkPlacesSidebar;
import com.github.ccook.gtk.model.object.widget.container.bin.scrolledwindow.*;
[ "com.github.ccook" ]
com.github.ccook;
1,958,650
private void binaryEventPublish() { Properties props = new Properties(); try { props.load(ApplicationEventSubscriptionTest.class.getResourceAsStream(DEVICE_PROPERTIES_FILE)); } catch (IOException e1) { System.err.println("Not able to read the properties file, exiting.."); return; } DeviceClient myClient = null; try { //Instantiate the class by passing the properties file myClient = new DeviceClient(props); myClient.connect(); } catch (Exception e) { System.out.println(""+e.getMessage()); // Looks like the properties file is not udpated, just ignore; return; } byte[] payload = {1, 4, 5, 6, 7, 9, 10}; try { myClient.publishEvent("blink", payload, "binary", 2); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } myClient.disconnect(); }
void function() { Properties props = new Properties(); try { props.load(ApplicationEventSubscriptionTest.class.getResourceAsStream(DEVICE_PROPERTIES_FILE)); } catch (IOException e1) { System.err.println(STR); return; } DeviceClient myClient = null; try { myClient = new DeviceClient(props); myClient.connect(); } catch (Exception e) { System.out.println(STRblinkSTRbinary", 2); } catch (Exception e) { e.printStackTrace(); } myClient.disconnect(); }
/** * This method publishes a device event such that the application will receive the same * and verifies that the event is same. */
This method publishes a device event such that the application will receive the same and verifies that the event is same
binaryEventPublish
{ "repo_name": "sathipal/iot-java", "path": "src/test/java/com/ibm/iotf/client/application/ApplicationEventSubscriptionTest.java", "license": "epl-1.0", "size": 39821 }
[ "com.ibm.iotf.client.device.DeviceClient", "java.io.IOException", "java.util.Properties" ]
import com.ibm.iotf.client.device.DeviceClient; import java.io.IOException; import java.util.Properties;
import com.ibm.iotf.client.device.*; import java.io.*; import java.util.*;
[ "com.ibm.iotf", "java.io", "java.util" ]
com.ibm.iotf; java.io; java.util;
227,469
public static java.util.Set extractVitalSignsSet(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.VitalSignsWebServiceVoCollection voCollection) { return extractVitalSignsSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.VitalSignsWebServiceVoCollection voCollection) { return extractVitalSignsSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.core.vitals.domain.objects.VitalSigns 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.core.vitals.domain.objects.VitalSigns set from the value object collection
extractVitalSignsSet
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/VitalSignsWebServiceVoAssembler.java", "license": "agpl-3.0", "size": 21713 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
553,135
public Collection<CacheTypeMetadata> getTypeMetadata() { return typeMeta; }
Collection<CacheTypeMetadata> function() { return typeMeta; }
/** * Gets collection of type metadata objects. * * @return Collection of type metadata. */
Gets collection of type metadata objects
getTypeMetadata
{ "repo_name": "leveyj/ignite", "path": "modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java", "license": "apache-2.0", "size": 96148 }
[ "java.util.Collection", "org.apache.ignite.cache.CacheTypeMetadata" ]
import java.util.Collection; import org.apache.ignite.cache.CacheTypeMetadata;
import java.util.*; import org.apache.ignite.cache.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
639,193
public static byte[] getBytesFromFile(String fileName) throws FileNotFoundException, IOException { byte refBytes[] = null; FileInputStream fisRef = null; UnsyncByteArrayOutputStream baos = null; try { fisRef = new FileInputStream(fileName); baos = new UnsyncByteArrayOutputStream(); byte buf[] = new byte[1024]; int len; while ((len = fisRef.read(buf)) > 0) { baos.write(buf, 0, len); } refBytes = baos.toByteArray(); } finally { if (baos != null) { baos.close(); } if (fisRef != null) { fisRef.close(); } } return refBytes; }
static byte[] function(String fileName) throws FileNotFoundException, IOException { byte refBytes[] = null; FileInputStream fisRef = null; UnsyncByteArrayOutputStream baos = null; try { fisRef = new FileInputStream(fileName); baos = new UnsyncByteArrayOutputStream(); byte buf[] = new byte[1024]; int len; while ((len = fisRef.read(buf)) > 0) { baos.write(buf, 0, len); } refBytes = baos.toByteArray(); } finally { if (baos != null) { baos.close(); } if (fisRef != null) { fisRef.close(); } } return refBytes; }
/** * Method getBytesFromFile * * @param fileName * @return the bytes read from the file * * @throws FileNotFoundException * @throws IOException */
Method getBytesFromFile
getBytesFromFile
{ "repo_name": "Taichi-SHINDO/jdk9-jdk", "path": "src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java", "license": "gpl-2.0", "size": 8589 }
[ "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.IOException" ]
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,121,912
public Column setRenderer(Renderer<?> renderer) { if (!internalSetRenderer(renderer)) { throw new IllegalArgumentException( "Could not find a converter for converting from the model type " + getModelType() + " to the renderer presentation type " + renderer.getPresentationType() + " (in " + toString() + ")"); } return this; }
Column function(Renderer<?> renderer) { if (!internalSetRenderer(renderer)) { throw new IllegalArgumentException( STR + getModelType() + STR + renderer.getPresentationType() + STR + toString() + ")"); } return this; }
/** * Sets the renderer for this column. * <p> * If a suitable converter isn't defined explicitly, the session * converter factory is used to find a compatible converter. * * @param renderer * the renderer to use * @return the column itself * * @throws IllegalArgumentException * if no compatible converter could be found * * @see VaadinSession#getConverterFactory() * @see ConverterUtil#getConverter(Class, Class, VaadinSession) * @see #setConverter(Converter) */
Sets the renderer for this column. If a suitable converter isn't defined explicitly, the session converter factory is used to find a compatible converter
setRenderer
{ "repo_name": "synes/vaadin", "path": "server/src/com/vaadin/ui/Grid.java", "license": "apache-2.0", "size": 239096 }
[ "com.vaadin.ui.renderers.Renderer" ]
import com.vaadin.ui.renderers.Renderer;
import com.vaadin.ui.renderers.*;
[ "com.vaadin.ui" ]
com.vaadin.ui;
1,974,301
public static byte[] getBytesUtf8(String input) { return input.getBytes(Charsets.UTF_8); }
static byte[] function(String input) { return input.getBytes(Charsets.UTF_8); }
/** * Returns the UTF-8 encoded byte[] representation of a String. * @param input input string * @return UTF-8 encoded byte array */
Returns the UTF-8 encoded byte[] representation of a String
getBytesUtf8
{ "repo_name": "LorenzReinhart/ONOSnew", "path": "utils/misc/src/main/java/org/onlab/util/Tools.java", "license": "apache-2.0", "size": 30536 }
[ "com.google.common.base.Charsets" ]
import com.google.common.base.Charsets;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,741,291
Block[] getFileBlocks(String src) throws UnresolvedLinkException { waitForReady(); synchronized (rootDir) { INode targetNode = rootDir.getNode(src, false); if (targetNode == null) return null; if (targetNode.isDirectory()) return null; if (targetNode.isLink()) return null; return ((INodeFile)targetNode).getBlocks(); } }
Block[] getFileBlocks(String src) throws UnresolvedLinkException { waitForReady(); synchronized (rootDir) { INode targetNode = rootDir.getNode(src, false); if (targetNode == null) return null; if (targetNode.isDirectory()) return null; if (targetNode.isLink()) return null; return ((INodeFile)targetNode).getBlocks(); } }
/** * Get the blocks associated with the file. */
Get the blocks associated with the file
getFileBlocks
{ "repo_name": "sdecoder/CMDS-HDFS", "path": "hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 76258 }
[ "org.apache.hadoop.fs.UnresolvedLinkException", "org.apache.hadoop.hdfs.protocol.Block" ]
import org.apache.hadoop.fs.UnresolvedLinkException; import org.apache.hadoop.hdfs.protocol.Block;
import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,872,465
@Generated @Selector("samplePresentationTimeForTrackTime:") @ByValue public native CMTime samplePresentationTimeForTrackTime(@ByValue CMTime trackTime);
@Selector(STR) native CMTime function(@ByValue CMTime trackTime);
/** * samplePresentationTimeForTrackTime: * <p> * Maps the specified trackTime through the appropriate time mapping and returns the resulting sample presentation time. * * @param trackTime The trackTime for which a sample presentation time is requested. * @return A CMTime; will be invalid if the trackTime is out of range */
samplePresentationTimeForTrackTime: Maps the specified trackTime through the appropriate time mapping and returns the resulting sample presentation time
samplePresentationTimeForTrackTime
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/avfoundation/AVAssetTrack.java", "license": "apache-2.0", "size": 21288 }
[ "org.moe.natj.general.ann.ByValue", "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.general.ann.ByValue; import org.moe.natj.objc.ann.Selector;
import org.moe.natj.general.ann.*; import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
1,141,730
private void handleBundles(String[] bundles, Profile profile) { Map<String, String> conf = profile.getConfiguration(Constants.AGENT_PID); for (String bundle : bundles) { if (set) { System.out.println("Adding bundle:" + bundle + " to profile:" + profile.getId() + " version:" + profile.getVersion()); } else if (delete) { System.out.println("Deleting bundle:" + bundle + " from profile:" + profile.getId() + " version:" + profile.getVersion()); } updateConfig(conf, BUNDLE_PREFIX + bundle.replace('/', '_'), bundle, set, delete); } profile.setConfiguration(Constants.AGENT_PID, conf); }
void function(String[] bundles, Profile profile) { Map<String, String> conf = profile.getConfiguration(Constants.AGENT_PID); for (String bundle : bundles) { if (set) { System.out.println(STR + bundle + STR + profile.getId() + STR + profile.getVersion()); } else if (delete) { System.out.println(STR + bundle + STR + profile.getId() + STR + profile.getVersion()); } updateConfig(conf, BUNDLE_PREFIX + bundle.replace('/', '_'), bundle, set, delete); } profile.setConfiguration(Constants.AGENT_PID, conf); }
/** * Adds or remove the specified bundles to the specified profile. * @param bundles The array of bundles. * @param profile The target profile. */
Adds or remove the specified bundles to the specified profile
handleBundles
{ "repo_name": "janstey/fuse", "path": "fabric/fabric-commands/src/main/java/org/fusesource/fabric/commands/ProfileEdit.java", "license": "apache-2.0", "size": 24028 }
[ "java.util.Map", "org.fusesource.fabric.api.Constants", "org.fusesource.fabric.api.Profile" ]
import java.util.Map; import org.fusesource.fabric.api.Constants; import org.fusesource.fabric.api.Profile;
import java.util.*; import org.fusesource.fabric.api.*;
[ "java.util", "org.fusesource.fabric" ]
java.util; org.fusesource.fabric;
477,218
public ActionForward processReport(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug("In ReportsUserParamsAction:processReport Method: "); ReportsUserParamsActionForm actionForm = (ReportsUserParamsActionForm) form; int reportId = actionForm.getReportId(); String applPath = actionForm.getApplPath(); String expType = actionForm.getExpFormat(); String expFilename = reportsBusinessService.runReport(reportId, request, applPath, expType); request.getSession().setAttribute("expFileName", expFilename); actionForm.setExpFileName(expFilename); String forward = ""; String error = (String) request.getSession().getAttribute("paramerror"); if (error == null || error.equals("")) { forward = ReportsConstants.PROCESSREPORTSUSERPARAMS; } else { forward = ReportsConstants.ADDLISTREPORTSUSERPARAMS; } return mapping.findForward(forward); }
ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug(STR); ReportsUserParamsActionForm actionForm = (ReportsUserParamsActionForm) form; int reportId = actionForm.getReportId(); String applPath = actionForm.getApplPath(); String expType = actionForm.getExpFormat(); String expFilename = reportsBusinessService.runReport(reportId, request, applPath, expType); request.getSession().setAttribute(STR, expFilename); actionForm.setExpFileName(expFilename); String forward = STRparamerrorSTR")) { forward = ReportsConstants.PROCESSREPORTSUSERPARAMS; } else { forward = ReportsConstants.ADDLISTREPORTSUSERPARAMS; } return mapping.findForward(forward); }
/** * Generate report in given export format */
Generate report in given export format
processReport
{ "repo_name": "mifos/1.4.x", "path": "application/src/main/java/org/mifos/application/reports/struts/action/ReportsUserParamsAction.java", "license": "apache-2.0", "size": 11874 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.mifos.application.reports.struts.actionforms.ReportsUserParamsActionForm", "org.mifos.application.reports.util.helpers.ReportsConstants" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.mifos.application.reports.struts.actionforms.ReportsUserParamsActionForm; import org.mifos.application.reports.util.helpers.ReportsConstants;
import javax.servlet.http.*; import org.apache.struts.action.*; import org.mifos.application.reports.struts.actionforms.*; import org.mifos.application.reports.util.helpers.*;
[ "javax.servlet", "org.apache.struts", "org.mifos.application" ]
javax.servlet; org.apache.struts; org.mifos.application;
1,657,368
public T caseConnections(Connections object) { return null; }
T function(Connections object) { return null; }
/** * Returns the result of interpreting the object as an instance of '<em>Connections</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>Connections</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */
Returns the result of interpreting the object as an instance of 'Connections'. This implementation returns null; returning a non-null result will terminate the switch.
caseConnections
{ "repo_name": "pedromateo/tug_qt_unit_testing_fw", "path": "qt48_model/src/org/casa/dsltesting/Qt48Xmlschema/util/Qt48XmlschemaSwitch.java", "license": "gpl-3.0", "size": 55025 }
[ "org.casa.dsltesting.Qt48Xmlschema" ]
import org.casa.dsltesting.Qt48Xmlschema;
import org.casa.dsltesting.*;
[ "org.casa.dsltesting" ]
org.casa.dsltesting;
2,076,107
public static Map<String, String> collectKeys( Class<? extends AdditionalResourceKeyProvider> providerClass) { return collectKeys(Arrays.asList(providerClass)); }
static Map<String, String> function( Class<? extends AdditionalResourceKeyProvider> providerClass) { return collectKeys(Arrays.asList(providerClass)); }
/** * Collect the additional keys present in the specified providers */
Collect the additional keys present in the specified providers
collectKeys
{ "repo_name": "ruediste/i18n", "path": "i18n/src/main/java/com/github/ruediste1/i18n/lString/AdditionalResourceKeyCollector.java", "license": "apache-2.0", "size": 3096 }
[ "java.util.Arrays", "java.util.Map" ]
import java.util.Arrays; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,511,652
void restore(IMemento memento) { if (memento == null) { return; } String primaryField = memento.getString(PRIMARY_SORT_FIELD_TAG); if (primaryField == null || primaryField.equals(MarkerSupportInternalUtilities.getId(fields[0]))) { return; } for (int i = 1; i < fields.length; i++) { if (MarkerSupportInternalUtilities.getId(fields[i]).equals(primaryField)) { setPrimarySortField(fields[i]); break; } } IMemento[] descending = memento.getChildren(DESCENDING_FIELDS); for (MarkerField field : fields) { for (IMemento currentMemento : descending) { if (currentMemento.getID().equals(MarkerSupportInternalUtilities.getId(field))) { descendingFields.add(field); continue; } } } }
void restore(IMemento memento) { if (memento == null) { return; } String primaryField = memento.getString(PRIMARY_SORT_FIELD_TAG); if (primaryField == null primaryField.equals(MarkerSupportInternalUtilities.getId(fields[0]))) { return; } for (int i = 1; i < fields.length; i++) { if (MarkerSupportInternalUtilities.getId(fields[i]).equals(primaryField)) { setPrimarySortField(fields[i]); break; } } IMemento[] descending = memento.getChildren(DESCENDING_FIELDS); for (MarkerField field : fields) { for (IMemento currentMemento : descending) { if (currentMemento.getID().equals(MarkerSupportInternalUtilities.getId(field))) { descendingFields.add(field); continue; } } } }
/** * Restore the receiver's state from memento. * * @param memento */
Restore the receiver's state from memento
restore
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerComparator.java", "license": "epl-1.0", "size": 5697 }
[ "org.eclipse.ui.IMemento", "org.eclipse.ui.views.markers.MarkerField" ]
import org.eclipse.ui.IMemento; import org.eclipse.ui.views.markers.MarkerField;
import org.eclipse.ui.*; import org.eclipse.ui.views.markers.*;
[ "org.eclipse.ui" ]
org.eclipse.ui;
2,205,172
public Adapter createYTextAreaDatatypeAdapter() { return null; }
Adapter function() { return null; }
/** * Creates a new adapter for an object of class '{@link org.lunifera.ecview.core.extension.model.datatypes.YTextAreaDatatype <em>YText Area Datatype</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * @return the new adapter. * @see org.lunifera.ecview.core.extension.model.datatypes.YTextAreaDatatype * @generated */
Creates a new adapter for an object of class '<code>org.lunifera.ecview.core.extension.model.datatypes.YTextAreaDatatype YText Area Datatype</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
createYTextAreaDatatypeAdapter
{ "repo_name": "lunifera/lunifera-ecview", "path": "org.lunifera.ecview.core.extension.model/src/org/lunifera/ecview/core/extension/model/datatypes/util/ExtDatatypesAdapterFactory.java", "license": "epl-1.0", "size": 20233 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,878,598
public LabVirtualMachineCreationParameterFragment withTags(Map<String, String> tags) { this.tags = tags; return this; }
LabVirtualMachineCreationParameterFragment function(Map<String, String> tags) { this.tags = tags; return this; }
/** * Set the tags of the resource. * * @param tags the tags value to set * @return the LabVirtualMachineCreationParameterFragment object itself. */
Set the tags of the resource
withTags
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/devtestlabs/mgmt-v2018_09_15/src/main/java/com/microsoft/azure/management/devtestlabs/v2018_09_15/LabVirtualMachineCreationParameterFragment.java", "license": "mit", "size": 28422 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
167,097
protected void executeMojo( final String projectName, String classifier ) throws Exception { File testPom = new File( getBasedir(), getTestDir( projectName ) + "/pom.xml" ); AbstractSourceJarMojo mojo = (AbstractSourceJarMojo) lookupMojo( getGoal(), testPom ); setVariableValueToObject( mojo, "classifier", classifier ); mojo.execute(); }
void function( final String projectName, String classifier ) throws Exception { File testPom = new File( getBasedir(), getTestDir( projectName ) + STR ); AbstractSourceJarMojo mojo = (AbstractSourceJarMojo) lookupMojo( getGoal(), testPom ); setVariableValueToObject( mojo, STR, classifier ); mojo.execute(); }
/** * Execute the source plugin for the specified project. * * @param projectName the name of the project * @return the base directory of the project * @throws Exception if an error occurred */
Execute the source plugin for the specified project
executeMojo
{ "repo_name": "dmlloyd/maven-plugins", "path": "maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java", "license": "apache-2.0", "size": 7711 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
269,713
public Color getFillColor() { return fillColor; }
Color function() { return fillColor; }
/** * Returns the fill color. */
Returns the fill color
getFillColor
{ "repo_name": "3w3rt0n/AmeacasInternas", "path": "src/com/mxgraph/swing/handler/mxRubberband.java", "license": "apache-2.0", "size": 7184 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,685,676
public boolean performFinish() { // 1st, add the connection to our overall state: MongoInstance mongoInstance = new MongoInstance(page.getConnName()); mongoInstance.setHost(page.getHost()); mongoInstance.setPort(page.getPort()); MeclipsePlugin.getDefault().addMongo(page.getConnName(), mongoInstance); return true; }
boolean function() { MongoInstance mongoInstance = new MongoInstance(page.getConnName()); mongoInstance.setHost(page.getHost()); mongoInstance.setPort(page.getPort()); MeclipsePlugin.getDefault().addMongo(page.getConnName(), mongoInstance); return true; }
/** * This method is called when 'Finish' button is pressed in the wizard. We * will create an operation and run it using wizard as execution context. */
This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context
performFinish
{ "repo_name": "FlaPer87/meclipse", "path": "org.mongodb.meclipse/src/org/mongodb/meclipse/wizards/ConnectionWizard.java", "license": "gpl-2.0", "size": 1788 }
[ "org.mongodb.meclipse.MeclipsePlugin", "org.mongodb.meclipse.preferences.MongoInstance" ]
import org.mongodb.meclipse.MeclipsePlugin; import org.mongodb.meclipse.preferences.MongoInstance;
import org.mongodb.meclipse.*; import org.mongodb.meclipse.preferences.*;
[ "org.mongodb.meclipse" ]
org.mongodb.meclipse;
2,125,118
private void changeClusterStateWithPendingLock(ClusterState newState, String exceptionMsg) { grid(0).cluster().state(ACTIVE); Lock lock = grid(0).cache(CACHE_NAME).lock(1); lock.lock(); try { //noinspection ThrowableNotThrown assertThrowsAnyCause(log, changeStateClo(newState), IgniteException.class, exceptionMsg); } finally { lock.unlock(); } }
void function(ClusterState newState, String exceptionMsg) { grid(0).cluster().state(ACTIVE); Lock lock = grid(0).cache(CACHE_NAME).lock(1); lock.lock(); try { assertThrowsAnyCause(log, changeStateClo(newState), IgniteException.class, exceptionMsg); } finally { lock.unlock(); } }
/** * Tests that cluster state change to {@code newState} is prohibited if explicit lock is held in current thread. * * @param newState New cluster state. * @param exceptionMsg Exception message. */
Tests that cluster state change to newState is prohibited if explicit lock is held in current thread
changeClusterStateWithPendingLock
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterStateServerAbstractTest.java", "license": "apache-2.0", "size": 7733 }
[ "java.util.concurrent.locks.Lock", "org.apache.ignite.IgniteException", "org.apache.ignite.cluster.ClusterState", "org.apache.ignite.testframework.GridTestUtils" ]
import java.util.concurrent.locks.Lock; import org.apache.ignite.IgniteException; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.testframework.GridTestUtils;
import java.util.concurrent.locks.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.testframework.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,293,671
public static void authorizationRequired(HttpServletResponse resp, String msg, String realm) throws IOException { resp.setHeader("WWW-Authenticate", "Basic realm=\"" + realm + "\""); sendResponse(resp, HttpServletResponse.SC_UNAUTHORIZED, msg); }
static void function(HttpServletResponse resp, String msg, String realm) throws IOException { resp.setHeader(STR, STRSTR\""); sendResponse(resp, HttpServletResponse.SC_UNAUTHORIZED, msg); }
/** * Send an UNAUTHORIZED (401) response. * * @param resp the HttpServletResponse * @param msg a human-readable message to send as the body of the response * @param realm the authentication realm (e.g. "Secure area") * @throws IOException */
Send an UNAUTHORIZED (401) response
authorizationRequired
{ "repo_name": "ndrppnc/CloudCoder", "path": "CloudCoderRepository/src/org/cloudcoder/repoapp/servlets/ServletUtil.java", "license": "agpl-3.0", "size": 7857 }
[ "java.io.IOException", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,774,123
ActionGroupPositionComparator comparator = new ActionGroupPositionComparator(); ActionGroup actionGr = new ActionGroup(); ActionGroup compareActionGr = new ActionGroup(); actionGr.setName("group"); compareActionGr.setName("copare"); actionGr.setSorting(null); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 1); actionGr.setSorting(null); compareActionGr.setSorting(null); assertEquals(comparator.compare(actionGr, compareActionGr), 4); actionGr.setSorting(1); compareActionGr.setSorting(null); assertEquals(comparator.compare(actionGr, compareActionGr), -1); actionGr.setSorting(1); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 4); actionGr.setSorting(3); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 1); actionGr.setSorting(1); compareActionGr.setSorting(3); assertEquals(comparator.compare(actionGr, compareActionGr), -1); }
ActionGroupPositionComparator comparator = new ActionGroupPositionComparator(); ActionGroup actionGr = new ActionGroup(); ActionGroup compareActionGr = new ActionGroup(); actionGr.setName("group"); compareActionGr.setName(STR); actionGr.setSorting(null); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 1); actionGr.setSorting(null); compareActionGr.setSorting(null); assertEquals(comparator.compare(actionGr, compareActionGr), 4); actionGr.setSorting(1); compareActionGr.setSorting(null); assertEquals(comparator.compare(actionGr, compareActionGr), -1); actionGr.setSorting(1); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 4); actionGr.setSorting(3); compareActionGr.setSorting(1); assertEquals(comparator.compare(actionGr, compareActionGr), 1); actionGr.setSorting(1); compareActionGr.setSorting(3); assertEquals(comparator.compare(actionGr, compareActionGr), -1); }
/** * this test tests the sorting of the actions. */
this test tests the sorting of the actions
testCompareTo
{ "repo_name": "test-editor/test-editor", "path": "core/org.testeditor.core/src/test/java/org/testeditor/core/model/action/ActionGroupPositionComparatorTest.java", "license": "epl-1.0", "size": 1899 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
997,969
// END_INCLUDE (test_name) final int TEST_SPINNER_POSITION_1 = MainActivity.WEATHER_PARTLY_CLOUDY; // BEGIN_INCLUDE (launch_activity) // Launch the activity Activity activity = getActivity(); // END_INCLUDE (launch_activity)
final int TEST_SPINNER_POSITION_1 = MainActivity.WEATHER_PARTLY_CLOUDY; Activity activity = getActivity();
/** * Test to make sure that spinner values are persisted across activity restarts. * * <p>Launches the main activity, sets a spinner value, closes the activity, then relaunches * that activity. Checks to make sure that the spinner values match what we set them to. */
Test to make sure that spinner values are persisted across activity restarts. Launches the main activity, sets a spinner value, closes the activity, then relaunches that activity. Checks to make sure that the spinner values match what we set them to
testSpinnerValuePersistedBetweenLaunches
{ "repo_name": "indashnet/InDashNet.Open.UN2000", "path": "android/developers/samples/android/testing/ActivityInstrumentationSample/tests/src/com/example/android/activityinstrumentation/MainActivityTest.java", "license": "apache-2.0", "size": 4767 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,391,046
boolean hasSettings(final EnumSet<AttrSetting> _attrSetting);
boolean hasSettings(final EnumSet<AttrSetting> _attrSetting);
/** * Check if this attribute contains the given Settings. * @param _attrSetting the settings to check for * @return has this attribute the given setting */
Check if this attribute contains the given Settings
hasSettings
{ "repo_name": "eFaps/eFapsApp-JMS", "path": "src/main/efaps/ESJP/org/efaps/esjp/jms/attributes/IAttribute.java", "license": "apache-2.0", "size": 1803 }
[ "java.util.EnumSet" ]
import java.util.EnumSet;
import java.util.*;
[ "java.util" ]
java.util;
1,704,140
@Override Set<String> tagSet() { Set<String> tags = Generics.newHashSet(); Pattern p1 = Pattern.compile("Q0TQ1T-([^-]+)-.*"); Pattern p2 = Pattern.compile("S0T-(.*)"); for (String feat : featureWeights.keySet()) { Matcher m1 = p1.matcher(feat); if (m1.matches()) { tags.add(m1.group(1)); } Matcher m2 = p2.matcher(feat); if (m2.matches()) { tags.add(m2.group(1)); } } // Add the end of sentence tag! // The SR model doesn't use it, but other models do and report it. // todo [cdm 2014]: Maybe we should reverse the convention here?!? tags.add(Tagger.EOS_TAG); return tags; }
Set<String> tagSet() { Set<String> tags = Generics.newHashSet(); Pattern p1 = Pattern.compile(STR); Pattern p2 = Pattern.compile(STR); for (String feat : featureWeights.keySet()) { Matcher m1 = p1.matcher(feat); if (m1.matches()) { tags.add(m1.group(1)); } Matcher m2 = p2.matcher(feat); if (m2.matches()) { tags.add(m2.group(1)); } } tags.add(Tagger.EOS_TAG); return tags; }
/** Reconstruct the tag set that was used to train the model by decoding some of the features. * This is slow and brittle but should work! Only if "-" is not in the tag set.... */
Reconstruct the tag set that was used to train the model by decoding some of the features. This is slow and brittle but should work! Only if "-" is not in the tag set...
tagSet
{ "repo_name": "rupenp/CoreNLP", "path": "src/edu/stanford/nlp/parser/shiftreduce/PerceptronModel.java", "license": "gpl-2.0", "size": 28174 }
[ "edu.stanford.nlp.tagger.common.Tagger", "edu.stanford.nlp.util.Generics", "java.util.Set", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import edu.stanford.nlp.tagger.common.Tagger; import edu.stanford.nlp.util.Generics; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern;
import edu.stanford.nlp.tagger.common.*; import edu.stanford.nlp.util.*; import java.util.*; import java.util.regex.*;
[ "edu.stanford.nlp", "java.util" ]
edu.stanford.nlp; java.util;
271,418
public static Enumeration getNames() { return names.elements(); }
static Enumeration function() { return names.elements(); }
/** * returns an enumeration containing the name strings for curves * contained in this structure. */
returns an enumeration containing the name strings for curves contained in this structure
getNames
{ "repo_name": "onessimofalconi/bc-java", "path": "core/src/main/java/org/bouncycastle/asn1/teletrust/TeleTrusTNamedCurves.java", "license": "mit", "size": 19936 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
122,385
public void readArray(long[] destination, int offset, int size) throws IOException;
void function(long[] destination, int offset, int size) throws IOException;
/** * Reads a slice of an array in place. * This method throws an IOException if the underlying serialization * stream can only do byte serialization. * (See {@link PortType#SERIALIZATION_BYTE}). * * @param destination * array in which the slice is stored * @param offset * offset where the slice starts * @param size * length of the slice (the number of elements) * @exception IOException * is thrown on an IO error. */
Reads a slice of an array in place. This method throws an IOException if the underlying serialization stream can only do byte serialization. (See <code>PortType#SERIALIZATION_BYTE</code>)
readArray
{ "repo_name": "interdroid/ibis-ipl", "path": "src/ibis/ipl/ReadMessage.java", "license": "bsd-3-clause", "size": 20592 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,554,100
public ValidatableWidget<TextBox> getValidateNameTextBox() { return validateNameTextBox; }
ValidatableWidget<TextBox> function() { return validateNameTextBox; }
/** * To get Validate Name TextBox. * * @return ValidatableWidget<TextBox> */
To get Validate Name TextBox
getValidateNameTextBox
{ "repo_name": "kuzavas/ephesoft", "path": "dcma-gwt/dcma-gwt-admin/src/main/java/com/ephesoft/dcma/gwt/admin/bm/client/view/fieldtype/EditFieldTypeView.java", "license": "agpl-3.0", "size": 20768 }
[ "com.ephesoft.dcma.gwt.core.client.validator.ValidatableWidget", "com.google.gwt.user.client.ui.TextBox" ]
import com.ephesoft.dcma.gwt.core.client.validator.ValidatableWidget; import com.google.gwt.user.client.ui.TextBox;
import com.ephesoft.dcma.gwt.core.client.validator.*; import com.google.gwt.user.client.ui.*;
[ "com.ephesoft.dcma", "com.google.gwt" ]
com.ephesoft.dcma; com.google.gwt;
1,105,544
public void reset() { scheduler = new Scheduler(); quit = false; }
void function() { scheduler = new Scheduler(); quit = false; }
/** * Causes all enqueued tasks to be discarded, and pause state to be reset */
Causes all enqueued tasks to be discarded, and pause state to be reset
reset
{ "repo_name": "gabrielduque/robolectric", "path": "robolectric/src/main/java/org/robolectric/shadows/ShadowLooper.java", "license": "mit", "size": 7351 }
[ "org.robolectric.util.Scheduler" ]
import org.robolectric.util.Scheduler;
import org.robolectric.util.*;
[ "org.robolectric.util" ]
org.robolectric.util;
715,160
public Map<String, Integer> getSubscriptionStates() { return subscriptionStates; }
Map<String, Integer> function() { return subscriptionStates; }
/** * Gets the subscription states. * * @return the subscription states */
Gets the subscription states
getSubscriptionStates
{ "repo_name": "vzhukovskyi/kaa", "path": "server/operations/src/main/java/org/kaaproject/kaa/server/operations/pojo/GetNotificationResponse.java", "license": "apache-2.0", "size": 3158 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,069,210
EList<String> getWebServiceNames();
EList<String> getWebServiceNames();
/** * Returns the value of the '<em><b>Web Service Names</b></em>' attribute list. * The list contents are of type {@link java.lang.String}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Web Service Names</em>' attribute list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Web Service Names</em>' attribute list. * @see com.odcgroup.t24.enquiry.enquiry.EnquiryPackage#getWebService_WebServiceNames() * @model unique="false" * @generated */
Returns the value of the 'Web Service Names' attribute list. The list contents are of type <code>java.lang.String</code>. If the meaning of the 'Web Service Names' attribute list isn't clear, there really should be more of a description here...
getWebServiceNames
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/t24/core/com.odcgroup.t24.enquiry.model/src-gen/com/odcgroup/t24/enquiry/enquiry/WebService.java", "license": "epl-1.0", "size": 4516 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,007,791
void allocateMemoryComponents() throws HyracksDataException;
void allocateMemoryComponents() throws HyracksDataException;
/** * Allocates the memory components of an LSM index in the buffer cache. * * @throws HyracksDataException */
Allocates the memory components of an LSM index in the buffer cache
allocateMemoryComponents
{ "repo_name": "heriram/incubator-asterixdb", "path": "hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/api/ILSMIndex.java", "license": "apache-2.0", "size": 6344 }
[ "org.apache.hyracks.api.exceptions.HyracksDataException" ]
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.exceptions.*;
[ "org.apache.hyracks" ]
org.apache.hyracks;
1,899,613
protected GroovyShell createShell() { return new GroovyShell(Jenkins.getInstance().getPluginManager().uberClassLoader, bindings); } private static final Logger LOGGER = Logger.getLogger(GroovyHookScript.class.getName());
GroovyShell function() { return new GroovyShell(Jenkins.getInstance().getPluginManager().uberClassLoader, bindings); } private static final Logger LOGGER = Logger.getLogger(GroovyHookScript.class.getName());
/** * Can be used to customize the environment in which the script runs. */
Can be used to customize the environment in which the script runs
createShell
{ "repo_name": "lindzh/jenkins", "path": "core/src/main/java/jenkins/util/groovy/GroovyHookScript.java", "license": "mit", "size": 4234 }
[ "groovy.lang.GroovyShell", "java.util.logging.Logger" ]
import groovy.lang.GroovyShell; import java.util.logging.Logger;
import groovy.lang.*; import java.util.logging.*;
[ "groovy.lang", "java.util" ]
groovy.lang; java.util;
2,529,038
private static boolean deleteFile(File file) { try { SimpleExec exec = new SimpleExec("rm -rf " + file.getAbsolutePath()).join(); return exec.exitCode() == 0; } catch (Exception e) { log.warn("Failed to delete file at path " + file.getAbsolutePath()); return false; } }
static boolean function(File file) { try { SimpleExec exec = new SimpleExec(STR + file.getAbsolutePath()).join(); return exec.exitCode() == 0; } catch (Exception e) { log.warn(STR + file.getAbsolutePath()); return false; } }
/** * Simple wrapper around SimpleExec to run rm -rc on a faile * * @param file The file to delete * @return True if the file was deleted successfully */
Simple wrapper around SimpleExec to run rm -rc on a faile
deleteFile
{ "repo_name": "mythguided/hydra", "path": "hydra-main/src/main/java/com/addthis/hydra/minion/MinionTaskDeleter.java", "license": "apache-2.0", "size": 11133 }
[ "com.addthis.basis.util.SimpleExec", "java.io.File" ]
import com.addthis.basis.util.SimpleExec; import java.io.File;
import com.addthis.basis.util.*; import java.io.*;
[ "com.addthis.basis", "java.io" ]
com.addthis.basis; java.io;
1,745,051
protected IFigure setupContentPane(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; // use nodeShape itself as contentPane }
IFigure function(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; }
/** * Default implementation treats passed figure as content pane. * Respects layout one may have set for generated figure. * @param nodeShape instance of generated figure class * @generated */
Default implementation treats passed figure as content pane. Respects layout one may have set for generated figure
setupContentPane
{ "repo_name": "nwnpallewela/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/PayloadFactoryMediatorEditPart.java", "license": "apache-2.0", "size": 11586 }
[ "org.eclipse.draw2d.IFigure", "org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout" ]
import org.eclipse.draw2d.IFigure; import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.draw2d.*; import org.eclipse.gmf.runtime.draw2d.ui.figures.*;
[ "org.eclipse.draw2d", "org.eclipse.gmf" ]
org.eclipse.draw2d; org.eclipse.gmf;
101,273
public void parse(InputStream contents) throws IOException, SAXException, ParserConfigurationException { // TODO 20110827 (jharty): Should we check for empty content and throw an Exception? parseContents("UTF-8", contents); }
void function(InputStream contents) throws IOException, SAXException, ParserConfigurationException { parseContents("UTF-8", contents); }
/** * Parse the contents of the InputStream. * <p/> * The contents are expected to represent a valid SMIL file. * * @param contents representing a valid SMIL file. * @throws ParserConfigurationException * @throws SAXException * @throws IOException */
Parse the contents of the InputStream. The contents are expected to represent a valid SMIL file
parse
{ "repo_name": "hosung03/DrawPadAndEPubReader_android", "path": "epublib/src/main/java/hosung/epublib/smil/SmilFile.java", "license": "mit", "size": 4600 }
[ "java.io.IOException", "java.io.InputStream", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.xml.sax" ]
java.io; javax.xml; org.xml.sax;
140,269
void updateCount(INodesInPath iip, long nsDelta, long ssDelta, short replication, boolean checkQuota) throws QuotaExceededException { final INodeFile fileINode = iip.getLastINode().asFile(); EnumCounters<StorageType> typeSpaceDeltas = getStorageTypeDeltas(fileINode.getStoragePolicyID(), ssDelta, replication, replication); updateCount(iip, iip.length() - 1, new QuotaCounts.Builder().nameSpace(nsDelta).storageSpace(ssDelta * replication). typeSpaces(typeSpaceDeltas).build(), checkQuota); }
void updateCount(INodesInPath iip, long nsDelta, long ssDelta, short replication, boolean checkQuota) throws QuotaExceededException { final INodeFile fileINode = iip.getLastINode().asFile(); EnumCounters<StorageType> typeSpaceDeltas = getStorageTypeDeltas(fileINode.getStoragePolicyID(), ssDelta, replication, replication); updateCount(iip, iip.length() - 1, new QuotaCounts.Builder().nameSpace(nsDelta).storageSpace(ssDelta * replication). typeSpaces(typeSpaceDeltas).build(), checkQuota); }
/** * Update usage count without replication factor change */
Update usage count without replication factor change
updateCount
{ "repo_name": "apurtell/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 76824 }
[ "org.apache.hadoop.fs.StorageType", "org.apache.hadoop.hdfs.protocol.QuotaExceededException", "org.apache.hadoop.hdfs.util.EnumCounters" ]
import org.apache.hadoop.fs.StorageType; import org.apache.hadoop.hdfs.protocol.QuotaExceededException; import org.apache.hadoop.hdfs.util.EnumCounters;
import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,732,147
public static Map<String, Command> loadCommands(String pkgName, Class[] classArgs, Object[] objectArgs) { Map<String, Command> commandsMap = new HashMap<>(); Reflections reflections = new Reflections(Command.class.getPackage().getName()); for (Class<? extends Command> cls : reflections.getSubTypesOf(Command.class)) { if (cls.getPackage().getName().startsWith(pkgName) && !Modifier.isAbstract(cls.getModifiers())) { // Only instantiate a concrete class Command cmd; try { cmd = CommonUtils.createNewClassInstance(cls, classArgs, objectArgs); } catch (Exception e) { throw Throwables.propagate(e); } commandsMap.put(cmd.getCommandName(), cmd); } } return commandsMap; }
static Map<String, Command> function(String pkgName, Class[] classArgs, Object[] objectArgs) { Map<String, Command> commandsMap = new HashMap<>(); Reflections reflections = new Reflections(Command.class.getPackage().getName()); for (Class<? extends Command> cls : reflections.getSubTypesOf(Command.class)) { if (cls.getPackage().getName().startsWith(pkgName) && !Modifier.isAbstract(cls.getModifiers())) { Command cmd; try { cmd = CommonUtils.createNewClassInstance(cls, classArgs, objectArgs); } catch (Exception e) { throw Throwables.propagate(e); } commandsMap.put(cmd.getCommandName(), cmd); } } return commandsMap; }
/** * Get instances of all subclasses of {@link Command} in the given package. * * @param pkgName package prefix to look in * @param classArgs type of args to instantiate the class * @param objectArgs args to instantiate the class * @return a mapping from command name to command instance */
Get instances of all subclasses of <code>Command</code> in the given package
loadCommands
{ "repo_name": "ChangerYoung/alluxio", "path": "core/common/src/main/java/alluxio/cli/CommandUtils.java", "license": "apache-2.0", "size": 2068 }
[ "com.google.common.base.Throwables", "java.lang.reflect.Modifier", "java.util.HashMap", "java.util.Map", "org.reflections.Reflections" ]
import com.google.common.base.Throwables; import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Map; import org.reflections.Reflections;
import com.google.common.base.*; import java.lang.reflect.*; import java.util.*; import org.reflections.*;
[ "com.google.common", "java.lang", "java.util", "org.reflections" ]
com.google.common; java.lang; java.util; org.reflections;
550,130
@Override public boolean equals(Object object) { if (object == this ) { return true; } if (object instanceof ResizableDoubleArray == false) { return false; } synchronized(this) { synchronized(object) { boolean result = true; ResizableDoubleArray other = (ResizableDoubleArray) object; result = result && (other.initialCapacity == initialCapacity); result = result && (other.contractionCriteria == contractionCriteria); result = result && (other.expansionFactor == expansionFactor); result = result && (other.expansionMode == expansionMode); result = result && (other.numElements == numElements); result = result && (other.startIndex == startIndex); if (!result) { return false; } else { return Arrays.equals(internalArray, other.internalArray); } } } }
boolean function(Object object) { if (object == this ) { return true; } if (object instanceof ResizableDoubleArray == false) { return false; } synchronized(this) { synchronized(object) { boolean result = true; ResizableDoubleArray other = (ResizableDoubleArray) object; result = result && (other.initialCapacity == initialCapacity); result = result && (other.contractionCriteria == contractionCriteria); result = result && (other.expansionFactor == expansionFactor); result = result && (other.expansionMode == expansionMode); result = result && (other.numElements == numElements); result = result && (other.startIndex == startIndex); if (!result) { return false; } else { return Arrays.equals(internalArray, other.internalArray); } } } }
/** * Returns true iff object is a ResizableDoubleArray with the same properties * as this and an identical internal storage array. * * @param object object to be compared for equality with this * @return true iff object is a ResizableDoubleArray with the same data and * properties as this * @since 2.0 */
Returns true iff object is a ResizableDoubleArray with the same properties as this and an identical internal storage array
equals
{ "repo_name": "justinwm/astor", "path": "examples/math_76/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java", "license": "gpl-2.0", "size": 35119 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
205,900
public void testDbCreateRemove() throws Throwable { createEnv(1 << 20, true); int N1 = 10; int N2 = 50; int N3 = 60; int N4 = 70; int N5 = 100; String dbName1 = "foo"; String dbName2 = "bar"; try { Transaction txn = env.beginTransaction(null, null); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); for (int i = 0; i < N2; i++) { env.openDatabase(txn, dbName1 + i, dbConfig); } txn.abort(); checkForNoDb(dbName1, 0, N2); txn = env.beginTransaction(null, null); for (int i = N1; i < N5; i++) { Database db = env.openDatabase(txn, dbName1 + i, dbConfig); db.close(); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N5); env.close(); EnvironmentConfig envConfig = TestUtils.initEnvConfig(); envConfig.setConfigParam (EnvironmentParams.NODE_MAX.getName(), "6"); envConfig.setConfigParam(EnvironmentParams.MAX_MEMORY.getName(), new Long(1 << 24).toString()); envConfig.setTransactional(true); envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC)); env = new Environment(envHome, envConfig); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N5); txn = env.beginTransaction(null, null); for (int i = N2; i < N4; i++) { env.removeDatabase(txn, dbName1+i); } txn.abort(); txn = env.beginTransaction(null, null); for (int i = N3; i < N4; i++) { env.removeDatabase(txn, dbName1+i); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); env.close(); env = new Environment(envHome, envConfig); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); txn = env.beginTransaction(null, null); for (int i = N1; i < N3; i++) { env.renameDatabase (txn, dbName1+i, dbName2+i); } txn.abort(); txn = env.beginTransaction(null, null); for (int i = N2; i < N3; i++) { env.renameDatabase (txn, dbName1+i, dbName2+i); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N2); checkForDb(dbName2, N2, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); } catch (Throwable t) { t.printStackTrace(); throw t; } }
void function() throws Throwable { createEnv(1 << 20, true); int N1 = 10; int N2 = 50; int N3 = 60; int N4 = 70; int N5 = 100; String dbName1 = "foo"; String dbName2 = "bar"; try { Transaction txn = env.beginTransaction(null, null); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setTransactional(true); dbConfig.setAllowCreate(true); for (int i = 0; i < N2; i++) { env.openDatabase(txn, dbName1 + i, dbConfig); } txn.abort(); checkForNoDb(dbName1, 0, N2); txn = env.beginTransaction(null, null); for (int i = N1; i < N5; i++) { Database db = env.openDatabase(txn, dbName1 + i, dbConfig); db.close(); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N5); env.close(); EnvironmentConfig envConfig = TestUtils.initEnvConfig(); envConfig.setConfigParam (EnvironmentParams.NODE_MAX.getName(), "6"); envConfig.setConfigParam(EnvironmentParams.MAX_MEMORY.getName(), new Long(1 << 24).toString()); envConfig.setTransactional(true); envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC)); env = new Environment(envHome, envConfig); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N5); txn = env.beginTransaction(null, null); for (int i = N2; i < N4; i++) { env.removeDatabase(txn, dbName1+i); } txn.abort(); txn = env.beginTransaction(null, null); for (int i = N3; i < N4; i++) { env.removeDatabase(txn, dbName1+i); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); env.close(); env = new Environment(envHome, envConfig); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); txn = env.beginTransaction(null, null); for (int i = N1; i < N3; i++) { env.renameDatabase (txn, dbName1+i, dbName2+i); } txn.abort(); txn = env.beginTransaction(null, null); for (int i = N2; i < N3; i++) { env.renameDatabase (txn, dbName1+i, dbName2+i); } txn.commit(); checkForNoDb(dbName1, 0, N1); checkForDb(dbName1, N1, N2); checkForDb(dbName2, N2, N3); checkForNoDb(dbName1, N3, N4); checkForDb(dbName1, N4, N5); } catch (Throwable t) { t.printStackTrace(); throw t; } }
/** * Insert dbs, commit some, abort some. To do: add db remove, rename. */
Insert dbs, commit some, abort some. To do: add db remove, rename
testDbCreateRemove
{ "repo_name": "bjorndm/prebake", "path": "code/third_party/bdb/test/com/sleepycat/je/recovery/RecoveryAbortTest.java", "license": "apache-2.0", "size": 23764 }
[ "com.sleepycat.je.Database", "com.sleepycat.je.DatabaseConfig", "com.sleepycat.je.Environment", "com.sleepycat.je.EnvironmentConfig", "com.sleepycat.je.Transaction", "com.sleepycat.je.config.EnvironmentParams", "com.sleepycat.je.util.TestUtils" ]
import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseConfig; import com.sleepycat.je.Environment; import com.sleepycat.je.EnvironmentConfig; import com.sleepycat.je.Transaction; import com.sleepycat.je.config.EnvironmentParams; import com.sleepycat.je.util.TestUtils;
import com.sleepycat.je.*; import com.sleepycat.je.config.*; import com.sleepycat.je.util.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
1,463,548
public String diff_text2(LinkedList<Diff> diffs) { StringBuilder text = new StringBuilder(); for (Diff aDiff : diffs) { if (aDiff.operation != Operation.DELETE) { text.append(aDiff.text); } } return text.toString(); }
String function(LinkedList<Diff> diffs) { StringBuilder text = new StringBuilder(); for (Diff aDiff : diffs) { if (aDiff.operation != Operation.DELETE) { text.append(aDiff.text); } } return text.toString(); }
/** * Compute and return the destination text (all equalities and insertions). * * @param diffs LinkedList of Diff objects. * @return Destination text. */
Compute and return the destination text (all equalities and insertions)
diff_text2
{ "repo_name": "Cognifide/AET", "path": "core/jobs/src/main/java/com/cognifide/aet/job/common/comparators/source/diff/DiffMatchPatch.java", "license": "apache-2.0", "size": 91233 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
1,144,190
@Generated @Selector("setAttributedText:") public native void setAttributedText(NSAttributedString value);
@Selector(STR) native void function(NSAttributedString value);
/** * default is nil */
default is nil
setAttributedText
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/UITextField.java", "license": "apache-2.0", "size": 46138 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,335,797
public static List<String> getProductCodes() { return getItems(EC2_METADATA_ROOT + "/product-codes"); }
static List<String> function() { return getItems(EC2_METADATA_ROOT + STR); }
/** * Get the list of product codes associated with the instance, if any. */
Get the list of product codes associated with the instance, if any
getProductCodes
{ "repo_name": "loremipsumdolor/CastFast", "path": "src/com/amazonaws/util/EC2MetadataUtils.java", "license": "mit", "size": 25744 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
235,372
public ApplicationGatewayFrontendIPConfigurationInner withPublicIPAddress(SubResource publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; }
ApplicationGatewayFrontendIPConfigurationInner function(SubResource publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; }
/** * Set the publicIPAddress value. * * @param publicIPAddress the publicIPAddress value to set * @return the ApplicationGatewayFrontendIPConfigurationInner object itself. */
Set the publicIPAddress value
withPublicIPAddress
{ "repo_name": "jianghaolu/azure-sdk-for-java", "path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ApplicationGatewayFrontendIPConfigurationInner.java", "license": "mit", "size": 5829 }
[ "com.microsoft.azure.SubResource" ]
import com.microsoft.azure.SubResource;
import com.microsoft.azure.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,302,951
public boolean renameDataBase(int original, int destination) throws SQLException, NamingException;;
boolean function(int original, int destination) throws SQLException, NamingException;;
/** * Indica el puerto donde se encuentra a la escucha el servicio del gestor * de bases de datos. * * @param port * Número al que hemos de mandar las órdenes. */
Indica el puerto donde se encuentra a la escucha el servicio del gestor de bases de datos
renameDataBase
{ "repo_name": "semantic-web-software/dynagent", "path": "Tools/src/dynagent/tools/importers/IImporter.java", "license": "agpl-3.0", "size": 5395 }
[ "java.sql.SQLException", "javax.naming.NamingException" ]
import java.sql.SQLException; import javax.naming.NamingException;
import java.sql.*; import javax.naming.*;
[ "java.sql", "javax.naming" ]
java.sql; javax.naming;
2,223,467
public static final VideoIntelligenceServiceClient create( VideoIntelligenceServiceSettings settings) throws IOException { return new VideoIntelligenceServiceClient(settings); }
static final VideoIntelligenceServiceClient function( VideoIntelligenceServiceSettings settings) throws IOException { return new VideoIntelligenceServiceClient(settings); }
/** * Constructs an instance of VideoIntelligenceServiceClient, using the given settings. The * channels are created based on the settings passed in, or defaults for any settings that are not * set. */
Constructs an instance of VideoIntelligenceServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set
create
{ "repo_name": "googleapis/java-video-intelligence", "path": "google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java", "license": "apache-2.0", "size": 13781 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,901,715
public static long getOutputSize(long inH, int kernel, int strides, int padding, ConvolutionMode convolutionMode, int dilation) { long eKernel = effectiveKernelSize(kernel, dilation); if (convolutionMode == ConvolutionMode.Same || convolutionMode == ConvolutionMode.Causal) { return (int) Math.ceil(inH / ((double) strides)); } return (inH - eKernel + 2 * padding) / strides + 1; }
static long function(long inH, int kernel, int strides, int padding, ConvolutionMode convolutionMode, int dilation) { long eKernel = effectiveKernelSize(kernel, dilation); if (convolutionMode == ConvolutionMode.Same convolutionMode == ConvolutionMode.Causal) { return (int) Math.ceil(inH / ((double) strides)); } return (inH - eKernel + 2 * padding) / strides + 1; }
/** * Get the output size (height) for the given input data and CNN1D configuration * * @param inH Input size (height, or channels). * @param kernel Kernel size * @param strides Stride * @param padding Padding * @param convolutionMode Convolution mode (Same, Strict, Truncate) * @param dilation Kernel dilation * @return Output size (width) */
Get the output size (height) for the given input data and CNN1D configuration
getOutputSize
{ "repo_name": "RobAltena/deeplearning4j", "path": "deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/Convolution1DUtils.java", "license": "apache-2.0", "size": 11507 }
[ "org.deeplearning4j.nn.conf.ConvolutionMode" ]
import org.deeplearning4j.nn.conf.ConvolutionMode;
import org.deeplearning4j.nn.conf.*;
[ "org.deeplearning4j.nn" ]
org.deeplearning4j.nn;
2,024,395
public void removeReplicaDb(Locker locker, String databaseName, DatabaseId checkId, DbOpReplicationContext repContext) throws DatabaseNotFoundException { try { doRemoveDb(locker, databaseName, checkId, repContext); } catch (NeedRepLockerException e) { throw EnvironmentFailureException.unexpectedException(envImpl, e); } }
void function(Locker locker, String databaseName, DatabaseId checkId, DbOpReplicationContext repContext) throws DatabaseNotFoundException { try { doRemoveDb(locker, databaseName, checkId, repContext); } catch (NeedRepLockerException e) { throw EnvironmentFailureException.unexpectedException(envImpl, e); } }
/** * Replica invocations. * * @see #doRemoveDb */
Replica invocations
removeReplicaDb
{ "repo_name": "prat0318/dbms", "path": "mini_dbms/je-5.0.103/src/com/sleepycat/je/dbi/DbTree.java", "license": "mit", "size": 81170 }
[ "com.sleepycat.je.DatabaseNotFoundException", "com.sleepycat.je.EnvironmentFailureException", "com.sleepycat.je.log.DbOpReplicationContext", "com.sleepycat.je.txn.Locker" ]
import com.sleepycat.je.DatabaseNotFoundException; import com.sleepycat.je.EnvironmentFailureException; import com.sleepycat.je.log.DbOpReplicationContext; import com.sleepycat.je.txn.Locker;
import com.sleepycat.je.*; import com.sleepycat.je.log.*; import com.sleepycat.je.txn.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
393,133
public int getLookback() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return getMetaData().getLookback(); } /** * Executes the calculations defined by this TA function. * * <p>You need to provide input arguments where this TA function will obtain data from and output arguments where this * TA function will write output data to. Optionally you can change default parameters used by this TA function in order * to execute the calculations. The typical use case would be: * <pre> * func = "MAMA"; * params.clear(); * params.add("0.2"); * params.add("0.02"); * calc = new SimpleHelper(func, params); * calc.calculate(0, 59, new Object[] { close }, new Object[] { output1, output2 }, lOutIdx, lOutSize); * System.out.println("lookback="+calc.getLookback()); * System.out.println("outBegIdx = "+lOutIdx.value+ " outNbElement = "+lOutSize.value); * for (int i=0; i<lOutSize.value; i++) { * System.out.println("output1["+i+"]="+output1[i]+" "+"output2["+i+"]="+output2[i]); * }
int function() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return getMetaData().getLookback(); } /** * Executes the calculations defined by this TA function. * * <p>You need to provide input arguments where this TA function will obtain data from and output arguments where this * TA function will write output data to. Optionally you can change default parameters used by this TA function in order * to execute the calculations. The typical use case would be: * <pre> * func = "MAMA"; * params.clear(); * params.add("0.2"); * params.add("0.02"); * calc = new SimpleHelper(func, params); * calc.calculate(0, 59, new Object[] { close }, new Object[] { output1, output2 }, lOutIdx, lOutSize); * System.out.println(STR+calc.getLookback()); * System.out.println(STR+lOutIdx.value+ STR+lOutSize.value); * for (int i=0; i<lOutSize.value; i++) { * System.out.println(STR+i+"]="+output1[i]+" "+STR+i+"]="+output2[i]); * }
/** * Returns the lookback. * * <p> Lookback is the number of input data points to be consumed in order to calculate the first output data point. This value * is affected by the optional input arguments passed to this TA function. * * @return the lookback number of input points to be consumed before the first output data point is produced. * * @throws NoSuchMethodException * @throws IllegalAccessException * @throws InvocationTargetException */
Returns the lookback. Lookback is the number of input data points to be consumed in order to calculate the first output data point. This value is affected by the optional input arguments passed to this TA function
getLookback
{ "repo_name": "nvsoft/talib", "path": "ta-lib/java/src/com/tictactec/ta/lib/meta/helpers/SimpleHelper.java", "license": "mit", "size": 9935 }
[ "java.lang.reflect.InvocationTargetException" ]
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,321,718
mInternalSensorManager.registerListener(mInternalSensorListener, mInternalSensor, SensorManager.SENSOR_DELAY_FASTEST); mKSensor.resume(); }
mInternalSensorManager.registerListener(mInternalSensorListener, mInternalSensor, SensorManager.SENSOR_DELAY_FASTEST); mKSensor.resume(); }
/** * Resumes listening for sensor data. Must be called from * {@link Activity#onResume()}. */
Resumes listening for sensor data. Must be called from <code>Activity#onResume()</code>
onResume
{ "repo_name": "Maginador/GearVRf", "path": "GVRf/Framework/src/org/gearvrf/RotationSensor.java", "license": "apache-2.0", "size": 4657 }
[ "android.hardware.SensorManager" ]
import android.hardware.SensorManager;
import android.hardware.*;
[ "android.hardware" ]
android.hardware;
811,315
void apply(INDArray param, INDArray gradView, double lr, int iteration, int epoch);
void apply(INDArray param, INDArray gradView, double lr, int iteration, int epoch);
/** * Apply the regularization by modifying the gradient array in-place * * @param param Input array (usually parameters) * @param gradView Gradient view array (should be modified/updated). Same shape and type as the input array. * @param lr Current learning rate * @param iteration Current network training iteration * @param epoch Current network training epoch */
Apply the regularization by modifying the gradient array in-place
apply
{ "repo_name": "RobAltena/deeplearning4j", "path": "nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/regularization/Regularization.java", "license": "apache-2.0", "size": 3958 }
[ "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
2,546,934
protected void drawImage(Image image, Rectangle rect, RenderingContext context) throws IOException, ImageException { drawImage(image, rect, context, false, null); }
void function(Image image, Rectangle rect, RenderingContext context) throws IOException, ImageException { drawImage(image, rect, context, false, null); }
/** * Draws an image using a suitable image handler. * @param image the image to be painted (it needs to of a supported image flavor) * @param rect the rectangle in which to paint the image * @param context a suitable rendering context * @throws IOException in case of an I/O error while handling/writing the image * @throws ImageException if an error occurs while converting the image to a suitable format */
Draws an image using a suitable image handler
drawImage
{ "repo_name": "Distrotech/fop", "path": "src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java", "license": "apache-2.0", "size": 17734 }
[ "java.awt.Rectangle", "java.io.IOException", "org.apache.fop.render.RenderingContext", "org.apache.xmlgraphics.image.loader.Image", "org.apache.xmlgraphics.image.loader.ImageException" ]
import java.awt.Rectangle; import java.io.IOException; import org.apache.fop.render.RenderingContext; import org.apache.xmlgraphics.image.loader.Image; import org.apache.xmlgraphics.image.loader.ImageException;
import java.awt.*; import java.io.*; import org.apache.fop.render.*; import org.apache.xmlgraphics.image.loader.*;
[ "java.awt", "java.io", "org.apache.fop", "org.apache.xmlgraphics" ]
java.awt; java.io; org.apache.fop; org.apache.xmlgraphics;
2,818,977
private void rotateUp(float amount) { if (invertedY) amount *= -1; Vector3f camPos = camera.getCamera().getLocation(); Vector3f targetPos = target.getWorldTranslation(); float thetaAccel = (amount * mouseYSpeed); difTemp.set(camPos).subtractLocal(targetPos).subtractLocal( camera.getTargetOffset()); if (worldUpVec.z == 1) { float y = difTemp.y; difTemp.y = difTemp.z; difTemp.z = y; } FastMath.cartesianToSpherical(difTemp, sphereTemp); camera.getIdealSphereCoords().z = clampUpAngle(sphereTemp.z + (thetaAccel)); }
void function(float amount) { if (invertedY) amount *= -1; Vector3f camPos = camera.getCamera().getLocation(); Vector3f targetPos = target.getWorldTranslation(); float thetaAccel = (amount * mouseYSpeed); difTemp.set(camPos).subtractLocal(targetPos).subtractLocal( camera.getTargetOffset()); if (worldUpVec.z == 1) { float y = difTemp.y; difTemp.y = difTemp.z; difTemp.z = y; } FastMath.cartesianToSpherical(difTemp, sphereTemp); camera.getIdealSphereCoords().z = clampUpAngle(sphereTemp.z + (thetaAccel)); }
/** * <code>rotateRight</code> updates the altitude/polar value of the * camera's spherical coordinates. * * @param amount */
<code>rotateRight</code> updates the altitude/polar value of the camera's spherical coordinates
rotateUp
{ "repo_name": "accelazh/ThreeBodyProblem", "path": "lib/jME2_0_1-Stable/src/com/jme/input/thirdperson/ThirdPersonMouseLook.java", "license": "mit", "size": 20047 }
[ "com.jme.math.FastMath", "com.jme.math.Vector3f" ]
import com.jme.math.FastMath; import com.jme.math.Vector3f;
import com.jme.math.*;
[ "com.jme.math" ]
com.jme.math;
708,608
public void removeName(org.ontoware.rdf2go.model.node.Node value) { Base.remove(this.model, this.getResource(), _NAME, value); }
void function(org.ontoware.rdf2go.model.node.Node value) { Base.remove(this.model, this.getResource(), _NAME, value); }
/** * Removes a value of property Name as an RDF2Go node * * @param value * the value to be removed * * [Generated from RDFReactor template rule #remove1dynamic] */
Removes a value of property Name as an RDF2Go node
removeName
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java", "license": "mit", "size": 317844 }
[ "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdfreactor" ]
org.ontoware.rdfreactor;
1,083,823
public Drawer buildForFragment() { if (mUsed) { throw new RuntimeException("you must not reuse a DrawerBuilder builder"); } if (mActivity == null) { throw new RuntimeException("please pass an activity"); } if (mRootView == null) { throw new RuntimeException("please pass the view which should host the DrawerLayout"); } //set that this builder was used. now you have to create a new one mUsed = true; // if the user has not set a drawerLayout use the default one :D if (mDrawerLayout == null) { withDrawerLayout(-1); } //set the drawer here... View originalContentView = mRootView.getChildAt(0); boolean alreadyInflated = originalContentView.getId() == R.id.materialize_root; //only add the new layout if it wasn't done before if (!alreadyInflated) { // remove the contentView mRootView.removeView(originalContentView); } else { //if it was already inflated we have to clean up again mRootView.removeAllViews(); } //create the layoutParams to use for the contentView FrameLayout.LayoutParams layoutParamsContentView = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ); //add the drawer mRootView.addView(mDrawerLayout, layoutParamsContentView); //set the id so we can check if it was already inflated mDrawerLayout.setId(R.id.materialize_root); //handle the navigation stuff of the ActionBarDrawerToggle and the drawer in general handleDrawerNavigation(mActivity, false); //build the view which will be set to the drawer Drawer result = buildView(); // add the slider to the drawer mDrawerLayout.addView(originalContentView, 0); // add the slider to the drawer mDrawerLayout.addView(mSliderLayout, 1); return result; }
Drawer function() { if (mUsed) { throw new RuntimeException(STR); } if (mActivity == null) { throw new RuntimeException(STR); } if (mRootView == null) { throw new RuntimeException(STR); } mUsed = true; if (mDrawerLayout == null) { withDrawerLayout(-1); } View originalContentView = mRootView.getChildAt(0); boolean alreadyInflated = originalContentView.getId() == R.id.materialize_root; if (!alreadyInflated) { mRootView.removeView(originalContentView); } else { mRootView.removeAllViews(); } FrameLayout.LayoutParams layoutParamsContentView = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ); mRootView.addView(mDrawerLayout, layoutParamsContentView); mDrawerLayout.setId(R.id.materialize_root); handleDrawerNavigation(mActivity, false); Drawer result = buildView(); mDrawerLayout.addView(originalContentView, 0); mDrawerLayout.addView(mSliderLayout, 1); return result; }
/** * Build and add the DrawerBuilder to your activity * * @return */
Build and add the DrawerBuilder to your activity
buildForFragment
{ "repo_name": "democedes/MaterialDrawer", "path": "library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java", "license": "apache-2.0", "size": 61635 }
[ "android.view.View", "android.view.ViewGroup", "android.widget.FrameLayout" ]
import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
875,813
Object fromStyleConstants(StyleConstants key, Object value) { if (value.equals(Boolean.TRUE)) { return parseCssValue("bold"); } return parseCssValue("normal"); }
Object fromStyleConstants(StyleConstants key, Object value) { if (value.equals(Boolean.TRUE)) { return parseCssValue("bold"); } return parseCssValue(STR); }
/** * Converts a <code>StyleConstants</code> attribute value to * a CSS attribute value. If there is no conversion * returns <code>null</code>. By default, there is no conversion. * * @param key the <code>StyleConstants</code> attribute * @param value the value of a <code>StyleConstants</code> * attribute to be converted * @return the CSS value that represents the * <code>StyleConstants</code> value */
Converts a <code>StyleConstants</code> attribute value to a CSS attribute value. If there is no conversion returns <code>null</code>. By default, there is no conversion
fromStyleConstants
{ "repo_name": "md-5/jdk10", "path": "src/java.desktop/share/classes/javax/swing/text/html/CSS.java", "license": "gpl-2.0", "size": 136569 }
[ "javax.swing.text.StyleConstants" ]
import javax.swing.text.StyleConstants;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
233,029
@Override public LoggingObjectInterface getParent() { return null; }
LoggingObjectInterface function() { return null; }
/** * Gets the interface to the parent log object. For AbstractMeta, this method always returns null. * * @return null * @see org.pentaho.di.core.logging.LoggingObjectInterface#getParent() */
Gets the interface to the parent log object. For AbstractMeta, this method always returns null
getParent
{ "repo_name": "AlexanderBuloichik/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/base/AbstractMeta.java", "license": "apache-2.0", "size": 55258 }
[ "org.pentaho.di.core.logging.LoggingObjectInterface" ]
import org.pentaho.di.core.logging.LoggingObjectInterface;
import org.pentaho.di.core.logging.*;
[ "org.pentaho.di" ]
org.pentaho.di;
444,983
super.init(config); try { fopFactory = FopFactory.newInstance(); String fopConfigPath = config.getServletContext().getRealPath("/WEB-INF/jpivot/print/userconfig-0.95.xml"); fopFactory.setUserConfig(new File(fopConfigPath)); String fontBaseDir = config.getServletContext().getRealPath("/WEB-INF/jpivot/print/"); fopFactory.setFontBaseURL("file:///" + fontBaseDir); fopFactory.setStrictValidation(false); } catch (Exception e) { e.printStackTrace(); logger.info("FOP user config file not loaded"); } }
super.init(config); try { fopFactory = FopFactory.newInstance(); String fopConfigPath = config.getServletContext().getRealPath(STR); fopFactory.setUserConfig(new File(fopConfigPath)); String fontBaseDir = config.getServletContext().getRealPath(STR); fopFactory.setFontBaseURL(STRFOP user config file not loaded"); } }
/** Initializes the servlet. */
Initializes the servlet
init
{ "repo_name": "leocockroach/JasperServer5.6", "path": "jasperserver-war-jar/src/main/java/com/jaspersoft/jasperserver/war/OlapPrint.java", "license": "gpl-2.0", "size": 14840 }
[ "java.io.File", "org.apache.fop.apps.FopFactory" ]
import java.io.File; import org.apache.fop.apps.FopFactory;
import java.io.*; import org.apache.fop.apps.*;
[ "java.io", "org.apache.fop" ]
java.io; org.apache.fop;
2,320,524
public void checkClosing() throws IllegalStateException { if (closing) { throw new IllegalStateException("Connection is closed or closing"); } }
void function() throws IllegalStateException { if (closing) { throw new IllegalStateException(STR); } }
/** * Checks if the connection close is in-progress or already completed. * * @throws IllegalStateException * If the connection close is in-progress or already completed. */
Checks if the connection close is in-progress or already completed
checkClosing
{ "repo_name": "awslabs/amazon-sqs-java-messaging-lib", "path": "src/main/java/com/amazon/sqs/javamessaging/SQSConnection.java", "license": "apache-2.0", "size": 20068 }
[ "javax.jms.IllegalStateException" ]
import javax.jms.IllegalStateException;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
2,379,297
private void unlockHelper(String token, String docId, boolean force) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException { log.debug("unlock({}, {}, {})", new Object[] { token, docId, force }); Authentication auth = null, oldAuth = null; String action = force ? "FORCE_UNLOCK_DOCUMENT" : "UNLOCK_DOCUMENT"; String docPath = null; String docUuid = null; try { if (token == null) { auth = PrincipalUtils.getAuthentication(); } else { oldAuth = PrincipalUtils.getAuthentication(); auth = PrincipalUtils.getAuthenticationByToken(token); } if (PathUtils.isPath(docId)) { docPath = docId; docUuid = NodeBaseDAO.getInstance().getUuidFromPath(docId); } else { docPath = NodeBaseDAO.getInstance().getPathFromUuid(docId); docUuid = docId; } NodeDocument docNode = NodeDocumentDAO.getInstance().findByPk(docUuid); NodeDocumentDAO.getInstance().unlock(auth.getName(), docUuid, force); // Check subscriptions BaseNotificationModule.checkSubscriptions(docNode, auth.getName(), action, null); // Activity log UserActivity.log(auth.getName(), action, docUuid, docPath, null); } catch (DatabaseException e) { throw e; } finally { if (token != null) { PrincipalUtils.setAuthentication(oldAuth); } } log.debug("unlock: void"); }
void function(String token, String docId, boolean force) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException { log.debug(STR, new Object[] { token, docId, force }); Authentication auth = null, oldAuth = null; String action = force ? STR : STR; String docPath = null; String docUuid = null; try { if (token == null) { auth = PrincipalUtils.getAuthentication(); } else { oldAuth = PrincipalUtils.getAuthentication(); auth = PrincipalUtils.getAuthenticationByToken(token); } if (PathUtils.isPath(docId)) { docPath = docId; docUuid = NodeBaseDAO.getInstance().getUuidFromPath(docId); } else { docPath = NodeBaseDAO.getInstance().getPathFromUuid(docId); docUuid = docId; } NodeDocument docNode = NodeDocumentDAO.getInstance().findByPk(docUuid); NodeDocumentDAO.getInstance().unlock(auth.getName(), docUuid, force); BaseNotificationModule.checkSubscriptions(docNode, auth.getName(), action, null); UserActivity.log(auth.getName(), action, docUuid, docPath, null); } catch (DatabaseException e) { throw e; } finally { if (token != null) { PrincipalUtils.setAuthentication(oldAuth); } } log.debug(STR); }
/** * Implement unlock and forceUnlock features */
Implement unlock and forceUnlock features
unlockHelper
{ "repo_name": "papamas/DMS-KANGREG-XI-MANADO", "path": "src/main/java/com/openkm/module/db/DbDocumentModule.java", "license": "gpl-3.0", "size": 60394 }
[ "com.openkm.core.AccessDeniedException", "com.openkm.core.DatabaseException", "com.openkm.core.LockException", "com.openkm.core.PathNotFoundException", "com.openkm.core.RepositoryException", "com.openkm.dao.NodeBaseDAO", "com.openkm.dao.NodeDocumentDAO", "com.openkm.dao.bean.NodeDocument", "com.openkm.module.db.base.BaseNotificationModule", "com.openkm.spring.PrincipalUtils", "com.openkm.util.PathUtils", "com.openkm.util.UserActivity", "org.springframework.security.core.Authentication" ]
import com.openkm.core.AccessDeniedException; import com.openkm.core.DatabaseException; import com.openkm.core.LockException; import com.openkm.core.PathNotFoundException; import com.openkm.core.RepositoryException; import com.openkm.dao.NodeBaseDAO; import com.openkm.dao.NodeDocumentDAO; import com.openkm.dao.bean.NodeDocument; import com.openkm.module.db.base.BaseNotificationModule; import com.openkm.spring.PrincipalUtils; import com.openkm.util.PathUtils; import com.openkm.util.UserActivity; import org.springframework.security.core.Authentication;
import com.openkm.core.*; import com.openkm.dao.*; import com.openkm.dao.bean.*; import com.openkm.module.db.base.*; import com.openkm.spring.*; import com.openkm.util.*; import org.springframework.security.core.*;
[ "com.openkm.core", "com.openkm.dao", "com.openkm.module", "com.openkm.spring", "com.openkm.util", "org.springframework.security" ]
com.openkm.core; com.openkm.dao; com.openkm.module; com.openkm.spring; com.openkm.util; org.springframework.security;
268,321
@SuppressWarnings("unused") // called from runtime.scm public static <T> OptionList<T> castToEnum(T value, Symbol className) { String classNameStr = stripEnumSuffix(className.getName()); try { Class<?> clazz = Class.forName(classNameStr); if (!OptionList.class.isAssignableFrom(clazz)) { // In theory the code generator should never do this, but just in case... throw new IllegalArgumentException(classNameStr + " does not identify an OptionList type."); } for (Method m : clazz.getMethods()) { if ("fromUnderlyingValue".equals(m.getName())) { return (OptionList<T>) m.invoke(clazz, value); } } return null; } catch (ClassNotFoundException e) { return null; } catch (InvocationTargetException e) { return null; } catch (IllegalAccessException e) { return null; } }
@SuppressWarnings(STR) static <T> OptionList<T> function(T value, Symbol className) { String classNameStr = stripEnumSuffix(className.getName()); try { Class<?> clazz = Class.forName(classNameStr); if (!OptionList.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(classNameStr + STR); } for (Method m : clazz.getMethods()) { if (STR.equals(m.getName())) { return (OptionList<T>) m.invoke(clazz, value); } } return null; } catch (ClassNotFoundException e) { return null; } catch (InvocationTargetException e) { return null; } catch (IllegalAccessException e) { return null; } }
/** * Cast a raw value of a option block into its enumeration value. * * @param value the raw value of the block * @param className the target enum for looking up the value * @param <T> the underlying type of the OptionList * @return the corresponding enum value, or null if the value isn't found */
Cast a raw value of a option block into its enumeration value
castToEnum
{ "repo_name": "jisqyv/appinventor-sources", "path": "appinventor/components/src/com/google/appinventor/components/runtime/util/TypeUtil.java", "license": "apache-2.0", "size": 2568 }
[ "com.google.appinventor.components.common.OptionList", "gnu.mapping.Symbol", "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method" ]
import com.google.appinventor.components.common.OptionList; import gnu.mapping.Symbol; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import com.google.appinventor.components.common.*; import gnu.mapping.*; import java.lang.reflect.*;
[ "com.google.appinventor", "gnu.mapping", "java.lang" ]
com.google.appinventor; gnu.mapping; java.lang;
1,923,122
@SuppressWarnings( "unused" ) private static boolean isEmptyString( AtomicValue lv ) throws XPathException { if( Type.subTypeOf( lv.getType(), Type.STRING ) || ( lv.getType() == Type.ATOMIC ) ) { if( lv.getStringValue().length() == 0 ) { return( true ); } } return( false ); }
@SuppressWarnings( STR ) static boolean function( AtomicValue lv ) throws XPathException { if( Type.subTypeOf( lv.getType(), Type.STRING ) ( lv.getType() == Type.ATOMIC ) ) { if( lv.getStringValue().length() == 0 ) { return( true ); } } return( false ); }
/** * DOCUMENT ME! * * @param lv * * @return Whether or not <code>lv</code> is an empty string * * @throws XPathException */
DOCUMENT ME
isEmptyString
{ "repo_name": "ambs/exist", "path": "exist-core/src/main/java/org/exist/xquery/GeneralComparison.java", "license": "lgpl-2.1", "size": 53949 }
[ "org.exist.xquery.value.AtomicValue", "org.exist.xquery.value.Type" ]
import org.exist.xquery.value.AtomicValue; import org.exist.xquery.value.Type;
import org.exist.xquery.value.*;
[ "org.exist.xquery" ]
org.exist.xquery;
2,740,629
//------------------------- AUTOGENERATED START ------------------------- public static SwaptionSabrSensitivity.Meta meta() { return SwaptionSabrSensitivity.Meta.INSTANCE; } static { MetaBean.register(SwaptionSabrSensitivity.Meta.INSTANCE); } private static final long serialVersionUID = 1L; private SwaptionSabrSensitivity( SwaptionVolatilitiesName volatilitiesName, double expiry, double tenor, SabrParameterType sensitivityType, Currency currency, double sensitivity) { JodaBeanUtils.notNull(volatilitiesName, "volatilitiesName"); JodaBeanUtils.notNull(expiry, "expiry"); this.volatilitiesName = volatilitiesName; this.expiry = expiry; this.tenor = tenor; this.sensitivityType = sensitivityType; this.currency = currency; this.sensitivity = sensitivity; }
static SwaptionSabrSensitivity.Meta function() { return SwaptionSabrSensitivity.Meta.INSTANCE; } static { MetaBean.register(SwaptionSabrSensitivity.Meta.INSTANCE); } private static final long serialVersionUID = 1L; private SwaptionSabrSensitivity( SwaptionVolatilitiesName volatilitiesName, double expiry, double tenor, SabrParameterType sensitivityType, Currency currency, double sensitivity) { JodaBeanUtils.notNull(volatilitiesName, STR); JodaBeanUtils.notNull(expiry, STR); this.volatilitiesName = volatilitiesName; this.expiry = expiry; this.tenor = tenor; this.sensitivityType = sensitivityType; this.currency = currency; this.sensitivity = sensitivity; }
/** * The meta-bean for {@code SwaptionSabrSensitivity}. * @return the meta-bean, not null */
The meta-bean for SwaptionSabrSensitivity
meta
{ "repo_name": "OpenGamma/Strata", "path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/swaption/SwaptionSabrSensitivity.java", "license": "apache-2.0", "size": 19164 }
[ "com.opengamma.strata.basics.currency.Currency", "com.opengamma.strata.market.model.SabrParameterType", "org.joda.beans.JodaBeanUtils", "org.joda.beans.MetaBean" ]
import com.opengamma.strata.basics.currency.Currency; import com.opengamma.strata.market.model.SabrParameterType; import org.joda.beans.JodaBeanUtils; import org.joda.beans.MetaBean;
import com.opengamma.strata.basics.currency.*; import com.opengamma.strata.market.model.*; import org.joda.beans.*;
[ "com.opengamma.strata", "org.joda.beans" ]
com.opengamma.strata; org.joda.beans;
2,199,506
boolean match(InetSocketAddress addr) { int port = addr.getPort(); Collection<Integer> ports = addrs.get(addr.getAddress()); boolean exactMatch = ports.contains(port); boolean genericMatch = ports.contains(0); return exactMatch || genericMatch; }
boolean match(InetSocketAddress addr) { int port = addr.getPort(); Collection<Integer> ports = addrs.get(addr.getAddress()); boolean exactMatch = ports.contains(port); boolean genericMatch = ports.contains(0); return exactMatch genericMatch; }
/** * The function that checks whether there exists an entry foo in the set * so that addr &lt;= foo. */
The function that checks whether there exists an entry foo in the set so that addr &lt;= foo
match
{ "repo_name": "JingchengDu/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/HostSet.java", "license": "apache-2.0", "size": 3618 }
[ "java.net.InetSocketAddress", "java.util.Collection" ]
import java.net.InetSocketAddress; import java.util.Collection;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
2,461,247
public String[] getGroupPermissions(String groupName) throws UserStoreException, RolePermissionException { return SCIMCommonComponentHolder.getRolePermissionManagementService().getRolePermissions(groupName, carbonUM.getTenantId()); }
String[] function(String groupName) throws UserStoreException, RolePermissionException { return SCIMCommonComponentHolder.getRolePermissionManagementService().getRolePermissions(groupName, carbonUM.getTenantId()); }
/** * Get permissions of a group. * * @param groupName group name. * @return String[] of permissions. * @throws UserStoreException * @throws RolePermissionException */
Get permissions of a group
getGroupPermissions
{ "repo_name": "wso2-extensions/identity-inbound-provisioning-scim2", "path": "components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java", "license": "apache-2.0", "size": 296414 }
[ "org.wso2.carbon.identity.scim2.common.internal.SCIMCommonComponentHolder", "org.wso2.carbon.user.api.UserStoreException", "org.wso2.carbon.user.mgt.RolePermissionException" ]
import org.wso2.carbon.identity.scim2.common.internal.SCIMCommonComponentHolder; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.mgt.RolePermissionException;
import org.wso2.carbon.identity.scim2.common.internal.*; import org.wso2.carbon.user.api.*; import org.wso2.carbon.user.mgt.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,068,247