method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public int emptyTrash(Users user) { TypedQuery query = em.createNamedQuery("Message.emptyToAndDeleted", Long.class) .setParameter("to", user) .setParameter("deleted", true); try { return query.executeUpdate(); } catch (NoResultException e) { return 0; } }
int function(Users user) { TypedQuery query = em.createNamedQuery(STR, Long.class) .setParameter("to", user) .setParameter(STR, true); try { return query.executeUpdate(); } catch (NoResultException e) { return 0; } }
/** * Empty trash * * @param user * @return */
Empty trash
emptyTrash
{ "repo_name": "FilotasSiskos/hopsworks", "path": "hopsworks-common/src/main/java/io/hops/hopsworks/common/dao/message/MessageFacade.java", "license": "agpl-3.0", "size": 4354 }
[ "io.hops.hopsworks.common.dao.user.Users", "javax.persistence.NoResultException", "javax.persistence.TypedQuery" ]
import io.hops.hopsworks.common.dao.user.Users; import javax.persistence.NoResultException; import javax.persistence.TypedQuery;
import io.hops.hopsworks.common.dao.user.*; import javax.persistence.*;
[ "io.hops.hopsworks", "javax.persistence" ]
io.hops.hopsworks; javax.persistence;
1,358,386
private String getMachineName() { String machName = "Cannot fetch System Name."; try { java.net.InetAddress info = java.net.InetAddress.getLocalHost(); machName = info.getHostName(); } catch (UnknownHostException e) { JOptionPane.showMessageDialog(null, "Error: System Name cannot be fetched."); e.printStackTrace(); } return machName; }
String function() { String machName = STR; try { java.net.InetAddress info = java.net.InetAddress.getLocalHost(); machName = info.getHostName(); } catch (UnknownHostException e) { JOptionPane.showMessageDialog(null, STR); e.printStackTrace(); } return machName; }
/** * Finds the network name of this system. * * @return the name of this machine as visible to other computers on * network. */
Finds the network name of this system
getMachineName
{ "repo_name": "afsheenrane/BigRedButton", "path": "Server [Button]/redbutton/MainRedButtonServer.java", "license": "mit", "size": 8574 }
[ "java.net.UnknownHostException", "javax.swing.JOptionPane" ]
import java.net.UnknownHostException; import javax.swing.JOptionPane;
import java.net.*; import javax.swing.*;
[ "java.net", "javax.swing" ]
java.net; javax.swing;
1,343,492
EReference getAxisType_Meaning();
EReference getAxisType_Meaning();
/** * Returns the meta object for the containment reference '{@link net.opengis.wcs11.AxisType#getMeaning <em>Meaning</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Meaning</em>'. * @see net.opengis.wcs11.AxisType#getMeaning() * @see #getAxisType() * @generated */
Returns the meta object for the containment reference '<code>net.opengis.wcs11.AxisType#getMeaning Meaning</code>'.
getAxisType_Meaning
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.wcs/src/net/opengis/wcs11/Wcs11Package.java", "license": "lgpl-2.1", "size": 160605 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
895,560
private Packet nextPacket() { Packet packet = null; // Wait until there's a packet or we're done. while (!done && (packet = queue.poll()) == null) { try { synchronized (queue) { queue.wait(); } } catch (InterruptedException ie) { // Do nothing } } return packet; }
Packet function() { Packet packet = null; while (!done && (packet = queue.poll()) == null) { try { synchronized (queue) { queue.wait(); } } catch (InterruptedException ie) { } } return packet; }
/** * Returns the next available packet from the queue for writing. * * @return the next packet for writing. */
Returns the next available packet from the queue for writing
nextPacket
{ "repo_name": "zhouzhouluo/chunpn", "path": "asmack/org/jivesoftware/smack/PacketWriterex.java", "license": "apache-2.0", "size": 11064 }
[ "org.jivesoftware.smack.packet.Packet" ]
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
2,708,217
private String stackTraceStr(final Throwable error) { if (error == null) { return ""; } StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); error.printStackTrace(pw); pw.close(); return sw.toString(); } /** Test that if separate reader and writer objects are opened, new categories written into the writer are available to a reader only after a commit(). Note that this test obviously doesn't cover all the different concurrency scenarios, all different methods, and so on. We may want to write more tests of this sort.
String function(final Throwable error) { if (error == null) { return ""; } StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); error.printStackTrace(pw); pw.close(); return sw.toString(); } /** Test that if separate reader and writer objects are opened, new categories written into the writer are available to a reader only after a commit(). Note that this test obviously doesn't cover all the different concurrency scenarios, all different methods, and so on. We may want to write more tests of this sort.
/** Grab the stack trace into a string since the exception was thrown in a thread and we want the assert * outside the thread to show the stack trace in case of failure. */
Grab the stack trace into a string since the exception was thrown in a thread and we want the assert
stackTraceStr
{ "repo_name": "terrancesnyder/solr-analytics", "path": "lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java", "license": "apache-2.0", "size": 42104 }
[ "java.io.PrintWriter", "java.io.StringWriter", "org.junit.Test" ]
import java.io.PrintWriter; import java.io.StringWriter; import org.junit.Test;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
2,319,165
public float getOldGenAllocationRatio() { MemoryPoolMXBean oldGenBean = getMatchedMemoryPool(".*Old.*|.*Tenured.*"); MemoryUsage usage = oldGenBean.getUsage(); System.out.format("Memory usage for %1s.\n", oldGenBean.getName()); System.out.format("Used: %1d\n", usage.getUsed()); System.out.format("Commited: %1d\n", usage.getCommitted()); System.out.format("Max: %1d\n", usage.getMax()); return ((float) usage.getUsed()) / usage.getCommitted(); }
float function() { MemoryPoolMXBean oldGenBean = getMatchedMemoryPool(STR); MemoryUsage usage = oldGenBean.getUsage(); System.out.format(STR, oldGenBean.getName()); System.out.format(STR, usage.getUsed()); System.out.format(STR, usage.getCommitted()); System.out.format(STR, usage.getMax()); return ((float) usage.getUsed()) / usage.getCommitted(); }
/** * Returns allocation rate for old gen based on appropriate MemoryPoolMXBean * memory usage. * * @return allocation rate */
Returns allocation rate for old gen based on appropriate MemoryPoolMXBean memory usage
getOldGenAllocationRatio
{ "repo_name": "md-5/jdk10", "path": "test/hotspot/jtreg/serviceability/tmtools/jstat/utils/GarbageProducer.java", "license": "gpl-2.0", "size": 4972 }
[ "java.lang.management.MemoryPoolMXBean", "java.lang.management.MemoryUsage" ]
import java.lang.management.MemoryPoolMXBean; import java.lang.management.MemoryUsage;
import java.lang.management.*;
[ "java.lang" ]
java.lang;
2,547,468
Value<Boolean> wet();
Value<Boolean> wet();
/** * Gets the {@link Value} for the "wet" state. * * @return The value for the wet state * @see Keys#IS_WET */
Gets the <code>Value</code> for the "wet" state
wet
{ "repo_name": "JBYoshi/SpongeAPI", "path": "src/main/java/org/spongepowered/api/data/manipulator/mutable/WetData.java", "license": "mit", "size": 2135 }
[ "org.spongepowered.api.data.value.mutable.Value" ]
import org.spongepowered.api.data.value.mutable.Value;
import org.spongepowered.api.data.value.mutable.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
1,273,354
Clause[] search(Literal goal);
Clause[] search(Literal goal);
/** * Return an array of rules whose head matches the goal. * * @param goal the goal * @return the array of rules */
Return an array of rules whose head matches the goal
search
{ "repo_name": "davidar/datum", "path": "src/cc/vidr/datum/db/RuleDatabase.java", "license": "agpl-3.0", "size": 1366 }
[ "cc.vidr.datum.Clause", "cc.vidr.datum.Literal" ]
import cc.vidr.datum.Clause; import cc.vidr.datum.Literal;
import cc.vidr.datum.*;
[ "cc.vidr.datum" ]
cc.vidr.datum;
2,675,384
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { Log.d(TAG, "onCreateLoader: " + id); switch (id) { case ID_WL15_LOADER: // Query database Uri wl15QueryUri = TidesEntry.WL15_CONTENT_URI; return new CursorLoader(this, wl15QueryUri, new String[] {TidesEntry.COLUMN_DATE, TidesEntry.COLUMN_VALUE}, "(" + TidesEntry.COLUMN_STATION_ID + "=?) " + "AND (" + TidesEntry.COLUMN_DATE + " BETWEEN ? AND ?)", args.getStringArray(SELECTION_ARGS_KEY), TidesEntry.COLUMN_DATE + " ASC"); case ID_HILO_LOADER: Uri hiloQueryUri = TidesEntry.HILO_CONTENT_URI; return new CursorLoader(this, hiloQueryUri, new String[] {TidesEntry.COLUMN_DATE, TidesEntry.COLUMN_VALUE}, "(" + TidesEntry.COLUMN_STATION_ID + "=?) " + "AND (" + TidesEntry.COLUMN_DATE + " BETWEEN ? AND ?)", args.getStringArray(SELECTION_ARGS_KEY), TidesEntry.COLUMN_DATE + " ASC"); case ID_STATIONS_LOADER: Uri stationsQueryUri = TidesEntry.STATION_INFO_CONTENT_URI; return new CursorLoader(this, stationsQueryUri, new String[] { TidesEntry.COLUMN_STATION_ID, TidesEntry.COLUMN_STATION_NAME, TidesEntry.COLUMN_STATION_LON, TidesEntry.COLUMN_STATION_LAT }, null, null, TidesEntry.COLUMN_STATION_ID + " ASC"); default: throw new RuntimeException("Loader not implemented: " + id); } }
Loader<Cursor> function(int id, Bundle args) { Log.d(TAG, STR + id); switch (id) { case ID_WL15_LOADER: Uri wl15QueryUri = TidesEntry.WL15_CONTENT_URI; return new CursorLoader(this, wl15QueryUri, new String[] {TidesEntry.COLUMN_DATE, TidesEntry.COLUMN_VALUE}, "(" + TidesEntry.COLUMN_STATION_ID + STR + STR + TidesEntry.COLUMN_DATE + STR, args.getStringArray(SELECTION_ARGS_KEY), TidesEntry.COLUMN_DATE + STR); case ID_HILO_LOADER: Uri hiloQueryUri = TidesEntry.HILO_CONTENT_URI; return new CursorLoader(this, hiloQueryUri, new String[] {TidesEntry.COLUMN_DATE, TidesEntry.COLUMN_VALUE}, "(" + TidesEntry.COLUMN_STATION_ID + STR + STR + TidesEntry.COLUMN_DATE + STR, args.getStringArray(SELECTION_ARGS_KEY), TidesEntry.COLUMN_DATE + STR); case ID_STATIONS_LOADER: Uri stationsQueryUri = TidesEntry.STATION_INFO_CONTENT_URI; return new CursorLoader(this, stationsQueryUri, new String[] { TidesEntry.COLUMN_STATION_ID, TidesEntry.COLUMN_STATION_NAME, TidesEntry.COLUMN_STATION_LON, TidesEntry.COLUMN_STATION_LAT }, null, null, TidesEntry.COLUMN_STATION_ID + STR); default: throw new RuntimeException(STR + id); } }
/** * GraphView cursorLoader. Responsible for loading Cursor from database, and displaying it in * the current day's graph. */
GraphView cursorLoader. Responsible for loading Cursor from database, and displaying it in the current day's graph
onCreateLoader
{ "repo_name": "dsolven/Tides", "path": "app/src/main/java/com/solvetec/derek/tides/MainActivity.java", "license": "mit", "size": 29076 }
[ "android.database.Cursor", "android.net.Uri", "android.os.Bundle", "android.support.v4.content.CursorLoader", "android.support.v4.content.Loader", "android.util.Log", "com.solvetec.derek.tides.data.TidesContract" ]
import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.util.Log; import com.solvetec.derek.tides.data.TidesContract;
import android.database.*; import android.net.*; import android.os.*; import android.support.v4.content.*; import android.util.*; import com.solvetec.derek.tides.data.*;
[ "android.database", "android.net", "android.os", "android.support", "android.util", "com.solvetec.derek" ]
android.database; android.net; android.os; android.support; android.util; com.solvetec.derek;
2,005,588
public Permission[] listResourcePermissions() throws XMLDBException;
Permission[] function() throws XMLDBException;
/** * Get permissions for all resources contained in the current * collection. Returns a list of permissions in the same order * as Collection.listResources(). * * @return Permission[] * @throws XMLDBException */
Get permissions for all resources contained in the current collection. Returns a list of permissions in the same order as Collection.listResources()
listResourcePermissions
{ "repo_name": "shabanovd/exist", "path": "src/org/exist/xmldb/UserManagementService.java", "license": "lgpl-2.1", "size": 12212 }
[ "org.exist.security.Permission", "org.xmldb.api.base.XMLDBException" ]
import org.exist.security.Permission; import org.xmldb.api.base.XMLDBException;
import org.exist.security.*; import org.xmldb.api.base.*;
[ "org.exist.security", "org.xmldb.api" ]
org.exist.security; org.xmldb.api;
309,383
public static TimeLine<CalendarQuarter> timeline() { return FixedCalendarTimeLine.forQuarters(); }
static TimeLine<CalendarQuarter> function() { return FixedCalendarTimeLine.forQuarters(); }
/** * <p>Obtains a timeline for this type. </p> * * @return singleton timeline * @since 5.0 */
Obtains a timeline for this type.
timeline
{ "repo_name": "MenoData/Time4J", "path": "base/src/main/java/net/time4j/range/CalendarQuarter.java", "license": "lgpl-2.1", "size": 26858 }
[ "net.time4j.engine.TimeLine" ]
import net.time4j.engine.TimeLine;
import net.time4j.engine.*;
[ "net.time4j.engine" ]
net.time4j.engine;
1,228,975
public void deleteObjectTags(String taggedObject, String type, String userName) { List<Tag> tags = getTags(null, taggedObject, type, userName); for (Tag tag : tags) { deleteTag(tag); } } public static class TagException extends Exception { private static final long serialVersionUID = 8400582347265920471L; public TagException(String message) { super(message); } } public static class TagNameException extends TagException { private static final long serialVersionUID = 120037828345744006L; public TagNameException() { super(INVALID_NAME_MSG); } } public static class TagNamePermissionException extends TagException { private static final long serialVersionUID = -7843016338063884403L; private static final String PERMISSION_MESSAGE = "You cannot add a tag starting with " + TagNames.IM_PREFIX + ", " + "that is a reserved word."; public TagNamePermissionException() { super(PERMISSION_MESSAGE); } public TagNamePermissionException(String message) { super(message); } }
void function(String taggedObject, String type, String userName) { List<Tag> tags = getTags(null, taggedObject, type, userName); for (Tag tag : tags) { deleteTag(tag); } } public static class TagException extends Exception { private static final long serialVersionUID = 8400582347265920471L; public TagException(String message) { super(message); } } public static class TagNameException extends TagException { private static final long serialVersionUID = 120037828345744006L; public TagNameException() { super(INVALID_NAME_MSG); } } public static class TagNamePermissionException extends TagException { private static final long serialVersionUID = -7843016338063884403L; private static final String PERMISSION_MESSAGE = STR + TagNames.IM_PREFIX + STR + STR; public TagNamePermissionException() { super(PERMISSION_MESSAGE); } public TagNamePermissionException(String message) { super(message); } }
/** * Deletes all tags assigned to a specified object. * @param taggedObject tagged object * @param type tag type * @param userName user name */
Deletes all tags assigned to a specified object
deleteObjectTags
{ "repo_name": "zebrafishmine/intermine", "path": "intermine/api/main/src/org/intermine/api/profile/TagManager.java", "license": "lgpl-2.1", "size": 29543 }
[ "java.util.List", "org.intermine.api.tag.TagNames", "org.intermine.model.userprofile.Tag" ]
import java.util.List; import org.intermine.api.tag.TagNames; import org.intermine.model.userprofile.Tag;
import java.util.*; import org.intermine.api.tag.*; import org.intermine.model.userprofile.*;
[ "java.util", "org.intermine.api", "org.intermine.model" ]
java.util; org.intermine.api; org.intermine.model;
1,553,570
private String getSanitizedUrlScheme(String url) { if (url == null) { return null; } int colonIdx = url.indexOf(":"); if (colonIdx < 0) { // No scheme specified for the url return null; } String scheme = url.substring(0, colonIdx).toLowerCase(Locale.US).trim(); // Check for the presence of and get rid of all non-alphanumeric characters in the scheme, // except dash, plus and period. Those are the only valid scheme chars: // https://tools.ietf.org/html/rfc3986#section-3.1 boolean nonAlphaNum = false; for (char ch : scheme.toCharArray()) { if (!Character.isLetterOrDigit(ch) && ch != '-' && ch != '+' && ch != '.') { nonAlphaNum = true; break; } } if (nonAlphaNum) { scheme = scheme.replaceAll("[^a-z0-9.+-]", ""); } return scheme; }
String function(String url) { if (url == null) { return null; } int colonIdx = url.indexOf(":"); if (colonIdx < 0) { return null; } String scheme = url.substring(0, colonIdx).toLowerCase(Locale.US).trim(); boolean nonAlphaNum = false; for (char ch : scheme.toCharArray()) { if (!Character.isLetterOrDigit(ch) && ch != '-' && ch != '+' && ch != '.') { nonAlphaNum = true; break; } } if (nonAlphaNum) { scheme = scheme.replaceAll(STR, ""); } return scheme; }
/** * Parses the scheme out of the URL if possible, trimming and getting rid of unsafe characters. * This is useful for determining if a URL has a sneaky, unsafe scheme, e.g. "java script" or * "j$a$r". See: http://crbug.com/248398 * @return The sanitized URL scheme or null if no scheme is specified. */
Parses the scheme out of the URL if possible, trimming and getting rid of unsafe characters. This is useful for determining if a URL has a sneaky, unsafe scheme, e.g. "java script" or "j$a$r". See: HREF
getSanitizedUrlScheme
{ "repo_name": "Chilledheart/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java", "license": "bsd-3-clause", "size": 35933 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
2,806,984
static boolean positionsOrdered(Spans spans1, Spans spans2) { assert spans1.docID() == spans2.docID() : "doc1 " + spans1.docID() + " != doc2 " + spans2.docID(); int start1 = spans1.startPosition(); int start2 = spans2.startPosition(); return (start1 == start2) ? (spans1.endPosition() < spans2.endPosition()) : (start1 < start2); }
static boolean positionsOrdered(Spans spans1, Spans spans2) { assert spans1.docID() == spans2.docID() : STR + spans1.docID() + STR + spans2.docID(); int start1 = spans1.startPosition(); int start2 = spans2.startPosition(); return (start1 == start2) ? (spans1.endPosition() < spans2.endPosition()) : (start1 < start2); }
/** Check whether two Spans in the same document are ordered with possible overlap. * @return true iff spans1 starts before spans2 * or the spans start at the same position, * and spans1 ends before spans2. */
Check whether two Spans in the same document are ordered with possible overlap
positionsOrdered
{ "repo_name": "cheng-li/pyramid", "path": "phrase-count-plugin/src/main/java/edu/neu/ccs/pyramid/esplugins/CustomNearSpansUnordered.java", "license": "apache-2.0", "size": 6581 }
[ "org.apache.lucene.search.spans.Spans" ]
import org.apache.lucene.search.spans.Spans;
import org.apache.lucene.search.spans.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,432,850
public static <T extends Comparable<T>> boolean testListIterator(ListIterator<T> iter, T[] data, int size) { // Make sure you catch going prev at the start boolean exceptionThrown = false; try { iter.previous(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println("ListIterator exception failure."); return false; } for (int i = 0; i < data.length; i++) { T t = data[i]; iter.add(t); } while (iter.hasPrevious()) iter.previous(); int i = 0; while (iter.hasNext()) { T item = iter.next(); int idx = iter.nextIndex(); if (idx!=++i) { System.err.println("ListIterator index failure."); return false; } if (item==null) { System.err.println("ListIterator item is null."); return false; } } // We should be at the end of the collection, this should fail exceptionThrown = false; try { iter.next(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println("ListIterator exception failure."); return false; } //This should be list.size iter.nextIndex(); int listSize = iter.nextIndex(); if (listSize!=size) { System.err.println("ListIterator ARRAY_SIZE failure."); return false; } i--; while (iter.hasPrevious()) { T item = iter.previous(); int idx = iter.previousIndex(); if (idx!=--i) { System.err.println("ListIterator index failure."); return false; } if (item==null) { System.err.println("ListIterator item is null."); return false; } } // We should be at the beginning of the collection, this should fail exceptionThrown = false; try { iter.previous(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println("ListIterator exception failure."); return false; } // This should be negative one iter.previousIndex(); int negOne = iter.previousIndex(); if (negOne!=-1) { System.err.println("ListIterator negative_one failure."); return false; } // Remove all using iterator while (iter.hasNext()) { iter.next(); iter.remove(); } return true; }
static <T extends Comparable<T>> boolean function(ListIterator<T> iter, T[] data, int size) { boolean exceptionThrown = false; try { iter.previous(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println(STR); return false; } for (int i = 0; i < data.length; i++) { T t = data[i]; iter.add(t); } while (iter.hasPrevious()) iter.previous(); int i = 0; while (iter.hasNext()) { T item = iter.next(); int idx = iter.nextIndex(); if (idx!=++i) { System.err.println(STR); return false; } if (item==null) { System.err.println(STR); return false; } } exceptionThrown = false; try { iter.next(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println(STR); return false; } iter.nextIndex(); int listSize = iter.nextIndex(); if (listSize!=size) { System.err.println(STR); return false; } i--; while (iter.hasPrevious()) { T item = iter.previous(); int idx = iter.previousIndex(); if (idx!=--i) { System.err.println(STR); return false; } if (item==null) { System.err.println(STR); return false; } } exceptionThrown = false; try { iter.previous(); } catch (NoSuchElementException e) { exceptionThrown = true; } if (!exceptionThrown) { System.err.println(STR); return false; } iter.previousIndex(); int negOne = iter.previousIndex(); if (negOne!=-1) { System.err.println(STR); return false; } while (iter.hasNext()) { iter.next(); iter.remove(); } return true; }
/** * An iterator for lists that allows the programmer to traverse the list in either direction, * modify the list during iteration, and obtain the iterator's current position in the list. * * http://en.wikipedia.org/wiki/Iterator * * @author Justin Wetherell <phishman3579@gmail.com> * * @param iter List iterator to test. * @param data Test data to test against. * @param size Size of the test data. * @return True if list iterator passes it's invariant tests. */
An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list. HREF
testListIterator
{ "repo_name": "dravit/java-algorithms-implementation-master", "path": "src/com/jwetherell/algorithms/data_structures/test/common/ListIteratorTest.java", "license": "apache-2.0", "size": 3648 }
[ "java.util.ListIterator", "java.util.NoSuchElementException" ]
import java.util.ListIterator; import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
2,609,427
public void setTintDrawable(Drawable drawable) { setStatusBarTintDrawable(drawable); setNavigationBarTintDrawable(drawable); }
void function(Drawable drawable) { setStatusBarTintDrawable(drawable); setNavigationBarTintDrawable(drawable); }
/** * Apply the specified drawable to all system UI bars. * * @param drawable The drawable to use as the background, or null to remove it. */
Apply the specified drawable to all system UI bars
setTintDrawable
{ "repo_name": "yuzhicong/LoveHuaLi", "path": "app/src/main/java/com/yzc/lovehuali/tool/SystemBarTintManager.java", "license": "mit", "size": 19991 }
[ "android.graphics.drawable.Drawable" ]
import android.graphics.drawable.Drawable;
import android.graphics.drawable.*;
[ "android.graphics" ]
android.graphics;
1,568,292
@Test(expected = BgpParseException.class) public void openMessageTest8() throws BgpParseException { // OPEN Message with invalid message type. byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x1d, 0x05, 0X04, (byte) 0xfe, 0x09, 0x00, (byte) 0xb4, (byte) 0xc0, (byte) 0xa8, 0x00, 0x0f, 0x00}; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(openMsg); BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader(); BgpMessage message; BgpHeader bgpHeader = new BgpHeader(); message = reader.readFrom(buffer, bgpHeader); assertThat(message, instanceOf(BgpOpenMsg.class)); }
@Test(expected = BgpParseException.class) void function() throws BgpParseException { byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x1d, 0x05, 0X04, (byte) 0xfe, 0x09, 0x00, (byte) 0xb4, (byte) 0xc0, (byte) 0xa8, 0x00, 0x0f, 0x00}; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(openMsg); BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader(); BgpMessage message; BgpHeader bgpHeader = new BgpHeader(); message = reader.readFrom(buffer, bgpHeader); assertThat(message, instanceOf(BgpOpenMsg.class)); }
/** * In this test case, Invalid message type is given as input and expecting * an exception. */
In this test case, Invalid message type is given as input and expecting an exception
openMessageTest8
{ "repo_name": "planoAccess/clonedONOS", "path": "protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpOpenMsgTest.java", "license": "apache-2.0", "size": 12881 }
[ "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers", "org.jboss.netty.buffer.ChannelBuffer", "org.jboss.netty.buffer.ChannelBuffers", "org.junit.Test", "org.onosproject.bgpio.exceptions.BgpParseException", "org.onosproject.bgpio.types.BgpHeader" ]
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.junit.Test; import org.onosproject.bgpio.exceptions.BgpParseException; import org.onosproject.bgpio.types.BgpHeader;
import org.hamcrest.*; import org.jboss.netty.buffer.*; import org.junit.*; import org.onosproject.bgpio.exceptions.*; import org.onosproject.bgpio.types.*;
[ "org.hamcrest", "org.jboss.netty", "org.junit", "org.onosproject.bgpio" ]
org.hamcrest; org.jboss.netty; org.junit; org.onosproject.bgpio;
1,473,761
@Test(expected = SetUpException.class) public void testMissingMandatoryEnumValues() throws SetUpException { Setting<TestEnum> s1 = new EnumSetting<ConfigurationTest.TestEnum>("s1", TestEnum.class, true, null, ""); Properties props = new Properties(); Configuration config = new Configuration(props); config.registerSetting(s1); }
@Test(expected = SetUpException.class) void function() throws SetUpException { Setting<TestEnum> s1 = new EnumSetting<ConfigurationTest.TestEnum>("s1", TestEnum.class, true, null, ""); Properties props = new Properties(); Configuration config = new Configuration(props); config.registerSetting(s1); }
/** * Tests that missing mandatory enum values are handled correctly. * * @throws SetUpException wanted. */
Tests that missing mandatory enum values are handled correctly
testMissingMandatoryEnumValues
{ "repo_name": "KernelHaven/KernelHaven", "path": "test/net/ssehub/kernel_haven/config/ConfigurationTest.java", "license": "apache-2.0", "size": 31348 }
[ "java.util.Properties", "net.ssehub.kernel_haven.SetUpException", "org.junit.Test" ]
import java.util.Properties; import net.ssehub.kernel_haven.SetUpException; import org.junit.Test;
import java.util.*; import net.ssehub.kernel_haven.*; import org.junit.*;
[ "java.util", "net.ssehub.kernel_haven", "org.junit" ]
java.util; net.ssehub.kernel_haven; org.junit;
951,720
public List<ScreeningPlan> findPlanByState(String state);
List<ScreeningPlan> function(String state);
/** * get screening plans by their state * @param state * @return List<ScreeningPlan>: * @throws */
get screening plans by their state
findPlanByState
{ "repo_name": "gavinfish/Assaic", "path": "src/com/cineplex/dao/ScreeningPlanDao.java", "license": "apache-2.0", "size": 933 }
[ "com.cineplex.entity.ScreeningPlan", "java.util.List" ]
import com.cineplex.entity.ScreeningPlan; import java.util.List;
import com.cineplex.entity.*; import java.util.*;
[ "com.cineplex.entity", "java.util" ]
com.cineplex.entity; java.util;
499,282
public void close() throws IOException { flush(true); out.close(); }
void function() throws IOException { flush(true); out.close(); }
/** * Closes the output file. * @exception IOException if there was an exception closing the Audio Writer. */
Closes the output file
close
{ "repo_name": "srnsw/xena", "path": "plugins/audio/ext/src/jspeex/src/java/org/xiph/speex/OggSpeexWriter.java", "license": "gpl-3.0", "size": 9936 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,414,213
public List<BuildBadgeAction> getBadgeActions() { List<BuildBadgeAction> r = null; for (Action a : getActions()) { if(a instanceof BuildBadgeAction) { if(r==null) r = new ArrayList<BuildBadgeAction>(); r.add((BuildBadgeAction)a); } } if(isKeepLog()) { if(r==null) r = new ArrayList<BuildBadgeAction>(); r.add(new KeepLogBuildBadge()); } if(r==null) return Collections.emptyList(); else return r; }
List<BuildBadgeAction> function() { List<BuildBadgeAction> r = null; for (Action a : getActions()) { if(a instanceof BuildBadgeAction) { if(r==null) r = new ArrayList<BuildBadgeAction>(); r.add((BuildBadgeAction)a); } } if(isKeepLog()) { if(r==null) r = new ArrayList<BuildBadgeAction>(); r.add(new KeepLogBuildBadge()); } if(r==null) return Collections.emptyList(); else return r; }
/** * Gets the subset of {@link #getActions()} that consists of {@link BuildBadgeAction}s. */
Gets the subset of <code>#getActions()</code> that consists of <code>BuildBadgeAction</code>s
getBadgeActions
{ "repo_name": "pantheon-systems/jenkins", "path": "core/src/main/java/hudson/model/Run.java", "license": "mit", "size": 67304 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
812,826
@Deprecated public WireTapDefinition<Type> wireTap(String uri, boolean copy, Processor processor) { WireTapDefinition answer = new WireTapDefinition(); answer.setUri(uri); answer.setCopy(copy); answer.setNewExchangeProcessor(processor); addOutput(answer); return answer; }
WireTapDefinition<Type> function(String uri, boolean copy, Processor processor) { WireTapDefinition answer = new WireTapDefinition(); answer.setUri(uri); answer.setCopy(copy); answer.setNewExchangeProcessor(processor); addOutput(answer); return answer; }
/** * <a href="http://camel.apache.org/wiretap.html">WireTap EIP:</a> * Sends a new {@link org.apache.camel.Exchange} to the destination * using {@link ExchangePattern#InOnly}. * * @param uri the dynamic endpoint to wiretap to (resolved using simple language by default) * @param copy whether or not use a copy of the original exchange or a new empty exchange * @param processor processor preparing the new exchange to send * @return the builder * @deprecated use the fluent builder from {@link WireTapDefinition}, will be removed in Camel 3.0 */
Sends a new <code>org.apache.camel.Exchange</code> to the destination using <code>ExchangePattern#InOnly</code>
wireTap
{ "repo_name": "gilfernandes/camel", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 165071 }
[ "org.apache.camel.Processor" ]
import org.apache.camel.Processor;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
2,369,468
private Vector<ClassLoadServiceElement> getClassLoadServiceVector(Class<? extends BaseClassLoadService> serviceBaseInterface) { Vector<ClassLoadServiceElement> clsElements = new Vector<>(); Class<?>[] affectedinterFaceClasses = this.getSuperInterfaces(new Class[]{serviceBaseInterface}); for (int i = 0; i < affectedinterFaceClasses.length; i++) { Vector<ClassLoadServiceElement> clsElementsPart = this.getClassLoadServiceElementsByServiceInterfaceName().get(affectedinterFaceClasses[i].getName()); if (clsElementsPart!=null) { clsElements.addAll(clsElementsPart); } } return clsElements; }
Vector<ClassLoadServiceElement> function(Class<? extends BaseClassLoadService> serviceBaseInterface) { Vector<ClassLoadServiceElement> clsElements = new Vector<>(); Class<?>[] affectedinterFaceClasses = this.getSuperInterfaces(new Class[]{serviceBaseInterface}); for (int i = 0; i < affectedinterFaceClasses.length; i++) { Vector<ClassLoadServiceElement> clsElementsPart = this.getClassLoadServiceElementsByServiceInterfaceName().get(affectedinterFaceClasses[i].getName()); if (clsElementsPart!=null) { clsElements.addAll(clsElementsPart); } } return clsElements; }
/** * Returns all BaseClassLoadService's as a vector. * * @param serviceBaseInterface the service base interface * @return the class load service vector */
Returns all BaseClassLoadService's as a vector
getClassLoadServiceVector
{ "repo_name": "EnFlexIT/AgentWorkbench", "path": "eclipseProjects/org.agentgui/bundles/de.enflexit.common/src/de/enflexit/common/classLoadService/AbstractClassLoadServiceUtilityImpl.java", "license": "lgpl-2.1", "size": 32942 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
12,037
public Object getValueAt(Object node, int column) { final Object result; if (node instanceof DetailNode) { result = getValueAtDetailNode((DetailNode) node, column); } else { result = getValueAtDetailAST((DetailAST) node, column); } return result; }
Object function(Object node, int column) { final Object result; if (node instanceof DetailNode) { result = getValueAtDetailNode((DetailNode) node, column); } else { result = getValueAtDetailAST((DetailAST) node, column); } return result; }
/** * Returns the value to be displayed for node at column number. * @param node the node * @param column the column number * @return the value to be displayed for node {@code node}, at column number {@code column}. */
Returns the value to be displayed for node at column number
getValueAt
{ "repo_name": "jonmbake/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTablePresentation.java", "license": "lgpl-2.1", "size": 11664 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.DetailNode" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.DetailNode;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
1,900,243
public YangEnumeration getVersionValue() throws JNCException { YangEnumeration version = (YangEnumeration)getValue("version"); if (version == null) { version = new YangEnumeration("10.12.0", new String[] { // default "9.6.1", "10.12.0", }); } return version; }
YangEnumeration function() throws JNCException { YangEnumeration version = (YangEnumeration)getValue(STR); if (version == null) { version = new YangEnumeration(STR, new String[] { "9.6.1", STR, }); } return version; }
/** * Gets the value for child leaf "version". * @return The value of the leaf. */
Gets the value for child leaf "version"
getVersionValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/interface_/ga/AgwSgsnGaProfile.java", "license": "apache-2.0", "size": 20837 }
[ "com.tailf.jnc.YangEnumeration" ]
import com.tailf.jnc.YangEnumeration;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
1,356,610
protected AlfrescoTransactionSupport getAlfrescoTransactionSupport() { return (AlfrescoTransactionSupport) applicationContext.getBean("rm.alfrescoTransactionSupport"); }
AlfrescoTransactionSupport function() { return (AlfrescoTransactionSupport) applicationContext.getBean(STR); }
/** * Gets the alfresco transaction support * * @return The alfresco transaction support */
Gets the alfresco transaction support
getAlfrescoTransactionSupport
{ "repo_name": "dnacreative/records-management", "path": "rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/PreMethodInvocationProcessor.java", "license": "lgpl-3.0", "size": 8465 }
[ "org.alfresco.module.org_alfresco_module_rm.util.AlfrescoTransactionSupport" ]
import org.alfresco.module.org_alfresco_module_rm.util.AlfrescoTransactionSupport;
import org.alfresco.module.org_alfresco_module_rm.util.*;
[ "org.alfresco.module" ]
org.alfresco.module;
1,447,358
public static class UnmodifiableMap <V> extends Long2ReferenceFunctions.UnmodifiableFunction <V> implements Long2ReferenceMap <V>, java.io.Serializable { private static final long serialVersionUID = -7046029254386353129L; protected final Long2ReferenceMap <V> map; protected transient volatile ObjectSet<Long2ReferenceMap.Entry <V> > entries; protected transient volatile LongSet keys; protected transient volatile ReferenceCollection <V> values; protected UnmodifiableMap( final Long2ReferenceMap <V> m ) { super( m ); this.map = m; } public int size() { return map.size(); }
public static class UnmodifiableMap <V> extends Long2ReferenceFunctions.UnmodifiableFunction <V> implements Long2ReferenceMap <V>, java.io.Serializable { private static final long serialVersionUID = -7046029254386353129L; protected final Long2ReferenceMap <V> map; protected transient volatile ObjectSet<Long2ReferenceMap.Entry <V> > entries; protected transient volatile LongSet keys; protected transient volatile ReferenceCollection <V> values; protected UnmodifiableMap( final Long2ReferenceMap <V> m ) { super( m ); this.map = m; } public int size() { return map.size(); }
/** Returns a synchronized type-specific map backed by the given type-specific map, using an assigned object to synchronize. * * @param m the map to be wrapped in a synchronized map. * @param sync an object that will be used to synchronize the access to the map. * @return a synchronized view of the specified map. * @see java.util.Collections#synchronizedMap(Map) */
Returns a synchronized type-specific map backed by the given type-specific map, using an assigned object to synchronize
synchronize
{ "repo_name": "karussell/fastutil", "path": "src/it/unimi/dsi/fastutil/longs/Long2ReferenceMaps.java", "license": "apache-2.0", "size": 14220 }
[ "it.unimi.dsi.fastutil.objects.ObjectSet", "it.unimi.dsi.fastutil.objects.ReferenceCollection" ]
import it.unimi.dsi.fastutil.objects.ObjectSet; import it.unimi.dsi.fastutil.objects.ReferenceCollection;
import it.unimi.dsi.fastutil.objects.*;
[ "it.unimi.dsi" ]
it.unimi.dsi;
2,221,409
@Override public WarmupRegionResponse warmupRegion(final RpcController controller, final WarmupRegionRequest request) throws ServiceException { RegionInfo regionInfo = request.getRegionInfo(); final HRegionInfo region = HRegionInfo.convert(regionInfo); HTableDescriptor htd; WarmupRegionResponse response = WarmupRegionResponse.getDefaultInstance(); try { checkOpen(); String encodedName = region.getEncodedName(); byte[] encodedNameBytes = region.getEncodedNameAsBytes(); final Region onlineRegion = regionServer.getFromOnlineRegions(encodedName); if (onlineRegion != null) { LOG.info("Region already online. Skipping warming up " + region); return response; } if (LOG.isDebugEnabled()) { LOG.debug("Warming up Region " + region.getRegionNameAsString()); } htd = regionServer.tableDescriptors.get(region.getTable()); if (regionServer.getRegionsInTransitionInRS().containsKey(encodedNameBytes)) { LOG.info("Region is in transition. Skipping warmup " + region); return response; } HRegion.warmupHRegion(region, htd, regionServer.getWAL(region), regionServer.getConfiguration(), regionServer, null); } catch (IOException ie) { LOG.error("Failed warming up region " + region.getRegionNameAsString(), ie); throw new ServiceException(ie); } return response; }
WarmupRegionResponse function(final RpcController controller, final WarmupRegionRequest request) throws ServiceException { RegionInfo regionInfo = request.getRegionInfo(); final HRegionInfo region = HRegionInfo.convert(regionInfo); HTableDescriptor htd; WarmupRegionResponse response = WarmupRegionResponse.getDefaultInstance(); try { checkOpen(); String encodedName = region.getEncodedName(); byte[] encodedNameBytes = region.getEncodedNameAsBytes(); final Region onlineRegion = regionServer.getFromOnlineRegions(encodedName); if (onlineRegion != null) { LOG.info(STR + region); return response; } if (LOG.isDebugEnabled()) { LOG.debug(STR + region.getRegionNameAsString()); } htd = regionServer.tableDescriptors.get(region.getTable()); if (regionServer.getRegionsInTransitionInRS().containsKey(encodedNameBytes)) { LOG.info(STR + region); return response; } HRegion.warmupHRegion(region, htd, regionServer.getWAL(region), regionServer.getConfiguration(), regionServer, null); } catch (IOException ie) { LOG.error(STR + region.getRegionNameAsString(), ie); throw new ServiceException(ie); } return response; }
/** * Wamrmup a region on this server. * * This method should only be called by Master. It synchrnously opens the region and * closes the region bringing the most important pages in cache. * <p> * * @param controller the RPC controller * @param request the request * @throws ServiceException */
Wamrmup a region on this server. This method should only be called by Master. It synchrnously opens the region and closes the region bringing the most important pages in cache.
warmupRegion
{ "repo_name": "ibmsoe/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java", "license": "apache-2.0", "size": 107607 }
[ "com.google.protobuf.RpcController", "com.google.protobuf.ServiceException", "java.io.IOException", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.HTableDescriptor", "org.apache.hadoop.hbase.protobuf.generated.AdminProtos", "org.apache.hadoop.hbase.protobuf.generated.HBaseProtos" ]
import com.google.protobuf.RpcController; import com.google.protobuf.ServiceException; import java.io.IOException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
import com.google.protobuf.*; import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.protobuf.generated.*;
[ "com.google.protobuf", "java.io", "org.apache.hadoop" ]
com.google.protobuf; java.io; org.apache.hadoop;
1,037,645
public synchronized Instant getEarliestTimerTimestamp() { Instant earliest = THE_END_OF_TIME.get(); for (NavigableSet<TimerData> timers : processingTimers.values()) { if (!timers.isEmpty()) { earliest = INSTANT_ORDERING.min(timers.first().getTimestamp(), earliest); } } for (NavigableSet<TimerData> timers : synchronizedProcessingTimers.values()) { if (!timers.isEmpty()) { earliest = INSTANT_ORDERING.min(timers.first().getTimestamp(), earliest); } } if (!pendingTimers.isEmpty()) { earliest = INSTANT_ORDERING.min(pendingTimers.first().getTimestamp(), earliest); } return earliest; }
synchronized Instant function() { Instant earliest = THE_END_OF_TIME.get(); for (NavigableSet<TimerData> timers : processingTimers.values()) { if (!timers.isEmpty()) { earliest = INSTANT_ORDERING.min(timers.first().getTimestamp(), earliest); } } for (NavigableSet<TimerData> timers : synchronizedProcessingTimers.values()) { if (!timers.isEmpty()) { earliest = INSTANT_ORDERING.min(timers.first().getTimestamp(), earliest); } } if (!pendingTimers.isEmpty()) { earliest = INSTANT_ORDERING.min(pendingTimers.first().getTimestamp(), earliest); } return earliest; }
/** * Return the earliest timestamp of the earliest timer that has not been completed. This is * either the earliest timestamp across timers that have not been completed, or the earliest * timestamp across timers that have been delivered but have not been completed. */
Return the earliest timestamp of the earliest timer that has not been completed. This is either the earliest timestamp across timers that have not been completed, or the earliest timestamp across timers that have been delivered but have not been completed
getEarliestTimerTimestamp
{ "repo_name": "yafengguo/Apache-beam", "path": "runners/direct-java/src/main/java/org/apache/beam/runners/direct/WatermarkManager.java", "license": "apache-2.0", "size": 56507 }
[ "java.util.NavigableSet", "org.apache.beam.sdk.util.TimerInternals", "org.joda.time.Instant" ]
import java.util.NavigableSet; import org.apache.beam.sdk.util.TimerInternals; import org.joda.time.Instant;
import java.util.*; import org.apache.beam.sdk.util.*; import org.joda.time.*;
[ "java.util", "org.apache.beam", "org.joda.time" ]
java.util; org.apache.beam; org.joda.time;
601,647
private void waitForImage() throws InterruptedException { int w = fImage.getWidth(this); int h = fImage.getHeight(this); while (true) { int flags = Toolkit.getDefaultToolkit().checkImage(fImage, w, h, this); if(((flags & ERROR) != 0) || ((flags & ABORT) != 0 )) { throw new InterruptedException(); } else if((flags & (ALLBITS | FRAMEBITS)) != 0) { return; } Thread.sleep(10); } }
void function() throws InterruptedException { int w = fImage.getWidth(this); int h = fImage.getHeight(this); while (true) { int flags = Toolkit.getDefaultToolkit().checkImage(fImage, w, h, this); if(((flags & ERROR) != 0) ((flags & ABORT) != 0 )) { throw new InterruptedException(); } else if((flags & (ALLBITS FRAMEBITS)) != 0) { return; } Thread.sleep(10); } }
/** Method insures that the image is loaded and not a broken reference */
Method insures that the image is loaded and not a broken reference
waitForImage
{ "repo_name": "Esleelkartea/hermes", "path": "hermes_v1.0.0_src/bgc/gui/wysiwyg/draganddrop/clases/RelativeImageView.java", "license": "gpl-2.0", "size": 22843 }
[ "java.awt.Toolkit" ]
import java.awt.Toolkit;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,084,418
private InformationLoss<?> getValueOrDefault(InformationLoss<?> value, InformationLoss<?> _default) { return value != null ? value : _default; }
InformationLoss<?> function(InformationLoss<?> value, InformationLoss<?> _default) { return value != null ? value : _default; }
/** * Returns the value if != null, the default otherwise. * @param value * @param _default * @return */
Returns the value if != null, the default otherwise
getValueOrDefault
{ "repo_name": "COWYARD/arx", "path": "src/main/org/deidentifier/arx/UtilityEstimator.java", "license": "apache-2.0", "size": 13988 }
[ "org.deidentifier.arx.metric.InformationLoss" ]
import org.deidentifier.arx.metric.InformationLoss;
import org.deidentifier.arx.metric.*;
[ "org.deidentifier.arx" ]
org.deidentifier.arx;
1,766,250
public List<Contact> getAllContacts();
List<Contact> function();
/** * Get all contacts from database * * @return list of the contacts */
Get all contacts from database
getAllContacts
{ "repo_name": "avkcorporation/rest-service", "path": "src/main/java/ua/avk/rest/dao/IContactDao.java", "license": "apache-2.0", "size": 580 }
[ "java.util.List", "ua.avk.rest.entity.Contact" ]
import java.util.List; import ua.avk.rest.entity.Contact;
import java.util.*; import ua.avk.rest.entity.*;
[ "java.util", "ua.avk.rest" ]
java.util; ua.avk.rest;
1,748,914
public static Binding asBinding(final QuerySolution map) { if(map != null) { BindingBuilder builder = BindingBuilder.create(); Iterator<String> varNames = map.varNames(); while(varNames.hasNext()) { String varName = varNames.next(); RDFNode node = map.get(varName); if(node != null) { builder.add(Var.alloc(varName), node.asNode()); } } return builder.build(); } else { return null; } }
static Binding function(final QuerySolution map) { if(map != null) { BindingBuilder builder = BindingBuilder.create(); Iterator<String> varNames = map.varNames(); while(varNames.hasNext()) { String varName = varNames.next(); RDFNode node = map.get(varName); if(node != null) { builder.add(Var.alloc(varName), node.asNode()); } } return builder.build(); } else { return null; } }
/** * Turns a QuerySolution into a Binding. * @param map the input QuerySolution * @return a Binding or null if the input is null */
Turns a QuerySolution into a Binding
asBinding
{ "repo_name": "TopQuadrant/shacl", "path": "src/main/java/org/topbraid/jenax/util/JenaUtil.java", "license": "apache-2.0", "size": 38680 }
[ "java.util.Iterator", "org.apache.jena.query.QuerySolution", "org.apache.jena.rdf.model.RDFNode", "org.apache.jena.sparql.core.Var", "org.apache.jena.sparql.engine.binding.Binding", "org.apache.jena.sparql.engine.binding.BindingBuilder" ]
import java.util.Iterator; import org.apache.jena.query.QuerySolution; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.sparql.core.Var; import org.apache.jena.sparql.engine.binding.Binding; import org.apache.jena.sparql.engine.binding.BindingBuilder;
import java.util.*; import org.apache.jena.query.*; import org.apache.jena.rdf.model.*; import org.apache.jena.sparql.core.*; import org.apache.jena.sparql.engine.binding.*;
[ "java.util", "org.apache.jena" ]
java.util; org.apache.jena;
2,494,844
@Test public void testConstructorResourceNull() { final List<TreeNode> children = null; try { new MarketDataTreeNode((ResourceProduct)null, children); fail("Should have thrown an exception"); } catch (final NullPointerException e) { assertNull(e.getMessage()); } }
void function() { final List<TreeNode> children = null; try { new MarketDataTreeNode((ResourceProduct)null, children); fail(STR); } catch (final NullPointerException e) { assertNull(e.getMessage()); } }
/** * Test the <code>MarketDataTreeNode()</code> method. */
Test the <code>MarketDataTreeNode()</code> method
testConstructorResourceNull
{ "repo_name": "jmthompson2015/vizzini", "path": "game/illyriad/src/test/java/org/vizzini/illyriad/robot/market/MarketDataTreeNodeTest.java", "license": "mit", "size": 10561 }
[ "java.util.List", "org.junit.Assert", "org.vizzini.illyriad.ResourceProduct" ]
import java.util.List; import org.junit.Assert; import org.vizzini.illyriad.ResourceProduct;
import java.util.*; import org.junit.*; import org.vizzini.illyriad.*;
[ "java.util", "org.junit", "org.vizzini.illyriad" ]
java.util; org.junit; org.vizzini.illyriad;
2,085,637
Update withDisplayName(String displayName); } } interface Update extends Settable<BatchAccount.Update>, UpdateStages.WithOptionalProperties, UpdateStages.WithApplicationPackage { }
Update withDisplayName(String displayName); } } interface Update extends Settable<BatchAccount.Update>, UpdateStages.WithOptionalProperties, UpdateStages.WithApplicationPackage { }
/** * Specifies the display name for the application. * * @param displayName a display name * @return the next stage of the update */
Specifies the display name for the application
withDisplayName
{ "repo_name": "jianghaolu/azure-sdk-for-java", "path": "azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/Application.java", "license": "mit", "size": 8927 }
[ "com.microsoft.azure.management.resources.fluentcore.model.Settable" ]
import com.microsoft.azure.management.resources.fluentcore.model.Settable;
import com.microsoft.azure.management.resources.fluentcore.model.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
587,067
public VdxEntityInfo getInfo(Class<?> clazz) { final VdxEntityInfo info = classInfos.get(clazz); if (info == null) throw new PersistenceException(clazz + " not found in persistence unit \"" + persistenceUnit + "\""); if (!info.isInspected()) inspect(info); return info; }
VdxEntityInfo function(Class<?> clazz) { final VdxEntityInfo info = classInfos.get(clazz); if (info == null) throw new PersistenceException(clazz + STRSTR\""); if (!info.isInspected()) inspect(info); return info; }
/** * Get the information for a class. The class is inspected if required. * * @param clazz - The class which information is requested. * * @return The information about the class. * @throws PersistenceException - If the class is not found in the * persistence unit of persistence.xml */
Get the information for a class. The class is inspected if required
getInfo
{ "repo_name": "Paolo-Maffei/freebus-fts", "path": "freebus-fts-persistence/src/main/java/org/freebus/fts/persistence/vdx/internal/VdxEntityInspector.java", "license": "gpl-3.0", "size": 11605 }
[ "javax.persistence.PersistenceException" ]
import javax.persistence.PersistenceException;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
1,260,482
public static Movie retrieveMovieDetails (Context context, long movieId, Client client) { Map<String,String> params = movieDetailsURLParameters(context); RestAdapter restAdapter = createRestAdapter(client); MovieDetailsAPI movieDetailsAPI = restAdapter.create(MovieDetailsAPI.class); return movieDetailsAPI.retrieveMovieDetails(movieId, params); }
static Movie function (Context context, long movieId, Client client) { Map<String,String> params = movieDetailsURLParameters(context); RestAdapter restAdapter = createRestAdapter(client); MovieDetailsAPI movieDetailsAPI = restAdapter.create(MovieDetailsAPI.class); return movieDetailsAPI.retrieveMovieDetails(movieId, params); }
/** * Call MovieDB and retrieve details of the movie identified by movieId * @param context * @param movieId * @param client for testing purpose, you can provide a mock client. Leave it to null for real MovieDB api call * @return */
Call MovieDB and retrieve details of the movie identified by movieId
retrieveMovieDetails
{ "repo_name": "frank-tan/Popular-Movies", "path": "app/src/main/java/com/franktan/popularmovies/rest/MovieDetailsAPIService.java", "license": "apache-2.0", "size": 4931 }
[ "android.content.Context", "com.franktan.popularmovies.model.Movie", "java.util.Map" ]
import android.content.Context; import com.franktan.popularmovies.model.Movie; import java.util.Map;
import android.content.*; import com.franktan.popularmovies.model.*; import java.util.*;
[ "android.content", "com.franktan.popularmovies", "java.util" ]
android.content; com.franktan.popularmovies; java.util;
781,915
@Test public void testVAProblemGetCodesNoICD9() { try { when(mockHDDDao.getMappedCode(eq(MappingType.ProblemsIcd9ToSnomedCT), eq(""))).thenReturn(null); when(mockHDDDao.getMappedCode(eq(MappingType.ProblemsIcd9ToSnomedCT), eq((String) null))).thenReturn(null); testSubject.setData("uid", "urn:va:problem:B362:8:748"); testSubject.setData("icdCode", "someText"); List<JdsCode> oaReturnedCodes = testSubject.getCodes(); assertTrue("This should not have contained any codes.", NullChecker.isNullish(oaReturnedCodes)); verify(mockHDDDao, times(1)).getMappedCode(eq(MappingType.ProblemsIcd9ToSnomedCT), any(String.class)); } catch (Exception e) { String sErrorMessage = "An unexpected exception occurred. Error: " + e.getMessage(); System.out.println(sErrorMessage); e.printStackTrace(); fail(sErrorMessage); } }
void function() { try { when(mockHDDDao.getMappedCode(eq(MappingType.ProblemsIcd9ToSnomedCT), eq(STRuidSTRurn:va:problem:B362:8:748STRicdCodeSTRsomeTextSTRThis should not have contained any codes.STRAn unexpected exception occurred. Error: " + e.getMessage(); System.out.println(sErrorMessage); e.printStackTrace(); fail(sErrorMessage); } }
/** * Test VA case where the VA result contains no ICD9 Code. */
Test VA case where the VA result contains no ICD9 Code
testVAProblemGetCodesNoICD9
{ "repo_name": "KRMAssociatesInc/eHMP", "path": "ehmp/product/production/hmp-main/src/test/java/gov/va/cpe/vpr/ProblemTests.java", "license": "apache-2.0", "size": 7622 }
[ "gov.va.cpe.vpr.termeng.jlv.JLVHddDao", "org.junit.Assert", "org.mockito.Matchers", "org.mockito.Mockito" ]
import gov.va.cpe.vpr.termeng.jlv.JLVHddDao; import org.junit.Assert; import org.mockito.Matchers; import org.mockito.Mockito;
import gov.va.cpe.vpr.termeng.jlv.*; import org.junit.*; import org.mockito.*;
[ "gov.va.cpe", "org.junit", "org.mockito" ]
gov.va.cpe; org.junit; org.mockito;
979,284
private void handlePostChange(final IResourceChangeEvent event) { IResourceDelta rootDelta = event.getDelta(); if (rootDelta == null) { return; } IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
void function(final IResourceChangeEvent event) { IResourceDelta rootDelta = event.getDelta(); if (rootDelta == null) { return; } IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
/** * Callback method that handles all post changes * Implemented using the design pattern visitor that traverses * through the changed resources * * @param event The change event to handle */
Callback method that handles all post changes Implemented using the design pattern visitor that traverses through the changed resources
handlePostChange
{ "repo_name": "eroslevi/titan.EclipsePlug-ins", "path": "org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/ResourceListener.java", "license": "epl-1.0", "size": 6641 }
[ "org.eclipse.core.resources.IResourceChangeEvent", "org.eclipse.core.resources.IResourceDelta", "org.eclipse.core.resources.IResourceDeltaVisitor" ]
import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.*;
[ "org.eclipse.core" ]
org.eclipse.core;
1,233,007
public Insets getBorderInsets(Component c) { return new Insets(2, 2, 2, 2); }
Insets function(Component c) { return new Insets(2, 2, 2, 2); }
/** * Measures the width of this border. * * @param c the component whose border is to be measured. * * @return an Insets object whose <code>left</code>, <code>right</code>, * <code>top</code> and <code>bottom</code> fields indicate the * width of the border at the respective edge. * * @see #getBorderInsets(java.awt.Component, java.awt.Insets) */
Measures the width of this border
getBorderInsets
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/border/BevelBorder.java", "license": "gpl-2.0", "size": 19241 }
[ "java.awt.Component", "java.awt.Insets" ]
import java.awt.Component; import java.awt.Insets;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,014,206
@Test public void createOrUpdateObjectFromJson_objectWithPrimaryKeySetValueDirectlyFromJsonObject() throws JSONException { JSONObject newObject = new JSONObject("{\"id\": 1, \"name\": \"bar\"}"); realm.beginTransaction(); realm.createObject(OwnerPrimaryKey.class, 0); // id = 0 realm.createOrUpdateObjectFromJson(OwnerPrimaryKey.class, newObject); realm.commitTransaction(); RealmResults<OwnerPrimaryKey> owners = realm.where(OwnerPrimaryKey.class).findAll(); assertEquals(2, owners.size()); assertEquals(1, owners.get(1).getId()); assertEquals("bar", owners.get(1).getName()); }
void function() throws JSONException { JSONObject newObject = new JSONObject("{\"id\STRname\STRbar\"}"); realm.beginTransaction(); realm.createObject(OwnerPrimaryKey.class, 0); realm.createOrUpdateObjectFromJson(OwnerPrimaryKey.class, newObject); realm.commitTransaction(); RealmResults<OwnerPrimaryKey> owners = realm.where(OwnerPrimaryKey.class).findAll(); assertEquals(2, owners.size()); assertEquals(1, owners.get(1).getId()); assertEquals("bar", owners.get(1).getName()); }
/** * Checks that using createOrUpdateObject will set the primary key directly instead of first setting * it to the default value (which can fail). */
Checks that using createOrUpdateObject will set the primary key directly instead of first setting it to the default value (which can fail)
createOrUpdateObjectFromJson_objectWithPrimaryKeySetValueDirectlyFromJsonObject
{ "repo_name": "weiwenqiang/GitHub", "path": "expert/realm-java/realm/realm-library/src/androidTest/java/io/realm/RealmJsonTests.java", "license": "apache-2.0", "size": 81058 }
[ "io.realm.entities.OwnerPrimaryKey", "org.json.JSONException", "org.json.JSONObject", "org.junit.Assert" ]
import io.realm.entities.OwnerPrimaryKey; import org.json.JSONException; import org.json.JSONObject; import org.junit.Assert;
import io.realm.entities.*; import org.json.*; import org.junit.*;
[ "io.realm.entities", "org.json", "org.junit" ]
io.realm.entities; org.json; org.junit;
913,115
public List<ConnectionMonitorResultInner> list(String resourceGroupName, String networkWatcherName) { return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); }
List<ConnectionMonitorResultInner> function(String resourceGroupName, String networkWatcherName) { return listWithServiceResponseAsync(resourceGroupName, networkWatcherName).toBlocking().single().body(); }
/** * Lists all connection monitors for the specified Network Watcher. * * @param resourceGroupName The name of the resource group containing Network Watcher. * @param networkWatcherName The name of the Network Watcher resource. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;ConnectionMonitorResultInner&gt; object if successful. */
Lists all connection monitors for the specified Network Watcher
list
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java", "license": "mit", "size": 73331 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
873,213
private int getIndexOfDataType(DataType<?> type){ int idx = 0; for (DataTypeDescription<?> desc : DataType.list()){ if (desc.getLabel().equals(type.getDescription().getLabel())) { return idx; } idx++; } throw new RuntimeException(Resources.getMessage("DialogOrderSelection.2")+type.getDescription().getLabel()); //$NON-NLS-1$ }
int function(DataType<?> type){ int idx = 0; for (DataTypeDescription<?> desc : DataType.list()){ if (desc.getLabel().equals(type.getDescription().getLabel())) { return idx; } idx++; } throw new RuntimeException(Resources.getMessage(STR)+type.getDescription().getLabel()); }
/** * Returns the index of a given data type. * * @param type * @return */
Returns the index of a given data type
getIndexOfDataType
{ "repo_name": "fstahnke/arx", "path": "src/gui/org/deidentifier/arx/gui/view/impl/menu/DialogOrderSelection.java", "license": "apache-2.0", "size": 17423 }
[ "org.deidentifier.arx.DataType", "org.deidentifier.arx.gui.resources.Resources" ]
import org.deidentifier.arx.DataType; import org.deidentifier.arx.gui.resources.Resources;
import org.deidentifier.arx.*; import org.deidentifier.arx.gui.resources.*;
[ "org.deidentifier.arx" ]
org.deidentifier.arx;
798,350
private void sendRequestRecord() throws IllegalStateException, SocketException, IOException { String request = "RECORD rtsp://"+mParameters.host+":"+mParameters.port+mParameters.path+" RTSP/1.0\r\n" + "Range: npt=0.000-\r\n" + addHeaders(); Log.i(TAG,request.substring(0, request.indexOf("\r\n"))); mOutputStream.write(request.getBytes("UTF-8")); mOutputStream.flush(); Response.parseResponse(mBufferedReader); }
void function() throws IllegalStateException, SocketException, IOException { String request = STRRange: npt=0.000-\r\nSTR\r\nSTRUTF-8")); mOutputStream.flush(); Response.parseResponse(mBufferedReader); }
/** * Forges and sends the RECORD request */
Forges and sends the RECORD request
sendRequestRecord
{ "repo_name": "xunboo/JJCamera", "path": "android/src/main/java/com/jjcamera/apps/iosched/streaming/rtsp/RtspClient.java", "license": "apache-2.0", "size": 19888 }
[ "java.io.IOException", "java.net.SocketException" ]
import java.io.IOException; import java.net.SocketException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
838,872
@Override public List<EnvVar> getEnvVarList() { List<EnvVar> newEnvVarList = new ArrayList<>(); for (EnvVar envVar : envVarList) { newEnvVarList.add(new EnvVar(envVar)); } return newEnvVarList; }
List<EnvVar> function() { List<EnvVar> newEnvVarList = new ArrayList<>(); for (EnvVar envVar : envVarList) { newEnvVarList.add(new EnvVar(envVar)); } return newEnvVarList; }
/** * Gets the environment variable list. * * @return the envVarList */
Gets the environment variable list
getEnvVarList
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/main/java/com/sldeditor/filter/v2/envvar/EnvironmentVariableManager.java", "license": "gpl-3.0", "size": 12545 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,978,540
public Drawable loadIcon(Context context) { if (mIconUri == null) { return loadServiceIcon(context); } try (InputStream is = context.getContentResolver().openInputStream(mIconUri)) { Drawable drawable = Drawable.createFromStream(is, null); if (drawable == null) { return loadServiceIcon(context); } return drawable; } catch (IOException e) { Log.w(TAG, "Loading the default icon due to a failure on loading " + mIconUri, e); return loadServiceIcon(context); } }
Drawable function(Context context) { if (mIconUri == null) { return loadServiceIcon(context); } try (InputStream is = context.getContentResolver().openInputStream(mIconUri)) { Drawable drawable = Drawable.createFromStream(is, null); if (drawable == null) { return loadServiceIcon(context); } return drawable; } catch (IOException e) { Log.w(TAG, STR + mIconUri, e); return loadServiceIcon(context); } }
/** * Loads the user-displayed icon for this TV input. * * @param context Supplies a {@link Context} used to load the icon. * @return a Drawable containing the TV input's icon. If the TV input does not have an icon, * application's icon is returned. If it's unavailable too, {@code null} is returned. */
Loads the user-displayed icon for this TV input
loadIcon
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "frameworks/base/media/java/android/media/tv/TvInputInfo.java", "license": "gpl-3.0", "size": 27691 }
[ "android.content.Context", "android.graphics.drawable.Drawable", "android.util.Log", "java.io.IOException", "java.io.InputStream" ]
import android.content.Context; import android.graphics.drawable.Drawable; import android.util.Log; import java.io.IOException; import java.io.InputStream;
import android.content.*; import android.graphics.drawable.*; import android.util.*; import java.io.*;
[ "android.content", "android.graphics", "android.util", "java.io" ]
android.content; android.graphics; android.util; java.io;
2,670,750
log.info("Updating file {} using {} in zip archive {}", new String[] {fileName, file.getAbsolutePath(), zip.getAbsolutePath()}); Path filePath = file.toPath(); try (FileSystem fileSystem = FileSystems.newFileSystem(zip.toPath(), null)) { Path fileInsideZipPath = fileSystem.getPath(fileName); Files.copy(filePath, fileInsideZipPath, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { throw new IOException("Unable to update " + fileName + " in " + zip.getAbsolutePath() + " using " + file.getAbsolutePath(), e); } }
log.info(STR, new String[] {fileName, file.getAbsolutePath(), zip.getAbsolutePath()}); Path filePath = file.toPath(); try (FileSystem fileSystem = FileSystems.newFileSystem(zip.toPath(), null)) { Path fileInsideZipPath = fileSystem.getPath(fileName); Files.copy(filePath, fileInsideZipPath, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { throw new IOException(STR + fileName + STR + zip.getAbsolutePath() + STR + file.getAbsolutePath(), e); } }
/** * Updates one specified file inside of archive * @param zip target archive file * @param file new file that will override old one inside of the archive * @param fileName file path of file that should be replaced * @throws IOException */
Updates one specified file inside of archive
updateOneFileInZip
{ "repo_name": "mkrajcov/testsuite", "path": "src/main/java/org/jboss/hal/testsuite/util/ZipUtils.java", "license": "lgpl-2.1", "size": 2339 }
[ "java.io.IOException", "java.nio.file.FileSystem", "java.nio.file.FileSystems", "java.nio.file.Files", "java.nio.file.Path", "java.nio.file.StandardCopyOption" ]
import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
692,632
public void removeFromBranch(Collection<LabelledFormula<P>> lfs) { branch.removeAll(lfs); }
void function(Collection<LabelledFormula<P>> lfs) { branch.removeAll(lfs); }
/** * Removes the given subformulas from branch. * * @param lfs the subformulas */
Removes the given subformulas from branch
removeFromBranch
{ "repo_name": "johanneskoester/libmodallogic", "path": "src/modalLogic/tableau/Tableau.java", "license": "bsd-3-clause", "size": 16949 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,190,447
@Test public void fatalExceptionAndFormattedStringWithSingleObject() { RuntimeException exception = new RuntimeException(); logger.fatalf(exception, "Hello %s!", "World"); if (errorEnabled) { verify(provider).log(eq(2), isNull(), eq(Level.ERROR), same(exception), any(PrintfStyleFormatter.class), eq("Hello %s!"), eq("World")); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
void function() { RuntimeException exception = new RuntimeException(); logger.fatalf(exception, STR, "World"); if (errorEnabled) { verify(provider).log(eq(2), isNull(), eq(Level.ERROR), same(exception), any(PrintfStyleFormatter.class), eq(STR), eq("World")); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any(), any()); } }
/** * Verifies that an exception and a formatted string with a single object argument will be logged correctly at * {@link Level#ERROR ERROR} level. */
Verifies that an exception and a formatted string with a single object argument will be logged correctly at <code>Level#ERROR ERROR</code> level
fatalExceptionAndFormattedStringWithSingleObject
{ "repo_name": "pmwmedia/tinylog", "path": "jboss-tinylog/src/test/java/org/tinylog/jboss/TinylogLoggerTest.java", "license": "apache-2.0", "size": 189291 }
[ "org.mockito.ArgumentMatchers", "org.mockito.Mockito", "org.tinylog.Level", "org.tinylog.format.PrintfStyleFormatter" ]
import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.tinylog.Level; import org.tinylog.format.PrintfStyleFormatter;
import org.mockito.*; import org.tinylog.*; import org.tinylog.format.*;
[ "org.mockito", "org.tinylog", "org.tinylog.format" ]
org.mockito; org.tinylog; org.tinylog.format;
1,061,268
public BufferedImage loadImage(String fileName){ BufferedImage buff = null; try { buff = ImageIO.read(getClass().getResourceAsStream(fileName)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } return buff; }
BufferedImage function(String fileName){ BufferedImage buff = null; try { buff = ImageIO.read(getClass().getResourceAsStream(fileName)); } catch (IOException e) { e.printStackTrace(); return null; } return buff; }
/** * Load a image in the specified path * @param fileName Absolute or relative path to the image * @return BufferedImage that contains the image */
Load a image in the specified path
loadImage
{ "repo_name": "juanhg/PhysicsApplets", "path": "src/com/juanhg/icewalker/IceWalkerApplet.java", "license": "gpl-3.0", "size": 32010 }
[ "java.awt.image.BufferedImage", "java.io.IOException", "javax.imageio.ImageIO" ]
import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO;
import java.awt.image.*; import java.io.*; import javax.imageio.*;
[ "java.awt", "java.io", "javax.imageio" ]
java.awt; java.io; javax.imageio;
1,262,050
@Override public T visitSinkDefine(@NotNull CQLParser.SinkDefineContext ctx) { return visitChildren(ctx); }
@Override public T visitSinkDefine(@NotNull CQLParser.SinkDefineContext ctx) { return visitChildren(ctx); }
/** * {@inheritDoc} * <p/> * The default implementation returns the result of calling * {@link #visitChildren} on {@code ctx}. */
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
visitRangeMilliSeconds
{ "repo_name": "jack6215/StreamCQL", "path": "cql/src/main/java/com/huawei/streaming/cql/semanticanalyzer/parser/CQLParserBaseVisitor.java", "license": "apache-2.0", "size": 44928 }
[ "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;
1,486,330
protected byte[] generateEphemeralKey(int keySize) throws TrustException { try { SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] temp = new byte[keySize / 8]; random.nextBytes(temp); return temp; } catch (Exception e) { throw new TrustException("Error in creating the ephemeral key", e); } }
byte[] function(int keySize) throws TrustException { try { SecureRandom random = SecureRandom.getInstance(STR); byte[] temp = new byte[keySize / 8]; random.nextBytes(temp); return temp; } catch (Exception e) { throw new TrustException(STR, e); } }
/** * Create an ephemeral key * * @return The generated ephemeral key * @throws TrustException */
Create an ephemeral key
generateEphemeralKey
{ "repo_name": "wso2/wso2-rampart", "path": "modules/rampart-trust/src/main/java/org/apache/rahas/TrustUtil.java", "license": "apache-2.0", "size": 32598 }
[ "java.security.SecureRandom" ]
import java.security.SecureRandom;
import java.security.*;
[ "java.security" ]
java.security;
2,183,356
public void testImportUsingCleanupWithGrouping() { String origModuleText = "\n" + "module " + CALPlatformTestModuleNames.ImportCleaner_Test_Support1 + ";\n" + "import " + CAL_Prelude.MODULE_NAME + " using\n" + "function = concat, equals, error, fromJust, fst, intToString, isNothing, isEmpty;\n" + "function = max, not, output, seq, snd, field1, field2, field3, upFrom, upFromTo, fromMaybe, notANumber, isNotANumber, isJust, abs, multiply, min, field4;\n" + "dataConstructor =\n" + " Cons, EQ, False, GT, Just, LT, Left, Nil, Nothing, Right, True;" + " ;\n" + "import " + CAL_List.MODULE_NAME + " using\n" + " function = head, tail, subList;\n" + " ;\n" + "\n" + "listRoundTrip x = " + CAL_List.MODULE_NAME + ".head x : tail x;" + "private referencePreludeFunctions =\n" + " (concat, equals, error, fromJust, fst, intToString, isNothing, isEmpty, max, not, output, seq, snd, field1, field2, field3, upFrom, upFromTo, fromMaybe, notANumber, isNotANumber, isJust, abs, multiply, min, field4);" + "private referencePreludeDataconses =" + " (False, True, LT, EQ, GT, Nil, Cons, Nothing, Just, Left, Right);"; CompilerMessageLogger logger = new MessageLogger(); SourceModifier sourceModifier = ImportCleaner.getSourceModifier_cleanImports(workspace.asModuleContainer(), CALPlatformTestModuleNames.ImportCleaner_Test_Support1, origModuleText, false, logger); assertTrue(logger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) < 0); String newModuleText = sourceModifier.apply(origModuleText); CompilerTestUtilities.assertEqualsCanonicalLineFeed( "\n" + "module " + CALPlatformTestModuleNames.ImportCleaner_Test_Support1 + ";\n" + "import " + CAL_Prelude.MODULE_NAME + " using\n" + " dataConstructor =\n" + " False, True, Left, Right, Nil, Cons, Nothing, Just, LT, EQ, GT;\n" + " function =\n" + " abs, concat, equals, error, field1, field2, field3, field4, fromJust,\n" + " fromMaybe, fst, intToString, isEmpty, isJust, isNotANumber, isNothing,\n" + " max, min, multiply, not, notANumber, output, seq, snd, upFrom, upFromTo;\n" + " ;\n" + "import " + CAL_List.MODULE_NAME + " using\n" + " function = tail;\n" + " ;\n" + "\n" + "listRoundTrip x = " + CAL_List.MODULE_NAME + ".head x : tail x;" + "private referencePreludeFunctions =\n" + " (concat, equals, error, fromJust, fst, intToString, isNothing, isEmpty, max, not, output, seq, snd, field1, field2, field3, upFrom, upFromTo, fromMaybe, notANumber, isNotANumber, isJust, abs, multiply, min, field4);" + "private referencePreludeDataconses =" + " (False, True, LT, EQ, GT, Nil, Cons, Nothing, Just, Left, Right);", newModuleText); }
void function() { String origModuleText = "\n" + STR + CALPlatformTestModuleNames.ImportCleaner_Test_Support1 + ";\n" + STR + CAL_Prelude.MODULE_NAME + STR + STR + STR + STR + STR + STR + STR + CAL_List.MODULE_NAME + STR + STR + STR + "\n" + STR + CAL_List.MODULE_NAME + STR + STR + STR + STR + STR; CompilerMessageLogger logger = new MessageLogger(); SourceModifier sourceModifier = ImportCleaner.getSourceModifier_cleanImports(workspace.asModuleContainer(), CALPlatformTestModuleNames.ImportCleaner_Test_Support1, origModuleText, false, logger); assertTrue(logger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) < 0); String newModuleText = sourceModifier.apply(origModuleText); CompilerTestUtilities.assertEqualsCanonicalLineFeed( "\n" + STR + CALPlatformTestModuleNames.ImportCleaner_Test_Support1 + ";\n" + STR + CAL_Prelude.MODULE_NAME + STR + STR + STR + STR + STR + STR + STR + STR + STR + CAL_List.MODULE_NAME + STR + STR + STR + "\n" + STR + CAL_List.MODULE_NAME + STR + STR + STR + STR + STR, newModuleText); }
/** * Test import cleanup and multi-line formatting and grouping of multiple * items into a single item. * */
Test import cleanup and multi-line formatting and grouping of multiple items into a single item
testImportUsingCleanupWithGrouping
{ "repo_name": "levans/Open-Quark", "path": "src/CAL_Platform/test/org/openquark/cal/compiler/ImportCleaner_Test.java", "license": "bsd-3-clause", "size": 21023 }
[ "junit.framework.Test", "org.openquark.cal.CALPlatformTestModuleNames" ]
import junit.framework.Test; import org.openquark.cal.CALPlatformTestModuleNames;
import junit.framework.*; import org.openquark.cal.*;
[ "junit.framework", "org.openquark.cal" ]
junit.framework; org.openquark.cal;
2,847,963
public void setSyllabusDataView(String view) { DecoratedSyllabusEntry entry = getEntry(); if (entry != null) { SyllabusData syllabusData = entry.getEntry(); if (syllabusData != null) { syllabusData.setView(view); } } }
void function(String view) { DecoratedSyllabusEntry entry = getEntry(); if (entry != null) { SyllabusData syllabusData = entry.getEntry(); if (syllabusData != null) { syllabusData.setView(view); } } }
/** * set the view for saving * @param view */
set the view for saving
setSyllabusDataView
{ "repo_name": "hackbuteer59/sakai", "path": "syllabus/syllabus-app/src/java/org/sakaiproject/tool/syllabus/SyllabusTool.java", "license": "apache-2.0", "size": 91701 }
[ "org.sakaiproject.api.app.syllabus.SyllabusData" ]
import org.sakaiproject.api.app.syllabus.SyllabusData;
import org.sakaiproject.api.app.syllabus.*;
[ "org.sakaiproject.api" ]
org.sakaiproject.api;
2,044,983
public LinkedList<Diff> diff_fromDelta(String text1, String delta) throws IllegalArgumentException { LinkedList<Diff> diffs = new LinkedList<Diff>(); int pointer = 0; // Cursor in text1 String[] tokens = delta.split("\t"); for (String token : tokens) { if (token.length() == 0) { // Blank tokens are ok (from a trailing \t). continue; } // Each token begins with a one character parameter which specifies the // operation of this token (delete, insert, equality). String param = token.substring(1); switch (token.charAt(0)) { case '+': // decode would change all "+" to " " param = param.replace("+", "%2B"); try { param = URLDecoder.decode(param, "UTF-8"); } catch (UnsupportedEncodingException e) { // Not likely on modern system. throw new Error("This system does not support UTF-8.", e); } catch (IllegalArgumentException e) { // Malformed URI sequence. throw new IllegalArgumentException( "Illegal escape in diff_fromDelta: " + param, e); } diffs.add(new Diff(Operation.INSERT, param)); break; case '-': // Fall through. case '=': int n; try { n = Integer.parseInt(param); } catch (NumberFormatException e) { throw new IllegalArgumentException( "Invalid number in diff_fromDelta: " + param, e); } if (n < 0) { throw new IllegalArgumentException( "Negative number in diff_fromDelta: " + param); } String text; try { text = text1.substring(pointer, pointer += n); } catch (StringIndexOutOfBoundsException e) { throw new IllegalArgumentException("Delta length (" + pointer + ") larger than source text length (" + text1.length() + ").", e); } if (token.charAt(0) == '=') { diffs.add(new Diff(Operation.EQUAL, text)); } else { diffs.add(new Diff(Operation.DELETE, text)); } break; default: // Anything else is an error. throw new IllegalArgumentException( "Invalid diff operation in diff_fromDelta: " + token.charAt(0)); } } if (pointer != text1.length()) { throw new IllegalArgumentException("Delta length (" + pointer + ") smaller than source text length (" + text1.length() + ")."); } return diffs; } // MATCH FUNCTIONS
LinkedList<Diff> function(String text1, String delta) throws IllegalArgumentException { LinkedList<Diff> diffs = new LinkedList<Diff>(); int pointer = 0; String[] tokens = delta.split("\t"); for (String token : tokens) { if (token.length() == 0) { continue; } String param = token.substring(1); switch (token.charAt(0)) { case '+': param = param.replace("+", "%2B"); try { param = URLDecoder.decode(param, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new Error(STR, e); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( STR + param, e); } diffs.add(new Diff(Operation.INSERT, param)); break; case '-': case '=': int n; try { n = Integer.parseInt(param); } catch (NumberFormatException e) { throw new IllegalArgumentException( STR + param, e); } if (n < 0) { throw new IllegalArgumentException( STR + param); } String text; try { text = text1.substring(pointer, pointer += n); } catch (StringIndexOutOfBoundsException e) { throw new IllegalArgumentException(STR + pointer + STR + text1.length() + ").", e); } if (token.charAt(0) == '=') { diffs.add(new Diff(Operation.EQUAL, text)); } else { diffs.add(new Diff(Operation.DELETE, text)); } break; default: throw new IllegalArgumentException( STR + token.charAt(0)); } } if (pointer != text1.length()) { throw new IllegalArgumentException(STR + pointer + STR + text1.length() + ")."); } return diffs; }
/** * Given the original text1, and an encoded string which describes the * operations required to transform text1 into text2, compute the full diff. * @param text1 Source string for the diff. * @param delta Delta text. * @return Array of diff tuples or null if invalid. * @throws IllegalArgumentException If invalid input. */
Given the original text1, and an encoded string which describes the operations required to transform text1 into text2, compute the full diff
diff_fromDelta
{ "repo_name": "SeekingFor/jfniki", "path": "alien/src/name/fraser/neil/plaintext/diff_match_patch.java", "license": "gpl-2.0", "size": 88387 }
[ "java.io.UnsupportedEncodingException", "java.net.URLDecoder", "java.util.LinkedList" ]
import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.LinkedList;
import java.io.*; import java.net.*; import java.util.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
930,056
private static void setNodeMaximumSize(final Node node, final FormatOptions options) { int size = getGroupCountSize(node); for (CharGroup g : node.mData) { final int groupSize = getCharGroupMaximumSize(g, options); g.mCachedSize = groupSize; size += groupSize; } if (options.mSupportsDynamicUpdate) { size += FormatSpec.FORWARD_LINK_ADDRESS_SIZE; } node.mCachedSize = size; }
static void function(final Node node, final FormatOptions options) { int size = getGroupCountSize(node); for (CharGroup g : node.mData) { final int groupSize = getCharGroupMaximumSize(g, options); g.mCachedSize = groupSize; size += groupSize; } if (options.mSupportsDynamicUpdate) { size += FormatSpec.FORWARD_LINK_ADDRESS_SIZE; } node.mCachedSize = size; }
/** * Compute the maximum size of a node, assuming 3-byte addresses for everything, and caches * it in the 'actualSize' member of the node. * * @param node the node to compute the maximum size of. * @param options file format options. */
Compute the maximum size of a node, assuming 3-byte addresses for everything, and caches it in the 'actualSize' member of the node
setNodeMaximumSize
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java", "license": "gpl-2.0", "size": 76116 }
[ "com.android.inputmethod.latin.makedict.FormatSpec", "com.android.inputmethod.latin.makedict.FusionDictionary" ]
import com.android.inputmethod.latin.makedict.FormatSpec; import com.android.inputmethod.latin.makedict.FusionDictionary;
import com.android.inputmethod.latin.makedict.*;
[ "com.android.inputmethod" ]
com.android.inputmethod;
2,368,733
public static java.util.Set extractEmergencyAttendanceSet(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForTriageLiteVoCollection voCollection) { return extractEmergencyAttendanceSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForTriageLiteVoCollection voCollection) { return extractEmergencyAttendanceSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.core.admin.domain.objects.EmergencyAttendance set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.core.admin.domain.objects.EmergencyAttendance set from the value object collection
extractEmergencyAttendanceSet
{ "repo_name": "IMS-MAXIMS/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/EmergencyAttendanceForTriageLiteVoAssembler.java", "license": "agpl-3.0", "size": 31659 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,012,455
protected boolean markOffline(Computer c, OfflineCause oc) { if (isIgnored() || c.isTemporarilyOffline()) return false; // noop c.setTemporarilyOffline(true, oc); // notify the admin MonitorMarkedNodeOffline no = AdministrativeMonitor.all().get(MonitorMarkedNodeOffline.class); if (no != null) no.active = true; return true; }
boolean function(Computer c, OfflineCause oc) { if (isIgnored() c.isTemporarilyOffline()) return false; c.setTemporarilyOffline(true, oc); MonitorMarkedNodeOffline no = AdministrativeMonitor.all().get(MonitorMarkedNodeOffline.class); if (no != null) no.active = true; return true; }
/** * Utility method to mark the computer offline for derived classes. * * @return true * if the node was actually taken offline by this act (as opposed to us deciding not to do it, * or the computer already marked offline.) */
Utility method to mark the computer offline for derived classes
markOffline
{ "repo_name": "MarkEWaite/jenkins", "path": "core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java", "license": "mit", "size": 11363 }
[ "hudson.model.AdministrativeMonitor", "hudson.model.Computer", "hudson.slaves.OfflineCause" ]
import hudson.model.AdministrativeMonitor; import hudson.model.Computer; import hudson.slaves.OfflineCause;
import hudson.model.*; import hudson.slaves.*;
[ "hudson.model", "hudson.slaves" ]
hudson.model; hudson.slaves;
1,614,854
Set<String> getCustomMetricNames();
Set<String> getCustomMetricNames();
/** * Get the set of custom metric names created in this context. * * The set may include additional metrics not created by this function * including metric created by the topology framework. * * @return The set of custom metric names created in this context. * * @since 1.7 */
Get the set of custom metric names created in this context. The set may include additional metrics not created by this function including metric created by the topology framework
getCustomMetricNames
{ "repo_name": "ddebrunner/streamsx.topology", "path": "java/runtime/src/com/ibm/streamsx/topology/function/FunctionContext.java", "license": "apache-2.0", "size": 9343 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,484,218
public QueryShardContext getQueryShardContext() { return queryShardContextCache.get(); }
QueryShardContext function() { return queryShardContextCache.get(); }
/** * Returns a threadlocal QueryShardContext for this shard. */
Returns a threadlocal QueryShardContext for this shard
getQueryShardContext
{ "repo_name": "polyfractal/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/shard/IndexShard.java", "license": "apache-2.0", "size": 75969 }
[ "org.elasticsearch.index.query.QueryShardContext" ]
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.index.query.*;
[ "org.elasticsearch.index" ]
org.elasticsearch.index;
1,122,094
public static <T extends OrmLiteSqliteOpenHelper> T getHelper(Context context, Class<T> schemaClass) { T helper=null; if(find(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName())) { helper = getHelper(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName(), schemaClass); } else{ try{ helper = OpenHelperManager.getHelper(context, schemaClass); } catch(IllegalStateException e) { OpenHelperManager.releaseHelper(); OpenHelperManager.setHelper(helper); helper = OpenHelperManager.getHelper(context, schemaClass); } create(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName(), helper); } helper.getWritableDatabase(); return helper; }
static <T extends OrmLiteSqliteOpenHelper> T function(Context context, Class<T> schemaClass) { T helper=null; if(find(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName())) { helper = getHelper(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName(), schemaClass); } else{ try{ helper = OpenHelperManager.getHelper(context, schemaClass); } catch(IllegalStateException e) { OpenHelperManager.releaseHelper(); OpenHelperManager.setHelper(helper); helper = OpenHelperManager.getHelper(context, schemaClass); } create(schemaClass.getSimpleName()+DefinitionsDatabase.getDatabaseName(), helper); } helper.getWritableDatabase(); return helper; }
/** * Simulates a singleton instance of a database helper, therefore creating and opening the database and allowing * to use it. * @param context a valid application context. * @param password the password of the database. * @param schemaClass a subclass of com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper * implementing the database schema class (Example: ORMSchema.class) * @param <T> * @return a valid database helper to connect with a database described in schemaClass (Connection) */
Simulates a singleton instance of a database helper, therefore creating and opening the database and allowing to use it
getHelper
{ "repo_name": "fcopardo/APF-Ormlite", "path": "src/main/java/com/grizzly/apf/Ormlite/DBManager.java", "license": "apache-2.0", "size": 4544 }
[ "android.content.Context", "com.j256.ormlite.android.apptools.OpenHelperManager", "com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper" ]
import android.content.Context; import com.j256.ormlite.android.apptools.OpenHelperManager; import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import android.content.*; import com.j256.ormlite.android.apptools.*;
[ "android.content", "com.j256.ormlite" ]
android.content; com.j256.ormlite;
21,951
public int getAccountContainerCount () { Header contCountHeader = getResponseHeader (FilesConstants.X_ACCOUNT_CONTAINER_COUNT); if (contCountHeader != null ) return Integer.parseInt(contCountHeader.getValue()); return -1; }
int function () { Header contCountHeader = getResponseHeader (FilesConstants.X_ACCOUNT_CONTAINER_COUNT); if (contCountHeader != null ) return Integer.parseInt(contCountHeader.getValue()); return -1; }
/** * Get the number of objects in the header * * @return -1 if the header is not present or the correct value as defined by the header */
Get the number of objects in the header
getAccountContainerCount
{ "repo_name": "stacksync/android", "path": "src/main/java/com/stacksync/android/api/FilesResponse.java", "license": "gpl-3.0", "size": 9266 }
[ "org.apache.http.Header" ]
import org.apache.http.Header;
import org.apache.http.*;
[ "org.apache.http" ]
org.apache.http;
2,430,045
public ReceiveCommand.Type getChangeType(String ref) { ReceiveCommand.Type type = refUpdates.get(ref); return type; }
ReceiveCommand.Type function(String ref) { ReceiveCommand.Type type = refUpdates.get(ref); return type; }
/** * Returns the change type of the ref change. * * @param ref * @return the change type for the ref */
Returns the change type of the ref change
getChangeType
{ "repo_name": "heavenlyhash/gitblit", "path": "src/main/java/com/gitblit/models/PushLogEntry.java", "license": "apache-2.0", "size": 8790 }
[ "org.eclipse.jgit.transport.ReceiveCommand" ]
import org.eclipse.jgit.transport.ReceiveCommand;
import org.eclipse.jgit.transport.*;
[ "org.eclipse.jgit" ]
org.eclipse.jgit;
671,263
private void put(URI uri, Cookie cookie) { logger.log(Level.FINEST, "cookie: {0}", cookie); String host = uri.getHost(); if (host == null || host.length() == 0) { logger.log(Level.FINEST, "Null or empty URI host, ignoring cookie"); return; } host = canonicalize(host); if (PublicSuffixes.isPublicSuffix(cookie.getDomain())) { if (cookie.getDomain().equals(host)) { cookie.setDomain(""); } else { logger.log(Level.FINEST, "Domain is public suffix, " + "ignoring cookie"); return; } } if (cookie.getDomain().length() > 0) { if (!Cookie.domainMatches(host, cookie.getDomain())) { logger.log(Level.FINEST, "Hostname does not match domain, " + "ignoring cookie"); return; } else { cookie.setHostOnly(false); } } else { cookie.setHostOnly(true); cookie.setDomain(host); } if (cookie.getPath() == null) { cookie.setPath(Cookie.defaultPath(uri)); } boolean httpApi = "http".equalsIgnoreCase(uri.getScheme()) || "https".equalsIgnoreCase(uri.getScheme()); if (cookie.getHttpOnly() && !httpApi) { logger.log(Level.FINEST, "HttpOnly cookie received from non-HTTP " + "API, ignoring cookie"); return; } synchronized (store) { Cookie oldCookie = store.get(cookie); if (oldCookie != null) { if (oldCookie.getHttpOnly() && !httpApi) { logger.log(Level.FINEST, "Non-HTTP API attempts to " + "overwrite HttpOnly cookie, blocked"); return; } cookie.setCreationTime(oldCookie.getCreationTime()); } store.put(cookie); } logger.log(Level.FINEST, "Stored: {0}", cookie); }
void function(URI uri, Cookie cookie) { logger.log(Level.FINEST, STR, cookie); String host = uri.getHost(); if (host == null host.length() == 0) { logger.log(Level.FINEST, STR); return; } host = canonicalize(host); if (PublicSuffixes.isPublicSuffix(cookie.getDomain())) { if (cookie.getDomain().equals(host)) { cookie.setDomain(STRDomain is public suffix, STRignoring cookieSTRHostname does not match domain, STRignoring cookieSTRhttpSTRhttpsSTRHttpOnly cookie received from non-HTTP STRAPI, ignoring cookieSTRNon-HTTP API attempts to STRoverwrite HttpOnly cookie, blockedSTRStored: {0}", cookie); }
/** * Puts an individual cookie. */
Puts an individual cookie
put
{ "repo_name": "maiklos-mirrors/jfx78", "path": "modules/web/src/main/java/com/sun/webkit/network/CookieManager.java", "license": "gpl-2.0", "size": 7659 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
2,681,498
@Override public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); MessageDispatch info = (MessageDispatch) o; tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessage(), dataOut, bs); dataOut.writeInt(info.getRedeliveryCounter()); }
void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); MessageDispatch info = (MessageDispatch) o; tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessage(), dataOut, bs); dataOut.writeInt(info.getRedeliveryCounter()); }
/** * Write a object instance to data output stream * * @param o * the instance to be marshaled * @param dataOut * the output stream * @throws IOException * thrown if an error occurs */
Write a object instance to data output stream
tightMarshal2
{ "repo_name": "tabish121/OpenWire", "path": "openwire-legacy/src/main/java/io/openwire/codec/v5/MessageDispatchMarshaller.java", "license": "apache-2.0", "size": 5324 }
[ "io.openwire.codec.BooleanStream", "io.openwire.codec.OpenWireFormat", "io.openwire.commands.MessageDispatch", "java.io.DataOutput", "java.io.IOException" ]
import io.openwire.codec.BooleanStream; import io.openwire.codec.OpenWireFormat; import io.openwire.commands.MessageDispatch; import java.io.DataOutput; import java.io.IOException;
import io.openwire.codec.*; import io.openwire.commands.*; import java.io.*;
[ "io.openwire.codec", "io.openwire.commands", "java.io" ]
io.openwire.codec; io.openwire.commands; java.io;
722,923
private ImmutableList<Substitution> getTemplateSubstitutions(RuleContext ruleContext) throws RuleErrorException { return ImmutableList.<Substitution>builder() .add(Substitution.of("%workspace%", ruleContext.getWorkspaceName())) .add(Substitution.of("%test_label%", ruleContext.getLabel().getCanonicalForm())) .add(executableSubstitution("%adb%", getAdb(ruleContext))) .add(executableSubstitution("%aapt%", getAapt(ruleContext))) .add(executableSubstitution("%device_script%", getTargetDevice(ruleContext))) .add(executableSubstitution("%test_entry_point%", getTestEntryPoint(ruleContext))) .add(artifactSubstitution("%target_apk%", getTargetApk(ruleContext))) .add(artifactSubstitution("%instrumentation_apk%", getInstrumentationApk(ruleContext))) .add(artifactListSubstitution("%support_apks%", getAllSupportApks(ruleContext).toList())) .add(deviceScriptFixturesSubstitution(ruleContext)) .addAll(hostServiceFixturesSubstitutions(ruleContext)) .add(artifactListSubstitution("%data_deps%", getDataDeps(ruleContext))) .add(Substitution.of("%device_broker_type%", getDeviceBrokerType(ruleContext))) .add(Substitution.of("%test_suite_property_name%", getTestSuitePropertyName(ruleContext))) .build(); }
ImmutableList<Substitution> function(RuleContext ruleContext) throws RuleErrorException { return ImmutableList.<Substitution>builder() .add(Substitution.of(STR, ruleContext.getWorkspaceName())) .add(Substitution.of(STR, ruleContext.getLabel().getCanonicalForm())) .add(executableSubstitution("%adb%", getAdb(ruleContext))) .add(executableSubstitution(STR, getAapt(ruleContext))) .add(executableSubstitution(STR, getTargetDevice(ruleContext))) .add(executableSubstitution(STR, getTestEntryPoint(ruleContext))) .add(artifactSubstitution(STR, getTargetApk(ruleContext))) .add(artifactSubstitution(STR, getInstrumentationApk(ruleContext))) .add(artifactListSubstitution(STR, getAllSupportApks(ruleContext).toList())) .add(deviceScriptFixturesSubstitution(ruleContext)) .addAll(hostServiceFixturesSubstitutions(ruleContext)) .add(artifactListSubstitution(STR, getDataDeps(ruleContext))) .add(Substitution.of(STR, getDeviceBrokerType(ruleContext))) .add(Substitution.of(STR, getTestSuitePropertyName(ruleContext))) .build(); }
/** * This method defines all substitutions need to fill in {@link * #ANDROID_INSTRUMENTATION_TEST_STUB_SCRIPT}. */
This method defines all substitutions need to fill in <code>#ANDROID_INSTRUMENTATION_TEST_STUB_SCRIPT</code>
getTemplateSubstitutions
{ "repo_name": "dslomov/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTestBase.java", "license": "apache-2.0", "size": 15446 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.analysis.actions.Substitution" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.actions.Substitution;
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.analysis.actions.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
2,706,861
public void setProperties(String prefix, Properties properties) { super.setProperties(prefix, properties); String realPrefix = ""; if (prefix != null) { realPrefix = prefix + "."; } setUpdateInterval(PropUtils.intFromProperties(properties, realPrefix + UpdateTimerIntervalProperty, updateInterval)); setAutoTimer(PropUtils.booleanFromProperties(properties, realPrefix + AutoTimerProperty, autoTimer)); }
void function(String prefix, Properties properties) { super.setProperties(prefix, properties); String realPrefix = STR."; } setUpdateInterval(PropUtils.intFromProperties(properties, realPrefix + UpdateTimerIntervalProperty, updateInterval)); setAutoTimer(PropUtils.booleanFromProperties(properties, realPrefix + AutoTimerProperty, autoTimer)); }
/** * The properties and prefix are managed and decoded here, for the standard * uses of the LocationLayer. * * @param prefix string prefix used in the properties file for this layer. * @param properties the properties set in the properties file. */
The properties and prefix are managed and decoded here, for the standard uses of the LocationLayer
setProperties
{ "repo_name": "d2fn/passage", "path": "src/main/java/com/bbn/openmap/layer/location/TimerLocationLayer.java", "license": "mit", "size": 12489 }
[ "com.bbn.openmap.util.PropUtils", "java.util.Properties" ]
import com.bbn.openmap.util.PropUtils; import java.util.Properties;
import com.bbn.openmap.util.*; import java.util.*;
[ "com.bbn.openmap", "java.util" ]
com.bbn.openmap; java.util;
1,338,748
public void addUpdateListener(AnimatorUpdateListener listener) { if (mUpdateListeners == null) { mUpdateListeners = new ArrayList<AnimatorUpdateListener>(); } mUpdateListeners.add(listener); }
void function(AnimatorUpdateListener listener) { if (mUpdateListeners == null) { mUpdateListeners = new ArrayList<AnimatorUpdateListener>(); } mUpdateListeners.add(listener); }
/** * Adds a listener to the set of listeners that are sent update events through the life of * an animation. This method is called on all listeners for every frame of the animation, * after the values for the animation have been calculated. * * @param listener the listener to be added to the current set of listeners for this animation. */
Adds a listener to the set of listeners that are sent update events through the life of an animation. This method is called on all listeners for every frame of the animation, after the values for the animation have been calculated
addUpdateListener
{ "repo_name": "Codetail/Mover", "path": "uicomponents/src/main/java/com/nineoldandroids/animation/ValueAnimator.java", "license": "apache-2.0", "size": 53433 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,428,205
public String format(final Date date) { return printer.format(date); }
String function(final Date date) { return printer.format(date); }
/** * <p>Formats a {@code Date} object using a {@code GregorianCalendar}.</p> * * @param date the date to format * @return the formatted string */
Formats a Date object using a GregorianCalendar
format
{ "repo_name": "angelLYK/sqlite-jdbc", "path": "src/main/java/org/sqlite/date/FastDateFormat.java", "license": "apache-2.0", "size": 21993 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,662,137
public void open(String file, String rw) throws IOException, FormatException;
void function(String file, String rw) throws IOException, FormatException;
/** * Initializes the service for the given file path. * @param file File path with which to initialize the service. * @throws IOException * @throws FormatException */
Initializes the service for the given file path
open
{ "repo_name": "bramalingam/bioformats", "path": "components/formats-gpl/src/loci/formats/services/WlzService.java", "license": "gpl-2.0", "size": 6834 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
127,261
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { if (!(e.getMessage() instanceof ChannelBuffer)) { ctx.sendUpstream(e); return; } final ChannelBuffer buffer = (ChannelBuffer) e.getMessage(); final int type, rc; final long ledgerId, entryId; try { type = buffer.readInt(); rc = buffer.readInt(); ledgerId = buffer.readLong(); entryId = buffer.readLong(); } catch (IndexOutOfBoundsException ex) { LOG.error("Unparseable response from bookie: " + addr, ex); return; }
void function(ChannelHandlerContext ctx, MessageEvent e) throws Exception { if (!(e.getMessage() instanceof ChannelBuffer)) { ctx.sendUpstream(e); return; } final ChannelBuffer buffer = (ChannelBuffer) e.getMessage(); final int type, rc; final long ledgerId, entryId; try { type = buffer.readInt(); rc = buffer.readInt(); ledgerId = buffer.readLong(); entryId = buffer.readLong(); } catch (IndexOutOfBoundsException ex) { LOG.error(STR + addr, ex); return; }
/** * Called by netty when a message is received on a channel */
Called by netty when a message is received on a channel
messageReceived
{ "repo_name": "cloudera/zookeeper", "path": "src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java", "license": "apache-2.0", "size": 21618 }
[ "org.jboss.netty.buffer.ChannelBuffer", "org.jboss.netty.channel.ChannelHandlerContext", "org.jboss.netty.channel.MessageEvent" ]
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.buffer.*; import org.jboss.netty.channel.*;
[ "org.jboss.netty" ]
org.jboss.netty;
1,517,776
public CountDownLatch updateAccountContactAsync(com.mozu.api.contracts.customer.CustomerContact contact, Integer accountId, Integer contactId, String responseFields, AsyncCallback<com.mozu.api.contracts.customer.CustomerContact> callback) throws Exception { MozuClient<com.mozu.api.contracts.customer.CustomerContact> client = com.mozu.api.clients.commerce.customer.accounts.CustomerContactClient.updateAccountContactClient( contact, accountId, contactId, responseFields); client.setContext(_apiContext); return client.executeRequest(callback); }
CountDownLatch function(com.mozu.api.contracts.customer.CustomerContact contact, Integer accountId, Integer contactId, String responseFields, AsyncCallback<com.mozu.api.contracts.customer.CustomerContact> callback) throws Exception { MozuClient<com.mozu.api.contracts.customer.CustomerContact> client = com.mozu.api.clients.commerce.customer.accounts.CustomerContactClient.updateAccountContactClient( contact, accountId, contactId, responseFields); client.setContext(_apiContext); return client.executeRequest(callback); }
/** * Updates a contact for a specified customer account such as to update addresses or change which contact is the primary contact for billing. * <p><pre><code> * CustomerContact customercontact = new CustomerContact(); * CountDownLatch latch = customercontact.updateAccountContact( contact, accountId, contactId, responseFields, callback ); * latch.await() * </code></pre></p> * @param accountId Unique identifier of the customer account. * @param contactId Unique identifer of the customer account contact being updated. * @param responseFields Use this field to include those fields which are not included by default. * @param callback callback handler for asynchronous operations * @param contact Contact information, including the contact's name, address, phone numbers, email addresses, and company (if supplied). Also indicates whether this is a billing, shipping, or billing and shipping contact. * @return com.mozu.api.contracts.customer.CustomerContact * @see com.mozu.api.contracts.customer.CustomerContact * @see com.mozu.api.contracts.customer.CustomerContact */
Updates a contact for a specified customer account such as to update addresses or change which contact is the primary contact for billing. <code><code> CustomerContact customercontact = new CustomerContact(); CountDownLatch latch = customercontact.updateAccountContact( contact, accountId, contactId, responseFields, callback ); latch.await() * </code></code>
updateAccountContactAsync
{ "repo_name": "sanjaymandadi/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/customer/accounts/CustomerContactResource.java", "license": "mit", "size": 21834 }
[ "com.mozu.api.AsyncCallback", "com.mozu.api.MozuClient", "java.util.concurrent.CountDownLatch" ]
import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.concurrent.CountDownLatch;
import com.mozu.api.*; import java.util.concurrent.*;
[ "com.mozu.api", "java.util" ]
com.mozu.api; java.util;
73,865
public UserService getUserService() { return userService; }
UserService function() { return userService; }
/** * Gets the user remote service. * * @return the user remote service */
Gets the user remote service
getUserService
{ "repo_name": "RamkumarChandran/My-Courses-Portlet", "path": "docroot/WEB-INF/src/org/gnenc/internet/mycourses/service/base/HostLocalServiceBaseImpl.java", "license": "gpl-3.0", "size": 17570 }
[ "com.liferay.portal.service.UserService" ]
import com.liferay.portal.service.UserService;
import com.liferay.portal.service.*;
[ "com.liferay.portal" ]
com.liferay.portal;
2,485,248
public void execute(HttpServletRequest request, HttpServletResponse response) throws Exception { response.setContentType("text/javascript"); this.builder.build(response.getWriter()); response.flushBuffer(); }
void function(HttpServletRequest request, HttpServletResponse response) throws Exception { response.setContentType(STR); this.builder.build(response.getWriter()); response.flushBuffer(); }
/** * Converts the object passed in to JavaScript and streams it back to the client. */
Converts the object passed in to JavaScript and streams it back to the client
execute
{ "repo_name": "scarcher2/stripes", "path": "stripes/src/net/sourceforge/stripes/ajax/JavaScriptResolution.java", "license": "apache-2.0", "size": 3118 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
1,905,297
Set<K> getKeys();
Set<K> getKeys();
/** * Returns a set of all the keys currently contained within the ObjectCache. * * <p>This is a static copy of the keys in the cache at the point in time when the function is * called. * * @return a set of keys currently contained within the cache. */
Returns a set of all the keys currently contained within the ObjectCache. This is a static copy of the keys in the cache at the point in time when the function is called
getKeys
{ "repo_name": "geotools/geotools", "path": "modules/library/metadata/src/main/java/org/geotools/util/ObjectCache.java", "license": "lgpl-2.1", "size": 4599 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
974,471
public void processMouseEvent(ExecutionUnit process, MouseEventType type, MouseEvent e);
void function(ExecutionUnit process, MouseEventType type, MouseEvent e);
/** * Process the mouse event during the {@link RenderPhase} specified while registering. * <p> * If it makes no sense that the event is passed down to the earlier phases/decorators, call * {@link MouseEvent#consume()}. * </p> * * @param process * the process the mouse event happened over. Can be {@code null}! * @param type * the mouse event type * @param e * the mouse event to process */
Process the mouse event during the <code>RenderPhase</code> specified while registering. If it makes no sense that the event is passed down to the earlier phases/decorators, call <code>MouseEvent#consume()</code>.
processMouseEvent
{ "repo_name": "rapidminer/rapidminer-studio", "path": "src/main/java/com/rapidminer/gui/flow/processrendering/view/ProcessEventDecorator.java", "license": "agpl-3.0", "size": 4042 }
[ "com.rapidminer.operator.ExecutionUnit", "java.awt.event.MouseEvent" ]
import com.rapidminer.operator.ExecutionUnit; import java.awt.event.MouseEvent;
import com.rapidminer.operator.*; import java.awt.event.*;
[ "com.rapidminer.operator", "java.awt" ]
com.rapidminer.operator; java.awt;
270,565
public void setPosition(int x, int y) { GLFW.glfwSetWindowPos(windowHandle, x, y); }
void function(int x, int y) { GLFW.glfwSetWindowPos(windowHandle, x, y); }
/** Sets the position of the window in logical coordinates. All monitors * span a virtual surface together. The coordinates are relative to * the first monitor in the virtual surface. **/
Sets the position of the window in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to
setPosition
{ "repo_name": "mini2Dx/mini2Dx", "path": "libgdx-desktop-lwjgl3/src/main/java/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Mini2DxWindow.java", "license": "apache-2.0", "size": 16186 }
[ "org.lwjgl.glfw.GLFW" ]
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.*;
[ "org.lwjgl.glfw" ]
org.lwjgl.glfw;
353,934
public void setBirtEngine(IReportEngine birtEngine) { this.birtEngine = birtEngine; }
void function(IReportEngine birtEngine) { this.birtEngine = birtEngine; }
/** * Setter for birtEngine * @param birtEngine */
Setter for birtEngine
setBirtEngine
{ "repo_name": "praxiscomputing/Jtrac", "path": "helpdesk/src/main/java/info/jtrac/birt/ReportRenderer.java", "license": "apache-2.0", "size": 11209 }
[ "org.eclipse.birt.report.engine.api.IReportEngine" ]
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.*;
[ "org.eclipse.birt" ]
org.eclipse.birt;
840,986
public static boolean verifyPermissions(@NonNull int[] grantResults) { if (1 > grantResults.length) { return false; } for (int result : grantResults) { if (PackageManager.PERMISSION_GRANTED != result) { return false; } } return true; }
static boolean function(@NonNull int[] grantResults) { if (1 > grantResults.length) { return false; } for (int result : grantResults) { if (PackageManager.PERMISSION_GRANTED != result) { return false; } } return true; }
/** * Check that all permissions have been granted. * * @param grantResults The grant results for permissions. * @return true if all permissions have been granted, otherwise false. */
Check that all permissions have been granted
verifyPermissions
{ "repo_name": "raatiniemi/worker", "path": "app/src/main/java/me/raatiniemi/worker/util/PermissionUtil.java", "license": "gpl-2.0", "size": 2048 }
[ "android.content.pm.PackageManager", "androidx.annotation.NonNull" ]
import android.content.pm.PackageManager; import androidx.annotation.NonNull;
import android.content.pm.*; import androidx.annotation.*;
[ "android.content", "androidx.annotation" ]
android.content; androidx.annotation;
1,037,124
public static Predicate<Volume> awaitDeleted(VolumeApi volumeApi) { DeletedPredicate deletedPredicate = new DeletedPredicate(volumeApi); return retry(deletedPredicate, 600, 5, 5, SECONDS); }
static Predicate<Volume> function(VolumeApi volumeApi) { DeletedPredicate deletedPredicate = new DeletedPredicate(volumeApi); return retry(deletedPredicate, 600, 5, 5, SECONDS); }
/** * Wait until a Volume no longer exists. * * @param volumeApi The VolumeApi in the region where your Volume resides. * @return RetryablePredicate That will check the whether the Volume exists * every 5 seconds for a maxiumum of 10 minutes. */
Wait until a Volume no longer exists
awaitDeleted
{ "repo_name": "yanzhijun/jclouds-aliyun", "path": "apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/predicates/VolumePredicates.java", "license": "apache-2.0", "size": 5394 }
[ "com.google.common.base.Predicate", "org.jclouds.openstack.cinder.v1.domain.Volume", "org.jclouds.openstack.cinder.v1.features.VolumeApi", "org.jclouds.util.Predicates2" ]
import com.google.common.base.Predicate; import org.jclouds.openstack.cinder.v1.domain.Volume; import org.jclouds.openstack.cinder.v1.features.VolumeApi; import org.jclouds.util.Predicates2;
import com.google.common.base.*; import org.jclouds.openstack.cinder.v1.domain.*; import org.jclouds.openstack.cinder.v1.features.*; import org.jclouds.util.*;
[ "com.google.common", "org.jclouds.openstack", "org.jclouds.util" ]
com.google.common; org.jclouds.openstack; org.jclouds.util;
1,685,634
public static void save(File f, byte[] data) { try (FileOutputStream fout = new FileOutputStream(f)) { fout.write(data); } catch (IOException ex) { Exceptions.add(ex); } } private static class RAFtoInputStream extends InputStream implements DataInput { private final RandomAccessFile raf; private long markPosition = -1; public RAFtoInputStream(RandomAccessFile raf) { this.raf = raf; } /** * {@inheritDoc}
static void function(File f, byte[] data) { try (FileOutputStream fout = new FileOutputStream(f)) { fout.write(data); } catch (IOException ex) { Exceptions.add(ex); } } private static class RAFtoInputStream extends InputStream implements DataInput { private final RandomAccessFile raf; private long markPosition = -1; public RAFtoInputStream(RandomAccessFile raf) { this.raf = raf; } /** * {@inheritDoc}
/** * Save the given byte array as the given file. * @param f the file * @param data the non null data to save */
Save the given byte array as the given file
save
{ "repo_name": "p-smith/open-ig", "path": "src/hu/openig/utils/IOUtils.java", "license": "lgpl-3.0", "size": 16562 }
[ "java.io.DataInput", "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "java.io.InputStream", "java.io.RandomAccessFile" ]
import java.io.DataInput; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile;
import java.io.*;
[ "java.io" ]
java.io;
956,048
private void updateSelectionFromDataBook() { if (!ignoreSelectionEvents) { ignoreSelectionEvents = true; try { int rowIndex = dataBook.get().getSelectedRow(); if (rowIndex >= 0 && !getSelectionModel().isSelected(rowIndex)) { @SuppressWarnings("unchecked") TablePosition<IDataRow, ?> focusedPosition = getFocusModel().getFocusedCell(); if (focusedPosition != null && focusedPosition.getTableColumn() != null) { getSelectionModel().clearAndSelect(rowIndex, focusedPosition.getTableColumn()); } else if (!getColumns().isEmpty()) { getSelectionModel().clearAndSelect(rowIndex, getColumns().get(0)); } else { getSelectionModel().clearAndSelect(rowIndex); } } } catch (ModelException e) { ExceptionHandler.raise(e); } finally { ignoreSelectionEvents = false; } } } / public static class FXDataBookViewFocusModel extends TableViewFocusModel<IDataRow> { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class members //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private FXDataBookView dataBookView; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Initialization //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public FXDataBookViewFocusModel(FXDataBookView pDataBookView) { super(pDataBookView); dataBookView = pDataBookView; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Overwritten methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * {@inheritDoc}
void function() { if (!ignoreSelectionEvents) { ignoreSelectionEvents = true; try { int rowIndex = dataBook.get().getSelectedRow(); if (rowIndex >= 0 && !getSelectionModel().isSelected(rowIndex)) { @SuppressWarnings(STR) TablePosition<IDataRow, ?> focusedPosition = getFocusModel().getFocusedCell(); if (focusedPosition != null && focusedPosition.getTableColumn() != null) { getSelectionModel().clearAndSelect(rowIndex, focusedPosition.getTableColumn()); } else if (!getColumns().isEmpty()) { getSelectionModel().clearAndSelect(rowIndex, getColumns().get(0)); } else { getSelectionModel().clearAndSelect(rowIndex); } } } catch (ModelException e) { ExceptionHandler.raise(e); } finally { ignoreSelectionEvents = false; } } } / public static class FXDataBookViewFocusModel extends TableViewFocusModel<IDataRow> { private FXDataBookView dataBookView; public FXDataBookViewFocusModel(FXDataBookView pDataBookView) { super(pDataBookView); dataBookView = pDataBookView; } /** * {@inheritDoc}
/** * Updates the selection of this table with the one from the backing * {@link #dataBook}. */
Updates the selection of this table with the one from the backing <code>#dataBook</code>
updateSelectionFromDataBook
{ "repo_name": "ivartanian/JVx.javafx", "path": "src/com/sibvisions/rad/ui/javafx/ext/control/table/FXDataBookView.java", "license": "apache-2.0", "size": 23565 }
[ "javax.rad.model.IDataRow", "javax.rad.model.ModelException", "javax.rad.util.ExceptionHandler" ]
import javax.rad.model.IDataRow; import javax.rad.model.ModelException; import javax.rad.util.ExceptionHandler;
import javax.rad.model.*; import javax.rad.util.*;
[ "javax.rad" ]
javax.rad;
606,552
@Test public void testSuccessfulRequestContextWithThreadIsolatedSynchronousObservable() { RequestContextTestResults results = testRequestContextOnSuccess(ExecutionIsolationStrategy.THREAD, Schedulers.immediate()); assertTrue(results.isContextInitialized.get()); assertTrue(results.originThread.get().getName().startsWith("hystrix-OWNER_ONE")); // thread isolated on a HystrixThreadPool assertTrue(results.isContextInitializedObserveOn.get()); assertTrue(results.observeOnThread.get().getName().startsWith("hystrix-OWNER_ONE")); // thread isolated assertTrue(results.command.isExecutedInThread()); }
void function() { RequestContextTestResults results = testRequestContextOnSuccess(ExecutionIsolationStrategy.THREAD, Schedulers.immediate()); assertTrue(results.isContextInitialized.get()); assertTrue(results.originThread.get().getName().startsWith(STR)); assertTrue(results.isContextInitializedObserveOn.get()); assertTrue(results.observeOnThread.get().getName().startsWith(STR)); assertTrue(results.command.isExecutedInThread()); }
/** * Synchronous Observable and thread isolation. Work done on [hystrix-OWNER_ONE] thread and then observed on [RxComputation] */
Synchronous Observable and thread isolation. Work done on [hystrix-OWNER_ONE] thread and then observed on [RxComputation]
testSuccessfulRequestContextWithThreadIsolatedSynchronousObservable
{ "repo_name": "daveray/Hystrix", "path": "hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java", "license": "apache-2.0", "size": 357869 }
[ "com.netflix.hystrix.HystrixCommandProperties", "org.junit.Assert" ]
import com.netflix.hystrix.HystrixCommandProperties; import org.junit.Assert;
import com.netflix.hystrix.*; import org.junit.*;
[ "com.netflix.hystrix", "org.junit" ]
com.netflix.hystrix; org.junit;
2,004,387
public RowSet findRowSet( String from, int fromcopy, String to, int tocopy ) { // Start with the transformation. for ( int i = 0; i < rowsets.size(); i++ ) { RowSet rs = rowsets.get( i ); if ( rs.getOriginStepName().equalsIgnoreCase( from ) && rs.getDestinationStepName().equalsIgnoreCase( to ) && rs .getOriginStepCopy() == fromcopy && rs.getDestinationStepCopy() == tocopy ) { return rs; } } return null; }
RowSet function( String from, int fromcopy, String to, int tocopy ) { for ( int i = 0; i < rowsets.size(); i++ ) { RowSet rs = rowsets.get( i ); if ( rs.getOriginStepName().equalsIgnoreCase( from ) && rs.getDestinationStepName().equalsIgnoreCase( to ) && rs .getOriginStepCopy() == fromcopy && rs.getDestinationStepCopy() == tocopy ) { return rs; } } return null; }
/** * Finds the RowSet between two steps (or copies of steps). * * @param from * the name of the "from" step * @param fromcopy * the copy number of the "from" step * @param to * the name of the "to" step * @param tocopy * the copy number of the "to" step * @return the row set, or null if none found */
Finds the RowSet between two steps (or copies of steps)
findRowSet
{ "repo_name": "ViswesvarSekar/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 197991 }
[ "org.pentaho.di.core.RowSet" ]
import org.pentaho.di.core.RowSet;
import org.pentaho.di.core.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,525,952
public static byte[] convertFileToByteArray(File file) throws IOException { FileInputStream fis = new FileInputStream(file); try { long length = file.length(); if (length > 0) { return fastConversion(fis, length); } else { return slowConversion(fis); } } finally { try { fis.close(); } catch (IOException e) { // We want to throw the exception thrown by the outer try block // not by the close() } } }
static byte[] function(File file) throws IOException { FileInputStream fis = new FileInputStream(file); try { long length = file.length(); if (length > 0) { return fastConversion(fis, length); } else { return slowConversion(fis); } } finally { try { fis.close(); } catch (IOException e) { } } }
/** Read contents of a file and return it as a byte array * @param file the file to read * @return an array of bytes containing file's data. * @throws IOException */
Read contents of a file and return it as a byte array
convertFileToByteArray
{ "repo_name": "laurianed/scheduling", "path": "common/common-client/src/main/java/org/ow2/proactive/utils/FileToBytesConverter.java", "license": "agpl-3.0", "size": 4307 }
[ "java.io.File", "java.io.FileInputStream", "java.io.IOException" ]
import java.io.File; import java.io.FileInputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,841,298
List<TaskSummary> getTasksAssignedAsPotentialOwnerByExpirationDateOptional(String userId, List<Status> status, Date from, QueryFilter filter);
List<TaskSummary> getTasksAssignedAsPotentialOwnerByExpirationDateOptional(String userId, List<Status> status, Date from, QueryFilter filter);
/** * Return a list of tasks the user is eligible for with one of the listed * statuses and expiration date starting at <code>from</code>. Tasks that do not have expiration date set * will also be included in the result set. * * @param userId * @param status * @param from * @param filter * @return */
Return a list of tasks the user is eligible for with one of the listed statuses and expiration date starting at <code>from</code>. Tasks that do not have expiration date set will also be included in the result set
getTasksAssignedAsPotentialOwnerByExpirationDateOptional
{ "repo_name": "DuncanDoyle/jbpm", "path": "jbpm-services/jbpm-services-api/src/main/java/org/jbpm/services/api/RuntimeDataService.java", "license": "apache-2.0", "size": 26170 }
[ "java.util.Date", "java.util.List", "org.kie.api.task.model.Status", "org.kie.api.task.model.TaskSummary", "org.kie.internal.query.QueryFilter" ]
import java.util.Date; import java.util.List; import org.kie.api.task.model.Status; import org.kie.api.task.model.TaskSummary; import org.kie.internal.query.QueryFilter;
import java.util.*; import org.kie.api.task.model.*; import org.kie.internal.query.*;
[ "java.util", "org.kie.api", "org.kie.internal" ]
java.util; org.kie.api; org.kie.internal;
312,574
@Override public Adapter createGuardRuntimeDataAdapter() { if (guardRuntimeDataItemProvider == null) { guardRuntimeDataItemProvider = new GuardRuntimeDataItemProvider( this); } return guardRuntimeDataItemProvider; } protected MachineRuntimeDataItemProvider machineRuntimeDataItemProvider;
Adapter function() { if (guardRuntimeDataItemProvider == null) { guardRuntimeDataItemProvider = new GuardRuntimeDataItemProvider( this); } return guardRuntimeDataItemProvider; } protected MachineRuntimeDataItemProvider machineRuntimeDataItemProvider;
/** * This creates an adapter for a {@link com.thalesgroup.trt.mde.vp.modesimulation.ModeSimulation.GuardRuntimeData}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>com.thalesgroup.trt.mde.vp.modesimulation.ModeSimulation.GuardRuntimeData</code>.
createGuardRuntimeDataAdapter
{ "repo_name": "smadelenat/CapellaModeAutomata", "path": "Semantic/SimulationExtension/com.thalesgroup.trt.mde.vp.modesimulation.model.edit/src/com/thalesgroup/trt/mde/vp/modesimulation/ModeSimulation/provider/ModeSimulationItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 31712 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
729,063
public void setBalancerBandwidth(long bandwidth) throws IOException { namesystem.setBalancerBandwidth(bandwidth); }
void function(long bandwidth) throws IOException { namesystem.setBalancerBandwidth(bandwidth); }
/** * Tell all datanodes to use a new, non-persistent bandwidth value for * dfs.balance.bandwidthPerSec. * @param bandwidth Blanacer bandwidth in bytes per second for all datanodes. * @throws IOException */
Tell all datanodes to use a new, non-persistent bandwidth value for dfs.balance.bandwidthPerSec
setBalancerBandwidth
{ "repo_name": "fchu/hadoop-0.20.205", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java", "license": "apache-2.0", "size": 48090 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,108,633
public FileURL[] getForwardFolders() { if (!hasForwardFolder()) { return new FileURL[0]; } int historySize = history.size(); FileURL[] urls = new FileURL[historySize-historyIndex-1]; int cur = 0; for(int i=historyIndex+1; i<historySize; i++) { urls[cur++] = history.get(i); } return urls; }
FileURL[] function() { if (!hasForwardFolder()) { return new FileURL[0]; } int historySize = history.size(); FileURL[] urls = new FileURL[historySize-historyIndex-1]; int cur = 0; for(int i=historyIndex+1; i<historySize; i++) { urls[cur++] = history.get(i); } return urls; }
/** * Returns a list of 'forward' folders, most recently visited folder first. The returned array may be empty if there * currently isn't any 'forward' folder in history, but may never be null. * * @return a list of 'forward' folders, most recently visited folder first */
Returns a list of 'forward' folders, most recently visited folder first. The returned array may be empty if there currently isn't any 'forward' folder in history, but may never be null
getForwardFolders
{ "repo_name": "trol73/mucommander", "path": "src/main/com/mucommander/core/LocalLocationHistory.java", "license": "gpl-3.0", "size": 7278 }
[ "com.mucommander.commons.file.FileURL" ]
import com.mucommander.commons.file.FileURL;
import com.mucommander.commons.file.*;
[ "com.mucommander.commons" ]
com.mucommander.commons;
2,550,350
public static void main(String... args) throws SQLException { new Backup().runTool(args); }
static void function(String... args) throws SQLException { new Backup().runTool(args); }
/** * Options are case sensitive. Supported options are: * <table> * <tr><td>[-help] or [-?]</td> * <td>Print the list of options</td></tr> * <tr><td>[-file &lt;filename&gt;]</td> * <td>The target file name (default: backup.zip)</td></tr> * <tr><td>[-dir &lt;dir&gt;]</td> * <td>The source directory (default: .)</td></tr> * <tr><td>[-db &lt;database&gt;]</td> * <td>Source database; not required if there is only one</td></tr> * <tr><td>[-quiet]</td> * <td>Do not print progress information</td></tr> * </table> * @h2.resource * * @param args the command line arguments */
Options are case sensitive. Supported options are: [-help] or [-?] Print the list of options [-file &lt;filename&gt;] The target file name (default: backup.zip) [-dir &lt;dir&gt;] The source directory (default: .) [-db &lt;database&gt;] Source database; not required if there is only one [-quiet] Do not print progress information
main
{ "repo_name": "ferquies/2dam", "path": "AD/Tema 2/h2/src/main/org/h2/tools/Backup.java", "license": "gpl-3.0", "size": 6421 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,618,107
public String getTag() throws IOException;
String function() throws IOException;
/** * Get a unique tag for the template source. Generally a hash (MD5, SHA1, * etc) of the source text. * * @return Unique tag for the source text * @throws IOException */
Get a unique tag for the template source. Generally a hash (MD5, SHA1, etc) of the source text
getTag
{ "repo_name": "impossibl/stencil", "path": "engine/src/main/java/com/impossibl/stencil/api/TemplateSource.java", "license": "bsd-3-clause", "size": 926 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,028,322
public void setLaborNightlyOutService(LaborNightlyOutService laborNightlyOutService) { this.laborNightlyOutService = laborNightlyOutService; }
void function(LaborNightlyOutService laborNightlyOutService) { this.laborNightlyOutService = laborNightlyOutService; }
/** * Sets the laborNightlyOutService attribute value. * * @param laborNightlyOutService The laborNightlyOutService to set. */
Sets the laborNightlyOutService attribute value
setLaborNightlyOutService
{ "repo_name": "bhutchinson/kfs", "path": "kfs-ld/src/main/java/org/kuali/kfs/module/ld/batch/ClearLaborPendingStep.java", "license": "agpl-3.0", "size": 2055 }
[ "org.kuali.kfs.module.ld.batch.service.LaborNightlyOutService" ]
import org.kuali.kfs.module.ld.batch.service.LaborNightlyOutService;
import org.kuali.kfs.module.ld.batch.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,383,045
@Test public void testMedicationOutVOToEntity() { Assert.fail("Test 'MedicationDaoTransformTest.testMedicationOutVOToEntity' not implemented!"); }
void function() { Assert.fail(STR); }
/** * Test for method medicationOutVOToEntity * * @see org.phoenixctms.ctsms.domain.MedicationDao#medicationOutVOToEntity(org.phoenixctms.ctsms.vo.MedicationOutVO source, org.phoenixctms.ctsms.domain.Medication target, boolean copyIfNull) */
Test for method medicationOutVOToEntity
testMedicationOutVOToEntity
{ "repo_name": "phoenixctms/ctsms", "path": "core/src/test/java/org/phoenixctms/ctsms/domain/test/MedicationDaoTransformTest.java", "license": "lgpl-2.1", "size": 2061 }
[ "org.testng.Assert" ]
import org.testng.Assert;
import org.testng.*;
[ "org.testng" ]
org.testng;
324,476
Class<? extends Item> getItemType(String itemName);
Class<? extends Item> getItemType(String itemName);
/** * Determines whether the item is a NumberItem or a StringItem * * @param itemName * @return */
Determines whether the item is a NumberItem or a StringItem
getItemType
{ "repo_name": "paolodenti/openhab", "path": "bundles/binding/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/EKeyBindingProvider.java", "license": "epl-1.0", "size": 1221 }
[ "org.openhab.core.items.Item" ]
import org.openhab.core.items.Item;
import org.openhab.core.items.*;
[ "org.openhab.core" ]
org.openhab.core;
1,533,386
static String locateLogConfig(String confDir, String application) { String explicitConfigFile = System.getProperty("log4j.configuration"); if (explicitConfigFile != null) { return explicitConfigFile; } String[] configFiles = {String.format("%s/%s_logger.xml", confDir, application), String.format("%s/%s_logger.properties", confDir, application), String.format("%s/generic_logger.xml", confDir), String.format("%s/generic_logger.properties", confDir)}; String defaultConfigFile = configFiles[2]; // generic_logger.xml for (String f : configFiles) { if (new File(f).exists()) { return f; } } return defaultConfigFile; }
static String locateLogConfig(String confDir, String application) { String explicitConfigFile = System.getProperty(STR); if (explicitConfigFile != null) { return explicitConfigFile; } String[] configFiles = {String.format(STR, confDir, application), String.format(STR, confDir, application), String.format(STR, confDir), String.format(STR, confDir)}; String defaultConfigFile = configFiles[2]; for (String f : configFiles) { if (new File(f).exists()) { return f; } } return defaultConfigFile; }
/** * Finds the best log4j configuration file. A generic file is used only if an application-specific file is not available. An XML file is preferred over a * properties file, if possible. * * @param confDir * directory where configuration files should reside * @param application * application name for configuration file name * @return configuration file name */
Finds the best log4j configuration file. A generic file is used only if an application-specific file is not available. An XML file is preferred over a properties file, if possible
locateLogConfig
{ "repo_name": "dhutchis/accumulo", "path": "server/base/src/main/java/org/apache/accumulo/server/Accumulo.java", "license": "apache-2.0", "size": 14285 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,359,263
public byte[] getSignatureBytes() { if (signatureEncoding == null) { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); BCPGOutputStream bcOut = new BCPGOutputStream(bOut); for (int i = 0; i != signature.length; i++) { try { bcOut.writeObject(signature[i]); } catch (IOException e) { throw new RuntimeException("internal error: " + e); } } return bOut.toByteArray(); } else { return Arrays.clone(signatureEncoding); } }
byte[] function() { if (signatureEncoding == null) { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); BCPGOutputStream bcOut = new BCPGOutputStream(bOut); for (int i = 0; i != signature.length; i++) { try { bcOut.writeObject(signature[i]); } catch (IOException e) { throw new RuntimeException(STR + e); } } return bOut.toByteArray(); } else { return Arrays.clone(signatureEncoding); } }
/** * Return the byte encoding of the signature section. * @return uninterpreted signature bytes. */
Return the byte encoding of the signature section
getSignatureBytes
{ "repo_name": "GaloisInc/hacrypto", "path": "src/Java/BouncyCastle/BouncyCastle-1.50/pg/src/main/java/org/bouncycastle/bcpg/SignaturePacket.java", "license": "bsd-3-clause", "size": 15809 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "org.bouncycastle.util.Arrays" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import org.bouncycastle.util.Arrays;
import java.io.*; import org.bouncycastle.util.*;
[ "java.io", "org.bouncycastle.util" ]
java.io; org.bouncycastle.util;
249,313
List<Element> elements = elementRepository.findActiveElementsForPeriod(period); return ElementTransformer.transformToDtoList(elements); }
List<Element> elements = elementRepository.findActiveElementsForPeriod(period); return ElementTransformer.transformToDtoList(elements); }
/** * Finds The active Elements for that period and transforms them to DTOs. * * @param period The relevant period. * @return A list of {@link ElementDto} */
Finds The active Elements for that period and transforms them to DTOs
findElementDtos
{ "repo_name": "USEF-Foundation/ri.usef.energy", "path": "usef-build/usef-workflow/usef-agr/src/main/java/energy/usef/agr/service/business/AgrElementBusinessService.java", "license": "apache-2.0", "size": 1842 }
[ "energy.usef.agr.model.Element", "energy.usef.agr.transformer.ElementTransformer", "java.util.List" ]
import energy.usef.agr.model.Element; import energy.usef.agr.transformer.ElementTransformer; import java.util.List;
import energy.usef.agr.model.*; import energy.usef.agr.transformer.*; import java.util.*;
[ "energy.usef.agr", "java.util" ]
energy.usef.agr; java.util;
884,691
public void setClientPreferencesStore(IPreferencesStore clientPreferencesStore) { this.clientPreferencesStore = clientPreferencesStore; } /** * Delegates to the backend controller. * <p> * {@inheritDoc}
void function(IPreferencesStore clientPreferencesStore) { this.clientPreferencesStore = clientPreferencesStore; } /** * Delegates to the backend controller. * <p> * {@inheritDoc}
/** * Sets the clientPreferenceStore. * * @param clientPreferencesStore * the clientPreferenceStore to set. */
Sets the clientPreferenceStore
setClientPreferencesStore
{ "repo_name": "maximehamm/jspresso-ce", "path": "application/src/main/java/org/jspresso/framework/application/frontend/controller/AbstractFrontendController.java", "license": "lgpl-3.0", "size": 82212 }
[ "org.jspresso.framework.util.preferences.IPreferencesStore" ]
import org.jspresso.framework.util.preferences.IPreferencesStore;
import org.jspresso.framework.util.preferences.*;
[ "org.jspresso.framework" ]
org.jspresso.framework;
1,374,790
@Override IComplexNDArray rdiv(INDArray other);
IComplexNDArray rdiv(INDArray other);
/** * Reverse division * * @param other the matrix to divide from * @return */
Reverse division
rdiv
{ "repo_name": "wlin12/JNN", "path": "src/org/nd4j/linalg/api/complex/IComplexNDArray.java", "license": "apache-2.0", "size": 32141 }
[ "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
1,318,308
private void doInitialization() { File file = new File(DeploymentConfig.OutDirectory); if (!file.exists()) { file.mkdir(); } }
void function() { File file = new File(DeploymentConfig.OutDirectory); if (!file.exists()) { file.mkdir(); } }
/** * Do initialization. */
Do initialization
doInitialization
{ "repo_name": "wasiahmad/intent_aware_privacy_protection_in_pws", "path": "source_code/src/edu/virginia/cs/main/MultiThread.java", "license": "mit", "size": 8899 }
[ "edu.virginia.cs.config.DeploymentConfig", "java.io.File" ]
import edu.virginia.cs.config.DeploymentConfig; import java.io.File;
import edu.virginia.cs.config.*; import java.io.*;
[ "edu.virginia.cs", "java.io" ]
edu.virginia.cs; java.io;
39,284