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
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<NameAvailabilityStatusInner>> regionalCheckNameAvailabilityWithResponseAsync( String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (checkNameAvailabilityParameters == null) { return Mono .error( new IllegalArgumentException( "Parameter checkNameAvailabilityParameters is required and cannot be null.")); } else { checkNameAvailabilityParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .regionalCheckNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), location, this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<NameAvailabilityStatusInner>> function( String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (location == null) { return Mono.error(new IllegalArgumentException(STR)); } if (checkNameAvailabilityParameters == null) { return Mono .error( new IllegalArgumentException( STR)); } else { checkNameAvailabilityParameters.validate(); } final String accept = STR; context = this.client.mergeContext(context); return service .regionalCheckNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), location, this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context); }
/** * Checks whether the configuration store name is available for use. * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @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 the result of a request to check the availability of a resource name along with {@link Response} on * successful completion of {@link Mono}. */
Checks whether the configuration store name is available for use
regionalCheckNameAvailabilityWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsClientImpl.java", "license": "mit", "size": 33617 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.appconfiguration.fluent.models.NameAvailabilityStatusInner", "com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.fluent.models.NameAvailabilityStatusInner; import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.appconfiguration.fluent.models.*; import com.azure.resourcemanager.appconfiguration.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
80,828
public boolean isGssV5ApReq() { String type = getValueType(); if (WSConstants.WSS_GSS_KRB_V5_AP_REQ.equals(type) || WSConstants.WSS_GSS_KRB_V5_AP_REQ1510.equals(type) || WSConstants.WSS_GSS_KRB_V5_AP_REQ4120.equals(type)) { return true; } return false; }
boolean function() { String type = getValueType(); if (WSConstants.WSS_GSS_KRB_V5_AP_REQ.equals(type) WSConstants.WSS_GSS_KRB_V5_AP_REQ1510.equals(type) WSConstants.WSS_GSS_KRB_V5_AP_REQ4120.equals(type)) { return true; } return false; }
/** * Return true if this token is a Kerberos GSS V5 AP REQ token */
Return true if this token is a Kerberos GSS V5 AP REQ token
isGssV5ApReq
{ "repo_name": "apache/wss4j", "path": "ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java", "license": "apache-2.0", "size": 12932 }
[ "org.apache.wss4j.dom.WSConstants" ]
import org.apache.wss4j.dom.WSConstants;
import org.apache.wss4j.dom.*;
[ "org.apache.wss4j" ]
org.apache.wss4j;
2,166,030
@Override public void setPlot(PolarPlot plot) { this.plot = plot; }
void function(PolarPlot plot) { this.plot = plot; }
/** * Set the plot associated with this renderer. * * @param plot the plot. * * @see #getPlot() */
Set the plot associated with this renderer
setPlot
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/chart/renderer/DefaultPolarItemRenderer.java", "license": "lgpl-2.1", "size": 33651 }
[ "org.jfree.chart.plot.PolarPlot" ]
import org.jfree.chart.plot.PolarPlot;
import org.jfree.chart.plot.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,604,267
public Integer port(final String host, final String port) { checkArgument(hosts.contains(host), "host %s not found", host); checkArgument(job.getPorts().containsKey(port), "port %s not found", port); final TaskStatus status = statuses.get(host); if (status == null) { return null; } final PortMapping portMapping = status.getPorts().get(port); if (portMapping == null) { return null; } return portMapping.getExternalPort(); }
Integer function(final String host, final String port) { checkArgument(hosts.contains(host), STR, host); checkArgument(job.getPorts().containsKey(port), STR, port); final TaskStatus status = statuses.get(host); if (status == null) { return null; } final PortMapping portMapping = status.getPorts().get(port); if (portMapping == null) { return null; } return portMapping.getExternalPort(); }
/** * Returns the port that a job can be reached at given the host and name of registered port. * This is useful to discover the value of a dynamically allocated port. * @param host the host where the job is deployed * @param port the name of the registered port * @return the port where the job can be reached, or null if the host or port name is not found */
Returns the port that a job can be reached at given the host and name of registered port. This is useful to discover the value of a dynamically allocated port
port
{ "repo_name": "mbruggmann/helios", "path": "helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJob.java", "license": "apache-2.0", "size": 12364 }
[ "com.google.common.base.Preconditions", "com.spotify.helios.common.descriptors.PortMapping", "com.spotify.helios.common.descriptors.TaskStatus", "com.spotify.helios.testing.Jobs" ]
import com.google.common.base.Preconditions; import com.spotify.helios.common.descriptors.PortMapping; import com.spotify.helios.common.descriptors.TaskStatus; import com.spotify.helios.testing.Jobs;
import com.google.common.base.*; import com.spotify.helios.common.descriptors.*; import com.spotify.helios.testing.*;
[ "com.google.common", "com.spotify.helios" ]
com.google.common; com.spotify.helios;
2,490,342
public BigInteger Reconstruction (TTP ttp, AsymKeysImpl Dkeys) { BigDecimal [] x = new BigDecimal [ttp.getK()]; BigDecimal [] mi = new BigDecimal [ttp.getK()]; for (int i = 0 ; i< ttp.getParticipants().size(); i++) { ParticipantEx Pi = ttp.getParticipant(i); x[i] = new BigDecimal(Pi.getX()); mi[i] = new BigDecimal (new BigInteger (Pi.getMiD())); } return Lagrange.inter( x, mi, BigDecimal.ZERO).mod(Dkeys.getP()); }
BigInteger function (TTP ttp, AsymKeysImpl Dkeys) { BigDecimal [] x = new BigDecimal [ttp.getK()]; BigDecimal [] mi = new BigDecimal [ttp.getK()]; for (int i = 0 ; i< ttp.getParticipants().size(); i++) { ParticipantEx Pi = ttp.getParticipant(i); x[i] = new BigDecimal(Pi.getX()); mi[i] = new BigDecimal (new BigInteger (Pi.getMiD())); } return Lagrange.inter( x, mi, BigDecimal.ZERO).mod(Dkeys.getP()); }
/** * reconstruction message with interpolation Lagrange formula * @param ttp * @param Dkeys, dealer keys * @return */
reconstruction message with interpolation Lagrange formula
Reconstruction
{ "repo_name": "chafca/p2pEngine", "path": "src/main/java/util/secure/AVProtocol/Receiver.java", "license": "lgpl-3.0", "size": 2536 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
1,441,967
public void setOidTextLength(int value) { super.set(View.PROPERTY.oidTextLength.name(), value); }
void function(int value) { super.set(View.PROPERTY.oidTextLength.name(), value); }
/** * Sets the value of the <b>oidTextLength</b> property to the given value. */
Sets the value of the oidTextLength property to the given value
setOidTextLength
{ "repo_name": "plasma-framework/plasma", "path": "plasma-provisioning/src/main/java/org/plasma/provisioning/rdb/oracle/g11/sys/impl/ViewImpl.java", "license": "apache-2.0", "size": 28230 }
[ "org.plasma.provisioning.rdb.oracle.g11.sys.View" ]
import org.plasma.provisioning.rdb.oracle.g11.sys.View;
import org.plasma.provisioning.rdb.oracle.g11.sys.*;
[ "org.plasma.provisioning" ]
org.plasma.provisioning;
1,185,291
@Test public void processMinElementsInvalidCardinality() throws IOException, ParserException { thrown.expect(ParserException.class); thrown.expectMessage("YANG file error: \"min-elements\" is defined more than once in \"leaf-list " + "invalid-interval\"."); YangNode node = manager.getDataModel("src/test/resources/MinElementsInvalidCardinality.yang"); }
void function() throws IOException, ParserException { thrown.expect(ParserException.class); thrown.expectMessage(STRmin-elements\STRleaf-list STRinvalid-interval\"."); YangNode node = manager.getDataModel(STR); }
/** * Checks whether exception is thrown when min-elements cardinality is not * as per the grammar. */
Checks whether exception is thrown when min-elements cardinality is not as per the grammar
processMinElementsInvalidCardinality
{ "repo_name": "VinodKumarS-Huawei/ietf96yang", "path": "utils/yangutils/plugin/src/test/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListenerTest.java", "license": "apache-2.0", "size": 6389 }
[ "java.io.IOException", "org.onosproject.yangutils.datamodel.YangNode", "org.onosproject.yangutils.parser.exceptions.ParserException" ]
import java.io.IOException; import org.onosproject.yangutils.datamodel.YangNode; import org.onosproject.yangutils.parser.exceptions.ParserException;
import java.io.*; import org.onosproject.yangutils.datamodel.*; import org.onosproject.yangutils.parser.exceptions.*;
[ "java.io", "org.onosproject.yangutils" ]
java.io; org.onosproject.yangutils;
2,208,076
public void setIoSession(IoSession protocolSession) { SocketAddress remote = protocolSession.getRemoteAddress(); if (remote instanceof InetSocketAddress) { remoteAddress = ((InetSocketAddress) remote).getAddress().getHostAddress(); remotePort = ((InetSocketAddress) remote).getPort(); } else { remoteAddress = remote.toString(); remotePort = -1; } remoteAddresses = new ArrayList<String>(1); remoteAddresses.add(remoteAddress); remoteAddresses = Collections.unmodifiableList(remoteAddresses); this.ioSession = protocolSession; if (log.isTraceEnabled()) { log.trace("setIoSession conn: {}", this); } }
void function(IoSession protocolSession) { SocketAddress remote = protocolSession.getRemoteAddress(); if (remote instanceof InetSocketAddress) { remoteAddress = ((InetSocketAddress) remote).getAddress().getHostAddress(); remotePort = ((InetSocketAddress) remote).getPort(); } else { remoteAddress = remote.toString(); remotePort = -1; } remoteAddresses = new ArrayList<String>(1); remoteAddresses.add(remoteAddress); remoteAddresses = Collections.unmodifiableList(remoteAddresses); this.ioSession = protocolSession; if (log.isTraceEnabled()) { log.trace(STR, this); } }
/** * Setter for MINA I/O session (connection). * * @param protocolSession * Protocol session */
Setter for MINA I/O session (connection)
setIoSession
{ "repo_name": "ant-media/Ant-Media-Server", "path": "src/main/java/org/red5/server/net/rtmp/RTMPMinaConnection.java", "license": "apache-2.0", "size": 15376 }
[ "java.net.InetSocketAddress", "java.net.SocketAddress", "java.util.ArrayList", "java.util.Collections", "org.apache.mina.core.session.IoSession" ]
import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collections; import org.apache.mina.core.session.IoSession;
import java.net.*; import java.util.*; import org.apache.mina.core.session.*;
[ "java.net", "java.util", "org.apache.mina" ]
java.net; java.util; org.apache.mina;
1,441,105
DeviceVariableState getDeviceVariableState(String deviceId, String name);
DeviceVariableState getDeviceVariableState(String deviceId, String name);
/** * Returns the device variable state for a device published by this plugin. * * @param deviceId the device ID * @param name the variable name * * @return a DeviceVariableState */
Returns the device variable state for a device published by this plugin
getDeviceVariableState
{ "repo_name": "whizzosoftware/hobson-hub-api", "path": "src/main/java/com/whizzosoftware/hobson/api/plugin/HobsonPlugin.java", "license": "epl-1.0", "size": 3912 }
[ "com.whizzosoftware.hobson.api.variable.DeviceVariableState" ]
import com.whizzosoftware.hobson.api.variable.DeviceVariableState;
import com.whizzosoftware.hobson.api.variable.*;
[ "com.whizzosoftware.hobson" ]
com.whizzosoftware.hobson;
937,600
public boolean put(String key, String value) { try { //Load into hashmap HashMap<String, String> map = new HashMap<String, String>(); BufferedReader br = new BufferedReader(new FileReader(file)); String next = br.readLine(); while(next != null) { String currentKey = next.substring(0, next.indexOf(DELIMITER)); String currentValue = next.substring(next.indexOf(DELIMITER) + 1); //Add existing to map map.put(currentKey, currentValue); //Finally next = br.readLine(); } //Add new map.put(key, value); //Save all br.close(); FileWriter fw = new FileWriter(file); for(String k : map.keySet()) { fw.write(k + DELIMITER + map.get(k)); fw.write("\n"); } //Finally fw.flush(); fw.close(); return true; } catch(Exception e) { System.err.println("Error putting " + file.getAbsolutePath()); e.printStackTrace(); return false; } }
boolean function(String key, String value) { try { HashMap<String, String> map = new HashMap<String, String>(); BufferedReader br = new BufferedReader(new FileReader(file)); String next = br.readLine(); while(next != null) { String currentKey = next.substring(0, next.indexOf(DELIMITER)); String currentValue = next.substring(next.indexOf(DELIMITER) + 1); map.put(currentKey, currentValue); next = br.readLine(); } map.put(key, value); br.close(); FileWriter fw = new FileWriter(file); for(String k : map.keySet()) { fw.write(k + DELIMITER + map.get(k)); fw.write("\n"); } fw.flush(); fw.close(); return true; } catch(Exception e) { System.err.println(STR + file.getAbsolutePath()); e.printStackTrace(); return false; } }
/** * Put a value in the db * @param key Key String * @param value Value String * @return true if successful, else false */
Put a value in the db
put
{ "repo_name": "C-D-Lewis/dashboard", "path": "android/DashboardRedux/src/main/java/cl_toolkit/FileMap.java", "license": "mit", "size": 3447 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.FileWriter", "java.util.HashMap" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.util.HashMap;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,846,508
Object fromJson = gson.fromJson(incoming, token_type.getType()); List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); if (fromJson instanceof List) { List lj = (List) fromJson; for (Object each : lj) { if (each instanceof Map) { Map<Object, Object> items = (Map) each; Map<String, Object> tmp = new LinkedHashMap(); for (Map.Entry entrySet : items.entrySet()) { Object key = entrySet.getKey(); Object value = entrySet.getValue(); tmp.put((String) key, efp.parse((String) value)); } result.add(tmp); } } } // System.out.println(result.toString()); return gson.toJson(result, token_type.getType()); }
Object fromJson = gson.fromJson(incoming, token_type.getType()); List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); if (fromJson instanceof List) { List lj = (List) fromJson; for (Object each : lj) { if (each instanceof Map) { Map<Object, Object> items = (Map) each; Map<String, Object> tmp = new LinkedHashMap(); for (Map.Entry entrySet : items.entrySet()) { Object key = entrySet.getKey(); Object value = entrySet.getValue(); tmp.put((String) key, efp.parse((String) value)); } result.add(tmp); } } } return gson.toJson(result, token_type.getType()); }
/** * CAUTION: not a generic implementation, currently works only for * List<Map<String, Object>> JSON representations. TODO add generic parsing * * @param incoming must be a JSON string reflecting the token_type structure * @param token_type the structure that the JSON represents * @return */
List> JSON representations. TODO add generic parsing
sanitize
{ "repo_name": "YourDataStories/components-visualisation", "path": "BackendUtilities/src/main/java/gr/demokritos/iit/ydsapi/couch/ResultSanitizer.java", "license": "apache-2.0", "size": 3924 }
[ "java.util.ArrayList", "java.util.LinkedHashMap", "java.util.List", "java.util.Map" ]
import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,130,695
public BoxRequestsBookmark.UpdateBookmark getUpdateRequest(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
BoxRequestsBookmark.UpdateBookmark function(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
/** * Gets a request that updates a bookmark's information * * @param id id of bookmark to update information on * @return request to update a bookmark's information */
Gets a request that updates a bookmark's information
getUpdateRequest
{ "repo_name": "follower/box-android-sdk", "path": "box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java", "license": "apache-2.0", "size": 10002 }
[ "com.box.androidsdk.content.requests.BoxRequestsBookmark" ]
import com.box.androidsdk.content.requests.BoxRequestsBookmark;
import com.box.androidsdk.content.requests.*;
[ "com.box.androidsdk" ]
com.box.androidsdk;
955,316
public Set<Role> getRoles() { return Collections.unmodifiableSet(roles); }
Set<Role> function() { return Collections.unmodifiableSet(roles); }
/** * Returns an unmodifiable set of roles. To modify the roles a user has, * replace the whole set using {@link #setRoles(Set)}. * * @return set of roles (unmodifiable, not null) */
Returns an unmodifiable set of roles. To modify the roles a user has, replace the whole set using <code>#setRoles(Set)</code>
getRoles
{ "repo_name": "jdahlstrom/vaadin.react", "path": "uitest/src/main/java/com/vaadin/tests/util/User.java", "license": "apache-2.0", "size": 1283 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
413,440
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.paint = SerialUtilities.readPaint(stream); }
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.paint = SerialUtilities.readPaint(stream); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */
Provides serialization support
readObject
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/block/ColorBlock.java", "license": "lgpl-2.1", "size": 5800 }
[ "java.io.IOException", "java.io.ObjectInputStream", "org.jfree.io.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities;
import java.io.*; import org.jfree.io.*;
[ "java.io", "org.jfree.io" ]
java.io; org.jfree.io;
1,898,177
private static Player getPlayerInfo(BufferedReader br) { final Emoji emoji = EmojiManager.getForAlias("bomb"); System.out.println(emoji.getUnicode() + emoji.getUnicode() + " WELCOME TO BOMB RING " + emoji.getUnicode() + emoji.getUnicode()); final Player p = new Player(); try { System.out.println("Please insert your name"); final String name = br.readLine(); System.out.println("Please insert your surname"); final String surname = br.readLine(); System.out.println("Please pick a nickname"); final String nickname = br.readLine(); p.setName(name); p.setSurname(surname); p.setNickname(nickname); p.setId(p.hashCode()); } catch (IOException e) { System.err.println("Error retrieving player info"); } return p; }
static Player function(BufferedReader br) { final Emoji emoji = EmojiManager.getForAlias("bomb"); System.out.println(emoji.getUnicode() + emoji.getUnicode() + STR + emoji.getUnicode() + emoji.getUnicode()); final Player p = new Player(); try { System.out.println(STR); final String name = br.readLine(); System.out.println(STR); final String surname = br.readLine(); System.out.println(STR); final String nickname = br.readLine(); p.setName(name); p.setSurname(surname); p.setNickname(nickname); p.setId(p.hashCode()); } catch (IOException e) { System.err.println(STR); } return p; }
/** * retrieve player's info from standard in * @param the buffered reader to communicate with the user * @return the current player of the game */
retrieve player's info from standard in
getPlayerInfo
{ "repo_name": "simosini/bombRing", "path": "src/peer/GameMain.java", "license": "gpl-3.0", "size": 8552 }
[ "com.vdurmont.emoji.Emoji", "com.vdurmont.emoji.EmojiManager", "java.io.BufferedReader", "java.io.IOException" ]
import com.vdurmont.emoji.Emoji; import com.vdurmont.emoji.EmojiManager; import java.io.BufferedReader; import java.io.IOException;
import com.vdurmont.emoji.*; import java.io.*;
[ "com.vdurmont.emoji", "java.io" ]
com.vdurmont.emoji; java.io;
1,654,336
void setLicenseVersion(LicenseVersion licenseVersion) { this.licenseVersion = licenseVersion; }
void setLicenseVersion(LicenseVersion licenseVersion) { this.licenseVersion = licenseVersion; }
/** * Set the license version. * * @param licenseVersion */
Set the license version
setLicenseVersion
{ "repo_name": "nate-rcl/irplus", "path": "ir_core/src/edu/ur/ir/institution/InstitutionalItemRepositoryLicense.java", "license": "apache-2.0", "size": 4683 }
[ "edu.ur.ir.repository.LicenseVersion" ]
import edu.ur.ir.repository.LicenseVersion;
import edu.ur.ir.repository.*;
[ "edu.ur.ir" ]
edu.ur.ir;
2,641,374
public ProvisioningState provisioningState() { return this.provisioningState; }
ProvisioningState function() { return this.provisioningState; }
/** * Get the provisioningState property: The current provisioning state of the outbound endpoint. This is a read-only * property and any attempt to set this value will be ignored. * * @return the provisioningState value. */
Get the provisioningState property: The current provisioning state of the outbound endpoint. This is a read-only property and any attempt to set this value will be ignored
provisioningState
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/dnsresolver/azure-resourcemanager-dnsresolver/src/main/java/com/azure/resourcemanager/dnsresolver/fluent/models/OutboundEndpointProperties.java", "license": "mit", "size": 2750 }
[ "com.azure.resourcemanager.dnsresolver.models.ProvisioningState" ]
import com.azure.resourcemanager.dnsresolver.models.ProvisioningState;
import com.azure.resourcemanager.dnsresolver.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
2,240,196
void notifyClientCertificate(Certificate clientCertificate) throws IOException;
void notifyClientCertificate(Certificate clientCertificate) throws IOException;
/** * Called by the protocol handler to report the client certificate, only if * {@link #getCertificateRequest()} returned non-null. * * Note: this method is responsible for certificate verification and validation. * * @param clientCertificate * the effective client certificate (may be an empty chain). * @throws IOException */
Called by the protocol handler to report the client certificate, only if <code>#getCertificateRequest()</code> returned non-null. Note: this method is responsible for certificate verification and validation
notifyClientCertificate
{ "repo_name": "ripple/ripple-lib-java", "path": "ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/crypto/tls/TlsServer.java", "license": "isc", "size": 2928 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
167,398
public static void writeStringFixedSize(final DataOutput out, String s, int size) throws IOException { byte[] b = toBytes(s); if (b.length > size) { throw new IOException("Trying to write " + b.length + " bytes (" + toStringBinary(b) + ") into a field of length " + size); } out.writeBytes(s); for (int i = 0; i < size - s.length(); ++i) { out.writeByte(0); } }
static void function(final DataOutput out, String s, int size) throws IOException { byte[] b = toBytes(s); if (b.length > size) { throw new IOException(STR + b.length + STR + toStringBinary(b) + STR + size); } out.writeBytes(s); for (int i = 0; i < size - s.length(); ++i) { out.writeByte(0); } }
/** * Writes a string as a fixed-size field, padded with zeros. */
Writes a string as a fixed-size field, padded with zeros
writeStringFixedSize
{ "repo_name": "cdapio/tigon", "path": "tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java", "license": "apache-2.0", "size": 40086 }
[ "java.io.DataOutput", "java.io.IOException" ]
import java.io.DataOutput; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
728,109
private List<TagTypeIndexSearchResponseDto> getTagTypeIndexSearchResponseDtosFromTerms(Terms aggregation) { List<TagTypeIndexSearchResponseDto> tagTypeIndexSearchResponseDtos = new ArrayList<>(); for (Terms.Bucket tagTypeCodeEntry : aggregation.getBuckets()) { List<TagIndexSearchResponseDto> tagIndexSearchResponseDtos = new ArrayList<>(); TagTypeIndexSearchResponseDto tagTypeIndexSearchResponseDto = new TagTypeIndexSearchResponseDto(tagTypeCodeEntry.getKeyAsString(), tagTypeCodeEntry.getDocCount(), tagIndexSearchResponseDtos, null); tagTypeIndexSearchResponseDtos.add(tagTypeIndexSearchResponseDto); Terms tagTypeDisplayNameAggs = tagTypeCodeEntry.getAggregations().get(TAGTYPE_NAME_AGGREGATION); for (Terms.Bucket tagTypeDisplayNameEntry : tagTypeDisplayNameAggs.getBuckets()) { tagTypeIndexSearchResponseDto.setDisplayName(tagTypeDisplayNameEntry.getKeyAsString()); Terms tagCodeAggs = tagTypeDisplayNameEntry.getAggregations().get(TAG_CODE_AGGREGATION); TagIndexSearchResponseDto tagIndexSearchResponseDto; for (Terms.Bucket tagCodeEntry : tagCodeAggs.getBuckets()) { tagIndexSearchResponseDto = new TagIndexSearchResponseDto(tagCodeEntry.getKeyAsString(), tagCodeEntry.getDocCount(), null); tagIndexSearchResponseDtos.add(tagIndexSearchResponseDto); Terms tagNameAggs = tagCodeEntry.getAggregations().get(TAG_NAME_AGGREGATION); for (Terms.Bucket tagNameEntry : tagNameAggs.getBuckets()) { tagIndexSearchResponseDto.setTagDisplayName(tagNameEntry.getKeyAsString()); } } } } return tagTypeIndexSearchResponseDtos; }
List<TagTypeIndexSearchResponseDto> function(Terms aggregation) { List<TagTypeIndexSearchResponseDto> tagTypeIndexSearchResponseDtos = new ArrayList<>(); for (Terms.Bucket tagTypeCodeEntry : aggregation.getBuckets()) { List<TagIndexSearchResponseDto> tagIndexSearchResponseDtos = new ArrayList<>(); TagTypeIndexSearchResponseDto tagTypeIndexSearchResponseDto = new TagTypeIndexSearchResponseDto(tagTypeCodeEntry.getKeyAsString(), tagTypeCodeEntry.getDocCount(), tagIndexSearchResponseDtos, null); tagTypeIndexSearchResponseDtos.add(tagTypeIndexSearchResponseDto); Terms tagTypeDisplayNameAggs = tagTypeCodeEntry.getAggregations().get(TAGTYPE_NAME_AGGREGATION); for (Terms.Bucket tagTypeDisplayNameEntry : tagTypeDisplayNameAggs.getBuckets()) { tagTypeIndexSearchResponseDto.setDisplayName(tagTypeDisplayNameEntry.getKeyAsString()); Terms tagCodeAggs = tagTypeDisplayNameEntry.getAggregations().get(TAG_CODE_AGGREGATION); TagIndexSearchResponseDto tagIndexSearchResponseDto; for (Terms.Bucket tagCodeEntry : tagCodeAggs.getBuckets()) { tagIndexSearchResponseDto = new TagIndexSearchResponseDto(tagCodeEntry.getKeyAsString(), tagCodeEntry.getDocCount(), null); tagIndexSearchResponseDtos.add(tagIndexSearchResponseDto); Terms tagNameAggs = tagCodeEntry.getAggregations().get(TAG_NAME_AGGREGATION); for (Terms.Bucket tagNameEntry : tagNameAggs.getBuckets()) { tagIndexSearchResponseDto.setTagDisplayName(tagNameEntry.getKeyAsString()); } } } } return tagTypeIndexSearchResponseDtos; }
/** * get Tag Type index response * * @param aggregation aggregation * * @return list of tag type index search dto */
get Tag Type index response
getTagTypeIndexSearchResponseDtosFromTerms
{ "repo_name": "kusid/herd", "path": "herd-code/herd-dao/src/main/java/org/finra/herd/dao/helper/ElasticsearchHelper.java", "license": "apache-2.0", "size": 32733 }
[ "java.util.ArrayList", "java.util.List", "org.elasticsearch.search.aggregations.bucket.terms.Terms", "org.finra.herd.model.dto.TagIndexSearchResponseDto", "org.finra.herd.model.dto.TagTypeIndexSearchResponseDto" ]
import java.util.ArrayList; import java.util.List; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.finra.herd.model.dto.TagIndexSearchResponseDto; import org.finra.herd.model.dto.TagTypeIndexSearchResponseDto;
import java.util.*; import org.elasticsearch.search.aggregations.bucket.terms.*; import org.finra.herd.model.dto.*;
[ "java.util", "org.elasticsearch.search", "org.finra.herd" ]
java.util; org.elasticsearch.search; org.finra.herd;
1,137,646
void enterParamName(@NotNull AnsaGrammarParser.ParamNameContext ctx);
void enterParamName(@NotNull AnsaGrammarParser.ParamNameContext ctx);
/** * Enter a parse tree produced by {@link AnsaGrammarParser#paramName}. * * @param ctx * the parse tree */
Enter a parse tree produced by <code>AnsaGrammarParser#paramName</code>
enterParamName
{ "repo_name": "tzbee/ansa-bot", "path": "src/com/touzbi/ansa/antlrgrammar/AnsaGrammarListener.java", "license": "mit", "size": 4423 }
[ "com.sun.istack.internal.NotNull" ]
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.*;
[ "com.sun.istack" ]
com.sun.istack;
2,401,632
public List getPBGLSalarySettingRows(String documentNumber, List salarySettingObjects);
List function(String documentNumber, List salarySettingObjects);
/** * Returns a list of Pending Budget GL rows that are Salary Setting detail related, based on the set of salarySettingObjects * passed in * * @param documentNumber * @param salarySettingObjects * @return */
Returns a list of Pending Budget GL rows that are Salary Setting detail related, based on the set of salarySettingObjects passed in
getPBGLSalarySettingRows
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/bc/document/dataaccess/BudgetConstructionDao.java", "license": "apache-2.0", "size": 8434 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,267,145
void add(RelNode rel) { if (set.rels.contains(rel)) { return; } VolcanoPlanner planner = (VolcanoPlanner) rel.getCluster().getPlanner(); if (planner.listener != null) { RelOptListener.RelEquivalenceEvent event = new RelOptListener.RelEquivalenceEvent( planner, rel, this, true); planner.listener.relEquivalenceFound(event); } // If this isn't the first rel in the set, it must have compatible // row type. if (set.rel != null) { if (!RelOptUtil.equal("rowtype of new rel", rel.getRowType(), "rowtype of set", getRowType(), true)) { throw new AssertionError(); } } set.addInternal(rel); Set<String> variablesSet = RelOptUtil.getVariablesSet(rel); Set<String> variablesStopped = rel.getVariablesStopped(); if (false) { Set<String> variablesPropagated = Util.minus(variablesSet, variablesStopped); assert set.variablesPropagated.containsAll(variablesPropagated); Set<String> variablesUsed = RelOptUtil.getVariablesUsed(rel); assert set.variablesUsed.containsAll(variablesUsed); } }
void add(RelNode rel) { if (set.rels.contains(rel)) { return; } VolcanoPlanner planner = (VolcanoPlanner) rel.getCluster().getPlanner(); if (planner.listener != null) { RelOptListener.RelEquivalenceEvent event = new RelOptListener.RelEquivalenceEvent( planner, rel, this, true); planner.listener.relEquivalenceFound(event); } if (set.rel != null) { if (!RelOptUtil.equal(STR, rel.getRowType(), STR, getRowType(), true)) { throw new AssertionError(); } } set.addInternal(rel); Set<String> variablesSet = RelOptUtil.getVariablesSet(rel); Set<String> variablesStopped = rel.getVariablesStopped(); if (false) { Set<String> variablesPropagated = Util.minus(variablesSet, variablesStopped); assert set.variablesPropagated.containsAll(variablesPropagated); Set<String> variablesUsed = RelOptUtil.getVariablesUsed(rel); assert set.variablesUsed.containsAll(variablesUsed); } }
/** * Adds expression <code>rel</code> to this subset. */
Adds expression <code>rel</code> to this subset
add
{ "repo_name": "jinfengni/incubator-optiq", "path": "core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java", "license": "apache-2.0", "size": 14501 }
[ "java.util.Set", "org.apache.calcite.plan.RelOptListener", "org.apache.calcite.plan.RelOptUtil", "org.apache.calcite.rel.RelNode", "org.apache.calcite.util.Util" ]
import java.util.Set; import org.apache.calcite.plan.RelOptListener; import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelNode; import org.apache.calcite.util.Util;
import java.util.*; import org.apache.calcite.plan.*; import org.apache.calcite.rel.*; import org.apache.calcite.util.*;
[ "java.util", "org.apache.calcite" ]
java.util; org.apache.calcite;
2,812,131
public String getDialogTitle(JFileChooser chooser) { String result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getDialogTitle(chooser); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); ui.getDialogTitle(chooser); } return result; } /** * Calls the {@link FileChooserUI#rescanCurrentDirectory(JFileChooser)}
String function(JFileChooser chooser) { String result = null; Iterator iterator = uis.iterator(); if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getDialogTitle(chooser); } while (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); ui.getDialogTitle(chooser); } return result; } /** * Calls the {@link FileChooserUI#rescanCurrentDirectory(JFileChooser)}
/** * Calls the {@link FileChooserUI#getDialogTitle(JFileChooser)} method * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, * returning the title for the UI delegate from the primary look and * feel. * * @param chooser the file chooser. * * @return The title returned by the UI delegate from the primary * look and feel. */
Calls the <code>FileChooserUI#getDialogTitle(JFileChooser)</code> method for all the UI delegates managed by this <code>MultiFileChooserUI</code>, returning the title for the UI delegate from the primary look and feel
getDialogTitle
{ "repo_name": "shaotuanchen/sunflower_exp", "path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/plaf/multi/MultiFileChooserUI.java", "license": "bsd-3-clause", "size": 16362 }
[ "java.util.Iterator", "javax.swing.JFileChooser", "javax.swing.plaf.FileChooserUI" ]
import java.util.Iterator; import javax.swing.JFileChooser; import javax.swing.plaf.FileChooserUI;
import java.util.*; import javax.swing.*; import javax.swing.plaf.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
1,383,153
public static String getFullPathTreeItem(TreeItem item) { String toReturn = item.getText(); if (item != null) { if (item.getParentItem() != null) { toReturn = getFullPathTreeItem(item.getParentItem()) + "." + toReturn; //$NON-NLS-1$ } } return toReturn; }
static String function(TreeItem item) { String toReturn = item.getText(); if (item != null) { if (item.getParentItem() != null) { toReturn = getFullPathTreeItem(item.getParentItem()) + "." + toReturn; } } return toReturn; }
/** * Returns the full path of a given tree item. * * @param item The tree item. * @return The full path of a given tree item. */
Returns the full path of a given tree item
getFullPathTreeItem
{ "repo_name": "rex-xxx/mt6572_x201", "path": "tools/motodev/src/plugins/logger.collector/src/com/motorola/studio/android/logger/collector/util/WidgetsUtil.java", "license": "gpl-2.0", "size": 11991 }
[ "org.eclipse.swt.widgets.TreeItem" ]
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,326,807
public void run() { TProcessor processor = null; TTransport inputTransport = null; TTransport outputTransport = null; TProtocol inputProtocol = null; TProtocol outputProtocol = null; TServerEventHandler eventHandler = null; ServerContext connectionContext = null; try { processor = processorFactory_.getProcessor(client_); inputTransport = inputTransportFactory_.getTransport(client_); outputTransport = outputTransportFactory_.getTransport(client_); inputProtocol = inputProtocolFactory_.getProtocol(inputTransport); outputProtocol = outputProtocolFactory_.getProtocol(outputTransport); eventHandler = getEventHandler(); if (eventHandler != null) { connectionContext = eventHandler.createContext(inputProtocol, outputProtocol); } // we check stopped_ first to make sure we're not supposed to be shutting // down. this is necessary for graceful shutdown. while (true) { if (eventHandler != null) { eventHandler.processContext(connectionContext, inputTransport, outputTransport); } if(stopped_ || !processor.process(inputProtocol, outputProtocol)) { break; } } } catch (TSaslTransportException ttx) { // Something thats not SASL was in the stream, continue silently } catch (TTransportException ttx) { // Assume the client died and continue silently } catch (TException tx) { LOGGER.error("Thrift error occurred during processing of message.", tx); } catch (Exception x) { LOGGER.error("Error occurred during processing of message.", x); } finally { if (eventHandler != null) { eventHandler.deleteContext(connectionContext, inputProtocol, outputProtocol); } if (inputTransport != null) { inputTransport.close(); } if (outputTransport != null) { outputTransport.close(); } if (client_.isOpen()) { client_.close(); } } } }
void function() { TProcessor processor = null; TTransport inputTransport = null; TTransport outputTransport = null; TProtocol inputProtocol = null; TProtocol outputProtocol = null; TServerEventHandler eventHandler = null; ServerContext connectionContext = null; try { processor = processorFactory_.getProcessor(client_); inputTransport = inputTransportFactory_.getTransport(client_); outputTransport = outputTransportFactory_.getTransport(client_); inputProtocol = inputProtocolFactory_.getProtocol(inputTransport); outputProtocol = outputProtocolFactory_.getProtocol(outputTransport); eventHandler = getEventHandler(); if (eventHandler != null) { connectionContext = eventHandler.createContext(inputProtocol, outputProtocol); } while (true) { if (eventHandler != null) { eventHandler.processContext(connectionContext, inputTransport, outputTransport); } if(stopped_ !processor.process(inputProtocol, outputProtocol)) { break; } } } catch (TSaslTransportException ttx) { } catch (TTransportException ttx) { } catch (TException tx) { LOGGER.error(STR, tx); } catch (Exception x) { LOGGER.error(STR, x); } finally { if (eventHandler != null) { eventHandler.deleteContext(connectionContext, inputProtocol, outputProtocol); } if (inputTransport != null) { inputTransport.close(); } if (outputTransport != null) { outputTransport.close(); } if (client_.isOpen()) { client_.close(); } } } }
/** * Loops on processing a client forever */
Loops on processing a client forever
run
{ "repo_name": "johnbelamaric/themis", "path": "vendor/github.com/apache/thrift/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java", "license": "apache-2.0", "size": 10411 }
[ "org.apache.thrift.TException", "org.apache.thrift.TProcessor", "org.apache.thrift.protocol.TProtocol", "org.apache.thrift.transport.TSaslTransportException", "org.apache.thrift.transport.TTransport", "org.apache.thrift.transport.TTransportException" ]
import org.apache.thrift.TException; import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TSaslTransportException; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.*; import org.apache.thrift.protocol.*; import org.apache.thrift.transport.*;
[ "org.apache.thrift" ]
org.apache.thrift;
2,170,413
public static AccountManagerHelper get(Context context) { synchronized (sLock) { if (sAccountManagerHelper == null) { sAccountManagerHelper = new AccountManagerHelper(context, new SystemAccountManagerDelegate(context)); } } return sAccountManagerHelper; }
static AccountManagerHelper function(Context context) { synchronized (sLock) { if (sAccountManagerHelper == null) { sAccountManagerHelper = new AccountManagerHelper(context, new SystemAccountManagerDelegate(context)); } } return sAccountManagerHelper; }
/** * A factory method for the AccountManagerHelper. * * It is possible to override the AccountManager to use in tests for the instance of the * AccountManagerHelper by calling overrideAccountManagerHelperForTests(...) with * your MockAccountManager. * * @param context the applicationContext is retrieved from the context used as an argument. * @return a singleton instance of the AccountManagerHelper */
A factory method for the AccountManagerHelper. It is possible to override the AccountManager to use in tests for the instance of the AccountManagerHelper by calling overrideAccountManagerHelperForTests(...) with your MockAccountManager
get
{ "repo_name": "SaschaMester/delicium", "path": "sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java", "license": "bsd-3-clause", "size": 14974 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,801,169
public ConfigPropertyType<T> configPropertySupportsDynamicUpdates(Boolean configPropertySupportsDynamicUpdates) { childNode.getOrCreate("config-property-supports-dynamic-updates").text(configPropertySupportsDynamicUpdates); return this; }
ConfigPropertyType<T> function(Boolean configPropertySupportsDynamicUpdates) { childNode.getOrCreate(STR).text(configPropertySupportsDynamicUpdates); return this; }
/** * Sets the <code>config-property-supports-dynamic-updates</code> element * @param configPropertySupportsDynamicUpdates the value for the element <code>config-property-supports-dynamic-updates</code> * @return the current instance of <code>ConfigPropertyType<T></code> */
Sets the <code>config-property-supports-dynamic-updates</code> element
configPropertySupportsDynamicUpdates
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector17/ConfigPropertyTypeImpl.java", "license": "epl-1.0", "size": 14114 }
[ "org.jboss.shrinkwrap.descriptor.api.connector17.ConfigPropertyType" ]
import org.jboss.shrinkwrap.descriptor.api.connector17.ConfigPropertyType;
import org.jboss.shrinkwrap.descriptor.api.connector17.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
1,134,529
CompletableFuture<Void> setActive(boolean state) throws Exception;
CompletableFuture<Void> setActive(boolean state) throws Exception;
/** * Sets the active state of the fan * * @param state the binary state to set * @return a future that completes when the change is made * @throws Exception when the change cannot be made */
Sets the active state of the fan
setActive
{ "repo_name": "beowulfe/HAP-Java", "path": "src/main/java/io/github/hapjava/accessories/AirPurifierAccessory.java", "license": "mit", "size": 2804 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,256,321
Injector addProvider(Class<? extends Provider<?>> provider, Object... assisted); /** * Add a factory to enhance the current Injector. * <p> * Factory interfaces are used to provide {@link Assisted assisted}
Injector addProvider(Class<? extends Provider<?>> provider, Object... assisted); /** * Add a factory to enhance the current Injector. * <p> * Factory interfaces are used to provide {@link Assisted assisted}
/** * Add a {@link Provider Provider} to enhance the current Injector. * <p> * The {@link Provider Provider} must (lazy) instantiate the class and * return the result through his {@link Provider#get() get()}. If the * Provider needs assisted parameters for instantiation, they will be taken * from assisted. The Injector itself is immediately returned. */
Add a <code>Provider Provider</code> to enhance the current Injector. The <code>Provider Provider</code> must (lazy) instantiate the class and return the result through his <code>Provider#get() get()</code>. If the Provider needs assisted parameters for instantiation, they will be taken from assisted. The Injector itself is immediately returned
addProvider
{ "repo_name": "mschorn/net.nanojl.injector", "path": "src/main/java/net/nanojl/injector/Injector.java", "license": "isc", "size": 4057 }
[ "javax.inject.Provider" ]
import javax.inject.Provider;
import javax.inject.*;
[ "javax.inject" ]
javax.inject;
1,553,907
interface TreeElement { public Nodeid fileRevision() throws HgRuntimeException; /** * File node, provided revlog being iterated is a {@link HgDataFile}; {@link #fileRevision()}
interface TreeElement { Nodeid function() throws HgRuntimeException; /** * File node, provided revlog being iterated is a {@link HgDataFile}; {@link #fileRevision()}
/** * Revision of the revlog being iterated. For example, when walking file history, return value represents file revisions. * * @return revision of the revlog being iterated. * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> */
Revision of the revlog being iterated. For example, when walking file history, return value represents file revisions
fileRevision
{ "repo_name": "CharlieKuharski/hg4j", "path": "src/org/tmatesoft/hg/core/HgChangesetTreeHandler.java", "license": "gpl-2.0", "size": 5461 }
[ "org.tmatesoft.hg.repo.HgDataFile", "org.tmatesoft.hg.repo.HgRuntimeException" ]
import org.tmatesoft.hg.repo.HgDataFile; import org.tmatesoft.hg.repo.HgRuntimeException;
import org.tmatesoft.hg.repo.*;
[ "org.tmatesoft.hg" ]
org.tmatesoft.hg;
1,360,746
public void collapse(T t) { modelChanging(); getModelObject().remove(t); modelChanged(); updateBranch(t, getRequestCycle().find(AjaxRequestTarget.class)); }
void function(T t) { modelChanging(); getModelObject().remove(t); modelChanged(); updateBranch(t, getRequestCycle().find(AjaxRequestTarget.class)); }
/** * Collapse the given node, tries to update the affected branch if the change happens on an * {@link AjaxRequestTarget}. * * @param t * the object to collapse * * @see #getModelObject() * @see Set#remove(Object) * @see #updateBranch(Object, AjaxRequestTarget) */
Collapse the given node, tries to update the affected branch if the change happens on an <code>AjaxRequestTarget</code>
collapse
{ "repo_name": "zwsong/wicket", "path": "wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/AbstractTree.java", "license": "apache-2.0", "size": 7727 }
[ "org.apache.wicket.ajax.AjaxRequestTarget" ]
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.*;
[ "org.apache.wicket" ]
org.apache.wicket;
782,120
Collections.sort(playerList, (o1, o2) -> o1.getName().compareTo(o2.getName())); }
Collections.sort(playerList, (o1, o2) -> o1.getName().compareTo(o2.getName())); }
/** * sort a player array / list compared to playernames * @param playerList the list / array of players */
sort a player array / list compared to playernames
sortPlayerlist
{ "repo_name": "Alf21/event-system", "path": "src/main/java/me/alf21/eventsystem/EventFunctions.java", "license": "gpl-3.0", "size": 12808 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,477,872
public static void addArena(final AbstractArena arena) { StorageEngine.arenas.put(arena.getName(), arena); StorageEngine.areas.put(arena.getName(), arena); }
static void function(final AbstractArena arena) { StorageEngine.arenas.put(arena.getName(), arena); StorageEngine.areas.put(arena.getName(), arena); }
/** * Registers mingiame's arena. * * @param arena */
Registers mingiame's arena
addArena
{ "repo_name": "dobrakmato/PexelCore", "path": "src/eu/matejkormuth/pexel/PexelCore/core/StorageEngine.java", "license": "gpl-3.0", "size": 13337 }
[ "eu.matejkormuth.pexel.PexelCore" ]
import eu.matejkormuth.pexel.PexelCore;
import eu.matejkormuth.pexel.*;
[ "eu.matejkormuth.pexel" ]
eu.matejkormuth.pexel;
2,133,936
public byte[] getTimeOTP() { String apdu = "D0B0000000"; byte [] outData = null; try { DaplugApduCommand apduCommand = new DaplugApduCommand( DaplugUtils.hexStringToByteArray(apdu)); DaplugApduResponse response = this.exchange(apduCommand); if(response.normalEnding()){ if (response.getDataLen() != 0) { outData = new byte[response.getDataLen()]; System.arraycopy(response.getData(), 0, outData, 0, response.getDataLen()); }else{ throw new Exception("getTimeOTP() : Dongle_info time reference not set yet !"); } }else { throw new Exception( "getTimeOTP() - Cannot get dongle time !"); } } catch (Exception e) { e.printStackTrace(); } return outData; }
byte[] function() { String apdu = STR; byte [] outData = null; try { DaplugApduCommand apduCommand = new DaplugApduCommand( DaplugUtils.hexStringToByteArray(apdu)); DaplugApduResponse response = this.exchange(apduCommand); if(response.normalEnding()){ if (response.getDataLen() != 0) { outData = new byte[response.getDataLen()]; System.arraycopy(response.getData(), 0, outData, 0, response.getDataLen()); }else{ throw new Exception(STR); } }else { throw new Exception( STR); } } catch (Exception e) { e.printStackTrace(); } return outData; }
/** * Gets the current time of the dongle. * * @return byte [] result * * @author yassir */
Gets the current time of the dongle
getTimeOTP
{ "repo_name": "Plug-up/daplug-java", "path": "src/io/daplug/session/DaplugSession.java", "license": "apache-2.0", "size": 76040 }
[ "io.daplug.apdu.DaplugApduCommand", "io.daplug.apdu.DaplugApduResponse", "io.daplug.utils.DaplugUtils" ]
import io.daplug.apdu.DaplugApduCommand; import io.daplug.apdu.DaplugApduResponse; import io.daplug.utils.DaplugUtils;
import io.daplug.apdu.*; import io.daplug.utils.*;
[ "io.daplug.apdu", "io.daplug.utils" ]
io.daplug.apdu; io.daplug.utils;
2,466,691
public String readQuery(CmsUUID projectId, String queryKey) { String key; if ((projectId != null) && !projectId.isNullUUID()) { // id 0 is special, please see below StringBuffer buffer = new StringBuffer(128); buffer.append(queryKey); if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { buffer.append("_ONLINE"); } else { buffer.append("_OFFLINE"); } key = buffer.toString(); } else { key = queryKey; } // look up the query in the cache String query = (String)m_cachedQueries.get(key); if (query == null) { // the query has not been cached yet // get the SQL statement from the properties hash query = readQuery(queryKey); if (query == null) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_QUERY_NOT_FOUND_1, queryKey)); } // replace control chars. query = CmsStringUtil.substitute(query, "\t", " "); query = CmsStringUtil.substitute(query, "\n", " "); if ((projectId != null) && !projectId.isNullUUID()) { // a project ID = 0 is an internal indicator that a project-independent // query was requested - further regex operations are not required then query = CmsSqlManager.replaceProjectPattern(projectId, query); } // to minimize costs, all statements with replaced expressions are cached in a map m_cachedQueries.put(key, query); } return query; }
String function(CmsUUID projectId, String queryKey) { String key; if ((projectId != null) && !projectId.isNullUUID()) { StringBuffer buffer = new StringBuffer(128); buffer.append(queryKey); if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { buffer.append(STR); } else { buffer.append(STR); } key = buffer.toString(); } else { key = queryKey; } String query = (String)m_cachedQueries.get(key); if (query == null) { query = readQuery(queryKey); if (query == null) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_QUERY_NOT_FOUND_1, queryKey)); } query = CmsStringUtil.substitute(query, "\t", " "); query = CmsStringUtil.substitute(query, "\n", " "); if ((projectId != null) && !projectId.isNullUUID()) { query = CmsSqlManager.replaceProjectPattern(projectId, query); } m_cachedQueries.put(key, query); } return query; }
/** * Searches for the SQL query with the specified key and project-ID.<p> * * For projectIds &ne; 0, the pattern {@link #QUERY_PROJECT_SEARCH_PATTERN} in table names of queries is * replaced with "_ONLINE_" or "_OFFLINE_" to choose the right database * tables for SQL queries that are project dependent! * * @param projectId the ID of the specified CmsProject * @param queryKey the key of the SQL query * @return the the SQL query in this property list with the specified key */
Searches for the SQL query with the specified key and project-ID. For projectIds &ne; 0, the pattern <code>#QUERY_PROJECT_SEARCH_PATTERN</code> in table names of queries is replaced with "_ONLINE_" or "_OFFLINE_" to choose the right database tables for SQL queries that are project dependent
readQuery
{ "repo_name": "comundus/opencms-comundus", "path": "src/main/java/org/opencms/db/generic/CmsSqlManager.java", "license": "lgpl-2.1", "size": 19269 }
[ "org.opencms.file.CmsProject", "org.opencms.main.CmsRuntimeException", "org.opencms.util.CmsStringUtil", "org.opencms.util.CmsUUID" ]
import org.opencms.file.CmsProject; import org.opencms.main.CmsRuntimeException; import org.opencms.util.CmsStringUtil; import org.opencms.util.CmsUUID;
import org.opencms.file.*; import org.opencms.main.*; import org.opencms.util.*;
[ "org.opencms.file", "org.opencms.main", "org.opencms.util" ]
org.opencms.file; org.opencms.main; org.opencms.util;
2,762,245
public void run() { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput infoInput = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) infoControl.getInput(); infoControl.notifyDelayedInputChange(null); infoControl.dispose(); if (infoInput.getInputElement() instanceof EObject) { EObject decEO = (EObject) infoInput.getInputElement(); if (decEO != null && decEO.eResource() != null) { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHyperlink hyperlink = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHyperlink(null, decEO, infoInput.getTokenText()); hyperlink.open(); } } } } public static final class PresenterControlCreator extends AbstractReusableInformationControlCreator {
void function() { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput infoInput = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) infoControl.getInput(); infoControl.notifyDelayedInputChange(null); infoControl.dispose(); if (infoInput.getInputElement() instanceof EObject) { EObject decEO = (EObject) infoInput.getInputElement(); if (decEO != null && decEO.eResource() != null) { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHyperlink hyperlink = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHyperlink(null, decEO, infoInput.getTokenText()); hyperlink.open(); } } } } public static final class PresenterControlCreator extends AbstractReusableInformationControlCreator {
/** * Creates, sets, activates a hyperlink. */
Creates, sets, activates a hyperlink
run
{ "repo_name": "HyVar/DarwinSPL", "path": "plugins/eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui/src-gen/eu/hyvar/context/contextValidity/resource/hyvalidityformula/ui/HyvalidityformulaTextHover.java", "license": "apache-2.0", "size": 16641 }
[ "org.eclipse.emf.ecore.EObject", "org.eclipse.jface.text.AbstractReusableInformationControlCreator" ]
import org.eclipse.emf.ecore.EObject; import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
import org.eclipse.emf.ecore.*; import org.eclipse.jface.text.*;
[ "org.eclipse.emf", "org.eclipse.jface" ]
org.eclipse.emf; org.eclipse.jface;
918,178
TemplateDTO getTemplate(String id);
TemplateDTO getTemplate(String id);
/** * Gets the template with the specified id. * * @param id id * @return template */
Gets the template with the specified id
getTemplate
{ "repo_name": "mans2singh/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java", "license": "apache-2.0", "size": 84641 }
[ "org.apache.nifi.web.api.dto.TemplateDTO" ]
import org.apache.nifi.web.api.dto.TemplateDTO;
import org.apache.nifi.web.api.dto.*;
[ "org.apache.nifi" ]
org.apache.nifi;
1,377,041
public String getAppNameFromPackage(String packageName) { String appName = null; List<PackageInfo> packages = packageManager. getInstalledPackages(SYSTEM_APPS_DISABLED_FLAG); for (PackageInfo packageInfo : packages) { if (packageName.equals(packageInfo.packageName)) { appName = packageInfo.applicationInfo. loadLabel(packageManager).toString(); break; } } return appName; }
String function(String packageName) { String appName = null; List<PackageInfo> packages = packageManager. getInstalledPackages(SYSTEM_APPS_DISABLED_FLAG); for (PackageInfo packageInfo : packages) { if (packageName.equals(packageInfo.packageName)) { appName = packageInfo.applicationInfo. loadLabel(packageManager).toString(); break; } } return appName; }
/** * Returns the app name for a particular package name. * @param packageName - Package name which you need the app name. * @return - Application name. */
Returns the app name for a particular package name
getAppNameFromPackage
{ "repo_name": "jelacote/product-mdm", "path": "modules/mobile-agents/android/client/client/src/main/java/org/wso2/emm/agent/api/ApplicationManager.java", "license": "apache-2.0", "size": 8998 }
[ "android.content.pm.PackageInfo", "java.util.List" ]
import android.content.pm.PackageInfo; import java.util.List;
import android.content.pm.*; import java.util.*;
[ "android.content", "java.util" ]
android.content; java.util;
1,777,417
public OffsetDateTime submittedAt() { return this.submittedAt; }
OffsetDateTime function() { return this.submittedAt; }
/** * Get the submittedAt property: Time the script execution was submitted. * * @return the submittedAt value. */
Get the submittedAt property: Time the script execution was submitted
submittedAt
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java", "license": "mit", "size": 11004 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
185,707
private void rollbackMemstore(BatchOperationInProgress<Pair<Mutation, Integer>> batchOp, Map<byte[], List<KeyValue>>[] familyMaps, int start, int end) { int kvsRolledback = 0; for (int i = start; i < end; i++) { // skip over request that never succeeded in the first place. if (batchOp.retCodeDetails[i].getOperationStatusCode() != OperationStatusCode.SUCCESS) { continue; } // Rollback all the kvs for this row. Map<byte[], List<KeyValue>> familyMap = familyMaps[i]; for (Map.Entry<byte[], List<KeyValue>> e : familyMap.entrySet()) { byte[] family = e.getKey(); List<KeyValue> edits = e.getValue(); // Remove those keys from the memstore that matches our // key's (row, cf, cq, timestamp, memstoreTS). The interesting part is // that even the memstoreTS has to match for keys that will be rolleded-back. Store store = getStore(family); for (KeyValue kv: edits) { store.rollback(kv); kvsRolledback++; } } } LOG.debug("rollbackMemstore rolled back " + kvsRolledback + " keyvalues from start:" + start + " to end:" + end); }
void function(BatchOperationInProgress<Pair<Mutation, Integer>> batchOp, Map<byte[], List<KeyValue>>[] familyMaps, int start, int end) { int kvsRolledback = 0; for (int i = start; i < end; i++) { if (batchOp.retCodeDetails[i].getOperationStatusCode() != OperationStatusCode.SUCCESS) { continue; } Map<byte[], List<KeyValue>> familyMap = familyMaps[i]; for (Map.Entry<byte[], List<KeyValue>> e : familyMap.entrySet()) { byte[] family = e.getKey(); List<KeyValue> edits = e.getValue(); Store store = getStore(family); for (KeyValue kv: edits) { store.rollback(kv); kvsRolledback++; } } } LOG.debug(STR + kvsRolledback + STR + start + STR + end); }
/** * Remove all the keys listed in the map from the memstore. This method is * called when a Put/Delete has updated memstore but subequently fails to update * the wal. This method is then invoked to rollback the memstore. */
Remove all the keys listed in the map from the memstore. This method is called when a Put/Delete has updated memstore but subequently fails to update the wal. This method is then invoked to rollback the memstore
rollbackMemstore
{ "repo_name": "gdweijin/hindex", "path": "src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java", "license": "apache-2.0", "size": 221667 }
[ "java.util.List", "java.util.Map", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.KeyValue", "org.apache.hadoop.hbase.client.Mutation", "org.apache.hadoop.hbase.util.Pair" ]
import java.util.List; import java.util.Map; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.util.Pair;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,244,133
ThreadInfo[] threadInfos = threadMxBean.getThreadInfo(threadMxBean.getAllThreadIds(), Integer.MAX_VALUE); Map<Long, ThreadInfo> threadInfoMap = new HashMap<>(); for (ThreadInfo threadInfo : threadInfos) { threadInfoMap.put(threadInfo.getThreadId(), threadInfo); } try (OutputStreamWriter writer = new OutputStreamWriter(outputStream)) { Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces(); writer.write(String.format("Dump of %d threads at %Tc\n", stacks.size(), new Date())); for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) { Thread thread = entry.getKey(); writer.write( String.format( "\"%s\" prio=%d tid=%d state=%s daemon=%s\n", thread.getName(), thread.getPriority(), thread.getId(), thread.getState(), thread.isDaemon())); ThreadInfo threadInfo = threadInfoMap.get(thread.getId()); if (threadInfo != null) { writer.write( String.format( " native=%s, suspended=%s, block=%d, wait=%s\n", threadInfo.isInNative(), threadInfo.isSuspended(), threadInfo.getBlockedCount(), threadInfo.getWaitedCount())); writer.write( String.format( " lock=%s owned by %s (%s), cpu=%s, user=%s\n", threadInfo.getLockName(), threadInfo.getLockOwnerName(), threadInfo.getLockOwnerId(), MILLIS_FORMAT.format( new Date(threadMxBean.getThreadCpuTime(threadInfo.getThreadId()) / 1000000L)), MILLIS_FORMAT.format( new Date( threadMxBean.getThreadUserTime(threadInfo.getThreadId()) / 1000000L)))); } for (StackTraceElement element : entry.getValue()) { writer.append(" ").append(element.toString()).append(System.lineSeparator()); } writer.write(System.lineSeparator()); } writer.write("------------------------------------------------------"); writer.write(System.lineSeparator()); writer.write("Non-daemon threads: "); writer.write(System.lineSeparator()); for (Thread thread : stacks.keySet()) { if (!thread.isDaemon()) { writer .append("\"") .append(thread.getName()) .append("\", ") .append(System.lineSeparator()); } } writer.write("------------------------------------------------------"); writer.write(System.lineSeparator()); writer.write("Blocked threads: "); writer.write(System.lineSeparator()); for (Thread thread : stacks.keySet()) { if (thread.getState() == Thread.State.BLOCKED) { writer .append("\"") .append(thread.getName()) .append("\", ") .append(System.lineSeparator()); } } writer.write("------------------------------------------------------"); } }
ThreadInfo[] threadInfos = threadMxBean.getThreadInfo(threadMxBean.getAllThreadIds(), Integer.MAX_VALUE); Map<Long, ThreadInfo> threadInfoMap = new HashMap<>(); for (ThreadInfo threadInfo : threadInfos) { threadInfoMap.put(threadInfo.getThreadId(), threadInfo); } try (OutputStreamWriter writer = new OutputStreamWriter(outputStream)) { Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces(); writer.write(String.format(STR, stacks.size(), new Date())); for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) { Thread thread = entry.getKey(); writer.write( String.format( "\"%s\STR, thread.getName(), thread.getPriority(), thread.getId(), thread.getState(), thread.isDaemon())); ThreadInfo threadInfo = threadInfoMap.get(thread.getId()); if (threadInfo != null) { writer.write( String.format( STR, threadInfo.isInNative(), threadInfo.isSuspended(), threadInfo.getBlockedCount(), threadInfo.getWaitedCount())); writer.write( String.format( STR, threadInfo.getLockName(), threadInfo.getLockOwnerName(), threadInfo.getLockOwnerId(), MILLIS_FORMAT.format( new Date(threadMxBean.getThreadCpuTime(threadInfo.getThreadId()) / 1000000L)), MILLIS_FORMAT.format( new Date( threadMxBean.getThreadUserTime(threadInfo.getThreadId()) / 1000000L)))); } for (StackTraceElement element : entry.getValue()) { writer.append(" ").append(element.toString()).append(System.lineSeparator()); } writer.write(System.lineSeparator()); } writer.write(STR); writer.write(System.lineSeparator()); writer.write(STR); writer.write(System.lineSeparator()); for (Thread thread : stacks.keySet()) { if (!thread.isDaemon()) { writer .append("\"STR\STR) .append(System.lineSeparator()); } } writer.write(STR); writer.write(System.lineSeparator()); writer.write(STR); writer.write(System.lineSeparator()); for (Thread thread : stacks.keySet()) { if (thread.getState() == Thread.State.BLOCKED) { writer .append("\"STR\STR) .append(System.lineSeparator()); } } writer.write(STR); } }
/** * Write thread dump that contains stack traces of existed threads, plus it contains some other * diagnostic information about threads such as: daemon, priority, etc. */
Write thread dump that contains stack traces of existed threads, plus it contains some other diagnostic information about threads such as: daemon, priority, etc
writeThreadDump
{ "repo_name": "codenvy/che", "path": "wsmaster/che-core-api-system/src/main/java/org/eclipse/che/api/system/server/JvmManager.java", "license": "epl-1.0", "size": 5621 }
[ "java.io.OutputStreamWriter", "java.lang.management.ThreadInfo", "java.util.Date", "java.util.HashMap", "java.util.Map" ]
import java.io.OutputStreamWriter; import java.lang.management.ThreadInfo; import java.util.Date; import java.util.HashMap; import java.util.Map;
import java.io.*; import java.lang.management.*; import java.util.*;
[ "java.io", "java.lang", "java.util" ]
java.io; java.lang; java.util;
2,447,117
@GET @Path("job/{noteId}") @ZeppelinApi public Response getNoteJobStatus(@PathParam("noteId") String noteId) throws IOException, IllegalArgumentException { LOG.info("get note job status."); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); checkIfUserCanRead(noteId, "Insufficient privileges you cannot get job status"); return new JsonResponse<>(Status.OK, null, note.generateParagraphsInfo()).build(); }
@Path(STR) Response function(@PathParam(STR) String noteId) throws IOException, IllegalArgumentException { LOG.info(STR); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); checkIfUserCanRead(noteId, STR); return new JsonResponse<>(Status.OK, null, note.generateParagraphsInfo()).build(); }
/** * Get note job status REST API. * * @param noteId ID of Note * @return JSON with status.OK * @throws IOException * @throws IllegalArgumentException */
Get note job status REST API
getNoteJobStatus
{ "repo_name": "cquptEthan/incubator-zeppelin", "path": "zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java", "license": "apache-2.0", "size": 38819 }
[ "java.io.IOException", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.Response", "org.apache.zeppelin.notebook.Note", "org.apache.zeppelin.server.JsonResponse" ]
import java.io.IOException; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import org.apache.zeppelin.notebook.Note; import org.apache.zeppelin.server.JsonResponse;
import java.io.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.zeppelin.notebook.*; import org.apache.zeppelin.server.*;
[ "java.io", "javax.ws", "org.apache.zeppelin" ]
java.io; javax.ws; org.apache.zeppelin;
836,756
public static HttpServletResponse getWrappedResponse() { return (HttpServletResponse) wrappedResponseHolder.get(); }
static HttpServletResponse function() { return (HttpServletResponse) wrappedResponseHolder.get(); }
/** * Return the HttpServletResponse currently bound to the thread. * @return the HttpServletResponse currently bound to the thread, * or <code>null</code> */
Return the HttpServletResponse currently bound to the thread
getWrappedResponse
{ "repo_name": "lpicanco/grails", "path": "src/web/org/codehaus/groovy/grails/web/servlet/WrappedResponseHolder.java", "license": "apache-2.0", "size": 1633 }
[ "javax.servlet.http.HttpServletResponse" ]
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
14,586
protected boolean readBoolean() throws IOException { return (read() == 1); }
boolean function() throws IOException { return (read() == 1); }
/** * Reads a boolean from the stream. * * @return the boolean read. * @throws IOException */
Reads a boolean from the stream
readBoolean
{ "repo_name": "elkafoury/dguitar", "path": "src/dguitar/codecs/guitarPro/GPInputStream.java", "license": "gpl-2.0", "size": 12906 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
139,152
@SuppressWarnings({ "unchecked", "rawtypes" }) public final ControllerClassFactory<OutgoingErrorMessageController<Message>> getOutgoingErrorMessageControllerFactory() { if (outgoingErrorMessageControllerFactory == null) { outgoingErrorMessageControllerFactory = new ControllerClassFactory(OutgoingErrorMessageController.class, USEFConstants.BASE_PACKAGE, USEFConstants.OUTGOING_ERROR_MESSAGE_CONTROLLER_PACKAGE_PATTERN); LOGGER.debug("Created OutgoingErrorMessageControllerFactory"); } return outgoingErrorMessageControllerFactory; }
@SuppressWarnings({ STR, STR }) final ControllerClassFactory<OutgoingErrorMessageController<Message>> function() { if (outgoingErrorMessageControllerFactory == null) { outgoingErrorMessageControllerFactory = new ControllerClassFactory(OutgoingErrorMessageController.class, USEFConstants.BASE_PACKAGE, USEFConstants.OUTGOING_ERROR_MESSAGE_CONTROLLER_PACKAGE_PATTERN); LOGGER.debug(STR); } return outgoingErrorMessageControllerFactory; }
/** * Gets OutgoingErrorMessageControllerFactory instance. * * @return OutgoingErrorMessageControllerFactory */
Gets OutgoingErrorMessageControllerFactory instance
getOutgoingErrorMessageControllerFactory
{ "repo_name": "USEF-Foundation/ri.usef.energy", "path": "usef-build/usef-core/usef-core-transport/src/main/java/energy/usef/core/factory/ControllerClassFactoryBuilder.java", "license": "apache-2.0", "size": 3268 }
[ "energy.usef.core.constant.USEFConstants", "energy.usef.core.controller.error.OutgoingErrorMessageController", "energy.usef.core.data.xml.bean.message.Message" ]
import energy.usef.core.constant.USEFConstants; import energy.usef.core.controller.error.OutgoingErrorMessageController; import energy.usef.core.data.xml.bean.message.Message;
import energy.usef.core.constant.*; import energy.usef.core.controller.error.*; import energy.usef.core.data.xml.bean.message.*;
[ "energy.usef.core" ]
energy.usef.core;
1,626,055
void removeFeedback(FeedbackJpa feedback, String authToken) throws Exception;
void removeFeedback(FeedbackJpa feedback, String authToken) throws Exception;
/** * Removes the feedback. * * @param feedback the feedback * @param authToken the auth token * @throws Exception the exception */
Removes the feedback
removeFeedback
{ "repo_name": "IHTSDO/OTF-Mapping-Service", "path": "jpa-services/src/main/java/org/ihtsdo/otf/mapping/jpa/services/rest/WorkflowServiceRest.java", "license": "apache-2.0", "size": 13473 }
[ "org.ihtsdo.otf.mapping.jpa.FeedbackJpa" ]
import org.ihtsdo.otf.mapping.jpa.FeedbackJpa;
import org.ihtsdo.otf.mapping.jpa.*;
[ "org.ihtsdo.otf" ]
org.ihtsdo.otf;
2,499,729
public java.util.Date getEndDate() { return endDate; }
java.util.Date function() { return endDate; }
/** Getter for property endDate. * @return Value of property endDate. */
Getter for property endDate
getEndDate
{ "repo_name": "vivantech/kc_fixes", "path": "src/main/java/org/kuali/kra/budget/calculator/Boundary.java", "license": "apache-2.0", "size": 5789 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,150,457
public ServiceFuture<Void> putEmptyAsync(ArrayWrapper complexBody, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(complexBody), serviceCallback); }
ServiceFuture<Void> function(ArrayWrapper complexBody, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(complexBody), serviceCallback); }
/** * Put complex types with array property which is empty. * * @param complexBody Please put an empty array * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */
Put complex types with array property which is empty
putEmptyAsync
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java", "license": "mit", "size": 16716 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,021,476
@Override public boolean isValid() { if (applicationContext.containsBean("sessionFactory")) { GrailsApplication grailsApplication = applicationContext.getBean( GrailsApplication.APPLICATION_ID, GrailsApplication.class); GrailsDomainClass domainClass = (GrailsDomainClass)grailsApplication.getArtefact( DomainClassArtefactHandler.TYPE, constraintOwningClass.getName()); if (domainClass != null) { String mappingStrategy = domainClass.getMappingStrategy(); return mappingStrategy.equals(GrailsDomainClass.GORM); } } return false; }
boolean function() { if (applicationContext.containsBean(STR)) { GrailsApplication grailsApplication = applicationContext.getBean( GrailsApplication.APPLICATION_ID, GrailsApplication.class); GrailsDomainClass domainClass = (GrailsDomainClass)grailsApplication.getArtefact( DomainClassArtefactHandler.TYPE, constraintOwningClass.getName()); if (domainClass != null) { String mappingStrategy = domainClass.getMappingStrategy(); return mappingStrategy.equals(GrailsDomainClass.GORM); } } return false; }
/** * Return whether the constraint is valid for the owning class * * @return true if it is */
Return whether the constraint is valid for the owning class
isValid
{ "repo_name": "erdi/grails-core", "path": "grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/AbstractPersistentConstraint.java", "license": "apache-2.0", "size": 3346 }
[ "org.codehaus.groovy.grails.commons.DomainClassArtefactHandler", "org.codehaus.groovy.grails.commons.GrailsApplication", "org.codehaus.groovy.grails.commons.GrailsDomainClass" ]
import org.codehaus.groovy.grails.commons.DomainClassArtefactHandler; import org.codehaus.groovy.grails.commons.GrailsApplication; import org.codehaus.groovy.grails.commons.GrailsDomainClass;
import org.codehaus.groovy.grails.commons.*;
[ "org.codehaus.groovy" ]
org.codehaus.groovy;
1,865,230
public void startServer() throws IOException { String configPath = System.getProperty("moquette.path", null); startServer(new File(configPath, "config/moquette.conf")); }
void function() throws IOException { String configPath = System.getProperty(STR, null); startServer(new File(configPath, STR)); }
/** * Starts Moquette bringing the configuration from the file * located at config/moquette.conf */
Starts Moquette bringing the configuration from the file located at config/moquette.conf
startServer
{ "repo_name": "sureddy/moquette", "path": "broker/src/main/java/org/eclipse/moquette/server/Server.java", "license": "apache-2.0", "size": 3585 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,992,876
public void addReplicaResult(int clientId, int clientSequence, TransactionResult tx) throws InconsistentResultsException { resultManager.addClientResponse(clientId, clientSequence, tx); }
void function(int clientId, int clientSequence, TransactionResult tx) throws InconsistentResultsException { resultManager.addClientResponse(clientId, clientSequence, tx); }
/** * adds a replica's result. This is used to determine when enough results * for determining an operations result were received * * @param clientId the result's client id * @param clientSequence the result's client sequence * @param tx the result * @throws InconsistentResultsException seems like a faulty replica did send * something unexpected */
adds a replica's result. This is used to determine when enough results for determining an operations result were received
addReplicaResult
{ "repo_name": "Archistar/archistar-core", "path": "src/main/java/at/ac/ait/archistar/engine/serverinterface/OzymandiasClient.java", "license": "gpl-2.0", "size": 4573 }
[ "at.archistar.bft.exceptions.InconsistentResultsException", "at.archistar.bft.messages.TransactionResult" ]
import at.archistar.bft.exceptions.InconsistentResultsException; import at.archistar.bft.messages.TransactionResult;
import at.archistar.bft.exceptions.*; import at.archistar.bft.messages.*;
[ "at.archistar.bft" ]
at.archistar.bft;
861,551
public void netlobbyOnMessage(NetLobbyFrame lobby, NetPlayerClient client, String[] message) throws IOException;
void function(NetLobbyFrame lobby, NetPlayerClient client, String[] message) throws IOException;
/** * Message received * @param lobby NetLobbyFrame * @param client NetClient * @param message Message (Already sepatated by tabs) * @throws IOException When something bad occurs */
Message received
netlobbyOnMessage
{ "repo_name": "sammymax/nullpomino", "path": "src/mu/nu/nullpo/gui/net/NetLobbyListener.java", "license": "bsd-3-clause", "size": 3355 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
982,395
public Date getData() { return data; }
Date function() { return data; }
/** * Determina o valor de data. * @return o valor de data. */
Determina o valor de data
getData
{ "repo_name": "ggonzalezcr/siscofi", "path": "src/estatisticas/atendimento/DadosAtendimento.java", "license": "gpl-3.0", "size": 8174 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
195,071
@RequestMapping(value = "v1/search", method = RequestMethod.POST) public @ResponseBody JsonNode search(@RequestBody ObjectNode combinedQuery, @RequestParam(defaultValue = "1", required = false) long start) { ObjectNode combinedQueryObject = (ObjectNode) combinedQuery.get("search"); if (combinedQueryObject == null) { throw new SamplestackSearchException("A Samplestack search must have payload with root key \"search\""); } JsonNode postedStartNode = combinedQueryObject.get("start"); if (postedStartNode != null) { start = postedStartNode.asLong(); combinedQueryObject.remove("start"); } JsonNode postedTimeZone = combinedQueryObject.get("timezone"); DateTimeZone userTimeZone = DateTimeZone.getDefault(); if (postedTimeZone != null) { try { userTimeZone = DateTimeZone.forID(postedTimeZone.asText()); } catch (IllegalArgumentException e) { throw new SamplestackInvalidParameterException("Received unrecognized timezone from browser: " + postedTimeZone.asText()); } combinedQueryObject.remove("timezone"); } // TODO review for presence/absense of date facet as performance question. return qnaService.rawSearch(ClientRole.securityContextRole(), combinedQuery, start, userTimeZone); }
@RequestMapping(value = STR, method = RequestMethod.POST) JsonNode function(@RequestBody ObjectNode combinedQuery, @RequestParam(defaultValue = "1", required = false) long start) { ObjectNode combinedQueryObject = (ObjectNode) combinedQuery.get(STR); if (combinedQueryObject == null) { throw new SamplestackSearchException(STRsearch\STRstartSTRstartSTRtimezoneSTRReceived unrecognized timezone from browser: STRtimezone"); } return qnaService.rawSearch(ClientRole.securityContextRole(), combinedQuery, start, userTimeZone); }
/** * Exposes an endpoint for searching QnADocuments. * @param combinedQuery A JSON combined query. * @param start The index of the first result to return. * @return A Search Results JSON response. */
Exposes an endpoint for searching QnADocuments
search
{ "repo_name": "marklogic/marklogic-samplestack", "path": "appserver/java-spring/src/main/java/com/marklogic/samplestack/web/QnADocumentController.java", "license": "apache-2.0", "size": 12660 }
[ "com.fasterxml.jackson.databind.JsonNode", "com.fasterxml.jackson.databind.node.ObjectNode", "com.marklogic.samplestack.exception.SamplestackSearchException", "com.marklogic.samplestack.security.ClientRole", "org.springframework.web.bind.annotation.RequestBody", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.RequestParam" ]
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.marklogic.samplestack.exception.SamplestackSearchException; import com.marklogic.samplestack.security.ClientRole; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.node.*; import com.marklogic.samplestack.exception.*; import com.marklogic.samplestack.security.*; import org.springframework.web.bind.annotation.*;
[ "com.fasterxml.jackson", "com.marklogic.samplestack", "org.springframework.web" ]
com.fasterxml.jackson; com.marklogic.samplestack; org.springframework.web;
2,454,316
public List<SortOrder> getSortOrder() { return Collections.unmodifiableList(sortOrder); }
List<SortOrder> function() { return Collections.unmodifiableList(sortOrder); }
/** * Get a copy of the current sort order array. * * @return a copy of the current sort order array */
Get a copy of the current sort order array
getSortOrder
{ "repo_name": "synes/vaadin", "path": "client/src/com/vaadin/client/widgets/Grid.java", "license": "apache-2.0", "size": 301824 }
[ "com.vaadin.client.widget.grid.sort.SortOrder", "java.util.Collections", "java.util.List" ]
import com.vaadin.client.widget.grid.sort.SortOrder; import java.util.Collections; import java.util.List;
import com.vaadin.client.widget.grid.sort.*; import java.util.*;
[ "com.vaadin.client", "java.util" ]
com.vaadin.client; java.util;
329,721
public OkRequest<T> partHeader(final String name, final String value) throws IOException { return send(name).send(": ").send(value).send(CRLF); }
OkRequest<T> function(final String name, final String value) throws IOException { return send(name).send(STR).send(value).send(CRLF); }
/** * Write a multipart header to the response body * * @param name * @param value * @return this request */
Write a multipart header to the response body
partHeader
{ "repo_name": "googolmo/OkVolley", "path": "okvolley/src/main/java/im/amomo/volley/OkRequest.java", "license": "apache-2.0", "size": 27772 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
295,836
return EnumSet.of(FunctionProperty.INJECTIVE, FunctionProperty.INVERTIBLE); }
return EnumSet.of(FunctionProperty.INJECTIVE, FunctionProperty.INVERTIBLE); }
/** * Returns the properties of this converter. */
Returns the properties of this converter
properties
{ "repo_name": "apache/sis", "path": "core/sis-utility/src/main/java/org/apache/sis/internal/converter/PathConverter.java", "license": "apache-2.0", "size": 11510 }
[ "java.util.EnumSet", "org.apache.sis.math.FunctionProperty" ]
import java.util.EnumSet; import org.apache.sis.math.FunctionProperty;
import java.util.*; import org.apache.sis.math.*;
[ "java.util", "org.apache.sis" ]
java.util; org.apache.sis;
986,839
public static void drawRectangle(Rectangle r) { g2d.draw(r); }
static void function(Rectangle r) { g2d.draw(r); }
/** * Draws the outline of the specified rectangle. * @param r the rectangle to be drawn */
Draws the outline of the specified rectangle
drawRectangle
{ "repo_name": "BossLetsPlays/GfxLib-2D", "path": "source/com/blp/gfxlib/gfx/Gfx.java", "license": "apache-2.0", "size": 25020 }
[ "java.awt.Rectangle" ]
import java.awt.Rectangle;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,628,189
public static boolean isNotEmpty(Map map) { return !MapUtils.isEmpty(map); } // Map decorators //----------------------------------------------------------------------- /** * Returns a synchronized map backed by the given map. * <p> * You must manually synchronize on the returned buffer's iterator to * avoid non-deterministic behavior: * * <pre> * Map m = MapUtils.synchronizedMap(myMap); * Set s = m.keySet(); // outside synchronized block * synchronized (m) { // synchronized on MAP! * Iterator i = s.iterator(); * while (i.hasNext()) { * process (i.next()); * } * }
static boolean function(Map map) { return !MapUtils.isEmpty(map); } /** * Returns a synchronized map backed by the given map. * <p> * You must manually synchronize on the returned buffer's iterator to * avoid non-deterministic behavior: * * <pre> * Map m = MapUtils.synchronizedMap(myMap); * Set s = m.keySet(); * synchronized (m) { * Iterator i = s.iterator(); * while (i.hasNext()) { * process (i.next()); * } * }
/** * Null-safe check if the specified map is not empty. * <p> * Null returns false. * * @param map the map to check, may be null * @return true if non-null and non-empty * @since Commons Collections 3.2 */
Null-safe check if the specified map is not empty. Null returns false
isNotEmpty
{ "repo_name": "leodmurillo/sonar", "path": "plugins/sonar-squid-java-plugin/test-resources/commons-collections-3.2.1/src/org/apache/commons/collections/MapUtils.java", "license": "lgpl-3.0", "size": 65316 }
[ "java.util.Iterator", "java.util.Map" ]
import java.util.Iterator; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,725,414
setWillNotDraw(false); xLinesPaint.setColor(Color.WHITE); pLinesPaint.setColor(Color.WHITE); pLinesPaint.setStyle(Paint.Style.STROKE); pLinesPaint.setStrokeWidth(10f); // get screen dimensions WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size); width = size.x; height = size.y; // split into increments heightIncr = (int)(0.05*height); widthIncr = (int)(0.1*width); // divide major sections for the parallel lines widthMid = (int)(0.5*width); heightFirstThird = (int)((0.333333)*height); heightSecondThird = height - heightFirstThird; widthOffset = (int)(widthMid*0.3); // SeekBar variables maxCurveOffset = width/2; varCurveOffset = (int) (maxCurveOffset * (0.3)); }
setWillNotDraw(false); xLinesPaint.setColor(Color.WHITE); pLinesPaint.setColor(Color.WHITE); pLinesPaint.setStyle(Paint.Style.STROKE); pLinesPaint.setStrokeWidth(10f); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size); width = size.x; height = size.y; heightIncr = (int)(0.05*height); widthIncr = (int)(0.1*width); widthMid = (int)(0.5*width); heightFirstThird = (int)((0.333333)*height); heightSecondThird = height - heightFirstThird; widthOffset = (int)(widthMid*0.3); maxCurveOffset = width/2; varCurveOffset = (int) (maxCurveOffset * (0.3)); }
/** * Setup of colors and screen measurements * * @param context */
Setup of colors and screen measurements
commonSetup
{ "repo_name": "sa501428/avalon", "path": "IllusionH/src/com/visor/illusionh/CanvasView.java", "license": "mit", "size": 4339 }
[ "android.content.Context", "android.graphics.Color", "android.graphics.Paint", "android.graphics.Point", "android.view.Display", "android.view.WindowManager" ]
import android.content.Context; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Point; import android.view.Display; import android.view.WindowManager;
import android.content.*; import android.graphics.*; import android.view.*;
[ "android.content", "android.graphics", "android.view" ]
android.content; android.graphics; android.view;
1,751,877
public void reset() { fDeclaration = null; fTypeDecl = null; fNil = false; fSpecified = false; fNotation = null; fMemberType = null; fValidationAttempted = ElementPSVI.VALIDATION_NONE; fValidity = ElementPSVI.VALIDITY_NOTKNOWN; fErrorCodes = null; fValidationContext = null; fNormalizedValue = null; fActualValue = null; fActualValueType = XSConstants.UNAVAILABLE_DT; fItemValueTypes = null; }
void function() { fDeclaration = null; fTypeDecl = null; fNil = false; fSpecified = false; fNotation = null; fMemberType = null; fValidationAttempted = ElementPSVI.VALIDATION_NONE; fValidity = ElementPSVI.VALIDITY_NOTKNOWN; fErrorCodes = null; fValidationContext = null; fNormalizedValue = null; fActualValue = null; fActualValueType = XSConstants.UNAVAILABLE_DT; fItemValueTypes = null; }
/** * Reset() should be called in validator startElement(..) method. */
Reset() should be called in validator startElement(..) method
reset
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java", "license": "apache-2.0", "size": 9184 }
[ "com.sun.org.apache.xerces.internal.xs.ElementPSVI", "com.sun.org.apache.xerces.internal.xs.XSConstants" ]
import com.sun.org.apache.xerces.internal.xs.ElementPSVI; import com.sun.org.apache.xerces.internal.xs.XSConstants;
import com.sun.org.apache.xerces.internal.xs.*;
[ "com.sun.org" ]
com.sun.org;
1,528,217
List<ContactGroup> getFacilityContactGroups(PerunSession sess, User user) throws InternalErrorException;
List<ContactGroup> getFacilityContactGroups(PerunSession sess, User user) throws InternalErrorException;
/** * Get list of contact groups for the user. * * @param sess * @param user * @return list of ContactGroups for the user * @throws InternalErrorException */
Get list of contact groups for the user
getFacilityContactGroups
{ "repo_name": "Simcsa/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/FacilitiesManagerBl.java", "license": "bsd-2-clause", "size": 39157 }
[ "cz.metacentrum.perun.core.api.ContactGroup", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.User", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException", "java.util.List" ]
import cz.metacentrum.perun.core.api.ContactGroup; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.List;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
2,848,456
public void addStringUtf8(int columnIndex, byte[] val) { // TODO: use Utf8.isWellFormed from Guava 16 to verify that. // the user isn't putting in any garbage data. checkNotFrozen(); checkColumn(schema.getColumnByIndex(columnIndex), Type.STRING); addVarLengthData(columnIndex, val); }
void function(int columnIndex, byte[] val) { checkNotFrozen(); checkColumn(schema.getColumnByIndex(columnIndex), Type.STRING); addVarLengthData(columnIndex, val); }
/** * Add a String for the specified value, encoded as UTF8. * Note that the provided value must not be mutated after this. * @param columnIndex the column's index in the schema * @param val value to add * @throws IllegalArgumentException if the value doesn't match the column's type * @throws IllegalStateException if the row was already applied * @throws IndexOutOfBoundsException if the column doesn't exist */
Add a String for the specified value, encoded as UTF8. Note that the provided value must not be mutated after this
addStringUtf8
{ "repo_name": "EvilMcJerkface/kudu", "path": "java/kudu-client/src/main/java/org/apache/kudu/client/PartialRow.java", "license": "apache-2.0", "size": 55411 }
[ "org.apache.kudu.Type" ]
import org.apache.kudu.Type;
import org.apache.kudu.*;
[ "org.apache.kudu" ]
org.apache.kudu;
799,529
private void exportNewNucAlignment(PrintStream out, List<Pair<String, String>> result) { for (Pair<String, String> pair : result) { // Iterates over each sequence out.println(pair.getFirst()); // Print description out.println(pair.getSecond()); // Print sequence } }
void function(PrintStream out, List<Pair<String, String>> result) { for (Pair<String, String> pair : result) { out.println(pair.getFirst()); out.println(pair.getSecond()); } }
/** * Prints a list of (description, sequence) pairs into a given * PrintStream object with fasta format. * @param out * @param result */
Prints a list of (description, sequence) pairs into a given PrintStream object with fasta format
exportNewNucAlignment
{ "repo_name": "javieriserte/bioUtils", "path": "src/seqManipulation/alignnucbyprot/AlignNucByProt.java", "license": "gpl-3.0", "size": 10568 }
[ "java.io.PrintStream", "java.util.List" ]
import java.io.PrintStream; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
726,968
public TableRetryPolicy withExponentialBackoff(Duration sleepTime, Duration maxSleep, double factor) { Preconditions.checkNotNull(sleepTime); Preconditions.checkNotNull(maxSleep); this.sleepTime = sleepTime; this.exponentialMaxSleep = maxSleep; this.exponentialFactor = factor; this.backoffType = BackoffType.EXPONENTIAL; return this; } /** * Set the jitter for the backoff policy to provide additional randomness. * If this is set, a random value between {@code [0, jitter]} will be added * to each sleepTime time. This applies to {@code FIXED} and {@code EXPONENTIAL}
TableRetryPolicy function(Duration sleepTime, Duration maxSleep, double factor) { Preconditions.checkNotNull(sleepTime); Preconditions.checkNotNull(maxSleep); this.sleepTime = sleepTime; this.exponentialMaxSleep = maxSleep; this.exponentialFactor = factor; this.backoffType = BackoffType.EXPONENTIAL; return this; } /** * Set the jitter for the backoff policy to provide additional randomness. * If this is set, a random value between {@code [0, jitter]} will be added * to each sleepTime time. This applies to {@code FIXED} and {@code EXPONENTIAL}
/** * Set the parameters for the exponential backoff policy. The actual sleepTime time * is exponentially incremented up to the {@code maxSleep} and multiplying * successive delays by the {@code factor}. * @param sleepTime initial sleepTime time * @param maxSleep upper bound sleepTime time * @param factor exponential factor for backoff * @return this policy instance */
Set the parameters for the exponential backoff policy. The actual sleepTime time is exponentially incremented up to the maxSleep and multiplying successive delays by the factor
withExponentialBackoff
{ "repo_name": "bharathkk/samza", "path": "samza-api/src/main/java/org/apache/samza/table/retry/TableRetryPolicy.java", "license": "apache-2.0", "size": 8013 }
[ "com.google.common.base.Preconditions", "java.time.Duration" ]
import com.google.common.base.Preconditions; import java.time.Duration;
import com.google.common.base.*; import java.time.*;
[ "com.google.common", "java.time" ]
com.google.common; java.time;
1,397,743
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); isTargetNode = false; droppedAllowed = true; selected = sel; if (tree instanceof DnDTree) { DnDTree dndTree = (DnDTree) tree; isTargetNode = (value == dndTree.getDropTargetNode()); if (dndTree.getRowDropLocation() == row) { droppedAllowed = false; } } setIcon(FILE_TEXT_ICON); if (!(value instanceof TreeImageDisplay)) return this; TreeImageDisplay node = (TreeImageDisplay) value; int w = 0; FontMetrics fm = getFontMetrics(getFont()); Object ho = node.getUserObject(); if (node.getLevel() == 0) { if (ho instanceof ExperimenterData) setIcon(OWNER_ICON); if (getIcon() != null) w += getIcon().getIconWidth(); w += getIconTextGap(); w += fm.stringWidth(getText()); setPreferredSize(new Dimension(w, fm.getHeight())); Color c = node.getHighLight(); if (c == null) c = tree.getForeground(); setForeground(c); if (!sel) setBorderSelectionColor(getBackground()); else setTextColor(getBackgroundSelectionColor()); return this; } setIcon(node); if (numberChildrenVisible) setText(node.getNodeText()); else setText(node.getNodeName()); setToolTipText(node.getToolTip()); Color c = node.getHighLight(); if (c == null) c = tree.getForeground(); setForeground(c); if (!sel) setBorderSelectionColor(getBackground()); else setTextColor(getBackgroundSelectionColor()); if (getIcon() != null) w += getIcon().getIconWidth(); else w += SIZE.width; w += getIconTextGap(); xText = w; if (ho instanceof ImageData) w += fm.stringWidth(node.getNodeName()); else if (node instanceof TreeFileSet) w += fm.stringWidth(getText())+40; else w += fm.stringWidth(getText()); setPreferredSize(new Dimension(w, fm.getHeight()+4));//4 b/c GTK L&F setEnabled(node.isSelectable()); return this; }
Component function(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); isTargetNode = false; droppedAllowed = true; selected = sel; if (tree instanceof DnDTree) { DnDTree dndTree = (DnDTree) tree; isTargetNode = (value == dndTree.getDropTargetNode()); if (dndTree.getRowDropLocation() == row) { droppedAllowed = false; } } setIcon(FILE_TEXT_ICON); if (!(value instanceof TreeImageDisplay)) return this; TreeImageDisplay node = (TreeImageDisplay) value; int w = 0; FontMetrics fm = getFontMetrics(getFont()); Object ho = node.getUserObject(); if (node.getLevel() == 0) { if (ho instanceof ExperimenterData) setIcon(OWNER_ICON); if (getIcon() != null) w += getIcon().getIconWidth(); w += getIconTextGap(); w += fm.stringWidth(getText()); setPreferredSize(new Dimension(w, fm.getHeight())); Color c = node.getHighLight(); if (c == null) c = tree.getForeground(); setForeground(c); if (!sel) setBorderSelectionColor(getBackground()); else setTextColor(getBackgroundSelectionColor()); return this; } setIcon(node); if (numberChildrenVisible) setText(node.getNodeText()); else setText(node.getNodeName()); setToolTipText(node.getToolTip()); Color c = node.getHighLight(); if (c == null) c = tree.getForeground(); setForeground(c); if (!sel) setBorderSelectionColor(getBackground()); else setTextColor(getBackgroundSelectionColor()); if (getIcon() != null) w += getIcon().getIconWidth(); else w += SIZE.width; w += getIconTextGap(); xText = w; if (ho instanceof ImageData) w += fm.stringWidth(node.getNodeName()); else if (node instanceof TreeFileSet) w += fm.stringWidth(getText())+40; else w += fm.stringWidth(getText()); setPreferredSize(new Dimension(w, fm.getHeight()+4)); setEnabled(node.isSelectable()); return this; }
/** * Overridden to set the icon and the text. * @see DefaultTreeCellRenderer#getTreeCellRendererComponent(JTree, Object, * boolean, boolean, boolean, int, boolean) */
Overridden to set the icon and the text
getTreeCellRendererComponent
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/TreeCellRenderer.java", "license": "gpl-2.0", "size": 11094 }
[ "java.awt.Color", "java.awt.Component", "java.awt.Dimension", "java.awt.FontMetrics", "javax.swing.JTree", "org.openmicroscopy.shoola.agents.util.browser.TreeFileSet", "org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay", "org.openmicroscopy.shoola.agents.util.dnd.DnDTree" ]
import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.FontMetrics; import javax.swing.JTree; import org.openmicroscopy.shoola.agents.util.browser.TreeFileSet; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay; import org.openmicroscopy.shoola.agents.util.dnd.DnDTree;
import java.awt.*; import javax.swing.*; import org.openmicroscopy.shoola.agents.util.browser.*; import org.openmicroscopy.shoola.agents.util.dnd.*;
[ "java.awt", "javax.swing", "org.openmicroscopy.shoola" ]
java.awt; javax.swing; org.openmicroscopy.shoola;
968,874
public String[] getKeywords() { return metadata.getValues(Metadata.KEYWORDS); }
String[] function() { return metadata.getValues(Metadata.KEYWORDS); }
/** * Return Keywords of an Office document * * @return String */
Return Keywords of an Office document
getKeywords
{ "repo_name": "NicolasEYSSERIC/Silverpeas-Core", "path": "lib-core/src/main/java/com/silverpeas/util/MetaData.java", "license": "agpl-3.0", "size": 4314 }
[ "org.apache.tika.metadata.Metadata" ]
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.*;
[ "org.apache.tika" ]
org.apache.tika;
2,371,265
@SystemApi(client = MODULE_LIBRARIES) native public static void setThreadNotifyEnabled(boolean enabled);
@SystemApi(client = MODULE_LIBRARIES) native static void function(boolean enabled);
/** * Enable thread notification. * * This is built into the VM, since that's where threads get managed. * * @param enabled {@code true} to enable thread notification; {@code false} to disable * * @hide */
Enable thread notification. This is built into the VM, since that's where threads get managed
setThreadNotifyEnabled
{ "repo_name": "google/desugar_jdk_libs", "path": "jdk11/src/libcore/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/DdmVmInternal.java", "license": "gpl-2.0", "size": 2247 }
[ "android.annotation.SystemApi" ]
import android.annotation.SystemApi;
import android.annotation.*;
[ "android.annotation" ]
android.annotation;
2,328,537
try { X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(new BASE64Decoder().decodeBuffer(str)); return KeyFactory.getInstance("RSA").generatePublic(publicKeySpec); } catch (NoSuchAlgorithmException | IOException | InvalidKeySpecException ex) { Logger.getLogger(Llaves.class.getName()).log(Level.SEVERE, null, ex); return null; } } ;
try { X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(new BASE64Decoder().decodeBuffer(str)); return KeyFactory.getInstance("RSA").generatePublic(publicKeySpec); } catch (NoSuchAlgorithmException IOException InvalidKeySpecException ex) { Logger.getLogger(Llaves.class.getName()).log(Level.SEVERE, null, ex); return null; } } ;
/** * Create the PublicKey object from the String encoded in Base64. * @param str base 64 encode public key * @return Client public key */
Create the PublicKey object from the String encoded in Base64
strToPublic
{ "repo_name": "DFOXpro/co.edu.unal.AdS-Bienestar", "path": "server/src/java/co/edu/UNal/ArquitecturaDeSoftware/Bienestar/Control/Cuentas/Util/Llaves.java", "license": "unlicense", "size": 1901 }
[ "java.io.IOException", "java.security.KeyFactory", "java.security.NoSuchAlgorithmException", "java.security.spec.InvalidKeySpecException", "java.security.spec.X509EncodedKeySpec", "java.util.logging.Level", "java.util.logging.Logger" ]
import java.io.IOException; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.logging.Level; import java.util.logging.Logger;
import java.io.*; import java.security.*; import java.security.spec.*; import java.util.logging.*;
[ "java.io", "java.security", "java.util" ]
java.io; java.security; java.util;
1,163,934
public TipoDocumento gettDoc() { return tDoc; }
TipoDocumento function() { return tDoc; }
/** * Metodo que permite obtener el valor del atributo tDoc * * @return tDoc el tipo de documento de la persona */
Metodo que permite obtener el valor del atributo tDoc
gettDoc
{ "repo_name": "uniquindiogaso/suturno", "path": "Persistencia/src/main/java/co/edu/uniquindio/ingesis/suturno/entidades/Persona.java", "license": "apache-2.0", "size": 13537 }
[ "co.edu.uniquindio.ingesis.suturno.utils.TipoDocumento" ]
import co.edu.uniquindio.ingesis.suturno.utils.TipoDocumento;
import co.edu.uniquindio.ingesis.suturno.utils.*;
[ "co.edu.uniquindio" ]
co.edu.uniquindio;
516,775
Preconditions.checkNotNull(sourceUnit, "SourceUnit"); for (TimeUnit unit : REVERSED) { if (unit.convert(source, sourceUnit) > 0) { return unit; } } return sourceUnit; }
Preconditions.checkNotNull(sourceUnit, STR); for (TimeUnit unit : REVERSED) { if (unit.convert(source, sourceUnit) > 0) { return unit; } } return sourceUnit; }
/** * Attempts to find a {@link TimeUnit} in which the given * time can be presented in a human friendly way. * <p> * Note: This function does not produce accurate results. * E.g. 23 hours, 59 minutes and 59 seconds will return hours. * </p> * * @param source the source time * @param sourceUnit the unit of source * @return a time unit for mere mortals * @throws NullPointerException if sourceUnit is null */
Attempts to find a <code>TimeUnit</code> in which the given time can be presented in a human friendly way. Note: This function does not produce accurate results. E.g. 23 hours, 59 minutes and 59 seconds will return hours.
forMortals
{ "repo_name": "cosmocode/cosmocode-commons", "path": "src/main/java/de/cosmocode/commons/concurrent/TimeUnits.java", "license": "apache-2.0", "size": 2139 }
[ "com.google.common.base.Preconditions", "java.util.concurrent.TimeUnit" ]
import com.google.common.base.Preconditions; import java.util.concurrent.TimeUnit;
import com.google.common.base.*; import java.util.concurrent.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,101,681
public static ByteString createByteStringFromConf(Configuration conf) throws IOException { Preconditions.checkNotNull(conf, "Configuration must be specified"); ByteString.Output os = ByteString.newOutput(); DeflaterOutputStream compressOs = new DeflaterOutputStream(os, new Deflater(Deflater.BEST_SPEED)); try { writeConfInPB(compressOs, conf); } finally { if (compressOs != null) { compressOs.close(); } } return os.toByteString(); } /** * Convert a Configuration to a {@link org.apache.tez.dag.api.UserPayload} </p> * * * @param conf configuration to be converted * @return an instance of {@link org.apache.tez.dag.api.UserPayload}
static ByteString function(Configuration conf) throws IOException { Preconditions.checkNotNull(conf, STR); ByteString.Output os = ByteString.newOutput(); DeflaterOutputStream compressOs = new DeflaterOutputStream(os, new Deflater(Deflater.BEST_SPEED)); try { writeConfInPB(compressOs, conf); } finally { if (compressOs != null) { compressOs.close(); } } return os.toByteString(); } /** * Convert a Configuration to a {@link org.apache.tez.dag.api.UserPayload} </p> * * * @param conf configuration to be converted * @return an instance of {@link org.apache.tez.dag.api.UserPayload}
/** * Convert a Configuration to compressed ByteString using Protocol buffer * * @param conf * : Configuration to be converted * @return PB ByteString (compressed) * @throws java.io.IOException */
Convert a Configuration to compressed ByteString using Protocol buffer
createByteStringFromConf
{ "repo_name": "ChetnaChaudhari/tez", "path": "tez-api/src/main/java/org/apache/tez/common/TezUtils.java", "license": "apache-2.0", "size": 7043 }
[ "com.google.common.base.Preconditions", "com.google.protobuf.ByteString", "java.io.IOException", "java.util.zip.Deflater", "java.util.zip.DeflaterOutputStream", "org.apache.hadoop.conf.Configuration", "org.apache.tez.dag.api.UserPayload" ]
import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; import java.io.IOException; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import org.apache.hadoop.conf.Configuration; import org.apache.tez.dag.api.UserPayload;
import com.google.common.base.*; import com.google.protobuf.*; import java.io.*; import java.util.zip.*; import org.apache.hadoop.conf.*; import org.apache.tez.dag.api.*;
[ "com.google.common", "com.google.protobuf", "java.io", "java.util", "org.apache.hadoop", "org.apache.tez" ]
com.google.common; com.google.protobuf; java.io; java.util; org.apache.hadoop; org.apache.tez;
2,785,825
@Test public void testQuirksMode() throws ParseException { SchemaParserTestUtils.testQuirksMode( parser, "APPLIES 1.1" ); try { parser.setQuirksMode( true ); // ensure all other test pass in quirks mode testNumericOid(); testNames(); testDescription(); testObsolete(); testApplies(); testExtensions(); testFull(); testUniqueElements(); testRequiredElements(); testOpenldap1(); testMultiThreaded(); } finally { parser.setQuirksMode( false ); } }
void function() throws ParseException { SchemaParserTestUtils.testQuirksMode( parser, STR ); try { parser.setQuirksMode( true ); testNumericOid(); testNames(); testDescription(); testObsolete(); testApplies(); testExtensions(); testFull(); testUniqueElements(); testRequiredElements(); testOpenldap1(); testMultiThreaded(); } finally { parser.setQuirksMode( false ); } }
/** * Tests quirks mode. */
Tests quirks mode
testQuirksMode
{ "repo_name": "darranl/directory-shared", "path": "ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/parser/MatchingRuleUseDescriptionSchemaParserTest.java", "license": "apache-2.0", "size": 16527 }
[ "java.text.ParseException" ]
import java.text.ParseException;
import java.text.*;
[ "java.text" ]
java.text;
1,748,648
public static String getMessage(ResourceBundle resources, String bundleName, Locale locale, String messageKey) { String message; try { return resources.getString(messageKey); } catch (MissingResourceException e) { complainMissingMessage("Missing resource '" + messageKey + "' in bundle '" + bundleName + "' for locale '"+locale.toString()+"'", e,bundleName,locale,messageKey); return null; } }
static String function(ResourceBundle resources, String bundleName, Locale locale, String messageKey) { String message; try { return resources.getString(messageKey); } catch (MissingResourceException e) { complainMissingMessage(STR + messageKey + STR + bundleName + STR+locale.toString()+"'", e,bundleName,locale,messageKey); return null; } }
/** Obtain a message given a resource bundle and message key. *@return null if the message could not be found. */
Obtain a message given a resource bundle and message key
getMessage
{ "repo_name": "buddhikaDilhan/GSoC_buddhika", "path": "framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java", "license": "apache-2.0", "size": 13916 }
[ "java.util.Locale", "java.util.MissingResourceException", "java.util.ResourceBundle" ]
import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
2,186,767
protected int nextBits(int numBits) { long rv = 0; int bytes = (numBits + 7) / 8; for (int i = 0; i < bytes; i++) rv += ((_fortuna.nextByte() & 0xFF) << i*8); //rv >>>= (64-numBits); if (rv < 0) rv = 0 - rv; int off = 8*bytes - numBits; rv >>>= off; return (int)rv; } @Override public EntropyHarvester harvester() { return this; }
int function(int numBits) { long rv = 0; int bytes = (numBits + 7) / 8; for (int i = 0; i < bytes; i++) rv += ((_fortuna.nextByte() & 0xFF) << i*8); if (rv < 0) rv = 0 - rv; int off = 8*bytes - numBits; rv >>>= off; return (int)rv; } public EntropyHarvester harvester() { return this; }
/** * Pull the next numBits of random data off the fortuna instance (returning 0 * through 2^numBits-1 * * Caller must synchronize! */
Pull the next numBits of random data off the fortuna instance (returning 0 through 2^numBits-1 Caller must synchronize
nextBits
{ "repo_name": "oakes/Nightweb", "path": "common/java/core/net/i2p/util/FortunaRandomSource.java", "license": "unlicense", "size": 7992 }
[ "net.i2p.crypto.EntropyHarvester" ]
import net.i2p.crypto.EntropyHarvester;
import net.i2p.crypto.*;
[ "net.i2p.crypto" ]
net.i2p.crypto;
1,040,870
public void notifyAccessibilityEvent(AccessibilityEvent event) { synchronized (mLock) { final int eventType = event.getEventType(); // Make a copy since during dispatch it is possible the event to // be modified to remove its source if the receiving service does // not have permission to access the window content. AccessibilityEvent newEvent = AccessibilityEvent.obtain(event); AccessibilityEvent oldEvent = mPendingEvents.get(eventType); mPendingEvents.put(eventType, newEvent); final int what = eventType; if (oldEvent != null) { mHandler.removeMessages(what); oldEvent.recycle(); } Message message = mHandler.obtainMessage(what); mHandler.sendMessageDelayed(message, mNotificationTimeout); } }
void function(AccessibilityEvent event) { synchronized (mLock) { final int eventType = event.getEventType(); AccessibilityEvent newEvent = AccessibilityEvent.obtain(event); AccessibilityEvent oldEvent = mPendingEvents.get(eventType); mPendingEvents.put(eventType, newEvent); final int what = eventType; if (oldEvent != null) { mHandler.removeMessages(what); oldEvent.recycle(); } Message message = mHandler.obtainMessage(what); mHandler.sendMessageDelayed(message, mNotificationTimeout); } }
/** * Performs a notification for an {@link AccessibilityEvent}. * * @param event The event. */
Performs a notification for an <code>AccessibilityEvent</code>
notifyAccessibilityEvent
{ "repo_name": "rex-xxx/mt6572_x201", "path": "frameworks/base/services/java/com/android/server/accessibility/AccessibilityManagerService.java", "license": "gpl-2.0", "size": 112156 }
[ "android.os.Message", "android.view.accessibility.AccessibilityEvent" ]
import android.os.Message; import android.view.accessibility.AccessibilityEvent;
import android.os.*; import android.view.accessibility.*;
[ "android.os", "android.view" ]
android.os; android.view;
428,183
Dimension getImageDimensions(File file) throws IOException { ImageInputStream in = ImageIO.createImageInputStream(file); try { final Iterator<ImageReader> readers = ImageIO.getImageReaders(in); if (readers.hasNext()) { ImageReader reader = readers.next(); try { reader.setInput(in); return new Dimension(reader.getWidth(0), reader.getHeight(0)); } finally { reader.dispose(); } } } finally { if (in != null) { in.close(); } } return null; }
Dimension getImageDimensions(File file) throws IOException { ImageInputStream in = ImageIO.createImageInputStream(file); try { final Iterator<ImageReader> readers = ImageIO.getImageReaders(in); if (readers.hasNext()) { ImageReader reader = readers.next(); try { reader.setInput(in); return new Dimension(reader.getWidth(0), reader.getHeight(0)); } finally { reader.dispose(); } } } finally { if (in != null) { in.close(); } } return null; }
/** * Return the dimensions of the specified image file. * * @param file * @return dimensions of the image * @throws IOException */
Return the dimensions of the specified image file
getImageDimensions
{ "repo_name": "gitblit/moxie", "path": "toolkit/src/all/java/org/moxie/ant/MxThumbs.java", "license": "apache-2.0", "size": 4840 }
[ "java.awt.Dimension", "java.io.File", "java.io.IOException", "java.util.Iterator", "javax.imageio.ImageIO", "javax.imageio.ImageReader", "javax.imageio.stream.ImageInputStream" ]
import java.awt.Dimension; import java.io.File; import java.io.IOException; import java.util.Iterator; import javax.imageio.ImageIO; import javax.imageio.ImageReader; import javax.imageio.stream.ImageInputStream;
import java.awt.*; import java.io.*; import java.util.*; import javax.imageio.*; import javax.imageio.stream.*;
[ "java.awt", "java.io", "java.util", "javax.imageio" ]
java.awt; java.io; java.util; javax.imageio;
940,973
@Override public void stop(BundleContext context) throws Exception { super.stop(context); plugin = null; resourceBundle = null; }
void function(BundleContext context) throws Exception { super.stop(context); plugin = null; resourceBundle = null; }
/** * This method is called when the plug-in is stopped */
This method is called when the plug-in is stopped
stop
{ "repo_name": "nasa/OpenSPIFe", "path": "gov.nasa.arc.spife.core.constraints.view/src/gov/nasa/arc/spife/core/constraints/view/ConstraintsViewPlugin.java", "license": "apache-2.0", "size": 2651 }
[ "org.osgi.framework.BundleContext" ]
import org.osgi.framework.BundleContext;
import org.osgi.framework.*;
[ "org.osgi.framework" ]
org.osgi.framework;
1,578,842
public RelationEvent getRelationEventObject( RelationEvent relationEventObject, List<Element> referencedList) throws URISyntaxException, InvalidDataException { if (isInternalIdSet(relationEventObject)) { for (Element element : referencedList) { if (element.getRefId().equals(relationEventObject.getInternal_refId())) { relationEventObject = (RelationEvent) element; return relationEventObject; } } throw new InvalidDataException("The referrenced relation event is not present"); } if (isExternalIdSet(relationEventObject)) { String externalRefId = relationEventObject.getExternal_refId(); if(externalRefId.startsWith(IXmlElements.REL_EVENT_ID_PREFIX)) { relationEventObject = relationEventRepository .findById(relationEventObject.getExternal_refId()); if (relationEventObject != null) { relationEventObject.setExternal_refId(externalRefId); return relationEventObject; } else { throw new InvalidDataException("Relation Event with " + externalRefId + " not present in database."); } } else throw new InvalidDataException("The given ID is not corresponding to RELATION_EVENT"); } if (!isIdSet(relationEventObject)) { relationEventObject.setId(createId(IXmlElements.REL_EVENT_ID_PREFIX)); relationEventObject.setIdAssigned(true); } else { if (!relationEventObject.isIdAssigned()) throw new InvalidDataException( "The Id for the relation event is already assigned"); } Relation relationObject = relationEventObject.getRelation(); relationObject = getRelationObjcet(relationObject, referencedList); relationEventObject.setRelation(relationObject); return relationEventObject; }
RelationEvent function( RelationEvent relationEventObject, List<Element> referencedList) throws URISyntaxException, InvalidDataException { if (isInternalIdSet(relationEventObject)) { for (Element element : referencedList) { if (element.getRefId().equals(relationEventObject.getInternal_refId())) { relationEventObject = (RelationEvent) element; return relationEventObject; } } throw new InvalidDataException(STR); } if (isExternalIdSet(relationEventObject)) { String externalRefId = relationEventObject.getExternal_refId(); if(externalRefId.startsWith(IXmlElements.REL_EVENT_ID_PREFIX)) { relationEventObject = relationEventRepository .findById(relationEventObject.getExternal_refId()); if (relationEventObject != null) { relationEventObject.setExternal_refId(externalRefId); return relationEventObject; } else { throw new InvalidDataException(STR + externalRefId + STR); } } else throw new InvalidDataException(STR); } if (!isIdSet(relationEventObject)) { relationEventObject.setId(createId(IXmlElements.REL_EVENT_ID_PREFIX)); relationEventObject.setIdAssigned(true); } else { if (!relationEventObject.isIdAssigned()) throw new InvalidDataException( STR); } Relation relationObject = relationEventObject.getRelation(); relationObject = getRelationObjcet(relationObject, referencedList); relationEventObject.setRelation(relationObject); return relationEventObject; }
/** * This method stores relationObject into the database. * * @param relationEventObject * the relation event object to store in the db. * @param termsList * the list of the terms already stored in the db. * @return URI of the node in the database. */
This method stores relationObject into the database
getRelationEventObject
{ "repo_name": "AourpallyNikhil/qstore", "path": "QStore4S/src/main/java/edu/asu/qstore4s/db/neo4j/impl/StoreObjectsToDb.java", "license": "mit", "size": 17648 }
[ "edu.asu.qstore4s.converter.IXmlElements", "edu.asu.qstore4s.domain.elements.impl.Element", "edu.asu.qstore4s.domain.elements.impl.Relation", "edu.asu.qstore4s.domain.events.impl.RelationEvent", "edu.asu.qstore4s.exception.InvalidDataException", "java.net.URISyntaxException", "java.util.List" ]
import edu.asu.qstore4s.converter.IXmlElements; import edu.asu.qstore4s.domain.elements.impl.Element; import edu.asu.qstore4s.domain.elements.impl.Relation; import edu.asu.qstore4s.domain.events.impl.RelationEvent; import edu.asu.qstore4s.exception.InvalidDataException; import java.net.URISyntaxException; import java.util.List;
import edu.asu.qstore4s.converter.*; import edu.asu.qstore4s.domain.elements.impl.*; import edu.asu.qstore4s.domain.events.impl.*; import edu.asu.qstore4s.exception.*; import java.net.*; import java.util.*;
[ "edu.asu.qstore4s", "java.net", "java.util" ]
edu.asu.qstore4s; java.net; java.util;
1,811,978
public Iterator iterateObjects() { return getObjectStore().iterateObjects(); }
Iterator function() { return getObjectStore().iterateObjects(); }
/** * This class is not thread safe, changes to the working memory during * iteration may give unexpected results */
This class is not thread safe, changes to the working memory during iteration may give unexpected results
iterateObjects
{ "repo_name": "OnePaaS/drools", "path": "drools-core/src/main/java/org/drools/core/impl/StatefulKnowledgeSessionImpl.java", "license": "apache-2.0", "size": 82023 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,821,194
static void drawTexture(RendererCommon.GlDrawer drawer, VideoFrame.TextureBuffer buffer, Matrix renderMatrix, int frameWidth, int frameHeight, int viewportX, int viewportY, int viewportWidth, int viewportHeight) { Matrix finalMatrix = new Matrix(buffer.getTransformMatrix()); finalMatrix.preConcat(renderMatrix); float[] finalGlMatrix = RendererCommon.convertMatrixFromAndroidGraphicsMatrix(finalMatrix); switch (buffer.getType()) { case OES: drawer.drawOes(buffer.getTextureId(), finalGlMatrix, frameWidth, frameHeight, viewportX, viewportY, viewportWidth, viewportHeight); break; case RGB: drawer.drawRgb(buffer.getTextureId(), finalGlMatrix, frameWidth, frameHeight, viewportX, viewportY, viewportWidth, viewportHeight); break; default: throw new RuntimeException("Unknown texture type."); } } private static class YuvUploader { // Intermediate copy buffer for uploading yuv frames that are not packed, i.e. stride > width. // TODO(magjed): Investigate when GL_UNPACK_ROW_LENGTH is available, or make a custom shader // that handles stride and compare performance with intermediate copy. @Nullable private ByteBuffer copyBuffer; @Nullable private int[] yuvTextures;
static void drawTexture(RendererCommon.GlDrawer drawer, VideoFrame.TextureBuffer buffer, Matrix renderMatrix, int frameWidth, int frameHeight, int viewportX, int viewportY, int viewportWidth, int viewportHeight) { Matrix finalMatrix = new Matrix(buffer.getTransformMatrix()); finalMatrix.preConcat(renderMatrix); float[] finalGlMatrix = RendererCommon.convertMatrixFromAndroidGraphicsMatrix(finalMatrix); switch (buffer.getType()) { case OES: drawer.drawOes(buffer.getTextureId(), finalGlMatrix, frameWidth, frameHeight, viewportX, viewportY, viewportWidth, viewportHeight); break; case RGB: drawer.drawRgb(buffer.getTextureId(), finalGlMatrix, frameWidth, frameHeight, viewportX, viewportY, viewportWidth, viewportHeight); break; default: throw new RuntimeException(STR); } } private static class YuvUploader { @Nullable private ByteBuffer copyBuffer; @Nullable private int[] yuvTextures;
/** * Draws a VideoFrame.TextureBuffer. Calls either drawer.drawOes or drawer.drawRgb * depending on the type of the buffer. You can supply an additional render matrix. This is * used multiplied together with the transformation matrix of the frame. (M = renderMatrix * * transformationMatrix) */
Draws a VideoFrame.TextureBuffer. Calls either drawer.drawOes or drawer.drawRgb depending on the type of the buffer. You can supply an additional render matrix. This is used multiplied together with the transformation matrix of the frame. (M = renderMatrix transformationMatrix)
drawTexture
{ "repo_name": "koobonil/Boss2D", "path": "Boss2D/addon/webrtc-jumpingyang001_for_boss/sdk/android/api/org/webrtc/VideoFrameDrawer.java", "license": "mit", "size": 9574 }
[ "android.graphics.Matrix", "java.nio.ByteBuffer", "javax.annotation.Nullable" ]
import android.graphics.Matrix; import java.nio.ByteBuffer; import javax.annotation.Nullable;
import android.graphics.*; import java.nio.*; import javax.annotation.*;
[ "android.graphics", "java.nio", "javax.annotation" ]
android.graphics; java.nio; javax.annotation;
2,773,400
public Map<String, Service> getServices() { return services; }
Map<String, Service> function() { return services; }
/** * Returns the Map of <code>Service</code> instances. * * @return The Map of <code>Service</code> instances. */
Returns the Map of <code>Service</code> instances
getServices
{ "repo_name": "designreuse/flex-blazeds", "path": "modules/core/src/flex/messaging/MessageBroker.java", "license": "apache-2.0", "size": 77273 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,116,612
public static MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> getExtraValueLocalizedDeltaPriceClient(com.mozu.api.DataViewMode dataViewMode, String productCode, String attributeFQN, String value, String currencyCode, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.products.ProductExtraUrl.getExtraValueLocalizedDeltaPriceUrl(attributeFQN, currencyCode, productCode, responseFields, value); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice.class; MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; }
static MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> function(com.mozu.api.DataViewMode dataViewMode, String productCode, String attributeFQN, String value, String currencyCode, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.products.ProductExtraUrl.getExtraValueLocalizedDeltaPriceUrl(attributeFQN, currencyCode, productCode, responseFields, value); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice.class; MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; }
/** * Retrieves the localized delta price value for a product extra. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> mozuClient=GetExtraValueLocalizedDeltaPriceClient(dataViewMode, productCode, attributeFQN, value, currencyCode, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * ProductExtraValueDeltaPrice productExtraValueDeltaPrice = client.Result(); * </code></pre></p> * @param attributeFQN Fully qualified name for an attribute. * @param currencyCode The three character ISO currency code, such as USD for US Dollars. * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product. * @param responseFields Use this field to include those fields which are not included by default. * @param value The value string to create. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice> * @see com.mozu.api.contracts.productadmin.ProductExtraValueDeltaPrice */
Retrieves the localized delta price value for a product extra. Localized delta prices are deltas between two differing monetary conversion amounts between countries, such as US Dollar vs Euro. <code><code> MozuClient mozuClient=GetExtraValueLocalizedDeltaPriceClient(dataViewMode, productCode, attributeFQN, value, currencyCode, responseFields); client.setBaseAddress(url); client.executeRequest(); ProductExtraValueDeltaPrice productExtraValueDeltaPrice = client.Result(); </code></code>
getExtraValueLocalizedDeltaPriceClient
{ "repo_name": "johngatti/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/products/ProductExtraClient.java", "license": "mit", "size": 31216 }
[ "com.mozu.api.DataViewMode", "com.mozu.api.Headers", "com.mozu.api.MozuClient", "com.mozu.api.MozuClientFactory", "com.mozu.api.MozuUrl" ]
import com.mozu.api.DataViewMode; import com.mozu.api.Headers; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl;
import com.mozu.api.*;
[ "com.mozu.api" ]
com.mozu.api;
2,073,151
void setGroups(@Nonnull Set<UserGroup> groups); interface ID extends Serializable { }
void setGroups(@Nonnull Set<UserGroup> groups); interface ID extends Serializable { }
/** * Sets the groups this user belongs to. * * @param groups the groups */
Sets the groups this user belongs to
setGroups
{ "repo_name": "peter-gergely-horvath/kylo", "path": "metadata/metadata-api/src/main/java/com/thinkbiganalytics/metadata/api/user/User.java", "license": "apache-2.0", "size": 3721 }
[ "java.io.Serializable", "java.util.Set", "javax.annotation.Nonnull" ]
import java.io.Serializable; import java.util.Set; import javax.annotation.Nonnull;
import java.io.*; import java.util.*; import javax.annotation.*;
[ "java.io", "java.util", "javax.annotation" ]
java.io; java.util; javax.annotation;
2,272,306
public void render(SerialisationContext pSerialisationContext, OutputSerialiser pSerialiser) { ComponentBuilder lBuilder = pSerialiser.getComponentBuilder(mBuffer.getPageComponentType()); lBuilder.buildComponent(pSerialisationContext, pSerialiser, mBuffer); }
void function(SerialisationContext pSerialisationContext, OutputSerialiser pSerialiser) { ComponentBuilder lBuilder = pSerialiser.getComponentBuilder(mBuffer.getPageComponentType()); lBuilder.buildComponent(pSerialisationContext, pSerialiser, mBuffer); }
/** * Renders the contents of this modal popover's content buffer to the given serialiser. * @param pSerialisationContext Current SerialisationContext. * @param pSerialiser Destination for the buffer render result. */
Renders the contents of this modal popover's content buffer to the given serialiser
render
{ "repo_name": "Fivium/FOXopen", "path": "src/main/java/net/foxopen/fox/module/parsetree/EvaluatedModalPopover.java", "license": "gpl-3.0", "size": 4259 }
[ "net.foxopen.fox.module.serialiser.OutputSerialiser", "net.foxopen.fox.module.serialiser.SerialisationContext", "net.foxopen.fox.module.serialiser.components.ComponentBuilder" ]
import net.foxopen.fox.module.serialiser.OutputSerialiser; import net.foxopen.fox.module.serialiser.SerialisationContext; import net.foxopen.fox.module.serialiser.components.ComponentBuilder;
import net.foxopen.fox.module.serialiser.*; import net.foxopen.fox.module.serialiser.components.*;
[ "net.foxopen.fox" ]
net.foxopen.fox;
2,099,084
public static SessionFactory connect() { SessionFactory sf; Configuration cfg = new Configuration(); cfg.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry(); sf = cfg.buildSessionFactory(serviceRegistry); return sf; }
static SessionFactory function() { SessionFactory sf; Configuration cfg = new Configuration(); cfg.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry(); sf = cfg.buildSessionFactory(serviceRegistry); return sf; }
/** * Called by the init(...) method to generate hibernate Session object * * @return Hibernate SessionFactory object * */
Called by the init(...) method to generate hibernate Session object
connect
{ "repo_name": "TheUMCCS/aquamonitor", "path": "WEB-INF/src/edu/miami/ccs/goma/ProgramOperations.java", "license": "bsd-3-clause", "size": 14504 }
[ "org.hibernate.SessionFactory", "org.hibernate.cfg.Configuration", "org.hibernate.service.ServiceRegistryBuilder" ]
import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.*; import org.hibernate.cfg.*; import org.hibernate.service.*;
[ "org.hibernate", "org.hibernate.cfg", "org.hibernate.service" ]
org.hibernate; org.hibernate.cfg; org.hibernate.service;
595,465
void insertMedications(Stream<Medication> medications) throws SQLException { this.insertObservations(medications, "meds_event"); }
void insertMedications(Stream<Medication> medications) throws SQLException { this.insertObservations(medications, STR); }
/** * Insert the given stream of medications to a target database using the given * connection. * * @param medications The medications to insert. * @throws SQLException Thrown if there are any JDBC errors. */
Insert the given stream of medications to a target database using the given connection
insertMedications
{ "repo_name": "eurekaclinical/protempa", "path": "protempa-test-suite/src/test/java/org/protempa/test/DataInserter.java", "license": "apache-2.0", "size": 16041 }
[ "java.sql.SQLException", "java.util.stream.Stream" ]
import java.sql.SQLException; import java.util.stream.Stream;
import java.sql.*; import java.util.stream.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
1,977,355
public void setFilter(Filter filter) { this.filter = filter; }
void function(Filter filter) { this.filter = filter; }
/** * Sets the filter used to constrain which features from the joined feature type to return. * * @see #getFilter() */
Sets the filter used to constrain which features from the joined feature type to return
setFilter
{ "repo_name": "geotools/geotools", "path": "modules/library/main/src/main/java/org/geotools/data/Join.java", "license": "lgpl-2.1", "size": 8422 }
[ "org.opengis.filter.Filter" ]
import org.opengis.filter.Filter;
import org.opengis.filter.*;
[ "org.opengis.filter" ]
org.opengis.filter;
259,845
public HttpRequest getLastRequest(String requestPath) { synchronized (mLock) { if (!mLastRequestMap.containsKey(requestPath)) throw new IllegalArgumentException("Path not set: " + requestPath); return mLastRequestMap.get(requestPath); } }
HttpRequest function(String requestPath) { synchronized (mLock) { if (!mLastRequestMap.containsKey(requestPath)) throw new IllegalArgumentException(STR + requestPath); return mLastRequestMap.get(requestPath); } }
/** * Returns the last HttpRequest at this path. Can return null if it is never requested. */
Returns the last HttpRequest at this path. Can return null if it is never requested
getLastRequest
{ "repo_name": "guorendong/iridium-browser-ubuntu", "path": "net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java", "license": "bsd-3-clause", "size": 29490 }
[ "org.apache.http.HttpRequest" ]
import org.apache.http.HttpRequest;
import org.apache.http.*;
[ "org.apache.http" ]
org.apache.http;
603,055
public static void showOkDialog(Activity activity, int title, String message) { if (activity == null || activity.isFinishing()) { return; } AlertDialog.Builder builder = new AlertDialog.Builder(activity);
static void function(Activity activity, int title, String message) { if (activity == null activity.isFinishing()) { return; } AlertDialog.Builder builder = new AlertDialog.Builder(activity);
/** * Create a dialog with an OK button. * * @param activity Context activity * @param title Dialog title * @param message Dialog message */
Create a dialog with an OK button
showOkDialog
{ "repo_name": "sismics/books", "path": "books-android/app/src/main/java/com/sismics/books/util/DialogUtil.java", "license": "gpl-2.0", "size": 1854 }
[ "android.app.Activity", "android.app.AlertDialog" ]
import android.app.Activity; import android.app.AlertDialog;
import android.app.*;
[ "android.app" ]
android.app;
2,320,503
private boolean startNewSequence(List<IToken> commentSequence, IToken token) { return (!isComment(token) || !sameTypeAsFirstToken(token, commentSequence)) && !commentSequence.isEmpty(); }
boolean function(List<IToken> commentSequence, IToken token) { return (!isComment(token) !sameTypeAsFirstToken(token, commentSequence)) && !commentSequence.isEmpty(); }
/** * Start new sequence, in case (1) the current token is not a comment, or * (2) the token is of a different comment type than the tokens in the * current comment sequence. */
Start new sequence, in case (1) the current token is not a comment, or (2) the token is of a different comment type than the tokens in the current comment sequence
startNewSequence
{ "repo_name": "vimaier/conqat", "path": "org.conqat.engine.abap/src/org/conqat/engine/abap/analyzer/CommentedCodeAnalyzerBase.java", "license": "apache-2.0", "size": 5719 }
[ "java.util.List", "org.conqat.lib.scanner.IToken" ]
import java.util.List; import org.conqat.lib.scanner.IToken;
import java.util.*; import org.conqat.lib.scanner.*;
[ "java.util", "org.conqat.lib" ]
java.util; org.conqat.lib;
396,294
protected void emitOperandHelper(int reg, AMD64Address addr, boolean force4Byte, int additionalInstructionSize) { assert (reg & 0x07) == reg; int regenc = reg << 3; Register base = addr.getBase(); Register index = addr.getIndex(); AMD64Address.Scale scale = addr.getScale(); int disp = addr.getDisplacement(); if (base.equals(AMD64.rip)) { // also matches addresses returned by getPlaceholder() // [00 000 101] disp32 assert index.equals(Register.None) : "cannot use RIP relative addressing with index register"; emitByte(0x05 | regenc); if (codePatchingAnnotationConsumer != null && addr.instructionStartPosition >= 0) { codePatchingAnnotationConsumer.accept(new AddressDisplacementAnnotation(addr.instructionStartPosition, position(), 4, position() + 4 + additionalInstructionSize)); } emitInt(disp); } else if (base.isValid()) { int baseenc = base.isValid() ? encode(base) : 0; if (index.isValid()) { int indexenc = encode(index) << 3; // [base + indexscale + disp] if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) { // [base + indexscale] // [00 reg 100][ss index base] assert !index.equals(rsp) : "illegal addressing mode"; emitByte(0x04 | regenc); emitByte(scale.log2 << 6 | indexenc | baseenc); } else if (isByte(disp) && !force4Byte) { // [base + indexscale + imm8] // [01 reg 100][ss index base] imm8 assert !index.equals(rsp) : "illegal addressing mode"; emitByte(0x44 | regenc); emitByte(scale.log2 << 6 | indexenc | baseenc); emitByte(disp & 0xFF); } else { // [base + indexscale + disp32] // [10 reg 100][ss index base] disp32 assert !index.equals(rsp) : "illegal addressing mode"; emitByte(0x84 | regenc); emitByte(scale.log2 << 6 | indexenc | baseenc); emitInt(disp); } } else if (base.equals(rsp) || base.equals(r12)) { // [rsp + disp] if (disp == 0) { // [rsp] // [00 reg 100][00 100 100] emitByte(0x04 | regenc); emitByte(0x24); } else if (isByte(disp) && !force4Byte) { // [rsp + imm8] // [01 reg 100][00 100 100] disp8 emitByte(0x44 | regenc); emitByte(0x24); emitByte(disp & 0xFF); } else { // [rsp + imm32] // [10 reg 100][00 100 100] disp32 emitByte(0x84 | regenc); emitByte(0x24); emitInt(disp); } } else { // [base + disp] assert !base.equals(rsp) && !base.equals(r12) : "illegal addressing mode"; if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) { // [base] // [00 reg base] emitByte(0x00 | regenc | baseenc); } else if (isByte(disp) && !force4Byte) { // [base + disp8] // [01 reg base] disp8 emitByte(0x40 | regenc | baseenc); emitByte(disp & 0xFF); } else { // [base + disp32] // [10 reg base] disp32 emitByte(0x80 | regenc | baseenc); emitInt(disp); } } } else { if (index.isValid()) { int indexenc = encode(index) << 3; // [indexscale + disp] // [00 reg 100][ss index 101] disp32 assert !index.equals(rsp) : "illegal addressing mode"; emitByte(0x04 | regenc); emitByte(scale.log2 << 6 | indexenc | 0x05); emitInt(disp); } else { // [disp] ABSOLUTE // [00 reg 100][00 100 101] disp32 emitByte(0x04 | regenc); emitByte(0x25); emitInt(disp); } } setCurAttributes(null); } public static class AMD64Op { protected static final int P_0F = 0x0F; protected static final int P_0F38 = 0x380F; protected static final int P_0F3A = 0x3A0F; private final String opcode; protected final int prefix1; protected final int prefix2; protected final int op; private final boolean dstIsByte; private final boolean srcIsByte; private final OpAssertion assertion; private final CPUFeature feature; protected AMD64Op(String opcode, int prefix1, int prefix2, int op, OpAssertion assertion, CPUFeature feature) { this(opcode, prefix1, prefix2, op, assertion == OpAssertion.ByteAssertion, assertion == OpAssertion.ByteAssertion, assertion, feature); } protected AMD64Op(String opcode, int prefix1, int prefix2, int op, boolean dstIsByte, boolean srcIsByte, OpAssertion assertion, CPUFeature feature) { this.opcode = opcode; this.prefix1 = prefix1; this.prefix2 = prefix2; this.op = op; this.dstIsByte = dstIsByte; this.srcIsByte = srcIsByte; this.assertion = assertion; this.feature = feature; }
void function(int reg, AMD64Address addr, boolean force4Byte, int additionalInstructionSize) { assert (reg & 0x07) == reg; int regenc = reg << 3; Register base = addr.getBase(); Register index = addr.getIndex(); AMD64Address.Scale scale = addr.getScale(); int disp = addr.getDisplacement(); if (base.equals(AMD64.rip)) { assert index.equals(Register.None) : STR; emitByte(0x05 regenc); if (codePatchingAnnotationConsumer != null && addr.instructionStartPosition >= 0) { codePatchingAnnotationConsumer.accept(new AddressDisplacementAnnotation(addr.instructionStartPosition, position(), 4, position() + 4 + additionalInstructionSize)); } emitInt(disp); } else if (base.isValid()) { int baseenc = base.isValid() ? encode(base) : 0; if (index.isValid()) { int indexenc = encode(index) << 3; if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) { assert !index.equals(rsp) : STR; emitByte(0x04 regenc); emitByte(scale.log2 << 6 indexenc baseenc); } else if (isByte(disp) && !force4Byte) { assert !index.equals(rsp) : STR; emitByte(0x44 regenc); emitByte(scale.log2 << 6 indexenc baseenc); emitByte(disp & 0xFF); } else { assert !index.equals(rsp) : STR; emitByte(0x84 regenc); emitByte(scale.log2 << 6 indexenc baseenc); emitInt(disp); } } else if (base.equals(rsp) base.equals(r12)) { if (disp == 0) { emitByte(0x04 regenc); emitByte(0x24); } else if (isByte(disp) && !force4Byte) { emitByte(0x44 regenc); emitByte(0x24); emitByte(disp & 0xFF); } else { emitByte(0x84 regenc); emitByte(0x24); emitInt(disp); } } else { assert !base.equals(rsp) && !base.equals(r12) : STR; if (disp == 0 && !base.equals(rbp) && !base.equals(r13)) { emitByte(0x00 regenc baseenc); } else if (isByte(disp) && !force4Byte) { emitByte(0x40 regenc baseenc); emitByte(disp & 0xFF); } else { emitByte(0x80 regenc baseenc); emitInt(disp); } } } else { if (index.isValid()) { int indexenc = encode(index) << 3; assert !index.equals(rsp) : STR; emitByte(0x04 regenc); emitByte(scale.log2 << 6 indexenc 0x05); emitInt(disp); } else { emitByte(0x04 regenc); emitByte(0x25); emitInt(disp); } } setCurAttributes(null); } public static class AMD64Op { protected static final int P_0F = 0x0F; protected static final int P_0F38 = 0x380F; protected static final int P_0F3A = 0x3A0F; private final String opcode; protected final int prefix1; protected final int prefix2; protected final int op; private final boolean dstIsByte; private final boolean srcIsByte; private final OpAssertion assertion; private final CPUFeature feature; protected AMD64Op(String opcode, int prefix1, int prefix2, int op, OpAssertion assertion, CPUFeature feature) { this(opcode, prefix1, prefix2, op, assertion == OpAssertion.ByteAssertion, assertion == OpAssertion.ByteAssertion, assertion, feature); } protected AMD64Op(String opcode, int prefix1, int prefix2, int op, boolean dstIsByte, boolean srcIsByte, OpAssertion assertion, CPUFeature feature) { this.opcode = opcode; this.prefix1 = prefix1; this.prefix2 = prefix2; this.op = op; this.dstIsByte = dstIsByte; this.srcIsByte = srcIsByte; this.assertion = assertion; this.feature = feature; }
/** * Emits the ModR/M byte and optionally the SIB byte for one memory operand and an opcode * extension in the R field. * * @param force4Byte use 4 byte encoding for displacements that would normally fit in a byte * @param additionalInstructionSize the number of bytes that will be emitted after the operand, * so that the start position of the next instruction can be computed even though * this instruction has not been completely emitted yet. */
Emits the ModR/M byte and optionally the SIB byte for one memory operand and an opcode extension in the R field
emitOperandHelper
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java", "license": "gpl-2.0", "size": 150483 }
[ "org.graalvm.compiler.asm.amd64.AMD64Address" ]
import org.graalvm.compiler.asm.amd64.AMD64Address;
import org.graalvm.compiler.asm.amd64.*;
[ "org.graalvm.compiler" ]
org.graalvm.compiler;
76,062
@Override public NetMember newNetMember(InetAddress i, int p, boolean splitBrainEnabled, boolean canBeCoordinator, MemberAttributes attr, short version) { GMSMember result = new GMSMember(attr, i, p, splitBrainEnabled, canBeCoordinator, version, 0, 0); return result; }
NetMember function(InetAddress i, int p, boolean splitBrainEnabled, boolean canBeCoordinator, MemberAttributes attr, short version) { GMSMember result = new GMSMember(attr, i, p, splitBrainEnabled, canBeCoordinator, version, 0, 0); return result; }
/** * Return a new NetMember, possibly for a different host * * @param i the name of the host for the specified NetMember, the current host (hopefully) if * there are any problems. * @param splitBrainEnabled whether the member has this feature enabled * @param canBeCoordinator whether the member can be membership coordinator * @param p the membership port * @param attr the MemberAttributes * @return the new NetMember */
Return a new NetMember, possibly for a different host
newNetMember
{ "repo_name": "deepakddixit/incubator-geode", "path": "geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberFactory.java", "license": "apache-2.0", "size": 5545 }
[ "java.net.InetAddress", "org.apache.geode.distributed.internal.membership.MemberAttributes", "org.apache.geode.distributed.internal.membership.NetMember" ]
import java.net.InetAddress; import org.apache.geode.distributed.internal.membership.MemberAttributes; import org.apache.geode.distributed.internal.membership.NetMember;
import java.net.*; import org.apache.geode.distributed.internal.membership.*;
[ "java.net", "org.apache.geode" ]
java.net; org.apache.geode;
1,019,591
public void setAppendOnly(boolean appendOnly) { dictionary.setFlag(COSName.SIG_FLAGS, FLAG_APPEND_ONLY, appendOnly); }
void function(boolean appendOnly) { dictionary.setFlag(COSName.SIG_FLAGS, FLAG_APPEND_ONLY, appendOnly); }
/** * Set the AppendOnly bit. * * @param appendOnly The value for AppendOnly. */
Set the AppendOnly bit
setAppendOnly
{ "repo_name": "kalaspuffar/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java", "license": "apache-2.0", "size": 25083 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
1,179,256
public static void checkHasNoNullValues (final Map <?, ?> map, final String mapName) { if (hasNullValues (map)) illegalArgument (mapName, ArgumentStatus.NULL_VALUES); }
static void function (final Map <?, ?> map, final String mapName) { if (hasNullValues (map)) illegalArgument (mapName, ArgumentStatus.NULL_VALUES); }
/** * Checks if the specified Map has any null values. The check will pass if the Map itself is null, or if the map has * any null keys. * * @param map * The Map to check, may be null. * @param mapName * The name of the Map to check, must not be null. * * @throws IllegalArgumentException * If the Map has any null values. */
Checks if the specified Map has any null values. The check will pass if the Map itself is null, or if the map has any null keys
checkHasNoNullValues
{ "repo_name": "bgroenks96/fg-tools", "path": "common/src/main/java/com/forerunnergames/tools/common/Arguments.java", "license": "mit", "size": 52142 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
404,884
public boolean isValidLsaCheckSum(OspfLsa ospfLsa, int lsType, int lsaChecksumPos1, int lsaChecksumPos2) throws Exception { if (lsType == OspfLsaType.ROUTER.value()) { RouterLsa lsa = (RouterLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.NETWORK.value()) { NetworkLsa lsa = (NetworkLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.SUMMARY.value()) { SummaryLsa lsa = (SummaryLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.ASBR_SUMMARY.value()) { AsbrSummaryLsa lsa = (AsbrSummaryLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.EXTERNAL_LSA.value()) { ExternalLsa lsa = (ExternalLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.LINK_LOCAL_OPAQUE_LSA.value()) { OpaqueLsa9 lsa = (OpaqueLsa9) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.AREA_LOCAL_OPAQUE_LSA.value()) { OpaqueLsa10 lsa = (OpaqueLsa10) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.AS_OPAQUE_LSA.value()) { OpaqueLsa11 lsa = (OpaqueLsa11) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } return false; }
boolean function(OspfLsa ospfLsa, int lsType, int lsaChecksumPos1, int lsaChecksumPos2) throws Exception { if (lsType == OspfLsaType.ROUTER.value()) { RouterLsa lsa = (RouterLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.NETWORK.value()) { NetworkLsa lsa = (NetworkLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.SUMMARY.value()) { SummaryLsa lsa = (SummaryLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.ASBR_SUMMARY.value()) { AsbrSummaryLsa lsa = (AsbrSummaryLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.EXTERNAL_LSA.value()) { ExternalLsa lsa = (ExternalLsa) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.LINK_LOCAL_OPAQUE_LSA.value()) { OpaqueLsa9 lsa = (OpaqueLsa9) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.AREA_LOCAL_OPAQUE_LSA.value()) { OpaqueLsa10 lsa = (OpaqueLsa10) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } else if (lsType == OspfLsaType.AS_OPAQUE_LSA.value()) { OpaqueLsa11 lsa = (OpaqueLsa11) ospfLsa; return validateLsaCheckSum(lsa.asBytes(), lsaChecksumPos1, lsaChecksumPos2); } return false; }
/** * Checks whether checksum is valid or not in the given OSPF LSA. * * @param ospfLsa lsa instance * @param lsType lsa type * @param lsaChecksumPos1 lsa checksum position in packet * @param lsaChecksumPos2 lsa checksum position in packet * @return true if valid else false * @throws Exception might throw exception while processing */
Checks whether checksum is valid or not in the given OSPF LSA
isValidLsaCheckSum
{ "repo_name": "sonu283304/onos", "path": "protocols/ospf/protocol/src/main/java/org/onosproject/ospf/protocol/util/ChecksumCalculator.java", "license": "apache-2.0", "size": 12672 }
[ "org.onosproject.ospf.controller.OspfLsa", "org.onosproject.ospf.controller.OspfLsaType", "org.onosproject.ospf.protocol.lsa.types.AsbrSummaryLsa", "org.onosproject.ospf.protocol.lsa.types.ExternalLsa", "org.onosproject.ospf.protocol.lsa.types.NetworkLsa", "org.onosproject.ospf.protocol.lsa.types.OpaqueLsa10", "org.onosproject.ospf.protocol.lsa.types.OpaqueLsa11", "org.onosproject.ospf.protocol.lsa.types.OpaqueLsa9", "org.onosproject.ospf.protocol.lsa.types.RouterLsa", "org.onosproject.ospf.protocol.lsa.types.SummaryLsa" ]
import org.onosproject.ospf.controller.OspfLsa; import org.onosproject.ospf.controller.OspfLsaType; import org.onosproject.ospf.protocol.lsa.types.AsbrSummaryLsa; import org.onosproject.ospf.protocol.lsa.types.ExternalLsa; import org.onosproject.ospf.protocol.lsa.types.NetworkLsa; import org.onosproject.ospf.protocol.lsa.types.OpaqueLsa10; import org.onosproject.ospf.protocol.lsa.types.OpaqueLsa11; import org.onosproject.ospf.protocol.lsa.types.OpaqueLsa9; import org.onosproject.ospf.protocol.lsa.types.RouterLsa; import org.onosproject.ospf.protocol.lsa.types.SummaryLsa;
import org.onosproject.ospf.controller.*; import org.onosproject.ospf.protocol.lsa.types.*;
[ "org.onosproject.ospf" ]
org.onosproject.ospf;
1,620,921
public synchronized FileSystem getFs() throws IOException { if (this.fs == null) { Path sysDir = getSystemDir(); this.fs = sysDir.getFileSystem(getConf()); } return fs; }
synchronized FileSystem function() throws IOException { if (this.fs == null) { Path sysDir = getSystemDir(); this.fs = sysDir.getFileSystem(getConf()); } return fs; }
/** * Get a filesystem handle. We need this to prepare jobs * for submission to the MapReduce system. * * @return the filesystem handle. */
Get a filesystem handle. We need this to prepare jobs for submission to the MapReduce system
getFs
{ "repo_name": "Ayear0608/myhadoop", "path": "src/mapred/org/apache/hadoop/mapred/JobClient.java", "license": "apache-2.0", "size": 63874 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,619,773
public synchronized void setStartTime(final Time startTime) { if (isStarted) { throw new IllegalStateException( "Attempt to set start time of task that has already been started"); } this.startTime = startTime; }
synchronized void function(final Time startTime) { if (isStarted) { throw new IllegalStateException( STR); } this.startTime = startTime; }
/** * Sets start time for this task. You cannot set the start time for a task which is already * running. If you attempt to, an IllegalStateException will be thrown. * * @param startTime * The time this task should start running * @throws IllegalStateException * Thrown if task is already running */
Sets start time for this task. You cannot set the start time for a task which is already running. If you attempt to, an IllegalStateException will be thrown
setStartTime
{ "repo_name": "afiantara/apache-wicket-1.5.7", "path": "src/wicket-util/src/main/java/org/apache/wicket/util/thread/Task.java", "license": "apache-2.0", "size": 7250 }
[ "org.apache.wicket.util.time.Time" ]
import org.apache.wicket.util.time.Time;
import org.apache.wicket.util.time.*;
[ "org.apache.wicket" ]
org.apache.wicket;
49,380
// note: 'package' for testing static String escapeAllRegexCharacters(String input) { return Pattern.quote(input); }
static String escapeAllRegexCharacters(String input) { return Pattern.quote(input); }
/** * Escapes all special regex characters so that they are treated as literal characters * by the regex engine. * * @param input * The input string to be escaped * @return A new regex string with special characters escaped. */
Escapes all special regex characters so that they are treated as literal characters by the regex engine
escapeAllRegexCharacters
{ "repo_name": "NationalSecurityAgency/ghidra", "path": "Ghidra/Framework/Utility/src/main/java/ghidra/util/UserSearchUtils.java", "license": "apache-2.0", "size": 15329 }
[ "java.util.regex.Pattern" ]
import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,012,062