method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
protected void renderCheckboxTag(PageContext pageContext, Tag parentTag) throws JspException {
checkboxTag.setPageContext(pageContext);
checkboxTag.setParent(parentTag);
checkboxTag.setProperty(getFieldName());
checkboxTag.setTitle(this.getAccessibleTitle());
checkboxTag.setOnblur(this.buildOnBlur());
checkboxTag.setStyleId(getFieldName());
checkboxTag.setPageContext(pageContext);
checkboxTag.setParent(parentTag);
checkboxTag.doStartTag();
checkboxTag.doEndTag();
}
| void function(PageContext pageContext, Tag parentTag) throws JspException { checkboxTag.setPageContext(pageContext); checkboxTag.setParent(parentTag); checkboxTag.setProperty(getFieldName()); checkboxTag.setTitle(this.getAccessibleTitle()); checkboxTag.setOnblur(this.buildOnBlur()); checkboxTag.setStyleId(getFieldName()); checkboxTag.setPageContext(pageContext); checkboxTag.setParent(parentTag); checkboxTag.doStartTag(); checkboxTag.doEndTag(); } | /**
* Renders the checkbox portion of this checkbox tag
* @param pageContext the page context to render to
* @param parentTag the parent tag requesting all this rendering
* @param propertyPrefix the property from the form to the business object
*/ | Renders the checkbox portion of this checkbox tag | renderCheckboxTag | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/sys/document/web/renderers/CheckboxRenderer.java",
"license": "agpl-3.0",
"size": 3240
} | [
"javax.servlet.jsp.JspException",
"javax.servlet.jsp.PageContext",
"javax.servlet.jsp.tagext.Tag"
] | import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.Tag; | import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; | [
"javax.servlet"
] | javax.servlet; | 1,195,086 |
public static void login(final Configuration conf,
final String keytabFileKey, final String userNameKey, String hostname)
throws IOException {
String keytabFilename = conf.get(keytabFileKey);
if (keytabFilename == null)
return;
String principalConfig = conf.get(userNameKey, System
.getProperty("user.name"));
String principalName = SecurityUtil.getServerPrincipal(principalConfig,
hostname);
UserGroupInformation.loginUserFromKeytab(principalName, keytabFilename);
} | static void function(final Configuration conf, final String keytabFileKey, final String userNameKey, String hostname) throws IOException { String keytabFilename = conf.get(keytabFileKey); if (keytabFilename == null) return; String principalConfig = conf.get(userNameKey, System .getProperty(STR)); String principalName = SecurityUtil.getServerPrincipal(principalConfig, hostname); UserGroupInformation.loginUserFromKeytab(principalName, keytabFilename); } | /**
* If a keytab has been provided, login as that user. Substitute $host in
* user's Kerberos principal name with hostname.
*
* @param conf
* conf to use
* @param keytabFileKey
* the key to look for keytab file in conf
* @param userNameKey
* the key to look for user's Kerberos principal name in conf
* @param hostname
* hostname to use for substitution
* @throws IOException if login fails
*/ | If a keytab has been provided, login as that user. Substitute $host in user's Kerberos principal name with hostname | login | {
"repo_name": "wzhuo918/release-1.1.2-MDP",
"path": "src/core/org/apache/hadoop/security/SecurityUtil.java",
"license": "apache-2.0",
"size": 22737
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; | import java.io.*; import org.apache.hadoop.conf.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 52,718 |
@ApiModelProperty(value = "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `operations/some/unique/name`.")
public String getName() {
return name;
} | @ApiModelProperty(value = STR) String function() { return name; } | /**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `operations/some/unique/name`.
* @return name
**/ | The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `operations/some/unique/name` | getName | {
"repo_name": "grafeas/client-java",
"path": "src/main/java/io/grafeas/model/LongrunningOperation.java",
"license": "apache-2.0",
"size": 7107
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 1,011,736 |
if (headElements == null) {
headElements = super.getHeadElements();
Context context = getContext();
String versionIndicator = ClickUtils.getResourceVersionIndicator(context);
headElements.add(new CssImport("/assets/css/separator.css", versionIndicator));
}
return headElements;
}
| if (headElements == null) { headElements = super.getHeadElements(); Context context = getContext(); String versionIndicator = ClickUtils.getResourceVersionIndicator(context); headElements.add(new CssImport(STR, versionIndicator)); } return headElements; } | /**
* Returns the FieldSeparator HTML HEAD elements for the
* <tt>click/control.css</tt> resource.
*
* @see org.apache.click.Control#getHeadElements()
*
* @return the list of HEAD elements to be included in the page
*/ | Returns the FieldSeparator HTML HEAD elements for the click/control.css resource | getHeadElements | {
"repo_name": "medgar/click",
"path": "examples/src/org/apache/click/examples/control/FieldSeparator.java",
"license": "apache-2.0",
"size": 2775
} | [
"org.apache.click.Context",
"org.apache.click.element.CssImport",
"org.apache.click.util.ClickUtils"
] | import org.apache.click.Context; import org.apache.click.element.CssImport; import org.apache.click.util.ClickUtils; | import org.apache.click.*; import org.apache.click.element.*; import org.apache.click.util.*; | [
"org.apache.click"
] | org.apache.click; | 2,682,071 |
@ServiceMethod(returns = ReturnType.SINGLE)
AgentPoolInner create(
String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, Context context); | @ServiceMethod(returns = ReturnType.SINGLE) AgentPoolInner create( String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, Context context); | /**
* Creates an agent pool for a container registry with the specified parameters.
*
* @param resourceGroupName The name of the resource group to which the container registry belongs.
* @param registryName The name of the container registry.
* @param agentPoolName The name of the agent pool.
* @param agentPool The parameters of an agent pool that needs to scheduled.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the agentpool that has the ARM resource and properties.
*/ | Creates an agent pool for a container registry with the specified parameters | create | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/AgentPoolsClient.java",
"license": "mit",
"size": 30427
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.containerregistry.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 746,447 |
public void testUseLocalSessionState() throws Exception {
Properties props = new Properties();
props.setProperty("useLocalSessionState", "true");
props.setProperty("profileSQL", "true");
props.setProperty("logFactory", "com.mysql.jdbc.log.StandardLogger");
Connection conn1 = getConnectionWithProps(props);
conn1.setAutoCommit(true);
conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
StandardLogger.saveLogsToBuffer();
StandardLogger.bufferedLog.setLength(0);
conn1.setAutoCommit(true);
conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
conn1.getTransactionIsolation();
String logAsString = StandardLogger.bufferedLog.toString();
assertTrue(logAsString.indexOf("SET SESSION") == -1
&& logAsString.indexOf("SHOW VARIABLES LIKE 'tx_isolation'") == -1
&& logAsString.indexOf("SET autocommit=") == -1);
} | void function() throws Exception { Properties props = new Properties(); props.setProperty(STR, "true"); props.setProperty(STR, "true"); props.setProperty(STR, STR); Connection conn1 = getConnectionWithProps(props); conn1.setAutoCommit(true); conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ); StandardLogger.saveLogsToBuffer(); StandardLogger.bufferedLog.setLength(0); conn1.setAutoCommit(true); conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ); conn1.getTransactionIsolation(); String logAsString = StandardLogger.bufferedLog.toString(); assertTrue(logAsString.indexOf(STR) == -1 && logAsString.indexOf(STR) == -1 && logAsString.indexOf(STR) == -1); } | /**
* Tests whether or not the configuration 'useLocalSessionState' actually
* prevents non-needed 'set autocommit=', 'set session transaction isolation
* ...' and 'show variables like tx_isolation' queries.
*
* @throws Exception
* if the test fails.
*/ | Tests whether or not the configuration 'useLocalSessionState' actually prevents non-needed 'set autocommit=', 'set session transaction isolation ...' and 'show variables like tx_isolation' queries | testUseLocalSessionState | {
"repo_name": "AbstractedSheep/Shuttle-Tracker",
"path": "server/java/mysql-connector-java-5.1.14/src/testsuite/simple/ConnectionTest.java",
"license": "gpl-3.0",
"size": 59161
} | [
"com.mysql.jdbc.log.StandardLogger",
"java.sql.Connection",
"java.util.Properties"
] | import com.mysql.jdbc.log.StandardLogger; import java.sql.Connection; import java.util.Properties; | import com.mysql.jdbc.log.*; import java.sql.*; import java.util.*; | [
"com.mysql.jdbc",
"java.sql",
"java.util"
] | com.mysql.jdbc; java.sql; java.util; | 487,119 |
KeyStroke getDefaultDeleteKeyStroke();
| KeyStroke getDefaultDeleteKeyStroke(); | /**
* Gets the default {@link KeyStroke} used to delete items (e.g. {@code HistoryReference}, {@code Alert}) show in the
* view (e.g. History tab, Alerts tree).
*
* @return the {@code KeyStroke} to delete items.
* @since 2.7.0
*/ | Gets the default <code>KeyStroke</code> used to delete items (e.g. HistoryReference, Alert) show in the view (e.g. History tab, Alerts tree) | getDefaultDeleteKeyStroke | {
"repo_name": "zapbot/zaproxy",
"path": "src/org/parosproxy/paros/extension/ViewDelegate.java",
"license": "apache-2.0",
"size": 5356
} | [
"javax.swing.KeyStroke"
] | import javax.swing.KeyStroke; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 627,092 |
public APIBuilder tags(Set<String> tags) {
this.tags = tags;
return this;
} | APIBuilder function(Set<String> tags) { this.tags = tags; return this; } | /**
* Sets the {@code tags} and returns a reference to this APIBuilder so that the methods can be chained together.
*
* @param tags the {@code tags} to set
* @return a reference to this APIBuilder
*/ | Sets the tags and returns a reference to this APIBuilder so that the methods can be chained together | tags | {
"repo_name": "abimarank/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.core/src/main/java/org/wso2/carbon/apimgt/core/models/API.java",
"license": "apache-2.0",
"size": 36909
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 17,460 |
@Override
public void removeHandshakeCompletedListener(
HandshakeCompletedListener listener) {
if (listener == null) {
throw new IllegalArgumentException("Provided listener is null");
}
if (listeners == null) {
throw new IllegalArgumentException(
"Provided listener is not registered");
}
if (!listeners.remove(listener)) {
throw new IllegalArgumentException(
"Provided listener is not registered");
}
} | void function( HandshakeCompletedListener listener) { if (listener == null) { throw new IllegalArgumentException(STR); } if (listeners == null) { throw new IllegalArgumentException( STR); } if (!listeners.remove(listener)) { throw new IllegalArgumentException( STR); } } | /**
* This method works according to the specification of implemented class.
*
* @see javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener)
* method documentation for more information
*/ | This method works according to the specification of implemented class | removeHandshakeCompletedListener | {
"repo_name": "webos21/xi",
"path": "java/jcl/src/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java",
"license": "apache-2.0",
"size": 25837
} | [
"javax.net.ssl.HandshakeCompletedListener"
] | import javax.net.ssl.HandshakeCompletedListener; | import javax.net.ssl.*; | [
"javax.net"
] | javax.net; | 549,826 |
public boolean performItemClick(View view, int sectionIndex, int positionInSection, long id) {
if (mOnItemClickListener != null) {
// playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemClickListener.onItemClick(this, getFreeFlowItemForVisibleItemAt(sectionIndex, positionInSection));
return true;
}
return false;
}
OnItemSelectedListener mOnItemSelectedListener; | boolean function(View view, int sectionIndex, int positionInSection, long id) { if (mOnItemClickListener != null) { if (view != null) { view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); } mOnItemClickListener.onItemClick(this, getFreeFlowItemForVisibleItemAt(sectionIndex, positionInSection)); return true; } return false; } OnItemSelectedListener mOnItemSelectedListener; | /**
* Call the OnItemClickListener, if it is defined. Performs all normal
* actions associated with clicking: reporting accessibility event, playing
* a sound, etc.
*
* @param view
* The view within the AdapterView that was clicked.
* @param position
* The position of the view in the adapter.
* @param id
* The row id of the item that was clicked.
* @return True if there was an assigned OnItemClickListener that was
* called, false otherwise is returned.
*/ | Call the OnItemClickListener, if it is defined. Performs all normal actions associated with clicking: reporting accessibility event, playing a sound, etc | performItemClick | {
"repo_name": "cymcsg/UltimateAndroid",
"path": "deprecated/UltimateAndroidNormal/UltimateAndroidUi/src/com/marshalchen/common/uimodule/freeflow/core/AbsLayoutContainer.java",
"license": "apache-2.0",
"size": 10263
} | [
"android.view.View",
"android.view.accessibility.AccessibilityEvent"
] | import android.view.View; import android.view.accessibility.AccessibilityEvent; | import android.view.*; import android.view.accessibility.*; | [
"android.view"
] | android.view; | 2,065,854 |
@ManyToMany(mappedBy = "roles")
public Set<AppUser> getUsers() {
return users;
}
| @ManyToMany(mappedBy = "roles") Set<AppUser> function() { return users; } | /**
* This method is used to get users
*
* @return Set This returns users
* @version 1.0
*/ | This method is used to get users | getUsers | {
"repo_name": "DIR-FRT/SampleWebApplication",
"path": "src/main/java/fpt/dir/sampleweb/model/Role.java",
"license": "mit",
"size": 1492
} | [
"java.util.Set",
"javax.persistence.ManyToMany"
] | import java.util.Set; import javax.persistence.ManyToMany; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 2,574,605 |
void registerCustomEMC(ItemStack stack, int value); | void registerCustomEMC(ItemStack stack, int value); | /**
* Registers a custom EMC value for this ItemStack
* Call this during any of the main loading phases (Preinit, Init, Postinit)
* @param stack The stack we want to define EMC for
* @param value The value to define. Values below 0 are changed to 0
*/ | Registers a custom EMC value for this ItemStack Call this during any of the main loading phases (Preinit, Init, Postinit) | registerCustomEMC | {
"repo_name": "mengy007/MrFusion-1.8.9",
"path": "src/main/java/moze_intel/projecte/api/proxy/IEMCProxy.java",
"license": "lgpl-2.1",
"size": 3538
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 2,255,372 |
public static native byte[] lgetxattr(String path, String name)
throws IOException; | static native byte[] function(String path, String name) throws IOException; | /**
* Native wrapper around Linux lgetxattr(2) syscall. (Like getxattr, but
* does not follow symbolic links.)
*
* @param path the file whose extended attribute is to be returned.
* @param name the name of the extended attribute key.
* @return the value of the extended attribute associated with 'path', if
* any, or null if no such attribute is defined (ENODATA).
* @throws IOException if the call failed for any other reason.
*/ | Native wrapper around Linux lgetxattr(2) syscall. (Like getxattr, but does not follow symbolic links.) | lgetxattr | {
"repo_name": "Asana/bazel",
"path": "src/main/java/com/google/devtools/build/lib/unix/NativePosixFiles.java",
"license": "apache-2.0",
"size": 15575
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,145,034 |
public void putKvs(com.actiontech.dble.alarm.UcoreInterface.PutKvsInput request,
io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_PUT_KVS, getCallOptions()), request, responseObserver);
} | void function(com.actiontech.dble.alarm.UcoreInterface.PutKvsInput request, io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_PUT_KVS, getCallOptions()), request, responseObserver); } | /**
* <pre>
* PutKvs guarantee atomic.
* </pre>
*/ | <code> PutKvs guarantee atomic. </code> | putKvs | {
"repo_name": "actiontech/dble",
"path": "src/main/java/com/actiontech/dble/alarm/UcoreGrpc.java",
"license": "gpl-2.0",
"size": 134635
} | [
"io.grpc.stub.ClientCalls",
"io.grpc.stub.ServerCalls"
] | import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 1,859,867 |
public static CommandIndex forGroup(Path.Command command) {
return new CommandIndex(command, null, true);
} | static CommandIndex function(Path.Command command) { return new CommandIndex(command, null, true); } | /**
* Same as {@link #forCommand}, except that group selection is to be preferred when
* resolving to a tree node.
*/ | Same as <code>#forCommand</code>, except that group selection is to be preferred when resolving to a tree node | forGroup | {
"repo_name": "pmuetschard/gapid",
"path": "gapic/src/main/com/google/gapid/models/CommandStream.java",
"license": "apache-2.0",
"size": 15642
} | [
"com.google.gapid.proto.service.path.Path"
] | import com.google.gapid.proto.service.path.Path; | import com.google.gapid.proto.service.path.*; | [
"com.google.gapid"
] | com.google.gapid; | 1,473,689 |
public static String decode(String str) {
try {
return URLDecoder.decode(str, "UTF-8");
} catch (UnsupportedEncodingException e) {
//should never happen
throw new RuntimeException(e);
}
} | static String function(String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } | /**
* Decodes a string
* @param str the string
* @return the decoded string
*/ | Decodes a string | decode | {
"repo_name": "Klortho/citeproc-java",
"path": "citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/PercentEncoding.java",
"license": "apache-2.0",
"size": 1560
} | [
"java.io.UnsupportedEncodingException",
"java.net.URLDecoder"
] | import java.io.UnsupportedEncodingException; import java.net.URLDecoder; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 947,269 |
public static List<EntitlementServerGroup> listEntitlementGroups(Server s) {
return listServerGroups(s, "ServerGroup.lookupEntitlementGroupsByServer");
} | static List<EntitlementServerGroup> function(Server s) { return listServerGroups(s, STR); } | /**
* Returns the list of Entitlement ServerGroups associated to a server.
* @param s the server to find the server groups of
* @return list of EntitlementServerGroup objects that are associated to
* the server.
*/ | Returns the list of Entitlement ServerGroups associated to a server | listEntitlementGroups | {
"repo_name": "xkollar/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java",
"license": "gpl-2.0",
"size": 13191
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,343,400 |
public void testCertificateParsingException06() {
CertificateParsingException tE = new CertificateParsingException(null,
null);
assertNull("getMessage() must return null", tE.getMessage());
assertNull("getCause() must return null", tE.getCause());
}
| void function() { CertificateParsingException tE = new CertificateParsingException(null, null); assertNull(STR, tE.getMessage()); assertNull(STR, tE.getCause()); } | /**
* Test for <code>CertificateParsingException(String, Throwable)</code>
* constructor Assertion: constructs CertificateParsingException when
* <code>cause</code> is null <code>msg</code> is null
*/ | Test for <code>CertificateParsingException(String, Throwable)</code> constructor Assertion: constructs CertificateParsingException when <code>cause</code> is null <code>msg</code> is null | testCertificateParsingException06 | {
"repo_name": "shannah/cn1",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateParsingExceptionTest.java",
"license": "gpl-2.0",
"size": 7838
} | [
"java.security.cert.CertificateParsingException"
] | import java.security.cert.CertificateParsingException; | import java.security.cert.*; | [
"java.security"
] | java.security; | 1,999,955 |
public static void copyInternalVector2(FloatBuffer buf, int fromPos, int toPos) {
copyInternal(buf, fromPos * 2, toPos * 2, 2);
}
| static void function(FloatBuffer buf, int fromPos, int toPos) { copyInternal(buf, fromPos * 2, toPos * 2, 2); } | /**
* Copies a Vector2f from one position in the buffer to another. The index
* values are in terms of vector number (eg, vector number 0 is positions
* 0-1 in the FloatBuffer.)
*
* @param buf
* the buffer to copy from/to
* @param fromPos
* the index of the vector to copy
* @param toPos
* the index to copy the vector to
*/ | Copies a Vector2f from one position in the buffer to another. The index values are in terms of vector number (eg, vector number 0 is positions 0-1 in the FloatBuffer.) | copyInternalVector2 | {
"repo_name": "asiermarzo/Ultraino",
"path": "AcousticFieldSim/src/acousticfield3d/utils/BufferUtils.java",
"license": "mit",
"size": 44937
} | [
"java.nio.FloatBuffer"
] | import java.nio.FloatBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,063,803 |
public Node clonePropsFrom(Node other) {
Preconditions.checkState(this.propListHead == null,
"Node has existing properties.");
this.propListHead = other.propListHead;
return this;
} | Node function(Node other) { Preconditions.checkState(this.propListHead == null, STR); this.propListHead = other.propListHead; return this; } | /**
* Clone the properties from the provided node without copying
* the property object. The receiving node may not have any
* existing properties.
* @param other The node to clone properties from.
* @return this node.
*/ | Clone the properties from the provided node without copying the property object. The receiving node may not have any existing properties | clonePropsFrom | {
"repo_name": "PengXing/closure-compiler",
"path": "src/com/google/javascript/rhino/Node.java",
"license": "apache-2.0",
"size": 66192
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 2,202,034 |
return Arrays.stream(fieldTypes).collect(Collectors.toMap(
ft -> ft.name() + "-alias",
Function.identity()));
} | return Arrays.stream(fieldTypes).collect(Collectors.toMap( ft -> ft.name() + STR, Function.identity())); } | /**
* For each provided field type, we also register an alias with name {@code <field>-alias}.
*/ | For each provided field type, we also register an alias with name -alias | getFieldAliases | {
"repo_name": "coding0011/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java",
"license": "apache-2.0",
"size": 42029
} | [
"java.util.Arrays",
"java.util.function.Function",
"java.util.stream.Collectors"
] | import java.util.Arrays; import java.util.function.Function; import java.util.stream.Collectors; | import java.util.*; import java.util.function.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 2,229,823 |
public void setBlacklistForAlbumArtist(String albumArtistName, boolean blacklist) {
String where = SONG_ALBUM_ARTIST + "=" + "'" + albumArtistName.replace("'", "''") + "'";
ContentValues values = new ContentValues();
values.put(BLACKLIST_STATUS, blacklist);
getDatabase().update(MUSIC_LIBRARY_TABLE, values, where, null);
} | void function(String albumArtistName, boolean blacklist) { String where = SONG_ALBUM_ARTIST + "=" + "'" + albumArtistName.replace("'", "''") + "'"; ContentValues values = new ContentValues(); values.put(BLACKLIST_STATUS, blacklist); getDatabase().update(MUSIC_LIBRARY_TABLE, values, where, null); } | /**
* Sets the blacklist status of the specified album artist.
*/ | Sets the blacklist status of the specified album artist | setBlacklistForAlbumArtist | {
"repo_name": "yongjiliu/MusicPlayer",
"path": "ACEMusicPlayer/src/main/java/com/aniruddhc/acemusic/player/DBHelpers/DBAccessHelper.java",
"license": "gpl-2.0",
"size": 72380
} | [
"android.content.ContentValues"
] | import android.content.ContentValues; | import android.content.*; | [
"android.content"
] | android.content; | 1,181,007 |
private RulesProgrammingReturnCode uninstallPerHostRules(
HostNodeConnector host) {
RulesProgrammingReturnCode retCode = RulesProgrammingReturnCode.SUCCESS;
Map<NodeConnector, FlowEntry> pos;
FlowEntry po;
// Now program every single switch
for (HostNodePair key : this.rulesDB.keySet()) {
if (host == null || key.getHost().equals(host)) {
pos = this.rulesDB.get(key);
for (Map.Entry<NodeConnector, FlowEntry> e : pos.entrySet()) {
po = e.getValue();
if (po != null) {
// Uninstall the policy
this.frm.uninstallFlowEntry(po);
}
}
this.rulesDB.remove(key);
}
}
return retCode;
} | RulesProgrammingReturnCode function( HostNodeConnector host) { RulesProgrammingReturnCode retCode = RulesProgrammingReturnCode.SUCCESS; Map<NodeConnector, FlowEntry> pos; FlowEntry po; for (HostNodePair key : this.rulesDB.keySet()) { if (host == null key.getHost().equals(host)) { pos = this.rulesDB.get(key); for (Map.Entry<NodeConnector, FlowEntry> e : pos.entrySet()) { po = e.getValue(); if (po != null) { this.frm.uninstallFlowEntry(po); } } this.rulesDB.remove(key); } } return retCode; } | /**
* Cleanup all the host rules for a given host
*
* @param host Host for which the host rules need to be cleaned
* up, the host could be null in that case it match all the hosts
*
* @return a return code that convey the programming status of the HW
*/ | Cleanup all the host rules for a given host | uninstallPerHostRules | {
"repo_name": "lbchen/odl-mod",
"path": "opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java",
"license": "epl-1.0",
"size": 36323
} | [
"java.util.Map",
"org.opendaylight.controller.forwardingrulesmanager.FlowEntry",
"org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector",
"org.opendaylight.controller.sal.core.NodeConnector"
] | import java.util.Map; import org.opendaylight.controller.forwardingrulesmanager.FlowEntry; import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector; import org.opendaylight.controller.sal.core.NodeConnector; | import java.util.*; import org.opendaylight.controller.forwardingrulesmanager.*; import org.opendaylight.controller.hosttracker.*; import org.opendaylight.controller.sal.core.*; | [
"java.util",
"org.opendaylight.controller"
] | java.util; org.opendaylight.controller; | 1,885,220 |
private void setup(String fileName) throws MainException {
File file = new File(fileName+".xsd");
boolean isDone;
try {
if (file.exists()) {
isDone = file.delete();
logger.info("file deleted? " + isDone);
}
isDone = file.createNewFile();
logger.info("file created? " + isDone);
writer = new PrintWriter(new BufferedWriter(new FileWriter(file, false)), true);
} catch (IOException e) {
e.printStackTrace();
throw new MainException("Unable to open file " + fileName);
}
setupDataTypes();
}
| void function(String fileName) throws MainException { File file = new File(fileName+".xsd"); boolean isDone; try { if (file.exists()) { isDone = file.delete(); logger.info(STR + isDone); } isDone = file.createNewFile(); logger.info(STR + isDone); writer = new PrintWriter(new BufferedWriter(new FileWriter(file, false)), true); } catch (IOException e) { e.printStackTrace(); throw new MainException(STR + fileName); } setupDataTypes(); } | /**
* Set up the file I/O connection to write the XML schema to and the global data structures needed
* @param fileName name of the file (including its absolute path)
* @throws MainException if there is a database connection error which occurred at any time during the set up
*/ | Set up the file I/O connection to write the XML schema to and the global data structures needed | setup | {
"repo_name": "boyshawn/CS4221",
"path": "RDB To XML/src/xml/XMLSchemaGenerator.java",
"license": "unlicense",
"size": 19950
} | [
"java.io.BufferedWriter",
"java.io.File",
"java.io.FileWriter",
"java.io.IOException",
"java.io.PrintWriter"
] | import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 518,655 |
public void setValueFont(Font font) {
ParamChecks.nullNotPermitted(font, "font");
this.valueFont = font;
fireChangeEvent();
}
| void function(Font font) { ParamChecks.nullNotPermitted(font, "font"); this.valueFont = font; fireChangeEvent(); } | /**
* Sets the font used to display the value label and sends a
* {@link PlotChangeEvent} to all registered listeners.
*
* @param font the font (<code>null</code> not permitted).
*
* @see #getValueFont()
*/ | Sets the font used to display the value label and sends a <code>PlotChangeEvent</code> to all registered listeners | setValueFont | {
"repo_name": "raincs13/phd",
"path": "source/org/jfree/chart/plot/MeterPlot.java",
"license": "lgpl-2.1",
"size": 44257
} | [
"java.awt.Font",
"org.jfree.chart.util.ParamChecks"
] | import java.awt.Font; import org.jfree.chart.util.ParamChecks; | import java.awt.*; import org.jfree.chart.util.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 2,117,135 |
public CommonStatsFlags clear() {
flags = EnumSet.noneOf(Flag.class);
groups = null;
fieldDataFields = null;
completionDataFields = null;
includeSegmentFileSizes = false;
includeUnloadedSegments = false;
return this;
} | CommonStatsFlags function() { flags = EnumSet.noneOf(Flag.class); groups = null; fieldDataFields = null; completionDataFields = null; includeSegmentFileSizes = false; includeUnloadedSegments = false; return this; } | /**
* Clears all stats.
*/ | Clears all stats | clear | {
"repo_name": "ern/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java",
"license": "apache-2.0",
"size": 6971
} | [
"java.util.EnumSet"
] | import java.util.EnumSet; | import java.util.*; | [
"java.util"
] | java.util; | 739,657 |
@Override
public final boolean retainAll(final Collection<?> collection) {
if (collection != null && collection.size() > 0) {
int j = 0;
T obj;
for (int i = 0; i < this.size; i++) {
obj = this.values[i];
if (collection.contains(obj)) {
this.values[j++] = obj;
}
}
if (this.size != j) {
for (int i = j; i < this.size; i++) {
this.values[i] = null;
}
this.size = j;
return true;
}
}
return false;
} | final boolean function(final Collection<?> collection) { if (collection != null && collection.size() > 0) { int j = 0; T obj; for (int i = 0; i < this.size; i++) { obj = this.values[i]; if (collection.contains(obj)) { this.values[j++] = obj; } } if (this.size != j) { for (int i = j; i < this.size; i++) { this.values[i] = null; } this.size = j; return true; } } return false; } | /**
* Retains all elements in the list that are found in the specified collection.
*
* @param collection
* the {@link Collection} of objects to retain within the list
* @return {@code true} if the list was modified in any way, {@code false} otherwise
*/ | Retains all elements in the list that are found in the specified collection | retainAll | {
"repo_name": "macvelli/RootFramework",
"path": "src/root/adt/ListArraySorted.java",
"license": "apache-2.0",
"size": 24442
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,724,961 |
@Test(expected = MessageReadException.class)
public void shouldFailWhenReadingAnUnknownMessageNumber() throws CommunicationException {
when(client.tryReceiveByte()).thenReturn(UNKNOWN_MESSAGE_NUMBER);
cut.readMessage();
} | @Test(expected = MessageReadException.class) void function() throws CommunicationException { when(client.tryReceiveByte()).thenReturn(UNKNOWN_MESSAGE_NUMBER); cut.readMessage(); } | /**
* Should fail when an arbitrary message should be read next but the message number that was read is unknown.
*
* @throws CommunicationException
* if it is a {@link MessageReadException} it is expected, all other sub-types indicate a test failure.
*/ | Should fail when an arbitrary message should be read next but the message number that was read is unknown | shouldFailWhenReadingAnUnknownMessageNumber | {
"repo_name": "rbi/trading4j",
"path": "server/src/test/java/de/voidnode/trading4j/server/protocol/MessageBasedClientConnectionTest.java",
"license": "gpl-3.0",
"size": 24533
} | [
"de.voidnode.trading4j.server.protocol.exceptions.CommunicationException",
"de.voidnode.trading4j.server.protocol.exceptions.MessageReadException",
"org.junit.Test",
"org.mockito.Mockito"
] | import de.voidnode.trading4j.server.protocol.exceptions.CommunicationException; import de.voidnode.trading4j.server.protocol.exceptions.MessageReadException; import org.junit.Test; import org.mockito.Mockito; | import de.voidnode.trading4j.server.protocol.exceptions.*; import org.junit.*; import org.mockito.*; | [
"de.voidnode.trading4j",
"org.junit",
"org.mockito"
] | de.voidnode.trading4j; org.junit; org.mockito; | 1,585,468 |
public void doGenerate(IProgressMonitor monitor) throws IOException {
if (!targetFolder.getLocation().toFile().exists()) {
targetFolder.getLocation().toFile().mkdirs();
}
monitor.subTask("Loading...");
org.eclipse.cmf.occi.core.gen.connector.main.Main gen0 = new org.eclipse.cmf.occi.core.gen.connector.main.Main(modelURI, targetFolder.getLocation().toFile(), arguments);
monitor.worked(1);
String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.connector", "org.eclipse.cmf.occi.core.gen.connector.main.Main", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
gen0.setGenerationID(generationID);
gen0.doGenerate(BasicMonitor.toMonitor(monitor));
}
| void function(IProgressMonitor monitor) throws IOException { if (!targetFolder.getLocation().toFile().exists()) { targetFolder.getLocation().toFile().mkdirs(); } monitor.subTask(STR); org.eclipse.cmf.occi.core.gen.connector.main.Main gen0 = new org.eclipse.cmf.occi.core.gen.connector.main.Main(modelURI, targetFolder.getLocation().toFile(), arguments); monitor.worked(1); String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID(STR, STR, modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>()); gen0.setGenerationID(generationID); gen0.doGenerate(BasicMonitor.toMonitor(monitor)); } | /**
* Launches the generation.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* Thrown when the output cannot be saved.
* @generated
*/ | Launches the generation | doGenerate | {
"repo_name": "occiware/OCCI-Studio",
"path": "plugins/org.eclipse.cmf.occi.core.gen.connector.ui/src/org/eclipse/cmf/occi/core/gen/connector/ui/common/GenerateAll.java",
"license": "epl-1.0",
"size": 4547
} | [
"java.io.IOException",
"java.util.ArrayList",
"org.eclipse.core.runtime.IProgressMonitor",
"org.eclipse.emf.common.util.BasicMonitor"
] | import java.io.IOException; import java.util.ArrayList; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.common.util.BasicMonitor; | import java.io.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.emf.common.util.*; | [
"java.io",
"java.util",
"org.eclipse.core",
"org.eclipse.emf"
] | java.io; java.util; org.eclipse.core; org.eclipse.emf; | 2,631,039 |
public void setPlayedRole(List<org.hl7.rim.Role> playedRole) { } | public void setPlayedRole(List<org.hl7.rim.Role> playedRole) { } | /** Property accessor, returns an empty collection if not overloaded.playedRole.
@see org.hl7.rim.Entity#getPlayedRole
*/ | Property accessor, returns an empty collection if not overloaded.playedRole | getPlayedRole | {
"repo_name": "markusgumbel/dshl7",
"path": "hl7-javasig/gencode/org/hl7/rim/decorators/EntityDecorator.java",
"license": "apache-2.0",
"size": 10386
} | [
"java.util.List",
"org.hl7.rim.Role"
] | import java.util.List; import org.hl7.rim.Role; | import java.util.*; import org.hl7.rim.*; | [
"java.util",
"org.hl7.rim"
] | java.util; org.hl7.rim; | 1,281,217 |
@Nullable String header(String name); | @Nullable String header(String name); | /**
* Get the value of a header. If there is more than one header value with the same name, the headers are returned
* comma seperated, per <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2">rfc2616-sec4</a>.
* <p>
* Header names are case insensitive.
* </p>
* @param name name of header (case insensitive)
* @return value of header, or null if not set.
* @see #hasHeader(String)
* @see #cookie(String)
*/ | Get the value of a header. If there is more than one header value with the same name, the headers are returned comma seperated, per rfc2616-sec4. Header names are case insensitive. | header | {
"repo_name": "jhy/jsoup",
"path": "src/main/java/org/jsoup/Connection.java",
"license": "mit",
"size": 31086
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,190,493 |
@Override
public void addItem(String description) {
this.init(session ->
{
Item item = new Item();
item.setDescription(description);
item.setCreateDate(new Timestamp(System.currentTimeMillis()));
session.save(item);
}
);
} | void function(String description) { this.init(session -> { Item item = new Item(); item.setDescription(description); item.setCreateDate(new Timestamp(System.currentTimeMillis())); session.save(item); } ); } | /**
* The method adds item to database.
* @param description - description.
*/ | The method adds item to database | addItem | {
"repo_name": "1Evgeny/java-a-to-z",
"path": "chapter_010_hibernate/configuration/src/main/java/by.vorokhobko/database/DatabaseImp.java",
"license": "apache-2.0",
"size": 3416
} | [
"by.vorokhobko.models.Item",
"java.sql.Timestamp"
] | import by.vorokhobko.models.Item; import java.sql.Timestamp; | import by.vorokhobko.models.*; import java.sql.*; | [
"by.vorokhobko.models",
"java.sql"
] | by.vorokhobko.models; java.sql; | 891,173 |
@NotNull()
public static ModificationType[] values()
{
return new ModificationType[]
{
ADD,
DELETE,
REPLACE,
INCREMENT
};
} | @NotNull() static ModificationType[] function() { return new ModificationType[] { ADD, DELETE, REPLACE, INCREMENT }; } | /**
* Retrieves an array of all modification types defined in the LDAP SDK.
*
* @return An array of all modification types defined in the LDAP SDK.
*/ | Retrieves an array of all modification types defined in the LDAP SDK | values | {
"repo_name": "UnboundID/ldapsdk",
"path": "src/com/unboundid/ldap/sdk/ModificationType.java",
"license": "gpl-2.0",
"size": 11786
} | [
"com.unboundid.util.NotNull"
] | import com.unboundid.util.NotNull; | import com.unboundid.util.*; | [
"com.unboundid.util"
] | com.unboundid.util; | 1,119,253 |
return new PredicatedSortedBag<E>(bag, InstanceofPredicate.getInstance(type));
}
protected TypedSortedBag() {
super();
} | return new PredicatedSortedBag<E>(bag, InstanceofPredicate.getInstance(type)); } protected TypedSortedBag() { super(); } | /**
* Factory method to create a typed sorted bag.
* <p/>
* If there are any elements already in the bag being decorated, they
* are validated.
*
* @param bag the bag to decorate, must not be null
* @param type the type to allow into the bag, must not be null
* @return a new transformed SortedBag
* @throws IllegalArgumentException if bag or type is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/ | Factory method to create a typed sorted bag. If there are any elements already in the bag being decorated, they are validated | decorate | {
"repo_name": "megamattron/collections-generic",
"path": "src/java/org/apache/commons/collections15/bag/TypedSortedBag.java",
"license": "apache-2.0",
"size": 2132
} | [
"org.apache.commons.collections15.functors.InstanceofPredicate"
] | import org.apache.commons.collections15.functors.InstanceofPredicate; | import org.apache.commons.collections15.functors.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,539,363 |
public static WebGLContext createContext(Canvas canvas, WebGLContext.Attributes attributes)
{
return createContext(canvas.getCanvasElement(), attributes);
} | static WebGLContext function(Canvas canvas, WebGLContext.Attributes attributes) { return createContext(canvas.getCanvasElement(), attributes); } | /**
* Creates a WebGL 1.0 context upon a canvas object using the specified context attributes. This method alerts the
* user if there is no WebGL support and also redirects the browser to <a href="http://get.webgl.org/">get.webgl.org
* </a>.
*
* @param canvas The canvas object to creeate the context upon.
* @param attributes The context attributes to request the context with.
*
* @return The created WebGL context object.
*/ | Creates a WebGL 1.0 context upon a canvas object using the specified context attributes. This method alerts the user if there is no WebGL support and also redirects the browser to get.webgl.org | createContext | {
"repo_name": "sriharshachilakapati/WebGL4J",
"path": "webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java",
"license": "mit",
"size": 162601
} | [
"com.google.gwt.canvas.client.Canvas"
] | import com.google.gwt.canvas.client.Canvas; | import com.google.gwt.canvas.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,446,850 |
public void setInventorySlotContents(int index, @Nullable ItemStack stack)
{
if (index == 0)
{
this.payment = stack;
}
} | void function(int index, @Nullable ItemStack stack) { if (index == 0) { this.payment = stack; } } | /**
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
*/ | Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections) | setInventorySlotContents | {
"repo_name": "MartyParty21/AwakenDreamsClient",
"path": "mcp/src/minecraft/net/minecraft/tileentity/TileEntityBeacon.java",
"license": "gpl-3.0",
"size": 15970
} | [
"javax.annotation.Nullable",
"net.minecraft.item.ItemStack"
] | import javax.annotation.Nullable; import net.minecraft.item.ItemStack; | import javax.annotation.*; import net.minecraft.item.*; | [
"javax.annotation",
"net.minecraft.item"
] | javax.annotation; net.minecraft.item; | 6,876 |
private static void runApplicationMaster(final CommandLine cliParser) throws Exception {
int numWorkers = Integer.parseInt(cliParser.getOptionValue("num_workers", "1"));
String masterAddress = cliParser.getOptionValue("master_address");
String resourcePath = cliParser.getOptionValue("resource_path");
ApplicationMaster applicationMaster =
new ApplicationMaster(numWorkers, masterAddress, resourcePath);
applicationMaster.start();
applicationMaster.requestAndLaunchContainers();
applicationMaster.waitForShutdown();
applicationMaster.stop();
} | static void function(final CommandLine cliParser) throws Exception { int numWorkers = Integer.parseInt(cliParser.getOptionValue(STR, "1")); String masterAddress = cliParser.getOptionValue(STR); String resourcePath = cliParser.getOptionValue(STR); ApplicationMaster applicationMaster = new ApplicationMaster(numWorkers, masterAddress, resourcePath); applicationMaster.start(); applicationMaster.requestAndLaunchContainers(); applicationMaster.waitForShutdown(); applicationMaster.stop(); } | /**
* Run the application master.
*
* @param cliParser client arguments parser
*/ | Run the application master | runApplicationMaster | {
"repo_name": "riversand963/alluxio",
"path": "integration/yarn/src/main/java/alluxio/yarn/ApplicationMaster.java",
"license": "apache-2.0",
"size": 19374
} | [
"org.apache.commons.cli.CommandLine"
] | import org.apache.commons.cli.CommandLine; | import org.apache.commons.cli.*; | [
"org.apache.commons"
] | org.apache.commons; | 132,362 |
public static Long createAndStoreCommonNote(Blog topic, Long creatorId, String content,
Long[] attachmentIds) throws TestUtilsException {
return createAndStoreCommonNote(topic, creatorId, content, attachmentIds, null, new Date());
}
| static Long function(Blog topic, Long creatorId, String content, Long[] attachmentIds) throws TestUtilsException { return createAndStoreCommonNote(topic, creatorId, content, attachmentIds, null, new Date()); } | /**
* Creates a new note and stores in within the db.
*
* @param topic
* The topic.
* @param creatorId
* The creator.
* @param content
* The content.
* @param attachmentIds
* List of attachments for note.
* @return Id of the created note.
* @throws TestUtilsException
* Exception.
*/ | Creates a new note and stores in within the db | createAndStoreCommonNote | {
"repo_name": "Communote/communote-server",
"path": "communote/tests/all-versions/integration/src/main/java/com/communote/server/test/util/TestUtils.java",
"license": "apache-2.0",
"size": 37663
} | [
"com.communote.server.model.blog.Blog",
"java.util.Date"
] | import com.communote.server.model.blog.Blog; import java.util.Date; | import com.communote.server.model.blog.*; import java.util.*; | [
"com.communote.server",
"java.util"
] | com.communote.server; java.util; | 2,048,827 |
public void setIncidentRecord(IncidentRecord newIncidentRecord) {
if (newIncidentRecord != incidentRecord) {
NotificationChain msgs = null;
if (incidentRecord != null)
msgs = ((InternalEObject)incidentRecord).eInverseRemove(this, InfOperationsPackage.INCIDENT_RECORD__TROUBLE_TICKETS, IncidentRecord.class, msgs);
if (newIncidentRecord != null)
msgs = ((InternalEObject)newIncidentRecord).eInverseAdd(this, InfOperationsPackage.INCIDENT_RECORD__TROUBLE_TICKETS, IncidentRecord.class, msgs);
msgs = basicSetIncidentRecord(newIncidentRecord, msgs);
if (msgs != null) msgs.dispatch();
}
} | void function(IncidentRecord newIncidentRecord) { if (newIncidentRecord != incidentRecord) { NotificationChain msgs = null; if (incidentRecord != null) msgs = ((InternalEObject)incidentRecord).eInverseRemove(this, InfOperationsPackage.INCIDENT_RECORD__TROUBLE_TICKETS, IncidentRecord.class, msgs); if (newIncidentRecord != null) msgs = ((InternalEObject)newIncidentRecord).eInverseAdd(this, InfOperationsPackage.INCIDENT_RECORD__TROUBLE_TICKETS, IncidentRecord.class, msgs); msgs = basicSetIncidentRecord(newIncidentRecord, msgs); if (msgs != null) msgs.dispatch(); } } | /**
* Sets the value of the '{@link CIM15.IEC61970.Informative.InfOperations.TroubleTicket#getIncidentRecord <em>Incident Record</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Incident Record</em>' reference.
* @see #getIncidentRecord()
* @generated
*/ | Sets the value of the '<code>CIM15.IEC61970.Informative.InfOperations.TroubleTicket#getIncidentRecord Incident Record</code>' reference. | setIncidentRecord | {
"repo_name": "SES-fortiss/SmartGridCoSimulation",
"path": "core/cim15/src/CIM15/IEC61970/Informative/InfOperations/TroubleTicket.java",
"license": "apache-2.0",
"size": 45721
} | [
"org.eclipse.emf.common.notify.NotificationChain",
"org.eclipse.emf.ecore.InternalEObject"
] | import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.InternalEObject; | import org.eclipse.emf.common.notify.*; import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 307,371 |
FieldDescriptor.JavaType valueJavaType() {
return valueField().descriptor().getJavaType();
} | FieldDescriptor.JavaType valueJavaType() { return valueField().descriptor().getJavaType(); } | /**
* Returns the {@link JavaType} of the actual value of this field, which for map fields is the
* type of the map's value.
*/ | Returns the <code>JavaType</code> of the actual value of this field, which for map fields is the type of the map's value | valueJavaType | {
"repo_name": "curioswitch/curiostack",
"path": "common/grpc/protobuf-jackson/src/main/java/org/curioswitch/common/protobuf/json/ProtoFieldInfo.java",
"license": "mit",
"size": 14773
} | [
"com.google.protobuf.Descriptors"
] | import com.google.protobuf.Descriptors; | import com.google.protobuf.*; | [
"com.google.protobuf"
] | com.google.protobuf; | 1,551,348 |
private InternalDistributedMember waitForNodeOrCreateBucket(RetryTimeKeeper retryTime,
EntryEventImpl event, Integer bucketId) {
InternalDistributedMember newNode;
if (retryTime.overMaximum()) {
PRHARedundancyProvider.timedOut(this, null, null, "allocate a bucket",
retryTime.getRetryTime());
// NOTREACHED
}
retryTime.waitForBucketsRecovery();
newNode = getNodeForBucketWrite(bucketId, retryTime);
if (newNode == null) {
newNode = createBucket(bucketId, getEntrySize(event), retryTime);
}
return newNode;
}
/**
* Get the serialized size of an {@code EntryEventImpl} | InternalDistributedMember function(RetryTimeKeeper retryTime, EntryEventImpl event, Integer bucketId) { InternalDistributedMember newNode; if (retryTime.overMaximum()) { PRHARedundancyProvider.timedOut(this, null, null, STR, retryTime.getRetryTime()); } retryTime.waitForBucketsRecovery(); newNode = getNodeForBucketWrite(bucketId, retryTime); if (newNode == null) { newNode = createBucket(bucketId, getEntrySize(event), retryTime); } return newNode; } /** * Get the serialized size of an {@code EntryEventImpl} | /**
* Find an existing live Node that owns the bucket, or create the bucket and return one of its
* owners.
*
* @param retryTime the RetryTimeKeeper to track retry times
* @param event the event used to get the entry size in the event a new bucket should be created
* @param bucketId the identity of the bucket should it be created
* @return a Node which contains the bucket, potentially null
*/ | Find an existing live Node that owns the bucket, or create the bucket and return one of its owners | waitForNodeOrCreateBucket | {
"repo_name": "PurelyApplied/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java",
"license": "apache-2.0",
"size": 379321
} | [
"org.apache.geode.distributed.internal.membership.InternalDistributedMember"
] | import org.apache.geode.distributed.internal.membership.InternalDistributedMember; | import org.apache.geode.distributed.internal.membership.*; | [
"org.apache.geode"
] | org.apache.geode; | 762,227 |
@Override
public FooterCell join(Set<FooterCell> cellsToMerge) {
for (FooterCell cell : cellsToMerge) {
checkIfAlreadyMerged(cell.getColumnId());
}
// Create new cell data for the group
Cell newCell = createCell();
Set<String> columnGroup = new HashSet<>();
for (FooterCell cell : cellsToMerge) {
columnGroup.add(cell.getColumnId());
}
addMergedCell(newCell, columnGroup);
markAsDirty();
return newCell;
} | FooterCell function(Set<FooterCell> cellsToMerge) { for (FooterCell cell : cellsToMerge) { checkIfAlreadyMerged(cell.getColumnId()); } Cell newCell = createCell(); Set<String> columnGroup = new HashSet<>(); for (FooterCell cell : cellsToMerge) { columnGroup.add(cell.getColumnId()); } addMergedCell(newCell, columnGroup); markAsDirty(); return newCell; } | /**
* Merges column cells in the row. Original cells are hidden, and new
* merged cell is shown instead. The cell has a width of all merged
* cells together, inherits styles of the first merged cell but has
* empty caption.
*
* @param cellsToMerge
* the cells which should be merged. The cells should not be
* merged to any other cell set.
* @return the remaining visible cell after the merge
*
* @see #join(FooterCell...)
* @see com.vaadin.ui.AbstractComponent#setCaption(String) setCaption
*/ | Merges column cells in the row. Original cells are hidden, and new merged cell is shown instead. The cell has a width of all merged cells together, inherits styles of the first merged cell but has empty caption | join | {
"repo_name": "Legioth/vaadin",
"path": "server/src/main/java/com/vaadin/ui/components/grid/Footer.java",
"license": "apache-2.0",
"size": 3848
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,376,876 |
public ArticleResponse body(String messageId)
throws IOException
{
return articleImpl(BODY, messageId);
} | ArticleResponse function(String messageId) throws IOException { return articleImpl(BODY, messageId); } | /**
* Send an article body retrieval request to the server.
* @param messageId the message-id of the article to body
* @return an article response consisting of the article number and
* message-id, and an iterator over the lines of the article body
*/ | Send an article body retrieval request to the server | body | {
"repo_name": "SeekingFor/jfniki",
"path": "alien/src/gnu/inet/nntp/NNTPConnection.java",
"license": "gpl-2.0",
"size": 42972
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,708,268 |
private void assignInitialPositionPlayerLeft(String namePlayer){
this.playerLeft = new Player(namePlayer);
this.playerLeft.setPosition(new Point(X_POSITION_INITIAL_PLAYER_LEFT, Y_POSITION_INITIAL + WindowsGame.PLAYER_HEIGHT/2));
}
| void function(String namePlayer){ this.playerLeft = new Player(namePlayer); this.playerLeft.setPosition(new Point(X_POSITION_INITIAL_PLAYER_LEFT, Y_POSITION_INITIAL + WindowsGame.PLAYER_HEIGHT/2)); } | /**
* JUGADOR DE LA IZQUIERDA ASIGNAR LA POSICION
*/ | JUGADOR DE LA IZQUIERDA ASIGNAR LA POSICION | assignInitialPositionPlayerLeft | {
"repo_name": "DavCardenas/Air_Hockey_Sockets",
"path": "src/logic/Match.java",
"license": "gpl-3.0",
"size": 19835
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,207,174 |
public ComposeableAdapterFactory getRootAdapterFactory() {
return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
} | ComposeableAdapterFactory function() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } | /**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the root adapter factory that contains this factory. | getRootAdapterFactory | {
"repo_name": "eclipsesource/EMFFormsConferenceExample",
"path": "com.eclipsesource.conference.model.edit/src/conference/provider/ConferenceItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 8598
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; | import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,810,506 |
public static Map<String, Object> getNonNullProperties(Object target) {
Map<String, Object> properties = new HashMap<>();
getProperties(target, properties, null, false);
return properties;
} | static Map<String, Object> function(Object target) { Map<String, Object> properties = new HashMap<>(); getProperties(target, properties, null, false); return properties; } | /**
* Will inspect the target for properties.
* <p/>
* Notice a property must have both a getter/setter method to be included.
* Notice all <tt>null</tt> values won't be included.
*
* @param target the target bean
* @return the map with found properties
*/ | Will inspect the target for properties. Notice a property must have both a getter/setter method to be included. Notice all null values won't be included | getNonNullProperties | {
"repo_name": "DariusX/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java",
"license": "apache-2.0",
"size": 40150
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,269,552 |
@ServiceMethod(returns = ReturnType.SINGLE)
public NatGatewayInner createOrUpdate(
String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) {
return createOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) NatGatewayInner function( String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { return createOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context).block(); } | /**
* Creates or updates a nat gateway.
*
* @param resourceGroupName The name of the resource group.
* @param natGatewayName The name of the nat gateway.
* @param parameters Parameters supplied to the create or update nat gateway operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return nat Gateway resource.
*/ | Creates or updates a nat gateway | createOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NatGatewaysClientImpl.java",
"license": "mit",
"size": 72291
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.network.fluent.models.NatGatewayInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.NatGatewayInner; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,190,748 |
static void deleteContents(File dir) throws IOException {
File[] files = dir.listFiles();
if (files == null) {
throw new IOException("not a readable directory: " + dir);
}
for (File file : files) {
if (file.isDirectory()) {
deleteContents(file);
}
if (!file.delete()) {
throw new IOException("failed to delete file: " + file);
}
}
} | static void deleteContents(File dir) throws IOException { File[] files = dir.listFiles(); if (files == null) { throw new IOException(STR + dir); } for (File file : files) { if (file.isDirectory()) { deleteContents(file); } if (!file.delete()) { throw new IOException(STR + file); } } } | /**
* Deletes the contents of {@code dir}. Throws an IOException if any file
* could not be deleted, or if {@code dir} is not a readable directory.
*/ | Deletes the contents of dir. Throws an IOException if any file could not be deleted, or if dir is not a readable directory | deleteContents | {
"repo_name": "Yumore/YuanYuan",
"path": "Basekit/src/main/java/xyz/zimuju/basekit/utility/cache/DiskLruCache.java",
"license": "apache-2.0",
"size": 43277
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 469,590 |
public double calcFractalDimension()
{ assert image != null : "setBoxSize must have failed!";
int size = image.getWidth();
int count = 0;
// Clear the image
Graphics graphics = image.getGraphics();
graphics.setColor(Color.black);
graphics.fillRect(0, 0, size, size);
// Render the fractal
super.setDimension(size, size);
super.render(null);
// Count the pixels affected by the render
byte[] pixels = ((DataBufferByte)image
.getRaster()
.getDataBuffer())
.getData();
for(byte pixel : pixels)
if(pixel != 0)
count++;
// Return the approximate fractal dimension
return Math.log(count) / Math.log(size);
} | double function() { assert image != null : STR; int size = image.getWidth(); int count = 0; Graphics graphics = image.getGraphics(); graphics.setColor(Color.black); graphics.fillRect(0, 0, size, size); super.setDimension(size, size); super.render(null); byte[] pixels = ((DataBufferByte)image .getRaster() .getDataBuffer()) .getData(); for(byte pixel : pixels) if(pixel != 0) count++; return Math.log(count) / Math.log(size); } | /**
* Approximate the fractal dimension using box-counting. This is done by
* rendering the fractal unto an image of dimensions specified by the box-
* size, and counting the pixels rendered
*/ | Approximate the fractal dimension using box-counting. This is done by rendering the fractal unto an image of dimensions specified by the box- size, and counting the pixels rendered | calcFractalDimension | {
"repo_name": "leokdawson/di-geva",
"path": "GUI/src/Fractal/LSystem2FDBoxCounting.java",
"license": "gpl-3.0",
"size": 3442
} | [
"java.awt.Color",
"java.awt.Graphics",
"java.awt.image.DataBufferByte"
] | import java.awt.Color; import java.awt.Graphics; import java.awt.image.DataBufferByte; | import java.awt.*; import java.awt.image.*; | [
"java.awt"
] | java.awt; | 1,501,296 |
void writeFileMetadata(OrcProto.Metadata.Builder builder) throws IOException; | void writeFileMetadata(OrcProto.Metadata.Builder builder) throws IOException; | /**
* Writes out the file metadata.
* @param builder Metadata builder to finalize and write.
*/ | Writes out the file metadata | writeFileMetadata | {
"repo_name": "apache/orc",
"path": "java/core/src/java/org/apache/orc/PhysicalWriter.java",
"license": "apache-2.0",
"size": 4889
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,196,858 |
protected AFPPageFonts getFonts() {
return fonts;
} | AFPPageFonts function() { return fonts; } | /**
* Returns the page fonts
*
* @return the page fonts
*/ | Returns the page fonts | getFonts | {
"repo_name": "apache/fop",
"path": "fop-core/src/main/java/org/apache/fop/afp/AFPPaintingState.java",
"license": "apache-2.0",
"size": 21351
} | [
"org.apache.fop.afp.fonts.AFPPageFonts"
] | import org.apache.fop.afp.fonts.AFPPageFonts; | import org.apache.fop.afp.fonts.*; | [
"org.apache.fop"
] | org.apache.fop; | 316,517 |
@Nullable
public static <T> T getWithoutException(CompletableFuture<T> future) {
if (isCompletedNormally(future)) {
try {
return future.get();
} catch (InterruptedException | ExecutionException ignored) {
}
}
return null;
} | static <T> T function(CompletableFuture<T> future) { if (isCompletedNormally(future)) { try { return future.get(); } catch (InterruptedException ExecutionException ignored) { } } return null; } | /**
* Gets the result of a completable future without any exception thrown.
*
* @param future the completable future specified.
* @param <T> the type of result
* @return the result of completable future, or null if it's unfinished or finished
* exceptionally
*/ | Gets the result of a completable future without any exception thrown | getWithoutException | {
"repo_name": "tillrohrmann/flink",
"path": "flink-core/src/main/java/org/apache/flink/util/concurrent/FutureUtils.java",
"license": "apache-2.0",
"size": 57423
} | [
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.ExecutionException"
] | import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 757,576 |
List<String> getValues() throws WidgetException; | List<String> getValues() throws WidgetException; | /**
* Implementing this method would allow for returning available values on the RadioGroup widget
*
* @return available options value
* @throws WidgetException
*/ | Implementing this method would allow for returning available values on the RadioGroup widget | getValues | {
"repo_name": "FINRAOS/JTAF-ExtWebDriver",
"path": "src/main/java/org/finra/jtaf/ewd/widget/IRadioGroup.java",
"license": "apache-2.0",
"size": 1558
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 995,337 |
@Override
protected final void renderMergedOutputModel(
Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
// Set the content type and get the output stream.
response.setContentType(getContentType());
OutputStream outputStream = response.getOutputStream();
WritableWorkbook writableWorkbook;
if (this.url != null) {
Workbook workbook = getTemplateSource(this.url, request);
//this was modified from the standard AbstractJExcelView2 spring library to handle an error parsing out the
//username in linux environments
WorkbookSettings workbookSettings = ((WorkbookParser) workbook).getSettings();
workbookSettings.setWriteAccess("BSAS");
writableWorkbook = Workbook.createWorkbook(outputStream, workbook,workbookSettings);
}
else {
logger.debug("Creating Excel Workbook from scratch");
writableWorkbook = Workbook.createWorkbook(outputStream);
}
buildExcelDocument(model, writableWorkbook, request, response);
// Should we set the content length here?
// response.setContentLength(workbook.getBytes().length);
writableWorkbook.write();
outputStream.flush();
writableWorkbook.close();
}
| final void function( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { response.setContentType(getContentType()); OutputStream outputStream = response.getOutputStream(); WritableWorkbook writableWorkbook; if (this.url != null) { Workbook workbook = getTemplateSource(this.url, request); WorkbookSettings workbookSettings = ((WorkbookParser) workbook).getSettings(); workbookSettings.setWriteAccess("BSAS"); writableWorkbook = Workbook.createWorkbook(outputStream, workbook,workbookSettings); } else { logger.debug(STR); writableWorkbook = Workbook.createWorkbook(outputStream); } buildExcelDocument(model, writableWorkbook, request, response); writableWorkbook.write(); outputStream.flush(); writableWorkbook.close(); } | /**
* Renders the Excel view, given the specified model.
*/ | Renders the Excel view, given the specified model | renderMergedOutputModel | {
"repo_name": "designreuse/JDeSurvey",
"path": "jdsurvey-comcont/src/main/java/com/jd/survey/web/AbstractJExcelView2.java",
"license": "agpl-3.0",
"size": 5061
} | [
"java.io.OutputStream",
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.OutputStream; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import java.util.*; import javax.servlet.http.*; | [
"java.io",
"java.util",
"javax.servlet"
] | java.io; java.util; javax.servlet; | 285,309 |
public Document saveOrUpdate(Document doc) {
currentSession().saveOrUpdate(doc);
return doc;
} | Document function(Document doc) { currentSession().saveOrUpdate(doc); return doc; } | /**
* Writes the {@link Document} to the database.
*
* @see Session#saveOrUpdate(Object)
*/ | Writes the <code>Document</code> to the database | saveOrUpdate | {
"repo_name": "wesabe/grendel",
"path": "src/main/java/com/wesabe/grendel/entities/dao/DocumentDAO.java",
"license": "mit",
"size": 1405
} | [
"com.wesabe.grendel.entities.Document"
] | import com.wesabe.grendel.entities.Document; | import com.wesabe.grendel.entities.*; | [
"com.wesabe.grendel"
] | com.wesabe.grendel; | 1,704,770 |
private void hideAllParams() {
labelParam1.setVisible(false);
labelParam2.setVisible(false);
labelParam3.setVisible(false);
labelParam4.setVisible(false);
labelParam5.setVisible(false);
labelParam6.setVisible(false);
// .setVisible(false);
lbHelp1.setVisible(false);
lbHelp2.setVisible(false);
lbHelp3.setVisible(false);
lbHelp4.setVisible(false);
lbHelp5.setVisible(false);
lbHelp6.setVisible(false);
textFieldParam1.setVisible(false);
textFieldParam2.setVisible(false);
textFieldParam3.setVisible(false);
textFieldParam4.setVisible(false);
textFieldParam5.setVisible(false);
textFieldParam6.setVisible(false);
lblSetOutputFile.setVisible(true);
buttonOutput.setVisible(true);
textFieldOutput.setVisible(true);
lblChooseInputFile.setVisible(true);
buttonInput.setVisible(true);
textFieldInput.setVisible(true);
checkboxOpenOutput.setVisible(true);
}
static class TextAreaOutputStream extends OutputStream {
JTextArea textArea;
public TextAreaOutputStream(JTextArea textArea) {
this.textArea = textArea;
}
| void function() { labelParam1.setVisible(false); labelParam2.setVisible(false); labelParam3.setVisible(false); labelParam4.setVisible(false); labelParam5.setVisible(false); labelParam6.setVisible(false); lbHelp1.setVisible(false); lbHelp2.setVisible(false); lbHelp3.setVisible(false); lbHelp4.setVisible(false); lbHelp5.setVisible(false); lbHelp6.setVisible(false); textFieldParam1.setVisible(false); textFieldParam2.setVisible(false); textFieldParam3.setVisible(false); textFieldParam4.setVisible(false); textFieldParam5.setVisible(false); textFieldParam6.setVisible(false); lblSetOutputFile.setVisible(true); buttonOutput.setVisible(true); textFieldOutput.setVisible(true); lblChooseInputFile.setVisible(true); buttonInput.setVisible(true); textFieldInput.setVisible(true); checkboxOpenOutput.setVisible(true); } static class TextAreaOutputStream extends OutputStream { JTextArea textArea; public TextAreaOutputStream(JTextArea textArea) { this.textArea = textArea; } | /**
* Hide all parameters from the user interface. This is used to hide fields
* when the user change algorithms or when the JFrame is first created.
*/ | Hide all parameters from the user interface. This is used to hide fields when the user change algorithms or when the JFrame is first created | hideAllParams | {
"repo_name": "pommedeterresautee/spmf",
"path": "ca/pfv/spmf/gui/MainWindow.java",
"license": "gpl-3.0",
"size": 143042
} | [
"java.io.OutputStream",
"javax.swing.JTextArea"
] | import java.io.OutputStream; import javax.swing.JTextArea; | import java.io.*; import javax.swing.*; | [
"java.io",
"javax.swing"
] | java.io; javax.swing; | 2,780,473 |
public void fadeIn() {
if(getVisibility() == VISIBLE)
return;
// get visible window (keyboard shown)
final View rootView = getRootView();
Rect r = new Rect();
rootView.getWindowVisibleDisplayFrame(r);
int[] coord = new int[2];
mChipsInput.getLocationInWindow(coord);
ViewGroup.MarginLayoutParams layoutParams = (MarginLayoutParams) getLayoutParams();
layoutParams.topMargin = coord[1] + mChipsInput.getHeight();
// height of the keyboard
layoutParams.bottomMargin = rootView.getHeight() - r.bottom;
setLayoutParams(layoutParams);
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(200);
startAnimation(anim);
setVisibility(VISIBLE);
} | void function() { if(getVisibility() == VISIBLE) return; final View rootView = getRootView(); Rect r = new Rect(); rootView.getWindowVisibleDisplayFrame(r); int[] coord = new int[2]; mChipsInput.getLocationInWindow(coord); ViewGroup.MarginLayoutParams layoutParams = (MarginLayoutParams) getLayoutParams(); layoutParams.topMargin = coord[1] + mChipsInput.getHeight(); layoutParams.bottomMargin = rootView.getHeight() - r.bottom; setLayoutParams(layoutParams); AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(200); startAnimation(anim); setVisibility(VISIBLE); } | /**
* Fade in
*/ | Fade in | fadeIn | {
"repo_name": "psh/MaterialChipsInput",
"path": "library/src/main/java/com/pchmn/materialchips/views/FilterableListView.java",
"license": "apache-2.0",
"size": 4981
} | [
"android.graphics.Rect",
"android.view.View",
"android.view.ViewGroup",
"android.view.animation.AlphaAnimation"
] | import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; import android.view.animation.AlphaAnimation; | import android.graphics.*; import android.view.*; import android.view.animation.*; | [
"android.graphics",
"android.view"
] | android.graphics; android.view; | 1,879,323 |
EReference getMutualCoupling_Second_Terminal(); | EReference getMutualCoupling_Second_Terminal(); | /**
* Returns the meta object for the reference '{@link gluemodel.CIM.IEC61970.Wires.MutualCoupling#getSecond_Terminal <em>Second Terminal</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Second Terminal</em>'.
* @see gluemodel.CIM.IEC61970.Wires.MutualCoupling#getSecond_Terminal()
* @see #getMutualCoupling()
* @generated
*/ | Returns the meta object for the reference '<code>gluemodel.CIM.IEC61970.Wires.MutualCoupling#getSecond_Terminal Second Terminal</code>'. | getMutualCoupling_Second_Terminal | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/CIM/IEC61970/Wires/WiresPackage.java",
"license": "mit",
"size": 669840
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 533,531 |
CacheKeyIterationResult fetchKeys(int nextTableIndex, int size); | CacheKeyIterationResult fetchKeys(int nextTableIndex, int size); | /**
* Fetches keys in bulk as specified <tt>size</tt> at most.
*
* @param nextTableIndex starting point for fetching
* @param size maximum bulk size to fetch the keys
* @return the {@link CacheKeyIterationResult} instance contains fetched keys
*/ | Fetches keys in bulk as specified size at most | fetchKeys | {
"repo_name": "tufangorel/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheRecordMap.java",
"license": "apache-2.0",
"size": 2244
} | [
"com.hazelcast.cache.impl.CacheKeyIterationResult"
] | import com.hazelcast.cache.impl.CacheKeyIterationResult; | import com.hazelcast.cache.impl.*; | [
"com.hazelcast.cache"
] | com.hazelcast.cache; | 2,474,616 |
public static void writeSwagger( ResourceListing resourceListing, String path, SwaggerFormat format ) throws IOException {
createWriter( format ).writeSwagger( new FileSwaggerStore( path ), resourceListing );
} | static void function( ResourceListing resourceListing, String path, SwaggerFormat format ) throws IOException { createWriter( format ).writeSwagger( new FileSwaggerStore( path ), resourceListing ); } | /**
* Writes the specified Swagger ResourceListing to the specified local path in either json or xml format.
* Uses the default SwaggerWriter
*
* @param resourceListing the resourceListing to write
* @param path path to an existing folder where the api-docs and api declarations will be written
* @param format the format to use; either json or xml
* @throws IOException
*/ | Writes the specified Swagger ResourceListing to the specified local path in either json or xml format. Uses the default SwaggerWriter | writeSwagger | {
"repo_name": "mayuranchalia/swagger4j",
"path": "src/main/java/com/smartbear/swagger4j/Swagger.java",
"license": "apache-2.0",
"size": 4617
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,291,301 |
public List<User> getMembers() {
List<UserThreadLink> links = getLinks();
if (links == null) {
return Collections.emptyList();
}
Set<User> users = new HashSet<>();
for (UserThreadLink link: links) {
User user = link.getUser();
if (user != null && !user.isMe() && !link.hasLeft() && !link.isBanned()) {
users.add(user);
}
}
return new ArrayList<>(users);
} | List<User> function() { List<UserThreadLink> links = getLinks(); if (links == null) { return Collections.emptyList(); } Set<User> users = new HashSet<>(); for (UserThreadLink link: links) { User user = link.getUser(); if (user != null && !user.isMe() && !link.hasLeft() && !link.isBanned()) { users.add(user); } } return new ArrayList<>(users); } | /**
* Return a list of users who haven't left the group and are not banned
* @return
*/ | Return a list of users who haven't left the group and are not banned | getMembers | {
"repo_name": "chat-sdk/chat-sdk-android",
"path": "chat-sdk-core/src/main/java/sdk/chat/core/dao/Thread.java",
"license": "apache-2.0",
"size": 28470
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,055,068 |
public void setBaseDirectory(File baseDirectory) {
this.baseDirectory = baseDirectory;
validateDirectory(baseDirectory);
} | void function(File baseDirectory) { this.baseDirectory = baseDirectory; validateDirectory(baseDirectory); } | /**
* The base directory for the storage.
*/ | The base directory for the storage | setBaseDirectory | {
"repo_name": "Unipoole/unipoole-service",
"path": "src/main/java/coza/opencollab/unipoole/service/creator/impl/DefaultStorageService.java",
"license": "apache-2.0",
"size": 18233
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,275,999 |
public void testFiltersSortedByKey() {
KeyedFilter[] original = new KeyedFilter[]{new KeyedFilter("bbb", new MatchNoneQueryBuilder()),
new KeyedFilter("aaa", new MatchNoneQueryBuilder())};
FiltersAggregationBuilder builder;
builder = new FiltersAggregationBuilder("my-agg", original);
assertEquals("aaa", builder.filters().get(0).key());
assertEquals("bbb", builder.filters().get(1).key());
// original should be unchanged
assertEquals("bbb", original[0].key());
assertEquals("aaa", original[1].key());
} | void function() { KeyedFilter[] original = new KeyedFilter[]{new KeyedFilter("bbb", new MatchNoneQueryBuilder()), new KeyedFilter("aaa", new MatchNoneQueryBuilder())}; FiltersAggregationBuilder builder; builder = new FiltersAggregationBuilder(STR, original); assertEquals("aaa", builder.filters().get(0).key()); assertEquals("bbb", builder.filters().get(1).key()); assertEquals("bbb", original[0].key()); assertEquals("aaa", original[1].key()); } | /**
* Test that when passing in keyed filters as list or array, the list stored internally is sorted by key
* Also check the list passed in is not modified by this but rather copied
*/ | Test that when passing in keyed filters as list or array, the list stored internally is sorted by key Also check the list passed in is not modified by this but rather copied | testFiltersSortedByKey | {
"repo_name": "coding0011/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/search/aggregations/bucket/FiltersTests.java",
"license": "apache-2.0",
"size": 11986
} | [
"org.elasticsearch.index.query.MatchNoneQueryBuilder",
"org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder",
"org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator"
] | import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator; | import org.elasticsearch.index.query.*; import org.elasticsearch.search.aggregations.bucket.filter.*; | [
"org.elasticsearch.index",
"org.elasticsearch.search"
] | org.elasticsearch.index; org.elasticsearch.search; | 746,216 |
RESULT_TYPE visitCouponIborSpreadDefinition(CouponIborSpreadDefinition payment); | RESULT_TYPE visitCouponIborSpreadDefinition(CouponIborSpreadDefinition payment); | /**
* Ibor coupon with spread method that takes data.
* @param payment An ibor coupon with spread
* @return The result
*/ | Ibor coupon with spread method that takes data | visitCouponIborSpreadDefinition | {
"repo_name": "jerome79/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/instrument/InstrumentDefinitionVisitor.java",
"license": "apache-2.0",
"size": 78879
} | [
"com.opengamma.analytics.financial.instrument.payment.CouponIborSpreadDefinition"
] | import com.opengamma.analytics.financial.instrument.payment.CouponIborSpreadDefinition; | import com.opengamma.analytics.financial.instrument.payment.*; | [
"com.opengamma.analytics"
] | com.opengamma.analytics; | 2,216,826 |
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<NetworkInterfaceInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all network interfaces in a virtual machine scale set.
*
ServiceResponse<PageImpl<NetworkInterfaceInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful.
*/ | Gets all network interfaces in a virtual machine scale set | listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/implementation/NetworkInterfacesInner.java",
"license": "mit",
"size": 183667
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 1,350,697 |
@Authorized(PrivilegeConstants.VIEW_OBS)
public Integer getObservationCount(List<ConceptName> conceptNames, boolean includeVoided);
| @Authorized(PrivilegeConstants.VIEW_OBS) Integer function(List<ConceptName> conceptNames, boolean includeVoided); | /**
* Gets the number of observations(including voided ones) that are using the specified
* conceptNames as valueCodedName answers
*
* @param conceptNames the conceptNames to be searched against
* @param includeVoided whether voided observation should be included
* @return The number of observations using the specified conceptNames as valueCodedNames
* @should return the count of all observations using the specified conceptNames as answers
* @should include voided observations using the specified conceptNames as answers
* @should return zero if no observation is using any of the concepNames in the list
* @since Version 1.7
*/ | Gets the number of observations(including voided ones) that are using the specified conceptNames as valueCodedName answers | getObservationCount | {
"repo_name": "sintjuri/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/ObsService.java",
"license": "mpl-2.0",
"size": 31703
} | [
"java.util.List",
"org.openmrs.ConceptName",
"org.openmrs.annotation.Authorized",
"org.openmrs.util.PrivilegeConstants"
] | import java.util.List; import org.openmrs.ConceptName; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants; | import java.util.*; import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*; | [
"java.util",
"org.openmrs",
"org.openmrs.annotation",
"org.openmrs.util"
] | java.util; org.openmrs; org.openmrs.annotation; org.openmrs.util; | 2,182,060 |
public List<String> getTags() {
return tags;
} | List<String> function() { return tags; } | /**
* Retrieves the tags defined for the service.
*
* @return the list of tags
*/ | Retrieves the tags defined for the service | getTags | {
"repo_name": "opetrovski/development",
"path": "oscm-extsvc/javasrc/org/oscm/vo/VOService.java",
"license": "apache-2.0",
"size": 13485
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 309,447 |
public void writeXml(BufferedWriter outputWriter, int indent ) throws IOException {
String s = " ".substring( 0, indent );
outputWriter.write( s+ "<external-volume name=\"" + getName() +
"\" basedir=\"" + getBaseDir() );
}
| void function(BufferedWriter outputWriter, int indent ) throws IOException { String s = " ".substring( 0, indent ); outputWriter.write( s+ STRSTR\STR" + getBaseDir() ); } | /**
* Write the object as XML
* @param outputWriter The writer into which the object is written
* @param indent Number of spaces to indent the outermost element.
* @throws java.io.IOException If writing fails.
*/ | Write the object as XML | writeXml | {
"repo_name": "hkaimio/photovault",
"path": "src/main/java/org/photovault/imginfo/ExternalVolume.java",
"license": "gpl-2.0",
"size": 5092
} | [
"java.io.BufferedWriter",
"java.io.IOException"
] | import java.io.BufferedWriter; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,887,352 |
PagedIterable<ApiReleaseContract> listByService(
String resourceGroupName,
String serviceName,
String apiId,
String filter,
Integer top,
Integer skip,
Context context); | PagedIterable<ApiReleaseContract> listByService( String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip, Context context); | /**
* Lists all releases of an API. An API release is created when making an API Revision current. Releases are also
* used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip
* parameters.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param apiId API identifier. Must be unique in the current API Management service instance.
* @param filter | Field | Usage | Supported operators | Supported functions
* |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le,
* eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>.
* @param top Number of records to return.
* @param skip Number of records to skip.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return paged ApiRelease list representation.
*/ | Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters | listByService | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleases.java",
"license": "mit",
"size": 11285
} | [
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context"
] | import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; | import com.azure.core.http.rest.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,249,244 |
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null; | String function() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; | /**
* <p>Getter for the field <code>bizContent</code>.</p>
*
* @return a {@link java.lang.String} object.
*/ | Getter for the field <code>bizContent</code> | getBizContent | {
"repo_name": "NotFound403/WePay",
"path": "src/main/java/cn/felord/wepay/ali/sdk/api/request/AlipayMobilePublicMockListsmlistApiRequest.java",
"license": "apache-2.0",
"size": 4818
} | [
"cn.felord.wepay.ali.sdk.api.AlipayObject"
] | import cn.felord.wepay.ali.sdk.api.AlipayObject; | import cn.felord.wepay.ali.sdk.api.*; | [
"cn.felord.wepay"
] | cn.felord.wepay; | 447,025 |
@Test
public void testConstructorWithConfiguration() {
GridNodeConfiguration actualConfig = new GridNodeConfiguration();
actualConfig.host = "dummyhost";
RegistrationRequest req = new RegistrationRequest(actualConfig);
assertConstruction(req);
// make sure the provided config was used.
assertSame(req.getConfiguration(), actualConfig);
} | void function() { GridNodeConfiguration actualConfig = new GridNodeConfiguration(); actualConfig.host = STR; RegistrationRequest req = new RegistrationRequest(actualConfig); assertConstruction(req); assertSame(req.getConfiguration(), actualConfig); } | /**
* Tests that new RegistrationRequest(config) performs as expected
*/ | Tests that new RegistrationRequest(config) performs as expected | testConstructorWithConfiguration | {
"repo_name": "xmhubj/selenium",
"path": "java/server/test/org/openqa/grid/common/RegistrationRequestTest.java",
"license": "apache-2.0",
"size": 10439
} | [
"org.junit.Assert",
"org.openqa.grid.internal.utils.configuration.GridNodeConfiguration"
] | import org.junit.Assert; import org.openqa.grid.internal.utils.configuration.GridNodeConfiguration; | import org.junit.*; import org.openqa.grid.internal.utils.configuration.*; | [
"org.junit",
"org.openqa.grid"
] | org.junit; org.openqa.grid; | 929,241 |
public int loadDataField(ObjectReference object, int index) {
if (object.isNull()) fail(("Object can not be null in object "+ObjectModel.getString(object)));
Sanity.assertValid(object);
int limit = ObjectModel.getDataCount(object);
if (!(index >= 0)) fail(("Index must be non-negative in object "+ObjectModel.getString(object)));
if (!(index < limit)) fail(("Index "+index+" out of bounds "+limit+" in object "+ObjectModel.getString(object)));
Address dataSlot = ObjectModel.getDataSlot(object, index);
int result;
if (ActivePlan.constraints.needsIntReadBarrier()) {
result = context.intRead(object, dataSlot, dataSlot.toWord(), null, Plan.INSTANCE_FIELD);
} else {
result = dataSlot.loadInt();
}
if (Trace.isEnabled(Item.LOAD) || ObjectModel.isWatched(object)) {
Trace.printf(Item.LOAD,"[%s].int[%d] returned [%d]%n",ObjectModel.getString(object),index,result);
}
return result;
} | int function(ObjectReference object, int index) { if (object.isNull()) fail((STR+ObjectModel.getString(object))); Sanity.assertValid(object); int limit = ObjectModel.getDataCount(object); if (!(index >= 0)) fail((STR+ObjectModel.getString(object))); if (!(index < limit)) fail((STR+index+STR+limit+STR+ObjectModel.getString(object))); Address dataSlot = ObjectModel.getDataSlot(object, index); int result; if (ActivePlan.constraints.needsIntReadBarrier()) { result = context.intRead(object, dataSlot, dataSlot.toWord(), null, Plan.INSTANCE_FIELD); } else { result = dataSlot.loadInt(); } if (Trace.isEnabled(Item.LOAD) ObjectModel.isWatched(object)) { Trace.printf(Item.LOAD,STR,ObjectModel.getString(object),index,result); } return result; } | /**
* Load and return the value of a data field of an object.
*
* @param object The object to load the field of.
* @param index The field index.
* @return The contents of the data field
*/ | Load and return the value of a data field of an object | loadDataField | {
"repo_name": "CodeOffloading/JikesRVM-CCO",
"path": "jikesrvm-3.1.3/MMTk/harness/src/org/mmtk/harness/Mutator.java",
"license": "epl-1.0",
"size": 13746
} | [
"org.mmtk.harness.lang.Trace",
"org.mmtk.harness.sanity.Sanity",
"org.mmtk.harness.vm.ActivePlan",
"org.mmtk.harness.vm.ObjectModel",
"org.mmtk.plan.Plan",
"org.vmmagic.unboxed.Address",
"org.vmmagic.unboxed.ObjectReference"
] | import org.mmtk.harness.lang.Trace; import org.mmtk.harness.sanity.Sanity; import org.mmtk.harness.vm.ActivePlan; import org.mmtk.harness.vm.ObjectModel; import org.mmtk.plan.Plan; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.ObjectReference; | import org.mmtk.harness.lang.*; import org.mmtk.harness.sanity.*; import org.mmtk.harness.vm.*; import org.mmtk.plan.*; import org.vmmagic.unboxed.*; | [
"org.mmtk.harness",
"org.mmtk.plan",
"org.vmmagic.unboxed"
] | org.mmtk.harness; org.mmtk.plan; org.vmmagic.unboxed; | 901,512 |
public boolean implies(Permission p)
{
// BasicPermission checks for name and type.
if (super.implies(p))
{
// We have to check the actions.
PropertyPermission pp = (PropertyPermission) p;
return (pp.actions & ~actions) == 0;
}
return false;
} | boolean function(Permission p) { if (super.implies(p)) { PropertyPermission pp = (PropertyPermission) p; return (pp.actions & ~actions) == 0; } return false; } | /**
* Check if this permission implies p. This returns true iff all of
* the following conditions are true:
* <ul>
* <li> p is a PropertyPermission </li>
* <li> this.getName() implies p.getName(),
* e.g. <code>java.*</code> implies <code>java.home</code> </li>
* <li> this.getActions is a subset of p.getActions </li>
* </ul>
*
* @param p the permission to check
* @return true if this permission implies p
*/ | Check if this permission implies p. This returns true iff all of the following conditions are true: p is a PropertyPermission this.getName() implies p.getName(), e.g. <code>java.*</code> implies <code>java.home</code> this.getActions is a subset of p.getActions | implies | {
"repo_name": "aosm/gcc_40",
"path": "libjava/java/util/PropertyPermission.java",
"license": "gpl-2.0",
"size": 8770
} | [
"java.security.Permission"
] | import java.security.Permission; | import java.security.*; | [
"java.security"
] | java.security; | 1,578,350 |
private String getTargetColumnName(String sourceColumnName, String alias) {
String targetColumnName = alias;
Schema obj = this.getMetadataColumnMap().get(sourceColumnName.toLowerCase());
if (obj == null) {
targetColumnName = (targetColumnName == null ? "unknown" + this.unknownColumnCounter : targetColumnName);
this.unknownColumnCounter++;
} else {
targetColumnName = (StringUtils.isNotBlank(targetColumnName) ? targetColumnName : sourceColumnName);
}
targetColumnName = this.toCase(targetColumnName);
return Utils.escapeSpecialCharacters(targetColumnName, ConfigurationKeys.ESCAPE_CHARS_IN_COLUMN_NAME, "_");
} | String function(String sourceColumnName, String alias) { String targetColumnName = alias; Schema obj = this.getMetadataColumnMap().get(sourceColumnName.toLowerCase()); if (obj == null) { targetColumnName = (targetColumnName == null ? STR + this.unknownColumnCounter : targetColumnName); this.unknownColumnCounter++; } else { targetColumnName = (StringUtils.isNotBlank(targetColumnName) ? targetColumnName : sourceColumnName); } targetColumnName = this.toCase(targetColumnName); return Utils.escapeSpecialCharacters(targetColumnName, ConfigurationKeys.ESCAPE_CHARS_IN_COLUMN_NAME, "_"); } | /**
* Get target column name if column is not found in metadata, then name it
* as unknown column If alias is not found, target column is nothing but
* source column
*
* @param sourceColumnName
* @param alias
* @return targetColumnName
*/ | Get target column name if column is not found in metadata, then name it as unknown column If alias is not found, target column is nothing but source column | getTargetColumnName | {
"repo_name": "jenniferzheng/gobblin",
"path": "gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java",
"license": "apache-2.0",
"size": 43184
} | [
"org.apache.commons.lang3.StringUtils",
"org.apache.gobblin.configuration.ConfigurationKeys",
"org.apache.gobblin.source.extractor.schema.Schema",
"org.apache.gobblin.source.extractor.utils.Utils"
] | import org.apache.commons.lang3.StringUtils; import org.apache.gobblin.configuration.ConfigurationKeys; import org.apache.gobblin.source.extractor.schema.Schema; import org.apache.gobblin.source.extractor.utils.Utils; | import org.apache.commons.lang3.*; import org.apache.gobblin.configuration.*; import org.apache.gobblin.source.extractor.schema.*; import org.apache.gobblin.source.extractor.utils.*; | [
"org.apache.commons",
"org.apache.gobblin"
] | org.apache.commons; org.apache.gobblin; | 1,280,776 |
protected boolean onItemMoveSeq(int fromPosition, int toPosition) {
if (fromPosition == toPosition)
return super.onItemMove(fromPosition, toPosition);
try {
if (fromPosition < toPosition) {
T fromEntry = originalEntries.getEntry(fromPosition);
long maxSeq = 0;
for (int i = fromPosition + 1; i <= toPosition; ++i) {
T toEntry = originalEntries.getEntry(i);
long seq = ((IDbSeqEntry) toEntry).getSeq();
if (seq > 0)
--seq;
if (maxSeq < seq)
maxSeq = seq;
((IDbSeqEntry) toEntry).setSeq(seq);
// notifyItemChanged() is only necessary if the seq is visible to the user
notifyItemChanged(i);
updateAfterMove(toEntry);
}
++maxSeq;
((IDbSeqEntry) fromEntry).setSeq(maxSeq);
// notifyItemChanged() on the dragged item loses drag.
//notifyItemChanged(fromPosition);
updateAfterMove(fromEntry);
} else {
T fromEntry = originalEntries.getEntry(fromPosition);
long minSeq = 0;
for (int i = fromPosition - 1; i >= toPosition; --i) {
T toEntry = originalEntries.getEntry(i);
long seq = ((IDbSeqEntry) toEntry).getSeq();
++seq;
if (minSeq == 0 || minSeq > seq)
minSeq = seq;
((IDbSeqEntry) toEntry).setSeq(seq);
// notifyItemChanged() is only necessary if the seq is visible to the user
notifyItemChanged(i);
updateAfterMove(toEntry);
}
if (minSeq > 0)
--minSeq;
((IDbSeqEntry) fromEntry).setSeq(minSeq);
// notifyItemChanged() on the dragged item loses drag.
//notifyItemChanged(fromPosition);
updateAfterMove(fromEntry);
}
} catch (SQLException e) {
LoggingHelper.log(e);
}
return super.onItemMove(fromPosition, toPosition);
} | boolean function(int fromPosition, int toPosition) { if (fromPosition == toPosition) return super.onItemMove(fromPosition, toPosition); try { if (fromPosition < toPosition) { T fromEntry = originalEntries.getEntry(fromPosition); long maxSeq = 0; for (int i = fromPosition + 1; i <= toPosition; ++i) { T toEntry = originalEntries.getEntry(i); long seq = ((IDbSeqEntry) toEntry).getSeq(); if (seq > 0) --seq; if (maxSeq < seq) maxSeq = seq; ((IDbSeqEntry) toEntry).setSeq(seq); notifyItemChanged(i); updateAfterMove(toEntry); } ++maxSeq; ((IDbSeqEntry) fromEntry).setSeq(maxSeq); updateAfterMove(fromEntry); } else { T fromEntry = originalEntries.getEntry(fromPosition); long minSeq = 0; for (int i = fromPosition - 1; i >= toPosition; --i) { T toEntry = originalEntries.getEntry(i); long seq = ((IDbSeqEntry) toEntry).getSeq(); ++seq; if (minSeq == 0 minSeq > seq) minSeq = seq; ((IDbSeqEntry) toEntry).setSeq(seq); notifyItemChanged(i); updateAfterMove(toEntry); } if (minSeq > 0) --minSeq; ((IDbSeqEntry) fromEntry).setSeq(minSeq); updateAfterMove(fromEntry); } } catch (SQLException e) { LoggingHelper.log(e); } return super.onItemMove(fromPosition, toPosition); } | /**
* call this method from onItemMove if the underlying dbEntry is an instance of {@link IDbSeqEntry} and if you support drag'n'drop
*
* @param fromPosition
* @param toPosition
* @return
*/ | call this method from onItemMove if the underlying dbEntry is an instance of <code>IDbSeqEntry</code> and if you support drag'n'drop | onItemMoveSeq | {
"repo_name": "mikes222/BsnsTemplate",
"path": "app/src/main/java/com/mschwartz/bsnstemplate/core/AbstractDbEntryAdapter.java",
"license": "apache-2.0",
"size": 5139
} | [
"com.mschwartz.bsnstemplate.db.IDbSeqEntry",
"com.mschwartz.bsnstemplate.logging.LoggingHelper",
"java.sql.SQLException"
] | import com.mschwartz.bsnstemplate.db.IDbSeqEntry; import com.mschwartz.bsnstemplate.logging.LoggingHelper; import java.sql.SQLException; | import com.mschwartz.bsnstemplate.db.*; import com.mschwartz.bsnstemplate.logging.*; import java.sql.*; | [
"com.mschwartz.bsnstemplate",
"java.sql"
] | com.mschwartz.bsnstemplate; java.sql; | 2,028,655 |
public void enableEventProcessing(Object changeTracker) {
ObjectChangeListener listener = (ObjectChangeListener)((ChangeTracker)changeTracker)._persistence_getPropertyChangeListener();
if (listener != null) {
listener.processEvents();
}
} | void function(Object changeTracker) { ObjectChangeListener listener = (ObjectChangeListener)((ChangeTracker)changeTracker)._persistence_getPropertyChangeListener(); if (listener != null) { listener.processEvents(); } } | /**
* INTERNAL:
* This method is used to enable changetracking temporarily
*/ | This method is used to enable changetracking temporarily | enableEventProcessing | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/descriptors/changetracking/ObjectChangeTrackingPolicy.java",
"license": "epl-1.0",
"size": 8285
} | [
"org.eclipse.persistence.internal.descriptors.changetracking.ObjectChangeListener"
] | import org.eclipse.persistence.internal.descriptors.changetracking.ObjectChangeListener; | import org.eclipse.persistence.internal.descriptors.changetracking.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 2,526,793 |
public static Tuple max(Iterator tuples, String field, Comparator cmp) {
Tuple t = null, tmp;
Object min = null;
if ( tuples.hasNext() ) {
t = (Tuple)tuples.next();
min = t.get(field);
}
while ( tuples.hasNext() ) {
tmp = (Tuple)tuples.next();
Object obj = tmp.get(field);
if ( cmp.compare(obj,min) > 0 ) {
t = tmp;
min = obj;
}
}
return t;
}
| static Tuple function(Iterator tuples, String field, Comparator cmp) { Tuple t = null, tmp; Object min = null; if ( tuples.hasNext() ) { t = (Tuple)tuples.next(); min = t.get(field); } while ( tuples.hasNext() ) { tmp = (Tuple)tuples.next(); Object obj = tmp.get(field); if ( cmp.compare(obj,min) > 0 ) { t = tmp; min = obj; } } return t; } | /**
* Get the Tuple with the maximum data field value.
* @param tuples an iterator over tuples
* @param field the column / data field name
* @param cmp a comparator for sorting the column contents
* @return the Tuple with the maximum data field value
*/ | Get the Tuple with the maximum data field value | max | {
"repo_name": "effrafax/Prefux",
"path": "src/main/java/prefux/util/DataLib.java",
"license": "bsd-3-clause",
"size": 21370
} | [
"java.util.Comparator",
"java.util.Iterator"
] | import java.util.Comparator; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 643,588 |
@Authorized({HL7QueryPrivilegeConstants.MANAGE_HL7_TEMPLATES})
HL7Template retireHL7Template(HL7Template hl7Template, String reason); | @Authorized({HL7QueryPrivilegeConstants.MANAGE_HL7_TEMPLATES}) HL7Template retireHL7Template(HL7Template hl7Template, String reason); | /**
* Retires the template.
*
* @param hl7Template
* @param reason
* @return HL7Template
* @should retire template
*/ | Retires the template | retireHL7Template | {
"repo_name": "openmrs/openmrs-module-hl7query",
"path": "api/src/main/java/org/openmrs/module/hl7query/api/HL7QueryService.java",
"license": "mpl-2.0",
"size": 5151
} | [
"org.openmrs.annotation.Authorized",
"org.openmrs.module.hl7query.HL7Template",
"org.openmrs.module.hl7query.util.HL7QueryPrivilegeConstants"
] | import org.openmrs.annotation.Authorized; import org.openmrs.module.hl7query.HL7Template; import org.openmrs.module.hl7query.util.HL7QueryPrivilegeConstants; | import org.openmrs.annotation.*; import org.openmrs.module.hl7query.*; import org.openmrs.module.hl7query.util.*; | [
"org.openmrs.annotation",
"org.openmrs.module"
] | org.openmrs.annotation; org.openmrs.module; | 942,433 |
if(uriTemplate == null)
uriTemplate = new UriTemplate(template);
else
uriTemplate.template = template;
return uriTemplate;
}
/**
* Set the values of each template
*
* @param name
* the name of the template
* @param value
* the value of the template. Supported objects: simple objects
* that implement toString() method, Collections and Maps.
* @return a {@link UriTemplate} | if(uriTemplate == null) uriTemplate = new UriTemplate(template); else uriTemplate.template = template; return uriTemplate; } /** * Set the values of each template * * @param name * the name of the template * @param value * the value of the template. Supported objects: simple objects * that implement toString() method, Collections and Maps. * @return a {@link UriTemplate} | /**
* Generate a UriTemplate with a given template form.
*
* @param template
* the wanted template
* @return {@link UriTemplate}
*/ | Generate a UriTemplate with a given template form | fromTemplate | {
"repo_name": "CitySDK/tourism_library_java",
"path": "src/main/java/citysdk/tourism/client/requests/uri/UriTemplate.java",
"license": "gpl-3.0",
"size": 8842
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,792,032 |
public TAttributeOptionBean getBean(IdentityMap createdBeans)
{
TAttributeOptionBean result = (TAttributeOptionBean) createdBeans.get(this);
if (result != null ) {
// we have already created a bean for this object, return it
return result;
}
// no bean exists for this object; create a new one
result = new TAttributeOptionBean();
createdBeans.put(this, result);
result.setObjectID(getObjectID());
result.setAttributeID(getAttributeID());
result.setParentOption(getParentOption());
result.setOptionName(getOptionName());
result.setDeleted(getDeleted());
result.setSortorder(getSortorder());
result.setUuid(getUuid());
if (collTIssueAttributeValues != null)
{
List<TIssueAttributeValueBean> relatedBeans = new ArrayList<TIssueAttributeValueBean>(collTIssueAttributeValues.size());
for (Iterator<TIssueAttributeValue> collTIssueAttributeValuesIt = collTIssueAttributeValues.iterator(); collTIssueAttributeValuesIt.hasNext(); )
{
TIssueAttributeValue related = (TIssueAttributeValue) collTIssueAttributeValuesIt.next();
TIssueAttributeValueBean relatedBean = related.getBean(createdBeans);
relatedBeans.add(relatedBean);
}
result.setTIssueAttributeValueBeans(relatedBeans);
}
if (collTAttributes != null)
{
List<TAttributeBean> relatedBeans = new ArrayList<TAttributeBean>(collTAttributes.size());
for (Iterator<TAttribute> collTAttributesIt = collTAttributes.iterator(); collTAttributesIt.hasNext(); )
{
TAttribute related = (TAttribute) collTAttributesIt.next();
TAttributeBean relatedBean = related.getBean(createdBeans);
relatedBeans.add(relatedBean);
}
result.setTAttributeBeans(relatedBeans);
}
if (aTAttribute != null)
{
TAttributeBean relatedBean = aTAttribute.getBean(createdBeans);
result.setTAttributeBean(relatedBean);
}
result.setModified(isModified());
result.setNew(isNew());
return result;
} | TAttributeOptionBean function(IdentityMap createdBeans) { TAttributeOptionBean result = (TAttributeOptionBean) createdBeans.get(this); if (result != null ) { return result; } result = new TAttributeOptionBean(); createdBeans.put(this, result); result.setObjectID(getObjectID()); result.setAttributeID(getAttributeID()); result.setParentOption(getParentOption()); result.setOptionName(getOptionName()); result.setDeleted(getDeleted()); result.setSortorder(getSortorder()); result.setUuid(getUuid()); if (collTIssueAttributeValues != null) { List<TIssueAttributeValueBean> relatedBeans = new ArrayList<TIssueAttributeValueBean>(collTIssueAttributeValues.size()); for (Iterator<TIssueAttributeValue> collTIssueAttributeValuesIt = collTIssueAttributeValues.iterator(); collTIssueAttributeValuesIt.hasNext(); ) { TIssueAttributeValue related = (TIssueAttributeValue) collTIssueAttributeValuesIt.next(); TIssueAttributeValueBean relatedBean = related.getBean(createdBeans); relatedBeans.add(relatedBean); } result.setTIssueAttributeValueBeans(relatedBeans); } if (collTAttributes != null) { List<TAttributeBean> relatedBeans = new ArrayList<TAttributeBean>(collTAttributes.size()); for (Iterator<TAttribute> collTAttributesIt = collTAttributes.iterator(); collTAttributesIt.hasNext(); ) { TAttribute related = (TAttribute) collTAttributesIt.next(); TAttributeBean relatedBean = related.getBean(createdBeans); relatedBeans.add(relatedBean); } result.setTAttributeBeans(relatedBeans); } if (aTAttribute != null) { TAttributeBean relatedBean = aTAttribute.getBean(createdBeans); result.setTAttributeBean(relatedBean); } result.setModified(isModified()); result.setNew(isNew()); return result; } | /**
* Creates a TAttributeOptionBean with the contents of this object
* intended for internal use only
* @param createdBeans a IdentityMap which maps objects
* to already created beans
* @return a TAttributeOptionBean with the contents of this object
*/ | Creates a TAttributeOptionBean with the contents of this object intended for internal use only | getBean | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTAttributeOption.java",
"license": "gpl-3.0",
"size": 56949
} | [
"com.aurel.track.beans.TAttributeBean",
"com.aurel.track.beans.TAttributeOptionBean",
"com.aurel.track.beans.TIssueAttributeValueBean",
"com.aurel.track.persist.TAttribute",
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.apache.commons.collections.map.IdentityMap"
] | import com.aurel.track.beans.TAttributeBean; import com.aurel.track.beans.TAttributeOptionBean; import com.aurel.track.beans.TIssueAttributeValueBean; import com.aurel.track.persist.TAttribute; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.commons.collections.map.IdentityMap; | import com.aurel.track.beans.*; import com.aurel.track.persist.*; import java.util.*; import org.apache.commons.collections.map.*; | [
"com.aurel.track",
"java.util",
"org.apache.commons"
] | com.aurel.track; java.util; org.apache.commons; | 168,332 |
public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender)
{
return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender);
} | boolean function(ICommandSender par1ICommandSender) { return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); } | /**
* Returns true if the given command sender is allowed to use this command.
*/ | Returns true if the given command sender is allowed to use this command | canCommandSenderUseCommand | {
"repo_name": "HATB0T/RuneCraftery",
"path": "forge/mcp/src/minecraft/net/minecraft/command/CommandServerBanIp.java",
"license": "lgpl-3.0",
"size": 4044
} | [
"net.minecraft.server.MinecraftServer"
] | import net.minecraft.server.MinecraftServer; | import net.minecraft.server.*; | [
"net.minecraft.server"
] | net.minecraft.server; | 1,971,983 |
if (node != null) {
PsiElement checker = node.getPsi();
checker = checker.getPrevSibling(); // step from the source node
while (checker != null) {
ASTNode ch_node = checker.getNode();
if (ch_node == null) return false;
else {
if (ch_node.getElementType() == eltType) {
return true;
}
else if (!(checker instanceof PsiWhiteSpace)) {
return false;
}
}
checker = checker.getPrevSibling();
}
}
return false;
} | if (node != null) { PsiElement checker = node.getPsi(); checker = checker.getPrevSibling(); while (checker != null) { ASTNode ch_node = checker.getNode(); if (ch_node == null) return false; else { if (ch_node.getElementType() == eltType) { return true; } else if (!(checker instanceof PsiWhiteSpace)) { return false; } } checker = checker.getPrevSibling(); } } return false; } | /**
* Checks that given node actually follows a node of given type, skipping whitespace.
* @param node node to check.
* @param eltType type of a node that must precede the node we're checking.
* @return true if node is really a next sibling to a node of eltType type.
*/ | Checks that given node actually follows a node of given type, skipping whitespace | followsNodeOfType | {
"repo_name": "consulo/consulo-python",
"path": "python-impl/src/main/java/com/jetbrains/python/psi/impl/PyForPartImpl.java",
"license": "apache-2.0",
"size": 2884
} | [
"com.intellij.lang.ASTNode",
"com.intellij.psi.PsiElement",
"com.intellij.psi.PsiWhiteSpace"
] | import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiWhiteSpace; | import com.intellij.lang.*; import com.intellij.psi.*; | [
"com.intellij.lang",
"com.intellij.psi"
] | com.intellij.lang; com.intellij.psi; | 871,029 |
public TimeValue getScrollTime() {
return searchRequest.scroll().keepAlive();
} | TimeValue function() { return searchRequest.scroll().keepAlive(); } | /**
* Get scroll timeout
*/ | Get scroll timeout | getScrollTime | {
"repo_name": "robin13/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java",
"license": "apache-2.0",
"size": 16184
} | [
"org.elasticsearch.common.unit.TimeValue"
] | import org.elasticsearch.common.unit.TimeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,707,756 |
@Generated
@CVariable()
@MappedReturn(ObjCStringMapper.class)
public static native String NSURLProtectionSpaceHTTPS(); | @CVariable() @MappedReturn(ObjCStringMapper.class) static native String function(); | /**
* [@const] NSURLProtectionSpaceHTTPS
* <p>
* The protocol for HTTPS
*/ | [@const] NSURLProtectionSpaceHTTPS The protocol for HTTPS | NSURLProtectionSpaceHTTPS | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/foundation/c/Foundation.java",
"license": "apache-2.0",
"size": 156135
} | [
"org.moe.natj.c.ann.CVariable",
"org.moe.natj.general.ann.MappedReturn",
"org.moe.natj.objc.map.ObjCStringMapper"
] | import org.moe.natj.c.ann.CVariable; import org.moe.natj.general.ann.MappedReturn; import org.moe.natj.objc.map.ObjCStringMapper; | import org.moe.natj.c.ann.*; import org.moe.natj.general.ann.*; import org.moe.natj.objc.map.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,658,079 |
VerificationResult verify(KSISignature signature, DataHash documentHash, Long level, ContextAwarePolicy policy)
throws KSIException; | VerificationResult verify(KSISignature signature, DataHash documentHash, Long level, ContextAwarePolicy policy) throws KSIException; | /**
* Verifies the KSI signature. User provided document hash and level are compared against the values
* within the KSI signature.
*
* @param signature
* instance of {@link KSISignature} to be verified.
* @param documentHash
* instance of {@link DataHash} to be verified against the signature.
* @param level
* local aggregation tree height.
* @param policy
* context aware policy {@link ContextAwarePolicy} to be used to verify the signature.
* @return The verification result ({@link VerificationResult}).
* @throws KSIException
* when error occurs (e.g. when communication with KSI service fails).
*/ | Verifies the KSI signature. User provided document hash and level are compared against the values within the KSI signature | verify | {
"repo_name": "GuardTime/ksi-java-sdk",
"path": "ksi-api/src/main/java/com/guardtime/ksi/Verifier.java",
"license": "apache-2.0",
"size": 3532
} | [
"com.guardtime.ksi.exceptions.KSIException",
"com.guardtime.ksi.hashing.DataHash",
"com.guardtime.ksi.unisignature.KSISignature",
"com.guardtime.ksi.unisignature.verifier.VerificationResult",
"com.guardtime.ksi.unisignature.verifier.policies.ContextAwarePolicy"
] | import com.guardtime.ksi.exceptions.KSIException; import com.guardtime.ksi.hashing.DataHash; import com.guardtime.ksi.unisignature.KSISignature; import com.guardtime.ksi.unisignature.verifier.VerificationResult; import com.guardtime.ksi.unisignature.verifier.policies.ContextAwarePolicy; | import com.guardtime.ksi.exceptions.*; import com.guardtime.ksi.hashing.*; import com.guardtime.ksi.unisignature.*; import com.guardtime.ksi.unisignature.verifier.*; import com.guardtime.ksi.unisignature.verifier.policies.*; | [
"com.guardtime.ksi"
] | com.guardtime.ksi; | 2,557,597 |
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
try {
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
m.setAccessible(true);
m.invoke(manager, requestCode, resultCode, data);
} catch (Exception e) {
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
}
} | static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) { try { Method m = PreferenceManager.class.getDeclaredMethod(STR, int.class, int.class, Intent.class); m.setAccessible(true); m.invoke(manager, requestCode, resultCode, data); } catch (Exception e) { Log.w(TAG, STR, e); } } | /**
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
*/ | Called by the <code>PreferenceManager</code> to dispatch a subactivity result | dispatchActivityResult | {
"repo_name": "tsdl2013/COCOFramework",
"path": "framework/src/main/java/com/cocosw/framework/preference/PreferenceManagerCompat.java",
"license": "apache-2.0",
"size": 9613
} | [
"android.content.Intent",
"android.preference.PreferenceManager",
"android.util.Log",
"java.lang.reflect.Method"
] | import android.content.Intent; import android.preference.PreferenceManager; import android.util.Log; import java.lang.reflect.Method; | import android.content.*; import android.preference.*; import android.util.*; import java.lang.reflect.*; | [
"android.content",
"android.preference",
"android.util",
"java.lang"
] | android.content; android.preference; android.util; java.lang; | 1,072,963 |
public AbstractCallableImpl transform(Callable callable, AbstractNestingCallableImpl dfltParent, SubTraceImpl dfltSubTrace) {
throw new IllegalStateException("This method should never be called!");
} | AbstractCallableImpl function(Callable callable, AbstractNestingCallableImpl dfltParent, SubTraceImpl dfltSubTrace) { throw new IllegalStateException(STR); } | /**
* This is only a placeholder method. Actually, it should never be called!
*
* @param callable
* callable
* @param dfltParent
* parent
* @param dfltSubTrace
* subTrace
* @return nothing
*/ | This is only a placeholder method. Actually, it should never be called | transform | {
"repo_name": "diagnoseIT/CTA",
"path": "cta/cta.default.impl/src/main/java/rocks/cta/dflt/impl/tranformer/DefaultCTATransformer.java",
"license": "agpl-3.0",
"size": 13113
} | [
"rocks.cta.api.core.callables.Callable",
"rocks.cta.dflt.impl.core.SubTraceImpl",
"rocks.cta.dflt.impl.core.callables.AbstractCallableImpl",
"rocks.cta.dflt.impl.core.callables.AbstractNestingCallableImpl"
] | import rocks.cta.api.core.callables.Callable; import rocks.cta.dflt.impl.core.SubTraceImpl; import rocks.cta.dflt.impl.core.callables.AbstractCallableImpl; import rocks.cta.dflt.impl.core.callables.AbstractNestingCallableImpl; | import rocks.cta.api.core.callables.*; import rocks.cta.dflt.impl.core.*; import rocks.cta.dflt.impl.core.callables.*; | [
"rocks.cta.api",
"rocks.cta.dflt"
] | rocks.cta.api; rocks.cta.dflt; | 2,521,307 |
public Observable<ServiceResponseWithHeaders<Void, LROsDeleteAsyncNoRetrySucceededHeaders>> deleteAsyncNoRetrySucceededWithServiceResponseAsync() {
Observable<Response<ResponseBody>> observable = service.deleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Void>() { }.getType(), LROsDeleteAsyncNoRetrySucceededHeaders.class);
} | Observable<ServiceResponseWithHeaders<Void, LROsDeleteAsyncNoRetrySucceededHeaders>> function() { Observable<Response<ResponseBody>> observable = service.deleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken<Void>() { }.getType(), LROsDeleteAsyncNoRetrySucceededHeaders.class); } | /**
* Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/ | Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status | deleteAsyncNoRetrySucceededWithServiceResponseAsync | {
"repo_name": "hovsepm/AutoRest",
"path": "src/generator/AutoRest.Java.Azure.Fluent.Tests/src/main/java/fixtures/lro/implementation/LROsInner.java",
"license": "mit",
"size": 431095
} | [
"com.google.common.reflect.TypeToken",
"com.microsoft.rest.ServiceResponseWithHeaders"
] | import com.google.common.reflect.TypeToken; import com.microsoft.rest.ServiceResponseWithHeaders; | import com.google.common.reflect.*; import com.microsoft.rest.*; | [
"com.google.common",
"com.microsoft.rest"
] | com.google.common; com.microsoft.rest; | 515,982 |
public static void isNotNull(final Object validationInput,
final String parameterName) {
if (Check.isNull(validationInput)) {
String exceptionMessage = format(NOT_NULL_MESSAGE,
parameterName);
throw new IllegalArgumentException(exceptionMessage);
}
} | static void function(final Object validationInput, final String parameterName) { if (Check.isNull(validationInput)) { String exceptionMessage = format(NOT_NULL_MESSAGE, parameterName); throw new IllegalArgumentException(exceptionMessage); } } | /**
* Validates if the given input parameter is not <tt>null</tt>.
*
* @param validationInput The object to validate if it is not <tt>null</tt>.
* @param parameterName The parameter name used in the calling method. If this name is not <tt>null</tt>, it is
* used to generate a more useful exception message.
* @throws IllegalArgumentException If the given validation input object is <tt>null</tt>.
* @see Check#isNull(Object)
* @see Check#isNotNull(Object)
* @see Check#isNotNull(Object...)
*/ | Validates if the given input parameter is not null | isNotNull | {
"repo_name": "harmenweber/space-project",
"path": "src/main/java/ch/harmen/util/ParamValidator.java",
"license": "mit",
"size": 20515
} | [
"java.lang.String"
] | import java.lang.String; | import java.lang.*; | [
"java.lang"
] | java.lang; | 1,208,960 |
public static void start(Context context) {
context.startService(new Intent(context, SipService.class));
} | static void function(Context context) { context.startService(new Intent(context, SipService.class)); } | /**
* Starts the SIP service.
* @param context application context
*/ | Starts the SIP service | start | {
"repo_name": "alexbbb/pjsip-android",
"path": "sipservice/src/main/java/net/gotev/sipservice/SipServiceCommand.java",
"license": "apache-2.0",
"size": 22640
} | [
"android.content.Context",
"android.content.Intent"
] | import android.content.Context; import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 375,465 |
public void cutoff(int cutoffUnder, int cutoffOver) {
if (cutoffUnder > 0 || cutoffOver < Integer.MAX_VALUE) {
for (Iterator<StringList> it = iterator(); it.hasNext();) {
StringList ngram = (StringList) it.next();
int count = getCount(ngram);
if (count < cutoffUnder ||
count > cutoffOver) {
it.remove();
}
}
}
} | void function(int cutoffUnder, int cutoffOver) { if (cutoffUnder > 0 cutoffOver < Integer.MAX_VALUE) { for (Iterator<StringList> it = iterator(); it.hasNext();) { StringList ngram = (StringList) it.next(); int count = getCount(ngram); if (count < cutoffUnder count > cutoffOver) { it.remove(); } } } } | /**
* Deletes all ngram which do appear less than the cutoffUnder value
* and more often than the cutoffOver value.
*
* @param cutoffUnder
* @param cutoffOver
*/ | Deletes all ngram which do appear less than the cutoffUnder value and more often than the cutoffOver value | cutoff | {
"repo_name": "mccraigmccraig/opennlp",
"path": "src/main/java/opennlp/tools/ngram/NGramModel.java",
"license": "apache-2.0",
"size": 9274
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,900,756 |
public Query orderBy(@NonNullable FieldPath... fieldPaths) throws IllegalArgumentException; | Query function(@NonNullable FieldPath... fieldPaths) throws IllegalArgumentException; | /**
* Sets the sort ordering of the returned Documents to the ascending order of specified field paths.
* <p/>
* Multiple invocation will append the field to the sort list.
*
* @throws IllegalArgumentException if the same field is specified more than once
*
* @return {@code this} for chained invocation
*/ | Sets the sort ordering of the returned Documents to the ascending order of specified field paths. Multiple invocation will append the field to the sort list | orderBy | {
"repo_name": "ojai/ojai",
"path": "java/core/src/main/java/org/ojai/store/Query.java",
"license": "apache-2.0",
"size": 8531
} | [
"org.ojai.FieldPath",
"org.ojai.annotation.API"
] | import org.ojai.FieldPath; import org.ojai.annotation.API; | import org.ojai.*; import org.ojai.annotation.*; | [
"org.ojai",
"org.ojai.annotation"
] | org.ojai; org.ojai.annotation; | 327,240 |
public long discardUpstreamSamples(int discardFromIndex) {
int discardCount = getWriteIndex() - discardFromIndex;
Assertions.checkArgument(0 <= discardCount && discardCount <= queueSize);
if (discardCount == 0) {
if (absoluteReadIndex == 0) {
// queueSize == absoluteReadIndex == 0, so nothing has been written to the queue.
return 0;
}
int lastWriteIndex = (relativeWriteIndex == 0 ? capacity : relativeWriteIndex) - 1;
return offsets[lastWriteIndex] + sizes[lastWriteIndex];
}
queueSize -= discardCount;
relativeWriteIndex = (relativeWriteIndex + capacity - discardCount) % capacity;
// Update the largest queued timestamp, assuming that the timestamps prior to a keyframe are
// always less than the timestamp of the keyframe itself, and of subsequent frames.
largestQueuedTimestampUs = Long.MIN_VALUE;
for (int i = queueSize - 1; i >= 0; i--) {
int sampleIndex = (relativeReadIndex + i) % capacity;
largestQueuedTimestampUs = Math.max(largestQueuedTimestampUs, timesUs[sampleIndex]);
if ((flags[sampleIndex] & C.BUFFER_FLAG_KEY_FRAME) != 0) {
break;
}
}
return offsets[relativeWriteIndex];
} | long function(int discardFromIndex) { int discardCount = getWriteIndex() - discardFromIndex; Assertions.checkArgument(0 <= discardCount && discardCount <= queueSize); if (discardCount == 0) { if (absoluteReadIndex == 0) { return 0; } int lastWriteIndex = (relativeWriteIndex == 0 ? capacity : relativeWriteIndex) - 1; return offsets[lastWriteIndex] + sizes[lastWriteIndex]; } queueSize -= discardCount; relativeWriteIndex = (relativeWriteIndex + capacity - discardCount) % capacity; largestQueuedTimestampUs = Long.MIN_VALUE; for (int i = queueSize - 1; i >= 0; i--) { int sampleIndex = (relativeReadIndex + i) % capacity; largestQueuedTimestampUs = Math.max(largestQueuedTimestampUs, timesUs[sampleIndex]); if ((flags[sampleIndex] & C.BUFFER_FLAG_KEY_FRAME) != 0) { break; } } return offsets[relativeWriteIndex]; } | /**
* Discards samples from the write side of the buffer.
*
* @param discardFromIndex The absolute index of the first sample to be discarded.
* @return The reduced total number of bytes written, after the samples have been discarded.
*/ | Discards samples from the write side of the buffer | discardUpstreamSamples | {
"repo_name": "YouKim/ExoPlayer",
"path": "library/core/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java",
"license": "apache-2.0",
"size": 36215
} | [
"com.google.android.exoplayer2.util.Assertions"
] | import com.google.android.exoplayer2.util.Assertions; | import com.google.android.exoplayer2.util.*; | [
"com.google.android"
] | com.google.android; | 1,055,025 |
protected void deserialize(final int numberOfRecords, final boolean honorOrderId) {
for (int i = 0; i < numberOfRecords; i++) {
if (LOG.isDebugEnabled()) {
LOG.debug("Receive record " + i);
}
try {
final OperationExecutionRecord record = (OperationExecutionRecord) this.connector.deserializeNextRecord();
Assert.assertEquals("Tin is not equal", ConfigurationParameters.TEST_TIN, record.getTin());
Assert.assertEquals("Tout is not equal", ConfigurationParameters.TEST_TOUT, record.getTout());
Assert.assertEquals("TraceId is not equal", ConfigurationParameters.TEST_TRACE_ID, record.getTraceId());
if (honorOrderId) {
Assert.assertEquals("Eoi is not equal", i, record.getEoi());
}
Assert.assertEquals("Ess is not equal", ConfigurationParameters.TEST_ESS, record.getEss());
Assert.assertEquals("Hostname is not equal", ConfigurationParameters.TEST_HOSTNAME, record.getHostname());
Assert.assertEquals("OperationSignature is not equal", ConfigurationParameters.TEST_OPERATION_SIGNATURE, record.getOperationSignature());
Assert.assertEquals("SessionId is not equal", ConfigurationParameters.TEST_SESSION_ID, record.getSessionId());
this.recordCount++;
} catch (final ConnectorDataTransmissionException e) {
Assert.fail("Error receiving data: " + e.getMessage());
} catch (final ConnectorEndOfDataException e) {
Assert.fail("Connector has not terminated: " + e.getMessage());
}
}
} | void function(final int numberOfRecords, final boolean honorOrderId) { for (int i = 0; i < numberOfRecords; i++) { if (LOG.isDebugEnabled()) { LOG.debug(STR + i); } try { final OperationExecutionRecord record = (OperationExecutionRecord) this.connector.deserializeNextRecord(); Assert.assertEquals(STR, ConfigurationParameters.TEST_TIN, record.getTin()); Assert.assertEquals(STR, ConfigurationParameters.TEST_TOUT, record.getTout()); Assert.assertEquals(STR, ConfigurationParameters.TEST_TRACE_ID, record.getTraceId()); if (honorOrderId) { Assert.assertEquals(STR, i, record.getEoi()); } Assert.assertEquals(STR, ConfigurationParameters.TEST_ESS, record.getEss()); Assert.assertEquals(STR, ConfigurationParameters.TEST_HOSTNAME, record.getHostname()); Assert.assertEquals(STR, ConfigurationParameters.TEST_OPERATION_SIGNATURE, record.getOperationSignature()); Assert.assertEquals(STR, ConfigurationParameters.TEST_SESSION_ID, record.getSessionId()); this.recordCount++; } catch (final ConnectorDataTransmissionException e) { Assert.fail(STR + e.getMessage()); } catch (final ConnectorEndOfDataException e) { Assert.fail(STR + e.getMessage()); } } } | /**
* Read number of records from the input stream and trigger assertion errors if necessary.
*
* @param numberOfRecords
* number of expected records to receive
* @param honorOrderId
* if true the received EOI is compared to the record counter
*/ | Read number of records from the input stream and trigger assertion errors if necessary | deserialize | {
"repo_name": "HaStr/kieker",
"path": "kieker-tools/test/kieker/test/tools/junit/bridge/AbstractConnectorTest.java",
"license": "apache-2.0",
"size": 5518
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,845,104 |
public void setUrl(final String url) {
// Handle empty param
if (StringUtils.isBlank(url)) {
return;
}
final URI uri;
try {
uri = URI.create(url);
}
catch (final IllegalArgumentException ex) {
throw new ConversionException("Syntax error in url " + url, ex);
}
try {
root = ImportControlLoader.load(uri);
}
catch (final CheckstyleException ex) {
throw new ConversionException(UNABLE_TO_LOAD + url, ex);
}
} | void function(final String url) { if (StringUtils.isBlank(url)) { return; } final URI uri; try { uri = URI.create(url); } catch (final IllegalArgumentException ex) { throw new ConversionException(STR + url, ex); } try { root = ImportControlLoader.load(uri); } catch (final CheckstyleException ex) { throw new ConversionException(UNABLE_TO_LOAD + url, ex); } } | /**
* Set the parameter for the url containing the import control
* configuration. It will cause the url to be loaded.
* @param url the url of the file to load.
* @throws ConversionException on error loading the file.
*/ | Set the parameter for the url containing the import control configuration. It will cause the url to be loaded | setUrl | {
"repo_name": "attatrol/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java",
"license": "lgpl-2.1",
"size": 6123
} | [
"com.puppycrawl.tools.checkstyle.api.CheckstyleException",
"java.net.URI",
"org.apache.commons.beanutils.ConversionException",
"org.apache.commons.lang3.StringUtils"
] | import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import java.net.URI; import org.apache.commons.beanutils.ConversionException; import org.apache.commons.lang3.StringUtils; | import com.puppycrawl.tools.checkstyle.api.*; import java.net.*; import org.apache.commons.beanutils.*; import org.apache.commons.lang3.*; | [
"com.puppycrawl.tools",
"java.net",
"org.apache.commons"
] | com.puppycrawl.tools; java.net; org.apache.commons; | 2,039,327 |
@Test
public void testModelEqualsHashcode() throws Exception {
Logger.getLogger(getClass()).debug("TEST " + name.getMethodName());
EqualsHashcodeTester tester = new EqualsHashcodeTester(object);
tester.include("name");
tester.include("description");
tester.include("query");
tester.include("queryType");
tester.include("editable");
tester.include("enabled");
tester.include("required");
assertTrue(tester.testIdentityFieldEquals());
assertTrue(tester.testNonIdentityFieldEquals());
assertTrue(tester.testIdentityFieldNotEquals());
assertTrue(tester.testIdentityFieldHashcode());
assertTrue(tester.testNonIdentityFieldHashcode());
assertTrue(tester.testIdentityFieldDifferentHashcode());
} | void function() throws Exception { Logger.getLogger(getClass()).debug(STR + name.getMethodName()); EqualsHashcodeTester tester = new EqualsHashcodeTester(object); tester.include("name"); tester.include(STR); tester.include("query"); tester.include(STR); tester.include(STR); tester.include(STR); tester.include(STR); assertTrue(tester.testIdentityFieldEquals()); assertTrue(tester.testNonIdentityFieldEquals()); assertTrue(tester.testIdentityFieldNotEquals()); assertTrue(tester.testIdentityFieldHashcode()); assertTrue(tester.testNonIdentityFieldHashcode()); assertTrue(tester.testIdentityFieldDifferentHashcode()); } | /**
* Test equals and hascode methods.
*
* @throws Exception the exception
*/ | Test equals and hascode methods | testModelEqualsHashcode | {
"repo_name": "WestCoastInformatics/UMLS-Terminology-Server",
"path": "jpa-model/src/test/java/com/wci/umls/server/jpa/test/workflow/WorkflowBinDefinitionJpaUnitTest.java",
"license": "apache-2.0",
"size": 5619
} | [
"com.wci.umls.server.helpers.EqualsHashcodeTester",
"org.apache.log4j.Logger",
"org.junit.Assert"
] | import com.wci.umls.server.helpers.EqualsHashcodeTester; import org.apache.log4j.Logger; import org.junit.Assert; | import com.wci.umls.server.helpers.*; import org.apache.log4j.*; import org.junit.*; | [
"com.wci.umls",
"org.apache.log4j",
"org.junit"
] | com.wci.umls; org.apache.log4j; org.junit; | 1,096,255 |
public Map<String,Declaration> getInnerDeclarations() {
return Collections.emptyMap();
} | Map<String,Declaration> function() { return Collections.emptyMap(); } | /**
* It is not possible to declare any new variables, so always
* return an Empty Map
*/ | It is not possible to declare any new variables, so always return an Empty Map | getInnerDeclarations | {
"repo_name": "jiripetrlik/drools",
"path": "drools-core/src/main/java/org/drools/core/rule/WindowReference.java",
"license": "apache-2.0",
"size": 3581
} | [
"java.util.Collections",
"java.util.Map"
] | import java.util.Collections; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,365,338 |
public AbstractInsnNode getRegionStart() {
return regionStart;
} | AbstractInsnNode function() { return regionStart; } | /**
* Returns region start (this region is designed for static analysis).
*/ | Returns region start (this region is designed for static analysis) | getRegionStart | {
"repo_name": "mur47x111/pDiSL",
"path": "src-disl/ch/usi/dag/disl/snippet/Shadow.java",
"license": "apache-2.0",
"size": 4713
} | [
"org.objectweb.asm.tree.AbstractInsnNode"
] | import org.objectweb.asm.tree.AbstractInsnNode; | import org.objectweb.asm.tree.*; | [
"org.objectweb.asm"
] | org.objectweb.asm; | 2,410,833 |
public Session findSession(String id) throws IOException {
Session session = super.findSession(id);
// OK, at this point, we're not sure if another thread is trying to
// remove the session or not so the only way around this is to lock it
// (or attempt to) and then try to get it by this session id again. If
// the other code ran swapOut, then we should get a null back during
// this run, and if not, we lock it out so we can access the session
// safely.
if(session != null) {
synchronized(session){
session = super.findSession(session.getIdInternal());
if(session != null){
// To keep any external calling code from messing up the
// concurrency.
session.access();
session.endAccess();
}
}
}
if (session != null)
return (session);
// See if the Session is in the Store
session = swapIn(id);
return (session);
} | Session function(String id) throws IOException { Session session = super.findSession(id); if(session != null) { synchronized(session){ session = super.findSession(session.getIdInternal()); if(session != null){ session.access(); session.endAccess(); } } } if (session != null) return (session); session = swapIn(id); return (session); } | /**
* Return the active Session, associated with this Manager, with the
* specified session id (if any); otherwise return <code>null</code>.
* This method checks the persistence store if persistence is enabled,
* otherwise just uses the functionality from ManagerBase.
*
* @param id The session id for the session to be returned
*
* @exception IllegalStateException if a new session cannot be
* instantiated for any reason
* @exception IOException if an input/output error occurs while
* processing this request
*/ | Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return <code>null</code>. This method checks the persistence store if persistence is enabled, otherwise just uses the functionality from ManagerBase | findSession | {
"repo_name": "Netprophets/JBOSSWEB_7_0_13_FINAL",
"path": "java/org/apache/catalina/session/PersistentManagerBase.java",
"license": "lgpl-3.0",
"size": 36997
} | [
"java.io.IOException",
"org.apache.catalina.Session"
] | import java.io.IOException; import org.apache.catalina.Session; | import java.io.*; import org.apache.catalina.*; | [
"java.io",
"org.apache.catalina"
] | java.io; org.apache.catalina; | 206,592 |
public void setModel(ListModel model); | void function(ListModel model); | /**
* Set the value of model
*
* @param model new value of model
*/ | Set the value of model | setModel | {
"repo_name": "Sofd/viskit",
"path": "src/main/java/de/sofd/viskit/ui/imagelist/ImageListView.java",
"license": "gpl-2.0",
"size": 20991
} | [
"javax.swing.ListModel"
] | import javax.swing.ListModel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 950,969 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.