method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
private void setMovedGranularity(final GrainBean grainBeanFrom, final JTextPane paneFrom, final GrainBean grainBeanTo, final JTextPane paneTo, final JScrollPane scrollFrom, final JScrollPane scrollTo) {
IDIFFStyles.setStyle(paneFrom, grainBeanFrom, "MoveStyle");
Listener.setMouseAdapter(paneFrom, paneTo, scrollFrom, scrollTo);
Listener.setMouseMotion(paneFrom, grainBeanFrom, grainBeanTo, paneTo, scrollFrom, scrollTo);
IDIFFStyles.setStyle(paneTo, grainBeanTo, "MoveStyle");
Listener.setMouseAdapter(paneTo, paneFrom, scrollFrom, scrollTo);
Listener.setMouseMotion(paneTo, grainBeanTo, grainBeanFrom, paneFrom, scrollFrom, scrollTo);
} | void function(final GrainBean grainBeanFrom, final JTextPane paneFrom, final GrainBean grainBeanTo, final JTextPane paneTo, final JScrollPane scrollFrom, final JScrollPane scrollTo) { IDIFFStyles.setStyle(paneFrom, grainBeanFrom, STR); Listener.setMouseAdapter(paneFrom, paneTo, scrollFrom, scrollTo); Listener.setMouseMotion(paneFrom, grainBeanFrom, grainBeanTo, paneTo, scrollFrom, scrollTo); IDIFFStyles.setStyle(paneTo, grainBeanTo, STR); Listener.setMouseAdapter(paneTo, paneFrom, scrollFrom, scrollTo); Listener.setMouseMotion(paneTo, grainBeanTo, grainBeanFrom, paneFrom, scrollFrom, scrollTo); } | /**
* Set Moved Granularity
* @param grainBeanFrom
* @param paneFrom
* @param scrollFrom
* @param grainBeanTo
* @param paneTo
* @param scrollTo
*/ | Set Moved Granularity | setMovedGranularity | {
"repo_name": "gems-uff/idiff",
"path": "src/main/java/gui/components/GranularityComponent.java",
"license": "mit",
"size": 5292
} | [
"javax.swing.JScrollPane",
"javax.swing.JTextPane"
] | import javax.swing.JScrollPane; import javax.swing.JTextPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 851,707 |
void show() {
if (isAnimating()) {
if (DEBUG) Slog.v(TAG, "show: immediate");
show(mLayer, mTargetAlpha, 0);
}
} | void show() { if (isAnimating()) { if (DEBUG) Slog.v(TAG, STR); show(mLayer, mTargetAlpha, 0); } } | /** Jump to the end of the animation.
* NOTE: Must be called with Surface transaction open. */ | Jump to the end of the animation | show | {
"repo_name": "JSDemos/android-sdk-20",
"path": "src/com/android/server/wm/DimLayer.java",
"license": "apache-2.0",
"size": 11301
} | [
"android.util.Slog"
] | import android.util.Slog; | import android.util.*; | [
"android.util"
] | android.util; | 846,682 |
public static Map<XSD_PARTS, String> getNamespaceVersion(String namespace) {
Map<XSD_PARTS, String> map = new HashMap<XSD_PARTS, String>();
int index = namespace.lastIndexOf(":");
if (index > 0) {
String version = namespace.substring(index + 1);
if (versionPattern.matcher(version).matches()) {
String xsdName = namespace.substring(0, index);
map.put(XSD_PARTS.NAME, xsdName);
map.put(XSD_PARTS.VERSION, version);
return map;
}
}
map.put(XSD_PARTS.NAME, namespace);
map.put(XSD_PARTS.VERSION, null);
return map;
} | static Map<XSD_PARTS, String> function(String namespace) { Map<XSD_PARTS, String> map = new HashMap<XSD_PARTS, String>(); int index = namespace.lastIndexOf(":"); if (index > 0) { String version = namespace.substring(index + 1); if (versionPattern.matcher(version).matches()) { String xsdName = namespace.substring(0, index); map.put(XSD_PARTS.NAME, xsdName); map.put(XSD_PARTS.VERSION, version); return map; } } map.put(XSD_PARTS.NAME, namespace); map.put(XSD_PARTS.VERSION, null); return map; } | /**
* Split the version information from the XML namespace name.<br/>
*
* @param namespace
* Namespace name
* @return Map that contains the version name, the namespace name without
* the version part
*/ | Split the version information from the XML namespace name | getNamespaceVersion | {
"repo_name": "azkaoru/migration-tool",
"path": "src/tubame.wsearch.biz/src/main/java/tubame/wsearch/biz/cache/WSearchLibraryCache.java",
"license": "apache-2.0",
"size": 23078
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,199,185 |
protected void assertResultMessage(String expected) {
assertEquals(expected, this.resultDisplay.getText());
} | void function(String expected) { assertEquals(expected, this.resultDisplay.getText()); } | /**
* Asserts the message shown in the Result Display area is same as the given string.
*/ | Asserts the message shown in the Result Display area is same as the given string | assertResultMessage | {
"repo_name": "CS2103JAN2017-W14-B3/main",
"path": "src/test/java/guitests/TaskManagerGuiTest.java",
"license": "mit",
"size": 6229
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,385,544 |
public void close() throws IOException {
if (!this.closed) {
this.closed = true;
this.out.flush();
}
} | void function() throws IOException { if (!this.closed) { this.closed = true; this.out.flush(); } } | /**
* <p>Does not close the underlying socket output.</p>
*
* @throws IOException If an I/O problem occurs.
*/ | Does not close the underlying socket output | close | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "external/apache-http/src/org/apache/http/impl/io/IdentityOutputStream.java",
"license": "gpl-3.0",
"size": 3346
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,366,739 |
public CountDownLatch addPropertyValueLocalizedContentAsync(com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent localizedContent, String productCode, String attributeFQN, String value, AsyncCallback<com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent> callback) throws Exception
{
return addPropertyValueLocalizedContentAsync( localizedContent, productCode, attributeFQN, value, null, callback);
}
| CountDownLatch function(com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent localizedContent, String productCode, String attributeFQN, String value, AsyncCallback<com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent> callback) throws Exception { return addPropertyValueLocalizedContentAsync( localizedContent, productCode, attributeFQN, value, null, callback); } | /**
* Adds a property value for localized content. This content is set by the locale code.
* <p><pre><code>
* ProductProperty productproperty = new ProductProperty();
* CountDownLatch latch = productproperty.addPropertyValueLocalizedContent( localizedContent, productCode, attributeFQN, value, callback );
* latch.await() * </code></pre></p>
* @param attributeFQN Fully qualified name for an attribute.
* @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product.
* @param value The value string to create.
* @param callback callback handler for asynchronous operations
* @param localizedContent Use this field to include those fields which are not included by default.
* @return com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent
* @see com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent
* @see com.mozu.api.contracts.productadmin.ProductPropertyValueLocalizedContent
*/ | Adds a property value for localized content. This content is set by the locale code. <code><code> ProductProperty productproperty = new ProductProperty(); CountDownLatch latch = productproperty.addPropertyValueLocalizedContent( localizedContent, productCode, attributeFQN, value, callback ); latch.await() * </code></code> | addPropertyValueLocalizedContentAsync | {
"repo_name": "johngatti/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/products/ProductPropertyResource.java",
"license": "mit",
"size": 46960
} | [
"com.mozu.api.AsyncCallback",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 1,844,058 |
public long getOID(String name, FastpathArg[] args) throws SQLException
{
long oid = getInteger(name, args);
if (oid < 0)
oid += NUM_OIDS;
return oid;
} | long function(String name, FastpathArg[] args) throws SQLException { long oid = getInteger(name, args); if (oid < 0) oid += NUM_OIDS; return oid; } | /**
* This convenience method assumes that the return value is an oid.
* @param name Function name
* @param args Function arguments
* @exception SQLException if a database-access error occurs or no result
*/ | This convenience method assumes that the return value is an oid | getOID | {
"repo_name": "ekoontz/pgjdbc",
"path": "org/postgresql/fastpath/Fastpath.java",
"license": "bsd-3-clause",
"size": 12052
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 164,535 |
public MIcon getIcon() {
// no icon?
if (icon == null) {
if (isVirtualFile())
return null;
// no plugin?
if (iconName == null)
return null;
// load custom icon
icon = getIcon(iconName);
// no custom icon? - set safe icon
if (icon == null) {
iconName = "ui/misc";
icon = MIcon.stock(iconName);
}
}
return icon;
} | MIcon function() { if (icon == null) { if (isVirtualFile()) return null; if (iconName == null) return null; icon = getIcon(iconName); if (icon == null) { iconName = STR; icon = MIcon.stock(iconName); } } return icon; } | /**
* Returns icon associated with this item.
*/ | Returns icon associated with this item | getIcon | {
"repo_name": "stuffer2325/Makagiga",
"path": "src/org/makagiga/fs/MetaInfo.java",
"license": "apache-2.0",
"size": 36276
} | [
"org.makagiga.commons.MIcon"
] | import org.makagiga.commons.MIcon; | import org.makagiga.commons.*; | [
"org.makagiga.commons"
] | org.makagiga.commons; | 276,175 |
private static void loadDict() {
Path path = null;
try {
URL resource = DictionaryLoader.class.getResource(uri);
path = Paths.get(resource.toURI());
properties.load(new FileInputStream(path.toString()));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
for (String key : properties.stringPropertyNames()) {
dict.put(key, Double.parseDouble(properties.get(key).toString()));
}
} | static void function() { Path path = null; try { URL resource = DictionaryLoader.class.getResource(uri); path = Paths.get(resource.toURI()); properties.load(new FileInputStream(path.toString())); } catch (IOException URISyntaxException e) { e.printStackTrace(); } for (String key : properties.stringPropertyNames()) { dict.put(key, Double.parseDouble(properties.get(key).toString())); } } | /**
* Loads in memory the data from the dictionary file.
*/ | Loads in memory the data from the dictionary file | loadDict | {
"repo_name": "curiosone-bot/curiosone-core",
"path": "src/main/java/com/github/bot/curiosone/core/analysis/DictionaryLoader.java",
"license": "mit",
"size": 2260
} | [
"java.io.FileInputStream",
"java.io.IOException",
"java.net.URISyntaxException",
"java.nio.file.Path",
"java.nio.file.Paths"
] | import java.io.FileInputStream; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; | import java.io.*; import java.net.*; import java.nio.file.*; | [
"java.io",
"java.net",
"java.nio"
] | java.io; java.net; java.nio; | 1,365,035 |
@Test
public void testInvalidateSession12() throws Exception {
Callback c_1 = (request, response) -> {
HttpSession s = request.getSession();
s.invalidate();
s.setMaxInactiveInterval(1);
PrintWriter out = response.getWriter();
out.write("OK");
};
tester.setAttribute("callback_1", c_1);
servletHolder.setInitParameter("test.callback", "callback_1");
tester.start();
request.setMethod("GET");
request.setURI("/test/hello");
request.setHeader("Host", "tester");
request.setVersion("HTTP/1.0");
response = HttpTester.parseResponse(tester.getResponses(request.generate()));
assertEquals("OK", response.getContent());
} | void function() throws Exception { Callback c_1 = (request, response) -> { HttpSession s = request.getSession(); s.invalidate(); s.setMaxInactiveInterval(1); PrintWriter out = response.getWriter(); out.write("OK"); }; tester.setAttribute(STR, c_1); servletHolder.setInitParameter(STR, STR); tester.start(); request.setMethod("GET"); request.setURI(STR); request.setHeader("Host", STR); request.setVersion(STR); response = HttpTester.parseResponse(tester.getResponses(request.generate())); assertEquals("OK", response.getContent()); } | /**
* Test that invalidating a session does not throw an exception for subsequent
* setMaxInactiveInterval calls.
*/ | Test that invalidating a session does not throw an exception for subsequent setMaxInactiveInterval calls | testInvalidateSession12 | {
"repo_name": "smanvi-pivotal/geode",
"path": "extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java",
"license": "apache-2.0",
"size": 36392
} | [
"java.io.PrintWriter",
"javax.servlet.http.HttpSession",
"org.eclipse.jetty.http.HttpTester",
"org.junit.Assert"
] | import java.io.PrintWriter; import javax.servlet.http.HttpSession; import org.eclipse.jetty.http.HttpTester; import org.junit.Assert; | import java.io.*; import javax.servlet.http.*; import org.eclipse.jetty.http.*; import org.junit.*; | [
"java.io",
"javax.servlet",
"org.eclipse.jetty",
"org.junit"
] | java.io; javax.servlet; org.eclipse.jetty; org.junit; | 949,212 |
Set<VirtualHost> getHosts(NetworkId networkId); | Set<VirtualHost> getHosts(NetworkId networkId); | /**
* Returns the list of hosts in the specified virtual network.
*
* @param networkId network identifier
* @return set of virtual hosts
*/ | Returns the list of hosts in the specified virtual network | getHosts | {
"repo_name": "donNewtonAlpha/onos",
"path": "incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStore.java",
"license": "apache-2.0",
"size": 9227
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,024,929 |
public void writeUTF(String s, char term) throws IOException {
writeUTF(s);
UTF8.write(this, term);
} | void function(String s, char term) throws IOException { writeUTF(s); UTF8.write(this, term); } | /**
* Writes the UTF bytes of the string to the output.
*
* @param s
* The String to write.
* @param term
* The (line) terminator to write.
*/ | Writes the UTF bytes of the string to the output | writeUTF | {
"repo_name": "freenet/legacy",
"path": "src/freenet/support/io/WriteOutputStream.java",
"license": "gpl-2.0",
"size": 2190
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,575,585 |
// ! Edit a local instruction comment.
public IComment editLocalInstructionComment(final Instruction instruction,
final IComment comment, final String newComment)
throws com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException {
try {
return m_node.getComments().editLocalInstructionComment(instruction.getNative(), comment, newComment);
} catch (final CouldntSaveDataException exception) {
throw new com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException(
exception);
}
} | IComment function(final Instruction instruction, final IComment comment, final String newComment) throws com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException { try { return m_node.getComments().editLocalInstructionComment(instruction.getNative(), comment, newComment); } catch (final CouldntSaveDataException exception) { throw new com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException( exception); } } | /**
* Edit a local instruction comment.
*
* @param instruction The {@link Instruction} to which the comment is associated.
* @param comment The {@link IComment} which is edited.
* @param newComment The {@link String} to edit the comment with.
*
* @return The edited {@link IComment} if successful null otherwise.
* @throws com.google.security.zynamics.binnavi.API.disassembly.CouldntSaveDataException
*/ | Edit a local instruction comment | editLocalInstructionComment | {
"repo_name": "crowell/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/API/disassembly/CodeNode.java",
"license": "apache-2.0",
"size": 20009
} | [
"com.google.security.zynamics.binnavi.Database",
"com.google.security.zynamics.binnavi.Gui"
] | import com.google.security.zynamics.binnavi.Database; import com.google.security.zynamics.binnavi.Gui; | import com.google.security.zynamics.binnavi.*; | [
"com.google.security"
] | com.google.security; | 2,337,561 |
if (OptionsUtils.isMtkDrmApp()) {
if (mDrmManagerClient == null) {
mDrmManagerClient = new OmaDrmClient(context);
}
}
} | if (OptionsUtils.isMtkDrmApp()) { if (mDrmManagerClient == null) { mDrmManagerClient = new OmaDrmClient(context); } } } | /**
* Initial the DrmManagerClient.
*
* @param context The context to use.
*/ | Initial the DrmManagerClient | init | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "mediatek/packages/apps/FileManager/src/com/mediatek/filemanager/utils/DrmManager.java",
"license": "gpl-2.0",
"size": 6590
} | [
"com.mediatek.drm.OmaDrmClient"
] | import com.mediatek.drm.OmaDrmClient; | import com.mediatek.drm.*; | [
"com.mediatek.drm"
] | com.mediatek.drm; | 1,186,539 |
@Override
public void run() {
// Run as long as the socket is not closed and no fatal error occurred
while (state != SocketState.Closed && state != SocketState.Error) {
switch (state) {
case Connecting:
try {
// Create socket and set Input and OutputStream to send and receive messages
socket = new Socket(address, port);
out = socket.getOutputStream();
in = socket.getInputStream();
} catch (UnknownHostException e) {
fatalError(Error.ErrorCode.ConnectFailedError, "Could not connect to the given address");
continue;
} catch (IOException e) {
fatalError(Error.ErrorCode.CreationError, "Could not create a socket");
continue;
}
// Set timeout time for socket to 250ms. This way a read operation
// can at max take 250ms before returning. This the thread does not
// get blocked.
try {
socket.setSoTimeout(ArcusSocket.this.socketTimeout);
} catch (SocketException e) {
fatalError(Error.ErrorCode.ConnectFailedError, "Failed to set socket receive timeout");
continue;
}
nextState = SocketState.Connected;
break;
case Opening:
// Created the ServerSocket
try {
serverSocket = new ServerSocket(port);
} catch (BindException e) {
fatalError(Error.ErrorCode.BindFailedError, "Could not bind to the given port");
} catch (IOException e) {
fatalError(Error.ErrorCode.CreationError, "Could not create a socket. Maybe the port is already in use");
continue;
}
// Set timeout time for ServerSocket. That's needed to stop the thread
// if no client has connected.
try {
serverSocket.setSoTimeout(ArcusSocket.this.socketTimeout);
} catch (SocketException e) {
fatalError(Error.ErrorCode.ConnectFailedError, "Failed to set socket receive timeout");
continue;
}
nextState = SocketState.Listening;
break;
case Listening:
// Listen for an incoming connection
try {
socket = serverSocket.accept();
out = socket.getOutputStream();
in = socket.getInputStream();
} catch (SocketTimeoutException e) {
continue;
} catch (IOException e) {
fatalError(Error.ErrorCode.AcceptFailedError, "Could not accept the incoming connection");
continue;
}
// See above
try {
socket.setSoTimeout(ArcusSocket.this.socketTimeout);
} catch (SocketException e) {
fatalError(Error.ErrorCode.AcceptFailedError, "Failed to set socket receive timeout");
continue;
}
nextState = SocketState.Connected;
break;
case Connected:
// Send messages in queue
Message[] messages;
// Put all messages from the queue in a thread local array to not
// block access to the queue
synchronized (sendQueue) {
messages = new Message[sendQueue.size()];
messages = sendQueue.toArray(messages);
sendQueue.clear();
}
// Send every message that was in the queue
for (Message message : messages) {
this.sendMessage(message);
}
// Receive the next message
receiveNextMessage();
// check if we have to send a keep-alive message
if (nextState != SocketState.Error) {
checkConnectionState();
}
break;
case Closing:
// Did we instantiate the close
if (!receivedClose) {
// If so, first send all messages in the queue
synchronized (sendQueue) {
messages = new Message[sendQueue.size()];
messages = sendQueue.toArray(messages);
sendQueue.clear();
}
for (Message message : messages) {
this.sendMessage(message);
}
// Then send a close connection message
try {
out.write(SOCKET_CLOSE);
out.flush();
socket.shutdownOutput();
// And wait for a response from the other side with the
// same message
byte[] data = new byte[4];
int i = 0;
while (!Arrays.equals(data, SOCKET_CLOSE) && nextState == SocketState.Closing) {
if (i == data.length) {
i = 0;
}
i += in.read(data, i, data.length - i);
}
} catch (IOException e) {
break;
}
} else {
// If the other side wants to close, all messages in the queue
// get cleared
synchronized (sendQueue) {
sendQueue.clear();
}
// And we send a close connection message back
writeBytes(SOCKET_CLOSE);
}
// Finally the socket gets closed
closeSocket();
nextState = SocketState.Closed;
break;
default:
break;
}
// Update state variable and notify listeners about the state change
if (nextState != state) {
state = nextState;
for (SocketListener listener : listeners) {
listener.stateChanged(ArcusSocket.this, state);
}
}
}
} | void function() { while (state != SocketState.Closed && state != SocketState.Error) { switch (state) { case Connecting: try { socket = new Socket(address, port); out = socket.getOutputStream(); in = socket.getInputStream(); } catch (UnknownHostException e) { fatalError(Error.ErrorCode.ConnectFailedError, STR); continue; } catch (IOException e) { fatalError(Error.ErrorCode.CreationError, STR); continue; } try { socket.setSoTimeout(ArcusSocket.this.socketTimeout); } catch (SocketException e) { fatalError(Error.ErrorCode.ConnectFailedError, STR); continue; } nextState = SocketState.Connected; break; case Opening: try { serverSocket = new ServerSocket(port); } catch (BindException e) { fatalError(Error.ErrorCode.BindFailedError, STR); } catch (IOException e) { fatalError(Error.ErrorCode.CreationError, STR); continue; } try { serverSocket.setSoTimeout(ArcusSocket.this.socketTimeout); } catch (SocketException e) { fatalError(Error.ErrorCode.ConnectFailedError, STR); continue; } nextState = SocketState.Listening; break; case Listening: try { socket = serverSocket.accept(); out = socket.getOutputStream(); in = socket.getInputStream(); } catch (SocketTimeoutException e) { continue; } catch (IOException e) { fatalError(Error.ErrorCode.AcceptFailedError, STR); continue; } try { socket.setSoTimeout(ArcusSocket.this.socketTimeout); } catch (SocketException e) { fatalError(Error.ErrorCode.AcceptFailedError, STR); continue; } nextState = SocketState.Connected; break; case Connected: Message[] messages; synchronized (sendQueue) { messages = new Message[sendQueue.size()]; messages = sendQueue.toArray(messages); sendQueue.clear(); } for (Message message : messages) { this.sendMessage(message); } receiveNextMessage(); if (nextState != SocketState.Error) { checkConnectionState(); } break; case Closing: if (!receivedClose) { synchronized (sendQueue) { messages = new Message[sendQueue.size()]; messages = sendQueue.toArray(messages); sendQueue.clear(); } for (Message message : messages) { this.sendMessage(message); } try { out.write(SOCKET_CLOSE); out.flush(); socket.shutdownOutput(); byte[] data = new byte[4]; int i = 0; while (!Arrays.equals(data, SOCKET_CLOSE) && nextState == SocketState.Closing) { if (i == data.length) { i = 0; } i += in.read(data, i, data.length - i); } } catch (IOException e) { break; } } else { synchronized (sendQueue) { sendQueue.clear(); } writeBytes(SOCKET_CLOSE); } closeSocket(); nextState = SocketState.Closed; break; default: break; } if (nextState != state) { state = nextState; for (SocketListener listener : listeners) { listener.stateChanged(ArcusSocket.this, state); } } } } | /**
* Internal loop that handles creation of sockets, connecting, sending / receiving
* messages and closing the socket
*/ | Internal loop that handles creation of sockets, connecting, sending / receiving messages and closing the socket | run | {
"repo_name": "Ocarthon/libArcus-Java",
"path": "src/main/java/de/ocarthon/libArcus/ArcusSocket.java",
"license": "agpl-3.0",
"size": 38328
} | [
"com.google.protobuf.Message",
"java.io.IOException",
"java.net.BindException",
"java.net.ServerSocket",
"java.net.Socket",
"java.net.SocketException",
"java.net.SocketTimeoutException",
"java.net.UnknownHostException",
"java.util.Arrays"
] | import com.google.protobuf.Message; import java.io.IOException; import java.net.BindException; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.Arrays; | import com.google.protobuf.*; import java.io.*; import java.net.*; import java.util.*; | [
"com.google.protobuf",
"java.io",
"java.net",
"java.util"
] | com.google.protobuf; java.io; java.net; java.util; | 2,335,679 |
public int getRowIndex(Comparable key) {
if (key == null) {
throw new IllegalArgumentException("Null 'key' argument.");
}
if (this.sortRowKeys) {
return Collections.binarySearch(this.rowKeys, key);
}
else {
return this.rowKeys.indexOf(key);
}
}
| int function(Comparable key) { if (key == null) { throw new IllegalArgumentException(STR); } if (this.sortRowKeys) { return Collections.binarySearch(this.rowKeys, key); } else { return this.rowKeys.indexOf(key); } } | /**
* Returns the row index for a given key.
*
* @param key the key (<code>null</code> not permitted).
*
* @return The row index.
*
* @see #getRowKey(int)
* @see #getColumnIndex(Comparable)
*/ | Returns the row index for a given key | getRowIndex | {
"repo_name": "ilyessou/jfreechart",
"path": "source/org/jfree/data/DefaultKeyedValues2D.java",
"license": "lgpl-2.1",
"size": 18658
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 1,391,840 |
public static String getWorkingresourcePath() {
return WORKINGRESOURCE_PATH;
}
private Set resolvedWorkingresourcePaths = null;
protected WorkingresourcePathHandler( String uri ) {
super( uri );
} | static String function() { return WORKINGRESOURCE_PATH; } private Set resolvedWorkingresourcePaths = null; protected WorkingresourcePathHandler( String uri ) { super( uri ); } | /**
* Factory method.
*/ | Factory method | getWorkingresourcePath | {
"repo_name": "integrated/jakarta-slide-server",
"path": "src/webdav/server/org/apache/slide/webdav/util/WorkingresourcePathHandler.java",
"license": "apache-2.0",
"size": 5081
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,083,030 |
@Test
public void condOpt2() throws Exception {
List<String> text = new ArrayList<>();
String json = TestUtils.getJsonString("inkfiles/conditional/condopt.ink.json");
Story story = new Story(json);
TestUtils.nextAll(story, text);
story.chooseChoiceIndex(1);
text.clear();
TestUtils.nextAll(story, text);
Assert.assertEquals(2, story.getCurrentChoices().size());
} | void function() throws Exception { List<String> text = new ArrayList<>(); String json = TestUtils.getJsonString(STR); Story story = new Story(json); TestUtils.nextAll(story, text); story.chooseChoiceIndex(1); text.clear(); TestUtils.nextAll(story, text); Assert.assertEquals(2, story.getCurrentChoices().size()); } | /**
* "- work with options as conditional content (example 2)"
*/ | "- work with options as conditional content (example 2)" | condOpt2 | {
"repo_name": "bladecoder/blade-ink",
"path": "src/test/java/com/bladecoder/ink/runtime/test/ConditionalSpecTest.java",
"license": "mit",
"size": 13824
} | [
"com.bladecoder.ink.runtime.Story",
"java.util.ArrayList",
"java.util.List",
"org.junit.Assert"
] | import com.bladecoder.ink.runtime.Story; import java.util.ArrayList; import java.util.List; import org.junit.Assert; | import com.bladecoder.ink.runtime.*; import java.util.*; import org.junit.*; | [
"com.bladecoder.ink",
"java.util",
"org.junit"
] | com.bladecoder.ink; java.util; org.junit; | 1,279,893 |
public boolean needsToFire(int stmtType, int[] modifiedCols)
throws StandardException
{
if (SanityManager.DEBUG)
{
if (!((stmtType == StatementType.INSERT) ||
(stmtType == StatementType.BULK_INSERT_REPLACE) ||
(stmtType == StatementType.UPDATE) ||
(stmtType == StatementType.DELETE)))
{
SanityManager.THROWASSERT("invalid statement type "+stmtType);
}
}
if (!isEnabled)
{
return false;
}
if (stmtType == StatementType.INSERT)
{
return (eventMask & TRIGGER_EVENT_INSERT) == eventMask;
}
if (stmtType == StatementType.DELETE)
{
return (eventMask & TRIGGER_EVENT_DELETE) == eventMask;
}
// this is a temporary restriction, but it may not be lifted
// anytime soon.
if (stmtType == StatementType.BULK_INSERT_REPLACE)
{
throw StandardException.newException(SQLState.LANG_NO_BULK_INSERT_REPLACE_WITH_TRIGGER,
getTableDescriptor().getQualifiedName(), name);
}
// if update, only relevant if columns intersect
return ((eventMask & TRIGGER_EVENT_UPDATE) == eventMask) &&
ConstraintDescriptor.doColumnsIntersect(modifiedCols, referencedCols);
} | boolean function(int stmtType, int[] modifiedCols) throws StandardException { if (SanityManager.DEBUG) { if (!((stmtType == StatementType.INSERT) (stmtType == StatementType.BULK_INSERT_REPLACE) (stmtType == StatementType.UPDATE) (stmtType == StatementType.DELETE))) { SanityManager.THROWASSERT(STR+stmtType); } } if (!isEnabled) { return false; } if (stmtType == StatementType.INSERT) { return (eventMask & TRIGGER_EVENT_INSERT) == eventMask; } if (stmtType == StatementType.DELETE) { return (eventMask & TRIGGER_EVENT_DELETE) == eventMask; } if (stmtType == StatementType.BULK_INSERT_REPLACE) { throw StandardException.newException(SQLState.LANG_NO_BULK_INSERT_REPLACE_WITH_TRIGGER, getTableDescriptor().getQualifiedName(), name); } return ((eventMask & TRIGGER_EVENT_UPDATE) == eventMask) && ConstraintDescriptor.doColumnsIntersect(modifiedCols, referencedCols); } | /**
* Does this trigger need to fire on this type of
* DML?
*
* @param stmtType the type of DML
* (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)
* @param modifiedCols the columns modified, or null for all
*
* @return true/false
*
* @exception StandardException on error
*/ | Does this trigger need to fire on this type of DML | needsToFire | {
"repo_name": "scnakandala/derby",
"path": "java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java",
"license": "apache-2.0",
"size": 30193
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.reference.SQLState",
"org.apache.derby.iapi.sql.StatementType",
"org.apache.derby.shared.common.sanity.SanityManager"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.sql.StatementType; import org.apache.derby.shared.common.sanity.SanityManager; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.reference.*; import org.apache.derby.iapi.sql.*; import org.apache.derby.shared.common.sanity.*; | [
"org.apache.derby"
] | org.apache.derby; | 2,201,461 |
public com.mozu.api.contracts.productadmin.ProductOption addOption(com.mozu.api.contracts.productadmin.ProductOption productOption, String productCode, String responseFields) throws Exception
{
MozuClient<com.mozu.api.contracts.productadmin.ProductOption> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductOptionClient.addOptionClient(_dataViewMode, productOption, productCode, responseFields);
client.setContext(_apiContext);
client.executeRequest();
return client.getResult();
} | com.mozu.api.contracts.productadmin.ProductOption function(com.mozu.api.contracts.productadmin.ProductOption productOption, String productCode, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.productadmin.ProductOption> client = com.mozu.api.clients.commerce.catalog.admin.products.ProductOptionClient.addOptionClient(_dataViewMode, productOption, productCode, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } | /**
* Configures an option attribute for the product specified in the request.
* <p><pre><code>
* ProductOption productoption = new ProductOption();
* ProductOption productOption = productoption.addOption( productOption, productCode, responseFields);
* </code></pre></p>
* @param productCode Merchant-created code that uniquely identifies the product such as a SKU or item number. Once created, the product code is read-only.
* @param responseFields Use this field to include those fields which are not included by default.
* @param productOption Properties of the option attribute to define for the product.
* @return com.mozu.api.contracts.productadmin.ProductOption
* @see com.mozu.api.contracts.productadmin.ProductOption
* @see com.mozu.api.contracts.productadmin.ProductOption
*/ | Configures an option attribute for the product specified in the request. <code><code> ProductOption productoption = new ProductOption(); ProductOption productOption = productoption.addOption( productOption, productCode, responseFields); </code></code> | addOption | {
"repo_name": "eileenzhuang1/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/products/ProductOptionResource.java",
"license": "mit",
"size": 10113
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 1,690,835 |
public Boolean isLinkedtoSHC() {
return source == null ? false : Link.isTypeSHC(source);
} | Boolean function() { return source == null ? false : Link.isTypeSHC(source); } | /**
* Returns true, if the {@link Link} points to the SHC {@link Device}.
*
* @return
*/ | Returns true, if the <code>Link</code> points to the SHC <code>Device</code> | isLinkedtoSHC | {
"repo_name": "paulianttila/openhab2",
"path": "bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageEvent.java",
"license": "epl-1.0",
"size": 4184
} | [
"org.openhab.binding.innogysmarthome.internal.client.entity.link.Link"
] | import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; | import org.openhab.binding.innogysmarthome.internal.client.entity.link.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 764,810 |
public void setDossierDocPersistence(
DossierDocPersistence dossierDocPersistence) {
this.dossierDocPersistence = dossierDocPersistence;
} | void function( DossierDocPersistence dossierDocPersistence) { this.dossierDocPersistence = dossierDocPersistence; } | /**
* Sets the dossier doc persistence.
*
* @param dossierDocPersistence the dossier doc persistence
*/ | Sets the dossier doc persistence | setDossierDocPersistence | {
"repo_name": "openegovplatform/OEPv2",
"path": "oep-core-dossiermgt-portlet/docroot/WEB-INF/src/org/oep/core/dossiermgt/service/base/DocTemplateServiceBaseImpl.java",
"license": "apache-2.0",
"size": 52581
} | [
"org.oep.core.dossiermgt.service.persistence.DossierDocPersistence"
] | import org.oep.core.dossiermgt.service.persistence.DossierDocPersistence; | import org.oep.core.dossiermgt.service.persistence.*; | [
"org.oep.core"
] | org.oep.core; | 1,742,206 |
public int getServerCapabilities()
{
return Capability.Unicode + Capability.RemoteAPIs + Capability.NTSMBs + Capability.NTFind +
Capability.NTStatus + Capability.LargeFiles + Capability.LargeRead + Capability.LargeWrite +
Capability.ExtendedSecurity + Capability.InfoPassthru + Capability.Level2Oplocks;
}
| int function() { return Capability.Unicode + Capability.RemoteAPIs + Capability.NTSMBs + Capability.NTFind + Capability.NTStatus + Capability.LargeFiles + Capability.LargeRead + Capability.LargeWrite + Capability.ExtendedSecurity + Capability.InfoPassthru + Capability.Level2Oplocks; } | /**
* Return the server capability flags
*
* @return int
*/ | Return the server capability flags | getServerCapabilities | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/filesys/auth/cifs/EnterpriseCifsAuthenticator.java",
"license": "lgpl-3.0",
"size": 97998
} | [
"org.alfresco.jlan.smb.Capability"
] | import org.alfresco.jlan.smb.Capability; | import org.alfresco.jlan.smb.*; | [
"org.alfresco.jlan"
] | org.alfresco.jlan; | 971,302 |
public void testStore() {
file = new File(new File(BITARCHIVE_DIR, "filedir"),
STORABLE_FILES.get(0).toString());
ArcRepository arc = ArcRepository.getInstance();
StoreMessage msg = new StoreMessage(Channels.getError(), file);
JMSConnectionMockupMQ.updateMsgID(msg, "store1");
new ArcRepositoryServer(arc).visit(msg);
assertTrue("Message should have been tagged OK", msg.isOk());
arc.close();
} | void function() { file = new File(new File(BITARCHIVE_DIR, STR), STORABLE_FILES.get(0).toString()); ArcRepository arc = ArcRepository.getInstance(); StoreMessage msg = new StoreMessage(Channels.getError(), file); JMSConnectionMockupMQ.updateMsgID(msg, STR); new ArcRepositoryServer(arc).visit(msg); assertTrue(STR, msg.isOk()); arc.close(); } | /**
* Test message is sent and returned, and set "OK" if no errors occurs.
*/ | Test message is sent and returned, and set "OK" if no errors occurs | testStore | {
"repo_name": "netarchivesuite/netarchivesuite-svngit-migration",
"path": "tests/dk/netarkivet/archive/arcrepository/distribute/ArcRepositoryServerTester.java",
"license": "lgpl-2.1",
"size": 23877
} | [
"dk.netarkivet.archive.arcrepository.ArcRepository",
"dk.netarkivet.common.distribute.Channels",
"dk.netarkivet.common.distribute.JMSConnectionMockupMQ",
"java.io.File"
] | import dk.netarkivet.archive.arcrepository.ArcRepository; import dk.netarkivet.common.distribute.Channels; import dk.netarkivet.common.distribute.JMSConnectionMockupMQ; import java.io.File; | import dk.netarkivet.archive.arcrepository.*; import dk.netarkivet.common.distribute.*; import java.io.*; | [
"dk.netarkivet.archive",
"dk.netarkivet.common",
"java.io"
] | dk.netarkivet.archive; dk.netarkivet.common; java.io; | 935,699 |
public Table createTable(TableName tableName, String[] families)
throws IOException {
List<byte[]> fams = new ArrayList<>(families.length);
for (String family : families) {
fams.add(Bytes.toBytes(family));
}
return createTable(tableName, fams.toArray(new byte[0][]));
} | Table function(TableName tableName, String[] families) throws IOException { List<byte[]> fams = new ArrayList<>(families.length); for (String family : families) { fams.add(Bytes.toBytes(family)); } return createTable(tableName, fams.toArray(new byte[0][])); } | /**
* Create a table.
* @param tableName
* @param families
* @return A Table instance for the created table.
* @throws IOException
*/ | Create a table | createTable | {
"repo_name": "HubSpot/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 173926
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hbase.client.Table",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.util.Bytes; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,069,398 |
@ApiModelProperty(value = "Account information")
public Account getAccount() {
return account;
} | @ApiModelProperty(value = STR) Account function() { return account; } | /**
* Account information
* @return account
**/ | Account information | getAccount | {
"repo_name": "SDU-Software-Engineering/opn",
"path": "ws/BankingJavaServer/src/gen/java/dk/sdu/mmmi/opn/swaggerbank/model/CredentialAndAccount.java",
"license": "gpl-3.0",
"size": 2727
} | [
"dk.sdu.mmmi.opn.swaggerbank.model.Account",
"io.swagger.annotations.ApiModelProperty"
] | import dk.sdu.mmmi.opn.swaggerbank.model.Account; import io.swagger.annotations.ApiModelProperty; | import dk.sdu.mmmi.opn.swaggerbank.model.*; import io.swagger.annotations.*; | [
"dk.sdu.mmmi",
"io.swagger.annotations"
] | dk.sdu.mmmi; io.swagger.annotations; | 25,955 |
public static String buildSyntax(CommandDescription command, List<String> correctLabels) {
String commandSyntax = ChatColor.WHITE + "/" + correctLabels.get(0) + ChatColor.YELLOW;
for (int i = 1; i < correctLabels.size(); ++i) {
commandSyntax += " " + correctLabels.get(i);
}
for (CommandArgumentDescription argument : command.getArguments()) {
commandSyntax += " " + formatArgument(argument);
}
return commandSyntax;
} | static String function(CommandDescription command, List<String> correctLabels) { String commandSyntax = ChatColor.WHITE + "/" + correctLabels.get(0) + ChatColor.YELLOW; for (int i = 1; i < correctLabels.size(); ++i) { commandSyntax += " " + correctLabels.get(i); } for (CommandArgumentDescription argument : command.getArguments()) { commandSyntax += " " + formatArgument(argument); } return commandSyntax; } | /**
* Constructs a command path with color formatting, based on the supplied labels. This includes
* the command's arguments, as defined in the provided command description. The list of labels
* must contain all labels to be used.
*
* @param command the command to read arguments from
* @param correctLabels the labels to use (must be complete)
* @return formatted command syntax incl. arguments
*/ | Constructs a command path with color formatting, based on the supplied labels. This includes the command's arguments, as defined in the provided command description. The list of labels must contain all labels to be used | buildSyntax | {
"repo_name": "Xephi/AuthMeReloaded",
"path": "src/main/java/fr/xephi/authme/command/CommandUtils.java",
"license": "gpl-3.0",
"size": 3956
} | [
"java.util.List",
"org.bukkit.ChatColor"
] | import java.util.List; import org.bukkit.ChatColor; | import java.util.*; import org.bukkit.*; | [
"java.util",
"org.bukkit"
] | java.util; org.bukkit; | 169,630 |
public void precisionChanged(final ValueChangeEvent event); | void function(final ValueChangeEvent event); | /**
* Reacts to the Precision attribute value changing.
*
* @param event
* the event
*/ | Reacts to the Precision attribute value changing | precisionChanged | {
"repo_name": "Bernardo-MG/Tabletop-Punkapocalyptic-Model-API",
"path": "src/main/java/com/wandrell/tabletop/punkapocalyptic/model/unit/event/AttributesListener.java",
"license": "apache-2.0",
"size": 2275
} | [
"com.wandrell.tabletop.stats.event.ValueChangeEvent"
] | import com.wandrell.tabletop.stats.event.ValueChangeEvent; | import com.wandrell.tabletop.stats.event.*; | [
"com.wandrell.tabletop"
] | com.wandrell.tabletop; | 1,788,067 |
@GET
public Response getAll(@Context HttpServletRequest request) {
Response validateScopeResponse = validateScope(request, Collections.singletonList(AbstractResource.SCOPE_READ));
if (validateScopeResponse != null) {
return validateScopeResponse;
}
List<AccessToken> tokens = getAllAccessTokens(request);
return Response.ok(tokens).build();
} | Response function(@Context HttpServletRequest request) { Response validateScopeResponse = validateScope(request, Collections.singletonList(AbstractResource.SCOPE_READ)); if (validateScopeResponse != null) { return validateScopeResponse; } List<AccessToken> tokens = getAllAccessTokens(request); return Response.ok(tokens).build(); } | /**
* Get all access token for the provided credentials (== owner).
*/ | Get all access token for the provided credentials (== owner) | getAll | {
"repo_name": "biancini/oauth2-apis",
"path": "apis-authorization-server/src/main/java/org/surfnet/oaaas/resource/resourceserver/AccessTokenResource.java",
"license": "apache-2.0",
"size": 4176
} | [
"java.util.Collections",
"java.util.List",
"javax.servlet.http.HttpServletRequest",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.Response",
"org.surfnet.oaaas.model.AccessToken"
] | import java.util.Collections; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import org.surfnet.oaaas.model.AccessToken; | import java.util.*; import javax.servlet.http.*; import javax.ws.rs.core.*; import org.surfnet.oaaas.model.*; | [
"java.util",
"javax.servlet",
"javax.ws",
"org.surfnet.oaaas"
] | java.util; javax.servlet; javax.ws; org.surfnet.oaaas; | 600,730 |
private String removeSpecialCharsForXml(String text) {
if (Utils.isStringNotEmpty(text)) {
return text.replaceAll("&", "");
}
return Utils.EMPTY_STRING;
} | String function(String text) { if (Utils.isStringNotEmpty(text)) { return text.replaceAll("&", ""); } return Utils.EMPTY_STRING; } | /**
* Escape special characters which cause problems with jaxb or
* documentbuilderfactory and namespace aware mode
*/ | Escape special characters which cause problems with jaxb or documentbuilderfactory and namespace aware mode | removeSpecialCharsForXml | {
"repo_name": "zsoltii/dss",
"path": "dss-document/src/main/java/eu/europa/esig/dss/validation/DiagnosticDataBuilder.java",
"license": "lgpl-2.1",
"size": 42886
} | [
"eu.europa.esig.dss.utils.Utils"
] | import eu.europa.esig.dss.utils.Utils; | import eu.europa.esig.dss.utils.*; | [
"eu.europa.esig"
] | eu.europa.esig; | 121,476 |
private boolean drainSonicToFeedEncoder() {
MediaCodecAdapterWrapper encoder = checkNotNull(this.encoder);
if (!encoder.maybeDequeueInputBuffer(encoderInputBuffer)) {
return false;
}
if (!sonicOutputBuffer.hasRemaining()) {
sonicOutputBuffer = sonicAudioProcessor.getOutput();
if (!sonicOutputBuffer.hasRemaining()) {
if (checkNotNull(decoder).isEnded() && sonicAudioProcessor.isEnded()) {
queueEndOfStreamToEncoder();
}
return false;
}
}
feedEncoder(sonicOutputBuffer);
return true;
} | boolean function() { MediaCodecAdapterWrapper encoder = checkNotNull(this.encoder); if (!encoder.maybeDequeueInputBuffer(encoderInputBuffer)) { return false; } if (!sonicOutputBuffer.hasRemaining()) { sonicOutputBuffer = sonicAudioProcessor.getOutput(); if (!sonicOutputBuffer.hasRemaining()) { if (checkNotNull(decoder).isEnded() && sonicAudioProcessor.isEnded()) { queueEndOfStreamToEncoder(); } return false; } } feedEncoder(sonicOutputBuffer); return true; } | /**
* Attempts to pass audio processor output data to the encoder, and returns whether it may be
* possible to pass more data immediately by calling this method again.
*/ | Attempts to pass audio processor output data to the encoder, and returns whether it may be possible to pass more data immediately by calling this method again | drainSonicToFeedEncoder | {
"repo_name": "amzn/exoplayer-amazon-port",
"path": "library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerAudioRenderer.java",
"license": "apache-2.0",
"size": 14757
} | [
"com.google.android.exoplayer2.util.Assertions"
] | import com.google.android.exoplayer2.util.Assertions; | import com.google.android.exoplayer2.util.*; | [
"com.google.android"
] | com.google.android; | 1,799,146 |
private void loadServerListSpinner() {
m_serverlist = m_prefs.getServerList();
Spinner serverListSpinner = (Spinner) m_view.findViewById(R.id.serverListSpinner);
ArrayList<HashMap<String,String>> adapter_server_list = new ArrayList<HashMap<String,String>>();
for(Server s : m_serverlist.serverList()) {
HashMap<String,String> server = new HashMap<String, String>();
server.put("name", s.getName());
server.put("url", s.getUrl().toString());
adapter_server_list.add(server);
}
String[] from = { "name", "url" };
int[] to = { android.R.id.text1, android.R.id.text2 };
SpinnerAdapter adapter = new SimpleAdapter(getActivity(), adapter_server_list, android.R.layout.simple_list_item_2, from, to);
serverListSpinner.setAdapter(adapter);
} | void function() { m_serverlist = m_prefs.getServerList(); Spinner serverListSpinner = (Spinner) m_view.findViewById(R.id.serverListSpinner); ArrayList<HashMap<String,String>> adapter_server_list = new ArrayList<HashMap<String,String>>(); for(Server s : m_serverlist.serverList()) { HashMap<String,String> server = new HashMap<String, String>(); server.put("name", s.getName()); server.put("url", s.getUrl().toString()); adapter_server_list.add(server); } String[] from = { "name", "url" }; int[] to = { android.R.id.text1, android.R.id.text2 }; SpinnerAdapter adapter = new SimpleAdapter(getActivity(), adapter_server_list, android.R.layout.simple_list_item_2, from, to); serverListSpinner.setAdapter(adapter); } | /**
* Loads server list Spinner from ServerList values
*/ | Loads server list Spinner from ServerList values | loadServerListSpinner | {
"repo_name": "jernejovc/mkliker",
"path": "src/com/jernejovc/mkliker/StartFragment.java",
"license": "gpl-3.0",
"size": 12780
} | [
"android.widget.SimpleAdapter",
"android.widget.Spinner",
"android.widget.SpinnerAdapter",
"com.jernejovc.mkliker.net.Server",
"java.util.ArrayList",
"java.util.HashMap"
] | import android.widget.SimpleAdapter; import android.widget.Spinner; import android.widget.SpinnerAdapter; import com.jernejovc.mkliker.net.Server; import java.util.ArrayList; import java.util.HashMap; | import android.widget.*; import com.jernejovc.mkliker.net.*; import java.util.*; | [
"android.widget",
"com.jernejovc.mkliker",
"java.util"
] | android.widget; com.jernejovc.mkliker; java.util; | 2,757,087 |
public Node chooseRandomWithStorageType(final String scope,
final Collection<Node> excludedNodes, StorageType type) {
netlock.readLock().lock();
try {
if (scope.startsWith("~")) {
return chooseRandomWithStorageType(
NodeBase.ROOT, scope.substring(1), excludedNodes, type);
} else {
return chooseRandomWithStorageType(
scope, null, excludedNodes, type);
}
} finally {
netlock.readLock().unlock();
}
} | Node function(final String scope, final Collection<Node> excludedNodes, StorageType type) { netlock.readLock().lock(); try { if (scope.startsWith("~")) { return chooseRandomWithStorageType( NodeBase.ROOT, scope.substring(1), excludedNodes, type); } else { return chooseRandomWithStorageType( scope, null, excludedNodes, type); } } finally { netlock.readLock().unlock(); } } | /**
* Randomly choose one node from <i>scope</i>, with specified storage type.
*
* If scope starts with ~, choose one from the all nodes except for the
* ones in <i>scope</i>; otherwise, choose one from <i>scope</i>.
* If excludedNodes is given, choose a node that's not in excludedNodes.
*
* @param scope range of nodes from which a node will be chosen
* @param excludedNodes nodes to be excluded from
* @param type the storage type we search for
* @return the chosen node
*/ | Randomly choose one node from scope, with specified storage type. If scope starts with ~, choose one from the all nodes except for the ones in scope; otherwise, choose one from scope. If excludedNodes is given, choose a node that's not in excludedNodes | chooseRandomWithStorageType | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java",
"license": "apache-2.0",
"size": 14683
} | [
"java.util.Collection",
"org.apache.hadoop.fs.StorageType",
"org.apache.hadoop.net.Node",
"org.apache.hadoop.net.NodeBase"
] | import java.util.Collection; import org.apache.hadoop.fs.StorageType; import org.apache.hadoop.net.Node; import org.apache.hadoop.net.NodeBase; | import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.net.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 123,068 |
@Override
public void setQty_Planner (java.math.BigDecimal Qty_Planner)
{
set_Value (COLUMNNAME_Qty_Planner, Qty_Planner);
} | void function (java.math.BigDecimal Qty_Planner) { set_Value (COLUMNNAME_Qty_Planner, Qty_Planner); } | /** Set Planmenge.
@param Qty_Planner Planmenge */ | Set Planmenge | setQty_Planner | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.material/dispo-commons/src/main/java-gen/de/metas/material/dispo/model/X_MD_Candidate.java",
"license": "gpl-2.0",
"size": 12719
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 785,884 |
@Test
public void checkDockerfileLocation() {
assertEquals(gitlabUrl.dockerFileLocation(), "https://gitlab.com/eclipse/che/raw/master/.factory.dockerfile");
} | void function() { assertEquals(gitlabUrl.dockerFileLocation(), "https: } | /**
* Check when there is .codenvy.dockerfile in the repository
*/ | Check when there is .codenvy.dockerfile in the repository | checkDockerfileLocation | {
"repo_name": "R-Brain/codenvy",
"path": "plugins/plugin-gitlab/codenvy-plugin-gitlab-factory-resolver/src/test/java/com/codenvy/plugin/gitlab/factory/resolver/GitlabUrlTest.java",
"license": "epl-1.0",
"size": 2221
} | [
"org.testng.Assert"
] | import org.testng.Assert; | import org.testng.*; | [
"org.testng"
] | org.testng; | 489,291 |
public static boolean isEnabledFor(Logger logger, Loglevel level) {
boolean res = false;
if (logger != null && level != null) {
switch (level) {
case TRACE:
res = logger.isTraceEnabled();
break;
case DEBUG:
res = logger.isDebugEnabled();
break;
case INFO:
res = logger.isInfoEnabled();
break;
case WARN:
res = logger.isWarnEnabled();
break;
case ERROR:
res = logger.isErrorEnabled();
break;
}
}
return res;
} | static boolean function(Logger logger, Loglevel level) { boolean res = false; if (logger != null && level != null) { switch (level) { case TRACE: res = logger.isTraceEnabled(); break; case DEBUG: res = logger.isDebugEnabled(); break; case INFO: res = logger.isInfoEnabled(); break; case WARN: res = logger.isWarnEnabled(); break; case ERROR: res = logger.isErrorEnabled(); break; } } return res; } | /**
* Check whether a SLF4J logger is enabled for a certain loglevel.
* If the "logger" or the "level" is null, false is returned.
*/ | Check whether a SLF4J logger is enabled for a certain loglevel. If the "logger" or the "level" is null, false is returned | isEnabledFor | {
"repo_name": "dtonhofer/java_utils_other",
"path": "eclipse_project_root/src/name/heavycarbon/logging/LoglevelAid.java",
"license": "mit",
"size": 5084
} | [
"org.slf4j.Logger"
] | import org.slf4j.Logger; | import org.slf4j.*; | [
"org.slf4j"
] | org.slf4j; | 793,419 |
public HttpResponse updateClientApplication(String application, String keyType, String authorizedDomains,
String retryAfterFailure, String jsonParams, String callbackUrl) throws APIManagerIntegrationTestException {
try {
checkAuthentication();
return HTTPSClientUtils.doPost(new URL(backendURL
+ "/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag?" +
"action=updateClientApplication&application=" + application + "&keytype=" +
keyType + "&authorizedDomains=" + authorizedDomains + "&retryAfterFailure=" +
retryAfterFailure + "&jsonParams=" + URLEncoder.encode(jsonParams, "UTF-8")
+ "&callbackUrl=" + callbackUrl), "",
requestHeaders);
} catch (Exception e) {
throw new APIManagerIntegrationTestException(
"Unable to update application - " + application + ". Error: " + e.getMessage(), e);
}
} | HttpResponse function(String application, String keyType, String authorizedDomains, String retryAfterFailure, String jsonParams, String callbackUrl) throws APIManagerIntegrationTestException { try { checkAuthentication(); return HTTPSClientUtils.doPost(new URL(backendURL + STR + STR + application + STR + keyType + STR + authorizedDomains + STR + retryAfterFailure + STR + URLEncoder.encode(jsonParams, "UTF-8") + STR + callbackUrl), STRUnable to update application - STR. Error: " + e.getMessage(), e); } } | /**
* Update given Auth application
*
* @param application auth application name
* @param keyType type of the key
* @param authorizedDomains authorized domains
* @param retryAfterFailure retry after fail
* @param jsonParams json parameters for grant type
* @param callbackUrl call back url
* @return Http response of the update request
* @throws APIManagerIntegrationTestException APIManagerIntegrationTestException - throws if update application fail
*/ | Update given Auth application | updateClientApplication | {
"repo_name": "irhamiqbal/product-apim",
"path": "modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/utils/clients/APIStoreRestClient.java",
"license": "apache-2.0",
"size": 54601
} | [
"java.net.URLEncoder",
"org.wso2.am.integration.test.utils.APIManagerIntegrationTestException",
"org.wso2.am.integration.test.utils.http.HTTPSClientUtils",
"org.wso2.carbon.automation.test.utils.http.client.HttpResponse"
] | import java.net.URLEncoder; import org.wso2.am.integration.test.utils.APIManagerIntegrationTestException; import org.wso2.am.integration.test.utils.http.HTTPSClientUtils; import org.wso2.carbon.automation.test.utils.http.client.HttpResponse; | import java.net.*; import org.wso2.am.integration.test.utils.*; import org.wso2.am.integration.test.utils.http.*; import org.wso2.carbon.automation.test.utils.http.client.*; | [
"java.net",
"org.wso2.am",
"org.wso2.carbon"
] | java.net; org.wso2.am; org.wso2.carbon; | 106,381 |
public BitSet getComplement(BitSet A) {
BitSet result = new BitSet();
for (int t = 1; t <= ntax; t++) {
if (!A.get(t))
result.set(t);
}
return result;
} | BitSet function(BitSet A) { BitSet result = new BitSet(); for (int t = 1; t <= ntax; t++) { if (!A.get(t)) result.set(t); } return result; } | /**
* gets the complement to bit set A
*
* @param A
* @return complement
*/ | gets the complement to bit set A | getComplement | {
"repo_name": "danielhuson/dendroscope3",
"path": "src/dendroscope/consensus/Taxa.java",
"license": "gpl-3.0",
"size": 4823
} | [
"java.util.BitSet"
] | import java.util.BitSet; | import java.util.*; | [
"java.util"
] | java.util; | 309,114 |
public static void checkMultiplicationCompatible(final Vector v, final Matrix m) throws MathException {
if (v.getDimension() != m.getRowDimension()) {
throw new MathException(MATRIX_DIMENSION_MISMATCH__OPERATE).put(VECTOR, v).put(MATRIX_LEFT, m);
}
} | static void function(final Vector v, final Matrix m) throws MathException { if (v.getDimension() != m.getRowDimension()) { throw new MathException(MATRIX_DIMENSION_MISMATCH__OPERATE).put(VECTOR, v).put(MATRIX_LEFT, m); } } | /**
* Check if matrix is operate compatible (Multiplication) with the vector.
*
* @param m
* Left hand side matrix.
* @param v
* Right hand side vector.
* @throws MathException
* Of type {@code MATRIX_DIMENSION_MISMATCH__OPERATE} if
* matrices are not multiplication compatible.
*/ | Check if matrix is operate compatible (Multiplication) with the vector | checkMultiplicationCompatible | {
"repo_name": "firefly-math/firefly-math-linear-real",
"path": "src/main/java/com/fireflysemantics/math/linear/exceptions/LinearExceptionFactory.java",
"license": "apache-2.0",
"size": 11962
} | [
"com.fireflysemantics.math.exception.MathException",
"com.fireflysemantics.math.linear.matrix.interfaces.Matrix",
"com.fireflysemantics.math.linear.vector.interfaces.Vector"
] | import com.fireflysemantics.math.exception.MathException; import com.fireflysemantics.math.linear.matrix.interfaces.Matrix; import com.fireflysemantics.math.linear.vector.interfaces.Vector; | import com.fireflysemantics.math.exception.*; import com.fireflysemantics.math.linear.matrix.interfaces.*; import com.fireflysemantics.math.linear.vector.interfaces.*; | [
"com.fireflysemantics.math"
] | com.fireflysemantics.math; | 230,664 |
boolean onDoubleTap(MotionEvent e);
}
@SuppressWarnings("deprecation")
public VRTouchPadGestureDetector(
VRTouchPadGestureDetector.OnTouchPadGestureListener listener) {
gestureDetector = new GestureDetector(this);
gestureListener = listener;
}
public VRTouchPadGestureDetector(Context context,
VRTouchPadGestureDetector.OnTouchPadGestureListener listener) {
gestureDetector = new GestureDetector(context, this);
gestureListener = listener;
}
public VRTouchPadGestureDetector(Context context,
VRTouchPadGestureDetector.OnTouchPadGestureListener listener,
Handler handler) {
gestureDetector = new GestureDetector(context, this, handler);
gestureListener = listener;
} | boolean onDoubleTap(MotionEvent e); } @SuppressWarnings(STR) public VRTouchPadGestureDetector( VRTouchPadGestureDetector.OnTouchPadGestureListener listener) { gestureDetector = new GestureDetector(this); gestureListener = listener; } public VRTouchPadGestureDetector(Context context, VRTouchPadGestureDetector.OnTouchPadGestureListener listener) { gestureDetector = new GestureDetector(context, this); gestureListener = listener; } public VRTouchPadGestureDetector(Context context, VRTouchPadGestureDetector.OnTouchPadGestureListener listener, Handler handler) { gestureDetector = new GestureDetector(context, this, handler); gestureListener = listener; } | /**
* Notified when a double-tap occurs.
*
* @param e
* The down motion event of the first tap of the double-tap.
* @return true if the event is consumed, else false
*/ | Notified when a double-tap occurs | onDoubleTap | {
"repo_name": "danke-sra/GearVRf",
"path": "GVRf/Sample/gvrwidgetviewer/src/org/gearvrf/util/VRTouchPadGestureDetector.java",
"license": "apache-2.0",
"size": 9119
} | [
"android.content.Context",
"android.os.Handler",
"android.view.GestureDetector",
"android.view.MotionEvent"
] | import android.content.Context; import android.os.Handler; import android.view.GestureDetector; import android.view.MotionEvent; | import android.content.*; import android.os.*; import android.view.*; | [
"android.content",
"android.os",
"android.view"
] | android.content; android.os; android.view; | 2,157,357 |
public long skipUntil(char c) throws IllegalArgumentException, IOException {
if (lookaheadChar == UNDEFINED) {
lookaheadChar = super.read();
}
long counter = 0;
while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) {
if (lookaheadChar == '\n') {
lineCounter++;
}
lookaheadChar = super.read();
counter++;
}
return counter;
} | long function(char c) throws IllegalArgumentException, IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } long counter = 0; while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) { if (lookaheadChar == '\n') { lineCounter++; } lookaheadChar = super.read(); counter++; } return counter; } | /**
* Skips all chars in the input until (but excluding) the given char
*
* @return counter
* @throws IOException If there is a low-level I/O error.
*/ | Skips all chars in the input until (but excluding) the given char | skipUntil | {
"repo_name": "netboynb/search-core",
"path": "src/main/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java",
"license": "apache-2.0",
"size": 8600
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,522,815 |
public RelBuilder values(RelDataType rowType) {
return values(ImmutableList.<ImmutableList<RexLiteral>>of(), rowType);
} | RelBuilder function(RelDataType rowType) { return values(ImmutableList.<ImmutableList<RexLiteral>>of(), rowType); } | /** Creates a {@link Values} with a specified row type and
* zero rows.
*
* @param rowType Row type
*/ | Creates a <code>Values</code> with a specified row type and zero rows | values | {
"repo_name": "xhoong/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/tools/RelBuilder.java",
"license": "apache-2.0",
"size": 108300
} | [
"com.google.common.collect.ImmutableList",
"org.apache.calcite.rel.type.RelDataType",
"org.apache.calcite.rex.RexLiteral"
] | import com.google.common.collect.ImmutableList; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rex.RexLiteral; | import com.google.common.collect.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*; | [
"com.google.common",
"org.apache.calcite"
] | com.google.common; org.apache.calcite; | 1,988,072 |
@Generated
@Selector("lossType")
public native int lossType(); | @Selector(STR) native int function(); | /**
* See MPSCNNLossDescriptor for information about the following properties.
*/ | See MPSCNNLossDescriptor for information about the following properties | lossType | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/metalperformanceshaders/MPSNNForwardLoss.java",
"license": "apache-2.0",
"size": 7470
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 181,728 |
boolean shouldRollOnProcessingTime(final PartFileInfo<BucketID> partFileState, final long currentTime) throws IOException; | boolean shouldRollOnProcessingTime(final PartFileInfo<BucketID> partFileState, final long currentTime) throws IOException; | /**
* Determines if the in-progress part file for a bucket should roll based on a time condition.
* @param partFileState the state of the currently open part file of the bucket.
* @param currentTime the current processing time.
* @return {@code True} if the part file should roll, {@link false} otherwise.
*/ | Determines if the in-progress part file for a bucket should roll based on a time condition | shouldRollOnProcessingTime | {
"repo_name": "greghogan/flink",
"path": "flink-connectors/flink-file-sink-common/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/RollingPolicy.java",
"license": "apache-2.0",
"size": 2450
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,862,683 |
private void showLoading() {
mRecyclerView.setVisibility(View.INVISIBLE);
mLoadingIndicator.setVisibility(View.VISIBLE);
} | void function() { mRecyclerView.setVisibility(View.INVISIBLE); mLoadingIndicator.setVisibility(View.VISIBLE); } | /**
* This method will make the loading indicator visible and hide the weather View and error
* message.
* <p>
* Since it is okay to redundantly set the visibility of a View, we don't need to check whether
* each view is currently visible or invisible.
*/ | This method will make the loading indicator visible and hide the weather View and error message. Since it is okay to redundantly set the visibility of a View, we don't need to check whether each view is currently visible or invisible | showLoading | {
"repo_name": "semmiverian/sunshine_wear",
"path": "app/src/main/java/com/example/android/sunshine/MainActivity.java",
"license": "apache-2.0",
"size": 17611
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 519,144 |
public void updateDatabaseUploadStart(UploadFileOperation upload) {
String localPath = (FileUploader.LOCAL_BEHAVIOUR_MOVE == upload.getLocalBehaviour())
? upload.getStoragePath() : null;
updateUploadStatus(
upload.getOCUploadId(),
UploadStatus.UPLOAD_IN_PROGRESS,
UploadResult.UNKNOWN,
upload.getRemotePath(),
localPath
);
} | void function(UploadFileOperation upload) { String localPath = (FileUploader.LOCAL_BEHAVIOUR_MOVE == upload.getLocalBehaviour()) ? upload.getStoragePath() : null; updateUploadStatus( upload.getOCUploadId(), UploadStatus.UPLOAD_IN_PROGRESS, UploadResult.UNKNOWN, upload.getRemotePath(), localPath ); } | /**
* Updates the persistent upload database with an upload now in progress.
*/ | Updates the persistent upload database with an upload now in progress | updateDatabaseUploadStart | {
"repo_name": "PauloSantos13/android",
"path": "src/com/owncloud/android/datamodel/UploadsStorageManager.java",
"license": "gpl-2.0",
"size": 20479
} | [
"com.owncloud.android.db.UploadResult",
"com.owncloud.android.files.services.FileUploader",
"com.owncloud.android.operations.UploadFileOperation"
] | import com.owncloud.android.db.UploadResult; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.operations.UploadFileOperation; | import com.owncloud.android.db.*; import com.owncloud.android.files.services.*; import com.owncloud.android.operations.*; | [
"com.owncloud.android"
] | com.owncloud.android; | 1,881,461 |
File file = new File(Main.class.getResource("/sources.xml").getFile());
return loadSourceLibrary(file);
}
| File file = new File(Main.class.getResource(STR).getFile()); return loadSourceLibrary(file); } | /**
* loads the sources from the default location: project location /sources.xml
* @return source library loaded from file
* @throws ParsingException
* @throws IOException
*/ | loads the sources from the default location: project location /sources.xml | loadSourceLibrary | {
"repo_name": "LaL872k/PBib",
"path": "src/main/java/io/github/lal872k/pbib/SourceLibraryReader.java",
"license": "mit",
"size": 13219
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 217,330 |
@Test
public void egressVlan() throws Exception {
VlanId egressVlan = config.egressVlan();
assertNotNull("egressVlan should not be null", egressVlan);
assertThat(egressVlan, is(EGRESS_VLAN_1));
} | void function() throws Exception { VlanId egressVlan = config.egressVlan(); assertNotNull(STR, egressVlan); assertThat(egressVlan, is(EGRESS_VLAN_1)); } | /**
* Tests egress VLAN getter.
*
* @throws Exception
*/ | Tests egress VLAN getter | egressVlan | {
"repo_name": "kuujo/onos",
"path": "core/api/src/test/java/org/onosproject/net/config/basics/McastConfigTest.java",
"license": "apache-2.0",
"size": 4588
} | [
"org.hamcrest.Matchers",
"org.junit.Assert",
"org.onlab.packet.VlanId"
] | import org.hamcrest.Matchers; import org.junit.Assert; import org.onlab.packet.VlanId; | import org.hamcrest.*; import org.junit.*; import org.onlab.packet.*; | [
"org.hamcrest",
"org.junit",
"org.onlab.packet"
] | org.hamcrest; org.junit; org.onlab.packet; | 70,426 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
| void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } | /**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>POST</code> method | doPost | {
"repo_name": "gvillena/pweb162-s07suscribete",
"path": "src/java/pweb/email/TestServlet.java",
"license": "mit",
"size": 2946
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,368,411 |
public void setId() {
Uuid uuid = Uuid.of(UUID.randomUUID().toString());
setIdDetail(uuid);
} | void function() { Uuid uuid = Uuid.of(UUID.randomUUID().toString()); setIdDetail(uuid); } | /**
* Generate and set modelObject uuid.
*/ | Generate and set modelObject uuid | setId | {
"repo_name": "oplinkoms/onos",
"path": "apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiObjectHandler.java",
"license": "apache-2.0",
"size": 7784
} | [
"java.util.UUID",
"org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.Uuid"
] | import java.util.UUID; import org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.Uuid; | import java.util.*; import org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.*; | [
"java.util",
"org.onosproject.yang"
] | java.util; org.onosproject.yang; | 1,331,485 |
List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject,
final String modelName,
final String namespace); | List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject, final String modelName, final String namespace); | /**
* This method finds the list of {@link ItemDefinition}s for a given <code>namespace</code>.
* @param workspaceProject represents the project that will be scanned.
* @param modelName is the value used as the prefix for imported {@link ItemDefinition}s.
* @param namespace is the namespace of the model that provides the list of {@link ItemDefinition}s.
* @return a list of imported {@link ItemDefinition}s.
*/ | This method finds the list of <code>ItemDefinition</code>s for a given <code>namespace</code> | getImportedItemDefinitionsByNamespace | {
"repo_name": "jomarko/kie-wb-common",
"path": "kie-wb-common-dmn/kie-wb-common-dmn-backend/src/main/java/org/kie/workbench/common/dmn/backend/common/DMNMarshallerImportsHelperStandalone.java",
"license": "apache-2.0",
"size": 3883
} | [
"java.util.List",
"org.guvnor.common.services.project.model.WorkspaceProject",
"org.kie.dmn.model.api.ItemDefinition"
] | import java.util.List; import org.guvnor.common.services.project.model.WorkspaceProject; import org.kie.dmn.model.api.ItemDefinition; | import java.util.*; import org.guvnor.common.services.project.model.*; import org.kie.dmn.model.api.*; | [
"java.util",
"org.guvnor.common",
"org.kie.dmn"
] | java.util; org.guvnor.common; org.kie.dmn; | 679,334 |
public Collection<ToDoHeader> getToDos() throws TodoException {
if (getViewType() == PARTICIPANT_TODO_VIEW) {
return getNotCompletedToDos();
}
if (getViewType() == ORGANIZER_TODO_VIEW) {
return getOrganizerToDos();
}
if (getViewType() == CLOSED_TODO_VIEW) {
return getClosedToDos();
}
return null;
} | Collection<ToDoHeader> function() throws TodoException { if (getViewType() == PARTICIPANT_TODO_VIEW) { return getNotCompletedToDos(); } if (getViewType() == ORGANIZER_TODO_VIEW) { return getOrganizerToDos(); } if (getViewType() == CLOSED_TODO_VIEW) { return getClosedToDos(); } return null; } | /**
* methods for ToDo
*/ | methods for ToDo | getToDos | {
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "war-core/src/main/java/com/stratelia/webactiv/todo/control/ToDoSessionController.java",
"license": "agpl-3.0",
"size": 21603
} | [
"com.stratelia.webactiv.calendar.model.ToDoHeader",
"java.util.Collection"
] | import com.stratelia.webactiv.calendar.model.ToDoHeader; import java.util.Collection; | import com.stratelia.webactiv.calendar.model.*; import java.util.*; | [
"com.stratelia.webactiv",
"java.util"
] | com.stratelia.webactiv; java.util; | 1,322,790 |
public void readPacketData(PacketBuffer buf) throws IOException
{
this.windowId = buf.readUnsignedByte();
int i = buf.readShort();
this.itemStacks = new ItemStack[i];
for (int j = 0; j < i; ++j)
{
this.itemStacks[j] = buf.readItemStackFromBuffer();
}
} | void function(PacketBuffer buf) throws IOException { this.windowId = buf.readUnsignedByte(); int i = buf.readShort(); this.itemStacks = new ItemStack[i]; for (int j = 0; j < i; ++j) { this.itemStacks[j] = buf.readItemStackFromBuffer(); } } | /**
* Reads the raw packet data from the data stream.
*/ | Reads the raw packet data from the data stream | readPacketData | {
"repo_name": "danielyc/test-1.9.4",
"path": "build/tmp/recompileMc/sources/net/minecraft/network/play/server/SPacketWindowItems.java",
"license": "gpl-3.0",
"size": 2106
} | [
"java.io.IOException",
"net.minecraft.item.ItemStack",
"net.minecraft.network.PacketBuffer"
] | import java.io.IOException; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; | import java.io.*; import net.minecraft.item.*; import net.minecraft.network.*; | [
"java.io",
"net.minecraft.item",
"net.minecraft.network"
] | java.io; net.minecraft.item; net.minecraft.network; | 2,614,030 |
EClass getServiceDeliveryPoint(); | EClass getServiceDeliveryPoint(); | /**
* Returns the meta object for class '{@link rgse.ttc17.emoflon.tgg.task2.Rules.ServiceDeliveryPoint <em>Service Delivery Point</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Service Delivery Point</em>'.
* @see rgse.ttc17.emoflon.tgg.task2.Rules.ServiceDeliveryPoint
* @generated
*/ | Returns the meta object for class '<code>rgse.ttc17.emoflon.tgg.task2.Rules.ServiceDeliveryPoint Service Delivery Point</code>'. | getServiceDeliveryPoint | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.emoflon.tgg.task2/gen/rgse/ttc17/emoflon/tgg/task2/Rules/RulesPackage.java",
"license": "mit",
"size": 437406
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,727,778 |
public Promise<StompFrameContext> send(
final String destination,
final byte[] body
) {
return transmitFrame(new SendFrame(destination, body));
} | Promise<StompFrameContext> function( final String destination, final byte[] body ) { return transmitFrame(new SendFrame(destination, body)); } | /**
* Send the given body to the given destination.
*
* @param destination destination
* @param body body
* @return promise
*/ | Send the given body to the given destination | send | {
"repo_name": "lancomsystems/stomp",
"path": "stomp-core/src/main/java/de/lancom/systems/stomp/core/connection/StompConnection.java",
"license": "apache-2.0",
"size": 22915
} | [
"de.lancom.systems.defer.Promise",
"de.lancom.systems.stomp.core.wire.frame.SendFrame"
] | import de.lancom.systems.defer.Promise; import de.lancom.systems.stomp.core.wire.frame.SendFrame; | import de.lancom.systems.defer.*; import de.lancom.systems.stomp.core.wire.frame.*; | [
"de.lancom.systems"
] | de.lancom.systems; | 924,322 |
void setMeasurements(Collection result)
{
measurements = result;
}
Collection getMeasurements() { return measurements; } | void setMeasurements(Collection result) { measurements = result; } Collection getMeasurements() { return measurements; } | /**
* Sets the measurements associated to either the image or the plate.
*
* @param result The collection to set.
*/ | Sets the measurements associated to either the image or the plate | setMeasurements | {
"repo_name": "joshmoore/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java",
"license": "gpl-2.0",
"size": 72048
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 876,572 |
int updateByExample(@Param("record") FormSectionField record, @Param("example") FormSectionFieldExample example); | int updateByExample(@Param(STR) FormSectionField record, @Param(STR) FormSectionFieldExample example); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table m_form_section_field
*
* @mbggenerated Tue Sep 08 09:15:24 ICT 2015
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table m_form_section_field | updateByExample | {
"repo_name": "onlylin/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/form/dao/FormSectionFieldMapper.java",
"license": "agpl-3.0",
"size": 4921
} | [
"com.esofthead.mycollab.form.domain.FormSectionField",
"com.esofthead.mycollab.form.domain.FormSectionFieldExample",
"org.apache.ibatis.annotations.Param"
] | import com.esofthead.mycollab.form.domain.FormSectionField; import com.esofthead.mycollab.form.domain.FormSectionFieldExample; import org.apache.ibatis.annotations.Param; | import com.esofthead.mycollab.form.domain.*; import org.apache.ibatis.annotations.*; | [
"com.esofthead.mycollab",
"org.apache.ibatis"
] | com.esofthead.mycollab; org.apache.ibatis; | 1,686,702 |
protected int getCountSelected() {
int count = 0;
for (int i = 0; i < checked.size(); i++) {
if (checked.get(i)) {
count++;
}
}
if(SwipeListView.DEBUG){
Log.d(SwipeListView.TAG, "selected: " + count);
}
return count;
} | int function() { int count = 0; for (int i = 0; i < checked.size(); i++) { if (checked.get(i)) { count++; } } if(SwipeListView.DEBUG){ Log.d(SwipeListView.TAG, STR + count); } return count; } | /**
* Count selected
*
* @return
*/ | Count selected | getCountSelected | {
"repo_name": "x251089003/EveryXDay",
"path": "EveryXDay/src/main/java/com/xinxin/everyxday/widget/swipelistview/SwipeListViewTouchListener.java",
"license": "apache-2.0",
"size": 40122
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,865,567 |
public void begin()
{
int currLineWidth = Config.getConfigInt(Config.KEY_LINE_WIDTH);
if (currLineWidth < 1 || currLineWidth > 4) {
currLineWidth = 2;
}
Object lineWidthStr = JOptionPane.showInputDialog(_pruneApp.getFrame(),
I18nManager.getText("dialog.setlinewidth.text"),
I18nManager.getText(getNameKey()),
JOptionPane.QUESTION_MESSAGE, null, null, "" + currLineWidth);
if (lineWidthStr != null)
{
int lineWidth = 2;
try {
lineWidth = Integer.parseInt(lineWidthStr.toString());
if (lineWidth >= 1 && lineWidth <= 4 && lineWidth != currLineWidth)
{
Config.setConfigInt(Config.KEY_LINE_WIDTH, lineWidth);
UpdateMessageBroker.informSubscribers(DataSubscriber.SELECTION_CHANGED);
}
}
catch (NumberFormatException nfe) {};
}
} | void function() { int currLineWidth = Config.getConfigInt(Config.KEY_LINE_WIDTH); if (currLineWidth < 1 currLineWidth > 4) { currLineWidth = 2; } Object lineWidthStr = JOptionPane.showInputDialog(_pruneApp.getFrame(), I18nManager.getText(STR), I18nManager.getText(getNameKey()), JOptionPane.QUESTION_MESSAGE, null, null, "" + currLineWidth); if (lineWidthStr != null) { int lineWidth = 2; try { lineWidth = Integer.parseInt(lineWidthStr.toString()); if (lineWidth >= 1 && lineWidth <= 4 && lineWidth != currLineWidth) { Config.setConfigInt(Config.KEY_LINE_WIDTH, lineWidth); UpdateMessageBroker.informSubscribers(DataSubscriber.SELECTION_CHANGED); } } catch (NumberFormatException nfe) {}; } } | /**
* Run function
*/ | Run function | begin | {
"repo_name": "ta-apps/GpsPrune",
"path": "src/tim/prune/function/SetLineWidth.java",
"license": "gpl-2.0",
"size": 1327
} | [
"javax.swing.JOptionPane"
] | import javax.swing.JOptionPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,261,195 |
public void setProgress(int progress) {
if (mType != SuperToast.Type.PROGRESS_HORIZONTAL) {
Log.w(TAG, "setProgress()" + ERROR_NOTPROGRESSHORIZONTALTYPE);
}
if (mProgressBar != null) {
mProgressBar.setProgress(progress);
}
} | void function(int progress) { if (mType != SuperToast.Type.PROGRESS_HORIZONTAL) { Log.w(TAG, STR + ERROR_NOTPROGRESSHORIZONTALTYPE); } if (mProgressBar != null) { mProgressBar.setProgress(progress); } } | /**
* Sets the progress of the progressbar in a PROGRESS_HORIZONTAL
* {@link SuperToast.Type} {@value #TAG}.
*
* @param progress int
*/ | Sets the progress of the progressbar in a PROGRESS_HORIZONTAL <code>SuperToast.Type</code> #TAG | setProgress | {
"repo_name": "ihgoo/Android-UIView",
"path": "src/main/java/me/xunhou/androiduiview/toast/SuperCardToast.java",
"license": "mit",
"size": 59171
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,623,579 |
public static String setProcessFrequency(String process, Frequency frequency) {
ProcessMerlin p = new ProcessMerlin(process);
p.setFrequency(frequency);
return p.toString();
} | static String function(String process, Frequency frequency) { ProcessMerlin p = new ProcessMerlin(process); p.setFrequency(frequency); return p.toString(); } | /**
* Sets process frequency.
*
* @return modified process definition
*/ | Sets process frequency | setProcessFrequency | {
"repo_name": "ajayyadav/Apache-Falcon",
"path": "falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java",
"license": "apache-2.0",
"size": 45772
} | [
"org.apache.falcon.entity.v0.Frequency",
"org.apache.falcon.regression.Entities"
] | import org.apache.falcon.entity.v0.Frequency; import org.apache.falcon.regression.Entities; | import org.apache.falcon.entity.v0.*; import org.apache.falcon.regression.*; | [
"org.apache.falcon"
] | org.apache.falcon; | 663,945 |
void setPipelineInConstruction(LocatedBlock lastBlock) throws IOException{
// setup pipeline to append to the last block XXX retries??
setPipeline(lastBlock);
if (nodes.length < 1) {
throw new IOException("Unable to retrieve blocks locations " +
" for last block " + block + " of file " + src);
}
} | void setPipelineInConstruction(LocatedBlock lastBlock) throws IOException{ setPipeline(lastBlock); if (nodes.length < 1) { throw new IOException(STR + STR + block + STR + src); } } | /**
* Set pipeline in construction
*
* @param lastBlock the last block of a file
* @throws IOException
*/ | Set pipeline in construction | setPipelineInConstruction | {
"repo_name": "jaypatil/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java",
"license": "gpl-3.0",
"size": 68982
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.LocatedBlock"
] | import java.io.IOException; import org.apache.hadoop.hdfs.protocol.LocatedBlock; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,206,679 |
public static Set<Field> getFieldsOfType(Object object, Class<?> type) {
return findAllFieldsUsingStrategy(new AssignableFromFieldTypeMatcherStrategy(type), object, true,
getType(object));
} | static Set<Field> function(Object object, Class<?> type) { return findAllFieldsUsingStrategy(new AssignableFromFieldTypeMatcherStrategy(type), object, true, getType(object)); } | /**
* Get all fields assignable from a particular type. This method traverses
* the class hierarchy when checking for the type.
*
* @param object The object to look for type. Note that if're you're passing an
* object only instance fields are checked, passing a class will
* only check static fields.
* @param type The type to look for.
* @return A set of all fields of the particular type.
*/ | Get all fields assignable from a particular type. This method traverses the class hierarchy when checking for the type | getFieldsOfType | {
"repo_name": "thekingnothing/powermock",
"path": "reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java",
"license": "apache-2.0",
"size": 113110
} | [
"java.lang.reflect.Field",
"java.util.Set",
"org.powermock.reflect.internal.matcherstrategies.AssignableFromFieldTypeMatcherStrategy"
] | import java.lang.reflect.Field; import java.util.Set; import org.powermock.reflect.internal.matcherstrategies.AssignableFromFieldTypeMatcherStrategy; | import java.lang.reflect.*; import java.util.*; import org.powermock.reflect.internal.matcherstrategies.*; | [
"java.lang",
"java.util",
"org.powermock.reflect"
] | java.lang; java.util; org.powermock.reflect; | 2,502,449 |
private static void parseCategory(Map<?, ?> categoryMap, String categoryName,
Identifier defaultCategoryId, StdMutableRequest stdMutableRequest)
throws JSONStructureException {
Identifier categoryId = defaultCategoryId;
Object categoryIDString = ((Map<?, ?>)categoryMap).remove("CategoryId");
if (categoryIDString == null && defaultCategoryId == null) {
throw new JSONStructureException("Category is missing CategoryId");
}
if (categoryIDString != null) {
if (!(categoryIDString instanceof String)) {
throw new JSONStructureException("Expect '" + categoryName + "' CategoryId to be String got "
+ categoryIDString.getClass());
} else {
// TODO Spec says CategoryId may be shorthand, but none have been specified
categoryId = new IdentifierImpl(categoryIDString.toString());
}
}
// if we know the category, make sure user gave correct Id
if (defaultCategoryId != null && !defaultCategoryId.equals(categoryId)) {
throw new JSONStructureException(categoryName + " given CategoryId '" + categoryId
+ "' which does not match default id '" + defaultCategoryId
+ "'");
}
// get the Id, a.k.a xmlId
String xmlId = (String)((Map<?, ?>)categoryMap).remove("Id");
// get the Attributes for this Category, if any
List<Attribute> attributeList = new ArrayList<Attribute>();
Object attributesMap = ((Map<?, ?>)categoryMap).remove("Attribute");
if (attributesMap != null) {
if (attributesMap instanceof ArrayList) {
attributeList = parseAttribute(categoryId, (ArrayList<?>)attributesMap);
} else if (attributesMap instanceof Map) {
// underlying code expects only collections of Attributes, so create a collection of one to
// pass this single value
ArrayList<Map<?, ?>> listForOne = new ArrayList<Map<?, ?>>();
listForOne.add((Map<?, ?>)attributesMap);
attributeList = parseAttribute(categoryId, listForOne);
} else {
throw new JSONStructureException("Category '" + categoryName
+ "' saw unexpected Attribute class "
+ attributesMap.getClass());
}
}
// Get the Content node for this Category, if any
Node contentRootNode = null;
Object content = categoryMap.remove("Content");
if (content != null) {
if (content instanceof String) {
//
// Is it Base64 Encoded?
//
if (Base64.isBase64(((String)content).getBytes())) {
//
// Attempt to decode it
//
byte[] realContent = Base64.decodeBase64((String)content);
//
// Now what is it? JSON or XML? Should be XML.
//
try {
contentRootNode = parseXML(new String(realContent, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new JSONStructureException("Category '" + categoryName
+ "' Unsupported encoding in Content");
}
} else {
//
// No, so what is it? Should be XML escaped
//
contentRootNode = parseXML((String)content);
}
} else if (content instanceof byte[]) {
//
// Should be Base64
//
if (Base64.isBase64(((String)content).getBytes())) {
//
// Attempt to decode it
//
byte[] realContent = Base64.decodeBase64((String)content);
//
// Now what is it? JSON or XML? Should be XML.
//
try {
contentRootNode = parseXML(new String(realContent, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new JSONStructureException("Category '" + categoryName
+ "' Unsupported encoding in Content");
}
} else {
throw new JSONStructureException("Category '" + categoryName
+ "' Content expected Base64 value");
}
} else {
throw new JSONStructureException("Category '" + categoryName
+ "' Unable to determine what Content is "
+ content.getClass());
}
}
checkUnknown(categoryName, categoryMap);
StdMutableRequestAttributes attributeCategory = new StdMutableRequestAttributes(categoryId,
attributeList,
contentRootNode,
xmlId);
stdMutableRequest.add(attributeCategory);
} | static void function(Map<?, ?> categoryMap, String categoryName, Identifier defaultCategoryId, StdMutableRequest stdMutableRequest) throws JSONStructureException { Identifier categoryId = defaultCategoryId; Object categoryIDString = ((Map<?, ?>)categoryMap).remove(STR); if (categoryIDString == null && defaultCategoryId == null) { throw new JSONStructureException(STR); } if (categoryIDString != null) { if (!(categoryIDString instanceof String)) { throw new JSONStructureException(STR + categoryName + STR + categoryIDString.getClass()); } else { categoryId = new IdentifierImpl(categoryIDString.toString()); } } if (defaultCategoryId != null && !defaultCategoryId.equals(categoryId)) { throw new JSONStructureException(categoryName + STR + categoryId + STR + defaultCategoryId + "'"); } String xmlId = (String)((Map<?, ?>)categoryMap).remove("Id"); List<Attribute> attributeList = new ArrayList<Attribute>(); Object attributesMap = ((Map<?, ?>)categoryMap).remove(STR); if (attributesMap != null) { if (attributesMap instanceof ArrayList) { attributeList = parseAttribute(categoryId, (ArrayList<?>)attributesMap); } else if (attributesMap instanceof Map) { ArrayList<Map<?, ?>> listForOne = new ArrayList<Map<?, ?>>(); listForOne.add((Map<?, ?>)attributesMap); attributeList = parseAttribute(categoryId, listForOne); } else { throw new JSONStructureException(STR + categoryName + STR + attributesMap.getClass()); } } Node contentRootNode = null; Object content = categoryMap.remove(STR); if (content != null) { if (content instanceof String) { contentRootNode = parseXML(new String(realContent, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new JSONStructureException(STR + categoryName + STR); } } else { } } else if (content instanceof byte[]) { contentRootNode = parseXML(new String(realContent, "UTF-8")); } catch (UnsupportedEncodingException e) { throw new JSONStructureException(STR + categoryName + STR); } } else { throw new JSONStructureException(STR + categoryName + STR); } } else { throw new JSONStructureException(STR + categoryName + STR + content.getClass()); } } checkUnknown(categoryName, categoryMap); StdMutableRequestAttributes attributeCategory = new StdMutableRequestAttributes(categoryId, attributeList, contentRootNode, xmlId); stdMutableRequest.add(attributeCategory); } | /**
* Helper to parse all components of one Category or default Category
*
* @param categoryMap
* @param request
*/ | Helper to parse all components of one Category or default Category | parseCategory | {
"repo_name": "dash-/apache-openaz",
"path": "openaz-xacml/src/main/java/org/apache/openaz/xacml/std/json/JSONRequest.java",
"license": "apache-2.0",
"size": 64893
} | [
"java.io.UnsupportedEncodingException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.apache.openaz.xacml.api.Attribute",
"org.apache.openaz.xacml.api.Identifier",
"org.apache.openaz.xacml.std.IdentifierImpl",
"org.apache.openaz.xacml.std.StdMutableRequest",
"org.apache.openaz.xacml.std.StdMutableRequestAttributes",
"org.w3c.dom.Node"
] | import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.openaz.xacml.api.Attribute; import org.apache.openaz.xacml.api.Identifier; import org.apache.openaz.xacml.std.IdentifierImpl; import org.apache.openaz.xacml.std.StdMutableRequest; import org.apache.openaz.xacml.std.StdMutableRequestAttributes; import org.w3c.dom.Node; | import java.io.*; import java.util.*; import org.apache.openaz.xacml.api.*; import org.apache.openaz.xacml.std.*; import org.w3c.dom.*; | [
"java.io",
"java.util",
"org.apache.openaz",
"org.w3c.dom"
] | java.io; java.util; org.apache.openaz; org.w3c.dom; | 884,079 |
//-----------------------------------------------------------------------
public final MetaProperty<String> field() {
return _field;
} | final MetaProperty<String> function() { return _field; } | /**
* The meta-property for the {@code field} property.
* @return the meta-property, not null
*/ | The meta-property for the field property | field | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Bloomberg/src/main/java/com/opengamma/bbg/referencedata/ReferenceDataError.java",
"license": "apache-2.0",
"size": 13571
} | [
"org.joda.beans.MetaProperty"
] | import org.joda.beans.MetaProperty; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 1,442,044 |
T visitBoolean( @NotNull QuestionnaireParser.BooleanContext ctx ); | T visitBoolean( @NotNull QuestionnaireParser.BooleanContext ctx ); | /**
* Visit a parse tree produced by {@link QuestionnaireParser#boolean}.
*
* @param ctx the parse tree
* @return the visitor result
*/ | Visit a parse tree produced by <code>QuestionnaireParser#boolean</code> | visitBoolean | {
"repo_name": "software-engineering-amsterdam/poly-ql",
"path": "SantiagoCarrillo/q-language/src/edu/uva/softwarecons/grammar/QuestionnaireVisitor.java",
"license": "apache-2.0",
"size": 5749
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 322,940 |
private void initViewSubmissionListOption(SessionState state) {
if (state.getAttribute(VIEW_SUBMISSION_LIST_OPTION) == null
&& (state.getAttribute(SUBMISSIONS_SEARCH_ONLY) == null
|| !((Boolean) state.getAttribute(SUBMISSIONS_SEARCH_ONLY)).booleanValue()))
{
state.setAttribute(VIEW_SUBMISSION_LIST_OPTION, AssignmentConstants.ALL);
}
} | void function(SessionState state) { if (state.getAttribute(VIEW_SUBMISSION_LIST_OPTION) == null && (state.getAttribute(SUBMISSIONS_SEARCH_ONLY) == null !((Boolean) state.getAttribute(SUBMISSIONS_SEARCH_ONLY)).booleanValue())) { state.setAttribute(VIEW_SUBMISSION_LIST_OPTION, AssignmentConstants.ALL); } } | /**
* make sure the state variable VIEW_SUBMISSION_LIST_OPTION is not null
* @param state
*/ | make sure the state variable VIEW_SUBMISSION_LIST_OPTION is not null | initViewSubmissionListOption | {
"repo_name": "udayg/sakai",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 672322
} | [
"org.sakaiproject.assignment.api.AssignmentConstants",
"org.sakaiproject.event.api.SessionState"
] | import org.sakaiproject.assignment.api.AssignmentConstants; import org.sakaiproject.event.api.SessionState; | import org.sakaiproject.assignment.api.*; import org.sakaiproject.event.api.*; | [
"org.sakaiproject.assignment",
"org.sakaiproject.event"
] | org.sakaiproject.assignment; org.sakaiproject.event; | 1,838,600 |
public static void setLogger(Logger logger) {
SshWorker.logger = logger;
}
private static class SshTask implements Callable<ResponseOnSingeRequest> {
private SshMeta sshMeta;
private String targetHost;
public SshTask(SshMeta sshMeta, String targetHost) {
this.sshMeta = sshMeta;
this.targetHost = targetHost;
} | static void function(Logger logger) { SshWorker.logger = logger; } private static class SshTask implements Callable<ResponseOnSingeRequest> { private SshMeta sshMeta; private String targetHost; public SshTask(SshMeta sshMeta, String targetHost) { this.sshMeta = sshMeta; this.targetHost = targetHost; } | /**
* Sets the logger.
*
* @param logger
* the new logger
*/ | Sets the logger | setLogger | {
"repo_name": "eBay/parallec",
"path": "src/main/java/io/parallec/core/actor/SshWorker.java",
"license": "apache-2.0",
"size": 14202
} | [
"io.parallec.core.actor.message.ResponseOnSingeRequest",
"io.parallec.core.bean.ssh.SshMeta",
"java.util.concurrent.Callable",
"org.slf4j.Logger"
] | import io.parallec.core.actor.message.ResponseOnSingeRequest; import io.parallec.core.bean.ssh.SshMeta; import java.util.concurrent.Callable; import org.slf4j.Logger; | import io.parallec.core.actor.message.*; import io.parallec.core.bean.ssh.*; import java.util.concurrent.*; import org.slf4j.*; | [
"io.parallec.core",
"java.util",
"org.slf4j"
] | io.parallec.core; java.util; org.slf4j; | 1,297,765 |
public static ContentName rootName(ContentName nodeName) {
ContentName baseName = (isAccessName(nodeName) ? accessRoot(nodeName) : nodeName);
ContentName aclRootName = baseName.append(rootPostfix());
return aclRootName;
}
| static ContentName function(ContentName nodeName) { ContentName baseName = (isAccessName(nodeName) ? accessRoot(nodeName) : nodeName); ContentName aclRootName = baseName.append(rootPostfix()); return aclRootName; } | /**
* Return the name of the root access control policy information object,
* if it is stored at node nodeName.
**/ | Return the name of the root access control policy information object, if it is stored at node nodeName | rootName | {
"repo_name": "MobileCloudNetworking/icnaas",
"path": "mcn-ccn-router/ccnx-0.8.2/javasrc/src/main/org/ccnx/ccn/profiles/security/access/AccessControlProfile.java",
"license": "apache-2.0",
"size": 5647
} | [
"org.ccnx.ccn.protocol.ContentName"
] | import org.ccnx.ccn.protocol.ContentName; | import org.ccnx.ccn.protocol.*; | [
"org.ccnx.ccn"
] | org.ccnx.ccn; | 2,846,471 |
public void propertyChange(PropertyChangeEvent propChangeEvent) {
String propertyName = propChangeEvent.getPropertyName();
Object newValue = propChangeEvent.getNewValue();
if (propertyName.equals("isSelectable")) {
Boolean newBoolValue = (Boolean) newValue;
if (newBoolValue) {
isSelectable = newBoolValue;
initGUI();
this.revalidate();
} else {
isSelectable = newBoolValue;
this.remove(checkBox);
this.revalidate();
}
}
}
| void function(PropertyChangeEvent propChangeEvent) { String propertyName = propChangeEvent.getPropertyName(); Object newValue = propChangeEvent.getNewValue(); if (propertyName.equals(STR)) { Boolean newBoolValue = (Boolean) newValue; if (newBoolValue) { isSelectable = newBoolValue; initGUI(); this.revalidate(); } else { isSelectable = newBoolValue; this.remove(checkBox); this.revalidate(); } } } | /**
* Property Change Listener, listens for specific changes in JPagination property change like "isSelectable" property.
* @param propChangeEvent
*/ | Property Change Listener, listens for specific changes in JPagination property change like "isSelectable" property | propertyChange | {
"repo_name": "NCIP/cab2b",
"path": "software/cab2b/src/java/client/edu/wustl/cab2b/client/ui/pagination/JPageElement.java",
"license": "bsd-3-clause",
"size": 10652
} | [
"java.beans.PropertyChangeEvent"
] | import java.beans.PropertyChangeEvent; | import java.beans.*; | [
"java.beans"
] | java.beans; | 2,355,098 |
@Override
public ProjectHeaderList getProjectsForTeam(Long teamId, ProjectListSortColumn sortColumn, SortDirection sortDirection,
String nextPageToken) throws SynapseException {
return getProjects(ProjectListType.TEAM, null, teamId, sortColumn, sortDirection, nextPageToken);
} | ProjectHeaderList function(Long teamId, ProjectListSortColumn sortColumn, SortDirection sortDirection, String nextPageToken) throws SynapseException { return getProjects(ProjectListType.TEAM, null, teamId, sortColumn, sortDirection, nextPageToken); } | /**
* Retrieve a teams's Projects list
*
* @param teamId the team for which to get the project list
* @param sortColumn the optional sort column (default by last activity)
* @param sortDirection the optional sort direction (default descending)
* @param nextPageToken
* @return
* @throws SynapseException
*/ | Retrieve a teams's Projects list | getProjectsForTeam | {
"repo_name": "zimingd/Synapse-Repository-Services",
"path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java",
"license": "apache-2.0",
"size": 229293
} | [
"org.sagebionetworks.client.exceptions.SynapseException",
"org.sagebionetworks.repo.model.ProjectHeaderList",
"org.sagebionetworks.repo.model.ProjectListSortColumn",
"org.sagebionetworks.repo.model.ProjectListType",
"org.sagebionetworks.repo.model.entity.query.SortDirection"
] | import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.ProjectHeaderList; import org.sagebionetworks.repo.model.ProjectListSortColumn; import org.sagebionetworks.repo.model.ProjectListType; import org.sagebionetworks.repo.model.entity.query.SortDirection; | import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.model.entity.query.*; | [
"org.sagebionetworks.client",
"org.sagebionetworks.repo"
] | org.sagebionetworks.client; org.sagebionetworks.repo; | 698,422 |
final ListObjectsV2Request.Builder request() {
ListObjectsV2Request.Builder request = ListObjectsV2Request.builder().bucket(bucket).delimiter(fs.getSeparator());
if (key != null) {
request = request.prefix(isDirectory ? (key + KeyPath.SEPARATOR) : key);
}
return request;
} | final ListObjectsV2Request.Builder request() { ListObjectsV2Request.Builder request = ListObjectsV2Request.builder().bucket(bucket).delimiter(fs.getSeparator()); if (key != null) { request = request.prefix(isDirectory ? (key + KeyPath.SEPARATOR) : key); } return request; } | /**
* Creates a builder for a request to be sent to AWS S3 server. AWS limits the response to 1000 elements.
* Consequently this method may need to be invoked more than once in order to get the next elements.
* For all continuation requests, {@code request.continuationToken(String)} needs to be invoked.
*/ | Creates a builder for a request to be sent to AWS S3 server. AWS limits the response to 1000 elements. Consequently this method may need to be invoked more than once in order to get the next elements. For all continuation requests, request.continuationToken(String) needs to be invoked | request | {
"repo_name": "apache/sis",
"path": "cloud/sis-cloud-S3/src/main/java/org/apache/sis/cloud/aws/s3/KeyPath.java",
"license": "apache-2.0",
"size": 33691
} | [
"software.amazon.awssdk.services.s3.model.ListObjectsV2Request"
] | import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; | import software.amazon.awssdk.services.s3.model.*; | [
"software.amazon.awssdk"
] | software.amazon.awssdk; | 529,011 |
public FloatMatrix toFloatMatrix() {
return new FloatMatrix(numRows(), numCols(), toFloatArray());
} | FloatMatrix function() { return new FloatMatrix(numRows(), numCols(), toFloatArray()); } | /**
* Generates a JBlas FloatMatrix view of the data
*
* @return the float matrix
*/ | Generates a JBlas FloatMatrix view of the data | toFloatMatrix | {
"repo_name": "dbracewell/apollo",
"path": "src/main/java/com/davidbracewell/apollo/linear/NDArray.java",
"license": "apache-2.0",
"size": 68768
} | [
"org.jblas.FloatMatrix"
] | import org.jblas.FloatMatrix; | import org.jblas.*; | [
"org.jblas"
] | org.jblas; | 926,363 |
protected final Iterator bits() {
return saxbits.iterator();
} | final Iterator function() { return saxbits.iterator(); } | /**
* Iterates through the bits list
*/ | Iterates through the bits list | bits | {
"repo_name": "ggonzales/ksl",
"path": "src/com/dotmarketing/util/diff/helper/SaxBuffer.java",
"license": "gpl-3.0",
"size": 16333
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 878,092 |
public static Optional<EventListener> createEventListener(String descriptor, String description,
String descriptorID, Identifiable identifiable)
throws IllegalArgumentException{
if (!descriptorID.matches("[\\w\\-_]+"))
throw new IllegalArgumentException("descriptorID: " + descriptorID + " contains illegal characters");
return
IdentificationManagerM.getInstance().getIdentification(identifiable)
.flatMap(id -> Event.createEvent(CommonEvents.Type.NOTIFICATION_TYPE, id, Collections.singletonList(descriptor)))
.map(event -> new EventListener(event, descriptor, description, descriptorID));
} | static Optional<EventListener> function(String descriptor, String description, String descriptorID, Identifiable identifiable) throws IllegalArgumentException{ if (!descriptorID.matches(STR)) throw new IllegalArgumentException(STR + descriptorID + STR); return IdentificationManagerM.getInstance().getIdentification(identifiable) .flatMap(id -> Event.createEvent(CommonEvents.Type.NOTIFICATION_TYPE, id, Collections.singletonList(descriptor))) .map(event -> new EventListener(event, descriptor, description, descriptorID)); } | /**
* Create the EventListener.
*
* @param descriptor the descriptor of the Event you want to listen to
* @param description the description of the descriptor
* @param descriptorID an ID for the descriptor (Should contain no special characters, spaces etc.). Only String
* which match the regex (\w-_)+ are allowed.
* @param identifiable the identifiable which wants to create the EventListener
* @return if one of the parameter is null, or unable to to obtain ID
* @throws java.lang.IllegalArgumentException if the descriptorID contains illegal characters
*/ | Create the EventListener | createEventListener | {
"repo_name": "intellimate/IzouSDK",
"path": "src/main/java/org/intellimate/izou/sdk/contentgenerator/EventListener.java",
"license": "apache-2.0",
"size": 3485
} | [
"java.util.Collections",
"java.util.Optional",
"org.intellimate.izou.identification.Identifiable",
"org.intellimate.izou.identification.IdentificationManagerM",
"org.intellimate.izou.sdk.events.CommonEvents",
"org.intellimate.izou.sdk.events.Event"
] | import java.util.Collections; import java.util.Optional; import org.intellimate.izou.identification.Identifiable; import org.intellimate.izou.identification.IdentificationManagerM; import org.intellimate.izou.sdk.events.CommonEvents; import org.intellimate.izou.sdk.events.Event; | import java.util.*; import org.intellimate.izou.identification.*; import org.intellimate.izou.sdk.events.*; | [
"java.util",
"org.intellimate.izou"
] | java.util; org.intellimate.izou; | 345,818 |
public String getCommentStringValue (Object object)
{
if (isComment(object)) return ((Node)object).getNodeValue();
else return null;
} | String function (Object object) { if (isComment(object)) return ((Node)object).getNodeValue(); else return null; } | /**
* Get the string value of a comment node.
*
* @param object the target node
* @return the text of the comment if the node is a comment, null otherwise
*/ | Get the string value of a comment node | getCommentStringValue | {
"repo_name": "jenkinsci/jaxen",
"path": "src/java/main/org/jaxen/dom/DocumentNavigator.java",
"license": "bsd-3-clause",
"size": 34505
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,961,389 |
public static ClientCacheAffinityMapping readResponse(PayloadInputChannel ch) {
try (BinaryReaderExImpl in = ClientUtils.createBinaryReader(null, ch.in())) {
long topVer = in.readLong();
int minorTopVer = in.readInt();
ClientCacheAffinityMapping aff = new ClientCacheAffinityMapping(
new AffinityTopologyVersion(topVer, minorTopVer));
int mappingsCnt = in.readInt();
for (int i = 0; i < mappingsCnt; i++) {
boolean applicable = in.readBoolean();
int cachesCnt = in.readInt();
if (applicable) { // Partition awareness is applicable for this caches.
Map<Integer, Map<Integer, Integer>> cacheKeyCfg = U.newHashMap(cachesCnt);
for (int j = 0; j < cachesCnt; j++)
cacheKeyCfg.put(in.readInt(), readCacheKeyConfiguration(in));
UUID[] partToNode = readNodePartitions(in);
for (Map.Entry<Integer, Map<Integer, Integer>> keyCfg : cacheKeyCfg.entrySet())
aff.cacheAffinity.put(keyCfg.getKey(), new CacheAffinityInfo(keyCfg.getValue(), partToNode));
}
else { // Partition awareness is not applicable for this caches.
for (int j = 0; j < cachesCnt; j++)
aff.cacheAffinity.put(in.readInt(), NOT_APPLICABLE_CACHE_AFFINITY_INFO);
}
}
return aff;
}
catch (IOException e) {
throw new ClientError(e);
}
} | static ClientCacheAffinityMapping function(PayloadInputChannel ch) { try (BinaryReaderExImpl in = ClientUtils.createBinaryReader(null, ch.in())) { long topVer = in.readLong(); int minorTopVer = in.readInt(); ClientCacheAffinityMapping aff = new ClientCacheAffinityMapping( new AffinityTopologyVersion(topVer, minorTopVer)); int mappingsCnt = in.readInt(); for (int i = 0; i < mappingsCnt; i++) { boolean applicable = in.readBoolean(); int cachesCnt = in.readInt(); if (applicable) { Map<Integer, Map<Integer, Integer>> cacheKeyCfg = U.newHashMap(cachesCnt); for (int j = 0; j < cachesCnt; j++) cacheKeyCfg.put(in.readInt(), readCacheKeyConfiguration(in)); UUID[] partToNode = readNodePartitions(in); for (Map.Entry<Integer, Map<Integer, Integer>> keyCfg : cacheKeyCfg.entrySet()) aff.cacheAffinity.put(keyCfg.getKey(), new CacheAffinityInfo(keyCfg.getValue(), partToNode)); } else { for (int j = 0; j < cachesCnt; j++) aff.cacheAffinity.put(in.readInt(), NOT_APPLICABLE_CACHE_AFFINITY_INFO); } } return aff; } catch (IOException e) { throw new ClientError(e); } } | /**
* Reads caches affinity response from the input channel and creates {@code ClientCacheAffinityMapping} instance
* from this response.
*
* @param ch Input channel.
*/ | Reads caches affinity response from the input channel and creates ClientCacheAffinityMapping instance from this response | readResponse | {
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java",
"license": "apache-2.0",
"size": 10210
} | [
"java.io.IOException",
"java.util.Map",
"org.apache.ignite.internal.binary.BinaryReaderExImpl",
"org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import java.io.IOException; import java.util.Map; import org.apache.ignite.internal.binary.BinaryReaderExImpl; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.util.typedef.internal.U; | import java.io.*; import java.util.*; import org.apache.ignite.internal.binary.*; import org.apache.ignite.internal.processors.affinity.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.io",
"java.util",
"org.apache.ignite"
] | java.io; java.util; org.apache.ignite; | 846,666 |
EClass getTupleDescriptorCS(); | EClass getTupleDescriptorCS(); | /**
* Returns the meta object for class '{@link org.muml.psm.allocation.language.cs.TupleDescriptorCS <em>Tuple Descriptor CS</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Tuple Descriptor CS</em>'.
* @see org.muml.psm.allocation.language.cs.TupleDescriptorCS
* @generated
*/ | Returns the meta object for class '<code>org.muml.psm.allocation.language.cs.TupleDescriptorCS Tuple Descriptor CS</code>'. | getTupleDescriptorCS | {
"repo_name": "upohl/eloquent",
"path": "plugins/org.muml.psm.allocation.language/src/org/muml/psm/allocation/language/cs/CsPackage.java",
"license": "epl-1.0",
"size": 108228
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,489,983 |
public int getImageCount() {
List<XlifDocument> xlifs = getXlifs();
int imgCount = 0;
for (LMSXmlDocument xlif : xlifs) {
imgCount += ((XlifDocument)xlif).getImagePaths().size();
}
return imgCount;
}
// -- Methods -- | int function() { List<XlifDocument> xlifs = getXlifs(); int imgCount = 0; for (LMSXmlDocument xlif : xlifs) { imgCount += ((XlifDocument)xlif).getImagePaths().size(); } return imgCount; } | /**
* Returns number of images which are referenced by xlifs
*
* @return image number
*/ | Returns number of images which are referenced by xlifs | getImageCount | {
"repo_name": "snoopycrimecop/bioformats",
"path": "components/formats-gpl/src/loci/formats/in/LeicaMicrosystemsMetadata/XlefDocument.java",
"license": "gpl-2.0",
"size": 2131
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,448,295 |
public void refresh(final IProgressMonitor monitor) {
DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REFRESH_DIAGRAM_KEY);
refreshOperation(monitor);
DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REFRESH_DIAGRAM_KEY);
} | void function(final IProgressMonitor monitor) { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REFRESH_DIAGRAM_KEY); refreshOperation(monitor); DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REFRESH_DIAGRAM_KEY); } | /**
* refresh the content.
*
* @param monitor
* progress monitor for the processing.
*/ | refresh the content | refresh | {
"repo_name": "FTSRG/iq-sirius-integration",
"path": "host/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/experimental/sync/DDiagramSynchronizer.java",
"license": "epl-1.0",
"size": 80495
} | [
"org.eclipse.core.runtime.IProgressMonitor",
"org.eclipse.sirius.common.tools.DslCommonPlugin",
"org.eclipse.sirius.tools.api.profiler.SiriusTasksKey"
] | import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.sirius.common.tools.DslCommonPlugin; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; | import org.eclipse.core.runtime.*; import org.eclipse.sirius.common.tools.*; import org.eclipse.sirius.tools.api.profiler.*; | [
"org.eclipse.core",
"org.eclipse.sirius"
] | org.eclipse.core; org.eclipse.sirius; | 121,101 |
void saveCheckpoint(UniqueId actorId, UniqueId checkpointId); | void saveCheckpoint(UniqueId actorId, UniqueId checkpointId); | /**
* Save a checkpoint to persistent storage.
*
* If `shouldCheckpoint` returns true, this method will be called. You should implement this
* callback to save actor's checkpoint and the given checkpoint id to persistent storage.
*
* @param actorId Actor's ID.
* @param checkpointId An ID that represents this actor's current state in GCS. You should
* save this checkpoint ID together with actor's checkpoint data.
*/ | Save a checkpoint to persistent storage. If `shouldCheckpoint` returns true, this method will be called. You should implement this callback to save actor's checkpoint and the given checkpoint id to persistent storage | saveCheckpoint | {
"repo_name": "atumanov/ray",
"path": "java/api/src/main/java/org/ray/api/Checkpointable.java",
"license": "apache-2.0",
"size": 3550
} | [
"org.ray.api.id.UniqueId"
] | import org.ray.api.id.UniqueId; | import org.ray.api.id.*; | [
"org.ray.api"
] | org.ray.api; | 967,698 |
private Object readResolve() throws ObjectStreamException{
if (isClientConfigured()) {
numSamplesThreshold = clientConfiguredNumSamplesThreshold;
timeThresholdMs = clientConfiguredTimeThresholdMs;
} else {
numSamplesThreshold = NUM_SAMPLES_THRESHOLD;
timeThresholdMs = TIME_THRESHOLD_MS;
}
log.info("Using batching for this run."
+ " Thresholds: num=" + numSamplesThreshold
+ ", time=" + timeThresholdMs);
return this;
} | Object function() throws ObjectStreamException{ if (isClientConfigured()) { numSamplesThreshold = clientConfiguredNumSamplesThreshold; timeThresholdMs = clientConfiguredTimeThresholdMs; } else { numSamplesThreshold = NUM_SAMPLES_THRESHOLD; timeThresholdMs = TIME_THRESHOLD_MS; } log.info(STR + STR + numSamplesThreshold + STR + timeThresholdMs); return this; } | /**
* Processed by the RMI server code; acts as testStarted().
*
* @return this
* @throws ObjectStreamException
* never
*/ | Processed by the RMI server code; acts as testStarted() | readResolve | {
"repo_name": "johrstrom/cloud-meter",
"path": "cloud-meter-core/src/main/java/org/apache/jmeter/samplers/BatchSampleSender.java",
"license": "apache-2.0",
"size": 7394
} | [
"java.io.ObjectStreamException"
] | import java.io.ObjectStreamException; | import java.io.*; | [
"java.io"
] | java.io; | 496,961 |
public static void updateFileForMtp(File file, Context context) {
if (file != null && context != null) {
String path = file.getAbsolutePath();
Log.d(LOG_TAG, "running MediaScanner on: " + path);
String[] paths = { path };
MediaScannerConnection.scanFile(context, paths, null, null);
}
}
| static void function(File file, Context context) { if (file != null && context != null) { String path = file.getAbsolutePath(); Log.d(LOG_TAG, STR + path); String[] paths = { path }; MediaScannerConnection.scanFile(context, paths, null, null); } } | /**
* Runs the MediaScanner service on the specified file. This is needed to
* see the file on an attached computer.
*/ | Runs the MediaScanner service on the specified file. This is needed to see the file on an attached computer | updateFileForMtp | {
"repo_name": "ecemgroup/clinicalguide",
"path": "src/org/get/oxicam/clinicalguide/FileUtils.java",
"license": "apache-2.0",
"size": 2858
} | [
"android.content.Context",
"android.media.MediaScannerConnection",
"android.util.Log",
"java.io.File"
] | import android.content.Context; import android.media.MediaScannerConnection; import android.util.Log; import java.io.File; | import android.content.*; import android.media.*; import android.util.*; import java.io.*; | [
"android.content",
"android.media",
"android.util",
"java.io"
] | android.content; android.media; android.util; java.io; | 334,660 |
LetterValueAtTime new_lvt = new LetterValueAtTime(letter, new_value, time);
valueHistory.add(new_lvt);
//see if need to purge some history
while(valueHistory.size() > historyLength) {
LetterValueAtTime lvt = valueHistory.remove();
//if the last time a letter or color was updated was for this event entry
// then we know that it's no longer used
if(lvt == letterValue.get(lvt.letter.getLetter()).lvt)
letterValue.remove(lvt.letter.getLetter());
if(lvt == colorValue.get(lvt.letter.getColorID()).lvt)
letterValue.remove(lvt.letter.getColorID());
HashMap<Integer, ComputedValue> letter_values = letterTileValue.get(lvt.letter.getLetter());
if(lvt == letter_values.get(lvt.letter.getColorID()).lvt) {
letter_values.remove(lvt.letter.getColorID());
//see if that was the last letter of that color, if so, remove that hash
if(letter_values.size() == 0)
letterTileValue.remove(lvt.letter.getLetter());
}
}
//compute the new exponentially weighted mean values for this letter
double color_ave = 0.0;
double color_weight_sum = 0.0;
double letter_ave = 0.0;
double letter_weight_sum = 0.0;
double letter_color_ave = 0.0;
double letter_color_weight_sum = 0.0;
for(LetterValueAtTime lvt : valueHistory) {
//don't compute anything if it doesn't match
if(lvt.letter.getLetter() != letter.getLetter()
&& lvt.letter.getColorID() != letter.getColorID())
continue;
double weight = Math.pow(discountFactor, (time - lvt.time) / discountPeriod);
double value = weight * lvt.value;
//if matching color, accumulate color value
if(lvt.letter.getColorID() == letter.getColorID()) {
color_ave += value;
color_weight_sum += weight;
//if also matching letter, accumulate for the combo
if(lvt.letter.getLetter() == letter.getLetter()) {
letter_color_ave += value;
letter_color_weight_sum += weight;
}
}
//if matching letter, accumulate letter value
if(lvt.letter.getLetter() == letter.getLetter()) {
letter_ave += value;
letter_weight_sum += weight;
}
}
//turn sums into averages
color_ave /= color_weight_sum;
letter_ave /= letter_weight_sum;
letter_color_ave /= letter_color_weight_sum;
//if haven't dealt with this new letter before, then add it to letterTileValue
HashMap<Integer, ComputedValue> letter_values = letterTileValue.get(letter.getLetter());
if(letter_values == null) {
letter_values = new HashMap<Integer, ComputedValue>();
letterTileValue.put(letter.getLetter(), letter_values);
}
//insert new values
letter_values.put(letter.getColorID(), new ComputedValue((float)letter_color_ave, new_lvt));
letterValue.put(letter.getLetter(), new ComputedValue((float)letter_ave, new_lvt));
colorValue.put(letter.getColorID(), new ComputedValue((float)color_ave, new_lvt));
}
| LetterValueAtTime new_lvt = new LetterValueAtTime(letter, new_value, time); valueHistory.add(new_lvt); while(valueHistory.size() > historyLength) { LetterValueAtTime lvt = valueHistory.remove(); if(lvt == letterValue.get(lvt.letter.getLetter()).lvt) letterValue.remove(lvt.letter.getLetter()); if(lvt == colorValue.get(lvt.letter.getColorID()).lvt) letterValue.remove(lvt.letter.getColorID()); HashMap<Integer, ComputedValue> letter_values = letterTileValue.get(lvt.letter.getLetter()); if(lvt == letter_values.get(lvt.letter.getColorID()).lvt) { letter_values.remove(lvt.letter.getColorID()); if(letter_values.size() == 0) letterTileValue.remove(lvt.letter.getLetter()); } } double color_ave = 0.0; double color_weight_sum = 0.0; double letter_ave = 0.0; double letter_weight_sum = 0.0; double letter_color_ave = 0.0; double letter_color_weight_sum = 0.0; for(LetterValueAtTime lvt : valueHistory) { if(lvt.letter.getLetter() != letter.getLetter() && lvt.letter.getColorID() != letter.getColorID()) continue; double weight = Math.pow(discountFactor, (time - lvt.time) / discountPeriod); double value = weight * lvt.value; if(lvt.letter.getColorID() == letter.getColorID()) { color_ave += value; color_weight_sum += weight; if(lvt.letter.getLetter() == letter.getLetter()) { letter_color_ave += value; letter_color_weight_sum += weight; } } if(lvt.letter.getLetter() == letter.getLetter()) { letter_ave += value; letter_weight_sum += weight; } } color_ave /= color_weight_sum; letter_ave /= letter_weight_sum; letter_color_ave /= letter_color_weight_sum; HashMap<Integer, ComputedValue> letter_values = letterTileValue.get(letter.getLetter()); if(letter_values == null) { letter_values = new HashMap<Integer, ComputedValue>(); letterTileValue.put(letter.getLetter(), letter_values); } letter_values.put(letter.getColorID(), new ComputedValue((float)letter_color_ave, new_lvt)); letterValue.put(letter.getLetter(), new ComputedValue((float)letter_ave, new_lvt)); colorValue.put(letter.getColorID(), new ComputedValue((float)color_ave, new_lvt)); } | /**Adds a new value for a Letter at the specified time
* History is maintained in the order that new values are inserted.
* @param letter
* @param new_value
* @param time
*/ | Adds a new value for a Letter at the specified time History is maintained in the order that new values are inserted | addNewValue | {
"repo_name": "eshen1991/kivasim",
"path": "alphabetsoup/simulators/markettaskallocation/LetterHistory.java",
"license": "gpl-2.0",
"size": 9055
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 833,295 |
public Set<SchoolClass> getAllValuesOfSC(final ClassesOfTeacherMatch partialMatch) {
return rawAccumulateAllValuesOfSC(partialMatch.toArray());
} | Set<SchoolClass> function(final ClassesOfTeacherMatch partialMatch) { return rawAccumulateAllValuesOfSC(partialMatch.toArray()); } | /**
* Retrieve the set of values that occur in matches for SC.
* @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
*
*/ | Retrieve the set of values that occur in matches for SC | getAllValuesOfSC | {
"repo_name": "imbur/EMF-IncQuery-Examples",
"path": "school/school.incquery/src-gen/school/ClassesOfTeacherMatcher.java",
"license": "epl-1.0",
"size": 12766
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 26,979 |
public List<AutoTieringPolicyRestRep> getByStorageSystem(URI storageSystemId) {
List<NamedRelatedResourceRep> refs = listByStorageSystem(storageSystemId);
return getByRefs(refs);
} | List<AutoTieringPolicyRestRep> function(URI storageSystemId) { List<NamedRelatedResourceRep> refs = listByStorageSystem(storageSystemId); return getByRefs(refs); } | /**
* Gets all auto tier policies for a given storage system.
*
* @param storageSystemId
* the ID of the storage system.
* @return the list of auto tier policies.
*
* @see #listByStorageSystem(URI)
* @see #getByRefs(java.util.Collection)
* @see StorageSystems
*/ | Gets all auto tier policies for a given storage system | getByStorageSystem | {
"repo_name": "emcvipr/controller-client-java",
"path": "client/src/main/java/com/emc/vipr/client/core/AutoTieringPolicies.java",
"license": "apache-2.0",
"size": 11634
} | [
"com.emc.storageos.model.NamedRelatedResourceRep",
"com.emc.storageos.model.block.tier.AutoTieringPolicyRestRep",
"java.util.List"
] | import com.emc.storageos.model.NamedRelatedResourceRep; import com.emc.storageos.model.block.tier.AutoTieringPolicyRestRep; import java.util.List; | import com.emc.storageos.model.*; import com.emc.storageos.model.block.tier.*; import java.util.*; | [
"com.emc.storageos",
"java.util"
] | com.emc.storageos; java.util; | 141,594 |
if (columns.size() == 0) {
return EMPTY_CF_SET;
}
var builder = ImmutableSet.<ByteSequence>builder();
columns.forEach(c -> builder.add(new ArrayByteSequence(c.getColumnFamily())));
return builder.build();
}
@SuppressWarnings("serial")
public static class LocalityGroupConfigurationError extends AccumuloException {
LocalityGroupConfigurationError(String why) {
super(why);
}
} | if (columns.size() == 0) { return EMPTY_CF_SET; } var builder = ImmutableSet.<ByteSequence>builder(); columns.forEach(c -> builder.add(new ArrayByteSequence(c.getColumnFamily()))); return builder.build(); } @SuppressWarnings(STR) public static class LocalityGroupConfigurationError extends AccumuloException { LocalityGroupConfigurationError(String why) { super(why); } } | /**
* Create a set of families to be passed into the SortedKeyValueIterator seek call from a supplied
* set of columns. We are using the ImmutableSet to enable faster comparisons down in the
* LocalityGroupIterator.
*
* @param columns
* The set of columns
* @return An immutable set of columns
*/ | Create a set of families to be passed into the SortedKeyValueIterator seek call from a supplied set of columns. We are using the ImmutableSet to enable faster comparisons down in the LocalityGroupIterator | families | {
"repo_name": "lstav/accumulo",
"path": "core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java",
"license": "apache-2.0",
"size": 13383
} | [
"com.google.common.collect.ImmutableSet",
"org.apache.accumulo.core.client.AccumuloException",
"org.apache.accumulo.core.data.ArrayByteSequence",
"org.apache.accumulo.core.data.ByteSequence"
] | import com.google.common.collect.ImmutableSet; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; | import com.google.common.collect.*; import org.apache.accumulo.core.client.*; import org.apache.accumulo.core.data.*; | [
"com.google.common",
"org.apache.accumulo"
] | com.google.common; org.apache.accumulo; | 1,291,683 |
public Builder withCallback(Snackbar.Callback callback) {
this.snackbarCallback = callback;
return this;
} | Builder function(Snackbar.Callback callback) { this.snackbarCallback = callback; return this; } | /**
* Adds a callback to handle the snackbar {@code onDismissed} and {@code onShown} events
*/ | Adds a callback to handle the snackbar onDismissed and onShown events | withCallback | {
"repo_name": "Karumi/Dexter",
"path": "dexter/src/main/java/com/karumi/dexter/listener/single/SnackbarOnPermanentlyDeniedPermissionListener.java",
"license": "apache-2.0",
"size": 4913
} | [
"com.google.android.material.snackbar.Snackbar"
] | import com.google.android.material.snackbar.Snackbar; | import com.google.android.material.snackbar.*; | [
"com.google.android"
] | com.google.android; | 2,120,982 |
private CmsExcelXmlConfiguration getConfigurationFileToExcelFile(CmsExcelContent cmsExcelContent) {
CmsExcelXmlConfiguration cmsExcelXmlConfiguration = null;
// get property content for resource type
String excelProperty = cmsExcelContent.getCategoryProperty();
if (CmsStringUtil.isNotEmpty(excelProperty)) {
// get path to configuration files
String configFilesPath = getPathFromConfigurationFiles();
if (configFilesPath != null) {
try {
// get all configuration files
List allConfigFiles = getCms().readResources(configFilesPath, CmsResourceFilter.ALL, false);
if (allConfigFiles != null) {
// loop over all existing configuration files
Iterator iter = allConfigFiles.iterator();
while (iter.hasNext()) {
// get next configuration file
CmsResource cmsResource = (CmsResource)iter.next();
cmsExcelXmlConfiguration = new CmsExcelXmlConfiguration();
// read configuration file
cmsExcelXmlConfiguration.readConfigurationFile(getCms(), getCms().getSitePath(cmsResource));
// prove if setting from OpenCms resource type in excel file is the same like in the
// configuration file
if (CmsStringUtil.isNotEmpty(cmsExcelXmlConfiguration.getResourceType())
&& cmsExcelXmlConfiguration.getResourceType().equals(excelProperty)) {
// if a belonging configuration file is found, the configuration file is returned
return cmsExcelXmlConfiguration;
}
}
}
} catch (CmsException e) {
if (LOG.isErrorEnabled()) {
LOG.error(e);
}
}
}
}
return null;
} | CmsExcelXmlConfiguration function(CmsExcelContent cmsExcelContent) { CmsExcelXmlConfiguration cmsExcelXmlConfiguration = null; String excelProperty = cmsExcelContent.getCategoryProperty(); if (CmsStringUtil.isNotEmpty(excelProperty)) { String configFilesPath = getPathFromConfigurationFiles(); if (configFilesPath != null) { try { List allConfigFiles = getCms().readResources(configFilesPath, CmsResourceFilter.ALL, false); if (allConfigFiles != null) { Iterator iter = allConfigFiles.iterator(); while (iter.hasNext()) { CmsResource cmsResource = (CmsResource)iter.next(); cmsExcelXmlConfiguration = new CmsExcelXmlConfiguration(); cmsExcelXmlConfiguration.readConfigurationFile(getCms(), getCms().getSitePath(cmsResource)); if (CmsStringUtil.isNotEmpty(cmsExcelXmlConfiguration.getResourceType()) && cmsExcelXmlConfiguration.getResourceType().equals(excelProperty)) { return cmsExcelXmlConfiguration; } } } } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error(e); } } } } return null; } | /**
* Gets configuration file belonging to excel file. The mapping between excel file and configuration
* file is between a property from excel file and a setting in configuration file in form from OpenCms
* resource type name.<p>
*
* @param cmsExcelContent content from excel file
* @param report report content for user
*
* @return configuration file content belonging to excel file
*/ | Gets configuration file belonging to excel file. The mapping between excel file and configuration file is between a property from excel file and a setting in configuration file in form from OpenCms resource type name | getConfigurationFileToExcelFile | {
"repo_name": "gallardo/alkacon-oamp",
"path": "com.alkacon.opencms.v8.excelimport/src/com/alkacon/opencms/v8/excelimport/CmsExcelImport.java",
"license": "gpl-3.0",
"size": 69061
} | [
"java.util.Iterator",
"java.util.List",
"org.opencms.file.CmsResource",
"org.opencms.file.CmsResourceFilter",
"org.opencms.main.CmsException",
"org.opencms.util.CmsStringUtil"
] | import java.util.Iterator; import java.util.List; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.main.CmsException; import org.opencms.util.CmsStringUtil; | import java.util.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.util.*; | [
"java.util",
"org.opencms.file",
"org.opencms.main",
"org.opencms.util"
] | java.util; org.opencms.file; org.opencms.main; org.opencms.util; | 2,857,484 |
FeatureMap getContext();
| FeatureMap getContext(); | /**
* Returns the value of the '<em><b>Context</b></em>' attribute list.
* The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Allows indication of what realms a particular narrative applies to (if different from the realm associated with the overall storyboard)
* <!-- end-model-doc -->
* @return the value of the '<em>Context</em>' attribute list.
* @see org.openhealthtools.mdht.emf.hl7.mif2.Mif2Package#getStoryboardNarrative_Context()
* @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true"
* extendedMetaData="kind='group' name='Context:4'"
* @generated
*/ | Returns the value of the 'Context' attribute list. The list contents are of type <code>org.eclipse.emf.ecore.util.FeatureMap.Entry</code>. Allows indication of what realms a particular narrative applies to (if different from the realm associated with the overall storyboard) | getContext | {
"repo_name": "drbgfc/mdht",
"path": "hl7/plugins/org.openhealthtools.mdht.emf.hl7.mif2/src/org/openhealthtools/mdht/emf/hl7/mif2/StoryboardNarrative.java",
"license": "epl-1.0",
"size": 7285
} | [
"org.eclipse.emf.ecore.util.FeatureMap"
] | import org.eclipse.emf.ecore.util.FeatureMap; | import org.eclipse.emf.ecore.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,442,892 |
public void setModel(TableModel model) {
this.model = model;
reflowData();
} | void function(TableModel model) { this.model = model; reflowData(); } | /**
* The data model (containing the actual data) used by this {@link TTable},
* as with the usual Swing tables.
* <p>
* Will reset all the rendering cells.
*
* @param model
* the new model
*/ | The data model (containing the actual data) used by this <code>TTable</code>, as with the usual Swing tables. Will reset all the rendering cells | setModel | {
"repo_name": "nikiroo/fanfix",
"path": "src/be/nikiroo/jexer/TTable.java",
"license": "gpl-3.0",
"size": 13915
} | [
"javax.swing.table.TableModel"
] | import javax.swing.table.TableModel; | import javax.swing.table.*; | [
"javax.swing"
] | javax.swing; | 62,180 |
boolean isUserConnected(UserDetail user); | boolean isUserConnected(UserDetail user); | /**
* Is the specified user currently connected to Silverpeas?
*
* @param user the user for which the connection is checked.
* @return true if the user is connected, false otherwise.
*/ | Is the specified user currently connected to Silverpeas | isUserConnected | {
"repo_name": "SilverDav/Silverpeas-Core",
"path": "core-library/src/main/java/org/silverpeas/core/security/session/SessionManagement.java",
"license": "agpl-3.0",
"size": 6523
} | [
"org.silverpeas.core.admin.user.model.UserDetail"
] | import org.silverpeas.core.admin.user.model.UserDetail; | import org.silverpeas.core.admin.user.model.*; | [
"org.silverpeas.core"
] | org.silverpeas.core; | 2,081,024 |
private void updateConnectButton() {
connectButton.setEnabled(isConnected() &&
!urlInput.getText().toString().isEmpty()
&& TextUtils.isEmpty(urlInputLayout.getError()));
connectButton.setText(isConnected() ? R.string.button_connect : R.string.button_connect_no_network);
} | void function() { connectButton.setEnabled(isConnected() && !urlInput.getText().toString().isEmpty() && TextUtils.isEmpty(urlInputLayout.getError())); connectButton.setText(isConnected() ? R.string.button_connect : R.string.button_connect_no_network); } | /**
* Update the state of the connect button: require a valid URL and network access to allow clicking
*/ | Update the state of the connect button: require a valid URL and network access to allow clicking | updateConnectButton | {
"repo_name": "Maxr1998/home-assistant-Android",
"path": "app/src/phone/java/io.homeassistant.android/view/LoginView.java",
"license": "gpl-3.0",
"size": 9379
} | [
"android.text.TextUtils"
] | import android.text.TextUtils; | import android.text.*; | [
"android.text"
] | android.text; | 665,980 |
@Generated
@IsOptional
@Selector("indexTitlesForCollectionView:")
default NSArray<String> indexTitlesForCollectionView(UICollectionView collectionView) {
throw new java.lang.UnsupportedOperationException();
} | @Selector(STR) default NSArray<String> indexTitlesForCollectionView(UICollectionView collectionView) { throw new java.lang.UnsupportedOperationException(); } | /**
* Returns a list of index titles to display in the index view (e.g. ["A", "B", "C" ... "Z", "#"])
*/ | Returns a list of index titles to display in the index view (e.g. ["A", "B", "C" ... "Z", "#"]) | indexTitlesForCollectionView | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/protocol/UICollectionViewDataSource.java",
"license": "apache-2.0",
"size": 4027
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 76,916 |
protected ExampleSet performPreprocessing(ExampleSet exampleSet) throws OperatorException {
return exampleSet;
}
| ExampleSet function(ExampleSet exampleSet) throws OperatorException { return exampleSet; } | /**
* This default implementation does nothing. Subclasses might calculate for example a
* discretization but should either deliver a new view or a fresh example set in order to not
* change the underlying data.
*/ | This default implementation does nothing. Subclasses might calculate for example a discretization but should either deliver a new view or a fresh example set in order to not change the underlying data | performPreprocessing | {
"repo_name": "brtonnies/rapidminer-studio",
"path": "src/main/java/com/rapidminer/operator/visualization/dependencies/AbstractPairwiseMatrixOperator.java",
"license": "agpl-3.0",
"size": 3635
} | [
"com.rapidminer.example.ExampleSet",
"com.rapidminer.operator.OperatorException"
] | import com.rapidminer.example.ExampleSet; import com.rapidminer.operator.OperatorException; | import com.rapidminer.example.*; import com.rapidminer.operator.*; | [
"com.rapidminer.example",
"com.rapidminer.operator"
] | com.rapidminer.example; com.rapidminer.operator; | 2,530,909 |
@Nullable public IgniteInternalFuture<?> awaitAckAsync() {
synchronized (this) {
if (cnt == 0)
return null;
if (nodeLeft)
return new GridFinishedFuture<>(new IgniteCheckedException("Failed to wait for finish synchronizer " +
"state (node left grid): " + nodeId));
if (pendingFut == null) {
if (log.isTraceEnabled())
log.trace("Creating transaction synchronizer future [nodeId=" + nodeId +
", threadId=" + threadId + ']');
pendingFut = new GridFutureAdapter<>();
}
return pendingFut;
}
} | @Nullable IgniteInternalFuture<?> function() { synchronized (this) { if (cnt == 0) return null; if (nodeLeft) return new GridFinishedFuture<>(new IgniteCheckedException(STR + STR + nodeId)); if (pendingFut == null) { if (log.isTraceEnabled()) log.trace(STR + nodeId + STR + threadId + ']'); pendingFut = new GridFutureAdapter<>(); } return pendingFut; } } | /**
* Asynchronously waits for ack to be received from node.
*
* @return {@code null} if ack has been received, or future that will be completed when ack is received.
*/ | Asynchronously waits for ack to be received from node | awaitAckAsync | {
"repo_name": "vadopolski/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java",
"license": "apache-2.0",
"size": 10776
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.internal.util.future.GridFinishedFuture",
"org.apache.ignite.internal.util.future.GridFutureAdapter",
"org.jetbrains.annotations.Nullable"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.future.GridFinishedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.jetbrains.annotations.Nullable; | import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.future.*; import org.jetbrains.annotations.*; | [
"org.apache.ignite",
"org.jetbrains.annotations"
] | org.apache.ignite; org.jetbrains.annotations; | 775,660 |
@Override
public synchronized String getStatusHTML(String childUniqueStatus) {
StringBuffer sb = new StringBuffer();
sb.append("<tr><td width=\"20%\">Queue size:</td>");
sb.append("<td>" + ((queueManager!=null) ? queueManager.size() : "???") + "</td></tr>");
sb.append("<tr><td width=\"20%\">Last file dequeued:</td>");
if (lastTimeDequeued != 0) {
sb.append("<td>"+lastFileDequeued+"</td></tr>");
sb.append("<tr><td width=\"20%\">Last file dequeued at:</td>");
sb.append("<td>"+StringUtil.getDateTime(lastTimeDequeued," ")+"</td></tr>");
}
else sb.append("<td>No activity</td></tr>");
return super.getStatusHTML(childUniqueStatus + sb.toString());
} | synchronized String function(String childUniqueStatus) { StringBuffer sb = new StringBuffer(); sb.append(STR20%\STR); sb.append("<td>" + ((queueManager!=null) ? queueManager.size() : "???") + STR); sb.append(STR20%\STR); if (lastTimeDequeued != 0) { sb.append("<td>"+lastFileDequeued+STR); sb.append(STR20%\STR); sb.append("<td>"+StringUtil.getDateTime(lastTimeDequeued,STR)+STR); } else sb.append(STR); return super.getStatusHTML(childUniqueStatus + sb.toString()); } | /**
* Get HTML text displaying the active status of the stage.
* @param childUniqueStatus the status of the stage of which
* this class is the parent.
* @return HTML text displaying the active status of the stage.
*/ | Get HTML text displaying the active status of the stage | getStatusHTML | {
"repo_name": "blezek/Notion",
"path": "src/main/java/org/rsna/ctp/pipeline/AbstractQueuedExportService.java",
"license": "bsd-3-clause",
"size": 7005
} | [
"org.rsna.util.StringUtil"
] | import org.rsna.util.StringUtil; | import org.rsna.util.*; | [
"org.rsna.util"
] | org.rsna.util; | 1,102,176 |
@Deprecated
@SimpleFunction(userVisible = false, description = "Twitter's API no longer supports login via username and "
+ "password. Use the Authorize call instead.")
public void Login(String username, String password) {
form.dispatchErrorOccurredEvent(this, "Login",
ErrorMessages.ERROR_TWITTER_UNSUPPORTED_LOGIN_FUNCTION);
} | @SimpleFunction(userVisible = false, description = STR + STR) void function(String username, String password) { form.dispatchErrorOccurredEvent(this, "Login", ErrorMessages.ERROR_TWITTER_UNSUPPORTED_LOGIN_FUNCTION); } | /**
* Logs in to Twitter with a username and password.
*/ | Logs in to Twitter with a username and password | Login | {
"repo_name": "shilpamagrawal15/appinventor-sources",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/Twitter.java",
"license": "mit",
"size": 38300
} | [
"com.google.appinventor.components.annotations.SimpleFunction",
"com.google.appinventor.components.runtime.util.ErrorMessages"
] | import com.google.appinventor.components.annotations.SimpleFunction; import com.google.appinventor.components.runtime.util.ErrorMessages; | import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.runtime.util.*; | [
"com.google.appinventor"
] | com.google.appinventor; | 110,833 |
public ListTag setValue(List<Tag> list) {
return new ListTag(getType(), list);
} | ListTag function(List<Tag> list) { return new ListTag(getType(), list); } | /**
* Create a new list tag with this tag's name and type.
*
* @param list the new list
* @return a new list tag
*/ | Create a new list tag with this tag's name and type | setValue | {
"repo_name": "DarkFort/FastAsyncWorldedit-rus-by-DarkFort",
"path": "core/src/main/java/com/sk89q/jnbt/ListTag.java",
"license": "gpl-3.0",
"size": 11522
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,137,779 |
public Region getRegion() {
return this.userRegionNameToshadowPRMap.size() == 1
? (Region) this.userRegionNameToshadowPRMap.values().toArray()[0] : null;
} | Region function() { return this.userRegionNameToshadowPRMap.size() == 1 ? (Region) this.userRegionNameToshadowPRMap.values().toArray()[0] : null; } | /**
* This returns queueRegion if there is only one PartitionedRegion using the GatewaySender
* Otherwise it returns null.
*/ | This returns queueRegion if there is only one PartitionedRegion using the GatewaySender Otherwise it returns null | getRegion | {
"repo_name": "smanvi-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java",
"license": "apache-2.0",
"size": 68361
} | [
"org.apache.geode.cache.Region"
] | import org.apache.geode.cache.Region; | import org.apache.geode.cache.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,847,824 |