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 Map.Entry getFirst() { // sentinel.next points to the "first" element of the sequence -- the head // of the list, which is exactly the entry we need to return. We must test // for an empty list though because we don't want to return the sentinel! return (isEmpty()) ? null : sentinel.next; }
Map.Entry function() { return (isEmpty()) ? null : sentinel.next; }
/** * Return the entry for the "oldest" mapping. That is, return the Map.Entry * for the key-value pair that was first put into the map when compared to * all the other pairings in the map. This behavior is equivalent to using * <code>entrySet().iterator().next()</code>, but this method provides an * optimized implementation. * * @return The first entry in the sequence, or <code>null</code> if the * map is empty. **/
Return the entry for the "oldest" mapping. That is, return the Map.Entry for the key-value pair that was first put into the map when compared to all the other pairings in the map. This behavior is equivalent to using <code>entrySet().iterator().next()</code>, but this method provides an optimized implementation
getFirst
{ "repo_name": "lewis-ing/bbossgroups-3.5", "path": "bboss-persistent/src-jdk5/com/frameworkset/commons/dbcp/datasources/SequencedHashMap.java", "license": "apache-2.0", "size": 32335 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,751,575
void deleteBlockIndexEntriesForChunk(MetadataTransaction txn, String segmentName, long startOffset, long endOffset) { this.garbageCollector.deleteBlockIndexEntriesForChunk(txn, segmentName, startOffset, endOffset); }
void deleteBlockIndexEntriesForChunk(MetadataTransaction txn, String segmentName, long startOffset, long endOffset) { this.garbageCollector.deleteBlockIndexEntriesForChunk(txn, segmentName, startOffset, endOffset); }
/** * Delete block index entries for given chunk. */
Delete block index entries for given chunk
deleteBlockIndexEntriesForChunk
{ "repo_name": "pravega/pravega", "path": "segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/chunklayer/ChunkedSegmentStorage.java", "license": "apache-2.0", "size": 52641 }
[ "io.pravega.segmentstore.storage.metadata.MetadataTransaction" ]
import io.pravega.segmentstore.storage.metadata.MetadataTransaction;
import io.pravega.segmentstore.storage.metadata.*;
[ "io.pravega.segmentstore" ]
io.pravega.segmentstore;
1,543,212
void setNotificationService(NotificationService notificationService);
void setNotificationService(NotificationService notificationService);
/** * Set the notification service for this acceptor to use. * * @param notificationService the notification service */
Set the notification service for this acceptor to use
setNotificationService
{ "repo_name": "jbertram/activemq-artemis-old", "path": "artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java", "license": "apache-2.0", "size": 2256 }
[ "org.apache.activemq.artemis.core.server.management.NotificationService" ]
import org.apache.activemq.artemis.core.server.management.NotificationService;
import org.apache.activemq.artemis.core.server.management.*;
[ "org.apache.activemq" ]
org.apache.activemq;
1,321,007
@Override public int getItemCount() { int result = 0; if (this.source != null) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnCount(); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowCount(); } } return result; }
int function() { int result = 0; if (this.source != null) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnCount(); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowCount(); } } return result; }
/** * Returns the number of items (values) in the collection. If the * underlying dataset is <code>null</code>, this method returns zero. * * @return The item count. */
Returns the number of items (values) in the collection. If the underlying dataset is <code>null</code>, this method returns zero
getItemCount
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/data/category/CategoryToPieDataset.java", "license": "lgpl-2.1", "size": 11193 }
[ "org.jfree.chart.util.TableOrder" ]
import org.jfree.chart.util.TableOrder;
import org.jfree.chart.util.*;
[ "org.jfree.chart" ]
org.jfree.chart;
598,013
public static Reader getUpdateReader(Reader pReader, String xsltScript, FreeMindMain frame) throws IOException { StringWriter writer = null; InputStream inputStream = null; final java.util.logging.Logger logger = frame.getLogger(Tools.class .getName()); logger.info("Updating the reader " + pReader + " to the current version."); boolean successful = false; String errorMessage = null; try { // try to convert map with xslt: URL updaterUrl = null; updaterUrl = frame.getResource(xsltScript); if (updaterUrl == null) { throw new IllegalArgumentException(xsltScript + " not found."); } inputStream = updaterUrl.openStream(); final Source xsltSource = new StreamSource(inputStream); // get output: writer = new StringWriter(); final Result result = new StreamResult(writer); String fileContents = getFile(pReader); if (fileContents.length() > 10) { logger.info("File start before UTF8 replacement: '" + fileContents.substring(0, 9) + "'"); } fileContents = HtmlTools.removeInvalidXmlCharacters(fileContents); if (fileContents.length() > 10) { logger.info("File start after UTF8 replacement: '" + fileContents.substring(0, 9) + "'"); } final StreamSource sr = new StreamSource(new StringReader( fileContents)); // Dimitry: to avoid a memory leak and properly release resources // after the XSLT transformation // everything should run in own thread. Only after the thread dies // the resources are released. class TransformerRunnable implements Runnable { private boolean successful = false; private String errorMessage;
static Reader function(Reader pReader, String xsltScript, FreeMindMain frame) throws IOException { StringWriter writer = null; InputStream inputStream = null; final java.util.logging.Logger logger = frame.getLogger(Tools.class .getName()); logger.info(STR + pReader + STR); boolean successful = false; String errorMessage = null; try { URL updaterUrl = null; updaterUrl = frame.getResource(xsltScript); if (updaterUrl == null) { throw new IllegalArgumentException(xsltScript + STR); } inputStream = updaterUrl.openStream(); final Source xsltSource = new StreamSource(inputStream); writer = new StringWriter(); final Result result = new StreamResult(writer); String fileContents = getFile(pReader); if (fileContents.length() > 10) { logger.info(STR + fileContents.substring(0, 9) + "'"); } fileContents = HtmlTools.removeInvalidXmlCharacters(fileContents); if (fileContents.length() > 10) { logger.info(STR + fileContents.substring(0, 9) + "'"); } final StreamSource sr = new StreamSource(new StringReader( fileContents)); class TransformerRunnable implements Runnable { private boolean successful = false; private String errorMessage;
/** * Creates a reader that pipes the input file through a XSLT-Script that * updates the version to the current. * * @throws IOException */
Creates a reader that pipes the input file through a XSLT-Script that updates the version to the current
getUpdateReader
{ "repo_name": "mibischo/freemind", "path": "freemind/tools/ReaderProvider.java", "license": "gpl-2.0", "size": 5601 }
[ "java.io.IOException", "java.io.InputStream", "java.io.Reader", "java.io.StringReader", "java.io.StringWriter", "javax.xml.transform.Result", "javax.xml.transform.Source", "javax.xml.transform.stream.StreamResult", "javax.xml.transform.stream.StreamSource" ]
import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource;
import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*;
[ "java.io", "javax.xml" ]
java.io; javax.xml;
484,729
public void testSerialization() throws Exception { DoubleAdder x = new DoubleAdder(); DoubleAdder y = serialClone(x); assertNotSame(x, y); x.add(-22.0); DoubleAdder z = serialClone(x); assertEquals(-22.0, x.sum()); assertEquals(0.0, y.sum()); assertEquals(-22.0, z.sum()); }
void function() throws Exception { DoubleAdder x = new DoubleAdder(); DoubleAdder y = serialClone(x); assertNotSame(x, y); x.add(-22.0); DoubleAdder z = serialClone(x); assertEquals(-22.0, x.sum()); assertEquals(0.0, y.sum()); assertEquals(-22.0, z.sum()); }
/** * a deserialized serialized adder holds same value */
a deserialized serialized adder holds same value
testSerialization
{ "repo_name": "debian-pkg-android-tools/android-platform-libcore", "path": "jsr166-tests/src/test/java/jsr166/DoubleAdderTest.java", "license": "gpl-2.0", "size": 4934 }
[ "java.util.concurrent.atomic.DoubleAdder" ]
import java.util.concurrent.atomic.DoubleAdder;
import java.util.concurrent.atomic.*;
[ "java.util" ]
java.util;
2,218,134
@Nullable default <T> T getCastedValue (@Nullable final KEYTYPE aKey) { return GenericReflection.uncheckedCast (getValue (aKey)); }
default <T> T getCastedValue (@Nullable final KEYTYPE aKey) { return GenericReflection.uncheckedCast (getValue (aKey)); }
/** * Get the contained value casted to the return type. * * @param aKey * The key to be accessed. May be <code>null</code>. * @return The object value casted to the passed class. May be * <code>null</code> if the contained value is <code>null</code>. * @throws ClassCastException * in case the value types are not convertible * @param <T> * Destination type */
Get the contained value casted to the return type
getCastedValue
{ "repo_name": "phax/ph-commons", "path": "ph-commons/src/main/java/com/helger/commons/traits/IGetterByKeyTrait.java", "license": "apache-2.0", "size": 30218 }
[ "com.helger.commons.lang.GenericReflection", "javax.annotation.Nullable" ]
import com.helger.commons.lang.GenericReflection; import javax.annotation.Nullable;
import com.helger.commons.lang.*; import javax.annotation.*;
[ "com.helger.commons", "javax.annotation" ]
com.helger.commons; javax.annotation;
396,055
@Override protected boolean checkEntryNotValid(RegionEntry mapEntry) { return (super.checkEntryNotValid(mapEntry) || mapEntry.getKey() instanceof ThreadIdentifier); }
boolean function(RegionEntry mapEntry) { return (super.checkEntryNotValid(mapEntry) mapEntry.getKey() instanceof ThreadIdentifier); }
/** * This method is over-ridden since we do not want GII of ThreadIdentifier * objects to happen */
This method is over-ridden since we do not want GII of ThreadIdentifier objects to happen
checkEntryNotValid
{ "repo_name": "ysung-pivotal/incubator-geode", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/HARegion.java", "license": "apache-2.0", "size": 19227 }
[ "com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier" ]
import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier;
import com.gemstone.gemfire.internal.cache.ha.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
2,547,396
@Override public void checkForWinningCondition() { for (Player p : players) { if ( // Check rows (cfp(0, 0, p) && cfp(0, 1, p) && cfp(0, 2, p)) || (cfp(1, 0, p) && cfp(1, 1, p) && cfp(1, 2, p)) || (cfp(2, 0, p) && cfp(2, 1, p) && cfp(2, 2, p)) || // Check columns (cfp(0, 0, p) && cfp(1, 0, p) && cfp(2, 0, p)) || (cfp(0, 1, p) && cfp(1, 1, p) && cfp(2, 1, p)) || (cfp(0, 2, p) && cfp(1, 2, p) && cfp(2, 2, p)) || // Check diagonals (cfp(0, 0, p) && cfp(1, 1, p) && cfp(2, 2, p)) || (cfp(2, 0, p) && cfp(1, 1, p) && cfp(0, 2, p))) { GameEndsMessage gameEndsMessage = new GameEndsMessage(p.getName() + " won"); sendMessageToAllPlayers(gameEndsMessage); return; } } boolean isDraw = calculateDraw(); if (isDraw) { GameEndsMessage gameEndsMessage = new GameEndsMessage("Draw!"); sendMessageToAllPlayers(gameEndsMessage); } }
void function() { for (Player p : players) { if ( (cfp(0, 0, p) && cfp(0, 1, p) && cfp(0, 2, p)) (cfp(1, 0, p) && cfp(1, 1, p) && cfp(1, 2, p)) (cfp(2, 0, p) && cfp(2, 1, p) && cfp(2, 2, p)) (cfp(0, 0, p) && cfp(1, 0, p) && cfp(2, 0, p)) (cfp(0, 1, p) && cfp(1, 1, p) && cfp(2, 1, p)) (cfp(0, 2, p) && cfp(1, 2, p) && cfp(2, 2, p)) (cfp(0, 0, p) && cfp(1, 1, p) && cfp(2, 2, p)) (cfp(2, 0, p) && cfp(1, 1, p) && cfp(0, 2, p))) { GameEndsMessage gameEndsMessage = new GameEndsMessage(p.getName() + STR); sendMessageToAllPlayers(gameEndsMessage); return; } } boolean isDraw = calculateDraw(); if (isDraw) { GameEndsMessage gameEndsMessage = new GameEndsMessage("Draw!"); sendMessageToAllPlayers(gameEndsMessage); } }
/** * Checks whether one of the player meets the winning conditions: A full * row, a full column or three diagonal fields. */
Checks whether one of the player meets the winning conditions: A full row, a full column or three diagonal fields
checkForWinningCondition
{ "repo_name": "brad-richards/AIGS", "path": "TicTacToe/src/org/fhnw/aigs/TicTacToe/server/GameLogic.java", "license": "gpl-3.0", "size": 10420 }
[ "org.fhnw.aigs.commons.Player", "org.fhnw.aigs.commons.communication.GameEndsMessage" ]
import org.fhnw.aigs.commons.Player; import org.fhnw.aigs.commons.communication.GameEndsMessage;
import org.fhnw.aigs.commons.*; import org.fhnw.aigs.commons.communication.*;
[ "org.fhnw.aigs" ]
org.fhnw.aigs;
642,174
public void updateMembers(IEntityGroup eg) throws GroupsException { Connection conn = null; EntityGroupImpl egi = (EntityGroupImpl) eg; if ( egi.isDirty() ) try { conn = RDBMServices.getConnection(); setAutoCommit(conn, false); try { primUpdateMembers(egi, conn); commit(conn); } catch ( SQLException sqle ) { rollback(conn); throw new GroupsException("Problem updating memberships for " + egi, sqle); } } catch ( SQLException sqlex ) { throw new GroupsException(sqlex); } finally { if (conn != null) { try { setAutoCommit(conn, true); } catch (SQLException sqle) { throw new GroupsException(sqle); } finally { RDBMServices.releaseConnection(conn); } } } }
void function(IEntityGroup eg) throws GroupsException { Connection conn = null; EntityGroupImpl egi = (EntityGroupImpl) eg; if ( egi.isDirty() ) try { conn = RDBMServices.getConnection(); setAutoCommit(conn, false); try { primUpdateMembers(egi, conn); commit(conn); } catch ( SQLException sqle ) { rollback(conn); throw new GroupsException(STR + egi, sqle); } } catch ( SQLException sqlex ) { throw new GroupsException(sqlex); } finally { if (conn != null) { try { setAutoCommit(conn, true); } catch (SQLException sqle) { throw new GroupsException(sqle); } finally { RDBMServices.releaseConnection(conn); } } } }
/** * Insert and delete group membership rows inside a transaction. * @param eg org.jasig.portal.groups.IEntityGroup */
Insert and delete group membership rows inside a transaction
updateMembers
{ "repo_name": "kole9273/uPortal", "path": "uportal-war/src/main/java/org/jasig/portal/groups/RDBMEntityGroupStore.java", "license": "apache-2.0", "size": 60440 }
[ "java.sql.Connection", "java.sql.SQLException", "org.jasig.portal.RDBMServices" ]
import java.sql.Connection; import java.sql.SQLException; import org.jasig.portal.RDBMServices;
import java.sql.*; import org.jasig.portal.*;
[ "java.sql", "org.jasig.portal" ]
java.sql; org.jasig.portal;
2,535,640
public static String diffLines(List<String> lines1, List<String> lines2) { final Diff<String> differencer = new Diff<>(lines1, lines2); final List<Difference> differences = differencer.execute(); StringWriter sw = new StringWriter(); int offset = 0; for (Difference d : differences) { final int as = d.getAddedStart() + 1; final int ae = d.getAddedEnd() + 1; final int ds = d.getDeletedStart() + 1; final int de = d.getDeletedEnd() + 1; if (ae == 0) { if (de == 0) { // no change } else { // a deletion: "<ds>,<de>d<as>" sw.append(String.valueOf(ds)); if (de > ds) { sw.append(",").append(String.valueOf(de)); } sw.append("d").append(String.valueOf(as - 1)).append('\n'); for (int i = ds - 1; i < de; ++i) { sw.append("< ").append(lines1.get(i)).append('\n'); } } } else { if (de == 0) { // an addition: "<ds>a<as,ae>" sw.append(String.valueOf(ds - 1)).append("a").append( String.valueOf(as)); if (ae > as) { sw.append(",").append(String.valueOf(ae)); } sw.append('\n'); for (int i = as - 1; i < ae; ++i) { sw.append("> ").append(lines2.get(i)).append('\n'); } } else { // a change: "<ds>,<de>c<as>,<ae> sw.append(String.valueOf(ds)); if (de > ds) { sw.append(",").append(String.valueOf(de)); } sw.append("c").append(String.valueOf(as)); if (ae > as) { sw.append(",").append(String.valueOf(ae)); } sw.append('\n'); for (int i = ds - 1; i < de; ++i) { sw.append("< ").append(lines1.get(i)).append('\n'); } sw.append("---\n"); for (int i = as - 1; i < ae; ++i) { sw.append("> ").append(lines2.get(i)).append('\n'); } offset = offset + (ae - as) - (de - ds); } } } return sw.toString(); }
static String function(List<String> lines1, List<String> lines2) { final Diff<String> differencer = new Diff<>(lines1, lines2); final List<Difference> differences = differencer.execute(); StringWriter sw = new StringWriter(); int offset = 0; for (Difference d : differences) { final int as = d.getAddedStart() + 1; final int ae = d.getAddedEnd() + 1; final int ds = d.getDeletedStart() + 1; final int de = d.getDeletedEnd() + 1; if (ae == 0) { if (de == 0) { } else { sw.append(String.valueOf(ds)); if (de > ds) { sw.append(",").append(String.valueOf(de)); } sw.append("d").append(String.valueOf(as - 1)).append('\n'); for (int i = ds - 1; i < de; ++i) { sw.append(STR).append(lines1.get(i)).append('\n'); } } } else { if (de == 0) { sw.append(String.valueOf(ds - 1)).append("a").append( String.valueOf(as)); if (ae > as) { sw.append(",").append(String.valueOf(ae)); } sw.append('\n'); for (int i = as - 1; i < ae; ++i) { sw.append(STR).append(lines2.get(i)).append('\n'); } } else { sw.append(String.valueOf(ds)); if (de > ds) { sw.append(",").append(String.valueOf(de)); } sw.append("c").append(String.valueOf(as)); if (ae > as) { sw.append(",").append(String.valueOf(ae)); } sw.append('\n'); for (int i = ds - 1; i < de; ++i) { sw.append(STR).append(lines1.get(i)).append('\n'); } sw.append("---\n"); for (int i = as - 1; i < ae; ++i) { sw.append(STR).append(lines2.get(i)).append('\n'); } offset = offset + (ae - as) - (de - ds); } } } return sw.toString(); }
/** * Returns a string containing the difference between the two sets of lines. */
Returns a string containing the difference between the two sets of lines
diffLines
{ "repo_name": "apache/calcite", "path": "testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java", "license": "apache-2.0", "size": 16244 }
[ "java.io.StringWriter", "java.util.List", "org.incava.diff.Diff", "org.incava.diff.Difference" ]
import java.io.StringWriter; import java.util.List; import org.incava.diff.Diff; import org.incava.diff.Difference;
import java.io.*; import java.util.*; import org.incava.diff.*;
[ "java.io", "java.util", "org.incava.diff" ]
java.io; java.util; org.incava.diff;
1,219,874
public void mergeNode(HashSet<OctNode> _tempList) { HashSet<OctNode> _toAdd = new HashSet<OctNode>(); HashSet<OctNode> _toRemove = new HashSet<OctNode>(); for (OctNode temp : _tempList) { if (nodeList.contains(temp)) { _toRemove.add(temp); _toRemove.addAll(temp.getSiblings()); _toAdd.add(temp.getParent(1)); } } nodeList.removeAll(_toRemove); nodeList.addAll(_toAdd); } // ************************************************************************************* // ALGORITHMS // *************************************************************************************
void function(HashSet<OctNode> _tempList) { HashSet<OctNode> _toAdd = new HashSet<OctNode>(); HashSet<OctNode> _toRemove = new HashSet<OctNode>(); for (OctNode temp : _tempList) { if (nodeList.contains(temp)) { _toRemove.add(temp); _toRemove.addAll(temp.getSiblings()); _toAdd.add(temp.getParent(1)); } } nodeList.removeAll(_toRemove); nodeList.addAll(_toAdd); }
/** * Replaces list of nodes by their parent. Removes the siblings that are * also in the parent, but not smaller nodes! Can create nested nodes! */
Replaces list of nodes by their parent. Removes the siblings that are also in the parent, but not smaller nodes! Can create nested nodes
mergeNode
{ "repo_name": "thwegene/OCT", "path": "src/oct/octree/OctOctree.java", "license": "gpl-2.0", "size": 34059 }
[ "java.util.HashSet" ]
import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
21,142
public void stop(BundleContext bc) throws Exception { context = null; logger.debug("Z-Wave binding has been stopped."); }
void function(BundleContext bc) throws Exception { context = null; logger.debug(STR); }
/** * Called whenever the OSGi framework stops our bundle * @param bc the bundle's execution context within the framework */
Called whenever the OSGi framework stops our bundle
stop
{ "repo_name": "revenz/openhab", "path": "bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/ZWaveActivator.java", "license": "epl-1.0", "size": 1689 }
[ "org.osgi.framework.BundleContext" ]
import org.osgi.framework.BundleContext;
import org.osgi.framework.*;
[ "org.osgi.framework" ]
org.osgi.framework;
2,593,181
public static OID getPriv(String privProtocol) { switch (privProtocol) { case "DES": return PrivDES.ID; case "3DES": return Priv3DES.ID; case "AES128": return PrivAES128.ID; case "AES192": return PrivAES192.ID; case "AES256": return PrivAES256.ID; default: return null; } }
static OID function(String privProtocol) { switch (privProtocol) { case "DES": return PrivDES.ID; case "3DES": return Priv3DES.ID; case STR: return PrivAES128.ID; case STR: return PrivAES192.ID; case STR: return PrivAES256.ID; default: return null; } }
/** * Method to return the private protocol given the property * @param privProtocol property * @return protocol */
Method to return the private protocol given the property
getPriv
{ "repo_name": "WilliamNouet/nifi", "path": "nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/main/java/org/apache/nifi/snmp/processors/SNMPUtils.java", "license": "apache-2.0", "size": 10665 }
[ "org.snmp4j.security.Priv3DES", "org.snmp4j.security.PrivAES128", "org.snmp4j.security.PrivAES192", "org.snmp4j.security.PrivAES256", "org.snmp4j.security.PrivDES" ]
import org.snmp4j.security.Priv3DES; import org.snmp4j.security.PrivAES128; import org.snmp4j.security.PrivAES192; import org.snmp4j.security.PrivAES256; import org.snmp4j.security.PrivDES;
import org.snmp4j.security.*;
[ "org.snmp4j.security" ]
org.snmp4j.security;
387,922
public static void calset(Calendar cal, int field, int value) { int old = cal.get(field); int d = value - old; cal.roll(field, d); }
static void function(Calendar cal, int field, int value) { int old = cal.get(field); int d = value - old; cal.roll(field, d); }
/** * A slightly more sane wrapper for Calendar.set() * * Beware of Calendar.set! It doesn't properly work, as other fields may interfere, * e.g. you set the month, but the week-of-year stays wrong, and - madness ensues. * * Calendar.set() can be used if clear() is called first * * @param cal * @param field * @param value */
A slightly more sane wrapper for Calendar.set() Beware of Calendar.set! It doesn't properly work, as other fields may interfere, e.g. you set the month, but the week-of-year stays wrong, and - madness ensues. Calendar.set() can be used if clear() is called first
calset
{ "repo_name": "sodash/open-code", "path": "winterwell.utils/src/com/winterwell/utils/time/TimeUtils.java", "license": "mit", "size": 21909 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
1,848,579
private static int getDiskId(VolumeId hdfsVolumeId) { // Initialize the diskId as -1 to indicate it is unknown int diskId = -1; if (hdfsVolumeId != null) { // TODO: this is a hack and we'll have to address this by getting the // public API. Also, we need to be very mindful of this when we change // the version of HDFS. String volumeIdString = hdfsVolumeId.toString(); // This is the hacky part. The toString is currently the underlying id // encoded as hex. byte[] volumeIdBytes = StringUtils.hexStringToByte(volumeIdString); if (volumeIdBytes != null && volumeIdBytes.length == 4) { diskId = Bytes.toInt(volumeIdBytes); } else if (!hasLoggedDiskIdFormatWarning_) { LOG.warn("wrong disk id format: " + volumeIdString); hasLoggedDiskIdFormatWarning_ = true; } } return diskId; } public boolean spansMultipleFileSystems() { return multipleFileSystems_; }
static int function(VolumeId hdfsVolumeId) { int diskId = -1; if (hdfsVolumeId != null) { String volumeIdString = hdfsVolumeId.toString(); byte[] volumeIdBytes = StringUtils.hexStringToByte(volumeIdString); if (volumeIdBytes != null && volumeIdBytes.length == 4) { diskId = Bytes.toInt(volumeIdBytes); } else if (!hasLoggedDiskIdFormatWarning_) { LOG.warn(STR + volumeIdString); hasLoggedDiskIdFormatWarning_ = true; } } return diskId; } public boolean spansMultipleFileSystems() { return multipleFileSystems_; }
/** * Returns a disk id (0-based) index from the Hdfs VolumeId object. * There is currently no public API to get at the volume id. We'll have to get it * by accessing the internals. */
Returns a disk id (0-based) index from the Hdfs VolumeId object. There is currently no public API to get at the volume id. We'll have to get it by accessing the internals
getDiskId
{ "repo_name": "kapilrastogi/Impala", "path": "fe/src/main/java/com/cloudera/impala/catalog/HdfsTable.java", "license": "apache-2.0", "size": 81543 }
[ "org.apache.hadoop.fs.VolumeId", "org.apache.hadoop.hbase.util.Bytes", "org.apache.hadoop.util.StringUtils" ]
import org.apache.hadoop.fs.VolumeId; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.util.*; import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,732,772
public static Response save(Gasto obj) { try { GastoFacade facade = (GastoFacade) ServiceLocator.getInstance().getBean(Constantes.GASTO_FACADE); facade.save(obj); return Response.status(Status.CREATED).build(); } catch (Exception e) { LOGGER.error("Error al guardar un ingreso", e); return Response.status(Status.INTERNAL_SERVER_ERROR).build(); } }
static Response function(Gasto obj) { try { GastoFacade facade = (GastoFacade) ServiceLocator.getInstance().getBean(Constantes.GASTO_FACADE); facade.save(obj); return Response.status(Status.CREATED).build(); } catch (Exception e) { LOGGER.error(STR, e); return Response.status(Status.INTERNAL_SERVER_ERROR).build(); } }
/** * Guarda un ingreso * @param obj * @return */
Guarda un ingreso
save
{ "repo_name": "dmaldonadol/adm-ceppi", "path": "ws/ceppi-web/src/main/java/cl/ml/ceppi/web/logic/GastosLogic.java", "license": "mit", "size": 2318 }
[ "cl.ml.ceppi.core.facade.GastoFacade", "cl.ml.ceppi.core.model.gasto.Gasto", "cl.ml.ceppi.web.locator.ServiceLocator", "cl.ml.ceppi.web.util.Constantes", "javax.ws.rs.core.Response" ]
import cl.ml.ceppi.core.facade.GastoFacade; import cl.ml.ceppi.core.model.gasto.Gasto; import cl.ml.ceppi.web.locator.ServiceLocator; import cl.ml.ceppi.web.util.Constantes; import javax.ws.rs.core.Response;
import cl.ml.ceppi.core.facade.*; import cl.ml.ceppi.core.model.gasto.*; import cl.ml.ceppi.web.locator.*; import cl.ml.ceppi.web.util.*; import javax.ws.rs.core.*;
[ "cl.ml.ceppi", "javax.ws" ]
cl.ml.ceppi; javax.ws;
2,465,797
public void generateFIs() { Map curr, prev; Iterator<Row> it; Row row; boolean verbose = Global.getVerbosity().get(C.V_FUNCTION); for (int i = this.maxIndex; i > 1; --i) { if (verbose) System.err.println("Start: generating FIs from FCIs of size "+i); // curr = (Map) this.itemsetV.get(i); prev = (Map) this.itemsetV.get(i-1); for (it = curr.values().iterator(); it.hasNext(); ) { row = it.next(); populateFIs(row.getItemset(), row.getSupp(), prev); } // //if (verbose) System.err.println("End: generating FIs from FCIs of size "+i); } }
void function() { Map curr, prev; Iterator<Row> it; Row row; boolean verbose = Global.getVerbosity().get(C.V_FUNCTION); for (int i = this.maxIndex; i > 1; --i) { if (verbose) System.err.println(STR+i); prev = (Map) this.itemsetV.get(i-1); for (it = curr.values().iterator(); it.hasNext(); ) { row = it.next(); populateFIs(row.getItemset(), row.getSupp(), prev); } } }
/** * Generates all frequent itemsets from closed frequent itemsets. * FCI => FI. */
Generates all frequent itemsets from closed frequent itemsets. FCI => FI
generateFIs
{ "repo_name": "jabbalaci/Talky-G", "path": "src/main/java/fr/loria/coronsys/coron/datastructure/Result2.java", "license": "gpl-3.0", "size": 5770 }
[ "fr.loria.coronsys.coron.helper.Global", "java.util.Iterator", "java.util.Map" ]
import fr.loria.coronsys.coron.helper.Global; import java.util.Iterator; import java.util.Map;
import fr.loria.coronsys.coron.helper.*; import java.util.*;
[ "fr.loria.coronsys", "java.util" ]
fr.loria.coronsys; java.util;
2,563,601
public Map<String, Serializable> getPostFields() throws HelloSignException { Map<String, Serializable> fields = super.getPostFields(); try { // Mandatory fields List<String> templateIds = getTemplateIds(); for (int i = 0; i < templateIds.size(); i++) { fields.put(TEMPLATE_IDS + "[" + i + "]", templateIds.get(i)); } Map<String, Signer> signerz = getSigners(); for (Entry<String, Signer> entry : signerz.entrySet()) { var role = entry.getKey(); Signer s = signerz.get(role); fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_EMAIL + "]", s.getEmail()); fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_NAME + "]", s.getNameOrRole()); } // Optional fields if (hasTitle()) { fields.put(REQUEST_TITLE, getTitle()); } if (hasSubject()) { fields.put(REQUEST_SUBJECT, getSubject()); } if (hasMessage()) { fields.put(REQUEST_MESSAGE, getMessage()); } if (hasRedirectUrl()) { fields.put(REQUEST_REDIRECT_URL, getRedirectUrl()); } Map<String, String> ccz = getCCs(); for (Entry<String, String> entry : ccz.entrySet()) { var role = entry.getKey(); fields.put(TEMPLATE_CCS + "[" + role + "][" + TEMPLATE_CCS_EMAIL + "]", ccz.get(role)); } if (isTestMode()) { fields.put(REQUEST_TEST_MODE, true); } } catch (Exception ex) { throw new HelloSignException( "Could not extract form fields from TemplateSignatureRequest.", ex); } return fields; }
Map<String, Serializable> function() throws HelloSignException { Map<String, Serializable> fields = super.getPostFields(); try { List<String> templateIds = getTemplateIds(); for (int i = 0; i < templateIds.size(); i++) { fields.put(TEMPLATE_IDS + "[" + i + "]", templateIds.get(i)); } Map<String, Signer> signerz = getSigners(); for (Entry<String, Signer> entry : signerz.entrySet()) { var role = entry.getKey(); Signer s = signerz.get(role); fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_EMAIL + "]", s.getEmail()); fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_NAME + "]", s.getNameOrRole()); } if (hasTitle()) { fields.put(REQUEST_TITLE, getTitle()); } if (hasSubject()) { fields.put(REQUEST_SUBJECT, getSubject()); } if (hasMessage()) { fields.put(REQUEST_MESSAGE, getMessage()); } if (hasRedirectUrl()) { fields.put(REQUEST_REDIRECT_URL, getRedirectUrl()); } Map<String, String> ccz = getCCs(); for (Entry<String, String> entry : ccz.entrySet()) { var role = entry.getKey(); fields.put(TEMPLATE_CCS + "[" + role + "][" + TEMPLATE_CCS_EMAIL + "]", ccz.get(role)); } if (isTestMode()) { fields.put(REQUEST_TEST_MODE, true); } } catch (Exception ex) { throw new HelloSignException( STR, ex); } return fields; }
/** * Internal method used to retrieve the necessary POST fields to submit the signature request. * * @return Map * @throws HelloSignException thrown if there is a problem parsing the POST fields. */
Internal method used to retrieve the necessary POST fields to submit the signature request
getPostFields
{ "repo_name": "HelloFax/hellosign-java-sdk", "path": "src/main/java/com/hellosign/sdk/resource/TemplateSignatureRequest.java", "license": "mit", "size": 10111 }
[ "com.hellosign.sdk.HelloSignException", "com.hellosign.sdk.resource.support.Signer", "java.io.Serializable", "java.util.List", "java.util.Map" ]
import com.hellosign.sdk.HelloSignException; import com.hellosign.sdk.resource.support.Signer; import java.io.Serializable; import java.util.List; import java.util.Map;
import com.hellosign.sdk.*; import com.hellosign.sdk.resource.support.*; import java.io.*; import java.util.*;
[ "com.hellosign.sdk", "java.io", "java.util" ]
com.hellosign.sdk; java.io; java.util;
932,012
@Deprecated public static <R extends Readable & Closeable> String toString( InputSupplier<R> supplier) throws IOException { return asCharSource(supplier).read(); }
static <R extends Readable & Closeable> String function( InputSupplier<R> supplier) throws IOException { return asCharSource(supplier).read(); }
/** * Returns the characters from a {@link Readable} & {@link Closeable} object * supplied by a factory as a {@link String}. * * @param supplier the factory to read from * @return a string containing all the characters * @throws IOException if an I/O error occurs * @deprecated Use {@link CharSource#read()} instead. This method is * scheduled for removal in Guava 18.0. */
Returns the characters from a <code>Readable</code> & <code>Closeable</code> object supplied by a factory as a <code>String</code>
toString
{ "repo_name": "maxvetrenko/guava-libraries-17-0", "path": "guava/src/com/google/common/io/CharStreams.java", "license": "apache-2.0", "size": 19794 }
[ "java.io.Closeable", "java.io.IOException" ]
import java.io.Closeable; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,097,254
public void setComposite(Composite comp) { this.composite = comp; if (comp instanceof AlphaComposite) { AlphaComposite acomp = (AlphaComposite) comp; int alpha = (int) (acomp.getAlpha() * 0xFF); this.gc.setAlpha(alpha); } }
void function(Composite comp) { this.composite = comp; if (comp instanceof AlphaComposite) { AlphaComposite acomp = (AlphaComposite) comp; int alpha = (int) (acomp.getAlpha() * 0xFF); this.gc.setAlpha(alpha); } }
/** * Sets the current composite. This implementation currently supports * only the {@link AlphaComposite} class. * * @param comp the composite. */
Sets the current composite. This implementation currently supports only the <code>AlphaComposite</code> class
setComposite
{ "repo_name": "int32at/sweaty", "path": "src/src/at/int32/sweaty/ui/utils/SWTGraphics2D.java", "license": "mit", "size": 43576 }
[ "java.awt.AlphaComposite", "java.awt.Composite" ]
import java.awt.AlphaComposite; import java.awt.Composite;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,219,559
public IndexScanOperation getIndexScanOperation(Index storeIndex, Table storeTable) { assertActive(); try { IndexScanOperation result = clusterTransaction.getIndexScanOperation(storeIndex, storeTable); return result; } catch (ClusterJException ex) { throw new ClusterJException( local.message("ERR_Index_Scan", storeTable.getName(), storeIndex.getName()), ex); } }
IndexScanOperation function(Index storeIndex, Table storeTable) { assertActive(); try { IndexScanOperation result = clusterTransaction.getIndexScanOperation(storeIndex, storeTable); return result; } catch (ClusterJException ex) { throw new ClusterJException( local.message(STR, storeTable.getName(), storeIndex.getName()), ex); } }
/** Create an index scan operation for an index and table. * * @param storeIndex the index * @param storeTable the table * @return the index scan operation */
Create an index scan operation for an index and table
getIndexScanOperation
{ "repo_name": "gunnarku/mysql-8.0", "path": "storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java", "license": "gpl-2.0", "size": 60102 }
[ "com.mysql.clusterj.ClusterJException", "com.mysql.clusterj.core.store.Index", "com.mysql.clusterj.core.store.IndexScanOperation", "com.mysql.clusterj.core.store.Table" ]
import com.mysql.clusterj.ClusterJException; import com.mysql.clusterj.core.store.Index; import com.mysql.clusterj.core.store.IndexScanOperation; import com.mysql.clusterj.core.store.Table;
import com.mysql.clusterj.*; import com.mysql.clusterj.core.store.*;
[ "com.mysql.clusterj" ]
com.mysql.clusterj;
1,230,836
public Iterable<ClassificationModel> getClassificationByName(FileModel model, String classificationName) { GremlinPipeline<Vertex, Vertex> pipeline = new GremlinPipeline<>(model.asVertex()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.CONTAINS, ClassificationModel.TYPE); pipeline.has(ClassificationModel.CLASSIFICATION, classificationName); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline, ClassificationModel.class); }
Iterable<ClassificationModel> function(FileModel model, String classificationName) { GremlinPipeline<Vertex, Vertex> pipeline = new GremlinPipeline<>(model.asVertex()); pipeline.in(ClassificationModel.FILE_MODEL); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.CONTAINS, ClassificationModel.TYPE); pipeline.has(ClassificationModel.CLASSIFICATION, classificationName); return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline, ClassificationModel.class); }
/** * Return all {@link ClassificationModel} instances that are attached to the given {@link FileModel} instance with a specific classification name. */
Return all <code>ClassificationModel</code> instances that are attached to the given <code>FileModel</code> instance with a specific classification name
getClassificationByName
{ "repo_name": "OndraZizka/windup", "path": "reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java", "license": "epl-1.0", "size": 14514 }
[ "com.thinkaurelius.titan.core.attribute.Text", "com.tinkerpop.blueprints.Vertex", "com.tinkerpop.frames.structures.FramedVertexIterable", "com.tinkerpop.gremlin.java.GremlinPipeline", "org.jboss.windup.graph.model.WindupVertexFrame", "org.jboss.windup.graph.model.resource.FileModel", "org.jboss.windup.reporting.model.ClassificationModel" ]
import com.thinkaurelius.titan.core.attribute.Text; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.frames.structures.FramedVertexIterable; import com.tinkerpop.gremlin.java.GremlinPipeline; import org.jboss.windup.graph.model.WindupVertexFrame; import org.jboss.windup.graph.model.resource.FileModel; import org.jboss.windup.reporting.model.ClassificationModel;
import com.thinkaurelius.titan.core.attribute.*; import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.structures.*; import com.tinkerpop.gremlin.java.*; import org.jboss.windup.graph.model.*; import org.jboss.windup.graph.model.resource.*; import org.jboss.windup.reporting.model.*;
[ "com.thinkaurelius.titan", "com.tinkerpop.blueprints", "com.tinkerpop.frames", "com.tinkerpop.gremlin", "org.jboss.windup" ]
com.thinkaurelius.titan; com.tinkerpop.blueprints; com.tinkerpop.frames; com.tinkerpop.gremlin; org.jboss.windup;
2,129,229
public DataNode setValueScalar(Double value);
DataNode function(Double value);
/** * nominal setpoint or average value * - need [n] as may be a vector * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_ANY * <b>Dimensions:</b> 1: n; * </p> * * @param value the value */
nominal setpoint or average value - need [n] as may be a vector Type: NX_FLOAT Units: NX_ANY Dimensions: 1: n;
setValueScalar
{ "repo_name": "xen-0/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXsensor.java", "license": "epl-1.0", "size": 17164 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
804,475
public static Object getOutputPath(final Class<?> clazz, final Context ctx, final Scriptable thisObj, final Object[] args) { validateClass(clazz, ctx, thisObj); final Object arg0 = args.length >= 1 ? args[0] : Undefined.instance; if (args.length < 1) { throw Utils.makeError(ctx, thisObj, LembosMessages.ONE_ARG_EXPECTED); } else if (!JavaScriptUtils.isDefined(arg0)) { throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_REQUIRED); } else if (!(arg0 instanceof JobWrap)) { throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_MUST_BE_JOB); } Object outputPath; try { outputPath = ReflectionUtils.invokeStatic(clazz, "getOutputPath", new Class<?>[] { JobContext.class }, new Object[] { ((JobWrap)arg0).getJob() }); } catch (Exception e) { e.printStackTrace(); throw Utils.makeError(ctx, thisObj, e.getMessage()); } return outputPath == null ? Undefined.instance : outputPath.toString(); }
static Object function(final Class<?> clazz, final Context ctx, final Scriptable thisObj, final Object[] args) { validateClass(clazz, ctx, thisObj); final Object arg0 = args.length >= 1 ? args[0] : Undefined.instance; if (args.length < 1) { throw Utils.makeError(ctx, thisObj, LembosMessages.ONE_ARG_EXPECTED); } else if (!JavaScriptUtils.isDefined(arg0)) { throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_REQUIRED); } else if (!(arg0 instanceof JobWrap)) { throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_MUST_BE_JOB); } Object outputPath; try { outputPath = ReflectionUtils.invokeStatic(clazz, STR, new Class<?>[] { JobContext.class }, new Object[] { ((JobWrap)arg0).getJob() }); } catch (Exception e) { e.printStackTrace(); throw Utils.makeError(ctx, thisObj, e.getMessage()); } return outputPath == null ? Undefined.instance : outputPath.toString(); }
/** * Java wrapper for {@link FileOutputFormat#getOutputPath(JobContext)}. * * @param clazz the class to invoke the method of * @param ctx the JavaScript context * @param thisObj the 'this' object * @param args the function arguments * * @return the output path */
Java wrapper for <code>FileOutputFormat#getOutputPath(JobContext)</code>
getOutputPath
{ "repo_name": "apigee/lembos", "path": "src/main/java/io/apigee/lembos/node/types/FileOutputFormatHelper.java", "license": "apache-2.0", "size": 17655 }
[ "io.apigee.lembos.mapreduce.LembosMessages", "io.apigee.lembos.utils.JavaScriptUtils", "io.apigee.lembos.utils.ReflectionUtils", "io.apigee.trireme.core.Utils", "org.apache.hadoop.mapreduce.JobContext", "org.mozilla.javascript.Context", "org.mozilla.javascript.Scriptable", "org.mozilla.javascript.Undefined" ]
import io.apigee.lembos.mapreduce.LembosMessages; import io.apigee.lembos.utils.JavaScriptUtils; import io.apigee.lembos.utils.ReflectionUtils; import io.apigee.trireme.core.Utils; import org.apache.hadoop.mapreduce.JobContext; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.Undefined;
import io.apigee.lembos.mapreduce.*; import io.apigee.lembos.utils.*; import io.apigee.trireme.core.*; import org.apache.hadoop.mapreduce.*; import org.mozilla.javascript.*;
[ "io.apigee.lembos", "io.apigee.trireme", "org.apache.hadoop", "org.mozilla.javascript" ]
io.apigee.lembos; io.apigee.trireme; org.apache.hadoop; org.mozilla.javascript;
1,344,552
public static ims.emergency.vo.TIIGVo insert(DomainObjectMap map, ims.emergency.vo.TIIGVo valueObject, ims.core.admin.domain.objects.TIIG domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_TIIG(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); // If this is a recordedInError record, and the domainObject // value isIncludeRecord has not been set, then we return null and // not the value object if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; // If this is not a recordedInError record, and the domainObject // value isIncludeRecord has been set, then we return null and // not the value object if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; // Patient if (domainObject.getPatient() != null) { if(domainObject.getPatient() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already. { HibernateProxy p = (HibernateProxy) domainObject.getPatient(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setPatient(new ims.core.patient.vo.PatientRefVo(id, -1)); } else { valueObject.setPatient(new ims.core.patient.vo.PatientRefVo(domainObject.getPatient().getId(), domainObject.getPatient().getVersion())); } } // Episode if (domainObject.getEpisode() != null) { if(domainObject.getEpisode() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already. { HibernateProxy p = (HibernateProxy) domainObject.getEpisode(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setEpisode(new ims.core.admin.vo.EpisodeOfCareRefVo(id, -1)); } else { valueObject.setEpisode(new ims.core.admin.vo.EpisodeOfCareRefVo(domainObject.getEpisode().getId(), domainObject.getEpisode().getVersion())); } } // Attendance if (domainObject.getAttendance() != null) { if(domainObject.getAttendance() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already. { HibernateProxy p = (HibernateProxy) domainObject.getAttendance(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setAttendance(new ims.core.admin.vo.CareContextRefVo(id, -1)); } else { valueObject.setAttendance(new ims.core.admin.vo.CareContextRefVo(domainObject.getAttendance().getId(), domainObject.getAttendance().getVersion())); } } // HadPatientConsumedAlcohol ims.domain.lookups.LookupInstance instance4 = domainObject.getHadPatientConsumedAlcohol(); if ( null != instance4 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance4.getImage() != null) { img = new ims.framework.utils.ImagePath(instance4.getImage().getImageId(), instance4.getImage().getImagePath()); } color = instance4.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident voLookup4 = new ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident(instance4.getId(),instance4.getText(), instance4.isActive(), null, img, color); ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident parentVoLookup4 = voLookup4; ims.domain.lookups.LookupInstance parent4 = instance4.getParent(); while (parent4 != null) { if (parent4.getImage() != null) { img = new ims.framework.utils.ImagePath(parent4.getImage().getImageId(), parent4.getImage().getImagePath() ); } else { img = null; } color = parent4.getColor(); if (color != null) color.getValue(); parentVoLookup4.setParent(new ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident(parent4.getId(),parent4.getText(), parent4.isActive(), null, img, color)); parentVoLookup4 = parentVoLookup4.getParent(); parent4 = parent4.getParent(); } valueObject.setHadPatientConsumedAlcohol(voLookup4); } // AssaultWeapon ims.domain.lookups.LookupInstance instance5 = domainObject.getAssaultWeapon(); if ( null != instance5 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance5.getImage() != null) { img = new ims.framework.utils.ImagePath(instance5.getImage().getImageId(), instance5.getImage().getImagePath()); } color = instance5.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AssaultWeapon voLookup5 = new ims.emergency.vo.lookups.AssaultWeapon(instance5.getId(),instance5.getText(), instance5.isActive(), null, img, color); ims.emergency.vo.lookups.AssaultWeapon parentVoLookup5 = voLookup5; ims.domain.lookups.LookupInstance parent5 = instance5.getParent(); while (parent5 != null) { if (parent5.getImage() != null) { img = new ims.framework.utils.ImagePath(parent5.getImage().getImageId(), parent5.getImage().getImagePath() ); } else { img = null; } color = parent5.getColor(); if (color != null) color.getValue(); parentVoLookup5.setParent(new ims.emergency.vo.lookups.AssaultWeapon(parent5.getId(),parent5.getText(), parent5.isActive(), null, img, color)); parentVoLookup5 = parentVoLookup5.getParent(); parent5 = parent5.getParent(); } valueObject.setAssaultWeapon(voLookup5); } // AssaultLocation ims.domain.lookups.LookupInstance instance6 = domainObject.getAssaultLocation(); if ( null != instance6 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance6.getImage() != null) { img = new ims.framework.utils.ImagePath(instance6.getImage().getImageId(), instance6.getImage().getImagePath()); } color = instance6.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AssaultLocation voLookup6 = new ims.emergency.vo.lookups.AssaultLocation(instance6.getId(),instance6.getText(), instance6.isActive(), null, img, color); ims.emergency.vo.lookups.AssaultLocation parentVoLookup6 = voLookup6; ims.domain.lookups.LookupInstance parent6 = instance6.getParent(); while (parent6 != null) { if (parent6.getImage() != null) { img = new ims.framework.utils.ImagePath(parent6.getImage().getImageId(), parent6.getImage().getImagePath() ); } else { img = null; } color = parent6.getColor(); if (color != null) color.getValue(); parentVoLookup6.setParent(new ims.emergency.vo.lookups.AssaultLocation(parent6.getId(),parent6.getText(), parent6.isActive(), null, img, color)); parentVoLookup6 = parentVoLookup6.getParent(); parent6 = parent6.getParent(); } valueObject.setAssaultLocation(voLookup6); } // RelationshipToAttacker ims.domain.lookups.LookupInstance instance7 = domainObject.getRelationshipToAttacker(); if ( null != instance7 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance7.getImage() != null) { img = new ims.framework.utils.ImagePath(instance7.getImage().getImageId(), instance7.getImage().getImagePath()); } color = instance7.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.RelationshipToAttacker voLookup7 = new ims.emergency.vo.lookups.RelationshipToAttacker(instance7.getId(),instance7.getText(), instance7.isActive(), null, img, color); ims.emergency.vo.lookups.RelationshipToAttacker parentVoLookup7 = voLookup7; ims.domain.lookups.LookupInstance parent7 = instance7.getParent(); while (parent7 != null) { if (parent7.getImage() != null) { img = new ims.framework.utils.ImagePath(parent7.getImage().getImageId(), parent7.getImage().getImagePath() ); } else { img = null; } color = parent7.getColor(); if (color != null) color.getValue(); parentVoLookup7.setParent(new ims.emergency.vo.lookups.RelationshipToAttacker(parent7.getId(),parent7.getText(), parent7.isActive(), null, img, color)); parentVoLookup7 = parentVoLookup7.getParent(); parent7 = parent7.getParent(); } valueObject.setRelationshipToAttacker(voLookup7); } // IntendToInformPolice ims.domain.lookups.LookupInstance instance8 = domainObject.getIntendToInformPolice(); if ( null != instance8 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance8.getImage() != null) { img = new ims.framework.utils.ImagePath(instance8.getImage().getImageId(), instance8.getImage().getImagePath()); } color = instance8.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.PoliceInformed voLookup8 = new ims.emergency.vo.lookups.PoliceInformed(instance8.getId(),instance8.getText(), instance8.isActive(), null, img, color); ims.emergency.vo.lookups.PoliceInformed parentVoLookup8 = voLookup8; ims.domain.lookups.LookupInstance parent8 = instance8.getParent(); while (parent8 != null) { if (parent8.getImage() != null) { img = new ims.framework.utils.ImagePath(parent8.getImage().getImageId(), parent8.getImage().getImagePath() ); } else { img = null; } color = parent8.getColor(); if (color != null) color.getValue(); parentVoLookup8.setParent(new ims.emergency.vo.lookups.PoliceInformed(parent8.getId(),parent8.getText(), parent8.isActive(), null, img, color)); parentVoLookup8 = parentVoLookup8.getParent(); parent8 = parent8.getParent(); } valueObject.setIntendToInformPolice(voLookup8); } // ConsumedOrPurchasedAlcoholFrom ims.domain.lookups.LookupInstance instance9 = domainObject.getConsumedOrPurchasedAlcoholFrom(); if ( null != instance9 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance9.getImage() != null) { img = new ims.framework.utils.ImagePath(instance9.getImage().getImageId(), instance9.getImage().getImagePath()); } color = instance9.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom voLookup9 = new ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom(instance9.getId(),instance9.getText(), instance9.isActive(), null, img, color); ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom parentVoLookup9 = voLookup9; ims.domain.lookups.LookupInstance parent9 = instance9.getParent(); while (parent9 != null) { if (parent9.getImage() != null) { img = new ims.framework.utils.ImagePath(parent9.getImage().getImageId(), parent9.getImage().getImagePath() ); } else { img = null; } color = parent9.getColor(); if (color != null) color.getValue(); parentVoLookup9.setParent(new ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom(parent9.getId(),parent9.getText(), parent9.isActive(), null, img, color)); parentVoLookup9 = parentVoLookup9.getParent(); parent9 = parent9.getParent(); } valueObject.setConsumedOrPurchasedAlcoholFrom(voLookup9); } // NumberOfAttackers ims.domain.lookups.LookupInstance instance10 = domainObject.getNumberOfAttackers(); if ( null != instance10 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance10.getImage() != null) { img = new ims.framework.utils.ImagePath(instance10.getImage().getImageId(), instance10.getImage().getImagePath()); } color = instance10.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.NumberOfAttackers voLookup10 = new ims.emergency.vo.lookups.NumberOfAttackers(instance10.getId(),instance10.getText(), instance10.isActive(), null, img, color); ims.emergency.vo.lookups.NumberOfAttackers parentVoLookup10 = voLookup10; ims.domain.lookups.LookupInstance parent10 = instance10.getParent(); while (parent10 != null) { if (parent10.getImage() != null) { img = new ims.framework.utils.ImagePath(parent10.getImage().getImageId(), parent10.getImage().getImagePath() ); } else { img = null; } color = parent10.getColor(); if (color != null) color.getValue(); parentVoLookup10.setParent(new ims.emergency.vo.lookups.NumberOfAttackers(parent10.getId(),parent10.getText(), parent10.isActive(), null, img, color)); parentVoLookup10 = parentVoLookup10.getParent(); parent10 = parent10.getParent(); } valueObject.setNumberOfAttackers(voLookup10); } // GenderofAttacker ims.domain.lookups.LookupInstance instance11 = domainObject.getGenderofAttacker(); if ( null != instance11 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance11.getImage() != null) { img = new ims.framework.utils.ImagePath(instance11.getImage().getImageId(), instance11.getImage().getImagePath()); } color = instance11.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.GenderofAttacker voLookup11 = new ims.emergency.vo.lookups.GenderofAttacker(instance11.getId(),instance11.getText(), instance11.isActive(), null, img, color); ims.emergency.vo.lookups.GenderofAttacker parentVoLookup11 = voLookup11; ims.domain.lookups.LookupInstance parent11 = instance11.getParent(); while (parent11 != null) { if (parent11.getImage() != null) { img = new ims.framework.utils.ImagePath(parent11.getImage().getImageId(), parent11.getImage().getImagePath() ); } else { img = null; } color = parent11.getColor(); if (color != null) color.getValue(); parentVoLookup11.setParent(new ims.emergency.vo.lookups.GenderofAttacker(parent11.getId(),parent11.getText(), parent11.isActive(), null, img, color)); parentVoLookup11 = parentVoLookup11.getParent(); parent11 = parent11.getParent(); } valueObject.setGenderofAttacker(voLookup11); } // PreviouslyAssulatedByAttacker ims.domain.lookups.LookupInstance instance12 = domainObject.getPreviouslyAssulatedByAttacker(); if ( null != instance12 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance12.getImage() != null) { img = new ims.framework.utils.ImagePath(instance12.getImage().getImageId(), instance12.getImage().getImagePath()); } color = instance12.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker voLookup12 = new ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker(instance12.getId(),instance12.getText(), instance12.isActive(), null, img, color); ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker parentVoLookup12 = voLookup12; ims.domain.lookups.LookupInstance parent12 = instance12.getParent(); while (parent12 != null) { if (parent12.getImage() != null) { img = new ims.framework.utils.ImagePath(parent12.getImage().getImageId(), parent12.getImage().getImagePath() ); } else { img = null; } color = parent12.getColor(); if (color != null) color.getValue(); parentVoLookup12.setParent(new ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker(parent12.getId(),parent12.getText(), parent12.isActive(), null, img, color)); parentVoLookup12 = parentVoLookup12.getParent(); parent12 = parent12.getParent(); } valueObject.setPreviouslyAssulatedByAttacker(voLookup12); } // AssaultLocationDetails valueObject.setAssaultLocationDetails(domainObject.getAssaultLocationDetails()); // RelationshipToAttackerDetails valueObject.setRelationshipToAttackerDetails(domainObject.getRelationshipToAttackerDetails()); // AssaultWeaponDetails valueObject.setAssaultWeaponDetails(domainObject.getAssaultWeaponDetails()); // LastDrinkLocationDetails valueObject.setLastDrinkLocationDetails(domainObject.getLastDrinkLocationDetails()); // AttackerHadConsumedAlcohol ims.domain.lookups.LookupInstance instance17 = domainObject.getAttackerHadConsumedAlcohol(); if ( null != instance17 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance17.getImage() != null) { img = new ims.framework.utils.ImagePath(instance17.getImage().getImageId(), instance17.getImage().getImagePath()); } color = instance17.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AttackerHadConsumedAlcohol voLookup17 = new ims.emergency.vo.lookups.AttackerHadConsumedAlcohol(instance17.getId(),instance17.getText(), instance17.isActive(), null, img, color); ims.emergency.vo.lookups.AttackerHadConsumedAlcohol parentVoLookup17 = voLookup17; ims.domain.lookups.LookupInstance parent17 = instance17.getParent(); while (parent17 != null) { if (parent17.getImage() != null) { img = new ims.framework.utils.ImagePath(parent17.getImage().getImageId(), parent17.getImage().getImagePath() ); } else { img = null; } color = parent17.getColor(); if (color != null) color.getValue(); parentVoLookup17.setParent(new ims.emergency.vo.lookups.AttackerHadConsumedAlcohol(parent17.getId(),parent17.getText(), parent17.isActive(), null, img, color)); parentVoLookup17 = parentVoLookup17.getParent(); parent17 = parent17.getParent(); } valueObject.setAttackerHadConsumedAlcohol(voLookup17); } return valueObject; }
static ims.emergency.vo.TIIGVo function(DomainObjectMap map, ims.emergency.vo.TIIGVo valueObject, ims.core.admin.domain.objects.TIIG domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_TIIG(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; if ((valueObject.getIsRIE() == null valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; if (domainObject.getPatient() != null) { if(domainObject.getPatient() instanceof HibernateProxy) { HibernateProxy p = (HibernateProxy) domainObject.getPatient(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setPatient(new ims.core.patient.vo.PatientRefVo(id, -1)); } else { valueObject.setPatient(new ims.core.patient.vo.PatientRefVo(domainObject.getPatient().getId(), domainObject.getPatient().getVersion())); } } if (domainObject.getEpisode() != null) { if(domainObject.getEpisode() instanceof HibernateProxy) { HibernateProxy p = (HibernateProxy) domainObject.getEpisode(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setEpisode(new ims.core.admin.vo.EpisodeOfCareRefVo(id, -1)); } else { valueObject.setEpisode(new ims.core.admin.vo.EpisodeOfCareRefVo(domainObject.getEpisode().getId(), domainObject.getEpisode().getVersion())); } } if (domainObject.getAttendance() != null) { if(domainObject.getAttendance() instanceof HibernateProxy) { HibernateProxy p = (HibernateProxy) domainObject.getAttendance(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setAttendance(new ims.core.admin.vo.CareContextRefVo(id, -1)); } else { valueObject.setAttendance(new ims.core.admin.vo.CareContextRefVo(domainObject.getAttendance().getId(), domainObject.getAttendance().getVersion())); } } ims.domain.lookups.LookupInstance instance4 = domainObject.getHadPatientConsumedAlcohol(); if ( null != instance4 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance4.getImage() != null) { img = new ims.framework.utils.ImagePath(instance4.getImage().getImageId(), instance4.getImage().getImagePath()); } color = instance4.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident voLookup4 = new ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident(instance4.getId(),instance4.getText(), instance4.isActive(), null, img, color); ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident parentVoLookup4 = voLookup4; ims.domain.lookups.LookupInstance parent4 = instance4.getParent(); while (parent4 != null) { if (parent4.getImage() != null) { img = new ims.framework.utils.ImagePath(parent4.getImage().getImageId(), parent4.getImage().getImagePath() ); } else { img = null; } color = parent4.getColor(); if (color != null) color.getValue(); parentVoLookup4.setParent(new ims.emergency.vo.lookups.ConsumedAlcoholThreeHoursPriorToIncident(parent4.getId(),parent4.getText(), parent4.isActive(), null, img, color)); parentVoLookup4 = parentVoLookup4.getParent(); parent4 = parent4.getParent(); } valueObject.setHadPatientConsumedAlcohol(voLookup4); } ims.domain.lookups.LookupInstance instance5 = domainObject.getAssaultWeapon(); if ( null != instance5 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance5.getImage() != null) { img = new ims.framework.utils.ImagePath(instance5.getImage().getImageId(), instance5.getImage().getImagePath()); } color = instance5.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AssaultWeapon voLookup5 = new ims.emergency.vo.lookups.AssaultWeapon(instance5.getId(),instance5.getText(), instance5.isActive(), null, img, color); ims.emergency.vo.lookups.AssaultWeapon parentVoLookup5 = voLookup5; ims.domain.lookups.LookupInstance parent5 = instance5.getParent(); while (parent5 != null) { if (parent5.getImage() != null) { img = new ims.framework.utils.ImagePath(parent5.getImage().getImageId(), parent5.getImage().getImagePath() ); } else { img = null; } color = parent5.getColor(); if (color != null) color.getValue(); parentVoLookup5.setParent(new ims.emergency.vo.lookups.AssaultWeapon(parent5.getId(),parent5.getText(), parent5.isActive(), null, img, color)); parentVoLookup5 = parentVoLookup5.getParent(); parent5 = parent5.getParent(); } valueObject.setAssaultWeapon(voLookup5); } ims.domain.lookups.LookupInstance instance6 = domainObject.getAssaultLocation(); if ( null != instance6 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance6.getImage() != null) { img = new ims.framework.utils.ImagePath(instance6.getImage().getImageId(), instance6.getImage().getImagePath()); } color = instance6.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AssaultLocation voLookup6 = new ims.emergency.vo.lookups.AssaultLocation(instance6.getId(),instance6.getText(), instance6.isActive(), null, img, color); ims.emergency.vo.lookups.AssaultLocation parentVoLookup6 = voLookup6; ims.domain.lookups.LookupInstance parent6 = instance6.getParent(); while (parent6 != null) { if (parent6.getImage() != null) { img = new ims.framework.utils.ImagePath(parent6.getImage().getImageId(), parent6.getImage().getImagePath() ); } else { img = null; } color = parent6.getColor(); if (color != null) color.getValue(); parentVoLookup6.setParent(new ims.emergency.vo.lookups.AssaultLocation(parent6.getId(),parent6.getText(), parent6.isActive(), null, img, color)); parentVoLookup6 = parentVoLookup6.getParent(); parent6 = parent6.getParent(); } valueObject.setAssaultLocation(voLookup6); } ims.domain.lookups.LookupInstance instance7 = domainObject.getRelationshipToAttacker(); if ( null != instance7 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance7.getImage() != null) { img = new ims.framework.utils.ImagePath(instance7.getImage().getImageId(), instance7.getImage().getImagePath()); } color = instance7.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.RelationshipToAttacker voLookup7 = new ims.emergency.vo.lookups.RelationshipToAttacker(instance7.getId(),instance7.getText(), instance7.isActive(), null, img, color); ims.emergency.vo.lookups.RelationshipToAttacker parentVoLookup7 = voLookup7; ims.domain.lookups.LookupInstance parent7 = instance7.getParent(); while (parent7 != null) { if (parent7.getImage() != null) { img = new ims.framework.utils.ImagePath(parent7.getImage().getImageId(), parent7.getImage().getImagePath() ); } else { img = null; } color = parent7.getColor(); if (color != null) color.getValue(); parentVoLookup7.setParent(new ims.emergency.vo.lookups.RelationshipToAttacker(parent7.getId(),parent7.getText(), parent7.isActive(), null, img, color)); parentVoLookup7 = parentVoLookup7.getParent(); parent7 = parent7.getParent(); } valueObject.setRelationshipToAttacker(voLookup7); } ims.domain.lookups.LookupInstance instance8 = domainObject.getIntendToInformPolice(); if ( null != instance8 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance8.getImage() != null) { img = new ims.framework.utils.ImagePath(instance8.getImage().getImageId(), instance8.getImage().getImagePath()); } color = instance8.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.PoliceInformed voLookup8 = new ims.emergency.vo.lookups.PoliceInformed(instance8.getId(),instance8.getText(), instance8.isActive(), null, img, color); ims.emergency.vo.lookups.PoliceInformed parentVoLookup8 = voLookup8; ims.domain.lookups.LookupInstance parent8 = instance8.getParent(); while (parent8 != null) { if (parent8.getImage() != null) { img = new ims.framework.utils.ImagePath(parent8.getImage().getImageId(), parent8.getImage().getImagePath() ); } else { img = null; } color = parent8.getColor(); if (color != null) color.getValue(); parentVoLookup8.setParent(new ims.emergency.vo.lookups.PoliceInformed(parent8.getId(),parent8.getText(), parent8.isActive(), null, img, color)); parentVoLookup8 = parentVoLookup8.getParent(); parent8 = parent8.getParent(); } valueObject.setIntendToInformPolice(voLookup8); } ims.domain.lookups.LookupInstance instance9 = domainObject.getConsumedOrPurchasedAlcoholFrom(); if ( null != instance9 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance9.getImage() != null) { img = new ims.framework.utils.ImagePath(instance9.getImage().getImageId(), instance9.getImage().getImagePath()); } color = instance9.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom voLookup9 = new ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom(instance9.getId(),instance9.getText(), instance9.isActive(), null, img, color); ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom parentVoLookup9 = voLookup9; ims.domain.lookups.LookupInstance parent9 = instance9.getParent(); while (parent9 != null) { if (parent9.getImage() != null) { img = new ims.framework.utils.ImagePath(parent9.getImage().getImageId(), parent9.getImage().getImagePath() ); } else { img = null; } color = parent9.getColor(); if (color != null) color.getValue(); parentVoLookup9.setParent(new ims.emergency.vo.lookups.ConsumedOrPurchasedAlcoholFrom(parent9.getId(),parent9.getText(), parent9.isActive(), null, img, color)); parentVoLookup9 = parentVoLookup9.getParent(); parent9 = parent9.getParent(); } valueObject.setConsumedOrPurchasedAlcoholFrom(voLookup9); } ims.domain.lookups.LookupInstance instance10 = domainObject.getNumberOfAttackers(); if ( null != instance10 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance10.getImage() != null) { img = new ims.framework.utils.ImagePath(instance10.getImage().getImageId(), instance10.getImage().getImagePath()); } color = instance10.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.NumberOfAttackers voLookup10 = new ims.emergency.vo.lookups.NumberOfAttackers(instance10.getId(),instance10.getText(), instance10.isActive(), null, img, color); ims.emergency.vo.lookups.NumberOfAttackers parentVoLookup10 = voLookup10; ims.domain.lookups.LookupInstance parent10 = instance10.getParent(); while (parent10 != null) { if (parent10.getImage() != null) { img = new ims.framework.utils.ImagePath(parent10.getImage().getImageId(), parent10.getImage().getImagePath() ); } else { img = null; } color = parent10.getColor(); if (color != null) color.getValue(); parentVoLookup10.setParent(new ims.emergency.vo.lookups.NumberOfAttackers(parent10.getId(),parent10.getText(), parent10.isActive(), null, img, color)); parentVoLookup10 = parentVoLookup10.getParent(); parent10 = parent10.getParent(); } valueObject.setNumberOfAttackers(voLookup10); } ims.domain.lookups.LookupInstance instance11 = domainObject.getGenderofAttacker(); if ( null != instance11 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance11.getImage() != null) { img = new ims.framework.utils.ImagePath(instance11.getImage().getImageId(), instance11.getImage().getImagePath()); } color = instance11.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.GenderofAttacker voLookup11 = new ims.emergency.vo.lookups.GenderofAttacker(instance11.getId(),instance11.getText(), instance11.isActive(), null, img, color); ims.emergency.vo.lookups.GenderofAttacker parentVoLookup11 = voLookup11; ims.domain.lookups.LookupInstance parent11 = instance11.getParent(); while (parent11 != null) { if (parent11.getImage() != null) { img = new ims.framework.utils.ImagePath(parent11.getImage().getImageId(), parent11.getImage().getImagePath() ); } else { img = null; } color = parent11.getColor(); if (color != null) color.getValue(); parentVoLookup11.setParent(new ims.emergency.vo.lookups.GenderofAttacker(parent11.getId(),parent11.getText(), parent11.isActive(), null, img, color)); parentVoLookup11 = parentVoLookup11.getParent(); parent11 = parent11.getParent(); } valueObject.setGenderofAttacker(voLookup11); } ims.domain.lookups.LookupInstance instance12 = domainObject.getPreviouslyAssulatedByAttacker(); if ( null != instance12 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance12.getImage() != null) { img = new ims.framework.utils.ImagePath(instance12.getImage().getImageId(), instance12.getImage().getImagePath()); } color = instance12.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker voLookup12 = new ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker(instance12.getId(),instance12.getText(), instance12.isActive(), null, img, color); ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker parentVoLookup12 = voLookup12; ims.domain.lookups.LookupInstance parent12 = instance12.getParent(); while (parent12 != null) { if (parent12.getImage() != null) { img = new ims.framework.utils.ImagePath(parent12.getImage().getImageId(), parent12.getImage().getImagePath() ); } else { img = null; } color = parent12.getColor(); if (color != null) color.getValue(); parentVoLookup12.setParent(new ims.emergency.vo.lookups.PatientPreviouslyAssaultedByAttacker(parent12.getId(),parent12.getText(), parent12.isActive(), null, img, color)); parentVoLookup12 = parentVoLookup12.getParent(); parent12 = parent12.getParent(); } valueObject.setPreviouslyAssulatedByAttacker(voLookup12); } valueObject.setAssaultLocationDetails(domainObject.getAssaultLocationDetails()); valueObject.setRelationshipToAttackerDetails(domainObject.getRelationshipToAttackerDetails()); valueObject.setAssaultWeaponDetails(domainObject.getAssaultWeaponDetails()); valueObject.setLastDrinkLocationDetails(domainObject.getLastDrinkLocationDetails()); ims.domain.lookups.LookupInstance instance17 = domainObject.getAttackerHadConsumedAlcohol(); if ( null != instance17 ) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance17.getImage() != null) { img = new ims.framework.utils.ImagePath(instance17.getImage().getImageId(), instance17.getImage().getImagePath()); } color = instance17.getColor(); if (color != null) color.getValue(); ims.emergency.vo.lookups.AttackerHadConsumedAlcohol voLookup17 = new ims.emergency.vo.lookups.AttackerHadConsumedAlcohol(instance17.getId(),instance17.getText(), instance17.isActive(), null, img, color); ims.emergency.vo.lookups.AttackerHadConsumedAlcohol parentVoLookup17 = voLookup17; ims.domain.lookups.LookupInstance parent17 = instance17.getParent(); while (parent17 != null) { if (parent17.getImage() != null) { img = new ims.framework.utils.ImagePath(parent17.getImage().getImageId(), parent17.getImage().getImagePath() ); } else { img = null; } color = parent17.getColor(); if (color != null) color.getValue(); parentVoLookup17.setParent(new ims.emergency.vo.lookups.AttackerHadConsumedAlcohol(parent17.getId(),parent17.getText(), parent17.isActive(), null, img, color)); parentVoLookup17 = parentVoLookup17.getParent(); parent17 = parent17.getParent(); } valueObject.setAttackerHadConsumedAlcohol(voLookup17); } return valueObject; }
/** * Update the ValueObject with the Domain Object. * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.core.admin.domain.objects.TIIG */
Update the ValueObject with the Domain Object
insert
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/TIIGVoAssembler.java", "license": "agpl-3.0", "size": 40637 }
[ "org.hibernate.proxy.HibernateProxy" ]
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.*;
[ "org.hibernate.proxy" ]
org.hibernate.proxy;
1,795,833
private Response remoteCall(final String path, final String configName) throws ConfigurationException, InterruptedException { int i = 0; while (true) { try { return remote.getRemoteConfiguration(path, configName); } catch (final HttpConfigurationException nfe) { // don't retry if we have an explicit failure from the HTTP server throw nfe; } catch (final ConfigurationException e) { LOG.debug("HTTP client call failed, retrying"); if (i == retries) { throw e; } else { Thread.sleep((long) Math.pow(2, i) * 1000L); } i++; } } }
Response function(final String path, final String configName) throws ConfigurationException, InterruptedException { int i = 0; while (true) { try { return remote.getRemoteConfiguration(path, configName); } catch (final HttpConfigurationException nfe) { throw nfe; } catch (final ConfigurationException e) { LOG.debug(STR); if (i == retries) { throw e; } else { Thread.sleep((long) Math.pow(2, i) * 1000L); } i++; } } }
/** * Perform exponential backoff/retry of acquiring a data file from an HTTP source. * * @param configName the configuration file name * @return the HTTP response * @throws ConfigurationException if the data cannot be acquired * @throws InterruptedException usually if the application is shutting down */
Perform exponential backoff/retry of acquiring a data file from an HTTP source
remoteCall
{ "repo_name": "CAFapi/caf-common", "path": "config-rest/src/main/java/com/hpe/caf/config/rest/RestConfigurationSource.java", "license": "apache-2.0", "size": 7761 }
[ "com.hpe.caf.api.ConfigurationException" ]
import com.hpe.caf.api.ConfigurationException;
import com.hpe.caf.api.*;
[ "com.hpe.caf" ]
com.hpe.caf;
2,010,350
boolean removeJob(String jobId) throws NotConnectedException, UnknownJobException, PermissionException;
boolean removeJob(String jobId) throws NotConnectedException, UnknownJobException, PermissionException;
/** * Remove the job from the scheduler. * <p> * The jobId is given as a string. It's in fact the string returned by the * {@link JobId#value()} method.<br> * A user can only remove HIS job.<br> * If the job does not exist, a schedulerException is sent with the proper * message. * * @param jobId * the job to be removed. * @return true if success, false if job is not terminated. * @throws NotConnectedException * if you are not authenticated. * @throws UnknownJobException * if the job does not exist. * @throws PermissionException * if you can't access to this particular job. */
Remove the job from the scheduler. The jobId is given as a string. It's in fact the string returned by the <code>JobId#value()</code> method. A user can only remove HIS job. If the job does not exist, a schedulerException is sent with the proper message
removeJob
{ "repo_name": "marcocast/scheduling", "path": "scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/Scheduler.java", "license": "agpl-3.0", "size": 61764 }
[ "org.ow2.proactive.scheduler.common.exception.NotConnectedException", "org.ow2.proactive.scheduler.common.exception.PermissionException", "org.ow2.proactive.scheduler.common.exception.UnknownJobException" ]
import org.ow2.proactive.scheduler.common.exception.NotConnectedException; import org.ow2.proactive.scheduler.common.exception.PermissionException; import org.ow2.proactive.scheduler.common.exception.UnknownJobException;
import org.ow2.proactive.scheduler.common.exception.*;
[ "org.ow2.proactive" ]
org.ow2.proactive;
747,952
public String getAttributeKey() { final String idModification = this.getParam("id"); String attributeKey = null; Iterator < ITabController > controller = this.tabControllers.iterator(); while (controller.hasNext()) { ITabController iGroupController = controller.next(); attributeKey = iGroupController.getAttributeKey(idModification); if (null != attributeKey) { break; } } XmlProducer producer = new XmlProducer(); producer.setTarget(new XMLResultString(attributeKey)); producer.setTypesOfTarget(XMLResultString.class); return this.xmlProducerWrapper.wrap(producer); }
String function() { final String idModification = this.getParam("id"); String attributeKey = null; Iterator < ITabController > controller = this.tabControllers.iterator(); while (controller.hasNext()) { ITabController iGroupController = controller.next(); attributeKey = iGroupController.getAttributeKey(idModification); if (null != attributeKey) { break; } } XmlProducer producer = new XmlProducer(); producer.setTarget(new XMLResultString(attributeKey)); producer.setTypesOfTarget(XMLResultString.class); return this.xmlProducerWrapper.wrap(producer); }
/** * Getter for the attribute key that is modified. * * @return the result. */
Getter for the attribute key that is modified
getAttributeKey
{ "repo_name": "GIP-RECIA/esco-grouper-ui", "path": "metier/esco-web/src/main/java/org/esco/grouperui/web/controllers/AbstractGroupController.java", "license": "apache-2.0", "size": 25245 }
[ "java.util.Iterator", "org.esco.grouperui.web.beans.XMLResultString", "org.esco.grouperui.web.plugins.ITabController", "org.esco.grouperui.web.utils.XmlProducer" ]
import java.util.Iterator; import org.esco.grouperui.web.beans.XMLResultString; import org.esco.grouperui.web.plugins.ITabController; import org.esco.grouperui.web.utils.XmlProducer;
import java.util.*; import org.esco.grouperui.web.beans.*; import org.esco.grouperui.web.plugins.*; import org.esco.grouperui.web.utils.*;
[ "java.util", "org.esco.grouperui" ]
java.util; org.esco.grouperui;
1,629,519
public int getPlayerCount() throws JSONException, WebApiException { Map<String, Object> params = new HashMap<String, Object>(); params.put("appid", this.appId); String jsonString = WebApi.getJSON("ISteamUserStats", "GetNumberOfCurrentPlayers", 1, params); JSONObject result = new JSONObject(jsonString).getJSONObject("response"); return result.getInt("player_count"); }
int function() throws JSONException, WebApiException { Map<String, Object> params = new HashMap<String, Object>(); params.put("appid", this.appId); String jsonString = WebApi.getJSON(STR, STR, 1, params); JSONObject result = new JSONObject(jsonString).getJSONObject(STR); return result.getInt(STR); }
/** * Returns the overall number of players currently playing this game * * @return The number of players playing this game * @throws JSONException In case of misformatted JSON data * @throws WebApiException on Web API errors */
Returns the overall number of players currently playing this game
getPlayerCount
{ "repo_name": "tomtomssi/Steam-API", "path": "src/main/java/com/github/koraktor/steamcondenser/community/SteamGame.java", "license": "bsd-3-clause", "size": 11321 }
[ "com.github.koraktor.steamcondenser.exceptions.WebApiException", "java.util.HashMap", "java.util.Map", "org.json.JSONException", "org.json.JSONObject" ]
import com.github.koraktor.steamcondenser.exceptions.WebApiException; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import org.json.JSONObject;
import com.github.koraktor.steamcondenser.exceptions.*; import java.util.*; import org.json.*;
[ "com.github.koraktor", "java.util", "org.json" ]
com.github.koraktor; java.util; org.json;
702,589
public void testGetShares() { RemoteOperationResult result = mActivity.getShares(); assertTrue(result.isSuccess()); assertTrue(result.getData() != null && result.getData().size() == 1); }
void function() { RemoteOperationResult result = mActivity.getShares(); assertTrue(result.isSuccess()); assertTrue(result.getData() != null && result.getData().size() == 1); }
/** * Test Get Shares: the server must support SHARE API */
Test Get Shares: the server must support SHARE API
testGetShares
{ "repo_name": "duke8804/Iluq-Cloud", "path": "owncloud-android-library/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetSharesTest.java", "license": "gpl-2.0", "size": 3226 }
[ "com.iluq_cloud.android.lib.common.operations.RemoteOperationResult" ]
import com.iluq_cloud.android.lib.common.operations.RemoteOperationResult;
import com.iluq_cloud.android.lib.common.operations.*;
[ "com.iluq_cloud.android" ]
com.iluq_cloud.android;
589,803
@Test(expected=IllegalStateException.class) public void testRestoreLatestCheckpointFailureWhenMaxParallelismChanges() throws Exception { final JobID jid = new JobID(); final long timestamp = System.currentTimeMillis(); final JobVertexID jobVertexID1 = new JobVertexID(); final JobVertexID jobVertexID2 = new JobVertexID(); int parallelism1 = 3; int parallelism2 = 2; int maxParallelism1 = 42; int maxParallelism2 = 13; final ExecutionJobVertex jobVertex1 = mockExecutionJobVertex( jobVertexID1, parallelism1, maxParallelism1); final ExecutionJobVertex jobVertex2 = mockExecutionJobVertex( jobVertexID2, parallelism2, maxParallelism2); List<ExecutionVertex> allExecutionVertices = new ArrayList<>(parallelism1 + parallelism2); allExecutionVertices.addAll(Arrays.asList(jobVertex1.getTaskVertices())); allExecutionVertices.addAll(Arrays.asList(jobVertex2.getTaskVertices())); ExecutionVertex[] arrayExecutionVertices = allExecutionVertices.toArray(new ExecutionVertex[allExecutionVertices.size()]); // set up the coordinator and validate the initial state CheckpointCoordinator coord = new CheckpointCoordinator( jid, 600000, 600000, 0, Integer.MAX_VALUE, ExternalizedCheckpointSettings.none(), arrayExecutionVertices, arrayExecutionVertices, arrayExecutionVertices, new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), null, Executors.directExecutor()); // trigger the checkpoint coord.triggerCheckpoint(timestamp, false); assertTrue(coord.getPendingCheckpoints().keySet().size() == 1); long checkpointId = Iterables.getOnlyElement(coord.getPendingCheckpoints().keySet()); CheckpointMetaData checkpointMetaData = new CheckpointMetaData(checkpointId, 0L); List<KeyGroupRange> keyGroupPartitions1 = StateAssignmentOperation.createKeyGroupPartitions(maxParallelism1, parallelism1); List<KeyGroupRange> keyGroupPartitions2 = StateAssignmentOperation.createKeyGroupPartitions(maxParallelism2, parallelism2); for (int index = 0; index < jobVertex1.getParallelism(); index++) { ChainedStateHandle<StreamStateHandle> valueSizeTuple = generateStateForVertex(jobVertexID1, index); KeyGroupsStateHandle keyGroupState = generateKeyGroupState(jobVertexID1, keyGroupPartitions1.get(index), false); SubtaskState checkpointStateHandles = new SubtaskState(valueSizeTuple, null, null, keyGroupState, null); AcknowledgeCheckpoint acknowledgeCheckpoint = new AcknowledgeCheckpoint( jid, jobVertex1.getTaskVertices()[index].getCurrentExecutionAttempt().getAttemptId(), checkpointId, new CheckpointMetrics(), checkpointStateHandles); coord.receiveAcknowledgeMessage(acknowledgeCheckpoint); } for (int index = 0; index < jobVertex2.getParallelism(); index++) { ChainedStateHandle<StreamStateHandle> valueSizeTuple = generateStateForVertex(jobVertexID2, index); KeyGroupsStateHandle keyGroupState = generateKeyGroupState(jobVertexID2, keyGroupPartitions2.get(index), false); SubtaskState checkpointStateHandles = new SubtaskState(valueSizeTuple, null, null, keyGroupState, null); AcknowledgeCheckpoint acknowledgeCheckpoint = new AcknowledgeCheckpoint( jid, jobVertex2.getTaskVertices()[index].getCurrentExecutionAttempt().getAttemptId(), checkpointId, new CheckpointMetrics(), checkpointStateHandles); coord.receiveAcknowledgeMessage(acknowledgeCheckpoint); } List<CompletedCheckpoint> completedCheckpoints = coord.getSuccessfulCheckpoints(); assertEquals(1, completedCheckpoints.size()); Map<JobVertexID, ExecutionJobVertex> tasks = new HashMap<>(); int newMaxParallelism1 = 20; int newMaxParallelism2 = 42; final ExecutionJobVertex newJobVertex1 = mockExecutionJobVertex( jobVertexID1, parallelism1, newMaxParallelism1); final ExecutionJobVertex newJobVertex2 = mockExecutionJobVertex( jobVertexID2, parallelism2, newMaxParallelism2); tasks.put(jobVertexID1, newJobVertex1); tasks.put(jobVertexID2, newJobVertex2); coord.restoreLatestCheckpointedState(tasks, true, false); fail("The restoration should have failed because the max parallelism changed."); }
@Test(expected=IllegalStateException.class) void function() throws Exception { final JobID jid = new JobID(); final long timestamp = System.currentTimeMillis(); final JobVertexID jobVertexID1 = new JobVertexID(); final JobVertexID jobVertexID2 = new JobVertexID(); int parallelism1 = 3; int parallelism2 = 2; int maxParallelism1 = 42; int maxParallelism2 = 13; final ExecutionJobVertex jobVertex1 = mockExecutionJobVertex( jobVertexID1, parallelism1, maxParallelism1); final ExecutionJobVertex jobVertex2 = mockExecutionJobVertex( jobVertexID2, parallelism2, maxParallelism2); List<ExecutionVertex> allExecutionVertices = new ArrayList<>(parallelism1 + parallelism2); allExecutionVertices.addAll(Arrays.asList(jobVertex1.getTaskVertices())); allExecutionVertices.addAll(Arrays.asList(jobVertex2.getTaskVertices())); ExecutionVertex[] arrayExecutionVertices = allExecutionVertices.toArray(new ExecutionVertex[allExecutionVertices.size()]); CheckpointCoordinator coord = new CheckpointCoordinator( jid, 600000, 600000, 0, Integer.MAX_VALUE, ExternalizedCheckpointSettings.none(), arrayExecutionVertices, arrayExecutionVertices, arrayExecutionVertices, new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), null, Executors.directExecutor()); coord.triggerCheckpoint(timestamp, false); assertTrue(coord.getPendingCheckpoints().keySet().size() == 1); long checkpointId = Iterables.getOnlyElement(coord.getPendingCheckpoints().keySet()); CheckpointMetaData checkpointMetaData = new CheckpointMetaData(checkpointId, 0L); List<KeyGroupRange> keyGroupPartitions1 = StateAssignmentOperation.createKeyGroupPartitions(maxParallelism1, parallelism1); List<KeyGroupRange> keyGroupPartitions2 = StateAssignmentOperation.createKeyGroupPartitions(maxParallelism2, parallelism2); for (int index = 0; index < jobVertex1.getParallelism(); index++) { ChainedStateHandle<StreamStateHandle> valueSizeTuple = generateStateForVertex(jobVertexID1, index); KeyGroupsStateHandle keyGroupState = generateKeyGroupState(jobVertexID1, keyGroupPartitions1.get(index), false); SubtaskState checkpointStateHandles = new SubtaskState(valueSizeTuple, null, null, keyGroupState, null); AcknowledgeCheckpoint acknowledgeCheckpoint = new AcknowledgeCheckpoint( jid, jobVertex1.getTaskVertices()[index].getCurrentExecutionAttempt().getAttemptId(), checkpointId, new CheckpointMetrics(), checkpointStateHandles); coord.receiveAcknowledgeMessage(acknowledgeCheckpoint); } for (int index = 0; index < jobVertex2.getParallelism(); index++) { ChainedStateHandle<StreamStateHandle> valueSizeTuple = generateStateForVertex(jobVertexID2, index); KeyGroupsStateHandle keyGroupState = generateKeyGroupState(jobVertexID2, keyGroupPartitions2.get(index), false); SubtaskState checkpointStateHandles = new SubtaskState(valueSizeTuple, null, null, keyGroupState, null); AcknowledgeCheckpoint acknowledgeCheckpoint = new AcknowledgeCheckpoint( jid, jobVertex2.getTaskVertices()[index].getCurrentExecutionAttempt().getAttemptId(), checkpointId, new CheckpointMetrics(), checkpointStateHandles); coord.receiveAcknowledgeMessage(acknowledgeCheckpoint); } List<CompletedCheckpoint> completedCheckpoints = coord.getSuccessfulCheckpoints(); assertEquals(1, completedCheckpoints.size()); Map<JobVertexID, ExecutionJobVertex> tasks = new HashMap<>(); int newMaxParallelism1 = 20; int newMaxParallelism2 = 42; final ExecutionJobVertex newJobVertex1 = mockExecutionJobVertex( jobVertexID1, parallelism1, newMaxParallelism1); final ExecutionJobVertex newJobVertex2 = mockExecutionJobVertex( jobVertexID2, parallelism2, newMaxParallelism2); tasks.put(jobVertexID1, newJobVertex1); tasks.put(jobVertexID2, newJobVertex2); coord.restoreLatestCheckpointedState(tasks, true, false); fail(STR); }
/** * Tests that the checkpoint restoration fails if the max parallelism of the job vertices has * changed. * * @throws Exception */
Tests that the checkpoint restoration fails if the max parallelism of the job vertices has changed
testRestoreLatestCheckpointFailureWhenMaxParallelismChanges
{ "repo_name": "WangTaoTheTonic/flink", "path": "flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java", "license": "apache-2.0", "size": 145372 }
[ "com.google.common.collect.Iterables", "java.util.ArrayList", "java.util.Arrays", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.flink.api.common.JobID", "org.apache.flink.runtime.concurrent.Executors", "org.apache.flink.runtime.executiongraph.ExecutionJobVertex", "org.apache.flink.runtime.executiongraph.ExecutionVertex", "org.apache.flink.runtime.jobgraph.JobVertexID", "org.apache.flink.runtime.jobgraph.tasks.ExternalizedCheckpointSettings", "org.apache.flink.runtime.messages.checkpoint.AcknowledgeCheckpoint", "org.apache.flink.runtime.state.ChainedStateHandle", "org.apache.flink.runtime.state.KeyGroupRange", "org.apache.flink.runtime.state.KeyGroupsStateHandle", "org.apache.flink.runtime.state.StreamStateHandle", "org.junit.Assert", "org.junit.Test" ]
import com.google.common.collect.Iterables; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.concurrent.Executors; import org.apache.flink.runtime.executiongraph.ExecutionJobVertex; import org.apache.flink.runtime.executiongraph.ExecutionVertex; import org.apache.flink.runtime.jobgraph.JobVertexID; import org.apache.flink.runtime.jobgraph.tasks.ExternalizedCheckpointSettings; import org.apache.flink.runtime.messages.checkpoint.AcknowledgeCheckpoint; import org.apache.flink.runtime.state.ChainedStateHandle; import org.apache.flink.runtime.state.KeyGroupRange; import org.apache.flink.runtime.state.KeyGroupsStateHandle; import org.apache.flink.runtime.state.StreamStateHandle; import org.junit.Assert; import org.junit.Test;
import com.google.common.collect.*; import java.util.*; import org.apache.flink.api.common.*; import org.apache.flink.runtime.concurrent.*; import org.apache.flink.runtime.executiongraph.*; import org.apache.flink.runtime.jobgraph.*; import org.apache.flink.runtime.jobgraph.tasks.*; import org.apache.flink.runtime.messages.checkpoint.*; import org.apache.flink.runtime.state.*; import org.junit.*;
[ "com.google.common", "java.util", "org.apache.flink", "org.junit" ]
com.google.common; java.util; org.apache.flink; org.junit;
681,603
protected final void immutableSetName(@NotNull final String name) { m__strName = name; }
final void function(@NotNull final String name) { m__strName = name; }
/** * Specifies the alias name. * @param name the name. */
Specifies the alias name
immutableSetName
{ "repo_name": "rydnr/queryj-sql", "path": "src/main/java/org/acmsl/queryj/sql/TableAlias.java", "license": "gpl-3.0", "size": 3124 }
[ "org.jetbrains.annotations.NotNull" ]
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
140,643
public static <T> FutureTask<T> runOnUiThread(FutureTask<T> task) { if (runningOnUiThread()) { task.run(); } else { postOnUiThread(task); } return task; }
static <T> FutureTask<T> function(FutureTask<T> task) { if (runningOnUiThread()) { task.run(); } else { postOnUiThread(task); } return task; }
/** * Run the supplied FutureTask on the main thread. The method will block only if the current * thread is the main thread. * * @param task The FutureTask to run * @return The queried task (to aid inline construction) */
Run the supplied FutureTask on the main thread. The method will block only if the current thread is the main thread
runOnUiThread
{ "repo_name": "mogoweb/chromium_webview", "path": "java/src/org/chromium/base/ThreadUtils.java", "license": "bsd-3-clause", "size": 6559 }
[ "java.util.concurrent.FutureTask" ]
import java.util.concurrent.FutureTask;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
366,250
private String getReportDesignName( InputOptions options ) { String reportDesignName = null; if ( options != null ) { HttpServletRequest request = (HttpServletRequest) options.getOption( InputOptions.OPT_REQUEST ); if ( request != null ) { ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute( IBirtConstants.ATTRIBUTE_BEAN ); assert attrBean != null; reportDesignName = attrBean.getReportDesignName( ); if ( reportDesignName != null ) { // if the report design name is not a valid file, then set // it to null if ( reportDesignName.endsWith( "\\" ) //$NON-NLS-1$ || reportDesignName.endsWith( "/" ) ) //$NON-NLS-1$ reportDesignName = null; } } } return reportDesignName; }
String function( InputOptions options ) { String reportDesignName = null; if ( options != null ) { HttpServletRequest request = (HttpServletRequest) options.getOption( InputOptions.OPT_REQUEST ); if ( request != null ) { ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute( IBirtConstants.ATTRIBUTE_BEAN ); assert attrBean != null; reportDesignName = attrBean.getReportDesignName( ); if ( reportDesignName != null ) { if ( reportDesignName.endsWith( "\\" ) reportDesignName.endsWith( "/" ) ) reportDesignName = null; } } } return reportDesignName; }
/** * Gets the report design name from the input options. * * @param options * the input options * @return the report design name if the request contains a valid name, * otherwise null */
Gets the report design name from the input options
getReportDesignName
{ "repo_name": "sguan-actuate/birt", "path": "viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java", "license": "epl-1.0", "size": 41374 }
[ "javax.servlet.http.HttpServletRequest", "org.eclipse.birt.report.IBirtConstants", "org.eclipse.birt.report.context.ViewerAttributeBean", "org.eclipse.birt.report.service.api.InputOptions" ]
import javax.servlet.http.HttpServletRequest; import org.eclipse.birt.report.IBirtConstants; import org.eclipse.birt.report.context.ViewerAttributeBean; import org.eclipse.birt.report.service.api.InputOptions;
import javax.servlet.http.*; import org.eclipse.birt.report.*; import org.eclipse.birt.report.context.*; import org.eclipse.birt.report.service.api.*;
[ "javax.servlet", "org.eclipse.birt" ]
javax.servlet; org.eclipse.birt;
2,303,114
@Test public void testOf() { BSNR nr = BSNR.of("000002091"); assertEquals("000002091", nr.toString()); }
void function() { BSNR nr = BSNR.of(STR); assertEquals(STR, nr.toString()); }
/** * Betriebsnummern koennen fuehrende Nullen enthalten. */
Betriebsnummern koennen fuehrende Nullen enthalten
testOf
{ "repo_name": "oboehm/jfachwert", "path": "src/test/java/de/jfachwert/med/BSNRTest.java", "license": "apache-2.0", "size": 2159 }
[ "org.testng.AssertJUnit" ]
import org.testng.AssertJUnit;
import org.testng.*;
[ "org.testng" ]
org.testng;
2,259,694
//#ifdef JAVA4 public synchronized double getDouble( String parameterName) throws SQLException { return getDouble(findParameterIndex(parameterName)); } //#endif JAVA4
synchronized double function( String parameterName) throws SQLException { return getDouble(findParameterIndex(parameterName)); }
/** * <!-- start generic documentation --> * * Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> * in the Java programming language. * * <!-- end generic documentation --> * * <!-- start release-specific documentation --> * <div class="ReleaseSpecificDocumentation"> * <h3>HSQLDB-Specific Information:</h3> <p> * * HSQLDB supports this feature. <p> * * </div> * <!-- end release-specific documentation --> * * @param parameterName the name of the parameter * @return the parameter value. If the value is SQL <code>NULL</code>, * the result is <code>0</code>. * @exception SQLException if a database access error occurs or * this method is called on a closed <code>CallableStatement</code> * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see #setDouble * @since JDK 1.4, HSQLDB 1.7.0 */
Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code> in the Java programming language. HSQLDB-Specific Information: HSQLDB supports this feature.
getDouble
{ "repo_name": "ifcharming/voltdb2.0", "path": "src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCCallableStatement.java", "license": "gpl-3.0", "size": 185755 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,458,769
public WebTestClient.ResponseSpec secure(String name, boolean expected) { boolean isSecure = getCookie(name).isSecure(); this.exchangeResult.assertWithDiagnostics(() -> { String message = getMessage(name) + " secure"; AssertionErrors.assertEquals(message, expected, isSecure); }); return this.responseSpec; }
WebTestClient.ResponseSpec function(String name, boolean expected) { boolean isSecure = getCookie(name).isSecure(); this.exchangeResult.assertWithDiagnostics(() -> { String message = getMessage(name) + STR; AssertionErrors.assertEquals(message, expected, isSecure); }); return this.responseSpec; }
/** * Assert a cookie's secure attribute. */
Assert a cookie's secure attribute
secure
{ "repo_name": "spring-projects/spring-framework", "path": "spring-test/src/main/java/org/springframework/test/web/reactive/server/CookieAssertions.java", "license": "apache-2.0", "size": 6957 }
[ "org.springframework.test.util.AssertionErrors" ]
import org.springframework.test.util.AssertionErrors;
import org.springframework.test.util.*;
[ "org.springframework.test" ]
org.springframework.test;
435,319
@NotNull String getContentId();
@NotNull String getContentId();
/** * Content ID of the attachment. Uniquely identifies an attachment. * * @return * The content ID like "foo-bar-zot@abc.com", without * surrounding '&lt;' and '>' used as the transfer syntax. */
Content ID of the attachment. Uniquely identifies an attachment
getContentId
{ "repo_name": "axDev-JDK/jaxws", "path": "src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/Attachment.java", "license": "gpl-2.0", "size": 2719 }
[ "com.sun.istack.internal.NotNull" ]
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.*;
[ "com.sun.istack" ]
com.sun.istack;
1,210,886
public MappedFieldType unmappedFieldType(String type) { final ImmutableMap<String, MappedFieldType> unmappedFieldMappers = this.unmappedFieldTypes; MappedFieldType fieldType = unmappedFieldMappers.get(type); if (fieldType == null) { final Mapper.TypeParser.ParserContext parserContext = documentMapperParser().parserContext(); Mapper.TypeParser typeParser = parserContext.typeParser(type); if (typeParser == null) { throw new IllegalArgumentException("No mapper found for type [" + type + "]"); } final Mapper.Builder<?, ?> builder = typeParser.parse("__anonymous_" + type, ImmutableMap.<String, Object>of(), parserContext); final BuilderContext builderContext = new BuilderContext(indexSettings, new ContentPath(1)); fieldType = ((FieldMapper)builder.build(builderContext)).fieldType(); // There is no need to synchronize writes here. In the case of concurrent access, we could just // compute some mappers several times, which is not a big deal this.unmappedFieldTypes = ImmutableMap.<String, MappedFieldType>builder() .putAll(unmappedFieldMappers) .put(type, fieldType) .build(); } return fieldType; }
MappedFieldType function(String type) { final ImmutableMap<String, MappedFieldType> unmappedFieldMappers = this.unmappedFieldTypes; MappedFieldType fieldType = unmappedFieldMappers.get(type); if (fieldType == null) { final Mapper.TypeParser.ParserContext parserContext = documentMapperParser().parserContext(); Mapper.TypeParser typeParser = parserContext.typeParser(type); if (typeParser == null) { throw new IllegalArgumentException(STR + type + "]"); } final Mapper.Builder<?, ?> builder = typeParser.parse(STR + type, ImmutableMap.<String, Object>of(), parserContext); final BuilderContext builderContext = new BuilderContext(indexSettings, new ContentPath(1)); fieldType = ((FieldMapper)builder.build(builderContext)).fieldType(); this.unmappedFieldTypes = ImmutableMap.<String, MappedFieldType>builder() .putAll(unmappedFieldMappers) .put(type, fieldType) .build(); } return fieldType; }
/** * Given a type (eg. long, string, ...), return an anonymous field mapper that can be used for search operations. */
Given a type (eg. long, string, ...), return an anonymous field mapper that can be used for search operations
unmappedFieldType
{ "repo_name": "hechunwen/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/mapper/MapperService.java", "license": "apache-2.0", "size": 28448 }
[ "com.google.common.collect.ImmutableMap", "org.elasticsearch.index.mapper.Mapper" ]
import com.google.common.collect.ImmutableMap; import org.elasticsearch.index.mapper.Mapper;
import com.google.common.collect.*; import org.elasticsearch.index.mapper.*;
[ "com.google.common", "org.elasticsearch.index" ]
com.google.common; org.elasticsearch.index;
844,254
private static String tryDecodeUri(String uri) { try { // try to decode as the uri may contain %20 for spaces etc uri = URLDecoder.decode(uri, "UTF-8"); } catch (Exception e) { LOG.trace("Error URL decoding uri using UTF-8 encoding: {}. This exception is ignored.", uri); // ignore } return uri; }
static String function(String uri) { try { uri = URLDecoder.decode(uri, "UTF-8"); } catch (Exception e) { LOG.trace(STR, uri); } return uri; }
/** * Tries decoding the uri. * * @param uri the uri * @return the decoded uri, or the original uri */
Tries decoding the uri
tryDecodeUri
{ "repo_name": "mattrpav/blueprint-test", "path": "blueprint-test/src/main/java/com/mediadriver/osgi/blueprint/test/BlueprintHelper.java", "license": "apache-2.0", "size": 30706 }
[ "java.net.URLDecoder" ]
import java.net.URLDecoder;
import java.net.*;
[ "java.net" ]
java.net;
1,663,939
public int getVarIndex(SnmpVarBind varbind);
int function(SnmpVarBind varbind);
/** * Returns the varbind index that should be embedded in an * SnmpStatusException for this particular varbind. * This does not necessarily correspond to the "real" * index value that will be returned in the result PDU. * * @param varbind The varbind for which the index value is * querried. Note that this varbind <b>must</b> have * been obtained from the enumeration returned by * <CODE>getElements()</CODE>, or from the vector * returned by <CODE>getSublist()</CODE>. * * @return The varbind index that should be embedded in an * SnmpStatusException for this particular varbind. */
Returns the varbind index that should be embedded in an SnmpStatusException for this particular varbind. This does not necessarily correspond to the "real" index value that will be returned in the result PDU
getVarIndex
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequest.java", "license": "gpl-2.0", "size": 6885 }
[ "com.sun.jmx.snmp.SnmpVarBind" ]
import com.sun.jmx.snmp.SnmpVarBind;
import com.sun.jmx.snmp.*;
[ "com.sun.jmx" ]
com.sun.jmx;
1,081,847
Pattern[] getPatternsWithColors(Hex... hexes) throws IOException;
Pattern[] getPatternsWithColors(Hex... hexes) throws IOException;
/** * A wrapper for {@link #getPatternsWithColors(int, Hex...)} (int)} which gets the first page. * * @param hexes * @return * @throws IOException when underlying {@link #executeRequest(ColourLoverRequest)} encounters an exception * @see #executeRequest * @see #getPatternsWithColors(int, Hex...) */
A wrapper for <code>#getPatternsWithColors(int, Hex...)</code> (int)} which gets the first page
getPatternsWithColors
{ "repo_name": "DFStoneburner/ColourLovers4J", "path": "src/main/java/stone/colour/services/PatternService.java", "license": "apache-2.0", "size": 7664 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,409,550
public Date engineGetCreationDate(String alias) { if (alias == null) { return null; } return new Date(); }
Date function(String alias) { if (alias == null) { return null; } return new Date(); }
/** * Returns the creation date of the entry identified by the given alias. * * @param alias the alias name * * @return the creation date of this entry, or null if the given alias does * not exist */
Returns the creation date of the entry identified by the given alias
engineGetCreationDate
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/windows/classes/sun/security/mscapi/KeyStore.java", "license": "gpl-2.0", "size": 30243 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,333,346
private boolean isSkippableKey(@NonNull String key) { return Arrays.asList(KEYS_TO_SKIP).contains(key); }
boolean function(@NonNull String key) { return Arrays.asList(KEYS_TO_SKIP).contains(key); }
/** * Determines if we need to skip a key due to Firebase restrictions. * * @param key The key to check if its skippable. * @return <code>true</code> if a key is skippable, <code>false</code> otherwise. */
Determines if we need to skip a key due to Firebase restrictions
isSkippableKey
{ "repo_name": "edx/edx-app-android", "path": "OpenEdXMobile/src/main/java/org/edx/mobile/module/analytics/FirebaseEvent.java", "license": "apache-2.0", "size": 9258 }
[ "androidx.annotation.NonNull", "java.util.Arrays" ]
import androidx.annotation.NonNull; import java.util.Arrays;
import androidx.annotation.*; import java.util.*;
[ "androidx.annotation", "java.util" ]
androidx.annotation; java.util;
969,792
public void updateChartData(List<YearSummary> inData, boolean savePosition) { SlidingCategoryDataset eventsDataset = (SlidingCategoryDataset) createEventsDataset(inData); SlidingCategoryDataset recordersDataset = (SlidingCategoryDataset) createRecordersDataset(inData); SlidingCategoryDataset samplesDataset = (SlidingCategoryDataset) createSamplesDataset(inData); if (savePosition && inData.size() > 0) { int index = ((SlidingCategoryDataset) getChart().getCategoryPlot().getDataset()).getFirstCategoryIndex(); eventsDataset.setFirstCategoryIndex(index); recordersDataset.setFirstCategoryIndex(index); samplesDataset.setFirstCategoryIndex(index); } getChart().getCategoryPlot().setDataset(0, eventsDataset); // Temporarily removing recorders dataset // getChart().getCategoryPlot().setDataset(1, recordersDataset); getChart().getCategoryPlot().setDataset(1, samplesDataset); updateMaximumRangeValue(inData); }
void function(List<YearSummary> inData, boolean savePosition) { SlidingCategoryDataset eventsDataset = (SlidingCategoryDataset) createEventsDataset(inData); SlidingCategoryDataset recordersDataset = (SlidingCategoryDataset) createRecordersDataset(inData); SlidingCategoryDataset samplesDataset = (SlidingCategoryDataset) createSamplesDataset(inData); if (savePosition && inData.size() > 0) { int index = ((SlidingCategoryDataset) getChart().getCategoryPlot().getDataset()).getFirstCategoryIndex(); eventsDataset.setFirstCategoryIndex(index); recordersDataset.setFirstCategoryIndex(index); samplesDataset.setFirstCategoryIndex(index); } getChart().getCategoryPlot().setDataset(0, eventsDataset); getChart().getCategoryPlot().setDataset(1, samplesDataset); updateMaximumRangeValue(inData); }
/** * This method updates the data in the graph which forces the graph to redraw. * * @param inData This is the list of the incoming YearSummary objects. It is the data used to update the graphs. * @param savePosition When savePosition is set to true then this method will automatically scroll to the section of the graph that was * viewable before calling this method. Otherwise when savePosition is false, the graph will scroll to the first year. */
This method updates the data in the graph which forces the graph to redraw
updateChartData
{ "repo_name": "petebrew/fhaes", "path": "fhaes/src/main/java/org/fhaes/fhrecorder/view/GraphSummaryOverlay.java", "license": "gpl-3.0", "size": 11359 }
[ "java.util.List", "org.fhaes.fhrecorder.util.YearSummary", "org.jfree.data.category.SlidingCategoryDataset" ]
import java.util.List; import org.fhaes.fhrecorder.util.YearSummary; import org.jfree.data.category.SlidingCategoryDataset;
import java.util.*; import org.fhaes.fhrecorder.util.*; import org.jfree.data.category.*;
[ "java.util", "org.fhaes.fhrecorder", "org.jfree.data" ]
java.util; org.fhaes.fhrecorder; org.jfree.data;
2,218,683
Slot getBase_Slot();
Slot getBase_Slot();
/** * Returns the value of the '<em><b>Base Slot</b></em>' reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Base Slot</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Base Slot</em>' reference. * @see #setBase_Slot(Slot) * @see FCM.FCMPackage#getInterceptorConfiguration_Base_Slot() * @model required="true" ordered="false" * @generated */
Returns the value of the 'Base Slot' reference. If the meaning of the 'Base Slot' reference isn't clear, there really should be more of a description here...
getBase_Slot
{ "repo_name": "RobotML/RobotML-SDK-Juno", "path": "plugins/robotml/com.cea.profiles.fcm/src/FCM/InterceptorConfiguration.java", "license": "epl-1.0", "size": 2802 }
[ "org.eclipse.uml2.uml.Slot" ]
import org.eclipse.uml2.uml.Slot;
import org.eclipse.uml2.uml.*;
[ "org.eclipse.uml2" ]
org.eclipse.uml2;
128,386
public static void main(String[] args) { CLIRefuseServer server = null; try { server = new CLIRefuseServer(); logger.info(CONST_MSG_MTA_OPEN); server.open(); } catch (MTAException e) { logger.debug(CONST_ERR_MTA_ERR, e); } } // public static void main(String[] args) CLIRefuseServer() throws MTAException { super(System.in, System.out); mta = new RefuseMTA("local.refuse.server"); }
static void function(String[] args) { CLIRefuseServer server = null; try { server = new CLIRefuseServer(); logger.info(CONST_MSG_MTA_OPEN); server.open(); } catch (MTAException e) { logger.debug(CONST_ERR_MTA_ERR, e); } } CLIRefuseServer() throws MTAException { super(System.in, System.out); mta = new RefuseMTA(STR); }
/** * Run a CLI SinkMTA */
Run a CLI SinkMTA
main
{ "repo_name": "technosf/SMuTPea", "path": "smutpea-servers/src/main/java/com/github/technosf/smutpea/server/example/CLIRefuseServer.java", "license": "apache-2.0", "size": 3104 }
[ "com.github.technosf.smutpea.core.exceptions.MTAException", "com.github.technosf.smutpea.mta.impl.RefuseMTA" ]
import com.github.technosf.smutpea.core.exceptions.MTAException; import com.github.technosf.smutpea.mta.impl.RefuseMTA;
import com.github.technosf.smutpea.core.exceptions.*; import com.github.technosf.smutpea.mta.impl.*;
[ "com.github.technosf" ]
com.github.technosf;
88,067
default void attach(Solution solution){ ref().plugMonitor((IMonitorSolution) solution::record); }
default void attach(Solution solution){ ref().plugMonitor((IMonitorSolution) solution::record); }
/** * Attach a solution recorder to this solver * @param solution solution object to be filled on solutions. */
Attach a solution recorder to this solver
attach
{ "repo_name": "chocoteam/choco3", "path": "src/main/java/org/chocosolver/solver/search/loop/monitors/ISearchMonitorFactory.java", "license": "bsd-3-clause", "size": 5104 }
[ "org.chocosolver.solver.Solution" ]
import org.chocosolver.solver.Solution;
import org.chocosolver.solver.*;
[ "org.chocosolver.solver" ]
org.chocosolver.solver;
1,501,579
@After public void tearDown() throws BadCredentialsException, MailboxException { deleteAllMailboxes(); MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test")); session.close(); entityManagerFactory.close(); }
void function() throws BadCredentialsException, MailboxException { deleteAllMailboxes(); MailboxSession session = getMailboxManager().createSystemSession("test", LoggerFactory.getLogger("Test")); session.close(); entityManagerFactory.close(); }
/** * Close the system session and entityManagerFactory * * @throws MailboxException * @throws BadCredentialsException */
Close the system session and entityManagerFactory
tearDown
{ "repo_name": "mbaechler/james-mailbox", "path": "jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java", "license": "apache-2.0", "size": 5888 }
[ "org.apache.james.mailbox.MailboxSession", "org.apache.james.mailbox.exception.BadCredentialsException", "org.apache.james.mailbox.exception.MailboxException", "org.slf4j.LoggerFactory" ]
import org.apache.james.mailbox.MailboxSession; import org.apache.james.mailbox.exception.BadCredentialsException; import org.apache.james.mailbox.exception.MailboxException; import org.slf4j.LoggerFactory;
import org.apache.james.mailbox.*; import org.apache.james.mailbox.exception.*; import org.slf4j.*;
[ "org.apache.james", "org.slf4j" ]
org.apache.james; org.slf4j;
1,194,858
void removeExpiration(String workspaceId) throws ServerException;
void removeExpiration(String workspaceId) throws ServerException;
/** * Removes workspace expiration time (basically used on ws stop). * * @param workspaceId workspace id to remove expiration * @throws ServerException when operation failed */
Removes workspace expiration time (basically used on ws stop)
removeExpiration
{ "repo_name": "codenvy/che", "path": "wsmaster/che-core-api-workspace-activity/src/main/java/org/eclipse/che/api/workspace/activity/WorkspaceActivityDao.java", "license": "epl-1.0", "size": 4936 }
[ "org.eclipse.che.api.core.ServerException" ]
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.*;
[ "org.eclipse.che" ]
org.eclipse.che;
2,770,173
public void encode(byte tag, OutputStream out) throws IOException { out.write(tag); out.write(derEncoding, 1, derEncoding.length -1); }
void function(byte tag, OutputStream out) throws IOException { out.write(tag); out.write(derEncoding, 1, derEncoding.length -1); }
/** * Put the DER encoding of this PKCS9 attribute set on an * DerOutputStream, tagged with the given implicit tag. * * @param tag the implicit tag to use in the DER encoding. * @param out the output stream on which to put the DER encoding. * * @exception IOException on output error. */
Put the DER encoding of this PKCS9 attribute set on an DerOutputStream, tagged with the given implicit tag
encode
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/sun/security/pkcs/PKCS9Attributes.java", "license": "mit", "size": 11969 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,615,322
private void indexMethods() { this.modFunctions = new HashMap<>(); this.constFunctions = new HashMap<>(); this.events = new HashMap<>(); ContractAbiMethod[] methods = contract.getInfo().getAbiDefinition(); try { for (ContractAbiMethod method : methods) { ObjectMapper mapper = new ObjectMapper(); Function function = Function.fromJsonInterface(mapper.writeValueAsString(method)); if (method.getType().equals("constructor")) { constructor = function; } else if (method.getType().equals("function")) { if (!method.isConstant()) { modFunctions.put(method.getName(), function); } else { constFunctions.put(method.getName(), function); } } else { events.put(method.getName(), function); } } } catch (JsonProcessingException ex) { ex.printStackTrace(); } }
void function() { this.modFunctions = new HashMap<>(); this.constFunctions = new HashMap<>(); this.events = new HashMap<>(); ContractAbiMethod[] methods = contract.getInfo().getAbiDefinition(); try { for (ContractAbiMethod method : methods) { ObjectMapper mapper = new ObjectMapper(); Function function = Function.fromJsonInterface(mapper.writeValueAsString(method)); if (method.getType().equals(STR)) { constructor = function; } else if (method.getType().equals(STR)) { if (!method.isConstant()) { modFunctions.put(method.getName(), function); } else { constFunctions.put(method.getName(), function); } } else { events.put(method.getName(), function); } } } catch (JsonProcessingException ex) { ex.printStackTrace(); } }
/** * called once to index functions by type. */
called once to index functions by type
indexMethods
{ "repo_name": "cegeka/tether", "path": "src/main/java/com/cegeka/tetherj/EthSmartContractFactory.java", "license": "apache-2.0", "size": 6709 }
[ "com.cegeka.tetherj.pojo.ContractAbiMethod", "com.fasterxml.jackson.core.JsonProcessingException", "com.fasterxml.jackson.databind.ObjectMapper", "java.util.HashMap", "org.ethereum.tether.core.CallTransaction" ]
import com.cegeka.tetherj.pojo.ContractAbiMethod; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; import org.ethereum.tether.core.CallTransaction;
import com.cegeka.tetherj.pojo.*; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import java.util.*; import org.ethereum.tether.core.*;
[ "com.cegeka.tetherj", "com.fasterxml.jackson", "java.util", "org.ethereum.tether" ]
com.cegeka.tetherj; com.fasterxml.jackson; java.util; org.ethereum.tether;
1,532,533
@Nullable public ECKey getConnectedKey(KeyBag keyBag) throws ScriptException { TransactionOutput connectedOutput = getConnectedOutput(); checkNotNull(connectedOutput, "Input is not connected so cannot retrieve key"); Script connectedScript = connectedOutput.getScriptPubKey(); if (connectedScript.isSentToAddress()) { byte[] addressBytes = connectedScript.getPubKeyHash(); return keyBag.findKeyFromPubHash(addressBytes); } else if (connectedScript.isSentToRawPubKey()) { byte[] pubkeyBytes = connectedScript.getPubKey(); return keyBag.findKeyFromPubKey(pubkeyBytes); } else { throw new ScriptException("Could not understand form of connected output script: " + connectedScript); } }
ECKey function(KeyBag keyBag) throws ScriptException { TransactionOutput connectedOutput = getConnectedOutput(); checkNotNull(connectedOutput, STR); Script connectedScript = connectedOutput.getScriptPubKey(); if (connectedScript.isSentToAddress()) { byte[] addressBytes = connectedScript.getPubKeyHash(); return keyBag.findKeyFromPubHash(addressBytes); } else if (connectedScript.isSentToRawPubKey()) { byte[] pubkeyBytes = connectedScript.getPubKey(); return keyBag.findKeyFromPubKey(pubkeyBytes); } else { throw new ScriptException(STR + connectedScript); } }
/** * Returns the ECKey identified in the connected output, for either pay-to-address scripts or pay-to-key scripts. * For P2SH scripts you can use {@link #getConnectedRedeemData(org.bitcoinj.wallet.KeyBag)} and then get the * key from RedeemData. * If the script form cannot be understood, throws ScriptException. * * @return an ECKey or null if the connected key cannot be found in the wallet. */
Returns the ECKey identified in the connected output, for either pay-to-address scripts or pay-to-key scripts. For P2SH scripts you can use <code>#getConnectedRedeemData(org.bitcoinj.wallet.KeyBag)</code> and then get the key from RedeemData. If the script form cannot be understood, throws ScriptException
getConnectedKey
{ "repo_name": "egordon/CoinJoin", "path": "lib/bitcoinj/bitcoinj-0.12-src/main/java/org/bitcoinj/core/TransactionOutPoint.java", "license": "apache-2.0", "size": 8849 }
[ "com.google.common.base.Preconditions", "org.bitcoinj.script.Script", "org.bitcoinj.wallet.KeyBag" ]
import com.google.common.base.Preconditions; import org.bitcoinj.script.Script; import org.bitcoinj.wallet.KeyBag;
import com.google.common.base.*; import org.bitcoinj.script.*; import org.bitcoinj.wallet.*;
[ "com.google.common", "org.bitcoinj.script", "org.bitcoinj.wallet" ]
com.google.common; org.bitcoinj.script; org.bitcoinj.wallet;
1,712,746
public void deleteSharedScope(String scopeName, String tenantDomain) throws APIManagementException { int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.DELETE_SHARED_SCOPE)) { try { connection.setAutoCommit(false); statement.setString(1, scopeName); statement.setInt(2, tenantId); statement.executeUpdate(); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException("Failed to delete Shared Scope : " + scopeName + " from tenant: " + tenantDomain, e); } } catch (SQLException e) { handleException("Failed to delete Shared Scope : " + scopeName + " from tenant: " + tenantDomain, e); } }
void function(String scopeName, String tenantDomain) throws APIManagementException { int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.DELETE_SHARED_SCOPE)) { try { connection.setAutoCommit(false); statement.setString(1, scopeName); statement.setInt(2, tenantId); statement.executeUpdate(); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException(STR + scopeName + STR + tenantDomain, e); } } catch (SQLException e) { handleException(STR + scopeName + STR + tenantDomain, e); } }
/** * Delete shared scope. * * @param scopeName shared scope name * @param tenantDomain tenant domain * @throws APIManagementException if an error occurs while removing shared scope */
Delete shared scope
deleteSharedScope
{ "repo_name": "fazlan-nazeem/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java", "license": "apache-2.0", "size": 821235 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants", "org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil", "org.wso2.carbon.apimgt.impl.utils.APIUtil" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil; import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import java.sql.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
1,115,951
protected Guid asGuidOr404(String id) { try { return asGuid(id); } catch (IllegalArgumentException iae) { throw new WebApplicationException(Response.Status.NOT_FOUND); } }
Guid function(String id) { try { return asGuid(id); } catch (IllegalArgumentException iae) { throw new WebApplicationException(Response.Status.NOT_FOUND); } }
/** * Convert a string to a Guid, or return a 404 response. * * If an invalid UUID is supplied to a sub-resource locator, this * method will cause us to return a 404 response via the sub-resource * constructor. * * @param id the incoming UUID * @return a Guid * @throws WebApplicationException a 404 response, if the UUID is invalid */
Convert a string to a Guid, or return a 404 response. If an invalid UUID is supplied to a sub-resource locator, this method will cause us to return a 404 response via the sub-resource constructor
asGuidOr404
{ "repo_name": "anjalshireesh/gluster-ovirt-poc", "path": "backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendResource.java", "license": "apache-2.0", "size": 11969 }
[ "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.Response", "org.ovirt.engine.core.compat.Guid" ]
import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import org.ovirt.engine.core.compat.Guid;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.ovirt.engine.core.compat.*;
[ "javax.ws", "org.ovirt.engine" ]
javax.ws; org.ovirt.engine;
1,329,252
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { searcherUtil.refreshIndexInformation(); LOG.debug("Updated index for searcher"); } catch (InvalidIndexException ex) { LOG.error("Refreshing of index in searcher was not successful\n" + ex); } }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { searcherUtil.refreshIndexInformation(); LOG.debug(STR); } catch (InvalidIndexException ex) { LOG.error(STR + ex); } }
/** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>GET</code> method
doGet
{ "repo_name": "codesearch-github/codesearch", "path": "src/searcher/src/main/java/org/codesearch/searcher/server/servlets/RefreshServlet.java", "license": "gpl-3.0", "size": 3364 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.codesearch.searcher.server.InvalidIndexException" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.codesearch.searcher.server.InvalidIndexException;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import org.codesearch.searcher.server.*;
[ "java.io", "javax.servlet", "org.codesearch.searcher" ]
java.io; javax.servlet; org.codesearch.searcher;
1,708,548
public static ArrayList<HashMap<String, Object>> getProductRows(String condition, String orderby) throws SQLException { return Product.getProductRows(condition, orderby, "ASC"); }
static ArrayList<HashMap<String, Object>> function(String condition, String orderby) throws SQLException { return Product.getProductRows(condition, orderby, "ASC"); }
/** * Return Array list of Hashmap key/value * * @param condition * @param orderby * @return * @throws SQLException */
Return Array list of Hashmap key/value
getProductRows
{ "repo_name": "Gami-404/OnlineShope", "path": "src/app/models/Product.java", "license": "mit", "size": 11897 }
[ "java.sql.SQLException", "java.util.ArrayList", "java.util.HashMap" ]
import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
925,337
public void setBatchRecordLimit(int batchRecordLimit) { scanBatchRecordLimit = Math.max(1, Math.min(batchRecordLimit, ValueVector.MAX_ROW_COUNT)); }
void function(int batchRecordLimit) { scanBatchRecordLimit = Math.max(1, Math.min(batchRecordLimit, ValueVector.MAX_ROW_COUNT)); }
/** * Specify a custom batch record count. This is the maximum number of records * per batch for this scan. Readers can adjust this, but the adjustment is capped * at the value specified here * * @param scanBatchSize maximum records per batch */
Specify a custom batch record count. This is the maximum number of records per batch for this scan. Readers can adjust this, but the adjustment is capped at the value specified here
setBatchRecordLimit
{ "repo_name": "Ben-Zvi/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/scan/project/ScanSchemaOrchestrator.java", "license": "apache-2.0", "size": 17570 }
[ "org.apache.drill.exec.vector.ValueVector" ]
import org.apache.drill.exec.vector.ValueVector;
import org.apache.drill.exec.vector.*;
[ "org.apache.drill" ]
org.apache.drill;
75,717
private void updateWaterCount() { int waterCount = PreferenceUtilities.getWaterCount(this); mWaterCountDisplay.setText(waterCount+""); }
void function() { int waterCount = PreferenceUtilities.getWaterCount(this); mWaterCountDisplay.setText(waterCount+""); }
/** * Updates the TextView to display the new water count from SharedPreferences */
Updates the TextView to display the new water count from SharedPreferences
updateWaterCount
{ "repo_name": "f1dz/ud851-Exercises", "path": "Lesson10-Hydration-Reminder/T10.02-Exercise-CreateNotification/app/src/main/java/com/example/android/background/MainActivity.java", "license": "apache-2.0", "size": 4531 }
[ "com.example.android.background.utilities.PreferenceUtilities" ]
import com.example.android.background.utilities.PreferenceUtilities;
import com.example.android.background.utilities.*;
[ "com.example.android" ]
com.example.android;
990,195
@Test public void testAddEntryNoRDNInEntry() throws Exception { DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE ); // Create a person Attributes person = new BasicAttributes( "objectClass", "inetOrgPerson", true ); person.get( "objectClass" ).add( "top" ); person.get( "objectClass" ).add( "person" ); person.get( "objectClass" ).add( "organizationalPerson" ); person.put( "sn", "Michael Jackson" ); person.put( "cn", "Jackson" ); DirContext michaelCtx = ctx.createSubcontext( "givenname=Michael", person ); assertNotNull( michaelCtx ); DirContext jackson = ( DirContext ) ctx.lookup( "givenname=Michael" ); person = jackson.getAttributes( "" ); javax.naming.directory.Attribute newOcls = person.get( "objectClass" ); String[] expectedOcls = { "top", "person", "organizationalPerson", "inetOrgPerson" }; for ( String name : expectedOcls ) { assertTrue( "object class " + name + " is present", newOcls.contains( name ) ); } javax.naming.directory.Attribute givenName = person.get( "givenname" ); assertEquals( "Michael", givenName.get() ); }
void function() throws Exception { DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE ); Attributes person = new BasicAttributes( STR, STR, true ); person.get( STR ).add( "top" ); person.get( STR ).add( STR ); person.get( STR ).add( STR ); person.put( "sn", STR ); person.put( "cn", STR ); DirContext michaelCtx = ctx.createSubcontext( STR, person ); assertNotNull( michaelCtx ); DirContext jackson = ( DirContext ) ctx.lookup( STR ); person = jackson.getAttributes( "" ); javax.naming.directory.Attribute newOcls = person.get( STR ); String[] expectedOcls = { "top", STR, STR, STR }; for ( String name : expectedOcls ) { assertTrue( "object class STR is presentSTRgivennameSTRMichael", givenName.get() ); }
/** * Create an entry a Rdn which is not present in the entry */
Create an entry a Rdn which is not present in the entry
testAddEntryNoRDNInEntry
{ "repo_name": "lucastheisen/apache-directory-server", "path": "server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java", "license": "apache-2.0", "size": 56338 }
[ "javax.naming.directory.Attributes", "javax.naming.directory.BasicAttributes", "javax.naming.directory.DirContext", "org.apache.directory.api.ldap.model.entry.Attribute", "org.apache.directory.server.integ.ServerIntegrationUtils", "org.junit.Assert" ]
import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.server.integ.ServerIntegrationUtils; import org.junit.Assert;
import javax.naming.directory.*; import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.server.integ.*; import org.junit.*;
[ "javax.naming", "org.apache.directory", "org.junit" ]
javax.naming; org.apache.directory; org.junit;
1,258,261
public ValueFunctionApproximation generateVFA(double defaultWeightValue){ return new LinearVFA(this, defaultWeightValue); }
ValueFunctionApproximation function(double defaultWeightValue){ return new LinearVFA(this, defaultWeightValue); }
/** * After all the tiling specifications have been set, this method can be called to produce a linear * VFA object. * @param defaultWeightValue the default value weights for the CMAC features will use. * @return a linear ValueFunctionApproximation object that uses this feature database */
After all the tiling specifications have been set, this method can be called to produce a linear VFA object
generateVFA
{ "repo_name": "nakulgopalan/burlap_pomdp_additions", "path": "src/burlap/behavior/singleagent/vfa/cmac/FVCMACFeatureDatabase.java", "license": "lgpl-3.0", "size": 13406 }
[ "burlap.behavior.singleagent.vfa.ValueFunctionApproximation", "burlap.behavior.singleagent.vfa.common.LinearVFA" ]
import burlap.behavior.singleagent.vfa.ValueFunctionApproximation; import burlap.behavior.singleagent.vfa.common.LinearVFA;
import burlap.behavior.singleagent.vfa.*; import burlap.behavior.singleagent.vfa.common.*;
[ "burlap.behavior.singleagent" ]
burlap.behavior.singleagent;
1,011,541
@Override public List<ITBook> getAllBooks() throws TransactionException { List<ITBook> BookList = new ArrayList<ITBook>(); String query = "SELECT * FROM "+TransactionManager.BOOK_ENTITY; try{ this.resultSet = this.statement.executeQuery(query); while (this.resultSet.next()) { ITBook book = TransferFactory.getInstance().getBookTransfer(); copyResultBookData(resultSet,book); BookList.add(book); } } catch (SQLException e) { throw new TransactionException(e); } finally { return BookList; } }
List<ITBook> function() throws TransactionException { List<ITBook> BookList = new ArrayList<ITBook>(); String query = STR+TransactionManager.BOOK_ENTITY; try{ this.resultSet = this.statement.executeQuery(query); while (this.resultSet.next()) { ITBook book = TransferFactory.getInstance().getBookTransfer(); copyResultBookData(resultSet,book); BookList.add(book); } } catch (SQLException e) { throw new TransactionException(e); } finally { return BookList; } }
/** * Searches all the Books stored at the DDBB * @return The <code>{@link ITBook}</code> list including all the Books; * <code>null</code> if no Book is found. * @throws TransactionException if a DDBB exception occurred */
Searches all the Books stored at the DDBB
getAllBooks
{ "repo_name": "pablo-albaladejo/javaee", "path": "Modulo1/BookStore/src/bookstore/integration/book/BookDAO.java", "license": "gpl-3.0", "size": 9044 }
[ "java.sql.SQLException", "java.util.ArrayList", "java.util.List" ]
import java.sql.SQLException; import java.util.ArrayList; import java.util.List;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
2,105,904
default void beforeMethod(final AdviceTargetObject target, final Method method, final Object[] args, final MethodInvocationResult result) { }
default void beforeMethod(final AdviceTargetObject target, final Method method, final Object[] args, final MethodInvocationResult result) { }
/** * Intercept the target method and weave the method before origin method. It will invoke before the origin calling. * * @param target the target object * @param method the target method * @param args all method arguments * @param result wrapped class of result to detect whether or not to execute the origin method */
Intercept the target method and weave the method before origin method. It will invoke before the origin calling
beforeMethod
{ "repo_name": "apache/incubator-shardingsphere", "path": "shardingsphere-agent/shardingsphere-agent-api/src/main/java/org/apache/shardingsphere/agent/api/advice/InstanceMethodAroundAdvice.java", "license": "apache-2.0", "size": 2754 }
[ "java.lang.reflect.Method", "org.apache.shardingsphere.agent.api.result.MethodInvocationResult" ]
import java.lang.reflect.Method; import org.apache.shardingsphere.agent.api.result.MethodInvocationResult;
import java.lang.reflect.*; import org.apache.shardingsphere.agent.api.result.*;
[ "java.lang", "org.apache.shardingsphere" ]
java.lang; org.apache.shardingsphere;
474,834
public void addElementGroup(JRElementGroup group) { addElementGroup(children.size(), group); }
void function(JRElementGroup group) { addElementGroup(children.size(), group); }
/** * Adds an element group to the frame. * * @param group the element group to add */
Adds an element group to the frame
addElementGroup
{ "repo_name": "aleatorio12/ProVentasConnector", "path": "jasperreports-6.2.1-project/jasperreports-6.2.1/src/net/sf/jasperreports/engine/design/JRDesignFrame.java", "license": "gpl-3.0", "size": 8988 }
[ "net.sf.jasperreports.engine.JRElementGroup" ]
import net.sf.jasperreports.engine.JRElementGroup;
import net.sf.jasperreports.engine.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
1,077,139
public static byte[] getNTLM2SessionResponse(String password, byte[] challenge, byte[] clientNonce) throws Exception { byte[] ntlmHash = ntlmHash(password); MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(challenge); md5.update(clientNonce); byte[] sessionHash = new byte[8]; System.arraycopy(md5.digest(), 0, sessionHash, 0, 8); return lmResponse(ntlmHash, sessionHash); }
static byte[] function(String password, byte[] challenge, byte[] clientNonce) throws Exception { byte[] ntlmHash = ntlmHash(password); MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(challenge); md5.update(clientNonce); byte[] sessionHash = new byte[8]; System.arraycopy(md5.digest(), 0, sessionHash, 0, 8); return lmResponse(ntlmHash, sessionHash); }
/** * Calculates the NTLM2 Session Response for the given challenge, using the * specified password and client nonce. * * @param password The user's password. * @param challenge The Type 2 challenge from the server. * @param clientNonce The random 8-byte client nonce. * * @return The NTLM2 Session Response. This is placed in the NTLM * response field of the Type 3 message; the LM response field contains * the client nonce, null-padded to 24 bytes. */
Calculates the NTLM2 Session Response for the given challenge, using the specified password and client nonce
getNTLM2SessionResponse
{ "repo_name": "sardine/mina-ja", "path": "src/mina-core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java", "license": "apache-2.0", "size": 16604 }
[ "java.security.MessageDigest" ]
import java.security.MessageDigest;
import java.security.*;
[ "java.security" ]
java.security;
342,377
public HidModel sendError(String hid, ErrorModel model) { String method = "sendError"; try { URI uri = buildUri(SEND_ERROR_URL.replace("{hid}", hid)); HidModel result = execute(new HttpPost(uri), JsonUtils.toJson(model), HidModel.class); log(method, result); return result; } catch (Throwable e) { throw handleException(e); } }
HidModel function(String hid, ErrorModel model) { String method = STR; try { URI uri = buildUri(SEND_ERROR_URL.replace("{hid}", hid)); HidModel result = execute(new HttpPost(uri), JsonUtils.toJson(model), HidModel.class); log(method, result); return result; } catch (Throwable e) { throw handleException(e); } }
/** * Sends POST request to submit an error * * @param model {@link ErrorModel} content of the error (code and message) * * @return {@link HidModel} containing external {@code hid} of the created audit * log * * @throws AcnClientException if request failed */
Sends POST request to submit an error
sendError
{ "repo_name": "arrow-acs/acn-sdk-java", "path": "acn-client/src/main/java/com/arrow/acn/client/api/DeviceApi.java", "license": "apache-2.0", "size": 13158 }
[ "com.arrow.acs.JsonUtils", "com.arrow.acs.client.model.ErrorModel", "com.arrow.acs.client.model.HidModel", "org.apache.http.client.methods.HttpPost" ]
import com.arrow.acs.JsonUtils; import com.arrow.acs.client.model.ErrorModel; import com.arrow.acs.client.model.HidModel; import org.apache.http.client.methods.HttpPost;
import com.arrow.acs.*; import com.arrow.acs.client.model.*; import org.apache.http.client.methods.*;
[ "com.arrow.acs", "org.apache.http" ]
com.arrow.acs; org.apache.http;
1,922,480
void saveStatisticsForVds(VdsNetworkStatistics stats);
void saveStatisticsForVds(VdsNetworkStatistics stats);
/** * Saves the specified statistics * * @param stats * the statistics */
Saves the specified statistics
saveStatisticsForVds
{ "repo_name": "jtux270/translate", "path": "ovirt/3.6_source/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDao.java", "license": "gpl-3.0", "size": 6660 }
[ "org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics" ]
import org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics;
import org.ovirt.engine.core.common.businessentities.network.*;
[ "org.ovirt.engine" ]
org.ovirt.engine;
2,087,461
public Set<Host> loadHosts(String eid, String serviceName);
Set<Host> function(String eid, String serviceName);
/** * Load local hosts * * @param eid the tc Runtime instance id * @param serviceName the service's human id * @return set of local hosts */
Load local hosts
loadHosts
{ "repo_name": "pivotal/tcs-hq-management-plugin", "path": "com.springsource.hq.plugin.tcserver.serverconfig.web/src/main/java/com/springsource/hq/plugin/tcserver/serverconfig/web/services/SettingsService.java", "license": "gpl-2.0", "size": 15742 }
[ "com.springsource.hq.plugin.tcserver.serverconfig.services.engine.Host", "java.util.Set" ]
import com.springsource.hq.plugin.tcserver.serverconfig.services.engine.Host; import java.util.Set;
import com.springsource.hq.plugin.tcserver.serverconfig.services.engine.*; import java.util.*;
[ "com.springsource.hq", "java.util" ]
com.springsource.hq; java.util;
2,501,639
NodeAVL findNode(Session session, PersistentStore store, Object data, int compareType, int readMode) { readLock.lock(); try { NodeAVL x = getAccessor(store); NodeAVL n = null; NodeAVL result = null; Row currentRow = null; while (x != null) { currentRow = x.getRow(store); int i = colTypes[0].compare(session, data, currentRow.getData()[colIndex[0]]); switch (compareType) { case OpTypes.IS_NULL : case OpTypes.EQUAL : { if (i == 0) { result = x; n = x.getLeft(store); break; } else if (i > 0) { n = x.getRight(store); } else if (i < 0) { n = x.getLeft(store); } break; } case OpTypes.NOT : case OpTypes.GREATER : { if (i >= 0) { n = x.getRight(store); } else { result = x; n = x.getLeft(store); } break; } case OpTypes.GREATER_EQUAL : { if (i > 0) { n = x.getRight(store); } else { result = x; n = x.getLeft(store); } break; } default : Error.runtimeError(ErrorCode.U_S0500, "Index"); } if (n == null) { break; } x = n; } // MVCC 190 if (session == null) { return result; } while (result != null) { currentRow = result.getRow(store); if (session.database.txManager.canRead(session, currentRow, readMode, colIndex)) { break; } result = next(store, result); if (compareType == OpTypes.EQUAL) { if (colTypes[0].compare( session, data, currentRow.getData()[colIndex[0]]) != 0) { result = null; break; } } } return result; } finally { readLock.unlock(); } }
NodeAVL findNode(Session session, PersistentStore store, Object data, int compareType, int readMode) { readLock.lock(); try { NodeAVL x = getAccessor(store); NodeAVL n = null; NodeAVL result = null; Row currentRow = null; while (x != null) { currentRow = x.getRow(store); int i = colTypes[0].compare(session, data, currentRow.getData()[colIndex[0]]); switch (compareType) { case OpTypes.IS_NULL : case OpTypes.EQUAL : { if (i == 0) { result = x; n = x.getLeft(store); break; } else if (i > 0) { n = x.getRight(store); } else if (i < 0) { n = x.getLeft(store); } break; } case OpTypes.NOT : case OpTypes.GREATER : { if (i >= 0) { n = x.getRight(store); } else { result = x; n = x.getLeft(store); } break; } case OpTypes.GREATER_EQUAL : { if (i > 0) { n = x.getRight(store); } else { result = x; n = x.getLeft(store); } break; } default : Error.runtimeError(ErrorCode.U_S0500, "Index"); } if (n == null) { break; } x = n; } if (session == null) { return result; } while (result != null) { currentRow = result.getRow(store); if (session.database.txManager.canRead(session, currentRow, readMode, colIndex)) { break; } result = next(store, result); if (compareType == OpTypes.EQUAL) { if (colTypes[0].compare( session, data, currentRow.getData()[colIndex[0]]) != 0) { result = null; break; } } } return result; } finally { readLock.unlock(); } }
/** * Finds a match with a value * * @param session Session * @param store PersistentStore * @param data value data for the index columns * @param compareType int * @param readMode int * @return matching node or null */
Finds a match with a value
findNode
{ "repo_name": "RabadanLab/Pegasus", "path": "resources/hsqldb-2.2.7/hsqldb/src/org/hsqldb/index/IndexAVL.java", "license": "mit", "size": 52803 }
[ "org.hsqldb.OpTypes", "org.hsqldb.Row", "org.hsqldb.Session", "org.hsqldb.error.Error", "org.hsqldb.error.ErrorCode", "org.hsqldb.persist.PersistentStore" ]
import org.hsqldb.OpTypes; import org.hsqldb.Row; import org.hsqldb.Session; import org.hsqldb.error.Error; import org.hsqldb.error.ErrorCode; import org.hsqldb.persist.PersistentStore;
import org.hsqldb.*; import org.hsqldb.error.*; import org.hsqldb.persist.*;
[ "org.hsqldb", "org.hsqldb.error", "org.hsqldb.persist" ]
org.hsqldb; org.hsqldb.error; org.hsqldb.persist;
693,472
@Override default Object productElement(int n) { switch (n) { case 0: return _1(); case 1: return _2(); case 2: return _3(); default: throw new IndexOutOfBoundsException(Integer.toString(n)); } }
default Object productElement(int n) { switch (n) { case 0: return _1(); case 1: return _2(); case 2: return _3(); default: throw new IndexOutOfBoundsException(Integer.toString(n)); } }
/** * The n<sup>th</sup> element of this product, 0-based. * * @param n the index of the element to return * * @return the element {@code n} elements after the first element */
The nth element of this product, 0-based
productElement
{ "repo_name": "GlacialThorns/Glacial-Java-Kotlin", "path": "deziras/src/main/java/org/deziras/Product3.java", "license": "gpl-3.0", "size": 1123 }
[ "org.deziras.util.IndexOutOfBoundsException" ]
import org.deziras.util.IndexOutOfBoundsException;
import org.deziras.util.*;
[ "org.deziras.util" ]
org.deziras.util;
2,355,624
public void setSearchCriterias(List<SearchCriteria> searchCriterias);
void function(List<SearchCriteria> searchCriterias);
/** * Sets the search criterias. * * @param searchCriterias * the new search criterias */
Sets the search criterias
setSearchCriterias
{ "repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint", "path": "mat/src/mat/dao/IQuery.java", "license": "apache-2.0", "size": 1821 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,600,799
@Deprecated public Boolean isPreferredShortInCountry(String country) { if (!StringUtils.isBlank(country) && this.locale != null) { if (isShort() && this.locale.getCountry().equals(country)) { return true; } } return false; }
Boolean function(String country) { if (!StringUtils.isBlank(country) && this.locale != null) { if (isShort() && this.locale.getCountry().equals(country)) { return true; } } return false; }
/** * Checks if this conceptName is a short name in a locale with a matching country * * @deprecated since version 1.7 * @see Concept#getShortNameInLocale(Locale) * @see Concept#getShortestName(Locale, Boolean) * @param country ISO 639 2-letter code for a country * @return true if the name is a short name in a locale with a matching country code, otherwise * false */
Checks if this conceptName is a short name in a locale with a matching country
isPreferredShortInCountry
{ "repo_name": "Winbobob/openmrs-core", "path": "api/src/main/java/org/openmrs/ConceptName.java", "license": "mpl-2.0", "size": 18518 }
[ "org.apache.commons.lang.StringUtils" ]
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
2,898,084
public void setCurrentAmountField(Field currentAmountField) { this.currentAmountField = currentAmountField; }
void function(Field currentAmountField) { this.currentAmountField = currentAmountField; }
/** * Sets the currentAmountField attribute value. * @param currentAmountField The currentAmountField to set. */
Sets the currentAmountField attribute value
setCurrentAmountField
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/sys/document/web/AccountingLineViewCurrentBaseAmount.java", "license": "agpl-3.0", "size": 14624 }
[ "org.kuali.rice.kns.web.ui.Field" ]
import org.kuali.rice.kns.web.ui.Field;
import org.kuali.rice.kns.web.ui.*;
[ "org.kuali.rice" ]
org.kuali.rice;
919,623
protected Constraint makeOpposite() { return new Opposite(this); }
Constraint function() { return new Opposite(this); }
/** * Make the opposite constraint of this. * BEWARE: this method should never be called by the user * but it can be overridden to provide better constraint negations */
Make the opposite constraint of this. but it can be overridden to provide better constraint negations
makeOpposite
{ "repo_name": "chocoteam/choco3", "path": "src/main/java/org/chocosolver/solver/constraints/Constraint.java", "license": "bsd-3-clause", "size": 13379 }
[ "org.chocosolver.solver.constraints.reification.Opposite" ]
import org.chocosolver.solver.constraints.reification.Opposite;
import org.chocosolver.solver.constraints.reification.*;
[ "org.chocosolver.solver" ]
org.chocosolver.solver;
2,013,670
private void translateImageToCenterTouchPosition(float t) { float targetX = startTouch.x + t * (endTouch.x - startTouch.x); float targetY = startTouch.y + t * (endTouch.y - startTouch.y); PointF curr = transformCoordBitmapToTouch(bitmapX, bitmapY); matrix.postTranslate(targetX - curr.x, targetY - curr.y); }
void function(float t) { float targetX = startTouch.x + t * (endTouch.x - startTouch.x); float targetY = startTouch.y + t * (endTouch.y - startTouch.y); PointF curr = transformCoordBitmapToTouch(bitmapX, bitmapY); matrix.postTranslate(targetX - curr.x, targetY - curr.y); }
/** * Interpolate between where the image should start and end in order to translate * the image so that the point that is touched is what ends up centered at the end * of the zoom. * @param t */
Interpolate between where the image should start and end in order to translate the image so that the point that is touched is what ends up centered at the end of the zoom
translateImageToCenterTouchPosition
{ "repo_name": "Allesad/HabraClient", "path": "app/src/main/java/com/allesad/habraclient/components/views/TouchImageView.java", "license": "apache-2.0", "size": 31559 }
[ "android.graphics.PointF" ]
import android.graphics.PointF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,958,844
public static Map<String, SegmentName> getAllowedConsumingStateSegments(ExternalView externalView, Map<String, SortedSet<SegmentName>> sortedSegmentsByPartition) { Map<String, SegmentName> allowedSegmentInConsumingStateByPartition = new HashMap<>(); for (String partition : sortedSegmentsByPartition.keySet()) { SortedSet<SegmentName> sortedSegmentsForPartition = sortedSegmentsByPartition.get(partition); SegmentName lastAllowedSegmentInConsumingState = null; for (SegmentName segmentName : sortedSegmentsForPartition) { Map<String, String> helixPartitionState = externalView.getStateMap(segmentName.getSegmentName()); boolean allInConsumingState = true; int replicasInConsumingState = 0; // Only keep the segment if all replicas have it in CONSUMING state for (String externalViewState : helixPartitionState.values()) { // Ignore ERROR state if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.ERROR)) { continue; } // Not all segments are in CONSUMING state, therefore don't consider the last segment assignable to CONSUMING // replicas if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.ONLINE)) { allInConsumingState = false; break; } // Otherwise count the replica as being in CONSUMING state if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.CONSUMING)) { replicasInConsumingState++; } } // If all replicas have this segment in consuming state (and not all of them are in ERROR state), then pick this // segment to be the last allowed segment to be in CONSUMING state if (allInConsumingState && 0 < replicasInConsumingState) { lastAllowedSegmentInConsumingState = segmentName; break; } } if (lastAllowedSegmentInConsumingState != null) { allowedSegmentInConsumingStateByPartition.put(partition, lastAllowedSegmentInConsumingState); } } return allowedSegmentInConsumingStateByPartition; }
static Map<String, SegmentName> function(ExternalView externalView, Map<String, SortedSet<SegmentName>> sortedSegmentsByPartition) { Map<String, SegmentName> allowedSegmentInConsumingStateByPartition = new HashMap<>(); for (String partition : sortedSegmentsByPartition.keySet()) { SortedSet<SegmentName> sortedSegmentsForPartition = sortedSegmentsByPartition.get(partition); SegmentName lastAllowedSegmentInConsumingState = null; for (SegmentName segmentName : sortedSegmentsForPartition) { Map<String, String> helixPartitionState = externalView.getStateMap(segmentName.getSegmentName()); boolean allInConsumingState = true; int replicasInConsumingState = 0; for (String externalViewState : helixPartitionState.values()) { if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.ERROR)) { continue; } if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.ONLINE)) { allInConsumingState = false; break; } if (externalViewState.equalsIgnoreCase( CommonConstants.Helix.StateModel.RealtimeSegmentOnlineOfflineStateModel.CONSUMING)) { replicasInConsumingState++; } } if (allInConsumingState && 0 < replicasInConsumingState) { lastAllowedSegmentInConsumingState = segmentName; break; } } if (lastAllowedSegmentInConsumingState != null) { allowedSegmentInConsumingStateByPartition.put(partition, lastAllowedSegmentInConsumingState); } } return allowedSegmentInConsumingStateByPartition; }
/** * Compute the map of allowed 'consuming' segments for each partition. * * @param externalView helix external view * @param sortedSegmentsByPartition map of partition to sorted set of segment names. * @return map of allowed consuming segment for each partition for routing. */
Compute the map of allowed 'consuming' segments for each partition
getAllowedConsumingStateSegments
{ "repo_name": "apucher/pinot", "path": "pinot-broker/src/main/java/com/linkedin/pinot/broker/routing/builder/LowLevelRoutingTableBuilderUtil.java", "license": "apache-2.0", "size": 3673 }
[ "com.linkedin.pinot.common.utils.CommonConstants", "com.linkedin.pinot.common.utils.SegmentName", "java.util.HashMap", "java.util.Map", "java.util.SortedSet", "org.apache.helix.model.ExternalView" ]
import com.linkedin.pinot.common.utils.CommonConstants; import com.linkedin.pinot.common.utils.SegmentName; import java.util.HashMap; import java.util.Map; import java.util.SortedSet; import org.apache.helix.model.ExternalView;
import com.linkedin.pinot.common.utils.*; import java.util.*; import org.apache.helix.model.*;
[ "com.linkedin.pinot", "java.util", "org.apache.helix" ]
com.linkedin.pinot; java.util; org.apache.helix;
2,288,306
public void move(Point screenLocation) { if (origin == null) { origin = screenLocation; } dragImage.setLocation(screenLocation.x, screenLocation.y); }
void function(Point screenLocation) { if (origin == null) { origin = screenLocation; } dragImage.setLocation(screenLocation.x, screenLocation.y); }
/** Move the ghosted image to the requested location. * @param screenLocation Where to draw the image, in screen coordinates */
Move the ghosted image to the requested location
move
{ "repo_name": "trejkaz/jna", "path": "contrib/platform/src/com/sun/jna/platform/dnd/GhostedDragImage.java", "license": "lgpl-2.1", "size": 5785 }
[ "java.awt.Point" ]
import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,771,226
@Test(groups = { "wso2.esb" }, description = "Data-mapper conversion of input xml messages with underscore " + "element names for xml messages with element names with underscore") public void testXmlWithUnderscoreToXmlWithUnderscore() throws Exception { uploadResourcesToGovernanceRegistry(REGISTRY_ROOT_PATH + "xml_un_to_xml_un/", ARTIFACT_ROOT_PATH + "xml_un_to_xml_un" + File.separator); String expectedResponse = "<test xmlns:sf=\"urn:sobject.partner.soap.sforce.com\"" + " xmlns:axis2ns11=\"urn:partner.soap.sforce.com\"" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><axis2ns11:records_un " + "xsi:type=\"sf:sObject\"><sf:type>Account</sf:type><sf:Id>001E0000002SFO2IAO</sf:Id>" + "<sf:CreatedDate>2011-03-15T00:15:00.000Z</sf:CreatedDate><sf:Name>WSO2</sf:Name>" + "</axis2ns11:records_un></test>"; String request = "<test>\n" + " <axis2ns11:records_un xmlns:axis2ns11=\"urn:partner.soap.sforce.com\" " + "xmlns:sf=\"urn:sobject.partner.soap.sforce.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:type=\"sf:sObject\">\n" + " <sf:type xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">Account</sf:type>\n" + " <sf:Id xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">001E0000002SFO2IAO</sf:Id>\n" + " <sf:CreatedDate xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">" + "2011-03-15T00:15:00.000Z</sf:CreatedDate>\n" + " <sf:Id xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">001E0000002SFO2IAO</sf:Id>\n" + " <sf:Name xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">WSO2</sf:Name>\n" + " </axis2ns11:records_un>\n" + "</test>"; String response = sendRequest( getProxyServiceURLHttp("dataMapperXmlWithUnderscoreToXmlWithUnderscoreTestProxy"), request, "text/xml"); Assert.assertEquals(response,expectedResponse); }
@Test(groups = { STR }, description = STR + STR) void function() throws Exception { uploadResourcesToGovernanceRegistry(REGISTRY_ROOT_PATH + STR, ARTIFACT_ROOT_PATH + STR + File.separator); String expectedResponse = STRurn:sobject.partner.soap.sforce.com\STR xmlns:axis2ns11=\"urn:partner.soap.sforce.com\STR xmlns:xsi=\STRxsi:type=\STR><sf:type>Account</sf:type><sf:Id>001E0000002SFO2IAO</sf:Id>STR<sf:CreatedDate>2011-03-15T00:15:00.000Z</sf:CreatedDate><sf:Name>WSO2</sf:Name>STR</axis2ns11:records_un></test>STR<test>\nSTR <axis2ns11:records_un xmlns:axis2ns11=\STR STRxmlns:sf=\STR xmlns:xsi=\STR xsi:type=\STR>\nSTR <sf:type xmlns:sf=\STR>Account</sf:type>\nSTR <sf:Id xmlns:sf=\STR>001E0000002SFO2IAO</sf:Id>\nSTR <sf:CreatedDate xmlns:sf=\STR>STR2011-03-15T00:15:00.000Z</sf:CreatedDate>\nSTR <sf:Id xmlns:sf=\STR>001E0000002SFO2IAO</sf:Id>\nSTR <sf:Name xmlns:sf=\STR>WSO2</sf:Name>\nSTR </axis2ns11:records_un>\nSTR</test>STRdataMapperXmlWithUnderscoreToXmlWithUnderscoreTestProxySTRtext/xml"); Assert.assertEquals(response,expectedResponse); }
/** * This method contains the test case for mapping single xml object with elements containing * underscore in name to a single xml object with elements containing underscore in name * * @throws Exception */
This method contains the test case for mapping single xml object with elements containing underscore in name to a single xml object with elements containing underscore in name
testXmlWithUnderscoreToXmlWithUnderscore
{ "repo_name": "milindaperera/product-ei", "path": "integration/mediation-tests/tests-mediator-2/src/test/java/org/wso2/carbon/esb/mediator/test/datamapper/DataMapperSimpleTestCase.java", "license": "apache-2.0", "size": 14802 }
[ "java.io.File", "org.testng.Assert", "org.testng.annotations.Test" ]
import java.io.File; import org.testng.Assert; import org.testng.annotations.Test;
import java.io.*; import org.testng.*; import org.testng.annotations.*;
[ "java.io", "org.testng", "org.testng.annotations" ]
java.io; org.testng; org.testng.annotations;
1,114,155
public void publish(WorkUnitState state) throws IOException { publishMetadata(state); publishData(state); }
void function(WorkUnitState state) throws IOException { publishMetadata(state); publishData(state); }
/** * First publish the metadata via {@link DataPublisher#publishMetadata(WorkUnitState)}, and then publish the output data * via the {@link DataPublisher#publishData(WorkUnitState)} method. * * @param state is a {@link WorkUnitState}. * @throws IOException if there is a problem with publishing the metadata or the data. */
First publish the metadata via <code>DataPublisher#publishMetadata(WorkUnitState)</code>, and then publish the output data via the <code>DataPublisher#publishData(WorkUnitState)</code> method
publish
{ "repo_name": "slietz/gobblin", "path": "gobblin-api/src/main/java/gobblin/publisher/DataPublisher.java", "license": "apache-2.0", "size": 4127 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,335,277
public final void parse( URL url ) throws IOException, ParsingException { parse( url.openStream() ); }
final void function( URL url ) throws IOException, ParsingException { parse( url.openStream() ); }
/** * Parses the given file. * * @param url * * @throws IOException * @throws ParsingException */
Parses the given file
parse
{ "repo_name": "CTDP/TGM-Utils", "path": "src/net/ctdp/tgmutils/io/AbstractIniParser.java", "license": "mit", "size": 9493 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
486,789
public @NotNull Builder setTracingContext(TracingContext tracingContext) { this.tracingContext = tracingContext; return this; }
@NotNull Builder function(TracingContext tracingContext) { this.tracingContext = tracingContext; return this; }
/** * As of v.0.8.5, default {@link TracingContext} implementation will be automatically provided when a non-null * {@link Tracer} instance is set via {@link #setTracer(Tracer)}. * This method can still be used to provide a custom {@link TracingContext} implementation. */
As of v.0.8.5, default <code>TracingContext</code> implementation will be automatically provided when a non-null <code>Tracer</code> instance is set via <code>#setTracer(Tracer)</code>. This method can still be used to provide a custom <code>TracingContext</code> implementation
setTracingContext
{ "repo_name": "uber/tchannel-java", "path": "tchannel-core/src/main/java/com/uber/tchannel/api/TChannel.java", "license": "mit", "size": 20176 }
[ "com.uber.tchannel.tracing.TracingContext", "org.jetbrains.annotations.NotNull" ]
import com.uber.tchannel.tracing.TracingContext; import org.jetbrains.annotations.NotNull;
import com.uber.tchannel.tracing.*; import org.jetbrains.annotations.*;
[ "com.uber.tchannel", "org.jetbrains.annotations" ]
com.uber.tchannel; org.jetbrains.annotations;
948,264
private void addItemsToEditMenu() { this.backAction = new JMenuItem("Back"); this.frontAction = new JMenuItem("forward"); this.jMenu2.add(this.backAction); this.jMenu2.add(this.frontAction); }
void function() { this.backAction = new JMenuItem("Back"); this.frontAction = new JMenuItem(STR); this.jMenu2.add(this.backAction); this.jMenu2.add(this.frontAction); }
/** * Method for initializing and inserting edit menu items. */
Method for initializing and inserting edit menu items
addItemsToEditMenu
{ "repo_name": "karelhala/bachelor_thesis", "path": "source/BT/src/GUI/MyMenuBar.java", "license": "gpl-2.0", "size": 9128 }
[ "javax.swing.JMenuItem" ]
import javax.swing.JMenuItem;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,217,625
public void removeConnectionListener(ConnectionListener listener) { connectionListeners.remove(listener); if(null != server) { server.removeConnectionListener(listener); } }
void function(ConnectionListener listener) { connectionListeners.remove(listener); if(null != server) { server.removeConnectionListener(listener); } }
/** * Removes a previously registered connection listener. * @param listener */
Removes a previously registered connection listener
removeConnectionListener
{ "repo_name": "AscariaQuynn/ZoneOfUprising-Central", "path": "src/cz/ascaria/network/central/ServerWrapper.java", "license": "bsd-3-clause", "size": 12040 }
[ "com.jme3.network.ConnectionListener" ]
import com.jme3.network.ConnectionListener;
import com.jme3.network.*;
[ "com.jme3.network" ]
com.jme3.network;
1,929,879
public static int convertDateToProleptic(int hybrid) { int proleptic = hybrid; if (hybrid < SWITCHOVER_DAYS) { String dateStr = HYBRID_DATE_FORMAT.format(LocalDate.ofEpochDay(proleptic)); proleptic = (int) LocalDate.from(PROLEPTIC_DATE_FORMAT.parse(dateStr)).toEpochDay(); } return proleptic; }
static int function(int hybrid) { int proleptic = hybrid; if (hybrid < SWITCHOVER_DAYS) { String dateStr = HYBRID_DATE_FORMAT.format(LocalDate.ofEpochDay(proleptic)); proleptic = (int) LocalDate.from(PROLEPTIC_DATE_FORMAT.parse(dateStr)).toEpochDay(); } return proleptic; }
/** * Convert an epoch day from the hybrid Julian/Gregorian calendar to the * proleptic Gregorian. * @param hybrid day of epoch in the hybrid Julian/Gregorian * @return day of epoch in the proleptic Gregorian */
Convert an epoch day from the hybrid Julian/Gregorian calendar to the proleptic Gregorian
convertDateToProleptic
{ "repo_name": "apache/orc", "path": "java/core/src/java/org/apache/orc/impl/DateUtils.java", "license": "apache-2.0", "size": 8269 }
[ "java.time.LocalDate" ]
import java.time.LocalDate;
import java.time.*;
[ "java.time" ]
java.time;
1,082,418
@FIXVersion(introduced="5.0") @TagNumRef(tagNum=TagNum.UnderlyingAllocationPercent) public Double getUnderlyingAllocationPercent() { return underlyingAllocationPercent; }
@FIXVersion(introduced="5.0") @TagNumRef(tagNum=TagNum.UnderlyingAllocationPercent) Double function() { return underlyingAllocationPercent; }
/** * Message field getter. * @return field value */
Message field getter
getUnderlyingAllocationPercent
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/comp/UnderlyingInstrument.java", "license": "gpl-3.0", "size": 91408 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
711,058
void render(String key, String value, WebuiRequestContext context) throws IOException, Exception;
void render(String key, String value, WebuiRequestContext context) throws IOException, Exception;
/** * Render the value control. At this point the value field already rendered on the page and writer stands * just after it. * * @param key the key * @param value the value to which add a control * @param context the WebUI context * @throws IOException Signals that an I/O exception has occurred. * @throws Exception the exception */
Render the value control. At this point the value field already rendered on the page and writer stands just after it
render
{ "repo_name": "exodev/social", "path": "component/webui/src/main/java/org/exoplatform/social/webui/profile/settings/UIValueControl.java", "license": "lgpl-3.0", "size": 1797 }
[ "java.io.IOException", "org.exoplatform.webui.application.WebuiRequestContext" ]
import java.io.IOException; import org.exoplatform.webui.application.WebuiRequestContext;
import java.io.*; import org.exoplatform.webui.application.*;
[ "java.io", "org.exoplatform.webui" ]
java.io; org.exoplatform.webui;
2,822,357
protected String readLine() throws IOException { if (pdfSource.isEOF()) { throw new IOException("Error: End-of-File, expected line"); } StringBuilder buffer = new StringBuilder(11); int c; while ((c = pdfSource.read()) != -1) { if (isEOL(c)) { break; } buffer.append((char) c); } return buffer.toString(); }
String function() throws IOException { if (pdfSource.isEOF()) { throw new IOException(STR); } StringBuilder buffer = new StringBuilder(11); int c; while ((c = pdfSource.read()) != -1) { if (isEOL(c)) { break; } buffer.append((char) c); } return buffer.toString(); }
/** * This will read bytes until the first end of line marker occurs. Note: if you later unread the results of this function, you'll need to add a * newline character to the end of the string. * * @return The characters between the current position and the end of the line. * * @throws IOException If there is an error reading from the stream. */
This will read bytes until the first end of line marker occurs. Note: if you later unread the results of this function, you'll need to add a newline character to the end of the string
readLine
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/pdfparser/BaseParser.java", "license": "gpl-2.0", "size": 46902 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
159,444
@Test public void testMixed5() throws Exception { String q = query + "b = filter a by " + "(srcid == 10 or mrkt == 'us') and name == 'foo' and " + "dstid == 30;" + "store b into 'out';"; test(q, Arrays.asList("srcid", "dstid", "mrkt"), "(((srcid == 10) or (mrkt == 'us')) and (dstid == 30))", "(name == 'foo')"); }
void function() throws Exception { String q = query + STR + STR + STR + STR; test(q, Arrays.asList("srcid", "dstid", "mrkt"), STR, STR); }
/** * test case where filter has both conditions on partition cols and non * partition cols and the filter condition will be split to extract the * conditions on partition columns - * This testcase has two partition col conditions with OR + non parition * col conditions */
test case where filter has both conditions on partition cols and non partition cols and the filter condition will be split to extract the conditions on partition columns - This testcase has two partition col conditions with OR + non parition col conditions
testMixed5
{ "repo_name": "apache/pig", "path": "test/org/apache/pig/test/TestNewPartitionFilterPushDown.java", "license": "apache-2.0", "size": 44644 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,099,474
public boolean isKeyDown(int code) { return Keyboard.isKeyDown(code); }
boolean function(int code) { return Keyboard.isKeyDown(code); }
/** * Check if a particular key is down * * @param code The key code of the key to check * @return True if the key is down */
Check if a particular key is down
isKeyDown
{ "repo_name": "CyboticCatfish/code404", "path": "CodingGame/lib/slick/src/org/newdawn/slick/Input.java", "license": "gpl-2.0", "size": 43080 }
[ "org.lwjgl.input.Keyboard" ]
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.*;
[ "org.lwjgl.input" ]
org.lwjgl.input;
2,419,991
@ApiModelProperty(value = "") public ConversionDate getConversionDate() { return conversionDate; }
@ApiModelProperty(value = "") ConversionDate function() { return conversionDate; }
/** * Get conversionDate * * @return conversionDate */
Get conversionDate
getConversionDate
{ "repo_name": "XeroAPI/Xero-Java", "path": "src/main/java/com/xero/models/accounting/Setup.java", "license": "mit", "size": 5326 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
92,039
public static void noNullValues(String name, Map<?, ?> value) throws NullPointerException { if (Objects.requireNonNull(value, name).entrySet().stream().anyMatch(Objects::isNull)) { throw new NullPointerException(name + " may not contain null elements!"); } }
static void function(String name, Map<?, ?> value) throws NullPointerException { if (Objects.requireNonNull(value, name).entrySet().stream().anyMatch(Objects::isNull)) { throw new NullPointerException(name + STR); } }
/** * Throws a {@code NullPointerExceptions} if value is null or any key or value within is null. * * @param name the name of the value * @param value the value to check * * @throws NullPointerException if value == null or value contains null values */
Throws a NullPointerExceptions if value is null or any key or value within is null
noNullValues
{ "repo_name": "autermann/SOS", "path": "core/api/src/main/java/org/n52/sos/cache/CacheValidation.java", "license": "gpl-2.0", "size": 4836 }
[ "java.util.Map", "java.util.Objects" ]
import java.util.Map; import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
400,588
public Color getColor(int izV) { return new Color(this.r[izV], this.g[izV], this.b[izV]); }
Color function(int izV) { return new Color(this.r[izV], this.g[izV], this.b[izV]); }
/** * Returns a color. * * @param izV ??. * * @return The color. */
Returns a color
getColor
{ "repo_name": "raedle/univis", "path": "lib/jfreechart-1.0.1/src/org/jfree/chart/plot/ColorPalette.java", "license": "lgpl-2.1", "size": 12117 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
601,394
private int getImageWidth() { DisplayMetrics dm = new DisplayMetrics(); mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm); return dm.widthPixels >> 2; } private class BitmapToLoad { public String mUrl; public ImageView mImageView; public BitmapToLoad(String url, ImageView view) { mUrl = url; mImageView = view; } } private class BitmapLoader implements Runnable { BitmapToLoad mBitmapToLoad; BitmapLoader(BitmapToLoad bitmapToLoad) { mBitmapToLoad = bitmapToLoad; }
int function() { DisplayMetrics dm = new DisplayMetrics(); mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm); return dm.widthPixels >> 2; } private class BitmapToLoad { public String mUrl; public ImageView mImageView; public BitmapToLoad(String url, ImageView view) { mUrl = url; mImageView = view; } } private class BitmapLoader implements Runnable { BitmapToLoad mBitmapToLoad; BitmapLoader(BitmapToLoad bitmapToLoad) { mBitmapToLoad = bitmapToLoad; }
/** * return screen pixel width / 4 as image width */
return screen pixel width / 4 as image width
getImageWidth
{ "repo_name": "tengrenfu/AsyncLoad", "path": "AsyncLoad/src/com/displayjson/asyncload/ImageLoader.java", "license": "gpl-2.0", "size": 11223 }
[ "android.util.DisplayMetrics", "android.widget.ImageView" ]
import android.util.DisplayMetrics; import android.widget.ImageView;
import android.util.*; import android.widget.*;
[ "android.util", "android.widget" ]
android.util; android.widget;
2,021,683
FileChooser createSaveToExcelChooser() { List<FileFilter> filterList = new ArrayList<FileFilter>(); FileFilter filter = new ExcelFilter(); filterList.add(filter); FileChooser chooser = new FileChooser(this, FileChooser.SAVE, "Save Results to Excel", "Save the Results data to a file which can be loaded by " + "a spreadsheet.", filterList); try { File f = UIUtilities.getDefaultFolder(); if (f != null) chooser.setCurrentDirectory(f); } catch (Exception ex) {} return chooser; }
FileChooser createSaveToExcelChooser() { List<FileFilter> filterList = new ArrayList<FileFilter>(); FileFilter filter = new ExcelFilter(); filterList.add(filter); FileChooser chooser = new FileChooser(this, FileChooser.SAVE, STR, STR + STR, filterList); try { File f = UIUtilities.getDefaultFolder(); if (f != null) chooser.setCurrentDirectory(f); } catch (Exception ex) {} return chooser; }
/** * Creates a file chooser used to select where to save the results * as an Excel file. * * @return See above. */
Creates a file chooser used to select where to save the results as an Excel file
createSaveToExcelChooser
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerUI.java", "license": "gpl-2.0", "size": 45535 }
[ "java.io.File", "java.util.ArrayList", "java.util.List", "javax.swing.filechooser.FileFilter", "org.openmicroscopy.shoola.util.filter.file.ExcelFilter", "org.openmicroscopy.shoola.util.ui.UIUtilities", "org.openmicroscopy.shoola.util.ui.filechooser.FileChooser" ]
import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.filechooser.FileFilter; import org.openmicroscopy.shoola.util.filter.file.ExcelFilter; import org.openmicroscopy.shoola.util.ui.UIUtilities; import org.openmicroscopy.shoola.util.ui.filechooser.FileChooser;
import java.io.*; import java.util.*; import javax.swing.filechooser.*; import org.openmicroscopy.shoola.util.filter.file.*; import org.openmicroscopy.shoola.util.ui.*; import org.openmicroscopy.shoola.util.ui.filechooser.*;
[ "java.io", "java.util", "javax.swing", "org.openmicroscopy.shoola" ]
java.io; java.util; javax.swing; org.openmicroscopy.shoola;
2,861,456
public static CronTab findByName(String name) throws DatabaseException { log.debug("findByName({})", name); String qs = "from CronTab ct where ct.name=:name"; Session session = null; try { session = HibernateUtil.getSessionFactory().openSession(); Query q = session.createQuery(qs); q.setString("name", name); CronTab ret = (CronTab) q.setMaxResults(1).uniqueResult(); log.debug("findByName: {}", ret); return ret; } catch (HibernateException e) { throw new DatabaseException(e.getMessage(), e); } finally { HibernateUtil.close(session); } }
static CronTab function(String name) throws DatabaseException { log.debug(STR, name); String qs = STR; Session session = null; try { session = HibernateUtil.getSessionFactory().openSession(); Query q = session.createQuery(qs); q.setString("name", name); CronTab ret = (CronTab) q.setMaxResults(1).uniqueResult(); log.debug(STR, ret); return ret; } catch (HibernateException e) { throw new DatabaseException(e.getMessage(), e); } finally { HibernateUtil.close(session); } }
/** * Find by filename */
Find by filename
findByName
{ "repo_name": "papamas/DMS-KANGREG-XI-MANADO", "path": "src/main/java/com/openkm/dao/CronTabDAO.java", "license": "gpl-3.0", "size": 6763 }
[ "com.openkm.core.DatabaseException", "com.openkm.dao.bean.CronTab", "org.hibernate.HibernateException", "org.hibernate.Query", "org.hibernate.Session" ]
import com.openkm.core.DatabaseException; import com.openkm.dao.bean.CronTab; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session;
import com.openkm.core.*; import com.openkm.dao.bean.*; import org.hibernate.*;
[ "com.openkm.core", "com.openkm.dao", "org.hibernate" ]
com.openkm.core; com.openkm.dao; org.hibernate;
493,915
public DiagonalMatrix transform(final DoubleUnaryOperator operator) { final var D = new DiagonalMatrix(diag.length); for (var i = 0; i < diag.length; i++) { D.diag[i] = operator.applyAsDouble(diag[i]); } return D; }
DiagonalMatrix function(final DoubleUnaryOperator operator) { final var D = new DiagonalMatrix(diag.length); for (var i = 0; i < diag.length; i++) { D.diag[i] = operator.applyAsDouble(diag[i]); } return D; }
/** * Applies the given operator to all elements, returning a new Matrix. * * @param operator Operator to be applied to this Matrix and B * @return new Matrix with the result * @throws NullPointerException iff operator == null or B == null * @see #transformEquals(DoubleUnaryOperator) */
Applies the given operator to all elements, returning a new Matrix
transform
{ "repo_name": "tweimer/java-matrix", "path": "src/main/java/jama2/DiagonalMatrix.java", "license": "unlicense", "size": 10968 }
[ "java.util.function.DoubleUnaryOperator" ]
import java.util.function.DoubleUnaryOperator;
import java.util.function.*;
[ "java.util" ]
java.util;
2,059,681
public Record getSelectedParent() { return newParent; }
Record function() { return newParent; }
/** * Gets current selection of parent object. It tries to use record from TreeGrid * to propagate add/remove of record to view properly. */
Gets current selection of parent object. It tries to use record from TreeGrid to propagate add/remove of record to view properly
getSelectedParent
{ "repo_name": "proarc/proarc", "path": "proarc-webapp/src/main/java/cz/cas/lib/proarc/webapp/client/widget/ImportParentChooser.java", "license": "gpl-3.0", "size": 15089 }
[ "com.smartgwt.client.data.Record" ]
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.*;
[ "com.smartgwt.client" ]
com.smartgwt.client;
637,848
private IQueryFilter<I_PP_Order> getPP_OrderInvoiceableFilter(final Object contextProvider) { final IQueryBL queryBL = Services.get(IQueryBL.class); final ICompositeQueryFilter<I_PP_Order> filters = queryBL.createCompositeQueryFilter(I_PP_Order.class) // Only those manufacturing orders which are closed... .addEqualsFilter(I_PP_Order.COLUMN_DocStatus, DocAction.STATUS_Closed) // ...and only those which we didn't already explicitly look at .addEqualsFilter(de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_IsInvoiceCandidate, false); // // only if they reference a M_Material_Tracking that is not yet processed { final IQuery<I_M_Material_Tracking> unprocessedMaterialTrackingsQuery = queryBL .createQueryBuilder(I_M_Material_Tracking.class, contextProvider) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_M_Material_Tracking.COLUMNNAME_Processed, false) .create(); filters.addInSubQueryFilter(de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_M_Material_Tracking_ID, I_M_Material_Tracking.COLUMNNAME_M_Material_Tracking_ID, unprocessedMaterialTrackingsQuery); } // // Only those manufacturing orders which do not already have an invoice detail { final IQuery<I_C_Invoice_Detail> invoiceDetailsWithPPOrderQuery = queryBL .createQueryBuilder(I_C_Invoice_Detail.class, contextProvider) .addOnlyActiveRecordsFilter() .addNotEqualsFilter(I_C_Invoice_Detail.COLUMNNAME_C_Invoice_Candidate_ID, null) .create(); filters.addNotInSubQueryFilter(I_PP_Order.COLUMNNAME_PP_Order_ID, I_C_Invoice_Detail.COLUMNNAME_PP_Order_ID, invoiceDetailsWithPPOrderQuery); } return filters; }
IQueryFilter<I_PP_Order> function(final Object contextProvider) { final IQueryBL queryBL = Services.get(IQueryBL.class); final ICompositeQueryFilter<I_PP_Order> filters = queryBL.createCompositeQueryFilter(I_PP_Order.class) .addEqualsFilter(I_PP_Order.COLUMN_DocStatus, DocAction.STATUS_Closed) .addEqualsFilter(de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_IsInvoiceCandidate, false); { final IQuery<I_M_Material_Tracking> unprocessedMaterialTrackingsQuery = queryBL .createQueryBuilder(I_M_Material_Tracking.class, contextProvider) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_M_Material_Tracking.COLUMNNAME_Processed, false) .create(); filters.addInSubQueryFilter(de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_M_Material_Tracking_ID, I_M_Material_Tracking.COLUMNNAME_M_Material_Tracking_ID, unprocessedMaterialTrackingsQuery); } { final IQuery<I_C_Invoice_Detail> invoiceDetailsWithPPOrderQuery = queryBL .createQueryBuilder(I_C_Invoice_Detail.class, contextProvider) .addOnlyActiveRecordsFilter() .addNotEqualsFilter(I_C_Invoice_Detail.COLUMNNAME_C_Invoice_Candidate_ID, null) .create(); filters.addNotInSubQueryFilter(I_PP_Order.COLUMNNAME_PP_Order_ID, I_C_Invoice_Detail.COLUMNNAME_PP_Order_ID, invoiceDetailsWithPPOrderQuery); } return filters; }
/** * Gets a filter which accepts only those {@link I_PP_Order}s which are invoiceable. * * More precisely, manufacturing orders which: * <ul> * <li>reference a M_Material_Tracking and * <li>are closed * </ul> * * @return */
Gets a filter which accepts only those <code>I_PP_Order</code>s which are invoiceable. More precisely, manufacturing orders which: reference a M_Material_Tracking and are closed
getPP_OrderInvoiceableFilter
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.materialtracking/src/main/java/de/metas/materialtracking/qualityBasedInvoicing/ic/spi/impl/PP_Order_MaterialTracking_HandlerDAO.java", "license": "gpl-2.0", "size": 5257 }
[ "org.adempiere.ad.dao.ICompositeQueryFilter", "org.adempiere.ad.dao.IQueryBL", "org.adempiere.ad.dao.IQueryFilter", "org.adempiere.util.Services", "org.compiere.model.IQuery", "org.compiere.process.DocAction" ]
import org.adempiere.ad.dao.ICompositeQueryFilter; import org.adempiere.ad.dao.IQueryBL; import org.adempiere.ad.dao.IQueryFilter; import org.adempiere.util.Services; import org.compiere.model.IQuery; import org.compiere.process.DocAction;
import org.adempiere.ad.dao.*; import org.adempiere.util.*; import org.compiere.model.*; import org.compiere.process.*;
[ "org.adempiere.ad", "org.adempiere.util", "org.compiere.model", "org.compiere.process" ]
org.adempiere.ad; org.adempiere.util; org.compiere.model; org.compiere.process;
2,452,845
DiskUsage averageUsage(RoutingNode node, ImmutableOpenMap<String, DiskUsage> usages) { if (usages.size() == 0) { return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", 0, 0); } long totalBytes = 0; long freeBytes = 0; for (ObjectCursor<DiskUsage> du : usages.values()) { totalBytes += du.value.getTotalBytes(); freeBytes += du.value.getFreeBytes(); } return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", totalBytes / usages.size(), freeBytes / usages.size()); }
DiskUsage averageUsage(RoutingNode node, ImmutableOpenMap<String, DiskUsage> usages) { if (usages.size() == 0) { return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", 0, 0); } long totalBytes = 0; long freeBytes = 0; for (ObjectCursor<DiskUsage> du : usages.values()) { totalBytes += du.value.getTotalBytes(); freeBytes += du.value.getFreeBytes(); } return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", totalBytes / usages.size(), freeBytes / usages.size()); }
/** * Returns a {@link DiskUsage} for the {@link RoutingNode} using the * average usage of other nodes in the disk usage map. * @param node Node to return an averaged DiskUsage object for * @param usages Map of nodeId to DiskUsage for all known nodes * @return DiskUsage representing given node using the average disk usage */
Returns a <code>DiskUsage</code> for the <code>RoutingNode</code> using the average usage of other nodes in the disk usage map
averageUsage
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java", "license": "apache-2.0", "size": 31215 }
[ "com.carrotsearch.hppc.cursors.ObjectCursor", "org.elasticsearch.cluster.DiskUsage", "org.elasticsearch.cluster.routing.RoutingNode", "org.elasticsearch.common.collect.ImmutableOpenMap" ]
import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.cluster.DiskUsage; import org.elasticsearch.cluster.routing.RoutingNode; import org.elasticsearch.common.collect.ImmutableOpenMap;
import com.carrotsearch.hppc.cursors.*; import org.elasticsearch.cluster.*; import org.elasticsearch.cluster.routing.*; import org.elasticsearch.common.collect.*;
[ "com.carrotsearch.hppc", "org.elasticsearch.cluster", "org.elasticsearch.common" ]
com.carrotsearch.hppc; org.elasticsearch.cluster; org.elasticsearch.common;
595,649