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
@Nullable public Vec3d getTargetLocation() { return this.targetLocation; }
Vec3d function() { return this.targetLocation; }
/** * Returns the location the dragon is flying toward */
Returns the location the dragon is flying toward
getTargetLocation
{ "repo_name": "danielyc/test-1.9.4", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/boss/dragon/phase/PhaseLandingApproach.java", "license": "gpl-3.0", "size": 3584 }
[ "net.minecraft.util.math.Vec3d" ]
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,337,452
@NonNull public StaticLayoutBuilderCompat setMaxLines(@IntRange(from = 0) int maxLines) { this.maxLines = maxLines; return this; } /** * Set the line spacing addition and multiplier frequency. Only available on API level 23+. * * @param spacingAdd Line spacing addition for the resulting {@link StaticLayout} * @param lineSpacingMultiplier Line spacing multiplier for the resulting {@link StaticLayout}
StaticLayoutBuilderCompat function(@IntRange(from = 0) int maxLines) { this.maxLines = maxLines; return this; } /** * Set the line spacing addition and multiplier frequency. Only available on API level 23+. * * @param spacingAdd Line spacing addition for the resulting {@link StaticLayout} * @param lineSpacingMultiplier Line spacing multiplier for the resulting {@link StaticLayout}
/** * Set maximum number of lines. This is particularly useful in the case of ellipsizing, where it * changes the layout of the last line. The default is unlimited. * * @param maxLines maximum number of lines in the layout * @return this builder, useful for chaining * @see android.widget.TextView#setMaxLines */
Set maximum number of lines. This is particularly useful in the case of ellipsizing, where it changes the layout of the last line. The default is unlimited
setMaxLines
{ "repo_name": "material-components/material-components-android", "path": "lib/java/com/google/android/material/internal/StaticLayoutBuilderCompat.java", "license": "apache-2.0", "size": 11949 }
[ "android.text.StaticLayout", "androidx.annotation.IntRange" ]
import android.text.StaticLayout; import androidx.annotation.IntRange;
import android.text.*; import androidx.annotation.*;
[ "android.text", "androidx.annotation" ]
android.text; androidx.annotation;
638,988
protected void openFileChooser(ActionEvent e) { OurGridFileChooser fileChooser = new OurGridFileChooser("Properties file", "properties"); File propertiesFile = fileChooser.getFile(); if (propertiesFile != null) { Properties prop = CommonUtils.loadProperties(propertiesFile); peerAddressTextArea.setText(prop.getProperty(SignatureProperties.PROP_PUBLIC_KEY)); } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField playpenRootField; private javax.swing.JLabel idlenessTimeoutLabel; private javax.swing.JSpinner idlenessTimeoutSpinner; private javax.swing.JPanel idlenessPanel; private javax.swing.JLabel playpenRootLabel; private javax.swing.JLabel storageRootLabel; private javax.swing.JTextField storageRootField; private javax.swing.JPanel rootPanel; private javax.swing.JCheckBox enableIdlenessCheckBox; private javax.swing.JPanel keySettingsPanel; private javax.swing.JLabel peerAddressLabel; private javax.swing.JButton loadButton; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea peerAddressTextArea; // End of variables declaration//GEN-END:variables
void function(ActionEvent e) { OurGridFileChooser fileChooser = new OurGridFileChooser(STR, STR); File propertiesFile = fileChooser.getFile(); if (propertiesFile != null) { Properties prop = CommonUtils.loadProperties(propertiesFile); peerAddressTextArea.setText(prop.getProperty(SignatureProperties.PROP_PUBLIC_KEY)); } } private javax.swing.JTextField playpenRootField; private javax.swing.JLabel idlenessTimeoutLabel; private javax.swing.JSpinner idlenessTimeoutSpinner; private javax.swing.JPanel idlenessPanel; private javax.swing.JLabel playpenRootLabel; private javax.swing.JLabel storageRootLabel; private javax.swing.JTextField storageRootField; private javax.swing.JPanel rootPanel; private javax.swing.JCheckBox enableIdlenessCheckBox; private javax.swing.JPanel keySettingsPanel; private javax.swing.JLabel peerAddressLabel; private javax.swing.JButton loadButton; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea peerAddressTextArea;
/** * Opens a FileChooser that permites define the peer public key. * @param e The event that represents the clicking of the loadButton. */
Opens a FileChooser that permites define the peer public key
openFileChooser
{ "repo_name": "OurGrid/OurGrid", "path": "src/main/java/org/ourgrid/worker/ui/async/gui/WorkerBasicSettingsPanel.java", "license": "lgpl-3.0", "size": 15688 }
[ "br.edu.ufcg.lsd.commune.network.signature.SignatureProperties", "java.awt.event.ActionEvent", "java.io.File", "java.util.Properties", "org.ourgrid.common.util.CommonUtils", "org.ourgrid.peer.ui.async.gui.OurGridFileChooser" ]
import br.edu.ufcg.lsd.commune.network.signature.SignatureProperties; import java.awt.event.ActionEvent; import java.io.File; import java.util.Properties; import org.ourgrid.common.util.CommonUtils; import org.ourgrid.peer.ui.async.gui.OurGridFileChooser;
import br.edu.ufcg.lsd.commune.network.signature.*; import java.awt.event.*; import java.io.*; import java.util.*; import org.ourgrid.common.util.*; import org.ourgrid.peer.ui.async.gui.*;
[ "br.edu.ufcg", "java.awt", "java.io", "java.util", "org.ourgrid.common", "org.ourgrid.peer" ]
br.edu.ufcg; java.awt; java.io; java.util; org.ourgrid.common; org.ourgrid.peer;
1,912,669
public static <T> T[] shuffle(T[] array) { return shuffle(array, new Random()); }
static <T> T[] function(T[] array) { return shuffle(array, new Random()); }
/** * Shuffles the given array. * * @return mutated parameter array that was shuffled beforehand. */
Shuffles the given array
shuffle
{ "repo_name": "sourcewarehouse/thomasjungblut", "path": "src/de/jungblut/datastructure/ArrayUtils.java", "license": "apache-2.0", "size": 40697 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
1,490,797
public Type getOwnerType() { return ownerType; }
Type function() { return ownerType; }
/** * Returns a <tt>Type</tt> object representing the type that this type * is a member of. For example, if this type is <tt>O<T>.I<S></tt>, * return a representation of <tt>O<T></tt>. * * <p>If this type is a top-level type, <tt>null</tt> is returned. * * @return a <tt>Type</tt> object representing the type that * this type is a member of. If this type is a top-level type, * <tt>null</tt> is returned * @throws <tt>TypeNotPresentException</tt> if the owner type * refers to a non-existent type declaration * @throws <tt>MalformedParameterizedTypeException</tt> if the owner type * refers to a parameterized type that cannot be instantiated * for any reason * */
Returns a Type object representing the type that this type is a member of. For example, if this type is O.I, return a representation of O. If this type is a top-level type, null is returned
getOwnerType
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java", "license": "gpl-2.0", "size": 9904 }
[ "java.lang.reflect.Type" ]
import java.lang.reflect.Type;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,801,832
public AttributeInfo getAttribute(String name) { ArrayList list = attributes; int n = list.size(); for (int i = 0; i < n; ++i) { AttributeInfo ai = (AttributeInfo)list.get(i); if (ai.getName().equals(name)) return ai; } return null; }
AttributeInfo function(String name) { ArrayList list = attributes; int n = list.size(); for (int i = 0; i < n; ++i) { AttributeInfo ai = (AttributeInfo)list.get(i); if (ai.getName().equals(name)) return ai; } return null; }
/** * Returns the attribute with the specified name. If there are multiple * attributes with that name, this method returns either of them. It * returns null if the specified attributed is not found. * * @param name attribute name * @see #getAttributes() */
Returns the attribute with the specified name. If there are multiple attributes with that name, this method returns either of them. It returns null if the specified attributed is not found
getAttribute
{ "repo_name": "ilagunap/process-profiler", "path": "java_methods_profiler/javaassist/javassist-3.16.1-GA/src/main/javassist/bytecode/ClassFile.java", "license": "gpl-3.0", "size": 26642 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,303,822
public MessageBuilder addRecipient(String address, String name) throws AddressException { recipients.add(createAddress(address, name)); return this; }
MessageBuilder function(String address, String name) throws AddressException { recipients.add(createAddress(address, name)); return this; }
/** * Adds a recipient to the list. If the name parameter is specified as * "John Doe" then the recipient will be in the form of * "John Doe &lt;name@example.com&gt;" * * @param address * The internet email address in the form of "name@example.com" or * "name &lt;name@example.com&gt;" if name is specified then you * should use rthe first address form. * @param name * The name of the recipient. May be null. Combined with address to * form "name &lt;name@example.com&gt;" * @return This builder for chaining calls. * @throws AddressException * Is thrown when the address is invalid. */
Adds a recipient to the list. If the name parameter is specified as "John Doe" then the recipient will be in the form of "John Doe &lt;name@example.com&gt;"
addRecipient
{ "repo_name": "jaapgeurts/snap", "path": "src/main/java/snap/mail/Mailer.java", "license": "gpl-2.0", "size": 11691 }
[ "javax.mail.internet.AddressException" ]
import javax.mail.internet.AddressException;
import javax.mail.internet.*;
[ "javax.mail" ]
javax.mail;
2,154,148
public static String quoteIfNeeded(String s, String delim) { if (s==null) return null; if (s.length()==0) return "\"\""; for (int i=0;i<s.length();i++) { char c = s.charAt(i); if (c=='\\' || c=='"' || c=='\'' || Character.isWhitespace(c) || delim.indexOf(c)>=0) { StringBuffer b=new StringBuffer(s.length()+8); quote(b,s); return b.toString(); } } return s; } private static final char[] escapes = new char[32]; static { Arrays.fill(escapes, (char)0xFFFF); escapes['\b'] = 'b'; escapes['\t'] = 't'; escapes['\n'] = 'n'; escapes['\f'] = 'f'; escapes['\r'] = 'r'; }
static String function(String s, String delim) { if (s==null) return null; if (s.length()==0) return "\"\STR' c=='\'' Character.isWhitespace(c) delim.indexOf(c)>=0) { StringBuffer b=new StringBuffer(s.length()+8); quote(b,s); return b.toString(); } } return s; } private static final char[] escapes = new char[32]; static { Arrays.fill(escapes, (char)0xFFFF); escapes['\b'] = 'b'; escapes['\t'] = 't'; escapes['\n'] = 'n'; escapes['\f'] = 'f'; escapes['\r'] = 'r'; }
/** Quote a string. * The string is quoted only if quoting is required due to * embedded delimiters, quote characters or the * empty string. * @param s The string to quote. * @param delim the delimiter to use to quote the string * @return quoted string */
Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string
quoteIfNeeded
{ "repo_name": "knowledgecode/jetty-websocket-android", "path": "src/org/eclipse/jetty/util/QuotedStringTokenizer.java", "license": "apache-2.0", "size": 10524 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,553,422
public void setCreateDate(Date createDate) { this.createDate = createDate; }
void function(Date createDate) { this.createDate = createDate; }
/** * Setter of createDate. * * @param createDate createDate */
Setter of createDate
setCreateDate
{ "repo_name": "sismics/books", "path": "books-core/src/main/java/com/sismics/books/core/model/jpa/User.java", "license": "gpl-2.0", "size": 4946 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
96,745
@SubscribeEvent(priority = EventPriority.HIGHEST) public void magPickBonus(PlayerEvent.BreakSpeed event) { EntityPlayer player = event.entityPlayer; ItemStack itemstack = player.getCurrentEquippedItem(); List<Item> SpeedItems = new ArrayList(); SpeedItems.add(MagItems.MagAxe); SpeedItems.add(MagItems.MagEarthMover); SpeedItems.add(MagItems.MagHammer); SpeedItems.add(MagItems.MagPick); if (itemstack != null) { float bonus = (float) player.experienceLevel; if (SpeedItems.contains(itemstack.getItem()) && ConfigInfo.EnableXPSpeed) { if (ConfigInfo.EnableXPSpeed) { event.newSpeed = event.originalSpeed + (bonus / 25); } } else if (itemstack.getItem() == MagItems.MagHatchet) { Block block = event.block; Material material = block.getMaterial(); if (material == Material.plants || material == Material.vine || material == Material.coral || material == Material.leaves || material == Material.gourd) { event.newSpeed = event.originalSpeed + (bonus / 5); } } } return; }
@SubscribeEvent(priority = EventPriority.HIGHEST) void function(PlayerEvent.BreakSpeed event) { EntityPlayer player = event.entityPlayer; ItemStack itemstack = player.getCurrentEquippedItem(); List<Item> SpeedItems = new ArrayList(); SpeedItems.add(MagItems.MagAxe); SpeedItems.add(MagItems.MagEarthMover); SpeedItems.add(MagItems.MagHammer); SpeedItems.add(MagItems.MagPick); if (itemstack != null) { float bonus = (float) player.experienceLevel; if (SpeedItems.contains(itemstack.getItem()) && ConfigInfo.EnableXPSpeed) { if (ConfigInfo.EnableXPSpeed) { event.newSpeed = event.originalSpeed + (bonus / 25); } } else if (itemstack.getItem() == MagItems.MagHatchet) { Block block = event.block; Material material = block.getMaterial(); if (material == Material.plants material == Material.vine material == Material.coral material == Material.leaves material == Material.gourd) { event.newSpeed = event.originalSpeed + (bonus / 5); } } } return; }
/** * Speeds up the player's ability to harvest Blocks based on their * experience while using the magPick * * @param event */
Speeds up the player's ability to harvest Blocks based on their experience while using the magPick
magPickBonus
{ "repo_name": "VapourDrive/MagTools", "path": "src/main/java/com/vapourdrive/magtools/events/MagSpeedBonus.java", "license": "mit", "size": 1803 }
[ "com.vapourdrive.magtools.config.ConfigInfo", "com.vapourdrive.magtools.items.MagItems", "java.util.ArrayList", "java.util.List", "net.minecraft.block.Block", "net.minecraft.block.material.Material", "net.minecraft.entity.player.EntityPlayer", "net.minecraft.item.Item", "net.minecraft.item.ItemStack", "net.minecraftforge.event.entity.player.PlayerEvent" ]
import com.vapourdrive.magtools.config.ConfigInfo; import com.vapourdrive.magtools.items.MagItems; import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.player.PlayerEvent;
import com.vapourdrive.magtools.config.*; import com.vapourdrive.magtools.items.*; import java.util.*; import net.minecraft.block.*; import net.minecraft.block.material.*; import net.minecraft.entity.player.*; import net.minecraft.item.*; import net.minecraftforge.event.entity.player.*;
[ "com.vapourdrive.magtools", "java.util", "net.minecraft.block", "net.minecraft.entity", "net.minecraft.item", "net.minecraftforge.event" ]
com.vapourdrive.magtools; java.util; net.minecraft.block; net.minecraft.entity; net.minecraft.item; net.minecraftforge.event;
2,533,701
public BigDecimal getPastDue61_Plus () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PastDue61_Plus); if (bd == null) return Env.ZERO; return bd; }
BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PastDue61_Plus); if (bd == null) return Env.ZERO; return bd; }
/** Get Past Due > 61. @return Past Due > 61 */
Get Past Due > 61
getPastDue61_Plus
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_T_Aging.java", "license": "gpl-2.0", "size": 20737 }
[ "java.math.BigDecimal", "org.compiere.util.Env" ]
import java.math.BigDecimal; import org.compiere.util.Env;
import java.math.*; import org.compiere.util.*;
[ "java.math", "org.compiere.util" ]
java.math; org.compiere.util;
1,560,236
public void setHostname(Socket socket, String hostName) { castToOpenSSLSocket(socket).setHostname(hostName); }
void function(Socket socket, String hostName) { castToOpenSSLSocket(socket).setHostname(hostName); }
/** * Turns on <a href="http://tools.ietf.org/html/rfc6066#section-3">Server * Name Indication (SNI)</a> on a given socket. * * @param socket a socket created by this factory. * @param hostName the desired SNI hostname, null to disable. * @throws IllegalArgumentException if the socket was not created by this factory. */
Turns on Server Name Indication (SNI) on a given socket
setHostname
{ "repo_name": "haikuowuya/android_system_code", "path": "src/android/net/SSLCertificateSocketFactory.java", "license": "apache-2.0", "size": 19572 }
[ "java.net.Socket" ]
import java.net.Socket;
import java.net.*;
[ "java.net" ]
java.net;
787,849
public Set<ID> getPeerIDs() { return Collections.unmodifiableSet(peerids); }
Set<ID> function() { return Collections.unmodifiableSet(peerids); }
/** * Returns a {@link java.util.Set} (possibly empty) containing the peer ids * which should respond to this query. * * @return set containing the peer ids to which this peer is directed. */
Returns a <code>java.util.Set</code> (possibly empty) containing the peer ids which should respond to this query
getPeerIDs
{ "repo_name": "johnjianfang/jxse", "path": "src/main/java/net/jxta/protocol/PipeResolverMessage.java", "license": "apache-2.0", "size": 8258 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,086,804
@Override void createRowIndexEntry() throws IOException { getFileStatistics().merge(indexStatistics); OrcProto.RowIndexEntry.Builder rowIndexEntry = getRowIndexEntry(); rowIndexEntry.setStatistics(indexStatistics.serialize()); indexStatistics.reset(); if (useCarriedOverDirectEncoding()) { getRowIndex().addEntry(rowIndexEntry); } else { savedRowIndex.add(rowIndexEntry.build()); } rowIndexEntry.clear(); recordPosition(rowIndexPosition); if (useCarriedOverDirectEncoding()) { rowOutput.getPosition(rowIndexPosition); directLengthOutput.getPosition(rowIndexPosition); } else { rowIndexValueCount.add(Long.valueOf(rows.size())); } }
void createRowIndexEntry() throws IOException { getFileStatistics().merge(indexStatistics); OrcProto.RowIndexEntry.Builder rowIndexEntry = getRowIndexEntry(); rowIndexEntry.setStatistics(indexStatistics.serialize()); indexStatistics.reset(); if (useCarriedOverDirectEncoding()) { getRowIndex().addEntry(rowIndexEntry); } else { savedRowIndex.add(rowIndexEntry.build()); } rowIndexEntry.clear(); recordPosition(rowIndexPosition); if (useCarriedOverDirectEncoding()) { rowOutput.getPosition(rowIndexPosition); directLengthOutput.getPosition(rowIndexPosition); } else { rowIndexValueCount.add(Long.valueOf(rows.size())); } }
/** * This method doesn't call the super method, because unlike most of the * other TreeWriters, this one can't record the position in the streams * until the stripe is being flushed. Therefore it saves all of the entries * and augments them with the final information as the stripe is written. * @throws IOException */
This method doesn't call the super method, because unlike most of the other TreeWriters, this one can't record the position in the streams until the stripe is being flushed. Therefore it saves all of the entries and augments them with the final information as the stripe is written
createRowIndexEntry
{ "repo_name": "libin/hive-dwrf", "path": "hive-dwrf/src/main/java/com/facebook/hive/orc/WriterImpl.java", "license": "apache-2.0", "size": 91194 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,838,416
public TaskContainer getExportTaskContainer() { return getTaskContainer(TaskReference.Phase.EXPORT); }
TaskContainer function() { return getTaskContainer(TaskReference.Phase.EXPORT); }
/** * Returns a {@link TaskContainer} for {@code export} phase. * @return task reference container */
Returns a <code>TaskContainer</code> for export phase
getExportTaskContainer
{ "repo_name": "ashigeru/asakusafw-compiler", "path": "compiler-project/api/src/main/java/com/asakusafw/lang/compiler/api/basic/TaskContainerMap.java", "license": "apache-2.0", "size": 3620 }
[ "com.asakusafw.lang.compiler.api.reference.TaskReference" ]
import com.asakusafw.lang.compiler.api.reference.TaskReference;
import com.asakusafw.lang.compiler.api.reference.*;
[ "com.asakusafw.lang" ]
com.asakusafw.lang;
53,654
@Test @Ignore public void assertNotContainsWorksCorrect() { assertTrue(fixture.assertNotContains("Auto", "Bahn")); assertTrue(fixture.assertNotContains("Auto", null)); assertTrue(fixture.assertNotContains(null, "Bahn")); assertFalse(fixture.assertNotContains("Hallo Welt", "Welt")); assertFalse(fixture.assertNotContains("Hausbot", " Haus ")); assertFalse(fixture.assertNotContains("Hausbot", " aus")); assertFalse(fixture.assertNotContains("Hausbot", "bot")); assertFalse(fixture.assertNotContains("Eingabe", "Eingabe")); assertFalse(fixture.assertNotContains(null, null)); }
void function() { assertTrue(fixture.assertNotContains("Auto", "Bahn")); assertTrue(fixture.assertNotContains("Auto", null)); assertTrue(fixture.assertNotContains(null, "Bahn")); assertFalse(fixture.assertNotContains(STR, "Welt")); assertFalse(fixture.assertNotContains(STR, STR)); assertFalse(fixture.assertNotContains(STR, STR)); assertFalse(fixture.assertNotContains(STR, "bot")); assertFalse(fixture.assertNotContains(STR, STR)); assertFalse(fixture.assertNotContains(null, null)); }
/** * Test for assertNotContains. */
Test for assertNotContains
assertNotContainsWorksCorrect
{ "repo_name": "yatol/yatol", "path": "acceptanceTest/webfixture/src/test/java/org/testeditor/fixture/web/WebFixtureTest.java", "license": "epl-1.0", "size": 24750 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
983,152
public static String getCertificateDistinguishedName(InputStream keystore, String password, String alias, boolean useBCAPI) { PKCS12Content content = loadFromKeyStore(keystore, password, alias, useBCAPI); if (content == null || content.certificates == null || content.certificates[0] == null) return null; return content.certificates[0].getSubjectDN().toString(); }
static String function(InputStream keystore, String password, String alias, boolean useBCAPI) { PKCS12Content content = loadFromKeyStore(keystore, password, alias, useBCAPI); if (content == null content.certificates == null content.certificates[0] == null) return null; return content.certificates[0].getSubjectDN().toString(); }
/** This is a helper function for fetching the distinguished name from a certificate. * * @param keystore The keystore/PKCS12 file to load from. * @param password The password used to encrypt the keystore/PKCS12 file. * @param alias The alias used to store the certificate in the keystore/PKCS12 file. * @param useBCAPI Set to true if the Bouncycastle API should be used instead of JCE. * @return The subject DN if the certificate could be successfully loaded, null otherwise. */
This is a helper function for fetching the distinguished name from a certificate
getCertificateDistinguishedName
{ "repo_name": "mobilesec/openuat", "path": "src/org/openuat/channel/X509CertificateGenerator.java", "license": "lgpl-3.0", "size": 38112 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,595,229
public interface ReaderImportRowHandler { void handleRow(Iterator columnIterator) throws ImportException; }
interface ReaderImportRowHandler { void function(Iterator columnIterator) throws ImportException; }
/** * This is the callback that is called for each row. * @param columnIterator Iterator for a collection of CSVReaderImportCell for this row. */
This is the callback that is called for each row
handleRow
{ "repo_name": "marktriggs/nyu-sakai-10.4", "path": "calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/readers/Reader.java", "license": "apache-2.0", "size": 8035 }
[ "java.util.Iterator", "org.sakaiproject.exception.ImportException" ]
import java.util.Iterator; import org.sakaiproject.exception.ImportException;
import java.util.*; import org.sakaiproject.exception.*;
[ "java.util", "org.sakaiproject.exception" ]
java.util; org.sakaiproject.exception;
1,380,658
@GET @Produces("application/json") public Response handleGet(@Context HttpServletRequest request, @QueryParam("page") @DefaultValue("0") int page, @QueryParam("pageSize") @DefaultValue("-1") int pgSize, @QueryParam("count") @DefaultValue("false") boolean cnt, @QueryParam("sort") @DefaultValue("name") String sort, @QueryParam("tagId") int tagId, @QueryParam(value="tagName") String name) { Pagination pg = new Pagination(page, pgSize, cnt); pg.setSortBy(sort); return(handleGet(Video.class, request, pg, tagId, name)); }
@Produces(STR) Response function(@Context HttpServletRequest request, @QueryParam("page") @DefaultValue("0") int page, @QueryParam(STR) @DefaultValue("-1") int pgSize, @QueryParam("count") @DefaultValue("false") boolean cnt, @QueryParam("sort") @DefaultValue("name") String sort, @QueryParam("tagId") int tagId, @QueryParam(value=STR) String name) { Pagination pg = new Pagination(page, pgSize, cnt); pg.setSortBy(sort); return(handleGet(Video.class, request, pg, tagId, name)); }
/** * List videos. */
List videos
handleGet
{ "repo_name": "harkwell/khallware", "path": "src/main/java/com/khallware/api/ctrl/Videos.java", "license": "gpl-3.0", "size": 5965 }
[ "com.khallware.api.domain.Video", "com.khallware.api.dstore.Pagination", "javax.servlet.http.HttpServletRequest", "javax.ws.rs.DefaultValue", "javax.ws.rs.Produces", "javax.ws.rs.QueryParam", "javax.ws.rs.core.Context", "javax.ws.rs.core.Response" ]
import com.khallware.api.domain.Video; import com.khallware.api.dstore.Pagination; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.DefaultValue; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response;
import com.khallware.api.domain.*; import com.khallware.api.dstore.*; import javax.servlet.http.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "com.khallware.api", "javax.servlet", "javax.ws" ]
com.khallware.api; javax.servlet; javax.ws;
2,466,263
public final Pagerator<Refund> getRefunds(final Refund refund, final Filter filter) throws IOException, OptimalException { final HashMap<String, String> queryStr = new HashMap<String, String>(); if (null != refund) { if (null != refund.getMerchantRefNum() && !refund.getMerchantRefNum().isEmpty()) { queryStr.put(MERCHANT_REF_NUM, refund.getMerchantRefNum()); } } if (null != filter) { if (null != filter.getLimit()) { queryStr.put(LIMIT, filter.getLimit().toString()); } if (null != filter.getOffset()) { queryStr.put(OFFSET, filter.getOffset().toString()); } if (null != filter.getStartDate()) { queryStr.put(START_DATE, filter.getStartDate()); } if (null != filter.getEndDate()) { queryStr.put(END_DATE, filter.getEndDate()); } } Request request = Request.builder() .uri(prepareUri(REFUND_PATH)) .method(Request.RequestType.GET) .queryStr(queryStr) .build(); final RefundPagerator response = client.processRequest(request, RefundPagerator.class); response.setClient(client); return response; }
final Pagerator<Refund> function(final Refund refund, final Filter filter) throws IOException, OptimalException { final HashMap<String, String> queryStr = new HashMap<String, String>(); if (null != refund) { if (null != refund.getMerchantRefNum() && !refund.getMerchantRefNum().isEmpty()) { queryStr.put(MERCHANT_REF_NUM, refund.getMerchantRefNum()); } } if (null != filter) { if (null != filter.getLimit()) { queryStr.put(LIMIT, filter.getLimit().toString()); } if (null != filter.getOffset()) { queryStr.put(OFFSET, filter.getOffset().toString()); } if (null != filter.getStartDate()) { queryStr.put(START_DATE, filter.getStartDate()); } if (null != filter.getEndDate()) { queryStr.put(END_DATE, filter.getEndDate()); } } Request request = Request.builder() .uri(prepareUri(REFUND_PATH)) .method(Request.RequestType.GET) .queryStr(queryStr) .build(); final RefundPagerator response = client.processRequest(request, RefundPagerator.class); response.setClient(client); return response; }
/** * Get matching refunds. * * @param refund the refund * @param filter the filter * @return Pagerator< Refund > * @throws IOException Signals that an I/O exception has occurred. * @throws OptimalException the optimal exception */
Get matching refunds
getRefunds
{ "repo_name": "OptimalPayments/Java_SDK", "path": "NetBanxSDK/src/main/java/com/optimalpayments/cardpayments/CardPaymentsService.java", "license": "mit", "size": 24566 }
[ "com.optimalpayments.cardpayments.impl.RefundPagerator", "com.optimalpayments.common.OptimalException", "com.optimalpayments.common.Pagerator", "com.optimalpayments.common.impl.Request", "java.io.IOException", "java.util.HashMap" ]
import com.optimalpayments.cardpayments.impl.RefundPagerator; import com.optimalpayments.common.OptimalException; import com.optimalpayments.common.Pagerator; import com.optimalpayments.common.impl.Request; import java.io.IOException; import java.util.HashMap;
import com.optimalpayments.cardpayments.impl.*; import com.optimalpayments.common.*; import com.optimalpayments.common.impl.*; import java.io.*; import java.util.*;
[ "com.optimalpayments.cardpayments", "com.optimalpayments.common", "java.io", "java.util" ]
com.optimalpayments.cardpayments; com.optimalpayments.common; java.io; java.util;
2,496,020
public Set getProhibitedACAttributes() { return Collections.unmodifiableSet(prohibitedACAttributes); }
Set function() { return Collections.unmodifiableSet(prohibitedACAttributes); }
/** * Returns the attribute certificates which are not allowed. * <p> * The returned <code>Set</code> is immutable and contains * <code>String</code>s with the OIDs. * * @return Returns the prohibited AC attributes. Is never <code>null</code>. */
Returns the attribute certificates which are not allowed. The returned <code>Set</code> is immutable and contains <code>String</code>s with the OIDs
getProhibitedACAttributes
{ "repo_name": "bullda/DroidText", "path": "src/bouncycastle/repack/org/bouncycastle/x509/ExtendedPKIXParameters.java", "license": "lgpl-3.0", "size": 21507 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
437,455
public void createEmpty() throws IOException { Version luceneVersion = indexSettings.getIndexVersionCreated().luceneVersion; metadataLock.writeLock().lock(); try (IndexWriter writer = newTemporaryEmptyIndexWriter(directory, luceneVersion)) { final Map<String, String> map = new HashMap<>(); map.put(Engine.HISTORY_UUID_KEY, UUIDs.randomBase64UUID()); map.put(SequenceNumbers.LOCAL_CHECKPOINT_KEY, Long.toString(SequenceNumbers.NO_OPS_PERFORMED)); map.put(SequenceNumbers.MAX_SEQ_NO, Long.toString(SequenceNumbers.NO_OPS_PERFORMED)); map.put(Engine.MAX_UNSAFE_AUTO_ID_TIMESTAMP_COMMIT_ID, "-1"); updateCommitData(writer, map); } finally { metadataLock.writeLock().unlock(); } }
void function() throws IOException { Version luceneVersion = indexSettings.getIndexVersionCreated().luceneVersion; metadataLock.writeLock().lock(); try (IndexWriter writer = newTemporaryEmptyIndexWriter(directory, luceneVersion)) { final Map<String, String> map = new HashMap<>(); map.put(Engine.HISTORY_UUID_KEY, UUIDs.randomBase64UUID()); map.put(SequenceNumbers.LOCAL_CHECKPOINT_KEY, Long.toString(SequenceNumbers.NO_OPS_PERFORMED)); map.put(SequenceNumbers.MAX_SEQ_NO, Long.toString(SequenceNumbers.NO_OPS_PERFORMED)); map.put(Engine.MAX_UNSAFE_AUTO_ID_TIMESTAMP_COMMIT_ID, "-1"); updateCommitData(writer, map); } finally { metadataLock.writeLock().unlock(); } }
/** * creates an empty lucene index and a corresponding empty translog. Any existing data will be deleted. */
creates an empty lucene index and a corresponding empty translog. Any existing data will be deleted
createEmpty
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/store/Store.java", "license": "apache-2.0", "size": 74189 }
[ "java.io.IOException", "java.util.HashMap", "java.util.Map", "org.apache.lucene.index.IndexWriter", "org.apache.lucene.util.Version", "org.elasticsearch.common.UUIDs", "org.elasticsearch.index.engine.Engine", "org.elasticsearch.index.seqno.SequenceNumbers" ]
import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.util.Version; import org.elasticsearch.common.UUIDs; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.seqno.SequenceNumbers;
import java.io.*; import java.util.*; import org.apache.lucene.index.*; import org.apache.lucene.util.*; import org.elasticsearch.common.*; import org.elasticsearch.index.engine.*; import org.elasticsearch.index.seqno.*;
[ "java.io", "java.util", "org.apache.lucene", "org.elasticsearch.common", "org.elasticsearch.index" ]
java.io; java.util; org.apache.lucene; org.elasticsearch.common; org.elasticsearch.index;
1,281,953
@SuppressWarnings("unchecked") public void testQueryRowCount() throws ApplicationException { IvlIntDataType searchObject = new IvlIntDataType(); Collection results = search("gov.nih.nci.cacoresdk.domain.other.datatype.IvlIntDataType",searchObject ); assertNotNull(results); assertEquals(21,results.size()); }
@SuppressWarnings(STR) void function() throws ApplicationException { IvlIntDataType searchObject = new IvlIntDataType(); Collection results = search(STR,searchObject ); assertNotNull(results); assertEquals(21,results.size()); }
/** * Uses Nested Search Criteria for search * Verifies that the results are returned * Verifies size of the result set * * @throws ApplicationException */
Uses Nested Search Criteria for search Verifies that the results are returned Verifies size of the result set
testQueryRowCount
{ "repo_name": "NCIP/cacore-sdk", "path": "sdk-toolkit/iso-example-project/junit/src/test/gov/nih/nci/cacoresdk/domain/other/datatype/IvlIntDataTypeTest.java", "license": "bsd-3-clause", "size": 18696 }
[ "gov.nih.nci.cacoresdk.domain.other.datatype.IvlIntDataType", "gov.nih.nci.system.applicationservice.ApplicationException", "java.util.Collection" ]
import gov.nih.nci.cacoresdk.domain.other.datatype.IvlIntDataType; import gov.nih.nci.system.applicationservice.ApplicationException; import java.util.Collection;
import gov.nih.nci.cacoresdk.domain.other.datatype.*; import gov.nih.nci.system.applicationservice.*; import java.util.*;
[ "gov.nih.nci", "java.util" ]
gov.nih.nci; java.util;
2,553,631
protected static Instances getDataDictionaryAsInstances(Document doc) throws Exception { // TO-DO: definition of missing values (see below) ArrayList<Attribute> attInfo = new ArrayList<Attribute>(); NodeList dataDictionary = doc.getElementsByTagName("DataField"); for (int i = 0; i < dataDictionary.getLength(); i++) { Node dataField = dataDictionary.item(i); if (dataField.getNodeType() == Node.ELEMENT_NODE) { Element dataFieldEl = (Element) dataField; String name = dataFieldEl.getAttribute("name"); String type = dataFieldEl.getAttribute("optype"); Attribute tempAtt = null; if (name != null && type != null) { if (type.equals("continuous")) { tempAtt = new Attribute(name); } else if (type.equals("categorical") || type.equals("ordinal")) { NodeList valueList = dataFieldEl.getElementsByTagName("Value"); if (valueList == null || valueList.getLength() == 0) { // assume that categorical values will be revealed in the actual // model. // Create a string attribute for now ArrayList<String> nullV = null; tempAtt = new Attribute(name, nullV); } else { // add the values (if defined as "valid") ArrayList<String> valueVector = new ArrayList<String>(); for (int j = 0; j < valueList.getLength(); j++) { Node val = valueList.item(j); if (val.getNodeType() == Node.ELEMENT_NODE) { // property is optional (default value is "valid") String property = ((Element) val).getAttribute("property"); if (property == null || property.length() == 0 || property.equals("valid")) { String value = ((Element) val).getAttribute("value"); valueVector.add(value); } else { // Just ignore invalid or missing value definitions for // now... // TO-DO: implement Value meta data with missing/invalid // value defs. } } } tempAtt = new Attribute(name, valueVector); } } else { throw new Exception("[PMMLFactory] can't handle " + type + "attributes."); } attInfo.add(tempAtt); } } } // TO-DO: check whether certain values are declared to represent // missing or invalid values (applies to both categorical and continuous // attributes // create the Instances structure Instances insts = new Instances("dataDictionary", attInfo, 0); // System.out.println(insts); return insts; }
static Instances function(Document doc) throws Exception { ArrayList<Attribute> attInfo = new ArrayList<Attribute>(); NodeList dataDictionary = doc.getElementsByTagName(STR); for (int i = 0; i < dataDictionary.getLength(); i++) { Node dataField = dataDictionary.item(i); if (dataField.getNodeType() == Node.ELEMENT_NODE) { Element dataFieldEl = (Element) dataField; String name = dataFieldEl.getAttribute("name"); String type = dataFieldEl.getAttribute(STR); Attribute tempAtt = null; if (name != null && type != null) { if (type.equals(STR)) { tempAtt = new Attribute(name); } else if (type.equals(STR) type.equals(STR)) { NodeList valueList = dataFieldEl.getElementsByTagName("Value"); if (valueList == null valueList.getLength() == 0) { ArrayList<String> nullV = null; tempAtt = new Attribute(name, nullV); } else { ArrayList<String> valueVector = new ArrayList<String>(); for (int j = 0; j < valueList.getLength(); j++) { Node val = valueList.item(j); if (val.getNodeType() == Node.ELEMENT_NODE) { String property = ((Element) val).getAttribute(STR); if (property == null property.length() == 0 property.equals("valid")) { String value = ((Element) val).getAttribute("value"); valueVector.add(value); } else { } } } tempAtt = new Attribute(name, valueVector); } } else { throw new Exception(STR + type + STR); } attInfo.add(tempAtt); } } } Instances insts = new Instances(STR, attInfo, 0); return insts; }
/** * Get the data dictionary as an Instances object * * @param doc the Document encapsulating the pmml * @return the data dictionary as an Instances object * @throws Exception if there are fields that are not continuous, ordinal or * categorical in the data dictionary */
Get the data dictionary as an Instances object
getDataDictionaryAsInstances
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "src/weka/core/pmml/PMMLFactory.java", "license": "gpl-3.0", "size": 20765 }
[ "java.util.ArrayList", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node", "org.w3c.dom.NodeList" ]
import java.util.ArrayList; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
import java.util.*; import org.w3c.dom.*;
[ "java.util", "org.w3c.dom" ]
java.util; org.w3c.dom;
1,932,617
public void setRuntimeProperties(Map<String, String> runtimePropertyMap) { this.runtimePropertyMap = runtimePropertyMap; }
void function(Map<String, String> runtimePropertyMap) { this.runtimePropertyMap = runtimePropertyMap; }
/** * * Set runtime properties. * * @param runtimePropertyMap */
Set runtime properties
setRuntimeProperties
{ "repo_name": "capitalone/Hydrograph", "path": "hydrograph.ui/hydrograph.ui.propertywindow/src/main/java/hydrograph/ui/propertywindow/widgets/customwidgets/runtimeproperty/RuntimePropertyDialog.java", "license": "apache-2.0", "size": 21285 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,333,018
public void calculateBatchIdAndDateRange() throws KettleTransException { TransLogTable transLogTable = transMeta.getTransLogTable(); currentDate = new Date(); logDate = new Date(); startDate = Const.MIN_DATE; endDate = currentDate; DatabaseMeta logConnection = transLogTable.getDatabaseMeta(); String logTable = environmentSubstitute( transLogTable.getActualTableName() ); String logSchema = environmentSubstitute( transLogTable.getActualSchemaName() ); try { if ( logConnection != null ) { String logSchemaAndTable = logConnection.getQuotedSchemaTableCombination( logSchema, logTable ); if ( Utils.isEmpty( logTable ) ) { // It doesn't make sense to start database logging without a table // to log to. throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.NoLogTableDefined" ) ); } if ( Utils.isEmpty( transMeta.getName() ) && logConnection != null && logTable != null ) { throw new KettleException( BaseMessages.getString( PKG, "Trans.Exception.NoTransnameAvailableForLogging" ) ); } transLogTableDatabaseConnection = new Database( this, logConnection ); transLogTableDatabaseConnection.shareVariablesWith( this ); if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.OpeningLogConnection", "" + logConnection ) ); } transLogTableDatabaseConnection.connect(); transLogTableDatabaseConnection.setCommit( logCommitSize ); // See if we have to add a batch id... // Do this first, before anything else to lock the complete table exclusively // if ( transLogTable.isBatchIdUsed() ) { Long id_batch = logConnection.getNextBatchId( transLogTableDatabaseConnection, logSchema, logTable, transLogTable .getKeyField().getFieldName() ); setBatchId( id_batch.longValue() ); } // // Get the date range from the logging table: from the last end_date to now. (currentDate) // Object[] lastr = transLogTableDatabaseConnection.getLastLogDate( logSchemaAndTable, transMeta.getName(), false, LogStatus.END ); if ( lastr != null && lastr.length > 0 ) { startDate = (Date) lastr[0]; if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.StartDateFound" ) + startDate ); } } // // OK, we have a date-range. // However, perhaps we need to look at a table before we make a final judgment? // if ( transMeta.getMaxDateConnection() != null && transMeta.getMaxDateTable() != null && transMeta .getMaxDateTable().length() > 0 && transMeta.getMaxDateField() != null && transMeta.getMaxDateField() .length() > 0 ) { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.LookingForMaxdateConnection", "" + transMeta .getMaxDateConnection() ) ); } DatabaseMeta maxcon = transMeta.getMaxDateConnection(); if ( maxcon != null ) { Database maxdb = new Database( this, maxcon ); maxdb.shareVariablesWith( this ); try { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.OpeningMaximumDateConnection" ) ); } maxdb.connect(); maxdb.setCommit( logCommitSize ); // // Determine the endDate by looking at a field in a table... // String sql = "SELECT MAX(" + transMeta.getMaxDateField() + ") FROM " + transMeta.getMaxDateTable(); RowMetaAndData r1 = maxdb.getOneRow( sql ); if ( r1 != null ) { // OK, we have a value, what's the offset? Date maxvalue = r1.getRowMeta().getDate( r1.getData(), 0 ); if ( maxvalue != null ) { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.LastDateFoundOnTheMaxdateConnection" ) + r1 ); } endDate.setTime( (long) ( maxvalue.getTime() + ( transMeta.getMaxDateOffset() * 1000 ) ) ); } } else { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.NoLastDateFoundOnTheMaxdateConnection" ) ); } } } catch ( KettleException e ) { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.ErrorConnectingToDatabase", "" + transMeta.getMaxDateConnection() ), e ); } finally { maxdb.disconnect(); } } else { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.MaximumDateConnectionCouldNotBeFound", "" + transMeta.getMaxDateConnection() ) ); } } // Determine the last date of all dependend tables... // Get the maximum in depdate... if ( transMeta.nrDependencies() > 0 ) { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.CheckingForMaxDependencyDate" ) ); } // // Maybe one of the tables where this transformation is dependent on has changed? // If so we need to change the start-date! // depDate = Const.MIN_DATE; Date maxdepdate = Const.MIN_DATE; if ( lastr != null && lastr.length > 0 ) { Date dep = (Date) lastr[1]; // #1: last depdate if ( dep != null ) { maxdepdate = dep; depDate = dep; } } for ( int i = 0; i < transMeta.nrDependencies(); i++ ) { TransDependency td = transMeta.getDependency( i ); DatabaseMeta depcon = td.getDatabase(); if ( depcon != null ) { Database depdb = new Database( this, depcon ); try { depdb.connect(); depdb.setCommit( logCommitSize ); String sql = "SELECT MAX(" + td.getFieldname() + ") FROM " + td.getTablename(); RowMetaAndData r1 = depdb.getOneRow( sql ); if ( r1 != null ) { // OK, we have a row, get the result! Date maxvalue = (Date) r1.getData()[0]; if ( maxvalue != null ) { if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.FoundDateFromTable", td.getTablename(), "." + td.getFieldname(), " = " + maxvalue.toString() ) ); } if ( maxvalue.getTime() > maxdepdate.getTime() ) { maxdepdate = maxvalue; } } else { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.UnableToGetDependencyInfoFromDB", td.getDatabase().getName() + ".", td .getTablename() + ".", td.getFieldname() ) ); } } else { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.UnableToGetDependencyInfoFromDB", td.getDatabase().getName() + ".", td .getTablename() + ".", td.getFieldname() ) ); } } catch ( KettleException e ) { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.ErrorInDatabase", "" + td .getDatabase() ), e ); } finally { depdb.disconnect(); } } else { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.ConnectionCouldNotBeFound", "" + td.getDatabase() ) ); } if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.Maxdepdate" ) + ( XMLHandler.date2string( maxdepdate ) ) ); } } // OK, so we now have the maximum depdate; // If it is larger, it means we have to read everything back in again. // Maybe something has changed that we need! // if ( maxdepdate.getTime() > depDate.getTime() ) { depDate = maxdepdate; startDate = Const.MIN_DATE; } } else { depDate = currentDate; } } // OK, now we have a date-range. See if we need to set a maximum! if ( transMeta.getMaxDateDifference() > 0.0 && // Do we have a difference specified? startDate.getTime() > Const.MIN_DATE.getTime() // Is the startdate > Minimum? ) { // See if the end-date is larger then Start_date + DIFF? Date maxdesired = new Date( startDate.getTime() + ( (long) transMeta.getMaxDateDifference() * 1000 ) ); // If this is the case: lower the end-date. Pick up the next 'region' next time around. // We do this to limit the workload in a single update session (e.g. for large fact tables) // if ( endDate.compareTo( maxdesired ) > 0 ) { endDate = maxdesired; } } } catch ( KettleException e ) { throw new KettleTransException( BaseMessages.getString( PKG, "Trans.Exception.ErrorCalculatingDateRange", logTable ), e ); } // Be careful, We DO NOT close the trans log table database connection!!! // It's closed later in beginProcessing() to prevent excessive connect/disconnect repetitions. }
void function() throws KettleTransException { TransLogTable transLogTable = transMeta.getTransLogTable(); currentDate = new Date(); logDate = new Date(); startDate = Const.MIN_DATE; endDate = currentDate; DatabaseMeta logConnection = transLogTable.getDatabaseMeta(); String logTable = environmentSubstitute( transLogTable.getActualTableName() ); String logSchema = environmentSubstitute( transLogTable.getActualSchemaName() ); try { if ( logConnection != null ) { String logSchemaAndTable = logConnection.getQuotedSchemaTableCombination( logSchema, logTable ); if ( Utils.isEmpty( logTable ) ) { throw new KettleTransException( BaseMessages.getString( PKG, STR ) ); } if ( Utils.isEmpty( transMeta.getName() ) && logConnection != null && logTable != null ) { throw new KettleException( BaseMessages.getString( PKG, STR ) ); } transLogTableDatabaseConnection = new Database( this, logConnection ); transLogTableDatabaseConnection.shareVariablesWith( this ); if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, STR, STRTrans.Log.StartDateFoundSTRTrans.Log.LookingForMaxdateConnectionSTRSTRTrans.Log.OpeningMaximumDateConnectionSTRTrans.Log.LastDateFoundOnTheMaxdateConnectionSTRTrans.Log.NoLastDateFoundOnTheMaxdateConnectionSTRTrans.Exception.ErrorConnectingToDatabaseSTRSTRTrans.Exception.MaximumDateConnectionCouldNotBeFoundSTRSTRTrans.Log.CheckingForMaxDependencyDateSTRSELECT MAX(STR) FROM STRTrans.Log.FoundDateFromTableSTR.STR = STRTrans.Exception.UnableToGetDependencyInfoFromDBSTR.STR.STRTrans.Exception.UnableToGetDependencyInfoFromDBSTR.STR.STRTrans.Exception.ErrorInDatabaseSTRSTRTrans.Exception.ConnectionCouldNotBeFoundSTRSTRTrans.Log.MaxdepdateSTRTrans.Exception.ErrorCalculatingDateRange", logTable ), e ); } }
/** * Calculate the batch id and date range for the transformation. * * @throws KettleTransException * if there are any errors during calculation */
Calculate the batch id and date range for the transformation
calculateBatchIdAndDateRange
{ "repo_name": "mdamour1976/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 199226 }
[ "java.util.Date", "org.pentaho.di.core.Const", "org.pentaho.di.core.database.Database", "org.pentaho.di.core.database.DatabaseMeta", "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.core.exception.KettleTransException", "org.pentaho.di.core.logging.TransLogTable", "org.pentaho.di.core.util.Utils", "org.pentaho.di.i18n.BaseMessages" ]
import java.util.Date; import org.pentaho.di.core.Const; import org.pentaho.di.core.database.Database; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleTransException; import org.pentaho.di.core.logging.TransLogTable; import org.pentaho.di.core.util.Utils; import org.pentaho.di.i18n.BaseMessages;
import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.database.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.logging.*; import org.pentaho.di.core.util.*; import org.pentaho.di.i18n.*;
[ "java.util", "org.pentaho.di" ]
java.util; org.pentaho.di;
384,252
public static List<alluxio.grpc.table.FieldSchema> toProto(List<Column> glueCloumns) { if (glueCloumns == null) { return Collections.emptyList(); } List<alluxio.grpc.table.FieldSchema> list = new ArrayList<>(); for (Column column:glueCloumns) { alluxio.grpc.table.FieldSchema.Builder builder = alluxio.grpc.table.FieldSchema.newBuilder() .setName(column.getName()) .setType(column.getType()); if (column.getComment() != null) { builder.setComment(column.getComment()); } list.add(builder.build()); } return list; }
static List<alluxio.grpc.table.FieldSchema> function(List<Column> glueCloumns) { if (glueCloumns == null) { return Collections.emptyList(); } List<alluxio.grpc.table.FieldSchema> list = new ArrayList<>(); for (Column column:glueCloumns) { alluxio.grpc.table.FieldSchema.Builder builder = alluxio.grpc.table.FieldSchema.newBuilder() .setName(column.getName()) .setType(column.getType()); if (column.getComment() != null) { builder.setComment(column.getComment()); } list.add(builder.build()); } return list; }
/** * Convert the Glue FieldSchema to Alluxio FieldSchema. * * @param glueCloumns Glue FiledSchema * @return list of Alluxio FieldSchema */
Convert the Glue FieldSchema to Alluxio FieldSchema
toProto
{ "repo_name": "EvilMcJerkface/alluxio", "path": "table/server/underdb/glue/src/main/java/alluxio/table/under/glue/GlueUtils.java", "license": "apache-2.0", "size": 15207 }
[ "com.amazonaws.services.glue.model.Column", "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import com.amazonaws.services.glue.model.Column; import java.util.ArrayList; import java.util.Collections; import java.util.List;
import com.amazonaws.services.glue.model.*; import java.util.*;
[ "com.amazonaws.services", "java.util" ]
com.amazonaws.services; java.util;
1,958,723
public void setSeriesOutlineStroke(int series, Stroke stroke, boolean notify) { this.outlineStrokeList.setStroke(series, stroke); if (notify) { fireChangeEvent(); } }
void function(int series, Stroke stroke, boolean notify) { this.outlineStrokeList.setStroke(series, stroke); if (notify) { fireChangeEvent(); } }
/** * Sets the outline stroke for a series and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index. * @param stroke the stroke (<code>null</code> permitted). * @param notify notify listeners? * * @see #getSeriesOutlineStroke(int) */
Sets the outline stroke for a series and, if requested, sends a <code>RendererChangeEvent</code> to all registered listeners
setSeriesOutlineStroke
{ "repo_name": "sebkur/JFreeChart", "path": "src/main/java/org/jfree/chart/renderer/AbstractRenderer.java", "license": "lgpl-3.0", "size": 142687 }
[ "java.awt.Stroke" ]
import java.awt.Stroke;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,469,473
private static ParameterIssuerProviderInterface getBumpedProvider(final ParameterIssuerProviderInterface data) { if (data instanceof IssuerProviderDiscount) { final IssuerProviderDiscount discount = ((IssuerProviderDiscount) data); final MulticurveProviderDiscount multicurveProvider = discount.getMulticurveProvider(); final IssuerProviderDiscount bumped = new IssuerProviderDiscount(new MulticurveProviderDiscount(multicurveProvider.getFxRates())); for (final Map.Entry<Currency, YieldAndDiscountCurve> entry : multicurveProvider.getDiscountingCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException("Can only bump YieldCurves"); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<IborIndex, YieldAndDiscountCurve> entry : multicurveProvider.getForwardIborCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException("Can only bump YieldCurves"); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<IndexON, YieldAndDiscountCurve> entry : multicurveProvider.getForwardONCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException("Can only bump YieldCurves"); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<Pair<Object, LegalEntityFilter<LegalEntity>>, YieldAndDiscountCurve> entry : discount.getIssuerCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException("Can only bump YieldCurves"); } bumped.setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } return bumped; } throw new UnsupportedOperationException("Cannot bump curves of type " + data.getClass()); }
static ParameterIssuerProviderInterface function(final ParameterIssuerProviderInterface data) { if (data instanceof IssuerProviderDiscount) { final IssuerProviderDiscount discount = ((IssuerProviderDiscount) data); final MulticurveProviderDiscount multicurveProvider = discount.getMulticurveProvider(); final IssuerProviderDiscount bumped = new IssuerProviderDiscount(new MulticurveProviderDiscount(multicurveProvider.getFxRates())); for (final Map.Entry<Currency, YieldAndDiscountCurve> entry : multicurveProvider.getDiscountingCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException(STR); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<IborIndex, YieldAndDiscountCurve> entry : multicurveProvider.getForwardIborCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException(STR); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<IndexON, YieldAndDiscountCurve> entry : multicurveProvider.getForwardONCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException(STR); } bumped.getMulticurveProvider().setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } for (final Map.Entry<Pair<Object, LegalEntityFilter<LegalEntity>>, YieldAndDiscountCurve> entry : discount.getIssuerCurves().entrySet()) { if (!(entry.getValue() instanceof YieldCurve)) { throw new IllegalArgumentException(STR); } bumped.setCurve(entry.getKey(), YieldCurveUtils.withParallelShift((YieldCurve) entry.getValue(), BP1, ShiftType.ABSOLUTE)); } return bumped; } throw new UnsupportedOperationException(STR + data.getClass()); }
/** * Bumps every curve in a provider. This method will be replaced when the curve providers * have been refactored. * @param data The curves * @return A provider with each curve bumped by +1 bp */
Bumps every curve in a provider. This method will be replaced when the curve providers have been refactored
getBumpedProvider
{ "repo_name": "DevStreet/FinanceAnalytics", "path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/bond/calculator/BondBillTrsGammaPV01Calculator.java", "license": "apache-2.0", "size": 9316 }
[ "com.opengamma.analytics.ShiftType", "com.opengamma.analytics.financial.instrument.index.IborIndex", "com.opengamma.analytics.financial.instrument.index.IndexON", "com.opengamma.analytics.financial.legalentity.LegalEntity", "com.opengamma.analytics.financial.legalentity.LegalEntityFilter", "com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve", "com.opengamma.analytics.financial.model.interestrate.curve.YieldCurve", "com.opengamma.analytics.financial.model.interestrate.curve.YieldCurveUtils", "com.opengamma.analytics.financial.provider.description.interestrate.IssuerProviderDiscount", "com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderDiscount", "com.opengamma.analytics.financial.provider.description.interestrate.ParameterIssuerProviderInterface", "com.opengamma.util.money.Currency", "com.opengamma.util.tuple.Pair", "java.util.Map" ]
import com.opengamma.analytics.ShiftType; import com.opengamma.analytics.financial.instrument.index.IborIndex; import com.opengamma.analytics.financial.instrument.index.IndexON; import com.opengamma.analytics.financial.legalentity.LegalEntity; import com.opengamma.analytics.financial.legalentity.LegalEntityFilter; import com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve; import com.opengamma.analytics.financial.model.interestrate.curve.YieldCurve; import com.opengamma.analytics.financial.model.interestrate.curve.YieldCurveUtils; import com.opengamma.analytics.financial.provider.description.interestrate.IssuerProviderDiscount; import com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderDiscount; import com.opengamma.analytics.financial.provider.description.interestrate.ParameterIssuerProviderInterface; import com.opengamma.util.money.Currency; import com.opengamma.util.tuple.Pair; import java.util.Map;
import com.opengamma.analytics.*; import com.opengamma.analytics.financial.instrument.index.*; import com.opengamma.analytics.financial.legalentity.*; import com.opengamma.analytics.financial.model.interestrate.curve.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import com.opengamma.util.money.*; import com.opengamma.util.tuple.*; import java.util.*;
[ "com.opengamma.analytics", "com.opengamma.util", "java.util" ]
com.opengamma.analytics; com.opengamma.util; java.util;
1,828,903
@Override public CategoryURLGenerator getBaseItemURLGenerator() { return this.baseItemURLGenerator; }
CategoryURLGenerator function() { return this.baseItemURLGenerator; }
/** * Returns the base item URL generator. * * @return The item URL generator. * * @see #setBaseItemURLGenerator(CategoryURLGenerator) */
Returns the base item URL generator
getBaseItemURLGenerator
{ "repo_name": "ciaracdb/LOG6302", "path": "examples/jfreechart/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java", "license": "apache-2.0", "size": 71021 }
[ "org.jfree.chart.urls.CategoryURLGenerator" ]
import org.jfree.chart.urls.CategoryURLGenerator;
import org.jfree.chart.urls.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,478,279
private File writeShortCut(String target, String shortCutDef) { File targetPath = new File(target.substring(0, target.lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } File targetFileName = new File(target); File backupFile = new File(targetPath + File.separator + "." + targetFileName.getName() + System.currentTimeMillis()); if (targetFileName.exists()) { try { // create a hidden backup.file of the existing shortcut with a timestamp name. copyTo(targetFileName, backupFile); // + System.e ); targetFileName.delete(); } catch (IOException e3) { System.out.println("cannot create backup file " + backupFile + " of " + targetFileName); // e3.printStackTrace(); } } FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { System.out.println(e1.getMessage()); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } return targetFileName; }
File function(String target, String shortCutDef) { File targetPath = new File(target.substring(0, target.lastIndexOf(File.separatorChar))); if (!targetPath.exists()) { targetPath.mkdirs(); this.createdDirectory = targetPath.toString(); } File targetFileName = new File(target); File backupFile = new File(targetPath + File.separator + "." + targetFileName.getName() + System.currentTimeMillis()); if (targetFileName.exists()) { try { copyTo(targetFileName, backupFile); targetFileName.delete(); } catch (IOException e3) { System.out.println(STR + backupFile + STR + targetFileName); } } FileWriter fileWriter = null; try { fileWriter = new FileWriter(targetFileName); } catch (IOException e1) { System.out.println(e1.getMessage()); } try { fileWriter.write(shortCutDef); } catch (IOException e) { e.printStackTrace(); } try { fileWriter.close(); } catch (IOException e2) { e2.printStackTrace(); } return targetFileName; }
/** * Writes the given Shortcutdefinition to the given Target. Returns the written File. * * @param target * @param shortCutDef * * @return the File of the written shortcut. */
Writes the given Shortcutdefinition to the given Target. Returns the written File
writeShortCut
{ "repo_name": "RomRaider/original.mirror", "path": "installer/IzPack/src/lib/com/izforge/izpack/util/os/Unix_Shortcut.java", "license": "gpl-2.0", "size": 33355 }
[ "java.io.File", "java.io.FileWriter", "java.io.IOException" ]
import java.io.File; import java.io.FileWriter; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
814,058
public void assertStartsWith(AssertionInfo info, char[] actual, char[] sequence) { arrays.assertStartsWith(info, failures, actual, sequence); }
void function(AssertionInfo info, char[] actual, char[] sequence) { arrays.assertStartsWith(info, failures, actual, sequence); }
/** * Verifies that the given array starts with the given sequence of values, without any other values between them. * Similar to <code>{@link #assertContainsSequence(AssertionInfo, char[], char[])}</code>, but it also verifies that * the first element in the sequence is also the first element of the given array. * * @param info contains information about the assertion. * @param actual the given array. * @param sequence the sequence of values to look for. * @throws NullPointerException if the given argument is {@code null}. * @throws IllegalArgumentException if the given argument is an empty array. * @throws AssertionError if the given array is {@code null}. * @throws AssertionError if the given array does not start with the given sequence of values. */
Verifies that the given array starts with the given sequence of values, without any other values between them. Similar to <code><code>#assertContainsSequence(AssertionInfo, char[], char[])</code></code>, but it also verifies that the first element in the sequence is also the first element of the given array
assertStartsWith
{ "repo_name": "yurloc/assertj-core", "path": "src/main/java/org/assertj/core/internal/CharArrays.java", "license": "apache-2.0", "size": 14166 }
[ "org.assertj.core.api.AssertionInfo" ]
import org.assertj.core.api.AssertionInfo;
import org.assertj.core.api.*;
[ "org.assertj.core" ]
org.assertj.core;
1,680,314
protected void sequence_ModelLoad(EObject context, ModelLoad semanticObject) { if(errorAcceptor != null) { if(transientValues.isValueTransient(semanticObject, MMDSLPackage.eINSTANCE.getModelLoad_Modelname()) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MMDSLPackage.eINSTANCE.getModelLoad_Modelname())); } INodesForEObjectProvider nodes = createNodeProvider(semanticObject); SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); feeder.accept(grammarAccess.getModelLoadAccess().getModelnameModelCreateQualifiedNameParserRuleCall_1_0_1(), semanticObject.getModelname()); feeder.finish(); }
void function(EObject context, ModelLoad semanticObject) { if(errorAcceptor != null) { if(transientValues.isValueTransient(semanticObject, MMDSLPackage.eINSTANCE.getModelLoad_Modelname()) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MMDSLPackage.eINSTANCE.getModelLoad_Modelname())); } INodesForEObjectProvider nodes = createNodeProvider(semanticObject); SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); feeder.accept(grammarAccess.getModelLoadAccess().getModelnameModelCreateQualifiedNameParserRuleCall_1_0_1(), semanticObject.getModelname()); feeder.finish(); }
/** * Constraint: * modelname=[ModelCreate|QualifiedName] */
Constraint: modelname=[ModelCreate|QualifiedName]
sequence_ModelLoad
{ "repo_name": "niksavis/mm-dsl", "path": "org.xtext.nv.dsl/src-gen/org/xtext/nv/dsl/serializer/MMDSLSemanticSequencer.java", "license": "epl-1.0", "size": 190481 }
[ "org.eclipse.emf.ecore.EObject", "org.eclipse.xtext.serializer.acceptor.SequenceFeeder", "org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider", "org.eclipse.xtext.serializer.sequencer.ITransientValueService", "org.xtext.nv.dsl.mMDSL.MMDSLPackage", "org.xtext.nv.dsl.mMDSL.ModelLoad" ]
import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider; import org.eclipse.xtext.serializer.sequencer.ITransientValueService; import org.xtext.nv.dsl.mMDSL.MMDSLPackage; import org.xtext.nv.dsl.mMDSL.ModelLoad;
import org.eclipse.emf.ecore.*; import org.eclipse.xtext.serializer.acceptor.*; import org.eclipse.xtext.serializer.sequencer.*; import org.xtext.nv.dsl.*;
[ "org.eclipse.emf", "org.eclipse.xtext", "org.xtext.nv" ]
org.eclipse.emf; org.eclipse.xtext; org.xtext.nv;
1,125,880
@Override public List<InsurancesHasPlacesrisks> getInsurancesHasPlacesrisksByInsurancesId( int id) { List list = getSessionFactory() .getCurrentSession() .createQuery( "from InsurancesHasPlacesrisks where insurances_idinsurances=?") .setParameter(0, id).list(); return list; }
List<InsurancesHasPlacesrisks> function( int id) { List list = getSessionFactory() .getCurrentSession() .createQuery( STR) .setParameter(0, id).list(); return list; }
/** * Get InsurancesHasPlacesrisks * * @param int Id * @return List - InsurancesHasPlacesrisks list */
Get InsurancesHasPlacesrisks
getInsurancesHasPlacesrisksByInsurancesId
{ "repo_name": "machadolucas/watchout", "path": "src/main/java/com/riskvis/db/dao/impl/InsurancesHasPlacesrisksDAO.java", "license": "apache-2.0", "size": 3391 }
[ "com.riskvis.entity.InsurancesHasPlacesrisks", "java.util.List" ]
import com.riskvis.entity.InsurancesHasPlacesrisks; import java.util.List;
import com.riskvis.entity.*; import java.util.*;
[ "com.riskvis.entity", "java.util" ]
com.riskvis.entity; java.util;
1,680,031
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException, NotConnectedException { ChatMetadata request = new ChatMetadata(); request.setType(IQ.Type.get); request.setTo(workgroupJID); request.setSessionID(sessionID); ChatMetadata response = connection.createPacketCollectorAndSend(request).nextResult(); return response.getMetadata(); }
Map<String, List<String>> function(String sessionID) throws XMPPException, NotConnectedException { ChatMetadata request = new ChatMetadata(); request.setType(IQ.Type.get); request.setTo(workgroupJID); request.setSessionID(sessionID); ChatMetadata response = connection.createPacketCollectorAndSend(request).nextResult(); return response.getMetadata(); }
/** * Query for metadata associated with a session id. * * @param sessionID the sessionID to query for. * @return Map a map of all metadata associated with the sessionID. * @throws XMPPException if an error occurs while getting information from the server. * @throws NotConnectedException */
Query for metadata associated with a session id
getChatMetadata
{ "repo_name": "Soo000/SooChat", "path": "src/org/jivesoftware/smackx/workgroup/agent/AgentSession.java", "license": "apache-2.0", "size": 45270 }
[ "java.util.List", "java.util.Map", "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smackx.workgroup.ext.history.ChatMetadata" ]
import java.util.List; import java.util.Map; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.workgroup.ext.history.ChatMetadata;
import java.util.*; import org.jivesoftware.smack.*; import org.jivesoftware.smackx.workgroup.ext.history.*;
[ "java.util", "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
java.util; org.jivesoftware.smack; org.jivesoftware.smackx;
2,886,335
public Student getStudent(String id) { String[] columns = {DBHelper.ID_FIELD_NAME, DBHelper.NAME_FIELD_NAME, DBHelper.LASTNAME_FIELD_NAME, DBHelper.PHOTO_FIELD_NAME}; Cursor cursor = db.query(DBHelper.STUDENT_TBL_NAME, columns, DBHelper.ID_FIELD_NAME + "=" + id, null, null, null, null); Student student = null; if(cursor.moveToFirst()) { try { student = new Student( context, cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3)); } catch (CheckFieldException e) { e.printStackTrace(); } } cursor.close(); return student; }
Student function(String id) { String[] columns = {DBHelper.ID_FIELD_NAME, DBHelper.NAME_FIELD_NAME, DBHelper.LASTNAME_FIELD_NAME, DBHelper.PHOTO_FIELD_NAME}; Cursor cursor = db.query(DBHelper.STUDENT_TBL_NAME, columns, DBHelper.ID_FIELD_NAME + "=" + id, null, null, null, null); Student student = null; if(cursor.moveToFirst()) { try { student = new Student( context, cursor.getInt(0), cursor.getString(1), cursor.getString(2), cursor.getString(3)); } catch (CheckFieldException e) { e.printStackTrace(); } } cursor.close(); return student; }
/** * Get student specified by id or null if not exist. * * @return The Student if exist. */
Get student specified by id or null if not exist
getStudent
{ "repo_name": "rgmf/LTN", "path": "src/es/rgmf/ltn/db/DBAdapter.java", "license": "gpl-3.0", "size": 69648 }
[ "android.database.Cursor", "es.rgmf.ltn.model.orm.CheckFieldException", "es.rgmf.ltn.model.orm.Student" ]
import android.database.Cursor; import es.rgmf.ltn.model.orm.CheckFieldException; import es.rgmf.ltn.model.orm.Student;
import android.database.*; import es.rgmf.ltn.model.orm.*;
[ "android.database", "es.rgmf.ltn" ]
android.database; es.rgmf.ltn;
252,624
public static boolean equal(final Object a, final Object b, final boolean ignoreCase) { if (a == b) { return true; } if (a == null || b == null) { return false; } if (ignoreCase) { if (a instanceof String && b instanceof String) { return ((String) a).equalsIgnoreCase((String) b); } } return Objects.deepEquals(a, b); }
static boolean function(final Object a, final Object b, final boolean ignoreCase) { if (a == b) { return true; } if (a == null b == null) { return false; } if (ignoreCase) { if (a instanceof String && b instanceof String) { return ((String) a).equalsIgnoreCase((String) b); } } return Objects.deepEquals(a, b); }
/** * A helper method for comparing objects for equality while handling nulls */
A helper method for comparing objects for equality while handling nulls
equal
{ "repo_name": "trohovsky/camel", "path": "camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java", "license": "apache-2.0", "size": 70972 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
1,326,700
private static Object parseScalar(String value, String type) { if ("String".equals(type)) { return value; } if ("Integer".equals(type)) { return Integer.parseInt(value); } if ("Long".equals(type)) { return Long.parseLong(value); } if ("Double".equals(type)) { return Double.parseDouble(value); } if ("Byte".equals(type)) { return Byte.parseByte(value); } if ("Short".equals(type)) { return Short.parseShort(value); } if ("Character".equals(type)) { return value.charAt(0); } if ("Boolean".equals(type)) { return Boolean.parseBoolean(value); } if ("BigDecimal".equals(type)) { return new BigDecimal(value); } if ("BigInteger".equals(type)) { return new BigInteger(value); } throw new IllegalArgumentException("Unknown scalar type: " + type); }
static Object function(String value, String type) { if (STR.equals(type)) { return value; } if (STR.equals(type)) { return Integer.parseInt(value); } if ("Long".equals(type)) { return Long.parseLong(value); } if (STR.equals(type)) { return Double.parseDouble(value); } if ("Byte".equals(type)) { return Byte.parseByte(value); } if ("Short".equals(type)) { return Short.parseShort(value); } if (STR.equals(type)) { return value.charAt(0); } if (STR.equals(type)) { return Boolean.parseBoolean(value); } if (STR.equals(type)) { return new BigDecimal(value); } if (STR.equals(type)) { return new BigInteger(value); } throw new IllegalArgumentException(STR + type); }
/** * Construct the scalar value represented by the string * * @param value * @param type * @return the scalar value represented by the string */
Construct the scalar value represented by the string
parseScalar
{ "repo_name": "glyn/Gemini-Management", "path": "org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/internal/OSGiProperties.java", "license": "apache-2.0", "size": 18160 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
1,997,213
public static OAuthProvider getOAuthProvider(ServletContext context) throws ServletException { OAuthProvider provider = (OAuthProvider) context.getAttribute(ATTR_OAUTH_PROVIDER); if(provider != null) return provider; String providerClassName = context.getInitParameter(OAuthServlet.PARAM_PROVIDER_CLASS); if(providerClassName == null) throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.parameterRequired()); try { LogMessages.LOGGER.info(Messages.MESSAGES.loadingOAuthProvider(providerClassName)); Class<?> providerClass = Class.forName(providerClassName); if(!OAuthProvider.class.isAssignableFrom(providerClass)) throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classMustBeInstanceOAuthProvider(providerClassName)); provider = new OAuthProviderChecker((OAuthProvider) providerClass.newInstance()); context.setAttribute(ATTR_OAUTH_PROVIDER, provider); return provider; } catch (ClassNotFoundException e) { throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classNotFound(providerClassName)); } catch (Exception e) { throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classCouldNotBeInstantiated(providerClassName), e); } }
static OAuthProvider function(ServletContext context) throws ServletException { OAuthProvider provider = (OAuthProvider) context.getAttribute(ATTR_OAUTH_PROVIDER); if(provider != null) return provider; String providerClassName = context.getInitParameter(OAuthServlet.PARAM_PROVIDER_CLASS); if(providerClassName == null) throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.parameterRequired()); try { LogMessages.LOGGER.info(Messages.MESSAGES.loadingOAuthProvider(providerClassName)); Class<?> providerClass = Class.forName(providerClassName); if(!OAuthProvider.class.isAssignableFrom(providerClass)) throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classMustBeInstanceOAuthProvider(providerClassName)); provider = new OAuthProviderChecker((OAuthProvider) providerClass.newInstance()); context.setAttribute(ATTR_OAUTH_PROVIDER, provider); return provider; } catch (ClassNotFoundException e) { throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classNotFound(providerClassName)); } catch (Exception e) { throw new ServletException(OAuthServlet.PARAM_PROVIDER_CLASS+Messages.MESSAGES.classCouldNotBeInstantiated(providerClassName), e); } }
/** * Loads the OAuthProvider as specified in the Servlet Context parameters, and caches it in the Servlet Context attributes for reuse. */
Loads the OAuthProvider as specified in the Servlet Context parameters, and caches it in the Servlet Context attributes for reuse
getOAuthProvider
{ "repo_name": "soul2zimate/resteasy2", "path": "security/resteasy-oauth/src/main/java/org/jboss/resteasy/auth/oauth/OAuthUtils.java", "license": "apache-2.0", "size": 9154 }
[ "javax.servlet.ServletContext", "javax.servlet.ServletException", "org.jboss.resteasy.auth.oauth.i18n.LogMessages", "org.jboss.resteasy.auth.oauth.i18n.Messages" ]
import javax.servlet.ServletContext; import javax.servlet.ServletException; import org.jboss.resteasy.auth.oauth.i18n.LogMessages; import org.jboss.resteasy.auth.oauth.i18n.Messages;
import javax.servlet.*; import org.jboss.resteasy.auth.oauth.i18n.*;
[ "javax.servlet", "org.jboss.resteasy" ]
javax.servlet; org.jboss.resteasy;
1,065,947
@Nonnull T build(@Nonnull Message... messages);
T build(@Nonnull Message... messages);
/** * Partially builds a new message, setting the specified {@link Message}s to their relative extensions. * * @param messages The messages to be added as extensions. * @return The partially built message. */
Partially builds a new message, setting the specified <code>Message</code>s to their relative extensions
build
{ "repo_name": "rmsy/Protobuf-Packet", "path": "src/main/java/tc/oc/protobuf/packet/PacketManager.java", "license": "mit", "size": 1186 }
[ "com.google.protobuf.Message", "javax.annotation.Nonnull" ]
import com.google.protobuf.Message; import javax.annotation.Nonnull;
import com.google.protobuf.*; import javax.annotation.*;
[ "com.google.protobuf", "javax.annotation" ]
com.google.protobuf; javax.annotation;
2,733,390
public static ServiceInfoListDTO getServicesResponsePayloadBuilder(List<ServiceInfoDTO> servicesList) { ServiceInfoListDTO serviceInfoListDTO = new ServiceInfoListDTO(); serviceInfoListDTO.setCount(servicesList.size()); serviceInfoListDTO.setList(servicesList); return serviceInfoListDTO; }
static ServiceInfoListDTO function(List<ServiceInfoDTO> servicesList) { ServiceInfoListDTO serviceInfoListDTO = new ServiceInfoListDTO(); serviceInfoListDTO.setCount(servicesList.size()); serviceInfoListDTO.setList(servicesList); return serviceInfoListDTO; }
/** * Convert list of ServiceInfoDTO objects to ServiceInfoListDTO object * * @param servicesList metadata list of services provided in zip * @return build the ServiceInfoListDTO object */
Convert list of ServiceInfoDTO objects to ServiceInfoListDTO object
getServicesResponsePayloadBuilder
{ "repo_name": "Rajith90/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.service.catalog/src/main/java/org/wso2/carbon/apimgt/rest/api/service/catalog/utils/ServiceEntryMappingUtil.java", "license": "apache-2.0", "size": 15016 }
[ "java.util.List", "org.wso2.carbon.apimgt.rest.api.service.catalog.dto.ServiceInfoDTO", "org.wso2.carbon.apimgt.rest.api.service.catalog.dto.ServiceInfoListDTO" ]
import java.util.List; import org.wso2.carbon.apimgt.rest.api.service.catalog.dto.ServiceInfoDTO; import org.wso2.carbon.apimgt.rest.api.service.catalog.dto.ServiceInfoListDTO;
import java.util.*; import org.wso2.carbon.apimgt.rest.api.service.catalog.dto.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,131,465
public static ims.core.resource.place.domain.objects.Clinic extractClinic(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.ClinicMinVo valueObject) { return extractClinic(domainFactory, valueObject, new HashMap()); }
static ims.core.resource.place.domain.objects.Clinic function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.ClinicMinVo valueObject) { return extractClinic(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractClinic
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/ClinicMinVoAssembler.java", "license": "agpl-3.0", "size": 16012 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,418,047
List<ResourceRoot> getResourceRoots();
List<ResourceRoot> getResourceRoots();
/** * Returns all the collected property roots. * * @return an <b>unmodifiable</b> list of {@link TagSoupExtractionResult.ResourceRoot}s. */
Returns all the collected property roots
getResourceRoots
{ "repo_name": "lewismc/any23", "path": "core/src/main/java/org/apache/any23/extractor/TagSoupExtractionResult.java", "license": "apache-2.0", "size": 6221 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,658,048
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mCallbacks = (NavigationDrawerCallbacks) activity; } catch (ClassCastException e) { throw new ClassCastException("Activity must implement NavigationDrawerCallbacks."); } }
void function(Activity activity) { super.onAttach(activity); try { mCallbacks = (NavigationDrawerCallbacks) activity; } catch (ClassCastException e) { throw new ClassCastException(STR); } }
/** * Lifecycle Callback where the fragment could Ensure that the host activity implements the communication interface declared by the fragment * @param activity the host activity within which the fragment is managed */
Lifecycle Callback where the fragment could Ensure that the host activity implements the communication interface declared by the fragment
onAttach
{ "repo_name": "Leyonce/iceteck", "path": "app/src/main/java/org/apache/taverna/mobile/fragments/NavigationDrawerFragment.java", "license": "apache-2.0", "size": 12019 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,457,581
private Result pObsoleteArrayDesignation(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; // Alternative 1. yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$1 = "["; yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; // Nested alternative 1. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("ObsoleteArrayDesignation", v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } // Nested alternative 2. yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create("ObsoleteArrayDesignation", v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select("']' expected", yyBase); } } } else { yyError = yyError.select("'...' expected", yyBase); } } } // Done. yyError = yyError.select("obsolete array designation expected", yyStart); return yyError; } // =========================================================================
Result function(final int yyStart) throws IOException { Result yyResult; int yyBase; Node yyValue; ParseError yyError = ParseError.DUMMY; yyResult = pSymbol(yyStart); if (yyResult.hasValue("[")) { final String v$g$1 = "["; yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$2 = yyResult.semanticValue(); final int yyChoice1 = yyResult.index; yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create(STR, v$g$1, v$g$2); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select(STR, yyBase); } yyBase = yyChoice1; yyResult = pSymbol(yyBase); if (yyResult.hasValue("...")) { yyResult = pJeannieC$ConditionalExpression(yyResult.index); yyError = yyResult.select(yyError); if (yyResult.hasValue()) { final Node v$g$3 = yyResult.semanticValue(); yyBase = yyResult.index; yyResult = pSymbol(yyBase); if (yyResult.hasValue("]")) { yyValue = GNode.create(STR, v$g$1, v$g$2, v$g$3); yyValue.setLocation(location(yyStart)); return yyResult.createValue(yyValue, yyError); } else { yyError = yyError.select(STR, yyBase); } } } else { yyError = yyError.select(STR, yyBase); } } } yyError = yyError.select(STR, yyStart); return yyError; }
/** * Parse nonterminal xtc.lang.jeannie.JeannieC.ObsoleteArrayDesignation. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */
Parse nonterminal xtc.lang.jeannie.JeannieC.ObsoleteArrayDesignation
pObsoleteArrayDesignation
{ "repo_name": "wandoulabs/xtc-rats", "path": "xtc-core/src/main/java/xtc/lang/jeannie/JeannieParser.java", "license": "lgpl-2.1", "size": 647687 }
[ "java.io.IOException", "xtc.parser.ParseError", "xtc.parser.Result", "xtc.tree.GNode", "xtc.tree.Node" ]
import java.io.IOException; import xtc.parser.ParseError; import xtc.parser.Result; import xtc.tree.GNode; import xtc.tree.Node;
import java.io.*; import xtc.parser.*; import xtc.tree.*;
[ "java.io", "xtc.parser", "xtc.tree" ]
java.io; xtc.parser; xtc.tree;
2,001,456
public ArrayList<String> getMetricNames() { return this.metricNames; }
ArrayList<String> function() { return this.metricNames; }
/** * Optional. Specifies a comma-separated list of the names of the metrics to * return. If the names parameter is not specified, then all available * metrics are returned. * @return The MetricNames value. */
Optional. Specifies a comma-separated list of the names of the metrics to return. If the names parameter is not specified, then all available metrics are returned
getMetricNames
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-websites/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsParameters.java", "license": "apache-2.0", "size": 6246 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,963,548
public InputStream openInputStream() { if (zipFile != null) { try { inputStream = zipFile.getInputStream(zipEntry); return inputStream; } catch (IOException ioex) { throw new FindFileException("Unable to get input stream: '" + zipFile.getName() + "', entry: '" + zipEntry.getName() + "'." , ioex); } } try { inputStream = new FileInputStream(file); return inputStream; } catch (FileNotFoundException fnfex) { throw new FindFileException("Unable to open: " + file.getAbsolutePath(), fnfex); } }
InputStream function() { if (zipFile != null) { try { inputStream = zipFile.getInputStream(zipEntry); return inputStream; } catch (IOException ioex) { throw new FindFileException(STR + zipFile.getName() + STR + zipEntry.getName() + "'." , ioex); } } try { inputStream = new FileInputStream(file); return inputStream; } catch (FileNotFoundException fnfex) { throw new FindFileException(STR + file.getAbsolutePath(), fnfex); } }
/** * Opens zip entry or plain file and returns its input stream. */
Opens zip entry or plain file and returns its input stream
openInputStream
{ "repo_name": "Artemish/jodd", "path": "jodd-core/src/main/java/jodd/io/findfile/ClassFinder.java", "license": "bsd-3-clause", "size": 13757 }
[ "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.IOException", "java.io.InputStream" ]
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,161,392
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); }
Observable<ServiceResponse<Page<NetworkInterfaceInner>>> function(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); }
/** * Gets all network interfaces in a resource group. * ServiceResponse<PageImpl<NetworkInterfaceInner>> * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;NetworkInterfaceInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Gets all network interfaces in a resource group
listByResourceGroupSinglePageAsync
{ "repo_name": "martinsawicki/azure-sdk-for-java", "path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesInner.java", "license": "mit", "size": 169944 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,359,282
RRFedNonFedSubawardBudget1010Document rrSubawardBudgetDocument = RRFedNonFedSubawardBudget1010Document.Factory.newInstance(); RRFedNonFedSubawardBudget1010 rrSubawardBudget = RRFedNonFedSubawardBudget1010.Factory.newInstance(); BudgetAttachments budgetAttachments = BudgetAttachments.Factory.newInstance(); List<BudgetSubAwards> budgetSubAwardsList = getBudgetSubAwards(pdDoc,RR_FED_NON_FED_BUDGET10_11_NAMESPACE_URI,false); RRFedNonFedBudget10[] budgetList = new RRFedNonFedBudget10[budgetSubAwardsList.size()]; rrSubawardBudget.setFormVersion(S2SConstants.FORMVERSION_1_2); int attCount = 1; for (BudgetSubAwards budgetSubAwards : budgetSubAwardsList) { RRFedNonFedBudget10 rrBudget = getRRFedNonFedBudget(budgetSubAwards).getRRFedNonFedBudget10(); switch (attCount) { case 1: rrSubawardBudget.setATT1(prepareAttName(budgetSubAwards)); budgetList[0] = rrBudget; break; case 2: rrSubawardBudget.setATT2(prepareAttName(budgetSubAwards)); budgetList[1] = rrBudget; break; case 3: rrSubawardBudget.setATT3(prepareAttName(budgetSubAwards)); budgetList[2] = rrBudget; break; case 4: rrSubawardBudget.setATT4(prepareAttName(budgetSubAwards)); budgetList[3] = rrBudget; break; case 5: rrSubawardBudget.setATT5(prepareAttName(budgetSubAwards)); budgetList[4] = rrBudget; break; case 6: rrSubawardBudget.setATT6(prepareAttName(budgetSubAwards)); budgetList[5] = rrBudget; break; case 7: rrSubawardBudget.setATT7(prepareAttName(budgetSubAwards)); budgetList[6] = rrBudget; break; case 8: rrSubawardBudget.setATT8(prepareAttName(budgetSubAwards)); budgetList[7] = rrBudget; break; case 9: rrSubawardBudget.setATT9(prepareAttName(budgetSubAwards)); budgetList[8] = rrBudget; break; case 10: rrSubawardBudget.setATT10(prepareAttName(budgetSubAwards)); budgetList[9] = rrBudget; break; } addSubAwdAttachments(budgetSubAwards); attCount++; } budgetAttachments.setRRFedNonFedBudget10Array(budgetList); rrSubawardBudget.setBudgetAttachments(budgetAttachments); rrSubawardBudgetDocument.setRRFedNonFedSubawardBudget1010(rrSubawardBudget); return rrSubawardBudgetDocument; }
RRFedNonFedSubawardBudget1010Document rrSubawardBudgetDocument = RRFedNonFedSubawardBudget1010Document.Factory.newInstance(); RRFedNonFedSubawardBudget1010 rrSubawardBudget = RRFedNonFedSubawardBudget1010.Factory.newInstance(); BudgetAttachments budgetAttachments = BudgetAttachments.Factory.newInstance(); List<BudgetSubAwards> budgetSubAwardsList = getBudgetSubAwards(pdDoc,RR_FED_NON_FED_BUDGET10_11_NAMESPACE_URI,false); RRFedNonFedBudget10[] budgetList = new RRFedNonFedBudget10[budgetSubAwardsList.size()]; rrSubawardBudget.setFormVersion(S2SConstants.FORMVERSION_1_2); int attCount = 1; for (BudgetSubAwards budgetSubAwards : budgetSubAwardsList) { RRFedNonFedBudget10 rrBudget = getRRFedNonFedBudget(budgetSubAwards).getRRFedNonFedBudget10(); switch (attCount) { case 1: rrSubawardBudget.setATT1(prepareAttName(budgetSubAwards)); budgetList[0] = rrBudget; break; case 2: rrSubawardBudget.setATT2(prepareAttName(budgetSubAwards)); budgetList[1] = rrBudget; break; case 3: rrSubawardBudget.setATT3(prepareAttName(budgetSubAwards)); budgetList[2] = rrBudget; break; case 4: rrSubawardBudget.setATT4(prepareAttName(budgetSubAwards)); budgetList[3] = rrBudget; break; case 5: rrSubawardBudget.setATT5(prepareAttName(budgetSubAwards)); budgetList[4] = rrBudget; break; case 6: rrSubawardBudget.setATT6(prepareAttName(budgetSubAwards)); budgetList[5] = rrBudget; break; case 7: rrSubawardBudget.setATT7(prepareAttName(budgetSubAwards)); budgetList[6] = rrBudget; break; case 8: rrSubawardBudget.setATT8(prepareAttName(budgetSubAwards)); budgetList[7] = rrBudget; break; case 9: rrSubawardBudget.setATT9(prepareAttName(budgetSubAwards)); budgetList[8] = rrBudget; break; case 10: rrSubawardBudget.setATT10(prepareAttName(budgetSubAwards)); budgetList[9] = rrBudget; break; } addSubAwdAttachments(budgetSubAwards); attCount++; } budgetAttachments.setRRFedNonFedBudget10Array(budgetList); rrSubawardBudget.setBudgetAttachments(budgetAttachments); rrSubawardBudgetDocument.setRRFedNonFedSubawardBudget1010(rrSubawardBudget); return rrSubawardBudgetDocument; }
/** * * This method is to get SubAward Budget details * * @return rrSubawardBudgetDocument {@link XmlObject} of type RRFedNonFedSubawardBudgetDocument. */
This method is to get SubAward Budget details
getRRFedNonFedSubawardBudgetDocument
{ "repo_name": "vivantech/kc_fixes", "path": "src/main/java/org/kuali/kra/s2s/generator/impl/RRFedNonFedSubAwardBudget10_10V1_2Generator.java", "license": "apache-2.0", "size": 8935 }
[ "gov.grants.apply.forms.rrFedNonFedBudget10V11.RRFedNonFedBudget10Document", "gov.grants.apply.forms.rrFedNonFedSubawardBudget1010V12.RRFedNonFedSubawardBudget1010Document", "java.util.List", "org.kuali.kra.proposaldevelopment.budget.bo.BudgetSubAwards", "org.kuali.kra.s2s.util.S2SConstants" ]
import gov.grants.apply.forms.rrFedNonFedBudget10V11.RRFedNonFedBudget10Document; import gov.grants.apply.forms.rrFedNonFedSubawardBudget1010V12.RRFedNonFedSubawardBudget1010Document; import java.util.List; import org.kuali.kra.proposaldevelopment.budget.bo.BudgetSubAwards; import org.kuali.kra.s2s.util.S2SConstants;
import gov.grants.apply.forms.*; import java.util.*; import org.kuali.kra.proposaldevelopment.budget.bo.*; import org.kuali.kra.s2s.util.*;
[ "gov.grants.apply", "java.util", "org.kuali.kra" ]
gov.grants.apply; java.util; org.kuali.kra;
1,498,783
private boolean insertImageFromEnclosure(NewsViewHolder holder) { if (mCursor.getString(FeedFragment.INDEX_ENCLOSURE) != null) { Picasso.with(mContext).load(mCursor.getString(FeedFragment.INDEX_ENCLOSURE)).fit() .into(holder.imageView); return true; } return false; }
boolean function(NewsViewHolder holder) { if (mCursor.getString(FeedFragment.INDEX_ENCLOSURE) != null) { Picasso.with(mContext).load(mCursor.getString(FeedFragment.INDEX_ENCLOSURE)).fit() .into(holder.imageView); return true; } return false; }
/** * Insert the image from the enclosure field in the Cursor. If there is a problem in the XML * and it returns null, we simply use the default thumbnail. * * @param holder the relevant ViewHolder * @return whether or not the image was successfully found and applied */
Insert the image from the enclosure field in the Cursor. If there is a problem in the XML and it returns null, we simply use the default thumbnail
insertImageFromEnclosure
{ "repo_name": "benway0/Mundo", "path": "app/src/main/java/com/github/benway0/mundo/adapters/NewsAdapter.java", "license": "gpl-3.0", "size": 22194 }
[ "com.github.benway0.mundo.fragments.FeedFragment", "com.squareup.picasso.Picasso" ]
import com.github.benway0.mundo.fragments.FeedFragment; import com.squareup.picasso.Picasso;
import com.github.benway0.mundo.fragments.*; import com.squareup.picasso.*;
[ "com.github.benway0", "com.squareup.picasso" ]
com.github.benway0; com.squareup.picasso;
2,368,760
@Generated @Selector("maxSysExSize") public native NSNumber maxSysExSize();
@Selector(STR) native NSNumber function();
/** * unsigned long */
unsigned long
maxSysExSize
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/coremidi/MIDICISession.java", "license": "apache-2.0", "size": 11059 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,704,058
public static XMLGregorianCalendar createDateTime( BigInteger year, int month, int day, int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone) { return new XMLGregorianCalendarImpl( year, month, day, hours, minutes, seconds, fractionalSecond, timezone); }
static XMLGregorianCalendar function( BigInteger year, int month, int day, int hours, int minutes, int seconds, BigDecimal fractionalSecond, int timezone) { return new XMLGregorianCalendarImpl( year, month, day, hours, minutes, seconds, fractionalSecond, timezone); }
/** * <p>Create a Java representation of XML Schema builtin datatype <code>dateTime</code>. * All possible fields are specified for this factory method.</p> * * @param year represents both high-order eons and low-order year. * @param month of <code>dateTime</code> * @param day of <code>dateTime</code> * @param hours of <code>dateTime</code> * @param minutes of <code>dateTime</code> * @param seconds of <code>dateTime</code> * @param fractionalSecond value of null indicates optional field is absent. * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set. * * @return <code>XMLGregorianCalendar</code> created from parameter values. * * @see DatatypeConstants#FIELD_UNDEFINED * * @throws IllegalArgumentException if any parameter is outside value * constraints for the field as specified in * <a href="#datetimefieldmapping">date/time field mapping table</a>. */
Create a Java representation of XML Schema builtin datatype <code>dateTime</code>. All possible fields are specified for this factory method
createDateTime
{ "repo_name": "machine16/xerces-for-android", "path": "src/mf/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java", "license": "apache-2.0", "size": 122701 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
506,362
public void verify(XmlVTenant xvtn, boolean jaxb) { verify((XmlVNode)xvtn); assertEquals(idleTimeout, getIdleTimeout(xvtn)); assertEquals(hardTimeout, getHardTimeout(xvtn)); VBridgeConfigList.verify(vBridges, xvtn.getBridges(), jaxb); VTerminalConfigList.verify(vTerminals, xvtn.getTerminals(), jaxb); PathMapConfigList.verify(pathMaps, xvtn.getPathMaps(), jaxb); XmlFlowFilterList.verify(inputFilters, xvtn.getInputFilters(), jaxb); }
void function(XmlVTenant xvtn, boolean jaxb) { verify((XmlVNode)xvtn); assertEquals(idleTimeout, getIdleTimeout(xvtn)); assertEquals(hardTimeout, getHardTimeout(xvtn)); VBridgeConfigList.verify(vBridges, xvtn.getBridges(), jaxb); VTerminalConfigList.verify(vTerminals, xvtn.getTerminals(), jaxb); PathMapConfigList.verify(pathMaps, xvtn.getPathMaps(), jaxb); XmlFlowFilterList.verify(inputFilters, xvtn.getInputFilters(), jaxb); }
/** * Ensure that the given {@link XmlVTenant} instance is identical to * this instance. * * @param xvtn A {@link XmlVTenant} instance. * @param jaxb {@code true} indicates {@code xvbr} was deserialized from * XML. */
Ensure that the given <code>XmlVTenant</code> instance is identical to this instance
verify
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/vnode/xml/VTenantConfig.java", "license": "epl-1.0", "size": 10961 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,653,994
public RemoteDAVClient getClient();
RemoteDAVClient function();
/** * Provides access to the underlying RemoteDAVClient. * @return The client associated with the current repository connection. */
Provides access to the underlying RemoteDAVClient
getClient
{ "repo_name": "bbrodt/droolsjbpm-tools", "path": "drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/utils/webdav/IWebDavClient.java", "license": "apache-2.0", "size": 5708 }
[ "org.eclipse.webdav.client.RemoteDAVClient" ]
import org.eclipse.webdav.client.RemoteDAVClient;
import org.eclipse.webdav.client.*;
[ "org.eclipse.webdav" ]
org.eclipse.webdav;
409,169
@SuppressWarnings("unchecked") public static <V> SupplierCache<V> expiring(String name, Supplier<V> supplier, long duration, TimeUnit timeUnit) { return new SupplierCache(name,supplier,duration,timeUnit); } private SupplierCache(final String name, Supplier<V> supplier, long duration, TimeUnit timeUnit) { this.name = name; this.supplier = supplier; this.duration = duration; this.timeUnit = timeUnit; cache = createCache(); }
@SuppressWarnings(STR) static <V> SupplierCache<V> function(String name, Supplier<V> supplier, long duration, TimeUnit timeUnit) { return new SupplierCache(name,supplier,duration,timeUnit); } private SupplierCache(final String name, Supplier<V> supplier, long duration, TimeUnit timeUnit) { this.name = name; this.supplier = supplier; this.duration = duration; this.timeUnit = timeUnit; cache = createCache(); }
/** * Creates an expiring,caching Supplier, * if duration = 0 caching will effectively be disabled * if duration < 0 the cache will never expire * * @param <V> * @param name * @param supplier * @param duration * @param timeUnit * @return */
Creates an expiring,caching Supplier, if duration = 0 caching will effectively be disabled if duration < 0 the cache will never expire
expiring
{ "repo_name": "rhlabs/louie", "path": "engine/src/main/java/com/rhythm/louie/cache/SupplierCache.java", "license": "apache-2.0", "size": 4568 }
[ "com.google.common.base.Supplier", "java.util.concurrent.TimeUnit" ]
import com.google.common.base.Supplier; import java.util.concurrent.TimeUnit;
import com.google.common.base.*; import java.util.concurrent.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,084,125
public Stroke getDefaultOutlineStroke() { return this.defaultOutlineStroke; }
Stroke function() { return this.defaultOutlineStroke; }
/** * Returns the default outline stroke. * * @return The stroke (never <code>null</code>). * * @see #setDefaultOutlineStroke(Stroke) */
Returns the default outline stroke
getDefaultOutlineStroke
{ "repo_name": "greearb/jfreechart-fse-ct", "path": "src/main/java/org/jfree/chart/renderer/AbstractRenderer.java", "license": "lgpl-2.1", "size": 108424 }
[ "java.awt.Stroke" ]
import java.awt.Stroke;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,973,754
protected String build_student_view_submission_confirmation_context(VelocityPortlet portlet, Context context, RunData data, SessionState state) { String contextString = (String) state.getAttribute(STATE_CONTEXT_STRING); context.put("context", contextString); String invokedByStatus = (String) state.getAttribute(INVOKE); if(invokedByStatus!=null){ if(invokedByStatus.equalsIgnoreCase(INVOKE_BY_LINK)){ context.put("linkInvoked", Boolean.valueOf(true)); state.setAttribute(STATE_MODE, MODE_LIST_ASSIGNMENTS); }else{ context.put("linkInvoked", Boolean.valueOf(false)); } }else{ context.put("linkInvoked", Boolean.valueOf(false)); } context.put("view", MODE_LIST_ASSIGNMENTS); // get user information User user = (User) state.getAttribute(STATE_USER); String submitterId = (String) state.getAttribute(STATE_SUBMITTER); User submitter = user; if (submitterId != null) { try { submitter = UserDirectoryService.getUser(submitterId); } catch (UserNotDefinedException ex) { M_log.warn(this + ":build_student_view_submission cannot find user with id " + submitterId + " " + ex.getMessage()); } } context.put("user_name", submitter.getDisplayName()); context.put("user_id", submitter.getDisplayId()); if (StringUtils.trimToNull(user.getEmail()) != null) context.put("user_email", user.getEmail()); // get site information try { // get current site Site site = SiteService.getSite(contextString); context.put("site_title", site.getTitle()); } catch (Exception ignore) { M_log.warn(this + ":buildStudentViewSubmission " + ignore.getMessage() + " siteId= " + contextString); } // get assignment and submission information String currentAssignmentReference = (String) state.getAttribute(VIEW_SUBMISSION_ASSIGNMENT_REFERENCE); Assignment currentAssignment = getAssignment(currentAssignmentReference, "build_student_view_submission_confirmation_context", state); if (currentAssignment != null) { context.put("assignment", currentAssignment); context.put("assignment_title", currentAssignment.getTitle()); // differenciate submission type int submissionType = currentAssignment.getContent().getTypeOfSubmission(); if (submissionType == Assignment.ATTACHMENT_ONLY_ASSIGNMENT_SUBMISSION || submissionType == Assignment.SINGLE_ATTACHMENT_SUBMISSION) { context.put("attachmentSubmissionOnly", Boolean.TRUE); } else { context.put("attachmentSubmissionOnly", Boolean.FALSE); } if (submissionType == Assignment.TEXT_ONLY_ASSIGNMENT_SUBMISSION) { context.put("textSubmissionOnly", Boolean.TRUE); } else { context.put("textSubmissionOnly", Boolean.FALSE); } context.put("submissionType", submissionType); AssignmentSubmission s = getSubmission(currentAssignmentReference, submitter, "build_student_view_submission_confirmation_context",state); if (s != null) { context.put("submission", s); context.put("submitted", Boolean.valueOf(s.getSubmitted())); context.put("submission_id", s.getId()); if (s.getTimeSubmitted() != null) { context.put("submit_time", s.getTimeSubmitted().toStringLocalFull()); } List attachments = s.getSubmittedAttachments(); if (attachments != null && attachments.size()>0) { context.put("submit_attachments", s.getVisibleSubmittedAttachments()); } context.put("submit_text", StringUtils.trimToNull(s.getSubmittedText())); context.put("email_confirmation", Boolean.valueOf(ServerConfigurationService.getBoolean("assignment.submission.confirmation.email", true))); } } state.removeAttribute(STATE_SUBMITTER); String template = (String) getContext(data).get("template"); return template + TEMPLATE_STUDENT_VIEW_SUBMISSION_CONFIRMATION; } // build_student_view_submission_confirmation_context
String function(VelocityPortlet portlet, Context context, RunData data, SessionState state) { String contextString = (String) state.getAttribute(STATE_CONTEXT_STRING); context.put(STR, contextString); String invokedByStatus = (String) state.getAttribute(INVOKE); if(invokedByStatus!=null){ if(invokedByStatus.equalsIgnoreCase(INVOKE_BY_LINK)){ context.put(STR, Boolean.valueOf(true)); state.setAttribute(STATE_MODE, MODE_LIST_ASSIGNMENTS); }else{ context.put(STR, Boolean.valueOf(false)); } }else{ context.put(STR, Boolean.valueOf(false)); } context.put("view", MODE_LIST_ASSIGNMENTS); User user = (User) state.getAttribute(STATE_USER); String submitterId = (String) state.getAttribute(STATE_SUBMITTER); User submitter = user; if (submitterId != null) { try { submitter = UserDirectoryService.getUser(submitterId); } catch (UserNotDefinedException ex) { M_log.warn(this + STR + submitterId + " " + ex.getMessage()); } } context.put(STR, submitter.getDisplayName()); context.put(STR, submitter.getDisplayId()); if (StringUtils.trimToNull(user.getEmail()) != null) context.put(STR, user.getEmail()); try { Site site = SiteService.getSite(contextString); context.put(STR, site.getTitle()); } catch (Exception ignore) { M_log.warn(this + STR + ignore.getMessage() + STR + contextString); } String currentAssignmentReference = (String) state.getAttribute(VIEW_SUBMISSION_ASSIGNMENT_REFERENCE); Assignment currentAssignment = getAssignment(currentAssignmentReference, STR, state); if (currentAssignment != null) { context.put(STR, currentAssignment); context.put(STR, currentAssignment.getTitle()); int submissionType = currentAssignment.getContent().getTypeOfSubmission(); if (submissionType == Assignment.ATTACHMENT_ONLY_ASSIGNMENT_SUBMISSION submissionType == Assignment.SINGLE_ATTACHMENT_SUBMISSION) { context.put(STR, Boolean.TRUE); } else { context.put(STR, Boolean.FALSE); } if (submissionType == Assignment.TEXT_ONLY_ASSIGNMENT_SUBMISSION) { context.put(STR, Boolean.TRUE); } else { context.put(STR, Boolean.FALSE); } context.put(STR, submissionType); AssignmentSubmission s = getSubmission(currentAssignmentReference, submitter, STR,state); if (s != null) { context.put(STR, s); context.put(STR, Boolean.valueOf(s.getSubmitted())); context.put(STR, s.getId()); if (s.getTimeSubmitted() != null) { context.put(STR, s.getTimeSubmitted().toStringLocalFull()); } List attachments = s.getSubmittedAttachments(); if (attachments != null && attachments.size()>0) { context.put(STR, s.getVisibleSubmittedAttachments()); } context.put(STR, StringUtils.trimToNull(s.getSubmittedText())); context.put(STR, Boolean.valueOf(ServerConfigurationService.getBoolean(STR, true))); } } state.removeAttribute(STATE_SUBMITTER); String template = (String) getContext(data).get(STR); return template + TEMPLATE_STUDENT_VIEW_SUBMISSION_CONFIRMATION; }
/** * build the student view of showing an assignment submission confirmation */
build the student view of showing an assignment submission confirmation
build_student_view_submission_confirmation_context
{ "repo_name": "lorenamgUMU/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 677150 }
[ "java.util.List", "org.apache.commons.lang.StringUtils", "org.sakaiproject.assignment.api.Assignment", "org.sakaiproject.assignment.api.AssignmentSubmission", "org.sakaiproject.cheftool.Context", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.cheftool.VelocityPortlet", "org.sakaiproject.component.cover.ServerConfigurationService", "org.sakaiproject.event.api.SessionState", "org.sakaiproject.site.api.Site", "org.sakaiproject.site.cover.SiteService", "org.sakaiproject.user.api.User", "org.sakaiproject.user.api.UserNotDefinedException", "org.sakaiproject.user.cover.UserDirectoryService" ]
import java.util.List; import org.apache.commons.lang.StringUtils; import org.sakaiproject.assignment.api.Assignment; import org.sakaiproject.assignment.api.AssignmentSubmission; import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.cheftool.VelocityPortlet; import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.cover.SiteService; import org.sakaiproject.user.api.User; import org.sakaiproject.user.api.UserNotDefinedException; import org.sakaiproject.user.cover.UserDirectoryService;
import java.util.*; import org.apache.commons.lang.*; import org.sakaiproject.assignment.api.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.component.cover.*; import org.sakaiproject.event.api.*; import org.sakaiproject.site.api.*; import org.sakaiproject.site.cover.*; import org.sakaiproject.user.api.*; import org.sakaiproject.user.cover.*;
[ "java.util", "org.apache.commons", "org.sakaiproject.assignment", "org.sakaiproject.cheftool", "org.sakaiproject.component", "org.sakaiproject.event", "org.sakaiproject.site", "org.sakaiproject.user" ]
java.util; org.apache.commons; org.sakaiproject.assignment; org.sakaiproject.cheftool; org.sakaiproject.component; org.sakaiproject.event; org.sakaiproject.site; org.sakaiproject.user;
868,513
void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException;
void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException;
/** * Creates a <em>non-temporary</em> queue <em>non-durable</em> queue. * * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue */
Creates a non-temporary queue non-durable queue
createQueue
{ "repo_name": "iweiss/activemq-artemis", "path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java", "license": "apache-2.0", "size": 50872 }
[ "org.apache.activemq.artemis.api.core.ActiveMQException", "org.apache.activemq.artemis.api.core.RoutingType", "org.apache.activemq.artemis.api.core.SimpleString" ]
import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.*;
[ "org.apache.activemq" ]
org.apache.activemq;
585,924
private void writeTransportHeader(DataOutputStream out) throws RemoteException { try { // write out transport header DataOutputStream dataOut = new DataOutputStream(out); dataOut.writeInt(TransportConstants.Magic); dataOut.writeShort(TransportConstants.Version); } catch (IOException e) { throw new ConnectIOException( "error writing JRMP transport header", e); } }
void function(DataOutputStream out) throws RemoteException { try { DataOutputStream dataOut = new DataOutputStream(out); dataOut.writeInt(TransportConstants.Magic); dataOut.writeShort(TransportConstants.Version); } catch (IOException e) { throw new ConnectIOException( STR, e); } }
/** * Send transport header over stream. */
Send transport header over stream
writeTransportHeader
{ "repo_name": "JetBrains/jdk8u_jdk", "path": "src/share/classes/sun/rmi/transport/tcp/TCPChannel.java", "license": "gpl-2.0", "size": 19703 }
[ "java.io.DataOutputStream", "java.io.IOException", "java.rmi.ConnectIOException", "java.rmi.RemoteException" ]
import java.io.DataOutputStream; import java.io.IOException; import java.rmi.ConnectIOException; import java.rmi.RemoteException;
import java.io.*; import java.rmi.*;
[ "java.io", "java.rmi" ]
java.io; java.rmi;
130,211
public void setRegisterNameValue(String registerNameValue) throws JNCException { setRegisterNameValue(new YangString(registerNameValue)); }
void function(String registerNameValue) throws JNCException { setRegisterNameValue(new YangString(registerNameValue)); }
/** * Sets the value for child leaf "register-name", * using a String value. * @param registerNameValue used during instantiation. */
Sets the value for child leaf "register-name", using a String value
setRegisterNameValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/statistics/ss7/Sccp.java", "license": "apache-2.0", "size": 11300 }
[ "com.tailf.jnc.YangString" ]
import com.tailf.jnc.YangString;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
77,361
public Value getStaticFieldInternal(Env env, StringValue name) { StringValue staticName = _staticFieldNameMap.get(name); if (staticName != null) return env.getStaticValue(staticName); else return null; } // // Constructors // /* public Value callNew(Env env, Expr []args) { Value object = _classDef.callNew(env, args); if (object != null) return object; object = newInstance(env); AbstractFunction fun = findConstructor(); if (fun != null) { fun.callMethod(env, object, args); } return object; }
Value function(Env env, StringValue name) { StringValue staticName = _staticFieldNameMap.get(name); if (staticName != null) return env.getStaticValue(staticName); else return null; } /* public Value callNew(Env env, Expr []args) { Value object = _classDef.callNew(env, args); if (object != null) return object; object = newInstance(env); AbstractFunction fun = findConstructor(); if (fun != null) { fun.callMethod(env, object, args); } return object; }
/** * For Reflection. */
For Reflection
getStaticFieldInternal
{ "repo_name": "TheApacheCats/quercus", "path": "com/caucho/quercus/env/QuercusClass.java", "license": "gpl-2.0", "size": 68876 }
[ "com.caucho.quercus.expr.Expr", "com.caucho.quercus.function.AbstractFunction" ]
import com.caucho.quercus.expr.Expr; import com.caucho.quercus.function.AbstractFunction;
import com.caucho.quercus.expr.*; import com.caucho.quercus.function.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
2,259,012
@Override public long parse(JHOVE2 jhove2, Source source, Input input) throws EOFException, IOException, JHOVE2Exception { long consumed = super.parse(jhove2, source, input); long start = ((MeasurableSource) source).getStartingOffset(); this.unshiftedNote = input.readUnsignedByte(); if (this.unshiftedNote < 0 || this.unshiftedNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.unshiftedNote}; this.invalidUnshiftedNoteMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidUnshiftedNote", args, jhove2.getConfigInfo()); } consumed++; this.fineTune = input.readSignedByte(); if (this.fineTune < -50 || this.fineTune > 50) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.fineTune}; this.invalidFineTuneMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidFineTune", args, jhove2.getConfigInfo()); } consumed++; this.gain = input.readSignedByte(); consumed++; this.lowNote = input.readUnsignedByte(); if (this.lowNote < 0 || this.lowNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.lowNote}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidMIDINote", args, jhove2.getConfigInfo()); } consumed++; this.highNote = input.readUnsignedByte(); if (this.highNote < 0 || this.highNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.highNote}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidMIDINote", args, jhove2.getConfigInfo()); } consumed++; this.lowVelocity = input.readUnsignedByte(); if (this.lowVelocity < 0 || this.lowVelocity > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.lowVelocity}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidMIDIVelocity", args, jhove2.getConfigInfo()); } consumed++; this.highVelocity = input.readUnsignedByte(); if (this.highVelocity < 0 || this.highVelocity > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.highVelocity}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, "org.jhove2.module.format.wave.InstrumentChunk.invalidMIDIVelocity", args, jhove2.getConfigInfo()); } consumed++; return consumed; }
long function(JHOVE2 jhove2, Source source, Input input) throws EOFException, IOException, JHOVE2Exception { long consumed = super.parse(jhove2, source, input); long start = ((MeasurableSource) source).getStartingOffset(); this.unshiftedNote = input.readUnsignedByte(); if (this.unshiftedNote < 0 this.unshiftedNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.unshiftedNote}; this.invalidUnshiftedNoteMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; this.fineTune = input.readSignedByte(); if (this.fineTune < -50 this.fineTune > 50) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.fineTune}; this.invalidFineTuneMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; this.gain = input.readSignedByte(); consumed++; this.lowNote = input.readUnsignedByte(); if (this.lowNote < 0 this.lowNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.lowNote}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; this.highNote = input.readUnsignedByte(); if (this.highNote < 0 this.highNote > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.highNote}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; this.lowVelocity = input.readUnsignedByte(); if (this.lowVelocity < 0 this.lowVelocity > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.lowVelocity}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; this.highVelocity = input.readUnsignedByte(); if (this.highVelocity < 0 this.highVelocity > 127) { this.isValid = Validity.False; Object [] args = new Object [] {input.getPosition()-1L-start, this.highVelocity}; this.invalidMIDINoteMessage = new Message(Severity.ERROR, Context.OBJECT, STR, args, jhove2.getConfigInfo()); } consumed++; return consumed; }
/** * Parse a WAVE chunk. * * @param jhove2 * JHOVE2 framework * @param source * WAVE source unit * @param input WAVE source input * @return Number of bytes consumed * @throws EOFException * If End-of-File is reached reading the source unit * @throws IOException * If an I/O exception is raised reading the source unit * @throws JHOVE2Exception */
Parse a WAVE chunk
parse
{ "repo_name": "opf-labs/jhove2", "path": "src/main/java/org/jhove2/module/format/wave/InstrumentChunk.java", "license": "bsd-2-clause", "size": 11020 }
[ "java.io.EOFException", "java.io.IOException", "org.jhove2.core.JHOVE2Exception", "org.jhove2.core.Message", "org.jhove2.core.io.Input", "org.jhove2.core.source.MeasurableSource", "org.jhove2.core.source.Source", "org.jhove2.module.format.Validator" ]
import java.io.EOFException; import java.io.IOException; import org.jhove2.core.JHOVE2Exception; import org.jhove2.core.Message; import org.jhove2.core.io.Input; import org.jhove2.core.source.MeasurableSource; import org.jhove2.core.source.Source; import org.jhove2.module.format.Validator;
import java.io.*; import org.jhove2.core.*; import org.jhove2.core.io.*; import org.jhove2.core.source.*; import org.jhove2.module.format.*;
[ "java.io", "org.jhove2.core", "org.jhove2.module" ]
java.io; org.jhove2.core; org.jhove2.module;
818,549
default boolean containsAnyValue (@Nullable final Predicate <? super VALUETYPE> aFilter) { return CollectionHelper.containsAny (values (), aFilter); }
default boolean containsAnyValue (@Nullable final Predicate <? super VALUETYPE> aFilter) { return CollectionHelper.containsAny (values (), aFilter); }
/** * Check if at least one value matches the passed filter. * * @param aFilter * The filter to be applied. May be <code>null</code>. * @return <code>true</code> if the map is not empty and contains at least one * value matching the filter, <code>false</code> otherwise. If no * filter is provided the return value is identical to * {@link #isNotEmpty()}. */
Check if at least one value matches the passed filter
containsAnyValue
{ "repo_name": "phax/ph-commons", "path": "ph-commons/src/main/java/com/helger/commons/collection/impl/ICommonsMap.java", "license": "apache-2.0", "size": 25410 }
[ "com.helger.commons.collection.CollectionHelper", "java.util.function.Predicate", "javax.annotation.Nullable" ]
import com.helger.commons.collection.CollectionHelper; import java.util.function.Predicate; import javax.annotation.Nullable;
import com.helger.commons.collection.*; import java.util.function.*; import javax.annotation.*;
[ "com.helger.commons", "java.util", "javax.annotation" ]
com.helger.commons; java.util; javax.annotation;
2,832,071
long countByType(JpaDistributionSetType type);
long countByType(JpaDistributionSetType type);
/** * Counts {@link DistributionSet} instances of given type in the repository. * * @param type * to search for * @return number of found {@link DistributionSet}s */
Counts <code>DistributionSet</code> instances of given type in the repository
countByType
{ "repo_name": "StBurcher/hawkbit", "path": "hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/DistributionSetRepository.java", "license": "epl-1.0", "size": 5618 }
[ "org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSetType" ]
import org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSetType;
import org.eclipse.hawkbit.repository.jpa.model.*;
[ "org.eclipse.hawkbit" ]
org.eclipse.hawkbit;
2,705,693
public Cursor getMessagesContainingCursor(String message, boolean getDeleted, boolean getReplies, int limit){ if(message == null) message = ""; message = Utils.makeTextSafeForSQL(message); SQLiteDatabase db = getWritableDatabase(); if(db != null) { String likeQuery =""; String messageNoSpace = message.replaceAll("\\s",""); if(message.length() == 0 || messageNoSpace.length() == 0) likeQuery = (COL_MESSAGE + " LIKE '%" + message + "%'"); if(likeQuery.length() == 0){ message = message.replaceAll("[\n\"]", " "); while(message.charAt(0) == ' '){ message = message.substring(1); } String[] words = message.split("\\s"); for(int i=0; i<words.length; i++){ if(words[i].length() > 0) { if (likeQuery.length() > 0) { likeQuery += " OR "; } likeQuery += " " + COL_MESSAGE + " LIKE '%" + words[i] + "%' "; } } } String query = "SELECT * FROM " + TABLE + " WHERE (" + likeQuery + ")" + (!getReplies ? "AND ("+COL_BIGPARENT+ " IS NULL OR "+COL_BIGPARENT+" NOT IN (SELECT "+COL_MESSAGE_ID+" FROM "+TABLE+" WHERE "+COL_DELETED+"="+FALSE+") AND "+COL_PARENT+" NOT IN (SELECT "+COL_MESSAGE_ID+" FROM "+TABLE+" WHERE "+COL_DELETED+"="+FALSE+ "))" : "") + (!getDeleted ? " AND " + COL_DELETED + "=" + FALSE : "") + " "+sortOption + (limit > 0 ? " LIMIT " + limit : "") + ";"; return db.rawQuery(query, null); } return null; }
Cursor function(String message, boolean getDeleted, boolean getReplies, int limit){ if(message == null) message = STRSTR\\s","STR LIKE '%STR%'STR[\n\"]", " "); while(message.charAt(0) == ' '){ message = message.substring(1); } String[] words = message.split("\\s"); for(int i=0; i<words.length; i++){ if(words[i].length() > 0) { if (likeQuery.length() > 0) { likeQuery += STR; } likeQuery += " " + COL_MESSAGE + STR + words[i] + STR; } } } String query = STR + TABLE + STR + likeQuery + ")" + (!getReplies ? STR+COL_BIGPARENT+ STR+COL_BIGPARENT+STR+COL_MESSAGE_ID+STR+TABLE+STR+COL_DELETED+"="+FALSE+STR+COL_PARENT+STR+COL_MESSAGE_ID+STR+TABLE+STR+COL_DELETED+"="+FALSE+ "))" : STR AND STR=STRSTR STR LIMIT STRSTR;"; return db.rawQuery(query, null); } return null; }
/** Return a cursor pointing to messages sorted according to current sort order and deleted state * @param getDeleted whether or not results should include deleted items * @param getReplies whether or not results should include items which are replies on other message * @param limit Maximum number of items to return or -1 for unlimited * @return Cursor of Message items based on database items matching conditions */
Return a cursor pointing to messages sorted according to current sort order and deleted state
getMessagesContainingCursor
{ "repo_name": "casific/murmur", "path": "app/src/main/java/org/denovogroup/murmur/backend/MessageStore.java", "license": "apache-2.0", "size": 50068 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
1,176,712
public void triangulate() { double minArea = 1000 * charLength * DOUBLE_PREC; newFaces.clear(); for (Iterator it = faces.iterator(); it.hasNext();) { Face face = (Face) it.next(); if (face.mark == Face.VISIBLE) { face.triangulate(newFaces, minArea); // splitFace (face); } } for (Face face = newFaces.first(); face != null; face = face.next) { faces.add(face); } } // private void splitFace (Face face) // { // Face newFace = face.split(); // if (newFace != null) // { newFaces.add (newFace); // splitFace (newFace); // splitFace (face); // } // }
void function() { double minArea = 1000 * charLength * DOUBLE_PREC; newFaces.clear(); for (Iterator it = faces.iterator(); it.hasNext();) { Face face = (Face) it.next(); if (face.mark == Face.VISIBLE) { face.triangulate(newFaces, minArea); } } for (Face face = newFaces.first(); face != null; face = face.next) { faces.add(face); } }
/** * Triangulates any non-triangular hull faces. In some cases, due to * precision issues, the resulting triangles may be very thin or small, and * hence appear to be non-convex (this same limitation is present in <a * href=http://www.qhull.org>qhull</a>). */
Triangulates any non-triangular hull faces. In some cases, due to precision issues, the resulting triangles may be very thin or small, and hence appear to be non-convex (this same limitation is present in qhull)
triangulate
{ "repo_name": "Quickhull3d/quickhull3d", "path": "src/main/java/com/github/quickhull3d/QuickHull3D.java", "license": "bsd-2-clause", "size": 48505 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,660,045
public void setCounter(Date d, CounterValue value);
void function(Date d, CounterValue value);
/** * Counter value setter */
Counter value setter
setCounter
{ "repo_name": "xuraylei/floodlight_with_topoguard", "path": "src/main/java/net/floodlightcontroller/counter/ICounter.java", "license": "apache-2.0", "size": 1584 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,719,480
public URI getBaseUri() { return this.baseUri; } private SubscriptionCloudCredentials credentials;
URI function() { return this.baseUri; } private SubscriptionCloudCredentials credentials;
/** * Gets the URI used as the base for all cloud service requests. * @return The BaseUri value. */
Gets the URI used as the base for all cloud service requests
getBaseUri
{ "repo_name": "manikandan-palaniappan/azure-sdk-for-java", "path": "management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClientImpl.java", "license": "apache-2.0", "size": 27187 }
[ "com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials" ]
import com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials;
import com.microsoft.windowsazure.credentials.*;
[ "com.microsoft.windowsazure" ]
com.microsoft.windowsazure;
1,877,307
protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xDrawDoc " ); util.DesktopTools.closeDoc(xDrawDoc); }
void function( TestParameters tParam, PrintWriter log ) { log.println( STR ); util.DesktopTools.closeDoc(xDrawDoc); }
/** * in general this method disposes the testenvironment and document * * @param tParam class which contains additional test parameters * @param log class to log the test state and result * * * @see TestParameters * @see PrintWriter * */
in general this method disposes the testenvironment and document
cleanup
{ "repo_name": "qt-haiku/LibreOffice", "path": "qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java", "license": "gpl-3.0", "size": 5504 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
454,099
// Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel PluginsToRunLabel; private javax.swing.JButton browseButton; private javax.swing.JButton deselectAllButton; private javax.swing.JLabel errorLabel; private javax.swing.ButtonGroup infileTypeButtonGroup; private javax.swing.JScrollPane listsScrollPane; private javax.swing.JLabel pathLabel; private javax.swing.JTextField pathTextField; private javax.swing.JTable pluginTable; private javax.swing.JComboBox<String> profileComboBox; private javax.swing.JLabel profileLabel; private javax.swing.JButton selectAllButton; private javax.swing.JComboBox<String> timeZoneComboBox; private javax.swing.JLabel timeZoneLabel; // End of variables declaration//GEN-END:variables String getImageFilePath() { return pathTextField.getText(); }
javax.swing.JLabel PluginsToRunLabel; private javax.swing.JButton browseButton; private javax.swing.JButton deselectAllButton; private javax.swing.JLabel errorLabel; private javax.swing.ButtonGroup infileTypeButtonGroup; private javax.swing.JScrollPane listsScrollPane; private javax.swing.JLabel pathLabel; private javax.swing.JTextField pathTextField; private javax.swing.JTable pluginTable; private javax.swing.JComboBox<String> profileComboBox; private javax.swing.JLabel profileLabel; private javax.swing.JButton selectAllButton; private javax.swing.JComboBox<String> timeZoneComboBox; private javax.swing.JLabel timeZoneLabel; String function() { return pathTextField.getText(); }
/** * Get the path of the user selected image. * * @return the image path */
Get the path of the user selected image
getImageFilePath
{ "repo_name": "sleuthkit/autopsy", "path": "Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java", "license": "apache-2.0", "size": 24920 }
[ "javax.swing.JTable" ]
import javax.swing.JTable;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,671,701
public List<ProjectExpectedStudyLink> getAllStudyLinksByStudy(Long studyId);
List<ProjectExpectedStudyLink> function(Long studyId);
/** * This method gets a list of projectExpectedStudyLink by a given projectExpectedStudy identifier. * * @param studyId is the projectExpectedStudy identifier. * @return a list of projectExpectedStudyLink objects. */
This method gets a list of projectExpectedStudyLink by a given projectExpectedStudy identifier
getAllStudyLinksByStudy
{ "repo_name": "CCAFS/MARLO", "path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/ProjectExpectedStudyLinkManager.java", "license": "gpl-3.0", "size": 3759 }
[ "java.util.List", "org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudyLink" ]
import java.util.List; import org.cgiar.ccafs.marlo.data.model.ProjectExpectedStudyLink;
import java.util.*; import org.cgiar.ccafs.marlo.data.model.*;
[ "java.util", "org.cgiar.ccafs" ]
java.util; org.cgiar.ccafs;
2,388,329
private static void outputValue(PrintWriter out, Object value, int nestLevel) throws IOException { if (value == null) { out.println(JmxDumpUtil.NULL_VALUE); } else if (value.getClass().isArray()) { int length = Array.getLength(value); if (length == 0) { out.println("[]"); } else { out.println(); indent(out, nestLevel + 1); out.println('['); for (int i = 0; i < length; i++) { indent(out, nestLevel + 2); outputValue(out, Array.get(value, i), nestLevel + 2); if (i + 1 < length) { indent(out, nestLevel + 1); out.println(','); } } indent(out, nestLevel + 1); out.println(']'); } } else if (value instanceof CompositeData) { out.println(); indent(out, nestLevel + 1); out.println('['); printCompositeInfo((CompositeData) value, out, nestLevel + 2); indent(out, nestLevel + 1); out.println(']'); } else { out.println(value.toString()); } }
static void function(PrintWriter out, Object value, int nestLevel) throws IOException { if (value == null) { out.println(JmxDumpUtil.NULL_VALUE); } else if (value.getClass().isArray()) { int length = Array.getLength(value); if (length == 0) { out.println("[]"); } else { out.println(); indent(out, nestLevel + 1); out.println('['); for (int i = 0; i < length; i++) { indent(out, nestLevel + 2); outputValue(out, Array.get(value, i), nestLevel + 2); if (i + 1 < length) { indent(out, nestLevel + 1); out.println(','); } } indent(out, nestLevel + 1); out.println(']'); } } else if (value instanceof CompositeData) { out.println(); indent(out, nestLevel + 1); out.println('['); printCompositeInfo((CompositeData) value, out, nestLevel + 2); indent(out, nestLevel + 1); out.println(']'); } else { out.println(value.toString()); } }
/** * Outputs a single value, dealing with nested arrays and CompositeData objects. * * @param out * PrintWriter to write the output to * @param value * the value to output * @param nestLevel * the nesting level * @throws IOException * Signals that an I/O exception has occurred. */
Outputs a single value, dealing with nested arrays and CompositeData objects
outputValue
{ "repo_name": "daniel-he/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/management/JmxDumpUtil.java", "license": "lgpl-3.0", "size": 14081 }
[ "java.io.IOException", "java.io.PrintWriter", "java.lang.reflect.Array", "javax.management.openmbean.CompositeData" ]
import java.io.IOException; import java.io.PrintWriter; import java.lang.reflect.Array; import javax.management.openmbean.CompositeData;
import java.io.*; import java.lang.reflect.*; import javax.management.openmbean.*;
[ "java.io", "java.lang", "javax.management" ]
java.io; java.lang; javax.management;
1,747,366
private JasperPrint fillJasperTemplate( PrintMap printMap, int scaleDenominator ) throws JRException, MalformedURLException { URL templatePath = null; try { String templateName = printMap.getTemplate(); templatePath = getTemplatePath( templateName, true ); } catch ( IOException e ) { LOG.logError( e.getMessage(), e ); throw new MalformedURLException( Messages.getMessage( "WMPS_ERROR_CREATING_TEMPLATEPATH", printMap.getTemplate() ) ); } Map<String, Object> parameters = new HashMap<String, Object>(); URL mapImagePath = getResultImagePath( printMap, "Map" ); parameters.put( "MAP", mapImagePath.getFile() ); if ( printMap.getLegend() ) { URL legendImagePath = getResultImagePath( printMap, "Legend" ); parameters.put( "LEGEND", legendImagePath.getFile() ); } String scale = "1:" + scaleDenominator; if ( printMap.getScaleBar() == true ) { parameters.put( "SCALE", scale ); } TextArea[] textAreas = printMap.getTextAreas(); if ( textAreas != null && textAreas.length > 0 ) { for ( int i = 0; i < textAreas.length; i++ ) { TextArea textArea = textAreas[i]; LOG.logDebug( "Names and text fields entered, extracted." ); String name = textArea.getName(); String text = textArea.getText(); if ( name != null ) { LOG.logDebug( "If name is not null, allocate it to the hashmap 'parameters' in uppercase." ); parameters.put( name.toUpperCase(), text ); parameters.put( name, text ); } } } String title = printMap.getTitle(); if ( title != null ) { parameters.put( "TITLE", title ); } String copyright = printMap.getCopyright(); if ( copyright != null ) { parameters.put( "COPYRIGHT", copyright ); } String note = printMap.getNote(); if ( note != null ) { parameters.put( "NOTE", note ); } LOG.logDebug( "JASPER Parameter: ", parameters ); JasperPrint print = null; try { print = JasperFillManager.fillReport( templatePath.getFile(), parameters, new JREmptyDataSource() ); } catch ( JRException e ) { LOG.logError( e.getMessage(), e ); throw new JRException( Messages.getMessage( "WMPS_ERROR_BUILDING_TEMPLATE", templatePath ) ); } return print; }
JasperPrint function( PrintMap printMap, int scaleDenominator ) throws JRException, MalformedURLException { URL templatePath = null; try { String templateName = printMap.getTemplate(); templatePath = getTemplatePath( templateName, true ); } catch ( IOException e ) { LOG.logError( e.getMessage(), e ); throw new MalformedURLException( Messages.getMessage( STR, printMap.getTemplate() ) ); } Map<String, Object> parameters = new HashMap<String, Object>(); URL mapImagePath = getResultImagePath( printMap, "Map" ); parameters.put( "MAP", mapImagePath.getFile() ); if ( printMap.getLegend() ) { URL legendImagePath = getResultImagePath( printMap, STR ); parameters.put( STR, legendImagePath.getFile() ); } String scale = "1:" + scaleDenominator; if ( printMap.getScaleBar() == true ) { parameters.put( "SCALE", scale ); } TextArea[] textAreas = printMap.getTextAreas(); if ( textAreas != null && textAreas.length > 0 ) { for ( int i = 0; i < textAreas.length; i++ ) { TextArea textArea = textAreas[i]; LOG.logDebug( STR ); String name = textArea.getName(); String text = textArea.getText(); if ( name != null ) { LOG.logDebug( STR ); parameters.put( name.toUpperCase(), text ); parameters.put( name, text ); } } } String title = printMap.getTitle(); if ( title != null ) { parameters.put( "TITLE", title ); } String copyright = printMap.getCopyright(); if ( copyright != null ) { parameters.put( STR, copyright ); } String note = printMap.getNote(); if ( note != null ) { parameters.put( "NOTE", note ); } LOG.logDebug( STR, parameters ); JasperPrint print = null; try { print = JasperFillManager.fillReport( templatePath.getFile(), parameters, new JREmptyDataSource() ); } catch ( JRException e ) { LOG.logError( e.getMessage(), e ); throw new JRException( Messages.getMessage( STR, templatePath ) ); } return print; }
/** * Open the JasperAPI to process the PrintMap request. * * @param printMap * @param scaleDenominator * @return JasperPrint * @throws InconsistentRequestException * @throws JRException * @throws MalformedURLException */
Open the JasperAPI to process the PrintMap request
fillJasperTemplate
{ "repo_name": "lat-lon/deegree2-base", "path": "deegree2-core/src/main/java/org/deegree/ogcwebservices/wmps/PrintMapHandler.java", "license": "lgpl-2.1", "size": 53232 }
[ "java.io.IOException", "java.net.MalformedURLException", "java.util.HashMap", "java.util.Map", "net.sf.jasperreports.engine.JREmptyDataSource", "net.sf.jasperreports.engine.JRException", "net.sf.jasperreports.engine.JasperFillManager", "net.sf.jasperreports.engine.JasperPrint", "org.deegree.i18n.Messages", "org.deegree.ogcwebservices.wmps.operation.PrintMap", "org.deegree.ogcwebservices.wmps.operation.TextArea" ]
import java.io.IOException; import java.net.MalformedURLException; import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import org.deegree.i18n.Messages; import org.deegree.ogcwebservices.wmps.operation.PrintMap; import org.deegree.ogcwebservices.wmps.operation.TextArea;
import java.io.*; import java.net.*; import java.util.*; import net.sf.jasperreports.engine.*; import org.deegree.i18n.*; import org.deegree.ogcwebservices.wmps.operation.*;
[ "java.io", "java.net", "java.util", "net.sf.jasperreports", "org.deegree.i18n", "org.deegree.ogcwebservices" ]
java.io; java.net; java.util; net.sf.jasperreports; org.deegree.i18n; org.deegree.ogcwebservices;
1,400,098
public AnalogValueCallbackThreshold getAnalogValueCallbackThreshold() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_ANALOG_VALUE_CALLBACK_THRESHOLD, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); AnalogValueCallbackThreshold obj = new AnalogValueCallbackThreshold(); obj.option = (char)(bb.get()); obj.min = IPConnection.unsignedShort(bb.getShort()); obj.max = IPConnection.unsignedShort(bb.getShort()); return obj; } /** * Sets the period in ms with which the threshold listeners * * * {@link BrickletAnalogIn.VoltageReachedListener}, * * {@link BrickletAnalogIn.AnalogValueReachedListener} * * are triggered, if the thresholds * * * {@link BrickletAnalogIn#setVoltageCallbackThreshold(char, short, short)}, * * {@link BrickletAnalogIn#setAnalogValueCallbackThreshold(char, int, int)}
AnalogValueCallbackThreshold function() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_ANALOG_VALUE_CALLBACK_THRESHOLD, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); AnalogValueCallbackThreshold obj = new AnalogValueCallbackThreshold(); obj.option = (char)(bb.get()); obj.min = IPConnection.unsignedShort(bb.getShort()); obj.max = IPConnection.unsignedShort(bb.getShort()); return obj; } /** * Sets the period in ms with which the threshold listeners * * * {@link BrickletAnalogIn.VoltageReachedListener}, * * {@link BrickletAnalogIn.AnalogValueReachedListener} * * are triggered, if the thresholds * * * {@link BrickletAnalogIn#setVoltageCallbackThreshold(char, short, short)}, * * {@link BrickletAnalogIn#setAnalogValueCallbackThreshold(char, int, int)}
/** * Returns the threshold as set by {@link BrickletAnalogIn#setAnalogValueCallbackThreshold(char, int, int)}. */
Returns the threshold as set by <code>BrickletAnalogIn#setAnalogValueCallbackThreshold(char, int, int)</code>
getAnalogValueCallbackThreshold
{ "repo_name": "jaggr2/ch.bfh.fbi.mobiComp.17herz", "path": "com.tinkerforge/src/com/tinkerforge/BrickletAnalogIn.java", "license": "apache-2.0", "size": 23150 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,224,692
public String makeDebugString() { final StringBuilder sb = new StringBuilder(); for (int partitionIndex = 0; partitionIndex < partitions.length; partitionIndex++) { final String partitionPrefix = "Partition " + partitionIndex + ": "; final HashPartition hashPartition = partitions[partitionIndex]; sb.append(partitionPrefix).append(hashPartition.makeDebugString()).append("\n"); } return sb.toString(); }
String function() { final StringBuilder sb = new StringBuilder(); for (int partitionIndex = 0; partitionIndex < partitions.length; partitionIndex++) { final String partitionPrefix = STR + partitionIndex + STR; final HashPartition hashPartition = partitions[partitionIndex]; sb.append(partitionPrefix).append(hashPartition.makeDebugString()).append("\n"); } return sb.toString(); }
/** * This creates a string that summarizes the memory usage of the operator. * @return A memory dump string. */
This creates a string that summarizes the memory usage of the operator
makeDebugString
{ "repo_name": "kkhatua/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java", "license": "apache-2.0", "size": 61488 }
[ "org.apache.drill.exec.physical.impl.common.HashPartition" ]
import org.apache.drill.exec.physical.impl.common.HashPartition;
import org.apache.drill.exec.physical.impl.common.*;
[ "org.apache.drill" ]
org.apache.drill;
379,985
public OFFlowMod removeEntry(IOFSwitch sw, String name) { log.debug("removeEntry: switch {}, name {}", sw, name); OFFlowMod ret = null; HashMap<String, OFFlowMod> swentries = this.getEntries(sw); if (swentries.containsKey(name)) { ret = swentries.get(name); swentries.remove(name); } return ret; }
OFFlowMod function(IOFSwitch sw, String name) { log.debug(STR, sw, name); OFFlowMod ret = null; HashMap<String, OFFlowMod> swentries = this.getEntries(sw); if (swentries.containsKey(name)) { ret = swentries.get(name); swentries.remove(name); } return ret; }
/** * Remove a flow-mod entry that has been added previously * returns the flow-mod that has just been removed * * @param sw * @param name */
Remove a flow-mod entry that has been added previously returns the flow-mod that has just been removed
removeEntry
{ "repo_name": "bigswitch/BeaconMirror", "path": "net.beaconcontroller.staticflowentry/src/main/java/net/beaconcontroller/staticflowentry/StaticFlowEntryPusher.java", "license": "apache-2.0", "size": 21863 }
[ "java.util.HashMap", "net.beaconcontroller.core.IOFSwitch", "org.openflow.protocol.OFFlowMod" ]
import java.util.HashMap; import net.beaconcontroller.core.IOFSwitch; import org.openflow.protocol.OFFlowMod;
import java.util.*; import net.beaconcontroller.core.*; import org.openflow.protocol.*;
[ "java.util", "net.beaconcontroller.core", "org.openflow.protocol" ]
java.util; net.beaconcontroller.core; org.openflow.protocol;
2,536,927
List<Bundle> getBundlesByURL(String url);
List<Bundle> getBundlesByURL(String url);
/** * Returns the bundles that match * * @param url * @return */
Returns the bundles that match
getBundlesByURL
{ "repo_name": "soluvas/karaf", "path": "bundle/core/src/main/java/org/apache/karaf/bundle/core/BundleWatcher.java", "license": "apache-2.0", "size": 1316 }
[ "java.util.List", "org.osgi.framework.Bundle" ]
import java.util.List; import org.osgi.framework.Bundle;
import java.util.*; import org.osgi.framework.*;
[ "java.util", "org.osgi.framework" ]
java.util; org.osgi.framework;
2,397,885
public long[] processBombings(StatisticRound stats, StatisticEvent event) { // init List<String> playersIds = stats.getPlayersIds(); long result[] = stats.getScores(this); // processing if(event.getAction() == StatisticAction.BOMB_PLAYER) { int indexActor = playersIds.indexOf(event.getActorId()); int indexTarget = playersIds.indexOf(event.getTargetId()); if(indexActor>=0 && indexActor!=indexTarget) result[indexActor] = result[indexActor] + 1; } return result; }
long[] function(StatisticRound stats, StatisticEvent event) { List<String> playersIds = stats.getPlayersIds(); long result[] = stats.getScores(this); if(event.getAction() == StatisticAction.BOMB_PLAYER) { int indexActor = playersIds.indexOf(event.getActorId()); int indexTarget = playersIds.indexOf(event.getTargetId()); if(indexActor>=0 && indexActor!=indexTarget) result[indexActor] = result[indexActor] + 1; } return result; }
/** * Processes the bombed opponents scores for all players in the * specified round, using the specified event. * * @param stats * Stats object used to get players. * @param event * Data used to process the scores. * @return * An array containing the scores. */
Processes the bombed opponents scores for all players in the specified round, using the specified event
processBombings
{ "repo_name": "vlabatut/totalboumboum", "path": "src/org/totalboumboum/statistics/detailed/Score.java", "license": "gpl-2.0", "size": 10167 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,513,753
public String getName() { return this.getCOSDictionary().getNameAsString(COSName.N); }
String function() { return this.getCOSDictionary().getNameAsString(COSName.N); }
/** * Returns the property name. * * @return the property name */
Returns the property name
getName
{ "repo_name": "myrridin/qz-print", "path": "pdfbox_1.8.4_qz/src/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDUserProperty.java", "license": "lgpl-2.1", "size": 5311 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
2,536,372
Properties p = new Properties(); ArrayList<Configurable> l = new ArrayList<Configurable>(); findPieceSlots(l, p); return p; }
Properties p = new Properties(); ArrayList<Configurable> l = new ArrayList<Configurable>(); findPieceSlots(l, p); return p; }
/** * Returns a mapping of GamePiece type to the id of a PieceSlot in the module * This information is exported from an old module version, then imported into a new module version to update saved games * @return */
Returns a mapping of GamePiece type to the id of a PieceSlot in the module This information is exported from an old module version, then imported into a new module version to update saved games
getPieceSlotsMap
{ "repo_name": "fifa0329/vassal", "path": "src/VASSAL/tools/SavedGameUpdater.java", "license": "lgpl-2.1", "size": 5279 }
[ "java.util.ArrayList", "java.util.Properties" ]
import java.util.ArrayList; import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,669,721
public void diff_cleanupEfficiency(LinkedList<Diff> diffs) { if (diffs.isEmpty()) { return; } boolean changes = false; Stack<Diff> equalities = new Stack<Diff>(); // Stack of equalities. String lastequality = null; // Always equal to equalities.lastElement().text ListIterator<Diff> pointer = diffs.listIterator(); // Is there an insertion operation before the last equality. boolean pre_ins = false; // Is there a deletion operation before the last equality. boolean pre_del = false; // Is there an insertion operation after the last equality. boolean post_ins = false; // Is there a deletion operation after the last equality. boolean post_del = false; Diff thisDiff = pointer.next(); Diff safeDiff = thisDiff; // The last Diff that is known to be unsplitable. while (thisDiff != null) { if (thisDiff.operation == Operation.EQUAL) { // Equality found. if (thisDiff.text.length() < Diff_EditCost && (post_ins || post_del)) { // Candidate found. equalities.push(thisDiff); pre_ins = post_ins; pre_del = post_del; lastequality = thisDiff.text; } else { // Not a candidate, and can never become one. equalities.clear(); lastequality = null; safeDiff = thisDiff; } post_ins = post_del = false; } else { // An insertion or deletion. if (thisDiff.operation == Operation.DELETE) { post_del = true; } else { post_ins = true; } if (lastequality != null && ((pre_ins && pre_del && post_ins && post_del) || ((lastequality.length() < Diff_EditCost / 2) && ((pre_ins ? 1 : 0) + (pre_del ? 1 : 0) + (post_ins ? 1 : 0) + (post_del ? 1 : 0)) == 3))) { //System.out.println("Splitting: '" + lastequality + "'"); // Walk back to offending equality. while (thisDiff != equalities.lastElement()) { thisDiff = pointer.previous(); } pointer.next(); // Replace equality with a delete. pointer.set(new Diff(Operation.DELETE, lastequality)); // Insert a corresponding an insert. pointer.add(thisDiff = new Diff(Operation.INSERT, lastequality)); equalities.pop(); // Throw away the equality we just deleted. lastequality = null; if (pre_ins && pre_del) { // No changes made which could affect previous entry, keep going. post_ins = post_del = true; equalities.clear(); safeDiff = thisDiff; } else { if (!equalities.empty()) { // Throw away the previous equality (it needs to be reevaluated). equalities.pop(); } if (equalities.empty()) { // There are no previous questionable equalities, // walk back to the last known safe diff. thisDiff = safeDiff; } else { // There is an equality we can fall back to. thisDiff = equalities.lastElement(); } while (thisDiff != pointer.previous()) { // Intentionally empty loop. } post_ins = post_del = false; } changes = true; } } thisDiff = pointer.hasNext() ? pointer.next() : null; } if (changes) { diff_cleanupMerge(diffs); } }
void function(LinkedList<Diff> diffs) { if (diffs.isEmpty()) { return; } boolean changes = false; Stack<Diff> equalities = new Stack<Diff>(); String lastequality = null; ListIterator<Diff> pointer = diffs.listIterator(); boolean pre_ins = false; boolean pre_del = false; boolean post_ins = false; boolean post_del = false; Diff thisDiff = pointer.next(); Diff safeDiff = thisDiff; while (thisDiff != null) { if (thisDiff.operation == Operation.EQUAL) { if (thisDiff.text.length() < Diff_EditCost && (post_ins post_del)) { equalities.push(thisDiff); pre_ins = post_ins; pre_del = post_del; lastequality = thisDiff.text; } else { equalities.clear(); lastequality = null; safeDiff = thisDiff; } post_ins = post_del = false; } else { if (thisDiff.operation == Operation.DELETE) { post_del = true; } else { post_ins = true; } if (lastequality != null && ((pre_ins && pre_del && post_ins && post_del) ((lastequality.length() < Diff_EditCost / 2) && ((pre_ins ? 1 : 0) + (pre_del ? 1 : 0) + (post_ins ? 1 : 0) + (post_del ? 1 : 0)) == 3))) { while (thisDiff != equalities.lastElement()) { thisDiff = pointer.previous(); } pointer.next(); pointer.set(new Diff(Operation.DELETE, lastequality)); pointer.add(thisDiff = new Diff(Operation.INSERT, lastequality)); equalities.pop(); lastequality = null; if (pre_ins && pre_del) { post_ins = post_del = true; equalities.clear(); safeDiff = thisDiff; } else { if (!equalities.empty()) { equalities.pop(); } if (equalities.empty()) { thisDiff = safeDiff; } else { thisDiff = equalities.lastElement(); } while (thisDiff != pointer.previous()) { } post_ins = post_del = false; } changes = true; } } thisDiff = pointer.hasNext() ? pointer.next() : null; } if (changes) { diff_cleanupMerge(diffs); } }
/** * Reduce the number of edits by eliminating operationally trivial equalities. * @param diffs LinkedList of Diff objects. */
Reduce the number of edits by eliminating operationally trivial equalities
diff_cleanupEfficiency
{ "repo_name": "HTML5MSc/HTML5ParserComparator", "path": "Utils/src/com/html5tools/Utils/diff_match_patch.java", "license": "mit", "size": 89015 }
[ "java.util.LinkedList", "java.util.ListIterator", "java.util.Stack" ]
import java.util.LinkedList; import java.util.ListIterator; import java.util.Stack;
import java.util.*;
[ "java.util" ]
java.util;
540,578
private final static void markCompleted(String inpath, int crawlSize) throws Exception { synchronized (BulkEmbeddedJsonDownloader.class) { inpath = inpath.toUpperCase(); FileOutputStream out = new FileOutputStream(LOCK_FILE); try { FileLock lock = null; try { lock = out.getChannel().lock(); List<String> lines = Files.readLines(COMPLETED_TASKS_FILE, Charsets.UTF_8); lines.add(inpath + '\t' + crawlSize); Files.write(Joiner.on('\n').join(lines), COMPLETED_TASKS_FILE, Charsets.UTF_8); } catch (Exception e) { LOG.error( "Can't acquire lock on lock-file " + LOCK_FILE + " or can't access completed tasks file " + COMPLETED_TASKS_FILE + " : " + e.getMessage(), e); throw e; } finally { if (lock != null) lock.release(); } } finally { out.close(); } } } private final static class DownloadTask implements Callable<Integer> { public final String inpath; public final String outpath; public DownloadTask(String inpath, String outpath) { super(); this.inpath = inpath; this.outpath = outpath; }
final static void function(String inpath, int crawlSize) throws Exception { synchronized (BulkEmbeddedJsonDownloader.class) { inpath = inpath.toUpperCase(); FileOutputStream out = new FileOutputStream(LOCK_FILE); try { FileLock lock = null; try { lock = out.getChannel().lock(); List<String> lines = Files.readLines(COMPLETED_TASKS_FILE, Charsets.UTF_8); lines.add(inpath + '\t' + crawlSize); Files.write(Joiner.on('\n').join(lines), COMPLETED_TASKS_FILE, Charsets.UTF_8); } catch (Exception e) { LOG.error( STR + LOCK_FILE + STR + COMPLETED_TASKS_FILE + STR + e.getMessage(), e); throw e; } finally { if (lock != null) lock.release(); } } finally { out.close(); } } } private final static class DownloadTask implements Callable<Integer> { public final String inpath; public final String outpath; public DownloadTask(String inpath, String outpath) { super(); this.inpath = inpath; this.outpath = outpath; }
/** * Locks the lock-file, then records that this task has been completed * * @param inpath * path of the input file, which should serve as a unique ID for the * job * @return true if the job should be undertaken, false if the job should be * abandoned (on the premise that it's already done/in-progress) */
Locks the lock-file, then records that this task has been completed
markCompleted
{ "repo_name": "budgefeeney/twitter-tools", "path": "src/main/java/cc/twittertools/scripts/BulkEmbeddedJsonDownloader.java", "license": "apache-2.0", "size": 8641 }
[ "com.google.common.base.Charsets", "com.google.common.base.Joiner", "com.google.common.io.Files", "java.io.FileOutputStream", "java.nio.channels.FileLock", "java.util.List", "java.util.concurrent.Callable" ]
import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.io.Files; import java.io.FileOutputStream; import java.nio.channels.FileLock; import java.util.List; import java.util.concurrent.Callable;
import com.google.common.base.*; import com.google.common.io.*; import java.io.*; import java.nio.channels.*; import java.util.*; import java.util.concurrent.*;
[ "com.google.common", "java.io", "java.nio", "java.util" ]
com.google.common; java.io; java.nio; java.util;
449,742
public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); }
boolean function() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); }
/** * Returns true if field success is set (has been assigned a value) and * false otherwise */
Returns true if field success is set (has been assigned a value) and false otherwise
isSetSuccess
{ "repo_name": "f1194361820/helper", "path": "frameworkex/frameworkex-apache-thrift/src/test/java/com/fjn/helper/frameworkex/apache/thrift/tutorial/Calculator.java", "license": "gpl-2.0", "size": 130625 }
[ "org.apache.thrift.EncodingUtils" ]
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.*;
[ "org.apache.thrift" ]
org.apache.thrift;
2,679,551
public List<Patch> patch_fromText(String textline) throws IllegalArgumentException { List<Patch> patches = new LinkedList<Patch>(); if (textline.length() == 0) { return patches; } List<String> textList = Arrays.asList(textline.split("\n")); LinkedList<String> text = new LinkedList<String>(textList); Patch patch; Pattern patchHeader = Pattern.compile("^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$"); Matcher m; char sign; String line; while (!text.isEmpty()) { m = patchHeader.matcher(text.getFirst()); if (!m.matches()) { throw new IllegalArgumentException( "Invalid patch string: " + text.getFirst()); } patch = new Patch(); patches.add(patch); patch.start1 = Integer.parseInt(m.group(1)); if (m.group(2).length() == 0) { patch.start1--; patch.length1 = 1; } else if (m.group(2).equals("0")) { patch.length1 = 0; } else { patch.start1--; patch.length1 = Integer.parseInt(m.group(2)); } patch.start2 = Integer.parseInt(m.group(3)); if (m.group(4).length() == 0) { patch.start2--; patch.length2 = 1; } else if (m.group(4).equals("0")) { patch.length2 = 0; } else { patch.start2--; patch.length2 = Integer.parseInt(m.group(4)); } text.removeFirst(); while (!text.isEmpty()) { try { sign = text.getFirst().charAt(0); } catch (IndexOutOfBoundsException e) { // Blank line? Whatever. text.removeFirst(); continue; } line = text.getFirst().substring(1); line = line.replace("+", "%2B"); // decode would change all "+" to " " try { line = URLDecoder.decode(line, "UTF-8"); } catch (UnsupportedEncodingException e) { // Not likely on modern system. throw new Error("This system does not support UTF-8.", e); } catch (IllegalArgumentException e) { // Malformed URI sequence. throw new IllegalArgumentException( "Illegal escape in patch_fromText: " + line, e); } if (sign == '-') { // Deletion. patch.diffs.add(new Diff(Operation.DELETE, line)); } else if (sign == '+') { // Insertion. patch.diffs.add(new Diff(Operation.INSERT, line)); } else if (sign == ' ') { // Minor equality. patch.diffs.add(new Diff(Operation.EQUAL, line)); } else if (sign == '@') { // Start of next patch. break; } else { // WTF? throw new IllegalArgumentException( "Invalid patch mode '" + sign + "' in: " + line); } text.removeFirst(); } } return patches; } public static class Diff { public Operation operation; public String text; public Diff(Operation operation, String text) { // Construct a diff with the specified operation and text. this.operation = operation; this.text = text; }
List<Patch> function(String textline) throws IllegalArgumentException { List<Patch> patches = new LinkedList<Patch>(); if (textline.length() == 0) { return patches; } List<String> textList = Arrays.asList(textline.split("\n")); LinkedList<String> text = new LinkedList<String>(textList); Patch patch; Pattern patchHeader = Pattern.compile(STR); Matcher m; char sign; String line; while (!text.isEmpty()) { m = patchHeader.matcher(text.getFirst()); if (!m.matches()) { throw new IllegalArgumentException( STR + text.getFirst()); } patch = new Patch(); patches.add(patch); patch.start1 = Integer.parseInt(m.group(1)); if (m.group(2).length() == 0) { patch.start1--; patch.length1 = 1; } else if (m.group(2).equals("0")) { patch.length1 = 0; } else { patch.start1--; patch.length1 = Integer.parseInt(m.group(2)); } patch.start2 = Integer.parseInt(m.group(3)); if (m.group(4).length() == 0) { patch.start2--; patch.length2 = 1; } else if (m.group(4).equals("0")) { patch.length2 = 0; } else { patch.start2--; patch.length2 = Integer.parseInt(m.group(4)); } text.removeFirst(); while (!text.isEmpty()) { try { sign = text.getFirst().charAt(0); } catch (IndexOutOfBoundsException e) { text.removeFirst(); continue; } line = text.getFirst().substring(1); line = line.replace("+", "%2B"); try { line = URLDecoder.decode(line, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new Error(STR, e); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( STR + line, e); } if (sign == '-') { patch.diffs.add(new Diff(Operation.DELETE, line)); } else if (sign == '+') { patch.diffs.add(new Diff(Operation.INSERT, line)); } else if (sign == ' ') { patch.diffs.add(new Diff(Operation.EQUAL, line)); } else if (sign == '@') { break; } else { throw new IllegalArgumentException( STR + sign + STR + line); } text.removeFirst(); } } return patches; } public static class Diff { public Operation operation; public String text; public Diff(Operation operation, String text) { this.operation = operation; this.text = text; }
/** * Parse a textual representation of patches and return a List of Patch * objects. * @param textline Text representation of patches. * @return List of Patch objects. * @throws IllegalArgumentException If invalid input. */
Parse a textual representation of patches and return a List of Patch objects
patch_fromText
{ "repo_name": "ShengLiu/File-Dependency-Client", "path": "src/com/projectchanged/client/userInterface/diff_match_patch.java", "license": "bsd-3-clause", "size": 89449 }
[ "java.io.UnsupportedEncodingException", "java.net.URLDecoder", "java.util.Arrays", "java.util.LinkedList", "java.util.List", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.io.*; import java.net.*; import java.util.*; import java.util.regex.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
2,084,580
public static RepositoryFolderAndXml parseRepoFile(File directory, Collection<String> subDirs, ModuleFileUnmarshaller unmarshaller) { File repositoryFile = null; String repoDir = null; RepositoryXml repoFile = null; if (subDirs.contains(REPOSITORY_FOLDER_NAME)) { repoDir = directory.getAbsolutePath() + File.separator + REPOSITORY_FOLDER_NAME; repositoryFile = new File(directory.getPath()+ File.separator + REPOSITORY_FOLDER_NAME + File.separator + REPOSITORY_FILE_NAME); if (repositoryFile.exists()) { try { repoFile = unmarshaller.unmarshal(RepositoryXml.class, repositoryFile); } catch (Exception e) { repoFile = new RepositoryXml(); repoFile.setValid(false); String msg = "Unable to parse repo file at location: " + repositoryFile.getAbsolutePath(); repoFile.addError(msg); LOG.warn(msg); } } } return new RepositoryFolderAndXml(Optional.fromNullable(repoDir), Optional.fromNullable(repoFile)); }
static RepositoryFolderAndXml function(File directory, Collection<String> subDirs, ModuleFileUnmarshaller unmarshaller) { File repositoryFile = null; String repoDir = null; RepositoryXml repoFile = null; if (subDirs.contains(REPOSITORY_FOLDER_NAME)) { repoDir = directory.getAbsolutePath() + File.separator + REPOSITORY_FOLDER_NAME; repositoryFile = new File(directory.getPath()+ File.separator + REPOSITORY_FOLDER_NAME + File.separator + REPOSITORY_FILE_NAME); if (repositoryFile.exists()) { try { repoFile = unmarshaller.unmarshal(RepositoryXml.class, repositoryFile); } catch (Exception e) { repoFile = new RepositoryXml(); repoFile.setValid(false); String msg = STR + repositoryFile.getAbsolutePath(); repoFile.addError(msg); LOG.warn(msg); } } } return new RepositoryFolderAndXml(Optional.fromNullable(repoDir), Optional.fromNullable(repoFile)); }
/** * Parses the repository file for a stack/service if exists. * * @param directory stack/service base directory * @param subDirs stack/service directory sub directories * @param unmarshaller {@link ModuleFileUnmarshaller}, needed to parse repo XML * @throws AmbariException if unable to parse the repository file * @return The directory containing the repo file and the parsed repo file (if exists) */
Parses the repository file for a stack/service if exists
parseRepoFile
{ "repo_name": "alexryndin/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java", "license": "apache-2.0", "size": 8732 }
[ "com.google.common.base.Optional", "java.io.File", "java.util.Collection", "org.apache.ambari.server.state.stack.RepositoryXml" ]
import com.google.common.base.Optional; import java.io.File; import java.util.Collection; import org.apache.ambari.server.state.stack.RepositoryXml;
import com.google.common.base.*; import java.io.*; import java.util.*; import org.apache.ambari.server.state.stack.*;
[ "com.google.common", "java.io", "java.util", "org.apache.ambari" ]
com.google.common; java.io; java.util; org.apache.ambari;
341,431
public void updateUserPermissions(String userName, Map<String, List<String>> perms); /** * List the available permission types. * * @deprecated in favour of {@link listAvailablePermissionRoleTypes()}
void function(String userName, Map<String, List<String>> perms); /** * List the available permission types. * * @deprecated in favour of {@link listAvailablePermissionRoleTypes()}
/** * Update the user permissions - takes the userName, and a map from * permission type to the list of targets it applies to. */
Update the user permissions - takes the userName, and a map from permission type to the list of targets it applies to
updateUserPermissions
{ "repo_name": "cyberdrcarr/guvnor", "path": "guvnor-webapp-core/src/main/java/org/drools/guvnor/client/rpc/RepositoryService.java", "license": "apache-2.0", "size": 11271 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,666,933
@Test public void whenDelete() { Tracker tracker = new Tracker(); Item item = new Item("test1", "testDescription", "testdesc", 123L, "Hello World!"); Item item2 = new Item("test2", "testDescription", "testdesc", 123L, "Hello World!"); tracker.add(item); tracker.add(item2); tracker.delete(item2); assertThat(tracker.findByName("testDescription").length, is(1)); }
void function() { Tracker tracker = new Tracker(); Item item = new Item("test1", STR, STR, 123L, STR); Item item2 = new Item("test2", STR, STR, 123L, STR); tracker.add(item); tracker.add(item2); tracker.delete(item2); assertThat(tracker.findByName(STR).length, is(1)); }
/** * Test delete(), findByName(). */
Test delete(), findByName()
whenDelete
{ "repo_name": "jkulabuha/akulabuhov", "path": "chapter_002/src/test/java/ru/job4j/tracker/TrackerTest.java", "license": "apache-2.0", "size": 1855 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
1,412,555
public String getValueFromRequestElements(String sName) { String sValue = null; if (getQueryParams() != null) { final List<String> v = getQueryParams().get(sName); if (v != null && !v.isEmpty()) sValue = v.iterator().next(); } if (sValue != null) return sValue; sValue = getHeaderValue(sName); if (sValue != null) return sValue; sValue = getFormValue(sName); if (sValue != null) return sValue; return null; }
String function(String sName) { String sValue = null; if (getQueryParams() != null) { final List<String> v = getQueryParams().get(sName); if (v != null && !v.isEmpty()) sValue = v.iterator().next(); } if (sValue != null) return sValue; sValue = getHeaderValue(sName); if (sValue != null) return sValue; sValue = getFormValue(sName); if (sValue != null) return sValue; return null; }
/** * Checks headers, query string, and form body for a given parameter * * @param sName * @return */
Checks headers, query string, and form body for a given parameter
getValueFromRequestElements
{ "repo_name": "yeungbo/zuul", "path": "zuul-core/src/main/java/com/netflix/zuul/util/HTTPRequestUtils.java", "license": "apache-2.0", "size": 10218 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
300,244
public URL getAuthLoginURL() { try { return authServerURL.resolve(LOGIN_LOC).toURL(); } catch (MalformedURLException e) { throw new RuntimeException("This should never happen"); } }
URL function() { try { return authServerURL.resolve(LOGIN_LOC).toURL(); } catch (MalformedURLException e) { throw new RuntimeException(STR); } }
/** Returns the full URL used for logging in a user with the KBase * authorization service. * @return the auth service login URL. */
Returns the full URL used for logging in a user with the KBase authorization service
getAuthLoginURL
{ "repo_name": "kbase/auth", "path": "java-libs/src/us/kbase/auth/AuthConfig.java", "license": "mit", "size": 9591 }
[ "java.net.MalformedURLException" ]
import java.net.MalformedURLException;
import java.net.*;
[ "java.net" ]
java.net;
2,817,445
byte[] generateDelegatingMethodHandleHolderClassBytes(String className, MethodType[] methodTypes);
byte[] generateDelegatingMethodHandleHolderClassBytes(String className, MethodType[] methodTypes);
/** * Returns a {@code byte[]} containing the bytecode for a class implementing * DelegatingMethodHandles of each {@code MethodType} kind in the * {@code methodTypes} argument. Used by GenerateJLIClassesPlugin to * generate such a class during the jlink phase. */
Returns a byte[] containing the bytecode for a class implementing DelegatingMethodHandles of each MethodType kind in the methodTypes argument. Used by GenerateJLIClassesPlugin to generate such a class during the jlink phase
generateDelegatingMethodHandleHolderClassBytes
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java", "license": "gpl-2.0", "size": 3287 }
[ "java.lang.invoke.MethodType" ]
import java.lang.invoke.MethodType;
import java.lang.invoke.*;
[ "java.lang" ]
java.lang;
2,075,856
public Integer getAvailableAccountBalanceCount(Map fieldValues, boolean isConsolidated) { Integer recordCount = null; if (!isConsolidated) { recordCount = OJBUtility.getResultSizeFromMap(fieldValues, new AccountBalance()).intValue(); } else { Iterator recordCountIterator = accountBalanceDao.findConsolidatedAvailableAccountBalance(fieldValues); // TODO: WL: why build a list and waste time/memory when we can just iterate through the iterator and do a count? List recordCountList = IteratorUtils.toList(recordCountIterator); recordCount = recordCountList.size(); } return recordCount; }
Integer function(Map fieldValues, boolean isConsolidated) { Integer recordCount = null; if (!isConsolidated) { recordCount = OJBUtility.getResultSizeFromMap(fieldValues, new AccountBalance()).intValue(); } else { Iterator recordCountIterator = accountBalanceDao.findConsolidatedAvailableAccountBalance(fieldValues); List recordCountList = IteratorUtils.toList(recordCountIterator); recordCount = recordCountList.size(); } return recordCount; }
/** * This method gets the number of the available account balances according to input fields and values * * @param fieldValues the input fields and values * @param isConsolidated determine whether the search results are consolidated * @return the number of the available account balances * @see org.kuali.kfs.gl.service.AccountBalanceService#getAvailableAccountBalanceCount(java.util.Map, boolean) */
This method gets the number of the available account balances according to input fields and values
getAvailableAccountBalanceCount
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/org/kuali/kfs/gl/service/impl/AccountBalanceServiceImpl.java", "license": "agpl-3.0", "size": 23823 }
[ "java.util.Iterator", "java.util.List", "java.util.Map", "org.apache.commons.collections.IteratorUtils", "org.kuali.kfs.gl.OJBUtility", "org.kuali.kfs.gl.businessobject.AccountBalance" ]
import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.commons.collections.IteratorUtils; import org.kuali.kfs.gl.OJBUtility; import org.kuali.kfs.gl.businessobject.AccountBalance;
import java.util.*; import org.apache.commons.collections.*; import org.kuali.kfs.gl.*; import org.kuali.kfs.gl.businessobject.*;
[ "java.util", "org.apache.commons", "org.kuali.kfs" ]
java.util; org.apache.commons; org.kuali.kfs;
1,098,206
public void setProperties(Map<String, Object> properties) { m_properties = properties; }
void function(Map<String, Object> properties) { m_properties = properties; }
/** * Set the properties. * @param strProperties The properties to set. */
Set the properties
setProperties
{ "repo_name": "jbundle/jbundle", "path": "base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/BaseHttpTask.java", "license": "gpl-3.0", "size": 41977 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,691,484
public static void addMonths(Calendar calendar, int months) { calendar.add(Calendar.MONTH, months); }
static void function(Calendar calendar, int months) { calendar.add(Calendar.MONTH, months); }
/** * Add the given amount of months to the given calendar. The changes are * reflected in the given calendar. * * @param calendar * The calendar to add the given amount of months to. * @param months * The amount of months to be added to the given calendar. * Negative values are also allowed, it will just go back in * time. */
Add the given amount of months to the given calendar. The changes are reflected in the given calendar
addMonths
{ "repo_name": "masterucm1617/botzzaroni", "path": "BotzzaroniDev/src/icaro/aplicaciones/informacion/gestionPizzeria/CalendarUtil.java", "license": "gpl-3.0", "size": 21074 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
2,557,269
public void format(String journalId, NamespaceInfo nsInfo) throws IOException;
void function(String journalId, NamespaceInfo nsInfo) throws IOException;
/** * Format the underlying storage for the given namespace. */
Format the underlying storage for the given namespace
format
{ "repo_name": "ict-carch/hadoop-plus", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/protocol/QJournalProtocol.java", "license": "apache-2.0", "size": 5538 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.server.protocol.NamespaceInfo" ]
import java.io.IOException; import org.apache.hadoop.hdfs.server.protocol.NamespaceInfo;
import java.io.*; import org.apache.hadoop.hdfs.server.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
233,104
public TabBuilder setPreInitializeAction(Callback<Tab> action) { mPreInitializeAction = action; return this; }
TabBuilder function(Callback<Tab> action) { mPreInitializeAction = action; return this; }
/** * Sets a pre-initialization action to run. * @param action {@link Callback} object to invoke before {@link #initialize()}. * @return {@link TabBuilder} creating the Tab. */
Sets a pre-initialization action to run
setPreInitializeAction
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java", "license": "bsd-3-clause", "size": 8993 }
[ "org.chromium.base.Callback" ]
import org.chromium.base.Callback;
import org.chromium.base.*;
[ "org.chromium.base" ]
org.chromium.base;
1,779,889
public JPanel getContPaneItemFreqDist1() { if (contPaneItemFreqDist1 == null) { lblSkew = new JLabel(); lblSkew.setBounds(new Rectangle(15, 75, 95, 20)); lblSkew.setToolTipText("Must be >0"); lblSkew.setText("Skew ( >0 )"); lblMaxFreq1 = new JLabel(); lblMaxFreq1.setBounds(new Rectangle(15, 45, 95, 20)); lblMaxFreq1.setToolTipText("maximum global frequency of an item"); lblMaxFreq1.setText("Max Frequency"); lblMinFreq1 = new JLabel(); lblMinFreq1.setBounds(new Rectangle(15, 15, 95, 20)); lblMinFreq1.setToolTipText("minimum global frequency of an item"); lblMinFreq1.setText("Min Frequency"); contPaneItemFreqDist1 = new JPanel(); contPaneItemFreqDist1.setLayout(null); contPaneItemFreqDist1.setPreferredSize(new Dimension(220, 130)); contPaneItemFreqDist1.add(lblMinFreq1, null); contPaneItemFreqDist1.add(lblMaxFreq1, null); contPaneItemFreqDist1.add(getTxtMinFreq1(), null); contPaneItemFreqDist1.add(getTxtMaxFreq1(), null); contPaneItemFreqDist1.add(getBtnRndOK1(), null); contPaneItemFreqDist1.add(lblSkew, null); contPaneItemFreqDist1.add(getTxtSkew(), null); } return contPaneItemFreqDist1; }
JPanel function() { if (contPaneItemFreqDist1 == null) { lblSkew = new JLabel(); lblSkew.setBounds(new Rectangle(15, 75, 95, 20)); lblSkew.setToolTipText(STR); lblSkew.setText(STR); lblMaxFreq1 = new JLabel(); lblMaxFreq1.setBounds(new Rectangle(15, 45, 95, 20)); lblMaxFreq1.setToolTipText(STR); lblMaxFreq1.setText(STR); lblMinFreq1 = new JLabel(); lblMinFreq1.setBounds(new Rectangle(15, 15, 95, 20)); lblMinFreq1.setToolTipText(STR); lblMinFreq1.setText(STR); contPaneItemFreqDist1 = new JPanel(); contPaneItemFreqDist1.setLayout(null); contPaneItemFreqDist1.setPreferredSize(new Dimension(220, 130)); contPaneItemFreqDist1.add(lblMinFreq1, null); contPaneItemFreqDist1.add(lblMaxFreq1, null); contPaneItemFreqDist1.add(getTxtMinFreq1(), null); contPaneItemFreqDist1.add(getTxtMaxFreq1(), null); contPaneItemFreqDist1.add(getBtnRndOK1(), null); contPaneItemFreqDist1.add(lblSkew, null); contPaneItemFreqDist1.add(getTxtSkew(), null); } return contPaneItemFreqDist1; }
/** * This method initializes contPaneItemFreqDist1 * * @return javax.swing.JPanel */
This method initializes contPaneItemFreqDist1
getContPaneItemFreqDist1
{ "repo_name": "emrahcem/profid", "path": "src/example/popularItems/gui/content/NetworkParamsPanel.java", "license": "apache-2.0", "size": 43194 }
[ "java.awt.Dimension", "java.awt.Rectangle", "javax.swing.JLabel", "javax.swing.JPanel" ]
import java.awt.Dimension; import java.awt.Rectangle; import javax.swing.JLabel; import javax.swing.JPanel;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
779,651
public Node getNamedItem( String name ) { if ( name == null ) { return null; } return get( null, name ); }
Node function( String name ) { if ( name == null ) { return null; } return get( null, name ); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}. */
DOM: Implements <code>org.w3c.dom.NamedNodeMap#getNamedItem(String)</code>
getNamedItem
{ "repo_name": "sflyphotobooks/crp-batik", "path": "sources/org/apache/batik/dom/AbstractElement.java", "license": "apache-2.0", "size": 35349 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,854,464
ItemMeta getItemMeta(Material material); /** * Gets material. to use for the icon. {@link org.bukkit.Material}
ItemMeta getItemMeta(Material material); /** * Gets material. to use for the icon. {@link org.bukkit.Material}
/** * Gets item meta. * * @param material the material * @return the ItemMeta related to the material */
Gets item meta
getItemMeta
{ "repo_name": "SurvivalGamesDevTeam/TheSurvivalGames", "path": "src/main/java/com/communitysurvivalgames/thesurvivalgames/util/items/interfaces/IMetable.java", "license": "unlicense", "size": 732 }
[ "org.bukkit.Material", "org.bukkit.inventory.meta.ItemMeta" ]
import org.bukkit.Material; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.*; import org.bukkit.inventory.meta.*;
[ "org.bukkit", "org.bukkit.inventory" ]
org.bukkit; org.bukkit.inventory;
1,273,838
@Test public void service2getPage() { List<KeyValue> array = new ArrayList<>(); KeyValue key1 = new KeyValue(1, "Foo"); KeyValue key2 = new KeyValue(2, "Bar"); KeyValue key3 = new KeyValue(10, "Baz"); array.add(key1); array.add(key2); array.add(key3); KeyValuePage page = new KeyValuePage(array, "SomeNextLink"); PagedResponse<KeyValue> response = createService(Service2.class).getPage(page); assertNotNull(response); assertEquals(array.size(), response.getValue().size()); }
void function() { List<KeyValue> array = new ArrayList<>(); KeyValue key1 = new KeyValue(1, "Foo"); KeyValue key2 = new KeyValue(2, "Bar"); KeyValue key3 = new KeyValue(10, "Baz"); array.add(key1); array.add(key2); array.add(key3); KeyValuePage page = new KeyValuePage(array, STR); PagedResponse<KeyValue> response = createService(Service2.class).getPage(page); assertNotNull(response); assertEquals(array.size(), response.getValue().size()); }
/** * Verifies that we can get a PagedResponse&lt;T&gt; when the user has implemented their own class from {@link * Page}. */
Verifies that we can get a PagedResponse&lt;T&gt; when the user has implemented their own class from <code>Page</code>
service2getPage
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/core/azure-core-test/src/test/java/com/azure/core/test/implementation/RestProxyWithMockTests.java", "license": "mit", "size": 22800 }
[ "com.azure.core.http.rest.PagedResponse", "java.util.ArrayList", "java.util.List", "org.junit.jupiter.api.Assertions" ]
import com.azure.core.http.rest.PagedResponse; import java.util.ArrayList; import java.util.List; import org.junit.jupiter.api.Assertions;
import com.azure.core.http.rest.*; import java.util.*; import org.junit.jupiter.api.*;
[ "com.azure.core", "java.util", "org.junit.jupiter" ]
com.azure.core; java.util; org.junit.jupiter;
844,875
List<Invoice> retrieveInvoices(Company company);
List<Invoice> retrieveInvoices(Company company);
/** * Retrieve ventilated invoices from factorized customers. * * @param company * @return */
Retrieve ventilated invoices from factorized customers
retrieveInvoices
{ "repo_name": "ama-axelor/axelor-business-suite", "path": "axelor-account/src/main/java/com/axelor/apps/account/service/SubrogationReleaseService.java", "license": "agpl-3.0", "size": 2509 }
[ "com.axelor.apps.account.db.Invoice", "com.axelor.apps.base.db.Company", "java.util.List" ]
import com.axelor.apps.account.db.Invoice; import com.axelor.apps.base.db.Company; import java.util.List;
import com.axelor.apps.account.db.*; import com.axelor.apps.base.db.*; import java.util.*;
[ "com.axelor.apps", "java.util" ]
com.axelor.apps; java.util;
2,582,483