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 Array getArray(final Experiment exp) {
Array array = null;
Set<BioAssay> bioAssays = exp.getBioAssays();
if (bioAssays.size() > 0) {
array = bioAssays.iterator().next().getArray();
}
return array;
} | Array function(final Experiment exp) { Array array = null; Set<BioAssay> bioAssays = exp.getBioAssays(); if (bioAssays.size() > 0) { array = bioAssays.iterator().next().getArray(); } return array; } | /**
* Extract array object associated with all contained bioassays.
* That will have been the case for data uploaded from a file.
* @param exp An experiment
* @return Array object associated with bioassays contained in
* the experiment.
*/ | Extract array object associated with all contained bioassays. That will have been the case for data uploaded from a file | getArray | {
"repo_name": "NCIP/webgenome",
"path": "tags/WEBGENOME_R3.2_6MAR2009_BUILD1/java/core/src/org/rti/webgenome/service/job/DownloadDataJob.java",
"license": "bsd-3-clause",
"size": 4567
} | [
"java.util.Set",
"org.rti.webgenome.domain.Array",
"org.rti.webgenome.domain.BioAssay",
"org.rti.webgenome.domain.Experiment"
] | import java.util.Set; import org.rti.webgenome.domain.Array; import org.rti.webgenome.domain.BioAssay; import org.rti.webgenome.domain.Experiment; | import java.util.*; import org.rti.webgenome.domain.*; | [
"java.util",
"org.rti.webgenome"
] | java.util; org.rti.webgenome; | 1,430,881 |
public EjbRelationType<RelationshipsType<T>> createEjbRelation()
{
return new EjbRelationTypeImpl<RelationshipsType<T>>(this, "ejb-relation", childNode);
} | EjbRelationType<RelationshipsType<T>> function() { return new EjbRelationTypeImpl<RelationshipsType<T>>(this, STR, childNode); } | /**
* Creates a new <code>ejb-relation</code> element
* @return the new created instance of <code>EjbRelationType<RelationshipsType<T>></code>
*/ | Creates a new <code>ejb-relation</code> element | createEjbRelation | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar31/RelationshipsTypeImpl.java",
"license": "epl-1.0",
"size": 6478
} | [
"org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbRelationType",
"org.jboss.shrinkwrap.descriptor.api.ejbjar31.RelationshipsType"
] | import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbRelationType; import org.jboss.shrinkwrap.descriptor.api.ejbjar31.RelationshipsType; | import org.jboss.shrinkwrap.descriptor.api.ejbjar31.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 340,491 |
public static String convertDateToString(Date date, boolean millis) {
if (date == null) {
return null;
} else {
DateFormat df;
if (millis) {
df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
} else {
df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
}
df.setTimeZone(TimeZone.getTimeZone("UTC"));
if (date.before(ONE_CE)) {
StringBuilder sb = new StringBuilder(df.format(date));
sb.insert(0, "-");
return sb.toString();
} else {
return df.format(date);
}
}
} | static String function(Date date, boolean millis) { if (date == null) { return null; } else { DateFormat df; if (millis) { df = new SimpleDateFormat(STR); } else { df = new SimpleDateFormat(STR); } df.setTimeZone(TimeZone.getTimeZone("UTC")); if (date.before(ONE_CE)) { StringBuilder sb = new StringBuilder(df.format(date)); sb.insert(0, "-"); return sb.toString(); } else { return df.format(date); } } } | /**
* Converts an instance of java.util.Date into an ISO 8601 String
* representation. Uses the date format yyyy-MM-ddTHH:mm:ss.SSSZ or
* yyyy-MM-ddTHH:mm:ssZ, depending on whether millisecond precision is
* desired.
*
* @param date
* Instance of java.util.Date.
* @param millis
* Whether or not the return value should include milliseconds.
* @return ISO 8601 String representation of the Date argument or null if
* the Date argument is null.
*/ | Converts an instance of java.util.Date into an ISO 8601 String desired | convertDateToString | {
"repo_name": "DBCDK/fcrepo-3.5-patched",
"path": "fcrepo-common/src/main/java/org/fcrepo/utilities/DateUtility.java",
"license": "apache-2.0",
"size": 10536
} | [
"java.text.DateFormat",
"java.text.SimpleDateFormat",
"java.util.Date",
"java.util.TimeZone"
] | import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 440,450 |
static boolean handleIconKeyEvent(View v, int keyCode, KeyEvent e) {
ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) v.getParent();
final CellLayout layout = (CellLayout) parent.getParent();
final Workspace workspace = (Workspace) layout.getParent();
final ViewGroup launcher = (ViewGroup) workspace.getParent();
final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.search_drop_target_bar);
final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat);
int pageIndex = workspace.indexOfChild(layout);
int pageCount = workspace.getChildCount();
final int action = e.getAction();
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
boolean wasHandled = false;
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_LEFT:
if (handleKeyEvent) {
// Select the previous icon or the last icon on the previous page if possible
View newIcon = getIconInDirection(layout, parent, v, -1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
} else {
if (pageIndex > 0) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex - 1);
newIcon = getIconInDirection(layout, parent,
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
} else {
// Snap to the previous page
workspace.snapToPage(pageIndex - 1);
}
v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
}
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (handleKeyEvent) {
// Select the next icon or the first icon on the next page if possible
View newIcon = getIconInDirection(layout, parent, v, 1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
} else {
if (pageIndex < (pageCount - 1)) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex + 1);
newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
} else {
// Snap to the next page
workspace.snapToPage(pageIndex + 1);
}
v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
}
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_DPAD_UP:
if (handleKeyEvent) {
// Select the closest icon in the previous line, otherwise select the tab bar
View newIcon = getClosestIconOnLine(layout, parent, v, -1);
if (newIcon != null) {
newIcon.requestFocus();
wasHandled = true;
} else {
tabs.requestFocus();
}
v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
// Select the closest icon in the next line, otherwise select the button bar
View newIcon = getClosestIconOnLine(layout, parent, v, 1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
wasHandled = true;
} else if (hotseat != null) {
hotseat.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
break;
case KeyEvent.KEYCODE_PAGE_UP:
if (handleKeyEvent) {
// Select the first icon on the previous page or the first icon on this page
// if there is no previous page
if (pageIndex > 0) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex - 1);
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
} else {
// Snap to the previous page
workspace.snapToPage(pageIndex - 1);
}
v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
} else {
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_PAGE_DOWN:
if (handleKeyEvent) {
// Select the first icon on the next page or the last icon on this page
// if there is no previous page
if (pageIndex < (pageCount - 1)) {
parent = getCellLayoutChildrenForIndex(workspace, pageIndex + 1);
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
} else {
// Snap to the next page
workspace.snapToPage(pageIndex + 1);
}
v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
} else {
View newIcon = getIconInDirection(layout, parent,
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_MOVE_HOME:
if (handleKeyEvent) {
// Select the first icon on this page
View newIcon = getIconInDirection(layout, parent, -1, 1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
}
}
wasHandled = true;
break;
case KeyEvent.KEYCODE_MOVE_END:
if (handleKeyEvent) {
// Select the last icon on this page
View newIcon = getIconInDirection(layout, parent,
parent.getChildCount(), -1);
if (newIcon != null) {
newIcon.requestFocus();
v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
}
}
wasHandled = true;
break;
default: break;
}
return wasHandled;
} | static boolean handleIconKeyEvent(View v, int keyCode, KeyEvent e) { ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) v.getParent(); final CellLayout layout = (CellLayout) parent.getParent(); final Workspace workspace = (Workspace) layout.getParent(); final ViewGroup launcher = (ViewGroup) workspace.getParent(); final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.search_drop_target_bar); final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat); int pageIndex = workspace.indexOfChild(layout); int pageCount = workspace.getChildCount(); final int action = e.getAction(); final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP); boolean wasHandled = false; switch (keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: if (handleKeyEvent) { View newIcon = getIconInDirection(layout, parent, v, -1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT); } else { if (pageIndex > 0) { parent = getCellLayoutChildrenForIndex(workspace, pageIndex - 1); newIcon = getIconInDirection(layout, parent, parent.getChildCount(), -1); if (newIcon != null) { newIcon.requestFocus(); } else { workspace.snapToPage(pageIndex - 1); } v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT); } } } wasHandled = true; break; case KeyEvent.KEYCODE_DPAD_RIGHT: if (handleKeyEvent) { View newIcon = getIconInDirection(layout, parent, v, 1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT); } else { if (pageIndex < (pageCount - 1)) { parent = getCellLayoutChildrenForIndex(workspace, pageIndex + 1); newIcon = getIconInDirection(layout, parent, -1, 1); if (newIcon != null) { newIcon.requestFocus(); } else { workspace.snapToPage(pageIndex + 1); } v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT); } } } wasHandled = true; break; case KeyEvent.KEYCODE_DPAD_UP: if (handleKeyEvent) { View newIcon = getClosestIconOnLine(layout, parent, v, -1); if (newIcon != null) { newIcon.requestFocus(); wasHandled = true; } else { tabs.requestFocus(); } v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP); } break; case KeyEvent.KEYCODE_DPAD_DOWN: if (handleKeyEvent) { View newIcon = getClosestIconOnLine(layout, parent, v, 1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN); wasHandled = true; } else if (hotseat != null) { hotseat.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN); } } break; case KeyEvent.KEYCODE_PAGE_UP: if (handleKeyEvent) { if (pageIndex > 0) { parent = getCellLayoutChildrenForIndex(workspace, pageIndex - 1); View newIcon = getIconInDirection(layout, parent, -1, 1); if (newIcon != null) { newIcon.requestFocus(); } else { workspace.snapToPage(pageIndex - 1); } v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP); } else { View newIcon = getIconInDirection(layout, parent, -1, 1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP); } } } wasHandled = true; break; case KeyEvent.KEYCODE_PAGE_DOWN: if (handleKeyEvent) { if (pageIndex < (pageCount - 1)) { parent = getCellLayoutChildrenForIndex(workspace, pageIndex + 1); View newIcon = getIconInDirection(layout, parent, -1, 1); if (newIcon != null) { newIcon.requestFocus(); } else { workspace.snapToPage(pageIndex + 1); } v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN); } else { View newIcon = getIconInDirection(layout, parent, parent.getChildCount(), -1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN); } } } wasHandled = true; break; case KeyEvent.KEYCODE_MOVE_HOME: if (handleKeyEvent) { View newIcon = getIconInDirection(layout, parent, -1, 1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP); } } wasHandled = true; break; case KeyEvent.KEYCODE_MOVE_END: if (handleKeyEvent) { View newIcon = getIconInDirection(layout, parent, parent.getChildCount(), -1); if (newIcon != null) { newIcon.requestFocus(); v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN); } } wasHandled = true; break; default: break; } return wasHandled; } | /**
* Handles key events in a Workspace containing.
*/ | Handles key events in a Workspace containing | handleIconKeyEvent | {
"repo_name": "mkodekar/LB-Launcher",
"path": "app/src/main/java/com/lb/launcher/FocusHelper.java",
"license": "apache-2.0",
"size": 30725
} | [
"android.view.KeyEvent",
"android.view.SoundEffectConstants",
"android.view.View",
"android.view.ViewGroup"
] | import android.view.KeyEvent; import android.view.SoundEffectConstants; import android.view.View; import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 986,835 |
public NetworkQuotaInfo getActiveNetworkQuotaInfo() {
try {
return mService.getActiveNetworkQuotaInfo();
} catch (RemoteException e) {
return null;
}
} | NetworkQuotaInfo function() { try { return mService.getActiveNetworkQuotaInfo(); } catch (RemoteException e) { return null; } } | /**
* Return quota status for the current active network, or {@code null} if no
* network is active. Quota status can change rapidly, so these values
* shouldn't be cached.
*
* @hide
*/ | Return quota status for the current active network, or null if no network is active. Quota status can change rapidly, so these values shouldn't be cached | getActiveNetworkQuotaInfo | {
"repo_name": "AdeebNqo/Thula",
"path": "Thula/src/main/java/android/net/ConnectivityManager.java",
"license": "gpl-3.0",
"size": 32273
} | [
"android.os.RemoteException"
] | import android.os.RemoteException; | import android.os.*; | [
"android.os"
] | android.os; | 165,334 |
public IPAddress getSubnet();
| IPAddress function(); | /**
* Returns the subnet associated with this DhcpServerConfig
*
* @return a {@link IPAddress } representing the subnet
*/ | Returns the subnet associated with this DhcpServerConfig | getSubnet | {
"repo_name": "markcullen/kura_Windows",
"path": "kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/net/dhcp/DhcpServerConfig.java",
"license": "epl-1.0",
"size": 3302
} | [
"org.eclipse.kura.net.IPAddress"
] | import org.eclipse.kura.net.IPAddress; | import org.eclipse.kura.net.*; | [
"org.eclipse.kura"
] | org.eclipse.kura; | 1,456,238 |
public void run() {
timedOut = false;
long startTime = new Date().getTime();
long delta = 0;
while (delta < interval) {
try {
Thread.sleep(interval - delta);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return;
}
delta = new Date().getTime() - startTime;
}
timedOut = true;
timeoutHandler.handleTimeout();
return;
} | void function() { timedOut = false; long startTime = new Date().getTime(); long delta = 0; while (delta < interval) { try { Thread.sleep(interval - delta); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } delta = new Date().getTime() - startTime; } timedOut = true; timeoutHandler.handleTimeout(); return; } | /**
* Sleep for the timeout interval unless interrupted. If the
* sleep completes without interruption, the <code>timedOut</code>
* flag is set and the <code>TimeoutHandler.handleTimeout</code> method
* is called. Early returns from <code>Thread.sleep</code> will
* not cause premature indications of timeout.
*/ | Sleep for the timeout interval unless interrupted. If the sleep completes without interruption, the <code>timedOut</code> flag is set and the <code>TimeoutHandler.handleTimeout</code> method is called. Early returns from <code>Thread.sleep</code> will not cause premature indications of timeout | run | {
"repo_name": "pfirmstone/JGDMS",
"path": "qa/src/org/apache/river/qa/harness/Timeout.java",
"license": "apache-2.0",
"size": 4847
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 299,957 |
private static void search4(int row, int col, int rowBound, int colBound, Set<Cell> cells, boolean[][] visited,
char[][] board) {
int[] rowNumber = new int[] { -1, 0, 0, 1 };
int[] colNumber = new int[] { 0, -1, 1, 0 };
visited[row][col] = true;
Cell newCell = new Cell(row, col);
cells.add(newCell);
for (int k = 0; k < rowNumber.length; k++) {
int newRow = row + rowNumber[k];
int newCol = col + colNumber[k];
if (isConnected(newRow, newCol, rowBound, colBound, board) && !visited[newRow][newCol]) {
// newCell = new Cell(newRow, newCol);
// cells.add(newCell);
search4(newRow, newCol, rowBound, colBound, cells, visited, board);
}
}
} | static void function(int row, int col, int rowBound, int colBound, Set<Cell> cells, boolean[][] visited, char[][] board) { int[] rowNumber = new int[] { -1, 0, 0, 1 }; int[] colNumber = new int[] { 0, -1, 1, 0 }; visited[row][col] = true; Cell newCell = new Cell(row, col); cells.add(newCell); for (int k = 0; k < rowNumber.length; k++) { int newRow = row + rowNumber[k]; int newCol = col + colNumber[k]; if (isConnected(newRow, newCol, rowBound, colBound, board) && !visited[newRow][newCol]) { search4(newRow, newCol, rowBound, colBound, cells, visited, board); } } } | /**
* Search 4 directions: north, south, east, west
*
* @param board
* @param row
* @param col
* @param isVisited
*/ | Search 4 directions: north, south, east, west | search4 | {
"repo_name": "Edmondton/InterviewPrep",
"path": "Prep/src/islands/CircleOfFriends.java",
"license": "mit",
"size": 3961
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,447,944 |
@Override
public Annotations getAnnotationsV2(String entityId) throws SynapseException {
String url = ENTITY_URI_PATH + "/" + entityId + ANNOTATIONS_V2;
return getJSONEntity(getRepoEndpoint(), url, Annotations.class);
} | Annotations function(String entityId) throws SynapseException { String url = ENTITY_URI_PATH + "/" + entityId + ANNOTATIONS_V2; return getJSONEntity(getRepoEndpoint(), url, Annotations.class); } | /**
* Get the annotations for an entity.
*
* @param entityId
* @return
* @throws SynapseException
*/ | Get the annotations for an entity | getAnnotationsV2 | {
"repo_name": "Sage-Bionetworks/Synapse-Repository-Services",
"path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java",
"license": "apache-2.0",
"size": 233910
} | [
"org.sagebionetworks.client.exceptions.SynapseException",
"org.sagebionetworks.repo.model.annotation.v2.Annotations"
] | import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.annotation.v2.Annotations; | import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.annotation.v2.*; | [
"org.sagebionetworks.client",
"org.sagebionetworks.repo"
] | org.sagebionetworks.client; org.sagebionetworks.repo; | 1,295,406 |
//-----------------------------------------------------------------------
public Expiry getExpiry() {
return _expiry;
} | Expiry function() { return _expiry; } | /**
* Gets the expiry.
* @return the value of the property, not null
*/ | Gets the expiry | getExpiry | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/option/EquityWarrantSecurity.java",
"license": "apache-2.0",
"size": 20805
} | [
"com.opengamma.util.time.Expiry"
] | import com.opengamma.util.time.Expiry; | import com.opengamma.util.time.*; | [
"com.opengamma.util"
] | com.opengamma.util; | 966,229 |
public void reSeedSecure(long seed) {
if (secRand == null) {
secRand = new SecureRandom();
}
secRand.setSeed(seed);
} | void function(long seed) { if (secRand == null) { secRand = new SecureRandom(); } secRand.setSeed(seed); } | /**
* Reseeds the secure random number generator with the supplied seed.
* <p>
* Will create and initialize if null.
*
* @param seed the seed value to use
*/ | Reseeds the secure random number generator with the supplied seed. Will create and initialize if null | reSeedSecure | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_106/src/java/org/apache/commons/math/random/RandomDataImpl.java",
"license": "gpl-2.0",
"size": 20605
} | [
"java.security.SecureRandom"
] | import java.security.SecureRandom; | import java.security.*; | [
"java.security"
] | java.security; | 2,505,170 |
public String getString() throws StandardException
{
// GemStone changes BEGIN
if (this.value != null) {
return this.value;
}
if (this.rawLength != -1) {
if (this.rawData != null) {
this.value = ClientSharedUtils.getJdkHelper().newWrappedString(
this.rawData, 0, this.rawLength);
return this.value;
}
SanityManager.THROWASSERT("rawData null with rawLength="
+ this.rawLength);
}
return null;
// GemStone changes END
} | String function() throws StandardException { if (this.value != null) { return this.value; } if (this.rawLength != -1) { if (this.rawData != null) { this.value = ClientSharedUtils.getJdkHelper().newWrappedString( this.rawData, 0, this.rawLength); return this.value; } SanityManager.THROWASSERT(STR + this.rawLength); } return null; } | /**
* If possible, use getCharArray() if you don't really
* need a string. getString() will cause an extra
* char array to be allocated when it calls the the String()
* constructor (the first time through), so may be
* cheaper to use getCharArray().
*
* @exception StandardException Thrown on error
*/ | If possible, use getCharArray() if you don't really need a string. getString() will cause an extra char array to be allocated when it calls the the String() constructor (the first time through), so may be cheaper to use getCharArray() | getString | {
"repo_name": "papicella/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/iapi/types/SQLChar.java",
"license": "apache-2.0",
"size": 173889
} | [
"com.gemstone.gemfire.internal.shared.ClientSharedUtils",
"com.pivotal.gemfirexd.internal.iapi.error.StandardException",
"com.pivotal.gemfirexd.internal.iapi.services.sanity.SanityManager"
] | import com.gemstone.gemfire.internal.shared.ClientSharedUtils; import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.services.sanity.SanityManager; | import com.gemstone.gemfire.internal.shared.*; import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.services.sanity.*; | [
"com.gemstone.gemfire",
"com.pivotal.gemfirexd"
] | com.gemstone.gemfire; com.pivotal.gemfirexd; | 2,219,810 |
@Override public void enterForEnd(@NotNull BigDataScriptParser.ForEndContext ctx) { } | @Override public void enterForEnd(@NotNull BigDataScriptParser.ForEndContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | exitWhile | {
"repo_name": "leepc12/BigDataScript",
"path": "src/org/bds/antlr/BigDataScriptBaseListener.java",
"license": "apache-2.0",
"size": 36363
} | [
"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; | 449,804 |
public void tryFlush() throws CacheException, IgniteInterruptedException, IllegalStateException; | void function() throws CacheException, IgniteInterruptedException, IllegalStateException; | /**
* Makes an attempt to stream remaining data. This method is mostly similar to {@link #flush},
* with the difference that it won't wait and will exit immediately.
*
* @throws CacheException If failed to map key to node.
* @throws IgniteInterruptedException If thread has been interrupted.
* @throws IllegalStateException If grid has been concurrently stopped or
* {@link #close(boolean)} has already been called on streamer.
* @see #flush()
*/ | Makes an attempt to stream remaining data. This method is mostly similar to <code>#flush</code>, with the difference that it won't wait and will exit immediately | tryFlush | {
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java",
"license": "apache-2.0",
"size": 18553
} | [
"javax.cache.CacheException"
] | import javax.cache.CacheException; | import javax.cache.*; | [
"javax.cache"
] | javax.cache; | 1,258,881 |
public FlowCreator getFlowCreator() {
return this.flowCreator;
} | FlowCreator function() { return this.flowCreator; } | /**
* Provides the flow creator parameter that was provided to this menu item during initialization.
*
* @return The flow creator of this menu item.
* @since 2.0
*/ | Provides the flow creator parameter that was provided to this menu item during initialization | getFlowCreator | {
"repo_name": "nortal/araneaframework",
"path": "src/org/araneaframework/uilib/core/MenuItem.java",
"license": "apache-2.0",
"size": 8201
} | [
"org.araneaframework.uilib.support.FlowCreator"
] | import org.araneaframework.uilib.support.FlowCreator; | import org.araneaframework.uilib.support.*; | [
"org.araneaframework.uilib"
] | org.araneaframework.uilib; | 694,612 |
public void sortSummaryTableByColumn(long lcolumn) {
int column = (int) lcolumn;
log.debug("Sorting Criterion Impact Factors by IF" + column);
SortOrder currentColumn = summaryTableSortOrder[column];
clearSummaryTableSortOrders();
if (currentColumn.equals(SortOrder.descending)) {
summaryTableSortOrder[column] = SortOrder.ascending;
} else {
summaryTableSortOrder[column] = SortOrder.descending;
}
} | void function(long lcolumn) { int column = (int) lcolumn; log.debug(STR + column); SortOrder currentColumn = summaryTableSortOrder[column]; clearSummaryTableSortOrders(); if (currentColumn.equals(SortOrder.descending)) { summaryTableSortOrder[column] = SortOrder.ascending; } else { summaryTableSortOrder[column] = SortOrder.descending; } } | /**
* Sets the sort order of the specified column in summary table.
*
* @param column
* Column index starting from 0.
*/ | Sets the sort order of the specified column in summary table | sortSummaryTableByColumn | {
"repo_name": "openpreserve/plato",
"path": "kbrowser/src/main/java/eu/scape_project/planning/criteria/bean/CriteriaSetsSummaryView.java",
"license": "apache-2.0",
"size": 12593
} | [
"org.richfaces.component.SortOrder"
] | import org.richfaces.component.SortOrder; | import org.richfaces.component.*; | [
"org.richfaces.component"
] | org.richfaces.component; | 241,892 |
@Pure
protected TypeReferences getTypeReferences() {
return this.typeReferences;
} | TypeReferences function() { return this.typeReferences; } | /** Replies the builder of type references.
*
* @return the type reference builder.
*/ | Replies the builder of type references | getTypeReferences | {
"repo_name": "jgfoster/sarl",
"path": "main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/AbstractBuilder.java",
"license": "apache-2.0",
"size": 10434
} | [
"org.eclipse.xtext.common.types.util.TypeReferences"
] | import org.eclipse.xtext.common.types.util.TypeReferences; | import org.eclipse.xtext.common.types.util.*; | [
"org.eclipse.xtext"
] | org.eclipse.xtext; | 1,576,591 |
public BulkRequestBuilder add(byte[] data, int from, int length, @Nullable String defaultIndex, @Nullable String defaultType) throws Exception {
request.add(data, from, length, defaultIndex, defaultType);
return this;
} | BulkRequestBuilder function(byte[] data, int from, int length, @Nullable String defaultIndex, @Nullable String defaultType) throws Exception { request.add(data, from, length, defaultIndex, defaultType); return this; } | /**
* Adds a framed data in binary format
*/ | Adds a framed data in binary format | add | {
"repo_name": "anti-social/elasticsearch",
"path": "src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java",
"license": "apache-2.0",
"size": 5375
} | [
"org.elasticsearch.common.Nullable"
] | import org.elasticsearch.common.Nullable; | import org.elasticsearch.common.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 125,775 |
public static By getByFromElement(AbstractPage page, WebElement element) {
if (page == null || !isExists(element)) {
return null;
}
FindBy findBy = null;
List<AbstractWidget> widgets = new ArrayList<>();
for(Field field : page.getClass().getDeclaredFields()) {
field.setAccessible(true);
WebElement reflectionElement;
try {
if (field.isAnnotationPresent(Widget.class)) {
widgets.add((AbstractWidget)field.get(page));
continue;
}
reflectionElement = (WebElement) field.get(page);
if (reflectionElement.equals(element)) {
findBy = field.getAnnotation(FindBy.class);
break;
}
} catch (Exception e) {
logger.info(e.getMessage());
}
}
if (findBy != null) {
return buildByFromLongFindBy(findBy);
}
return getByFromWidgetElement(widgets, element);
} | static By function(AbstractPage page, WebElement element) { if (page == null !isExists(element)) { return null; } FindBy findBy = null; List<AbstractWidget> widgets = new ArrayList<>(); for(Field field : page.getClass().getDeclaredFields()) { field.setAccessible(true); WebElement reflectionElement; try { if (field.isAnnotationPresent(Widget.class)) { widgets.add((AbstractWidget)field.get(page)); continue; } reflectionElement = (WebElement) field.get(page); if (reflectionElement.equals(element)) { findBy = field.getAnnotation(FindBy.class); break; } } catch (Exception e) { logger.info(e.getMessage()); } } if (findBy != null) { return buildByFromLongFindBy(findBy); } return getByFromWidgetElement(widgets, element); } | /**
* Gets the defined field By selector from the page model
* @param element
* @param page
* @return By or null if not found
*/ | Gets the defined field By selector from the page model | getByFromElement | {
"repo_name": "PazsitZ/PaCuSe",
"path": "src/main/java/hu/pazsitz/pacuse/tests/helpers/ElementHelper.java",
"license": "mit",
"size": 7073
} | [
"hu.pazsitz.pacuse.pages.AbstractPage",
"hu.pazsitz.pacuse.pages.AbstractWidget",
"hu.pazsitz.pacuse.tests.annotations.Widget",
"java.lang.reflect.Field",
"java.util.ArrayList",
"java.util.List",
"org.openqa.selenium.By",
"org.openqa.selenium.WebElement",
"org.openqa.selenium.support.FindBy"
] | import hu.pazsitz.pacuse.pages.AbstractPage; import hu.pazsitz.pacuse.pages.AbstractWidget; import hu.pazsitz.pacuse.tests.annotations.Widget; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; | import hu.pazsitz.pacuse.pages.*; import hu.pazsitz.pacuse.tests.annotations.*; import java.lang.reflect.*; import java.util.*; import org.openqa.selenium.*; import org.openqa.selenium.support.*; | [
"hu.pazsitz.pacuse",
"java.lang",
"java.util",
"org.openqa.selenium"
] | hu.pazsitz.pacuse; java.lang; java.util; org.openqa.selenium; | 1,371,586 |
public List<Object[]> getSample() {
return m_sample;
} | List<Object[]> function() { return m_sample; } | /**
* Gets the sample as an array of rows
*
* @return the sampled rows
*/ | Gets the sample as an array of rows | getSample | {
"repo_name": "panbasten/imeta",
"path": "imeta2.x/imeta-src/imeta/src/main/java/com/panet/imeta/trans/steps/reservoirsampling/ReservoirSamplingData.java",
"license": "gpl-2.0",
"size": 5081
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,855,365 |
static Collection<RuleProduction> getRules(Category left, Category right, Collection<Combinator> rules) {
Collection<RuleProduction> result = new ArrayList<RuleProduction>(2);
for (Combinator c : rules) {
if (c.canApply(left, right)) {
result.add(new RuleProduction(c.ruleType, c.apply(left, right), c.headIsLeft(left, right)));
}
}
return result;
}
private static class Conjunction extends Combinator {
private Conjunction()
{
super(RuleType.CONJ);
} | static Collection<RuleProduction> getRules(Category left, Category right, Collection<Combinator> rules) { Collection<RuleProduction> result = new ArrayList<RuleProduction>(2); for (Combinator c : rules) { if (c.canApply(left, right)) { result.add(new RuleProduction(c.ruleType, c.apply(left, right), c.headIsLeft(left, right))); } } return result; } private static class Conjunction extends Combinator { private Conjunction() { super(RuleType.CONJ); } | /**
* Returns a set of rules that can be applied to a pair of categories.
*/ | Returns a set of rules that can be applied to a pair of categories | getRules | {
"repo_name": "mikelewis0/easyccg",
"path": "src/uk/ac/ed/easyccg/syntax/Combinator.java",
"license": "mit",
"size": 13842
} | [
"java.util.ArrayList",
"java.util.Collection"
] | import java.util.ArrayList; import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 949,750 |
public void setObjectives(List<SeqObjective> iObjs) {
if (_Debug) {
System.out.println(" :: SeqActivity --> BEGIN - " + "setObjectives");
if (iObjs != null) {
System.out.println(" ::--> " + iObjs.size());
} else {
System.out.println(" ::--> NULL");
}
}
mObjectives = iObjs;
if (iObjs != null) {
for (int i = 0; i < iObjs.size(); i++) {
SeqObjective obj = iObjs.get(i);
if (obj.mMaps != null) {
if (mObjMaps == null) {
mObjMaps = new Hashtable<String, List<SeqObjectiveMap>>();
}
mObjMaps.put(obj.mObjID, obj.mMaps);
}
}
}
if (_Debug) {
System.out.println(" :: SeqActivity --> END - " + "setObjectives");
}
} | void function(List<SeqObjective> iObjs) { if (_Debug) { System.out.println(STR + STR); if (iObjs != null) { System.out.println(STR + iObjs.size()); } else { System.out.println(STR); } } mObjectives = iObjs; if (iObjs != null) { for (int i = 0; i < iObjs.size(); i++) { SeqObjective obj = iObjs.get(i); if (obj.mMaps != null) { if (mObjMaps == null) { mObjMaps = new Hashtable<String, List<SeqObjectiveMap>>(); } mObjMaps.put(obj.mObjID, obj.mMaps); } } } if (_Debug) { System.out.println(STR + STR); } } | /**
* Sets the value of the Objectives Resource Sequencing Definition
* Model Elements (<b>elements 6 and 7</b>) for this activity.
*
* @param iObjs The set (<code>List</code> of <code>SeqObjective</code>)
* of objectives(s) associated with this activity.
*
*/ | Sets the value of the Objectives Resource Sequencing Definition Model Elements (elements 6 and 7) for this activity | setObjectives | {
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "scorm/scorm-api/src/java/org/adl/sequencer/SeqActivity.java",
"license": "apache-2.0",
"size": 140433
} | [
"java.util.Hashtable",
"java.util.List"
] | import java.util.Hashtable; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,381,973 |
public void test() throws FormatException {
byte[] testdata = new byte[50000];
Random r = new Random();
LOGGER.info("Testing {}", this.getClass().getName());
LOGGER.info("Generating random data");
r.nextBytes(testdata);
LOGGER.info("Compressing data");
byte[] compressed = compress(testdata, null);
LOGGER.info("Compressed size: {}", compressed.length);
LOGGER.info("Decompressing data");
byte[] decompressed = decompress(compressed);
LOGGER.info("Comparing data...");
if (testdata.length != decompressed.length) {
LOGGER.info("Test data differs in length from uncompressed data");
LOGGER.info("Exiting...");
System.exit(-1);
}
else {
boolean equalsFlag = true;
for (int i = 0; i < testdata.length; i++) {
if (testdata[i] != decompressed[i]) {
LOGGER.info("Test data and uncompressed data differ at byte {}", i);
equalsFlag = false;
}
}
if (!equalsFlag) {
LOGGER.info("Comparison failed. Exiting...");
System.exit(-1);
}
}
LOGGER.info("Success.");
LOGGER.info("Generating 2D byte array test");
byte[][] twoDtest = new byte[100][500];
for (int i = 0; i < 100; i++) {
System.arraycopy(testdata, 500*i, twoDtest[i], 0, 500);
}
byte[] twoDcompressed = compress(twoDtest, null);
LOGGER.info("Comparing compressed data...");
if (twoDcompressed.length != compressed.length) {
LOGGER.info("1D and 2D compressed data not same length");
LOGGER.info("Exiting...");
System.exit(-1);
}
boolean equalsFlag = true;
for (int i = 0; i < twoDcompressed.length; i++) {
if (twoDcompressed[i] != compressed[i]) {
LOGGER.info("1D data and 2D compressed data differs at byte {}", i);
equalsFlag = false;
}
if (!equalsFlag) {
LOGGER.info("Comparison failed. Exiting...");
System.exit(-1);
}
}
LOGGER.info("Success.");
LOGGER.info("Test complete.");
}
// -- Codec API methods -- | void function() throws FormatException { byte[] testdata = new byte[50000]; Random r = new Random(); LOGGER.info(STR, this.getClass().getName()); LOGGER.info(STR); r.nextBytes(testdata); LOGGER.info(STR); byte[] compressed = compress(testdata, null); LOGGER.info(STR, compressed.length); LOGGER.info(STR); byte[] decompressed = decompress(compressed); LOGGER.info(STR); if (testdata.length != decompressed.length) { LOGGER.info(STR); LOGGER.info(STR); System.exit(-1); } else { boolean equalsFlag = true; for (int i = 0; i < testdata.length; i++) { if (testdata[i] != decompressed[i]) { LOGGER.info(STR, i); equalsFlag = false; } } if (!equalsFlag) { LOGGER.info(STR); System.exit(-1); } } LOGGER.info(STR); LOGGER.info(STR); byte[][] twoDtest = new byte[100][500]; for (int i = 0; i < 100; i++) { System.arraycopy(testdata, 500*i, twoDtest[i], 0, 500); } byte[] twoDcompressed = compress(twoDtest, null); LOGGER.info(STR); if (twoDcompressed.length != compressed.length) { LOGGER.info(STR); LOGGER.info(STR); System.exit(-1); } boolean equalsFlag = true; for (int i = 0; i < twoDcompressed.length; i++) { if (twoDcompressed[i] != compressed[i]) { LOGGER.info(STR, i); equalsFlag = false; } if (!equalsFlag) { LOGGER.info(STR); System.exit(-1); } } LOGGER.info(STR); LOGGER.info(STR); } | /**
* Main testing method default implementation.
*
* This method tests whether the data is the same after compressing and
* decompressing, as well as doing a basic test of the 2D methods.
*
* @throws FormatException Can only occur if there is a bug in the
* compress method.
*/ | Main testing method default implementation. This method tests whether the data is the same after compressing and decompressing, as well as doing a basic test of the 2D methods | test | {
"repo_name": "ctrueden/bioformats",
"path": "components/formats-bsd/src/loci/formats/codec/BaseCodec.java",
"license": "gpl-2.0",
"size": 7829
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 1,337,848 |
@Override
public Event next() throws IOException {
try {
while (!done) {
// This blocks on the synchronized queue until a new event arrives.
Event e = sync.poll(100, TimeUnit.MILLISECONDS);
if (e == null)
continue; // nothing there, retry.
updateEventProcessingStats(e);
return e;
}
return null; // closed
} catch (InterruptedException e1) {
LOG.warn("next unexpectedly interrupted :" + e1.getMessage(), e1);
Thread.currentThread().interrupt();
throw new IOException(e1.getMessage());
}
} | Event function() throws IOException { try { while (!done) { Event e = sync.poll(100, TimeUnit.MILLISECONDS); if (e == null) continue; updateEventProcessingStats(e); return e; } return null; } catch (InterruptedException e1) { LOG.warn(STR + e1.getMessage(), e1); Thread.currentThread().interrupt(); throw new IOException(e1.getMessage()); } } | /**
* This function will block when the end of all the files it is trying to tail
* is reached.
*/ | This function will block when the end of all the files it is trying to tail is reached | next | {
"repo_name": "yongkun/flume-0.9.3-cdh3u0-rakuten",
"path": "src/java/com/cloudera/flume/handlers/text/TailSource.java",
"license": "apache-2.0",
"size": 21608
} | [
"com.cloudera.flume.core.Event",
"java.io.IOException",
"java.util.concurrent.TimeUnit"
] | import com.cloudera.flume.core.Event; import java.io.IOException; import java.util.concurrent.TimeUnit; | import com.cloudera.flume.core.*; import java.io.*; import java.util.concurrent.*; | [
"com.cloudera.flume",
"java.io",
"java.util"
] | com.cloudera.flume; java.io; java.util; | 1,906,447 |
private List search(String attributeNames[], String attributeValue,
String[] attrs) throws StoreException
{
String filter = null;
if (attributeNames == null)
{
filter = null;
}
else
{
filter = "";
if (attributeValue.equals("**"))
{
attributeValue = "*";
}
for (int i = 0; i < attributeNames.length; i++)
{
filter += "(" + attributeNames[i] + "=" + attributeValue + ")";
}
filter = "(|" + filter + ")";
}
String filter2 = "";
for (int i = 0; i < attrs.length; i++)
{
filter2 += "(" + attrs[i] + "=*)";
}
filter2 = "(|" + filter2 + ")";
String filter3 = "(&" + filter + "" + filter2 + ")";
if (filter == null)
{
filter3 = filter2;
}
List list;
list = getFromCache(filter3);
if (list != null)
{
return list;
}
DirContext ctx = null;
list = new ArrayList();
try
{
ctx = connectLDAP();
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
constraints.setCountLimit(0);
constraints.setReturningAttributes(attrs);
NamingEnumeration results = ctx.search(params.getBaseDN(), filter3,
constraints);
while (results.hasMoreElements())
{
SearchResult sr = (SearchResult)results.next();
NamingEnumeration enumeration = ((Attribute)(sr
.getAttributes().getAll().next())).getAll();
while (enumeration.hasMore())
{
list.add(enumeration.next());
}
}
addToCache(filter3, list);
}
catch (NamingException e)
{
// skip exception, unfortunately if an attribute type is not
// supported an exception is thrown
}
finally
{
try
{
if (null != ctx)
{
ctx.close();
}
}
catch (Exception e)
{
}
}
return list;
} | List function(String attributeNames[], String attributeValue, String[] attrs) throws StoreException { String filter = null; if (attributeNames == null) { filter = null; } else { filter = STR**STR*STR(STR=STR)STR( STR)STRSTR(STR=*)STR( STR)STR(&STRSTR)"; if (filter == null) { filter3 = filter2; } List list; list = getFromCache(filter3); if (list != null) { return list; } DirContext ctx = null; list = new ArrayList(); try { ctx = connectLDAP(); SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setCountLimit(0); constraints.setReturningAttributes(attrs); NamingEnumeration results = ctx.search(params.getBaseDN(), filter3, constraints); while (results.hasMoreElements()) { SearchResult sr = (SearchResult)results.next(); NamingEnumeration enumeration = ((Attribute)(sr .getAttributes().getAll().next())).getAll(); while (enumeration.hasMore()) { list.add(enumeration.next()); } } addToCache(filter3, list); } catch (NamingException e) { } finally { try { if (null != ctx) { ctx.close(); } } catch (Exception e) { } } return list; } | /**
* Returns a <code>List</code> of encodings of the certificates, attribute
* certificates, CRL or certificate pairs.
*
* @param attributeNames The attribute names to look for in the LDAP.
* @param attributeValue The value the attribute name must have.
* @param attrs The attributes in the LDAP which hold the certificate,
* attribute certificate, certificate pair or CRL in a found
* entry.
* @return A <code>List</code> of byte arrays with the encodings.
* @throws StoreException if an error occurs getting the results from the LDAP
* directory.
*/ | Returns a <code>List</code> of encodings of the certificates, attribute certificates, CRL or certificate pairs | search | {
"repo_name": "Skywalker-11/spongycastle",
"path": "prov/src/main/jdk1.4/org/spongycastle/x509/util/LDAPStoreHelper.java",
"license": "mit",
"size": 40077
} | [
"java.util.ArrayList",
"java.util.List",
"javax.naming.NamingEnumeration",
"javax.naming.NamingException",
"javax.naming.directory.Attribute",
"javax.naming.directory.DirContext",
"javax.naming.directory.SearchControls",
"javax.naming.directory.SearchResult",
"org.spongycastle.util.StoreException"
] | import java.util.ArrayList; import java.util.List; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.DirContext; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; import org.spongycastle.util.StoreException; | import java.util.*; import javax.naming.*; import javax.naming.directory.*; import org.spongycastle.util.*; | [
"java.util",
"javax.naming",
"org.spongycastle.util"
] | java.util; javax.naming; org.spongycastle.util; | 529,458 |
private synchronized void writeObject(ObjectOutputStream s)
throws IOException
{
s.defaultWriteObject();
} | synchronized void function(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); } | /**
* Writes the permissions list.
*/ | Writes the permissions list | writeObject | {
"repo_name": "apache/river",
"path": "src/net/jini/security/GrantPermission.java",
"license": "apache-2.0",
"size": 27762
} | [
"java.io.IOException",
"java.io.ObjectOutputStream"
] | import java.io.IOException; import java.io.ObjectOutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 399,575 |
public void fireNotifyChanged(Notification notification) {
changeNotifier.fireNotifyChanged(notification);
if (parentAdapterFactory != null) {
parentAdapterFactory.fireNotifyChanged(notification);
}
} | void function(Notification notification) { changeNotifier.fireNotifyChanged(notification); if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(notification); } } | /**
* This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This delegates to <code>#changeNotifier</code> and to <code>#parentAdapterFactory</code>. | fireNotifyChanged | {
"repo_name": "FraunhoferESK/ernest-eclipse-integration",
"path": "de.fraunhofer.esk.ernest.core.analysismodel.edit/src/ernest/timingspecification/provider/TimingspecificationItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 12504
} | [
"org.eclipse.emf.common.notify.Notification"
] | import org.eclipse.emf.common.notify.Notification; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,614,421 |
private static boolean isBetterCandidate(
@FocusRealDirection int direction, @NonNull Rect source,
@NonNull Rect candidate, @NonNull Rect currentBest) {
// To be a better candidate, need to at least be a candidate in the
// first place. :)
if (!isCandidate(source, candidate, direction)) {
return false;
}
// We know that candidateRect is a candidate. If currentBest is not
// a candidate, candidateRect is better.
if (!isCandidate(source, currentBest, direction)) {
return true;
}
// If candidateRect is better by beam, it wins.
if (beamBeats(direction, source, candidate, currentBest)) {
return true;
}
// If currentBest is better, then candidateRect cant' be. :)
if (beamBeats(direction, source, currentBest, candidate)) {
return false;
}
// Otherwise, do fudge-tastic comparison of the major and minor
// axis.
final int candidateDist = getWeightedDistanceFor(
majorAxisDistance(direction, source, candidate),
minorAxisDistance(direction, source, candidate));
final int currentBestDist = getWeightedDistanceFor(
majorAxisDistance(direction, source, currentBest),
minorAxisDistance(direction, source, currentBest));
return candidateDist < currentBestDist;
} | static boolean function( @FocusRealDirection int direction, @NonNull Rect source, @NonNull Rect candidate, @NonNull Rect currentBest) { if (!isCandidate(source, candidate, direction)) { return false; } if (!isCandidate(source, currentBest, direction)) { return true; } if (beamBeats(direction, source, candidate, currentBest)) { return true; } if (beamBeats(direction, source, currentBest, candidate)) { return false; } final int candidateDist = getWeightedDistanceFor( majorAxisDistance(direction, source, candidate), minorAxisDistance(direction, source, candidate)); final int currentBestDist = getWeightedDistanceFor( majorAxisDistance(direction, source, currentBest), minorAxisDistance(direction, source, currentBest)); return candidateDist < currentBestDist; } | /**
* Is candidate a better candidate than currentBest for a focus search
* in a particular direction from a source rect? This is the core
* routine that determines the order of focus searching.
*
* @param direction the direction (up, down, left, right)
* @param source the source from which we are searching
* @param candidate the candidate rectangle
* @param currentBest the current best rectangle
* @return {@code true} if the candidate rectangle is a better than the
* current best rectangle, {@code false} otherwise
*/ | Is candidate a better candidate than currentBest for a focus search in a particular direction from a source rect? This is the core routine that determines the order of focus searching | isBetterCandidate | {
"repo_name": "AndroidX/androidx",
"path": "customview/customview/src/main/java/androidx/customview/widget/FocusStrategy.java",
"license": "apache-2.0",
"size": 18454
} | [
"android.graphics.Rect",
"androidx.annotation.NonNull",
"androidx.core.view.ViewCompat"
] | import android.graphics.Rect; import androidx.annotation.NonNull; import androidx.core.view.ViewCompat; | import android.graphics.*; import androidx.annotation.*; import androidx.core.view.*; | [
"android.graphics",
"androidx.annotation",
"androidx.core"
] | android.graphics; androidx.annotation; androidx.core; | 1,144,728 |
public void setInput(Object input) {
Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput);
if (input instanceof String) {
setInformation((String)input);
return;
}
fInput= (BrowserInformationControlInput)input;
String content= null;
if (fInput != null)
content= fInput.getHtml();
fBrowserHasContent= content != null && content.length() > 0;
if (!fBrowserHasContent)
content= "<html><body ></html>"; //$NON-NLS-1$
boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
boolean resizable= isResizable();
// The default "overflow:auto" would not result in a predictable width for the client area
// and the re-wrapping would cause visual noise
String[] styles= null;
if (RTL && resizable)
styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else if (RTL && !resizable)
styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else if (!resizable)
//XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken words :-(see e.g. Javadoc of String).
// Re-check whether we really still need this now that the Javadoc Hover header already sets this style.
styles= new String[] { "overflow:hidden;"}; //$NON-NLS-1$
else
styles= new String[] { "overflow:scroll;" }; //$NON-NLS-1$
StringBuffer buffer= new StringBuffer(content);
HTMLPrinter.insertStyles(buffer, styles);
content= buffer.toString();
fCompleted= false;
fBrowser.setText(content);
Object[] listeners= fInputChangeListeners.getListeners();
for (int i= 0; i < listeners.length; i++)
((IInputChangedListener)listeners[i]).inputChanged(fInput);
} | void function(Object input) { Assert.isLegal(input == null input instanceof String input instanceof BrowserInformationControlInput); if (input instanceof String) { setInformation((String)input); return; } fInput= (BrowserInformationControlInput)input; String content= null; if (fInput != null) content= fInput.getHtml(); fBrowserHasContent= content != null && content.length() > 0; if (!fBrowserHasContent) content= STR; boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; boolean resizable= isResizable(); String[] styles= null; if (RTL && resizable) styles= new String[] { STR, STR, STR }; else if (RTL && !resizable) styles= new String[] { STR, STR, STR }; else if (!resizable) styles= new String[] { STR}; else styles= new String[] { STR }; StringBuffer buffer= new StringBuffer(content); HTMLPrinter.insertStyles(buffer, styles); content= buffer.toString(); fCompleted= false; fBrowser.setText(content); Object[] listeners= fInputChangeListeners.getListeners(); for (int i= 0; i < listeners.length; i++) ((IInputChangedListener)listeners[i]).inputChanged(fInput); } | /**
* {@inheritDoc} This control can handle {@link String} and
* {@link BrowserInformationControlInput}.
*/ | This control can handle <code>String</code> and <code>BrowserInformationControlInput</code> | setInput | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jface.text_3.8.1.v20120828-155502/src/org/eclipse/jface/internal/text/html/BrowserInformationControl.java",
"license": "mit",
"size": 18797
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.jface.text.IInputChangedListener"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.IInputChangedListener; | import org.eclipse.core.runtime.*; import org.eclipse.jface.text.*; | [
"org.eclipse.core",
"org.eclipse.jface"
] | org.eclipse.core; org.eclipse.jface; | 1,537,090 |
public List queryByOwnerLimitAccess(final Identity identity, final int limitAccess) {
final String query = "select v from" + " org.olat.repository.RepositoryEntry v inner join fetch v.olatResource as res,"
+ " org.olat.basesecurity.SecurityGroupMembershipImpl as sgmsi" + " where" + " v.ownerGroup = sgmsi.securityGroup "
+ " and sgmsi.identity = :identity and v.access >= :limitAccess";
final DBQuery dbquery = DBFactory.getInstance().createQuery(query);
dbquery.setEntity("identity", identity);
dbquery.setInteger("limitAccess", limitAccess);
return dbquery.list();
} | List function(final Identity identity, final int limitAccess) { final String query = STR + STR + STR + STR + STR + STR; final DBQuery dbquery = DBFactory.getInstance().createQuery(query); dbquery.setEntity(STR, identity); dbquery.setInteger(STR, limitAccess); return dbquery.list(); } | /**
* Query by ownership, limit by access.
*
* @param identity
* @param limitAccess
* @return Results
*/ | Query by ownership, limit by access | queryByOwnerLimitAccess | {
"repo_name": "RLDevOps/Demo",
"path": "src/main/java/org/olat/repository/RepositoryManager.java",
"license": "apache-2.0",
"size": 42875
} | [
"java.util.List",
"org.olat.core.commons.persistence.DBFactory",
"org.olat.core.commons.persistence.DBQuery",
"org.olat.core.id.Identity"
] | import java.util.List; import org.olat.core.commons.persistence.DBFactory; import org.olat.core.commons.persistence.DBQuery; import org.olat.core.id.Identity; | import java.util.*; import org.olat.core.commons.persistence.*; import org.olat.core.id.*; | [
"java.util",
"org.olat.core"
] | java.util; org.olat.core; | 1,415,846 |
private BlazeCommandResult reportConfigurationIds(
ConfigCommandOutputFormatter writer,
ImmutableSortedSet<ConfigurationForOutput> configurations) {
writer.writeConfigurationIDs(
configurations.stream().map(config -> config.configHash).collect(toList()));
return BlazeCommandResult.success();
} | BlazeCommandResult function( ConfigCommandOutputFormatter writer, ImmutableSortedSet<ConfigurationForOutput> configurations) { writer.writeConfigurationIDs( configurations.stream().map(config -> config.configHash).collect(toList())); return BlazeCommandResult.success(); } | /**
* Reports the result of <code>blaze config</code> and returns the appropriate command exit code.
*/ | Reports the result of <code>blaze config</code> and returns the appropriate command exit code | reportConfigurationIds | {
"repo_name": "ulfjack/bazel",
"path": "src/main/java/com/google/devtools/build/lib/runtime/commands/ConfigCommand.java",
"license": "apache-2.0",
"size": 27744
} | [
"com.google.common.collect.ImmutableSortedSet",
"com.google.devtools.build.lib.runtime.BlazeCommandResult"
] | import com.google.common.collect.ImmutableSortedSet; import com.google.devtools.build.lib.runtime.BlazeCommandResult; | import com.google.common.collect.*; import com.google.devtools.build.lib.runtime.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 6,788 |
@SuppressWarnings("unchecked")
protected Map<String, CostElement> loadCostElements() {
Collection<CostElement> costElements = (Collection<CostElement>) getBusinessObjectService().findAll(CostElement.class);
Map<String, CostElement> costElementsMappedToCostElementCode = new TreeMap<String, CostElement>();
for(CostElement costElement: costElements) {
costElementsMappedToCostElementCode.put(costElement.getCostElement(), costElement);
}
return costElementsMappedToCostElementCode;
} | @SuppressWarnings(STR) Map<String, CostElement> function() { Collection<CostElement> costElements = (Collection<CostElement>) getBusinessObjectService().findAll(CostElement.class); Map<String, CostElement> costElementsMappedToCostElementCode = new TreeMap<String, CostElement>(); for(CostElement costElement: costElements) { costElementsMappedToCostElementCode.put(costElement.getCostElement(), costElement); } return costElementsMappedToCostElementCode; } | /**
* This method loads Cost Elements, mapping them to their cost element code
* @return
*/ | This method loads Cost Elements, mapping them to their cost element code | loadCostElements | {
"repo_name": "blackcathacker/kc.preclean",
"path": "coeus-code/src/main/java/org/kuali/coeus/common/budget/impl/nonpersonnel/BudgetJustificationServiceImpl.java",
"license": "apache-2.0",
"size": 8262
} | [
"java.util.Collection",
"java.util.Map",
"java.util.TreeMap",
"org.kuali.coeus.common.budget.framework.core.CostElement"
] | import java.util.Collection; import java.util.Map; import java.util.TreeMap; import org.kuali.coeus.common.budget.framework.core.CostElement; | import java.util.*; import org.kuali.coeus.common.budget.framework.core.*; | [
"java.util",
"org.kuali.coeus"
] | java.util; org.kuali.coeus; | 547,544 |
public void setOffsetRepository(StateRepository<String, String> offsetRepository) {
this.offsetRepository = offsetRepository;
} | void function(StateRepository<String, String> offsetRepository) { this.offsetRepository = offsetRepository; } | /**
* The offset repository to use in order to locally store the offset of each partition of the topic.
* Defining one will disable the autocommit.
*/ | The offset repository to use in order to locally store the offset of each partition of the topic. Defining one will disable the autocommit | setOffsetRepository | {
"repo_name": "NickCis/camel",
"path": "components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java",
"license": "apache-2.0",
"size": 60336
} | [
"org.apache.camel.spi.StateRepository"
] | import org.apache.camel.spi.StateRepository; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,212,818 |
private FileSystem getFileSystem() throws IOException {
return FileSystem.get(filePath.toUri());
}
// ------------------------------------------------------------------------ | FileSystem function() throws IOException { return FileSystem.get(filePath.toUri()); } | /**
* Gets the file system that stores the file state.
*
* @return The file system that stores the file state.
* @throws IOException Thrown if the file system cannot be accessed.
*/ | Gets the file system that stores the file state | getFileSystem | {
"repo_name": "bowenli86/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java",
"license": "apache-2.0",
"size": 3674
} | [
"java.io.IOException",
"org.apache.flink.core.fs.FileSystem"
] | import java.io.IOException; import org.apache.flink.core.fs.FileSystem; | import java.io.*; import org.apache.flink.core.fs.*; | [
"java.io",
"org.apache.flink"
] | java.io; org.apache.flink; | 385,620 |
public SelectorBuilder greaterThan(EntityField field, long propertyValue) {
return this.greaterThan(field.name(), propertyValue);
} | SelectorBuilder function(EntityField field, long propertyValue) { return this.greaterThan(field.name(), propertyValue); } | /**
* Adds the predicate <b>greater than</b> to the selector for the given field and value.
*
* @param propertyValue the property value as a String independently of the field type. The caller
* should take care of the formatting if it is necessary
*/ | Adds the predicate greater than to the selector for the given field and value | greaterThan | {
"repo_name": "gawkermedia/googleads-java-lib",
"path": "modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/utils/v201509/SelectorBuilder.java",
"license": "apache-2.0",
"size": 24189
} | [
"com.google.api.ads.adwords.lib.selectorfields.EntityField"
] | import com.google.api.ads.adwords.lib.selectorfields.EntityField; | import com.google.api.ads.adwords.lib.selectorfields.*; | [
"com.google.api"
] | com.google.api; | 1,027,895 |
boolean updateStudent(Student student); | boolean updateStudent(Student student); | /**
* Updates existing Student with the newer information.
*
* @param student Student with the newer information
* @return true if succeeds, false otherwise
*/ | Updates existing Student with the newer information | updateStudent | {
"repo_name": "mpanibrat/mentoring",
"path": "src/com/panibrat/university/dao/StudentManager.java",
"license": "mit",
"size": 1070
} | [
"com.panibrat.university.entity.Student"
] | import com.panibrat.university.entity.Student; | import com.panibrat.university.entity.*; | [
"com.panibrat.university"
] | com.panibrat.university; | 2,823,159 |
@After
public void removeNode() throws BackingStoreException {
Preferences.userNodeForPackage(this.getClass()).removeNode();
} | void function() throws BackingStoreException { Preferences.userNodeForPackage(this.getClass()).removeNode(); } | /**
* Clean the preferences after testing.
*
* @throws BackingStoreException
*/ | Clean the preferences after testing | removeNode | {
"repo_name": "paxel/janusdixie",
"path": "janus-dixie-persistence-preferences/src/test/java/org/afk/jadi/impl/persist/prefs/JaDiPreferencePersistenceTest.java",
"license": "mit",
"size": 3052
} | [
"java.util.prefs.BackingStoreException",
"java.util.prefs.Preferences"
] | import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; | import java.util.prefs.*; | [
"java.util"
] | java.util; | 890,346 |
private void handleFirstSubframe(byte prn, byte[] rawData) {
int iodc = extractBits(IODC1_INDEX, IODC1_LENGTH, rawData) << 8;
iodc |= extractBits(IODC2_INDEX, IODC2_LENGTH, rawData);
IntermediateEphemeris intermediateEphemeris =
findIntermediateEphemerisToUpdate(prn, SUBFRAME_1, iodc);
if (intermediateEphemeris == null) {
// we are up-to-date
return;
}
GpsEphemerisProto gpsEphemerisProto = intermediateEphemeris.getEphemerisObj();
gpsEphemerisProto.iodc = iodc;
// the navigation message contains a modulo-1023 week number
int week = extractBits(WEEK_INDEX, WEEK_LENGTH, rawData);
week = getGpsWeekWithRollover(week);
gpsEphemerisProto.week = week;
int uraIndex = extractBits(URA_INDEX, URA_LENGTH, rawData);
double svAccuracy = computeNominalSvAccuracy(uraIndex);
gpsEphemerisProto.svAccuracyM = svAccuracy;
int svHealth = extractBits(SV_HEALTH_INDEX, SV_HEALTH_LENGTH, rawData);
gpsEphemerisProto.svHealth = svHealth;
byte tgd = (byte) extractBits(TGD_INDEX, TGD_LENGTH, rawData);
gpsEphemerisProto.tgd = tgd * POW_2_NEG_31;
int toc = extractBits(TOC_INDEX, TOC_LENGTH, rawData);
double tocScaled = toc * POW_2_4;
gpsEphemerisProto.toc = tocScaled;
byte af2 = (byte) extractBits(AF2_INDEX, AF2_LENGTH, rawData);
gpsEphemerisProto.af2 = af2 * POW_2_NEG_55;
short af1 = (short) extractBits(AF1_INDEX, AF1_LENGTH, rawData);
gpsEphemerisProto.af1 = af1 * POW_2_NEG_43;
// a 22-bit two's complement number
int af0 = extractBits(AF0_INDEX, AF0_LENGTH, rawData);
af0 = getTwoComplement(af0, AF0_LENGTH);
gpsEphemerisProto.af0 = af0 * POW_2_NEG_31;
updateDecodedState(prn, SUBFRAME_1, intermediateEphemeris);
} | void function(byte prn, byte[] rawData) { int iodc = extractBits(IODC1_INDEX, IODC1_LENGTH, rawData) << 8; iodc = extractBits(IODC2_INDEX, IODC2_LENGTH, rawData); IntermediateEphemeris intermediateEphemeris = findIntermediateEphemerisToUpdate(prn, SUBFRAME_1, iodc); if (intermediateEphemeris == null) { return; } GpsEphemerisProto gpsEphemerisProto = intermediateEphemeris.getEphemerisObj(); gpsEphemerisProto.iodc = iodc; int week = extractBits(WEEK_INDEX, WEEK_LENGTH, rawData); week = getGpsWeekWithRollover(week); gpsEphemerisProto.week = week; int uraIndex = extractBits(URA_INDEX, URA_LENGTH, rawData); double svAccuracy = computeNominalSvAccuracy(uraIndex); gpsEphemerisProto.svAccuracyM = svAccuracy; int svHealth = extractBits(SV_HEALTH_INDEX, SV_HEALTH_LENGTH, rawData); gpsEphemerisProto.svHealth = svHealth; byte tgd = (byte) extractBits(TGD_INDEX, TGD_LENGTH, rawData); gpsEphemerisProto.tgd = tgd * POW_2_NEG_31; int toc = extractBits(TOC_INDEX, TOC_LENGTH, rawData); double tocScaled = toc * POW_2_4; gpsEphemerisProto.toc = tocScaled; byte af2 = (byte) extractBits(AF2_INDEX, AF2_LENGTH, rawData); gpsEphemerisProto.af2 = af2 * POW_2_NEG_55; short af1 = (short) extractBits(AF1_INDEX, AF1_LENGTH, rawData); gpsEphemerisProto.af1 = af1 * POW_2_NEG_43; int af0 = extractBits(AF0_INDEX, AF0_LENGTH, rawData); af0 = getTwoComplement(af0, AF0_LENGTH); gpsEphemerisProto.af0 = af0 * POW_2_NEG_31; updateDecodedState(prn, SUBFRAME_1, intermediateEphemeris); } | /**
* Handles the first navigation message subframe which contains satellite clock correction
* parameters, GPS date (week number) plus satellite status and health.
*/ | Handles the first navigation message subframe which contains satellite clock correction parameters, GPS date (week number) plus satellite status and health | handleFirstSubframe | {
"repo_name": "google/gps-measurement-tools",
"path": "GNSSLogger/pseudorange/src/main/java/com/google/location/lbs/gnss/gps/pseudorange/GpsNavigationMessageStore.java",
"license": "apache-2.0",
"size": 29026
} | [
"android.location.cts.nano.Ephemeris"
] | import android.location.cts.nano.Ephemeris; | import android.location.cts.nano.*; | [
"android.location"
] | android.location; | 2,078,732 |
@Test
public void lentedVolumeIsReturnedWhenClosingTheConnection() throws Exception {
when(client.readMessage())
.thenThrow(new LoopThroughCommunicationException(new ExemplaryFatalCommunicationException()))
.thenThrow(
new LoopThroughIllegalStateException(new IllegalStateException("test exception")))
.thenThrow(new RuntimeException("some exception"));
startCutSwallowExpectedExceptions();
startCutSwallowExpectedExceptions();
startCutSwallowExpectedExceptions();
verify(releasableMoneyManagement, times(3)).realeaseAllAquieredVolume();
} | void function() throws Exception { when(client.readMessage()) .thenThrow(new LoopThroughCommunicationException(new ExemplaryFatalCommunicationException())) .thenThrow( new LoopThroughIllegalStateException(new IllegalStateException(STR))) .thenThrow(new RuntimeException(STR)); startCutSwallowExpectedExceptions(); startCutSwallowExpectedExceptions(); startCutSwallowExpectedExceptions(); verify(releasableMoneyManagement, times(3)).realeaseAllAquieredVolume(); } | /**
* All volume that was lent from the {@link MoneyManagement} is returned when the connection closes expectedly or
* unexpectedly.
*
* @throws Exception
* not expected to leave the test.
*/ | All volume that was lent from the <code>MoneyManagement</code> is returned when the connection closes expectedly or unexpectedly | lentedVolumeIsReturnedWhenClosingTheConnection | {
"repo_name": "rbi/trading4j",
"path": "server/src/test/java/de/voidnode/trading4j/server/protocol/expertadvisor/ExpertAdvisorProtocolTest.java",
"license": "gpl-3.0",
"size": 10224
} | [
"org.mockito.Mockito"
] | import org.mockito.Mockito; | import org.mockito.*; | [
"org.mockito"
] | org.mockito; | 1,520,627 |
public int ioctl(int req, @NonNull IntByReference info) throws LastErrorException {
return libc.ioctl(fd, req, info.getPointer());
} | int function(int req, @NonNull IntByReference info) throws LastErrorException { return libc.ioctl(fd, req, info.getPointer()); } | /**
* Perform a Linux style ioctl operation on the associated file.
*
* @param req ioctl operation to be performed
* @param info output as integer
* @return Linux style ioctl return
* @throws LastErrorException when operations fails
*/ | Perform a Linux style ioctl operation on the associated file | ioctl | {
"repo_name": "jabrena/ev3dev-lang-java",
"path": "src/main/java/ev3dev/utils/io/NativeFile.java",
"license": "mit",
"size": 9209
} | [
"com.sun.jna.LastErrorException",
"com.sun.jna.ptr.IntByReference"
] | import com.sun.jna.LastErrorException; import com.sun.jna.ptr.IntByReference; | import com.sun.jna.*; import com.sun.jna.ptr.*; | [
"com.sun.jna"
] | com.sun.jna; | 2,500,235 |
public void set(int index, String value) throws IOException {
Writer writer = null;
try {
writer = new OutputStreamWriter(newOutputStream(index), Util.UTF_8);
writer.write(value);
} finally {
Util.closeQuietly(writer);
}
} | void function(int index, String value) throws IOException { Writer writer = null; try { writer = new OutputStreamWriter(newOutputStream(index), Util.UTF_8); writer.write(value); } finally { Util.closeQuietly(writer); } } | /**
* Sets the value at {@code index} to {@code value}.
*/ | Sets the value at index to value | set | {
"repo_name": "Yumore/YuanYuan",
"path": "Basekit/src/main/java/xyz/zimuju/basekit/utility/cache/DiskLruCache.java",
"license": "apache-2.0",
"size": 43277
} | [
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.io.Writer"
] | import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; | import java.io.*; | [
"java.io"
] | java.io; | 469,597 |
public static float[] toArrayFloat( String s, String delimiter ) {
if ( s == null ) {
return null;
}
if ( s.equals( "" ) ) {
return null;
}
StringTokenizer st = new StringTokenizer( s, delimiter );
ArrayList<String> vec = new ArrayList<String>( st.countTokens() );
for ( int i = 0; st.hasMoreTokens(); i++ ) {
String t = st.nextToken().replace( ' ', '+' );
if ( ( t != null ) && ( t.length() > 0 ) ) {
vec.add( t.trim().replace( ',', '.' ) );
}
}
float[] array = new float[vec.size()];
for ( int i = 0; i < vec.size(); i++ ) {
array[i] = Float.parseFloat( vec.get( i ) );
}
return array;
}
| static float[] function( String s, String delimiter ) { if ( s == null ) { return null; } if ( s.equals( "" ) ) { return null; } StringTokenizer st = new StringTokenizer( s, delimiter ); ArrayList<String> vec = new ArrayList<String>( st.countTokens() ); for ( int i = 0; st.hasMoreTokens(); i++ ) { String t = st.nextToken().replace( ' ', '+' ); if ( ( t != null ) && ( t.length() > 0 ) ) { vec.add( t.trim().replace( ',', '.' ) ); } } float[] array = new float[vec.size()]; for ( int i = 0; i < vec.size(); i++ ) { array[i] = Float.parseFloat( vec.get( i ) ); } return array; } | /**
* convert the array of string like [(x1,y1),(x2,y2)...] into an array of float values [x1,y1,x2,y2...]
*
* @param s
* @param delimiter
*
* @return the array representation of the given String
*/ | convert the array of string like [(x1,y1),(x2,y2)...] into an array of float values [x1,y1,x2,y2...] | toArrayFloat | {
"repo_name": "lat-lon/deegree2-base",
"path": "deegree2-core/src/main/java/org/deegree/framework/util/StringTools.java",
"license": "lgpl-2.1",
"size": 28738
} | [
"java.util.ArrayList",
"java.util.StringTokenizer"
] | import java.util.ArrayList; import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 1,545,034 |
@Override
public Number getWindDirection(int series, int item) {
List oneSeriesData = (List) this.allSeriesData.get(series);
WindDataItem windItem = (WindDataItem) oneSeriesData.get(item);
return windItem.getWindDirection();
}
| Number function(int series, int item) { List oneSeriesData = (List) this.allSeriesData.get(series); WindDataItem windItem = (WindDataItem) oneSeriesData.get(item); return windItem.getWindDirection(); } | /**
* Returns the wind direction for one item within a series. This is a
* number between 0 and 12, like the numbers on an upside-down clock face.
*
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The wind direction for the item within the series.
*/ | Returns the wind direction for one item within a series. This is a number between 0 and 12, like the numbers on an upside-down clock face | getWindDirection | {
"repo_name": "simon04/jfreechart",
"path": "src/main/java/org/jfree/data/xy/DefaultWindDataset.java",
"license": "lgpl-2.1",
"size": 14494
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,178,925 |
private Map<String, Set<String>> resolveSearchRoutingAllIndices(MetaData metaData, String routing) {
if (routing != null) {
Set<String> r = Strings.splitStringByCommaToSet(routing);
Map<String, Set<String>> routings = new HashMap<>();
String[] concreteIndices = metaData.getConcreteAllIndices();
for (String index : concreteIndices) {
routings.put(index, r);
}
return routings;
}
return null;
} | Map<String, Set<String>> function(MetaData metaData, String routing) { if (routing != null) { Set<String> r = Strings.splitStringByCommaToSet(routing); Map<String, Set<String>> routings = new HashMap<>(); String[] concreteIndices = metaData.getConcreteAllIndices(); for (String index : concreteIndices) { routings.put(index, r); } return routings; } return null; } | /**
* Sets the same routing for all indices
*/ | Sets the same routing for all indices | resolveSearchRoutingAllIndices | {
"repo_name": "cwurm/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java",
"license": "apache-2.0",
"size": 44819
} | [
"java.util.HashMap",
"java.util.Map",
"java.util.Set",
"org.elasticsearch.common.Strings"
] | import java.util.HashMap; import java.util.Map; import java.util.Set; import org.elasticsearch.common.Strings; | import java.util.*; import org.elasticsearch.common.*; | [
"java.util",
"org.elasticsearch.common"
] | java.util; org.elasticsearch.common; | 2,804,009 |
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets,
Rectangle bounds, TreePath path, int row,
boolean isExpanded, boolean hasBeenExpanded,
boolean isLeaf)
{
boolean selected = tree.isPathSelected(path);
boolean hasIcons = false;
Object node = path.getLastPathComponent();
paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded,
hasBeenExpanded, isLeaf);
TreeCellRenderer dtcr = currentCellRenderer;
boolean focused = false;
if (treeSelectionModel != null)
focused = treeSelectionModel.getLeadSelectionRow() == row
&& tree.isFocusOwner();
Component c = dtcr.getTreeCellRendererComponent(tree, node, selected,
isExpanded, isLeaf, row,
focused);
rendererPane.paintComponent(g, c, c.getParent(), bounds);
} | void function(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); TreeCellRenderer dtcr = currentCellRenderer; boolean focused = false; if (treeSelectionModel != null) focused = treeSelectionModel.getLeadSelectionRow() == row && tree.isFocusOwner(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, focused); rendererPane.paintComponent(g, c, c.getParent(), bounds); } | /**
* Paints the renderer part of a row. The receiver should NOT modify
* clipBounds, or insets.
*
* @param g - the graphics configuration
* @param clipBounds -
* @param insets -
* @param bounds - bounds of expand control
* @param path - path to draw control for
* @param row - row to draw control for
* @param isExpanded - is the row expanded
* @param hasBeenExpanded - has the row already been expanded
* @param isLeaf - is the path a leaf
*/ | Paints the renderer part of a row. The receiver should NOT modify clipBounds, or insets | paintRow | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/javax/swing/plaf/basic/BasicTreeUI.java",
"license": "gpl-2.0",
"size": 115323
} | [
"java.awt.Component",
"java.awt.Graphics",
"java.awt.Insets",
"java.awt.Rectangle",
"javax.swing.tree.TreeCellRenderer",
"javax.swing.tree.TreePath"
] | import java.awt.Component; import java.awt.Graphics; import java.awt.Insets; import java.awt.Rectangle; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreePath; | import java.awt.*; import javax.swing.tree.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 573,393 |
protected void addOutputAttribute(String label, String value) {
if (StringUtils.isNotBlank(value)) {
addOutputInfo(label, value);
}
} | void function(String label, String value) { if (StringUtils.isNotBlank(value)) { addOutputInfo(label, value); } } | /**
* Wrapper around addOutputInfo that makes sure we don't add empty values.
* @param label The attribute name.
* @param value The value of the attribute.
*/ | Wrapper around addOutputInfo that makes sure we don't add empty values | addOutputAttribute | {
"repo_name": "tomck/intermine",
"path": "intermine/web/main/src/org/intermine/webservice/server/widget/WidgetService.java",
"license": "lgpl-2.1",
"size": 5751
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,957,507 |
public Map<String, List<FileItem>> parseParameterMap(HttpServletRequest request)
throws FileUploadException {
return parseParameterMap(new ServletRequestContext(request));
} | Map<String, List<FileItem>> function(HttpServletRequest request) throws FileUploadException { return parseParameterMap(new ServletRequestContext(request)); } | /**
* Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant <code>multipart/form-data</code> stream.
*
* @param request The servlet request to be parsed.
*
* @return A map of <code>FileItem</code> instances parsed from the request.
*
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
*
* @since 1.3
*/ | Processes an RFC 1867 compliant <code>multipart/form-data</code> stream | parseParameterMap | {
"repo_name": "jenkinsci/commons-fileupload",
"path": "src/main/java/org/apache/commons/fileupload/servlet/ServletFileUpload.java",
"license": "apache-2.0",
"size": 5874
} | [
"java.util.List",
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"org.apache.commons.fileupload.FileItem",
"org.apache.commons.fileupload.FileUploadException"
] | import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; | import java.util.*; import javax.servlet.http.*; import org.apache.commons.fileupload.*; | [
"java.util",
"javax.servlet",
"org.apache.commons"
] | java.util; javax.servlet; org.apache.commons; | 1,761,456 |
@ServiceMethod(returns = ReturnType.SINGLE)
public void create(
String resourceGroupName, String clusterName, String extensionName, Extension parameters, Context context) {
createAsync(resourceGroupName, clusterName, extensionName, parameters, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) void function( String resourceGroupName, String clusterName, String extensionName, Extension parameters, Context context) { createAsync(resourceGroupName, clusterName, extensionName, parameters, context).block(); } | /**
* Creates an HDInsight cluster extension.
*
* @param resourceGroupName The name of the resource group.
* @param clusterName The name of the cluster.
* @param extensionName The name of the cluster extension.
* @param parameters The cluster extensions create request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/ | Creates an HDInsight cluster extension | create | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java",
"license": "mit",
"size": 117529
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.hdinsight.models.Extension"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.hdinsight.models.Extension; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.hdinsight.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 381,446 |
private void transformImage(int width, int height) {
if (cameraContext.getPreviewSize() == null || cameraContext.getPreviewView() == null)
return;
Matrix matrix = new Matrix();
int rotation = cameraContext.getContext().getWindowManager()
.getDefaultDisplay()
.getRotation();
RectF textureRectF = new RectF(0,
0,
width,
height);
RectF previewRectF = new RectF(0,
0,
cameraContext.getPreviewSize().getHeight(),
cameraContext.getPreviewSize().getWidth());
float centerX = textureRectF.centerX();
float centerY = textureRectF.centerY();
if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
previewRectF.offset(centerX - previewRectF.centerX(),
centerY - previewRectF.centerY());
matrix.setRectToRect(textureRectF,
previewRectF,
Matrix.ScaleToFit.FILL);
float scale = Math.max((float) width / cameraContext.getPreviewSize().getWidth(),
(float) height / cameraContext.getPreviewSize().getHeight());
matrix.postScale(scale,
scale,
centerX,
centerY);
matrix.postRotate(90 * (rotation - 2),
centerX,
centerY);
}
cameraContext.getPreviewView().setTransform(matrix);
} | void function(int width, int height) { if (cameraContext.getPreviewSize() == null cameraContext.getPreviewView() == null) return; Matrix matrix = new Matrix(); int rotation = cameraContext.getContext().getWindowManager() .getDefaultDisplay() .getRotation(); RectF textureRectF = new RectF(0, 0, width, height); RectF previewRectF = new RectF(0, 0, cameraContext.getPreviewSize().getHeight(), cameraContext.getPreviewSize().getWidth()); float centerX = textureRectF.centerX(); float centerY = textureRectF.centerY(); if (rotation == Surface.ROTATION_90 rotation == Surface.ROTATION_270) { previewRectF.offset(centerX - previewRectF.centerX(), centerY - previewRectF.centerY()); matrix.setRectToRect(textureRectF, previewRectF, Matrix.ScaleToFit.FILL); float scale = Math.max((float) width / cameraContext.getPreviewSize().getWidth(), (float) height / cameraContext.getPreviewSize().getHeight()); matrix.postScale(scale, scale, centerX, centerY); matrix.postRotate(90 * (rotation - 2), centerX, centerY); } cameraContext.getPreviewView().setTransform(matrix); } | /**
* Magie om de het roteren van het scherm goed te laten verlopen om sommige toestellen (bijv. Samsung)
*
* @param width
* @param height
*/ | Magie om de het roteren van het scherm goed te laten verlopen om sommige toestellen (bijv. Samsung) | transformImage | {
"repo_name": "arjenvdhave/DaDa",
"path": "app/src/main/java/nl/arjen/dada/camera/DaDaCameraManager.java",
"license": "mit",
"size": 11475
} | [
"android.graphics.Matrix",
"android.graphics.RectF",
"android.view.Surface"
] | import android.graphics.Matrix; import android.graphics.RectF; import android.view.Surface; | import android.graphics.*; import android.view.*; | [
"android.graphics",
"android.view"
] | android.graphics; android.view; | 2,202,576 |
public void setSelectedColor(Color color)
{
if (color == null)
throw new Error("ColorSelectionModel cannot be set to have null color.");
if (color != selectedColor)
{
this.selectedColor = color;
fireStateChanged();
}
} | void function(Color color) { if (color == null) throw new Error(STR); if (color != selectedColor) { this.selectedColor = color; fireStateChanged(); } } | /**
* This method sets the color.
*
* @param color The color to set.
*
* @throws Error If the color is set.
*/ | This method sets the color | setSelectedColor | {
"repo_name": "unofficial-opensource-apple/gcc_40",
"path": "libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java",
"license": "gpl-2.0",
"size": 4805
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 841,771 |
protected void sendContextClickEvent(MouseEventDetails details,
EventTarget eventTarget) {
// The default context click implementation only provides the mouse
// coordinates relative to root element of widget.
getRpcProxy(ContextClickRpc.class).contextClick(details);
WidgetUtil.clearTextSelection();
}
/**
* Creates and returns the widget for this VPaintableWidget. This method
* should only be called once when initializing the paintable.
* <p>
* You should typically not override this method since the framework by
* default generates an implementation that uses {@link GWT#create(Class)} | void function(MouseEventDetails details, EventTarget eventTarget) { getRpcProxy(ContextClickRpc.class).contextClick(details); WidgetUtil.clearTextSelection(); } /** * Creates and returns the widget for this VPaintableWidget. This method * should only be called once when initializing the paintable. * <p> * You should typically not override this method since the framework by * default generates an implementation that uses {@link GWT#create(Class)} | /**
* This method sends the context menu event to the server-side. Can be
* overridden to provide extra information through an alternative RPC
* interface.
*
* @since 7.6
* @param details
* @param eventTarget
*/ | This method sends the context menu event to the server-side. Can be overridden to provide extra information through an alternative RPC interface | sendContextClickEvent | {
"repo_name": "Darsstar/framework",
"path": "client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java",
"license": "apache-2.0",
"size": 31992
} | [
"com.google.gwt.dom.client.EventTarget",
"com.vaadin.client.WidgetUtil",
"com.vaadin.shared.ContextClickRpc",
"com.vaadin.shared.MouseEventDetails"
] | import com.google.gwt.dom.client.EventTarget; import com.vaadin.client.WidgetUtil; import com.vaadin.shared.ContextClickRpc; import com.vaadin.shared.MouseEventDetails; | import com.google.gwt.dom.client.*; import com.vaadin.client.*; import com.vaadin.shared.*; | [
"com.google.gwt",
"com.vaadin.client",
"com.vaadin.shared"
] | com.google.gwt; com.vaadin.client; com.vaadin.shared; | 1,314,736 |
public BooleanWrapper removeNode(String nodeUrl, Client initiator) {
//verifying if node is already in the list,
//node could have fallen between remove request and the confirm
if (this.nodes.containsKey(nodeUrl)) {
logger.info("[" + name + "] removing node : " + nodeUrl);
Node node = nodes.remove(nodeUrl);
RMCore.topologyManager.removeNode(node);
try {
infrastructureManager.internalRemoveNode(node);
} catch (RMException e) {
logger.error(e.getCause().getMessage(), e);
}
} else {
Node downNode = downNodes.remove(nodeUrl);
if (downNode != null) {
logger.info("[" + name + "] removing down node : " + nodeUrl);
} else {
logger.error("[" + name + "] removing node : " + nodeUrl + " which not belongs to this node source");
return new BooleanWrapper(false);
}
}
if (toShutdown && nodes.size() == 0) {
// shutdown all pending nodes
shutdownNodeSourceServices(initiator);
}
return new BooleanWrapper(true);
} | BooleanWrapper function(String nodeUrl, Client initiator) { if (this.nodes.containsKey(nodeUrl)) { logger.info("[" + name + STR + nodeUrl); Node node = nodes.remove(nodeUrl); RMCore.topologyManager.removeNode(node); try { infrastructureManager.internalRemoveNode(node); } catch (RMException e) { logger.error(e.getCause().getMessage(), e); } } else { Node downNode = downNodes.remove(nodeUrl); if (downNode != null) { logger.info("[" + name + STR + nodeUrl); } else { logger.error("[" + name + STR + nodeUrl + STR); return new BooleanWrapper(false); } } if (toShutdown && nodes.size() == 0) { shutdownNodeSourceServices(initiator); } return new BooleanWrapper(true); } | /**
* Removes the node from the node source.
*
* @param nodeUrl the url of the node to be released
*/ | Removes the node from the node source | removeNode | {
"repo_name": "lpellegr/scheduling",
"path": "rm/rm-server/src/main/java/org/ow2/proactive/resourcemanager/nodesource/NodeSource.java",
"license": "agpl-3.0",
"size": 30067
} | [
"org.objectweb.proactive.core.node.Node",
"org.objectweb.proactive.core.util.wrapper.BooleanWrapper",
"org.ow2.proactive.resourcemanager.authentication.Client",
"org.ow2.proactive.resourcemanager.core.RMCore",
"org.ow2.proactive.resourcemanager.exception.RMException"
] | import org.objectweb.proactive.core.node.Node; import org.objectweb.proactive.core.util.wrapper.BooleanWrapper; import org.ow2.proactive.resourcemanager.authentication.Client; import org.ow2.proactive.resourcemanager.core.RMCore; import org.ow2.proactive.resourcemanager.exception.RMException; | import org.objectweb.proactive.core.node.*; import org.objectweb.proactive.core.util.wrapper.*; import org.ow2.proactive.resourcemanager.authentication.*; import org.ow2.proactive.resourcemanager.core.*; import org.ow2.proactive.resourcemanager.exception.*; | [
"org.objectweb.proactive",
"org.ow2.proactive"
] | org.objectweb.proactive; org.ow2.proactive; | 2,444,772 |
public static native void jerasure_matrix_encode(int k, int m, int w, int[] matrix,
ByteBuffer[] data_ptrs, ByteBuffer[] coding_ptrs, int size); | static native void function(int k, int m, int w, int[] matrix, ByteBuffer[] data_ptrs, ByteBuffer[] coding_ptrs, int size); | /**
* This function encodes a matrix in \f$GF(2^w)\f$. \f$w\f$ must be either 8, 16 or 32.
* We do not change ByteBuffer position.
*
* @param k Number of data devices
* @param m Number of coding devices
* @param w Word size
* @param matrix Array of k*m integers. It represents an m by k matrix. Element i,j is in matrix[i*k+j]
* @param data_ptrs Array of k pointers to data which is size bytes. Size must be a multiple of sizeof(long). Pointers must also be longword aligned.
* @param coding_ptrs Array of m pointers to coding data which is size bytes
* @param size Size of memory allocated by coding_ptrs in bytes.
*
*/ | This function encodes a matrix in \f$GF(2^w)\f$. \f$w\f$ must be either 8, 16 or 32. We do not change ByteBuffer position | jerasure_matrix_encode | {
"repo_name": "buptUnixGuys/jerasure-jni",
"path": "java/cn/ctyun/ec/jni/Jerasure.java",
"license": "bsd-3-clause",
"size": 10935
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 312,009 |
EReference getFormDataType_FormField(); | EReference getFormDataType_FormField(); | /**
* Returns the meta object for the containment reference list '{@link org.camunda.bpm.modeler.runtime.engine.model.FormDataType#getFormField <em>Form Field</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Form Field</em>'.
* @see org.camunda.bpm.modeler.runtime.engine.model.FormDataType#getFormField()
* @see #getFormDataType()
* @generated
*/ | Returns the meta object for the containment reference list '<code>org.camunda.bpm.modeler.runtime.engine.model.FormDataType#getFormField Form Field</code>'. | getFormDataType_FormField | {
"repo_name": "camunda/camunda-eclipse-plugin",
"path": "org.camunda.bpm.modeler/src/org/camunda/bpm/modeler/runtime/engine/model/ModelPackage.java",
"license": "epl-1.0",
"size": 231785
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 171,503 |
@Override
public String getText(Object object) {
String contentType = ((MessageBuilder) object).getContentType();
String contentTypeLabel = WordUtils.abbreviate(contentType, 40, 45, " ...");
String builderClass = ((MessageBuilder) object).getBuilderClass();
return contentType == null || contentType.length() == 0 ? getString("_UI_MessageBuilder_type")
: getString("_UI_MessageBuilder_type") + " - "
+ EEFPropertyViewUtil.spaceFormat(contentTypeLabel)
+ EEFPropertyViewUtil.spaceFormat(builderClass);
} | String function(Object object) { String contentType = ((MessageBuilder) object).getContentType(); String contentTypeLabel = WordUtils.abbreviate(contentType, 40, 45, STR); String builderClass = ((MessageBuilder) object).getBuilderClass(); return contentType == null contentType.length() == 0 ? getString(STR) : getString(STR) + STR + EEFPropertyViewUtil.spaceFormat(contentTypeLabel) + EEFPropertyViewUtil.spaceFormat(builderClass); } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/MessageBuilderItemProvider.java",
"license": "apache-2.0",
"size": 7235
} | [
"org.apache.commons.lang.WordUtils",
"org.wso2.developerstudio.eclipse.gmf.esb.MessageBuilder",
"org.wso2.developerstudio.eclipse.gmf.esb.presentation.EEFPropertyViewUtil"
] | import org.apache.commons.lang.WordUtils; import org.wso2.developerstudio.eclipse.gmf.esb.MessageBuilder; import org.wso2.developerstudio.eclipse.gmf.esb.presentation.EEFPropertyViewUtil; | import org.apache.commons.lang.*; import org.wso2.developerstudio.eclipse.gmf.esb.*; import org.wso2.developerstudio.eclipse.gmf.esb.presentation.*; | [
"org.apache.commons",
"org.wso2.developerstudio"
] | org.apache.commons; org.wso2.developerstudio; | 13,108 |
void attachContext(Context context); | void attachContext(Context context); | /**
* Attach a context to the renderer
*
* @param context the context
*/ | Attach a context to the renderer | attachContext | {
"repo_name": "Digitalisma/Android-PdfMyXml",
"path": "lib/src/main/java/com/digitalisma/pdfgen/renderer/IViewRenderer.java",
"license": "gpl-2.0",
"size": 1199
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,914,848 |
void setAccessAndExpiryTimeWhenCallerOutsideLock(K key, OnHeapValueHolder<V> valueHolder, long now); | void setAccessAndExpiryTimeWhenCallerOutsideLock(K key, OnHeapValueHolder<V> valueHolder, long now); | /**
* Set the access time on the mapping and its expiry time if it is access sensitive (TTI). We expect this action to
* be called when the caller isn't holding any lock.
*
* @param key key of the mapping. Used to remove it form the map if needed
* @param valueHolder the mapping
* @param now the current time
*/ | Set the access time on the mapping and its expiry time if it is access sensitive (TTI). We expect this action to be called when the caller isn't holding any lock | setAccessAndExpiryTimeWhenCallerOutsideLock | {
"repo_name": "rkavanap/ehcache3",
"path": "impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStrategy.java",
"license": "apache-2.0",
"size": 9402
} | [
"org.ehcache.impl.internal.store.heap.holders.OnHeapValueHolder"
] | import org.ehcache.impl.internal.store.heap.holders.OnHeapValueHolder; | import org.ehcache.impl.internal.store.heap.holders.*; | [
"org.ehcache.impl"
] | org.ehcache.impl; | 950,491 |
public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle, final Locale locale) {
return cache.getDateTimeInstance(dateStyle, timeStyle, null, locale);
} | static FastDateFormat function(final int dateStyle, final int timeStyle, final Locale locale) { return cache.getDateTimeInstance(dateStyle, timeStyle, null, locale); } | /**
* <p>Gets a date/time formatter instance using the specified style and
* locale in the default time zone.</p>
*
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
* @param locale optional locale, overrides system locale
* @return a localized standard date/time formatter
* @throws IllegalArgumentException if the Locale has no date/time
* pattern defined
* @since 2.1
*/ | Gets a date/time formatter instance using the specified style and locale in the default time zone | getDateTimeInstance | {
"repo_name": "hsjawanda/gae-objectify-utils",
"path": "src/main/java/com/hsjawanda/gaeobjectify/repackaged/commons/lang3/time/FastDateFormat.java",
"license": "apache-2.0",
"size": 24220
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,004,224 |
public static ItemStack getCharBanner(char c, DyeColor background, DyeColor color) {
return getCharBanner(c, background, color, false);
}
| static ItemStack function(char c, DyeColor background, DyeColor color) { return getCharBanner(c, background, color, false); } | /**
* Returns a banner item stack which represents the following character, with a specified background and the specified color.
* Throws IllegalArgumentException if the character isn't registered.
* @param c The character to be printed
* @param background The background color
* @param color The font color
* @return A banner {@link ItemStack} with the corresponding character using a basic font system
*/ | Returns a banner item stack which represents the following character, with a specified background and the specified color. Throws IllegalArgumentException if the character isn't registered | getCharBanner | {
"repo_name": "FlorianCassayre/BannersUtils",
"path": "src/main/java/me/cassayre/florian/BannersUtils/BannersUtils.java",
"license": "mpl-2.0",
"size": 20044
} | [
"org.bukkit.DyeColor",
"org.bukkit.inventory.ItemStack"
] | import org.bukkit.DyeColor; import org.bukkit.inventory.ItemStack; | import org.bukkit.*; import org.bukkit.inventory.*; | [
"org.bukkit",
"org.bukkit.inventory"
] | org.bukkit; org.bukkit.inventory; | 2,404,569 |
public static boolean validateDeflateSignature(String queryString, String issuer,
String alias, String domainName) throws IdentityException{
try {
synchronized (Runtime.getRuntime().getClass()){
samlHTTPRedirectSignatureValidator = (SAML2HTTPRedirectSignatureValidator)Class.forName(IdentityUtil.getProperty(
"SSOService.SAML2HTTPRedirectSignatureValidator").trim()).newInstance();
samlHTTPRedirectSignatureValidator.init();
}
return samlHTTPRedirectSignatureValidator.validateSignature(queryString, issuer,
alias, domainName);
} catch (SecurityException e) {
log.error("Error validating deflate signature", e);
return false;
} catch (IdentitySAML2SSOException e) {
log.warn("Signature validation failed for the SAML Message : Failed to construct the X509CredentialImpl for the alias " +
alias);
return false;
} catch (ClassNotFoundException e) {
throw new IdentityException("Class not found: "
+ IdentityUtil.getProperty("SSOService.SAML2HTTPRedirectSignatureValidator"), e);
} catch (InstantiationException e) {
throw new IdentityException("Error while instantiating class: "
+ IdentityUtil.getProperty("SSOService.SAML2HTTPRedirectSignatureValidator"), e);
} catch (IllegalAccessException e) {
throw new IdentityException("Illegal access to class: "
+ IdentityUtil.getProperty("SSOService.SAML2HTTPRedirectSignatureValidator"), e);
}
} | static boolean function(String queryString, String issuer, String alias, String domainName) throws IdentityException{ try { synchronized (Runtime.getRuntime().getClass()){ samlHTTPRedirectSignatureValidator = (SAML2HTTPRedirectSignatureValidator)Class.forName(IdentityUtil.getProperty( STR).trim()).newInstance(); samlHTTPRedirectSignatureValidator.init(); } return samlHTTPRedirectSignatureValidator.validateSignature(queryString, issuer, alias, domainName); } catch (SecurityException e) { log.error(STR, e); return false; } catch (IdentitySAML2SSOException e) { log.warn(STR + alias); return false; } catch (ClassNotFoundException e) { throw new IdentityException(STR + IdentityUtil.getProperty(STR), e); } catch (InstantiationException e) { throw new IdentityException(STR + IdentityUtil.getProperty(STR), e); } catch (IllegalAccessException e) { throw new IdentityException(STR + IdentityUtil.getProperty(STR), e); } } | /**
* Signature validation for HTTP Redirect Binding
*
* @param authnReqDTO
* @param samlRequest
* @param alias
* @param domainName
* @return
*/ | Signature validation for HTTP Redirect Binding | validateDeflateSignature | {
"repo_name": "thariyarox/ORG-carbon-identity",
"path": "components/identity/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java",
"license": "apache-2.0",
"size": 46450
} | [
"org.opensaml.xml.security.SecurityException",
"org.wso2.carbon.identity.base.IdentityException",
"org.wso2.carbon.identity.core.util.IdentityUtil",
"org.wso2.carbon.identity.sso.saml.exception.IdentitySAML2SSOException",
"org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectSignatureValidator"
] | import org.opensaml.xml.security.SecurityException; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.core.util.IdentityUtil; import org.wso2.carbon.identity.sso.saml.exception.IdentitySAML2SSOException; import org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectSignatureValidator; | import org.opensaml.xml.security.*; import org.wso2.carbon.identity.base.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.sso.saml.exception.*; import org.wso2.carbon.identity.sso.saml.validators.*; | [
"org.opensaml.xml",
"org.wso2.carbon"
] | org.opensaml.xml; org.wso2.carbon; | 2,458,840 |
protected void printInOutputArgument(final FieldDefinition argument, final Writer writer,
final AbstractSession session) throws ValidationException {
try {
final DatabasePlatform platform = session.getPlatform();
final FieldTypeDefinition fieldType
= getFieldTypeDefinition(session, argument.type, argument.typeName);
writer.write(platform.getProcedureArgumentString());
if (platform.shouldPrintOutputTokenAtStart()) {
writer.write(" ");
writer.write(platform.getCreationInOutputProcedureToken());
writer.write(" ");
}
writer.write(argument.name);
if ((!platform.shouldPrintOutputTokenAtStart()) && platform.shouldPrintOutputTokenBeforeType()) {
writer.write(" ");
writer.write(platform.getCreationInOutputProcedureToken());
}
writer.write(" ");
writer.write(fieldType.getName());
if (fieldType.isSizeAllowed() && platform.allowsSizeInProcedureArguments()
&& ((argument.size != 0) || (fieldType.isSizeRequired()))) {
writer.write("(");
if (argument.size == 0) {
writer.write(Integer.toString(fieldType.getDefaultSize()));
} else {
writer.write(Integer.toString(argument.size));
}
if (argument.subSize != 0) {
writer.write(",");
writer.write(Integer.toString(argument.subSize));
} else if (fieldType.getDefaultSubSize() != 0) {
writer.write(",");
writer.write(Integer.toString(fieldType.getDefaultSubSize()));
}
writer.write(")");
}
if ((!platform.shouldPrintOutputTokenAtStart()) && (!platform.shouldPrintOutputTokenBeforeType())) {
writer.write(" ");
writer.write(platform.getCreationInOutputProcedureToken());
}
} catch (IOException ioException) {
throw ValidationException.fileError(ioException);
}
} | void function(final FieldDefinition argument, final Writer writer, final AbstractSession session) throws ValidationException { try { final DatabasePlatform platform = session.getPlatform(); final FieldTypeDefinition fieldType = getFieldTypeDefinition(session, argument.type, argument.typeName); writer.write(platform.getProcedureArgumentString()); if (platform.shouldPrintOutputTokenAtStart()) { writer.write(" "); writer.write(platform.getCreationInOutputProcedureToken()); writer.write(" "); } writer.write(argument.name); if ((!platform.shouldPrintOutputTokenAtStart()) && platform.shouldPrintOutputTokenBeforeType()) { writer.write(" "); writer.write(platform.getCreationInOutputProcedureToken()); } writer.write(" "); writer.write(fieldType.getName()); if (fieldType.isSizeAllowed() && platform.allowsSizeInProcedureArguments() && ((argument.size != 0) (fieldType.isSizeRequired()))) { writer.write("("); if (argument.size == 0) { writer.write(Integer.toString(fieldType.getDefaultSize())); } else { writer.write(Integer.toString(argument.size)); } if (argument.subSize != 0) { writer.write(","); writer.write(Integer.toString(argument.subSize)); } else if (fieldType.getDefaultSubSize() != 0) { writer.write(","); writer.write(Integer.toString(fieldType.getDefaultSubSize())); } writer.write(")"); } if ((!platform.shouldPrintOutputTokenAtStart()) && (!platform.shouldPrintOutputTokenBeforeType())) { writer.write(" "); writer.write(platform.getCreationInOutputProcedureToken()); } } catch (IOException ioException) { throw ValidationException.fileError(ioException); } } | /**
* Print the argument and its type.
* @param argument Stored procedure argument.
* @param writer Target writer where to write argument string.
* @param session Current session context.
* @throws ValidationException When invalid or inconsistent data were found.
*/ | Print the argument and its type | printInOutputArgument | {
"repo_name": "gameduell/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/tools/schemaframework/StoredProcedureDefinition.java",
"license": "epl-1.0",
"size": 17002
} | [
"java.io.IOException",
"java.io.Writer",
"org.eclipse.persistence.exceptions.ValidationException",
"org.eclipse.persistence.internal.databaseaccess.DatabasePlatform",
"org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition",
"org.eclipse.persistence.internal.sessions.AbstractSession"
] | import java.io.IOException; import java.io.Writer; import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition; import org.eclipse.persistence.internal.sessions.AbstractSession; | import java.io.*; import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.internal.databaseaccess.*; import org.eclipse.persistence.internal.sessions.*; | [
"java.io",
"org.eclipse.persistence"
] | java.io; org.eclipse.persistence; | 151,861 |
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
componentMainThreadExecutor.schedule(runnable, delay, unit);
}
// ------------------------------------------------------------------------
// Helper classes
// ------------------------------------------------------------------------
static class AllocatedSlots {
private final Map<ResourceID, Set<AllocatedSlot>> allocatedSlotsByTaskManager;
private final DualKeyLinkedMap<AllocationID, SlotRequestId, AllocatedSlot> allocatedSlotsById;
AllocatedSlots() {
this.allocatedSlotsByTaskManager = new HashMap<>(16);
this.allocatedSlotsById = new DualKeyLinkedMap<>(16);
} | void function(Runnable runnable, long delay, TimeUnit unit) { componentMainThreadExecutor.schedule(runnable, delay, unit); } static class AllocatedSlots { private final Map<ResourceID, Set<AllocatedSlot>> allocatedSlotsByTaskManager; private final DualKeyLinkedMap<AllocationID, SlotRequestId, AllocatedSlot> allocatedSlotsById; AllocatedSlots() { this.allocatedSlotsByTaskManager = new HashMap<>(16); this.allocatedSlotsById = new DualKeyLinkedMap<>(16); } | /**
* Execute the runnable in the main thread of the underlying RPC endpoint, with
* a delay of the given number of milliseconds.
*
* @param runnable Runnable to be executed
* @param delay The delay after which the runnable will be executed
*/ | Execute the runnable in the main thread of the underlying RPC endpoint, with a delay of the given number of milliseconds | scheduleRunAsync | {
"repo_name": "darionyaphet/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java",
"license": "apache-2.0",
"size": 51447
} | [
"java.util.HashMap",
"java.util.Map",
"java.util.Set",
"java.util.concurrent.TimeUnit",
"org.apache.flink.runtime.clusterframework.types.AllocationID",
"org.apache.flink.runtime.clusterframework.types.ResourceID",
"org.apache.flink.runtime.jobmaster.SlotRequestId",
"org.apache.flink.runtime.util.DualKeyLinkedMap"
] | import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import org.apache.flink.runtime.clusterframework.types.AllocationID; import org.apache.flink.runtime.clusterframework.types.ResourceID; import org.apache.flink.runtime.jobmaster.SlotRequestId; import org.apache.flink.runtime.util.DualKeyLinkedMap; | import java.util.*; import java.util.concurrent.*; import org.apache.flink.runtime.clusterframework.types.*; import org.apache.flink.runtime.jobmaster.*; import org.apache.flink.runtime.util.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 1,877,380 |
public DeviceType getRawType() {
return device.flatMap(Device::getIdent).flatMap(Ident::getType).map(Type::getValueRaw)
.orElse(DeviceType.UNKNOWN);
} | DeviceType function() { return device.flatMap(Device::getIdent).flatMap(Ident::getType).map(Type::getValueRaw) .orElse(DeviceType.UNKNOWN); } | /**
* Gets the raw device type.
*
* @return The raw device type.
*/ | Gets the raw device type | getRawType | {
"repo_name": "paulianttila/openhab2",
"path": "bundles/org.openhab.binding.mielecloud/src/main/java/org/openhab/binding/mielecloud/internal/webservice/api/DeviceState.java",
"license": "epl-1.0",
"size": 18906
} | [
"org.openhab.binding.mielecloud.internal.webservice.api.json.Device",
"org.openhab.binding.mielecloud.internal.webservice.api.json.DeviceType",
"org.openhab.binding.mielecloud.internal.webservice.api.json.Ident",
"org.openhab.binding.mielecloud.internal.webservice.api.json.Type"
] | import org.openhab.binding.mielecloud.internal.webservice.api.json.Device; import org.openhab.binding.mielecloud.internal.webservice.api.json.DeviceType; import org.openhab.binding.mielecloud.internal.webservice.api.json.Ident; import org.openhab.binding.mielecloud.internal.webservice.api.json.Type; | import org.openhab.binding.mielecloud.internal.webservice.api.json.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 1,626,675 |
Flux<ServiceBusReceivedMessage> receiveDeferredMessages(ServiceBusReceiveMode receiveMode, String sessionId,
String associatedLinkName, Iterable<Long> sequenceNumbers); | Flux<ServiceBusReceivedMessage> receiveDeferredMessages(ServiceBusReceiveMode receiveMode, String sessionId, String associatedLinkName, Iterable<Long> sequenceNumbers); | /**
* Receives a deferred {@link ServiceBusReceivedMessage}. Deferred messages can only be received by using sequence
* number.
*
* @param receiveMode Mode to receive messages.
* @param sequenceNumbers The sequence numbers from the {@link ServiceBusReceivedMessage#getSequenceNumber()}.
* @param sessionId Identifier for the session.
*
* @return The received {@link ServiceBusReceivedMessage} message for given sequence number.
*/ | Receives a deferred <code>ServiceBusReceivedMessage</code>. Deferred messages can only be received by using sequence number | receiveDeferredMessages | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementNode.java",
"license": "mit",
"size": 5968
} | [
"com.azure.messaging.servicebus.ServiceBusReceivedMessage",
"com.azure.messaging.servicebus.models.ServiceBusReceiveMode"
] | import com.azure.messaging.servicebus.ServiceBusReceivedMessage; import com.azure.messaging.servicebus.models.ServiceBusReceiveMode; | import com.azure.messaging.servicebus.*; import com.azure.messaging.servicebus.models.*; | [
"com.azure.messaging"
] | com.azure.messaging; | 2,461,630 |
@SuppressWarnings("unchecked")
@Test
public void testNamedQueryParameter() throws URISyntaxException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("id", StaticModelDatabasePopulator.USER1_ID);
List<StaticUser> users = (List<StaticUser>)restNamedQuery("User.byId", "StaticUser", parameters, null);
assertTrue("Incorrect Number of users found.", users.size() == 1);
assertTrue("Wrong user returned", users.get(0).getId() == StaticModelDatabasePopulator.USER1_ID);
}
| @SuppressWarnings(STR) void function() throws URISyntaxException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("id", StaticModelDatabasePopulator.USER1_ID); List<StaticUser> users = (List<StaticUser>)restNamedQuery(STR, STR, parameters, null); assertTrue(STR, users.size() == 1); assertTrue(STR, users.get(0).getId() == StaticModelDatabasePopulator.USER1_ID); } | /**
* Test named query parameter.
*
* @throws URISyntaxException the uRI syntax exception
*/ | Test named query parameter | testNamedQueryParameter | {
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "jpa/eclipselink.jpars.test/src/org/eclipse/persistence/jpars/test/server/ServerCrudTest.java",
"license": "epl-1.0",
"size": 59374
} | [
"java.net.URISyntaxException",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.eclipse.persistence.jpars.test.model.auction.StaticUser",
"org.eclipse.persistence.jpars.test.util.StaticModelDatabasePopulator",
"org.junit.Assert"
] | import java.net.URISyntaxException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.persistence.jpars.test.model.auction.StaticUser; import org.eclipse.persistence.jpars.test.util.StaticModelDatabasePopulator; import org.junit.Assert; | import java.net.*; import java.util.*; import org.eclipse.persistence.jpars.test.model.auction.*; import org.eclipse.persistence.jpars.test.util.*; import org.junit.*; | [
"java.net",
"java.util",
"org.eclipse.persistence",
"org.junit"
] | java.net; java.util; org.eclipse.persistence; org.junit; | 372,111 |
private final void readID() throws IOException, ClassFormatException {
int magic = 0xCAFEBABE;
if (file.readInt() != magic) {
throw new ClassFormatException(file_name + " is not a Java .class file");
}
} | final void function() throws IOException, ClassFormatException { int magic = 0xCAFEBABE; if (file.readInt() != magic) { throw new ClassFormatException(file_name + STR); } } | /**
* Check whether the header of the file is ok.
* Of course, this has to be the first action on successive file reads.
* @throws IOException
* @throws ClassFormatException
*/ | Check whether the header of the file is ok. Of course, this has to be the first action on successive file reads | readID | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.0/ClassParser.java",
"license": "mit",
"size": 10552
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,031,452 |
public void addTask(Task nestedTask) {
unknownElements.add(nestedTask);
} | void function(Task nestedTask) { unknownElements.add(nestedTask); } | /**
* Add an unknown element (to be snipped into the macroDef instance)
*
* @param nestedTask an unknown element
*/ | Add an unknown element (to be snipped into the macroDef instance) | addTask | {
"repo_name": "Mayo-WE01051879/mayosapp",
"path": "Build/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java",
"license": "mit",
"size": 15039
} | [
"org.apache.tools.ant.Task"
] | import org.apache.tools.ant.Task; | import org.apache.tools.ant.*; | [
"org.apache.tools"
] | org.apache.tools; | 275,244 |
@Override
public void setForeground(Color c) {
super.setForeground(c);
} | void function(Color c) { super.setForeground(c); } | /**
* Overrides <code>JComponent.setForeground</code> to assign
* the unselected-foreground color to the specified color.
*
* @param c set the foreground color to this value
*/ | Overrides <code>JComponent.setForeground</code> to assign the unselected-foreground color to the specified color | setForeground | {
"repo_name": "pdeboer/wikilanguage",
"path": "lib/jung2/jung-visualization/src/main/java/edu/uci/ics/jung/visualization/renderers/DefaultEdgeLabelRenderer.java",
"license": "mit",
"size": 6512
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,146,710 |
public KualiDecimal calculatePendBudget(boolean isYearEndDocument, String budgetCheckingBalanceTypeCd, Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String acctSufficientFundsFinObjCd, List expenditureCodes) {
Criteria criteria = new Criteria();
criteria.addEqualTo(KFSConstants.FINANCIAL_BALANCE_TYPE_CODE_PROPERTY_NAME, budgetCheckingBalanceTypeCd);
criteria.addEqualTo(KFSConstants.UNIVERSITY_FISCAL_YEAR_PROPERTY_NAME, universityFiscalYear);
criteria.addEqualTo(KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME, accountNumber);
criteria.addIn(KFSConstants.FINANCIAL_OBJECT_TYPE_CODE, expenditureCodes);
criteria.addEqualTo(KFSConstants.ACCOUNT_SUFFICIENT_FUNDS_FINANCIAL_OBJECT_CODE_PROPERTY_NAME, acctSufficientFundsFinObjCd);
criteria.addNotEqualTo(KFSConstants.DOCUMENT_HEADER_PROPERTY_NAME + "." + KFSConstants.DOCUMENT_HEADER_DOCUMENT_STATUS_CODE_PROPERTY_NAME, KFSConstants.DocumentStatusCodes.CANCELLED);
if (isYearEndDocument) {
criteria.addLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX);
} else {
criteria.addNotLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX);
}
ReportQueryByCriteria reportQuery = QueryFactory.newReportQuery(GeneralLedgerPendingEntry.class, criteria);
reportQuery.setAttributes(new String[]{"sum(" + KFSConstants.TRANSACTION_LEDGER_ENTRY_AMOUNT + ")"});
return executeReportQuery(reportQuery);
} | KualiDecimal function(boolean isYearEndDocument, String budgetCheckingBalanceTypeCd, Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String acctSufficientFundsFinObjCd, List expenditureCodes) { Criteria criteria = new Criteria(); criteria.addEqualTo(KFSConstants.FINANCIAL_BALANCE_TYPE_CODE_PROPERTY_NAME, budgetCheckingBalanceTypeCd); criteria.addEqualTo(KFSConstants.UNIVERSITY_FISCAL_YEAR_PROPERTY_NAME, universityFiscalYear); criteria.addEqualTo(KFSConstants.ACCOUNT_NUMBER_PROPERTY_NAME, accountNumber); criteria.addIn(KFSConstants.FINANCIAL_OBJECT_TYPE_CODE, expenditureCodes); criteria.addEqualTo(KFSConstants.ACCOUNT_SUFFICIENT_FUNDS_FINANCIAL_OBJECT_CODE_PROPERTY_NAME, acctSufficientFundsFinObjCd); criteria.addNotEqualTo(KFSConstants.DOCUMENT_HEADER_PROPERTY_NAME + "." + KFSConstants.DOCUMENT_HEADER_DOCUMENT_STATUS_CODE_PROPERTY_NAME, KFSConstants.DocumentStatusCodes.CANCELLED); if (isYearEndDocument) { criteria.addLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX); } else { criteria.addNotLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX); } ReportQueryByCriteria reportQuery = QueryFactory.newReportQuery(GeneralLedgerPendingEntry.class, criteria); reportQuery.setAttributes(new String[]{"sum(" + KFSConstants.TRANSACTION_LEDGER_ENTRY_AMOUNT + ")"}); return executeReportQuery(reportQuery); } | /**
* calculates the current year pending budget total
*
* @param isYearEndDocument should year end documents be included?
* @param budgetCheckingBalanceTypeCd the budget balance type code
* @param universityFiscalYear the university fiscal year of sufficient funds balances to summarize
* @param chartOfAccountsCode the chart of accounts code of sufficient funds balances to summarize
* @param accountNumber the account number of sufficient fund balances to summarize
* @param acctSufficientFundsFinObjCd the object code for sufficient funds
* @param expenditureCodes object codes that represent expenditures
* @return calculates the current year pending budget total
* @see org.kuali.kfs.gl.batch.dataaccess.SufficientFundsDao#calculatePendBudget(boolean, java.lang.String, java.lang.Integer,
* java.lang.String, java.lang.String, java.lang.String, List)
*/ | calculates the current year pending budget total | calculatePendBudget | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/gl/batch/dataaccess/impl/SufficientFundsDaoOjb.java",
"license": "agpl-3.0",
"size": 26032
} | [
"java.util.List",
"org.apache.ojb.broker.query.Criteria",
"org.apache.ojb.broker.query.QueryFactory",
"org.apache.ojb.broker.query.ReportQueryByCriteria",
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry",
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import java.util.List; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.QueryFactory; import org.apache.ojb.broker.query.ReportQueryByCriteria; import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry; import org.kuali.rice.core.api.util.type.KualiDecimal; | import java.util.*; import org.apache.ojb.broker.query.*; import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.businessobject.*; import org.kuali.rice.core.api.util.type.*; | [
"java.util",
"org.apache.ojb",
"org.kuali.kfs",
"org.kuali.rice"
] | java.util; org.apache.ojb; org.kuali.kfs; org.kuali.rice; | 2,252,159 |
private static boolean checkAllRowsFound(HashMap<Text,Boolean> expectedRows) {
int count = 0;
boolean allFound = true;
for (Entry<Text,Boolean> entry : expectedRows.entrySet())
if (!entry.getValue())
count++;
if (count > 0) {
log.warn("Did not find " + count + " rows");
allFound = false;
}
return allFound;
} | static boolean function(HashMap<Text,Boolean> expectedRows) { int count = 0; boolean allFound = true; for (Entry<Text,Boolean> entry : expectedRows.entrySet()) if (!entry.getValue()) count++; if (count > 0) { log.warn(STR + count + STR); allFound = false; } return allFound; } | /**
* Prints a count of the number of rows mapped to false.
*
* @param expectedRows
* @return boolean indicating "were all the rows found?"
*/ | Prints a count of the number of rows mapped to false | checkAllRowsFound | {
"repo_name": "joshelser/accumulo",
"path": "examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java",
"license": "apache-2.0",
"size": 8214
} | [
"java.util.HashMap",
"java.util.Map",
"org.apache.hadoop.io.Text"
] | import java.util.HashMap; import java.util.Map; import org.apache.hadoop.io.Text; | import java.util.*; import org.apache.hadoop.io.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 825,002 |
public void testAdd() {
NavigableSet q = set0();
assertTrue(q.add(six));
} | void function() { NavigableSet q = set0(); assertTrue(q.add(six)); } | /**
* Add of comparable element succeeds
*/ | Add of comparable element succeeds | testAdd | {
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/libcore/ojluni/src/test/java/util/concurrent/tck/TreeSubSetTest.java",
"license": "gpl-2.0",
"size": 31878
} | [
"java.util.NavigableSet"
] | import java.util.NavigableSet; | import java.util.*; | [
"java.util"
] | java.util; | 1,730,412 |
private void makeValueIndex(Number max, Number min, Set uniqueValues) {
double valueRange = max.doubleValue() - min.doubleValue();
double valueStep = valueRange / this.paintLimit;
int paint = 0;
double cutPoint = min.doubleValue() + valueStep;
for (Iterator i = uniqueValues.iterator(); i.hasNext();) {
Number value = (Number) i.next();
while (value.doubleValue() > cutPoint) {
cutPoint += valueStep;
paint++;
if (paint > this.paintLimit) {
paint = this.paintLimit;
}
}
this.paintIndex.put(value, new Integer(paint));
}
} | void function(Number max, Number min, Set uniqueValues) { double valueRange = max.doubleValue() - min.doubleValue(); double valueStep = valueRange / this.paintLimit; int paint = 0; double cutPoint = min.doubleValue() + valueStep; for (Iterator i = uniqueValues.iterator(); i.hasNext();) { Number value = (Number) i.next(); while (value.doubleValue() > cutPoint) { cutPoint += valueStep; paint++; if (paint > this.paintLimit) { paint = this.paintLimit; } } this.paintIndex.put(value, new Integer(paint)); } } | /**
* Builds the paintindex by assigning colors evenly across the range
* of values: maxValue-minValue/totalcolors
*
* @param max the maximum value.
* @param min the minumum value.
* @param uniqueValues the unique values.
*/ | Builds the paintindex by assigning colors evenly across the range of values: maxValue-minValue/totalcolors | makeValueIndex | {
"repo_name": "simeshev/parabuild-ci",
"path": "3rdparty/jfreechart0921/source/org/jfree/chart/renderer/WaferMapRenderer.java",
"license": "lgpl-3.0",
"size": 12607
} | [
"java.util.Iterator",
"java.util.Set"
] | import java.util.Iterator; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,185,256 |
@Override
public void ready() throws PluginLifecycleException {
logger.info( "ready(): Called after the platform has been booted and is ready to receive requests. "
+ "All plugins have been initialized and loaded, spring has been loaded and all beans are ready. "
+ "All components and sub systems have been started - scheduler/repository/reporting/mondrian - etc." );
} | void function() throws PluginLifecycleException { logger.info( STR + STR + STR ); } | /**
* Called after the platform has been booted and is ready to receive requests. All plugins have been
* initialized and loaded, spring has been loaded and all beans are ready. All components and sub
* systems have been started - scheduler/repository/reporting/mondrian - etc.
*
* @throws PluginLifecycleException
* if an error occurred
*/ | Called after the platform has been booted and is ready to receive requests. All plugins have been initialized and loaded, spring has been loaded and all beans are ready. All components and sub systems have been started - scheduler/repository/reporting/mondrian - etc | ready | {
"repo_name": "graimundo/basic-plugin",
"path": "src/pt/webdetails/basic/plugin/BasicPluginLifecycleListener.java",
"license": "mpl-2.0",
"size": 3494
} | [
"org.pentaho.platform.api.engine.PluginLifecycleException"
] | import org.pentaho.platform.api.engine.PluginLifecycleException; | import org.pentaho.platform.api.engine.*; | [
"org.pentaho.platform"
] | org.pentaho.platform; | 163,714 |
private void setField(String parentName,jOTDBparam aParam, jOTDBnode aNode) {
// Generic Observation
if (aParam==null) {
return;
}
boolean isRef = LofarUtils.isReference(aNode.limits);
String aKeyName = LofarUtils.keyName(aNode.name);
logger.debug("setField for: "+ aNode.name);
try {
if (OtdbRmi.getRemoteTypes().getParamType(aParam.type).substring(0,1).equals("p")) {
// Have to get new param because we need the unresolved limits field.
aParam = OtdbRmi.getRemoteMaintenance().getParam(aNode.treeID(),aNode.paramDefID());
}
} catch (RemoteException ex) {
String aS="Error during getParam: "+ ex;
logger.error(aS);
LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
}
if(parentName.equals("VirtualInstrument")){
// Observation VirtualInstrument parameters
if (aKeyName.equals("stationList")) {
this.coreStationSelectionPanel.setToolTipText(aParam.description);
this.remoteStationSelectionPanel.setToolTipText(aParam.description);
this.europeStationSelectionPanel.setToolTipText(aParam.description);
this.itsStationList = aNode;
setStationLists(aNode.limits);
}
}
} | void function(String parentName,jOTDBparam aParam, jOTDBnode aNode) { if (aParam==null) { return; } boolean isRef = LofarUtils.isReference(aNode.limits); String aKeyName = LofarUtils.keyName(aNode.name); logger.debug(STR+ aNode.name); try { if (OtdbRmi.getRemoteTypes().getParamType(aParam.type).substring(0,1).equals("p")) { aParam = OtdbRmi.getRemoteMaintenance().getParam(aNode.treeID(),aNode.paramDefID()); } } catch (RemoteException ex) { String aS=STR+ ex; logger.error(aS); LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource(STR))); } if(parentName.equals(STR)){ if (aKeyName.equals(STR)) { this.coreStationSelectionPanel.setToolTipText(aParam.description); this.remoteStationSelectionPanel.setToolTipText(aParam.description); this.europeStationSelectionPanel.setToolTipText(aParam.description); this.itsStationList = aNode; setStationLists(aNode.limits); } } } | /**
* Sets the different fields in the GUI, using the names of the nodes provided
* @param parent the parent node of the node to be displayed
* @param aParam the parameter of the node to be displayed if applicable
* @param aNode the node to be displayed
*/ | Sets the different fields in the GUI, using the names of the nodes provided | setField | {
"repo_name": "kernsuite-debian/lofar",
"path": "SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/MultiEditDialog.java",
"license": "gpl-3.0",
"size": 28111
} | [
"java.rmi.RemoteException",
"nl.astron.lofar.lofarutils.LofarUtils",
"nl.astron.lofar.sas.otb.util.OtdbRmi"
] | import java.rmi.RemoteException; import nl.astron.lofar.lofarutils.LofarUtils; import nl.astron.lofar.sas.otb.util.OtdbRmi; | import java.rmi.*; import nl.astron.lofar.lofarutils.*; import nl.astron.lofar.sas.otb.util.*; | [
"java.rmi",
"nl.astron.lofar"
] | java.rmi; nl.astron.lofar; | 2,144,069 |
@Override
public Manager getManager() {
return(this.manager);
}
// --------------------------------------------------------- Public Methods | Manager function() { return(this.manager); } | /**
* Return the Manager with which the Store is associated.
*/ | Return the Manager with which the Store is associated | getManager | {
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.22/StoreBase.java",
"license": "mit",
"size": 7516
} | [
"org.apache.catalina.Manager"
] | import org.apache.catalina.Manager; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 484,256 |
@Test
@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP)
public void testStateRewinding() {
synchronized (mWaitLock) {
mPlayerAdapterCallback.reset();
mMediaControllerAdapter.mMediaControllerCallback.onPlaybackStateChanged(
createPlaybackStateForTesting(PlaybackStateCompat.STATE_REWINDING));
assertTrue(mPlayerAdapterCallback.mOnPlayStateChangedCalled);
assertTrue(mPlayerAdapterCallback.mOnCurrentPositionChangedCalled);
}
} | @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) void function() { synchronized (mWaitLock) { mPlayerAdapterCallback.reset(); mMediaControllerAdapter.mMediaControllerCallback.onPlaybackStateChanged( createPlaybackStateForTesting(PlaybackStateCompat.STATE_REWINDING)); assertTrue(mPlayerAdapterCallback.mOnPlayStateChangedCalled); assertTrue(mPlayerAdapterCallback.mOnCurrentPositionChangedCalled); } } | /**
* Check if STATE_REWIND is associated with onPlaybackStateChanged() and
* onCurrentPositionChanged() callback.
*/ | Check if STATE_REWIND is associated with onPlaybackStateChanged() and onCurrentPositionChanged() callback | testStateRewinding | {
"repo_name": "aosp-mirror/platform_frameworks_support",
"path": "leanback/src/androidTest/java/androidx/leanback/media/MediaControllerAdapterTest.java",
"license": "apache-2.0",
"size": 36826
} | [
"android.os.Build",
"android.support.test.filters.SdkSuppress",
"android.support.v4.media.session.PlaybackStateCompat",
"org.junit.Assert"
] | import android.os.Build; import android.support.test.filters.SdkSuppress; import android.support.v4.media.session.PlaybackStateCompat; import org.junit.Assert; | import android.os.*; import android.support.test.filters.*; import android.support.v4.media.session.*; import org.junit.*; | [
"android.os",
"android.support",
"org.junit"
] | android.os; android.support; org.junit; | 1,278,437 |
private void printLineChecked(String line) throws IOException {
if (!isLHD && line.startsWith(";###RHD###")) {
writer.write(line.substring(10) + newline);
} else if (isLHD && line.startsWith(";###LHD###")) {
writer.write(line.substring(10) + newline);
} else {
writer.write(line + newline);
}
} | void function(String line) throws IOException { if (!isLHD && line.startsWith(STR)) { writer.write(line.substring(10) + newline); } else if (isLHD && line.startsWith(STR)) { writer.write(line.substring(10) + newline); } else { writer.write(line + newline); } } | /**
* checks for LHD/RHD specific code.
* @param line
* @throws IOException
*/ | checks for LHD/RHD specific code | printLineChecked | {
"repo_name": "memo33/NAMControllerCompiler",
"path": "src/model/RUL1Entry.java",
"license": "mit",
"size": 2680
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,329,763 |
public synchronized JobID getNewJobId() throws IOException {
return new JobID(getTrackerIdentifier(), nextJobId++);
} | synchronized JobID function() throws IOException { return new JobID(getTrackerIdentifier(), nextJobId++); } | /**
* Allocates a new JobId string.
*/ | Allocates a new JobId string | getNewJobId | {
"repo_name": "zxqt223/hadoop-ha.1.0.3",
"path": "src/mapred/org/apache/hadoop/mapred/JobTracker.java",
"license": "apache-2.0",
"size": 199505
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,906,881 |
T lastOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate); | T lastOrDefault(Queryable<T> source, FunctionExpression<Predicate1<T>> predicate); | /**
* Returns the last element of a sequence that
* satisfies a condition or a default value if no such element is
* found.
*/ | Returns the last element of a sequence that satisfies a condition or a default value if no such element is found | lastOrDefault | {
"repo_name": "minji-kim/calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/QueryableFactory.java",
"license": "apache-2.0",
"size": 27824
} | [
"org.apache.calcite.linq4j.function.Predicate1",
"org.apache.calcite.linq4j.tree.FunctionExpression"
] | import org.apache.calcite.linq4j.function.Predicate1; import org.apache.calcite.linq4j.tree.FunctionExpression; | import org.apache.calcite.linq4j.function.*; import org.apache.calcite.linq4j.tree.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 254,228 |
public void testSecurityContextBeanResource() throws HttpException, IOException, JAXBException {
GetMethod getMethod = new GetMethod(getBaseURI() + "/context/securitycontext/bean");
try {
client.executeMethod(getMethod);
assertEquals(200, getMethod.getStatusCode());
JAXBContext context =
JAXBContext.newInstance(ObjectFactory.class.getPackage().getName());
SecurityContextInfo secContextInfo =
(SecurityContextInfo)context.createUnmarshaller().unmarshal(getMethod
.getResponseBodyAsStream());
assertNotNull(secContextInfo);
assertEquals(false, secContextInfo.isSecure());
assertEquals(false, secContextInfo.isUserInRoleAdmin());
assertEquals(false, secContextInfo.isUserInRoleNull());
assertEquals(false, secContextInfo.isUserInRoleUser());
assertEquals("null", secContextInfo.getUserPrincipal());
assertNull(secContextInfo.getAuthScheme());
} finally {
getMethod.releaseConnection();
}
} | void function() throws HttpException, IOException, JAXBException { GetMethod getMethod = new GetMethod(getBaseURI() + STR); try { client.executeMethod(getMethod); assertEquals(200, getMethod.getStatusCode()); JAXBContext context = JAXBContext.newInstance(ObjectFactory.class.getPackage().getName()); SecurityContextInfo secContextInfo = (SecurityContextInfo)context.createUnmarshaller().unmarshal(getMethod .getResponseBodyAsStream()); assertNotNull(secContextInfo); assertEquals(false, secContextInfo.isSecure()); assertEquals(false, secContextInfo.isUserInRoleAdmin()); assertEquals(false, secContextInfo.isUserInRoleNull()); assertEquals(false, secContextInfo.isUserInRoleUser()); assertEquals("null", secContextInfo.getUserPrincipal()); assertNull(secContextInfo.getAuthScheme()); } finally { getMethod.releaseConnection(); } } | /**
* Tests that a security context can be injected via a bean method.
*
* @throws IOException
* @throws HttpException
* @throws JAXBException
*/ | Tests that a security context can be injected via a bean method | testSecurityContextBeanResource | {
"repo_name": "os890/wink_patches",
"path": "wink-itests/wink-itest/wink-itest-context/src/test/java/org/apache/wink/itest/securitycontext/SecurityContextTest.java",
"license": "apache-2.0",
"size": 7631
} | [
"java.io.IOException",
"javax.xml.bind.JAXBContext",
"javax.xml.bind.JAXBException",
"org.apache.commons.httpclient.HttpException",
"org.apache.commons.httpclient.methods.GetMethod",
"org.apache.wink.itest.securitycontext.xml.ObjectFactory",
"org.apache.wink.itest.securitycontext.xml.SecurityContextInfo"
] | import java.io.IOException; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.wink.itest.securitycontext.xml.ObjectFactory; import org.apache.wink.itest.securitycontext.xml.SecurityContextInfo; | import java.io.*; import javax.xml.bind.*; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.apache.wink.itest.securitycontext.xml.*; | [
"java.io",
"javax.xml",
"org.apache.commons",
"org.apache.wink"
] | java.io; javax.xml; org.apache.commons; org.apache.wink; | 1,109,884 |
@Test
public void intersection() {
Interval i1 = new Interval(-2.0, 3.0);
Interval i2 = new Interval(-1.0, 4.0);
Interval u = i1.getIntersection(i2);
TestCase.assertEquals(-1.0, u.min);
TestCase.assertEquals(3.0, u.max);
// test cumulativity
u = i2.getIntersection(i1);
TestCase.assertEquals(-1.0, u.min);
TestCase.assertEquals(3.0, u.max);
// test intervals that dont overlap
Interval i3 = new Interval(-3.0, -2.5);
u = i1.getIntersection(i3);
TestCase.assertEquals(0.0, u.min);
TestCase.assertEquals(0.0, u.max);
}
| void function() { Interval i1 = new Interval(-2.0, 3.0); Interval i2 = new Interval(-1.0, 4.0); Interval u = i1.getIntersection(i2); TestCase.assertEquals(-1.0, u.min); TestCase.assertEquals(3.0, u.max); u = i2.getIntersection(i1); TestCase.assertEquals(-1.0, u.min); TestCase.assertEquals(3.0, u.max); Interval i3 = new Interval(-3.0, -2.5); u = i1.getIntersection(i3); TestCase.assertEquals(0.0, u.min); TestCase.assertEquals(0.0, u.max); } | /**
* Test the intersection methods.
*/ | Test the intersection methods | intersection | {
"repo_name": "diego4522/dyn4j",
"path": "junit/org/dyn4j/geometry/IntervalTest.java",
"license": "bsd-3-clause",
"size": 9358
} | [
"junit.framework.TestCase",
"org.dyn4j.geometry.Interval"
] | import junit.framework.TestCase; import org.dyn4j.geometry.Interval; | import junit.framework.*; import org.dyn4j.geometry.*; | [
"junit.framework",
"org.dyn4j.geometry"
] | junit.framework; org.dyn4j.geometry; | 2,329,085 |
public ValueAddEventService getValueAddEventService()
{
return valueAddEventService;
} | ValueAddEventService function() { return valueAddEventService; } | /**
* Returns the service for handling updates to events.
* @return revision service
*/ | Returns the service for handling updates to events | getValueAddEventService | {
"repo_name": "b-cuts/esper",
"path": "esper/src/main/java/com/espertech/esper/core/service/EPServicesContext.java",
"license": "gpl-2.0",
"size": 26818
} | [
"com.espertech.esper.event.vaevent.ValueAddEventService"
] | import com.espertech.esper.event.vaevent.ValueAddEventService; | import com.espertech.esper.event.vaevent.*; | [
"com.espertech.esper"
] | com.espertech.esper; | 850,612 |
int searchCount(String search, ReportGroupType type, ReportGroupStatus status) throws DataOperationException; | int searchCount(String search, ReportGroupType type, ReportGroupStatus status) throws DataOperationException; | /**
* Counts the records available that match the search criteria.
*
* @param search
* The search query.
* @param type
* The ReportGroupType to filter on, optional.
* @param status
* The ReportGroupStatus to filter on, optional.
* @return The number of matching records.
* @throws DataOperationException
* If the query could not be executed.
*/ | Counts the records available that match the search criteria | searchCount | {
"repo_name": "efsavage/ajah",
"path": "ajah-report/src/main/java/com/ajah/report/group/data/ReportGroupDao.java",
"license": "apache-2.0",
"size": 3117
} | [
"com.ajah.report.group.ReportGroupStatus",
"com.ajah.report.group.ReportGroupType",
"com.ajah.spring.jdbc.err.DataOperationException"
] | import com.ajah.report.group.ReportGroupStatus; import com.ajah.report.group.ReportGroupType; import com.ajah.spring.jdbc.err.DataOperationException; | import com.ajah.report.group.*; import com.ajah.spring.jdbc.err.*; | [
"com.ajah.report",
"com.ajah.spring"
] | com.ajah.report; com.ajah.spring; | 277,884 |
@Override
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
javax.swing.Action escapeAction = new AbstractAction("ESCAPE") {
private static final long serialVersionUID = -4036804004190858925L; | JRootPane function() { JRootPane rootPane = new JRootPane(); javax.swing.Action escapeAction = new AbstractAction(STR) { private static final long serialVersionUID = -4036804004190858925L; | /**
* Allow Dialog to be closed by ESC key
*/ | Allow Dialog to be closed by ESC key | createRootPane | {
"repo_name": "max3163/jmeter",
"path": "src/core/org/apache/jmeter/functions/gui/FunctionHelper.java",
"license": "apache-2.0",
"size": 9652
} | [
"javax.swing.AbstractAction",
"javax.swing.Action",
"javax.swing.JRootPane"
] | import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JRootPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 597,332 |
public Builder addRootSymlinks(Map<PathFragment, Artifact> symlinks) {
for (Map.Entry<PathFragment, Artifact> symlink : symlinks.entrySet()) {
rootSymlinksBuilder.add(new SymlinkEntry(symlink.getKey(), symlink.getValue()));
}
return this;
} | Builder function(Map<PathFragment, Artifact> symlinks) { for (Map.Entry<PathFragment, Artifact> symlink : symlinks.entrySet()) { rootSymlinksBuilder.add(new SymlinkEntry(symlink.getKey(), symlink.getValue())); } return this; } | /**
* Adds several root symlinks.
*/ | Adds several root symlinks | addRootSymlinks | {
"repo_name": "whuwxl/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java",
"license": "apache-2.0",
"size": 43416
} | [
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.vfs.PathFragment",
"java.util.Map"
] | import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Map; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.vfs.*; import java.util.*; | [
"com.google.devtools",
"java.util"
] | com.google.devtools; java.util; | 611,255 |
protected Map<String, SortedSet<String>> getHlogsByIdRecoveredQueues() {
return Collections.unmodifiableMap(hlogsByIdRecoveredQueues);
} | Map<String, SortedSet<String>> function() { return Collections.unmodifiableMap(hlogsByIdRecoveredQueues); } | /**
* Get a copy of the hlogs of the recovered sources on this rs
* @return a sorted set of hlog names
*/ | Get a copy of the hlogs of the recovered sources on this rs | getHlogsByIdRecoveredQueues | {
"repo_name": "mapr/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java",
"license": "apache-2.0",
"size": 21623
} | [
"java.util.Collections",
"java.util.Map",
"java.util.SortedSet"
] | import java.util.Collections; import java.util.Map; import java.util.SortedSet; | import java.util.*; | [
"java.util"
] | java.util; | 958,555 |
public void setCurrentOverlappingPair(BroadPhasePair overlappingPair) {
mCurrentOverlappingPair = overlappingPair;
} | void function(BroadPhasePair overlappingPair) { mCurrentOverlappingPair = overlappingPair; } | /**
* Sets the current overlapping pair.
*
* @param overlappingPair The overlapping pair
*/ | Sets the current overlapping pair | setCurrentOverlappingPair | {
"repo_name": "flow/react",
"path": "src/main/java/com/flowpowered/react/collision/narrowphase/NarrowPhaseAlgorithm.java",
"license": "mit",
"size": 3132
} | [
"com.flowpowered.react.collision.BroadPhasePair"
] | import com.flowpowered.react.collision.BroadPhasePair; | import com.flowpowered.react.collision.*; | [
"com.flowpowered.react"
] | com.flowpowered.react; | 2,077,920 |
@Override
public String toScript() {
// Python case
StringBuffer s = new StringBuffer("MPS(");
String f = null;
try {
f = ((RingElem<C>) coFac).toScriptFactory(); // sic
} catch (Exception e) {
f = coFac.toScript();
}
s.append(f + ",\"" + varsToString() + "\"," + truncate + ")");
return s.toString();
} | String function() { StringBuffer s = new StringBuffer("MPS("); String f = null; try { f = ((RingElem<C>) coFac).toScriptFactory(); } catch (Exception e) { f = coFac.toScript(); } s.append(f + ",\"STR\"," + truncate + ")"); return s.toString(); } | /**
* Get a scripting compatible string representation.
* @return script compatible representation for this ElemFactory.
* @see edu.jas.structure.ElemFactory#toScript()
*/ | Get a scripting compatible string representation | toScript | {
"repo_name": "breandan/java-algebra-system",
"path": "src/edu/jas/ps/MultiVarPowerSeriesRing.java",
"license": "gpl-2.0",
"size": 20916
} | [
"edu.jas.structure.RingElem"
] | import edu.jas.structure.RingElem; | import edu.jas.structure.*; | [
"edu.jas.structure"
] | edu.jas.structure; | 398,054 |
protected void addTransportJMSSessionTransactedPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_InboundEndpoint_transportJMSSessionTransacted_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_InboundEndpoint_transportJMSSessionTransacted_feature", "_UI_InboundEndpoint_type"),
EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_JMS_SESSION_TRANSACTED, true, false, false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, "Parameters", null));
} | void function(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_JMS_SESSION_TRANSACTED, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, STR, null)); } | /**
* This adds a property descriptor for the Transport JMS Session Transacted
* feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/ | This adds a property descriptor for the Transport JMS Session Transacted feature. | addTransportJMSSessionTransactedPropertyDescriptor | {
"repo_name": "nwnpallewela/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/InboundEndpointItemProvider.java",
"license": "apache-2.0",
"size": 165854
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage; | import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*; | [
"org.eclipse.emf",
"org.wso2.developerstudio"
] | org.eclipse.emf; org.wso2.developerstudio; | 2,530,749 |
public void close(final boolean cleanupOnError) throws StandardException
{
if (!isOpen)
return;
GemFireTransaction gft = (GemFireTransaction) this.lcc.getTransactionExecute();
if(gft != null) {
gft.release();
}
if (! dumpedStats)
{
//GemStone changes BEGIN
if (runtimeStatisticsOn && !doesCommit() && !lcc.isConnectionForRemote()
//GemStone changes END
)
{
endExecutionTime = statisticsTimingOn ? XPLAINUtil.currentTimeMillis() : 0;
ExecutionFactory ef = lcc.getLanguageConnectionFactory()
.getExecutionFactory();
ResultSetStatisticsFactory rssf = ef.getResultSetStatisticsFactory();
// GemStone changes BEGIN
final HeaderPrintWriter istream;
final boolean logPlan = lcc.getLogQueryPlan();
if (logPlan || lcc.getRunTimeStatisticsModeExplicit()) {
lcc.setRunTimeStatisticsObject(rssf.getRunTimeStatistics(activation,
this, subqueryTrackingArray));
istream = logPlan ? Monitor.getStream() : null;
}
else {
istream = null;
}
// GemStone changes END
if (istream != null)
{
istream.printlnWithHeader(LanguageConnectionContext.xidStr +
lcc.getTransactionExecute().getTransactionIdString() +
"), " +
LanguageConnectionContext.lccStr +
lcc.getInstanceNumber() +
"), " +
lcc.getRunTimeStatisticsObject().getStatementText() + " ******* " +
lcc.getRunTimeStatisticsObject().getStatementExecutionPlanText());
}
if (!cleanupOnError) {
// now explain gathered statistics, using an appropriate visitor
ResultSetStatisticsVisitor visitor = ef.getXPLAINFactory()
.getXPLAINVisitor(lcc, statsEnabled, explainConnection);
visitor.doXPLAIN(this, activation, true, statisticsTimingOn, false);
// GemStone changes BEGIN
executionPlanID = visitor.getStatementUUID();
// GemStone changes END
}
}
dumpedStats = true;
}
int staLength = (subqueryTrackingArray == null) ? 0 :
subqueryTrackingArray.length;
for (int index = 0; index < staLength; index++)
{
if (subqueryTrackingArray[index] == null)
{
continue;
}
if (subqueryTrackingArray[index].isClosed())
{
continue;
}
subqueryTrackingArray[index].close(cleanupOnError);
}
// GemStone changes BEGIN
// reset the statistics variables
if (!lcc.isConnectionForRemote()) {
resetStatistics();
}
// GemStone changes END
isOpen = false;
if (activation.isSingleExecution())
activation.close();
} | void function(final boolean cleanupOnError) throws StandardException { if (!isOpen) return; GemFireTransaction gft = (GemFireTransaction) this.lcc.getTransactionExecute(); if(gft != null) { gft.release(); } if (! dumpedStats) { if (runtimeStatisticsOn && !doesCommit() && !lcc.isConnectionForRemote() ) { endExecutionTime = statisticsTimingOn ? XPLAINUtil.currentTimeMillis() : 0; ExecutionFactory ef = lcc.getLanguageConnectionFactory() .getExecutionFactory(); ResultSetStatisticsFactory rssf = ef.getResultSetStatisticsFactory(); final HeaderPrintWriter istream; final boolean logPlan = lcc.getLogQueryPlan(); if (logPlan lcc.getRunTimeStatisticsModeExplicit()) { lcc.setRunTimeStatisticsObject(rssf.getRunTimeStatistics(activation, this, subqueryTrackingArray)); istream = logPlan ? Monitor.getStream() : null; } else { istream = null; } if (istream != null) { istream.printlnWithHeader(LanguageConnectionContext.xidStr + lcc.getTransactionExecute().getTransactionIdString() + STR + LanguageConnectionContext.lccStr + lcc.getInstanceNumber() + STR + lcc.getRunTimeStatisticsObject().getStatementText() + STR + lcc.getRunTimeStatisticsObject().getStatementExecutionPlanText()); } if (!cleanupOnError) { ResultSetStatisticsVisitor visitor = ef.getXPLAINFactory() .getXPLAINVisitor(lcc, statsEnabled, explainConnection); visitor.doXPLAIN(this, activation, true, statisticsTimingOn, false); executionPlanID = visitor.getStatementUUID(); } } dumpedStats = true; } int staLength = (subqueryTrackingArray == null) ? 0 : subqueryTrackingArray.length; for (int index = 0; index < staLength; index++) { if (subqueryTrackingArray[index] == null) { continue; } if (subqueryTrackingArray[index].isClosed()) { continue; } subqueryTrackingArray[index].close(cleanupOnError); } if (!lcc.isConnectionForRemote()) { resetStatistics(); } isOpen = false; if (activation.isSingleExecution()) activation.close(); } | /**
* Dump the stat if not already done so. Close all of the open subqueries.
*
* @exception StandardException thrown on error
*/ | Dump the stat if not already done so. Close all of the open subqueries | close | {
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/execute/NoRowsResultSetImpl.java",
"license": "apache-2.0",
"size": 23363
} | [
"com.pivotal.gemfirexd.internal.engine.access.GemFireTransaction",
"com.pivotal.gemfirexd.internal.iapi.error.StandardException",
"com.pivotal.gemfirexd.internal.iapi.services.monitor.Monitor",
"com.pivotal.gemfirexd.internal.iapi.services.stream.HeaderPrintWriter",
"com.pivotal.gemfirexd.internal.iapi.sql.conn.LanguageConnectionContext",
"com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecutionFactory",
"com.pivotal.gemfirexd.internal.iapi.sql.execute.ResultSetStatisticsFactory",
"com.pivotal.gemfirexd.internal.impl.sql.execute.xplain.XPLAINUtil"
] | import com.pivotal.gemfirexd.internal.engine.access.GemFireTransaction; import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.services.monitor.Monitor; import com.pivotal.gemfirexd.internal.iapi.services.stream.HeaderPrintWriter; import com.pivotal.gemfirexd.internal.iapi.sql.conn.LanguageConnectionContext; import com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecutionFactory; import com.pivotal.gemfirexd.internal.iapi.sql.execute.ResultSetStatisticsFactory; import com.pivotal.gemfirexd.internal.impl.sql.execute.xplain.XPLAINUtil; | import com.pivotal.gemfirexd.internal.engine.access.*; import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.services.monitor.*; import com.pivotal.gemfirexd.internal.iapi.services.stream.*; import com.pivotal.gemfirexd.internal.iapi.sql.conn.*; import com.pivotal.gemfirexd.internal.iapi.sql.execute.*; import com.pivotal.gemfirexd.internal.impl.sql.execute.xplain.*; | [
"com.pivotal.gemfirexd"
] | com.pivotal.gemfirexd; | 1,064,484 |
protected RemoteRepository createCentralRepository() {
return createRemoteRepository("central", "default", "http://repo1.maven.org/maven2/");
} | RemoteRepository function() { return createRemoteRepository(STR, STR, "http: } | /**
* Creates the Maven central repository specification.
*
* @return the Maven central repository specification.
*/ | Creates the Maven central repository specification | createCentralRepository | {
"repo_name": "nethad/clustermeister",
"path": "provisioning/src/main/java/com/github/nethad/clustermeister/provisioning/dependencymanager/MavenRepositorySystem.java",
"license": "apache-2.0",
"size": 17014
} | [
"org.sonatype.aether.repository.RemoteRepository"
] | import org.sonatype.aether.repository.RemoteRepository; | import org.sonatype.aether.repository.*; | [
"org.sonatype.aether"
] | org.sonatype.aether; | 2,095,379 |
// init pref file
UserPrefs pref = new UserPrefs(activity);
boolean wifiPreference = pref.isDownloadOverWifiOnly();
boolean connectedToWifi = NetworkUtil.isConnectedWifi(activity);
boolean connectedMobile = NetworkUtil.isConnectedMobile(activity);
boolean isOnZeroRatedNetwork = NetworkUtil.isOnZeroRatedNetwork(activity, config);
if (connectedToWifi || (connectedMobile && isOnZeroRatedNetwork)
|| (connectedMobile && !wifiPreference)) {
//no consent needed, continue playback
consentCallback.onPositiveClicked();
} else {
consentCallback.onNegativeClicked();
}
} | UserPrefs pref = new UserPrefs(activity); boolean wifiPreference = pref.isDownloadOverWifiOnly(); boolean connectedToWifi = NetworkUtil.isConnectedWifi(activity); boolean connectedMobile = NetworkUtil.isConnectedMobile(activity); boolean isOnZeroRatedNetwork = NetworkUtil.isOnZeroRatedNetwork(activity, config); if (connectedToWifi (connectedMobile && isOnZeroRatedNetwork) (connectedMobile && !wifiPreference)) { consentCallback.onPositiveClicked(); } else { consentCallback.onNegativeClicked(); } } | /**
* Handles playback by checking user preferences and network connectivity.
* If the device is connected to the following, return positive callback
* 1. WIFI
* 2. Is connected to mobile and on zero rated network
* 3. Is connected to mobile network and wifi preference is off
*/ | Handles playback by checking user preferences and network connectivity. If the device is connected to the following, return positive callback 1. WIFI 2. Is connected to mobile and on zero rated network 3. Is connected to mobile network and wifi preference is off | consentToMediaPlayback | {
"repo_name": "miptliot/edx-app-android",
"path": "VideoLocker/src/main/java/org/edx/mobile/util/MediaConsentUtils.java",
"license": "apache-2.0",
"size": 3041
} | [
"org.edx.mobile.module.prefs.UserPrefs"
] | import org.edx.mobile.module.prefs.UserPrefs; | import org.edx.mobile.module.prefs.*; | [
"org.edx.mobile"
] | org.edx.mobile; | 1,026,595 |
response.setContentLength(0);
response.setStatus(HttpServletResponse.SC_OK);
} | response.setContentLength(0); response.setStatus(HttpServletResponse.SC_OK); } | /**
* Response to HEAD request with a HTTP_OK and no content, as defined by the standard.
* @param response
*/ | Response to HEAD request with a HTTP_OK and no content, as defined by the standard | healthCheckHead | {
"repo_name": "Canadensys/vascan",
"path": "src/main/java/net/canadensys/dataportal/vascan/controller/HealthController.java",
"license": "mit",
"size": 1655
} | [
"javax.servlet.http.HttpServletResponse"
] | import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 1,796,182 |
public static void prepareDownload(HttpServletResponse response, File file, String mimeType) {
if (file.exists() == false) {
throw new IllegalArgumentException("File not found: " + file);
}
if (file.length() > Integer.MAX_VALUE) {
throw new IllegalArgumentException("File too big: " + file);
}
prepareResponse(response, file.getAbsolutePath(), mimeType, (int) file.length());
} | static void function(HttpServletResponse response, File file, String mimeType) { if (file.exists() == false) { throw new IllegalArgumentException(STR + file); } if (file.length() > Integer.MAX_VALUE) { throw new IllegalArgumentException(STR + file); } prepareResponse(response, file.getAbsolutePath(), mimeType, (int) file.length()); } | /**
* Prepares response for file download with provided mime type.
*/ | Prepares response for file download with provided mime type | prepareDownload | {
"repo_name": "wsldl123292/jodd",
"path": "jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java",
"license": "bsd-3-clause",
"size": 23646
} | [
"java.io.File",
"javax.servlet.http.HttpServletResponse"
] | import java.io.File; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,231,776 |
Servlet createServlet(ApplicationContext context, String servletClass); | Servlet createServlet(ApplicationContext context, String servletClass); | /**
* Creates a servlet of the given {@code servletClass} with a classloader of the given {@code context}.
*
* @param context {@link ApplicationContext} instance
* @param servletClass Fully qualified name of the created servlet
* @return {@link Servlet} instance
*/ | Creates a servlet of the given servletClass with a classloader of the given context | createServlet | {
"repo_name": "dimone-kun/cuba",
"path": "modules/global/src/com/haulmont/cuba/core/sys/servlet/ServletRegistrationManager.java",
"license": "apache-2.0",
"size": 1897
} | [
"javax.servlet.Servlet",
"org.springframework.context.ApplicationContext"
] | import javax.servlet.Servlet; import org.springframework.context.ApplicationContext; | import javax.servlet.*; import org.springframework.context.*; | [
"javax.servlet",
"org.springframework.context"
] | javax.servlet; org.springframework.context; | 2,697,948 |
@Command
@NotifyChange({SELECTED_BRANCH, MODERATING_BRANCHES, SHOW_MODERATOR_GROUP_SELECTION_PART})
public void saveModeratorForCurrentBranch(@BindingParam("branch") PoulpeBranch branch) {
branches.setModeratingGroupForCurrentBranch(selectedGroup, branch);
closeDeleteModeratorGroupDialog();
} | @NotifyChange({SELECTED_BRANCH, MODERATING_BRANCHES, SHOW_MODERATOR_GROUP_SELECTION_PART}) void function(@BindingParam(STR) PoulpeBranch branch) { branches.setModeratingGroupForCurrentBranch(selectedGroup, branch); closeDeleteModeratorGroupDialog(); } | /**
* If moderator group were changed for branch, given as parameter, saves moderator group for this branch.
*
* @param branch {@link PoulpeBranch} key field for map
*/ | If moderator group were changed for branch, given as parameter, saves moderator group for this branch | saveModeratorForCurrentBranch | {
"repo_name": "jtalks-org/poulpe",
"path": "poulpe-view/poulpe-web-controller/src/main/java/org/jtalks/poulpe/web/controller/group/UserGroupVm.java",
"license": "lgpl-2.1",
"size": 13715
} | [
"org.jtalks.poulpe.model.entity.PoulpeBranch",
"org.zkoss.bind.annotation.BindingParam",
"org.zkoss.bind.annotation.NotifyChange"
] | import org.jtalks.poulpe.model.entity.PoulpeBranch; import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.NotifyChange; | import org.jtalks.poulpe.model.entity.*; import org.zkoss.bind.annotation.*; | [
"org.jtalks.poulpe",
"org.zkoss.bind"
] | org.jtalks.poulpe; org.zkoss.bind; | 1,312,116 |
static public File getLastPath(String fileChooserID, File defaultDirectory) {
File path = jfcLastPaths.get(fileChooserID);
if (path != null)
return path;
if (defaultDirectory != null)
return defaultDirectory;
return FileSystemView.getFileSystemView().getHomeDirectory();
} | static File function(String fileChooserID, File defaultDirectory) { File path = jfcLastPaths.get(fileChooserID); if (path != null) return path; if (defaultDirectory != null) return defaultDirectory; return FileSystemView.getFileSystemView().getHomeDirectory(); } | /**
* Returns the Last Path for this fileChooserID
* @param fileChooserID, the id that distinguishes the wanted files (i.e. "TEMPLATES_FILECHOOSER")
* @param defaultDirectory, the default directory to go for the first time. It allows null, which
* means the user's home directory.
* @return
*/ | Returns the Last Path for this fileChooserID | getLastPath | {
"repo_name": "iCarto/siga",
"path": "libUIComponent/src/org/gvsig/gui/beans/swing/JFileChooser.java",
"license": "gpl-3.0",
"size": 7556
} | [
"java.io.File",
"javax.swing.filechooser.FileSystemView"
] | import java.io.File; import javax.swing.filechooser.FileSystemView; | import java.io.*; import javax.swing.filechooser.*; | [
"java.io",
"javax.swing"
] | java.io; javax.swing; | 2,681,590 |
public boolean removeRecordOwner(RecordOwnerParent recordOwner)
{
return this.remove(recordOwner);
} | boolean function(RecordOwnerParent recordOwner) { return this.remove(recordOwner); } | /**
* Remove this record owner to my list.
* @param recordOwner The recordowner to remove.
*/ | Remove this record owner to my list | removeRecordOwner | {
"repo_name": "jbundle/jbundle",
"path": "thin/base/thread/src/main/java/org/jbundle/thin/base/thread/RecordOwnerCollection.java",
"license": "gpl-3.0",
"size": 1810
} | [
"org.jbundle.model.RecordOwnerParent"
] | import org.jbundle.model.RecordOwnerParent; | import org.jbundle.model.*; | [
"org.jbundle.model"
] | org.jbundle.model; | 1,518,444 |
public CacheConfiguration<K, V> setRebalanceMode(CacheRebalanceMode rebalanceMode) {
this.rebalanceMode = rebalanceMode;
return this;
} | CacheConfiguration<K, V> function(CacheRebalanceMode rebalanceMode) { this.rebalanceMode = rebalanceMode; return this; } | /**
* Sets cache rebalance mode.
*
* @param rebalanceMode Rebalance mode.
* @return {@code this} for chaining.
*/ | Sets cache rebalance mode | setRebalanceMode | {
"repo_name": "afinka77/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java",
"license": "apache-2.0",
"size": 98164
} | [
"org.apache.ignite.cache.CacheRebalanceMode"
] | import org.apache.ignite.cache.CacheRebalanceMode; | import org.apache.ignite.cache.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 498,923 |
public void setImageNextButton(@DrawableRes final Drawable imageNextButton) {
final ImageView nextButton = (ImageView) findViewById(R.id.next);
nextButton.setImageDrawable(imageNextButton);
} | void function(@DrawableRes final Drawable imageNextButton) { final ImageView nextButton = (ImageView) findViewById(R.id.next); nextButton.setImageDrawable(imageNextButton); } | /**
* Override Next button
*
* @param imageNextButton your drawable resource
*/ | Override Next button | setImageNextButton | {
"repo_name": "mingjunli/GithubApp",
"path": "appintro/src/main/java/com/github/paolorotolo/appintro/AppIntro.java",
"license": "apache-2.0",
"size": 3948
} | [
"android.graphics.drawable.Drawable",
"android.support.annotation.DrawableRes",
"android.widget.ImageView"
] | import android.graphics.drawable.Drawable; import android.support.annotation.DrawableRes; import android.widget.ImageView; | import android.graphics.drawable.*; import android.support.annotation.*; import android.widget.*; | [
"android.graphics",
"android.support",
"android.widget"
] | android.graphics; android.support; android.widget; | 2,181,269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.