method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public String getFullName() throws RemoteException;
String function() throws RemoteException;
/** * Returns the full name of the SubComponent. * * @return a String containing the full name. * * @exception RemoteException if there was an error during remote access of this method. */
Returns the full name of the SubComponent
getFullName
{ "repo_name": "tolo/JServer", "path": "src/java/com/teletalk/jserver/rmi/remote/RemoteSubComponent.java", "license": "apache-2.0", "size": 14573 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
459,236
public static DoubleMatrix cholesky(DoubleMatrix A) { DoubleMatrix result = A.dup(); int info = NativeBlas.dpotrf('U', A.rows, result.data, 0, A.rows); if (info < 0) { throw new LapackArgumentException("DPOTRF", -info); } else if (info > 0) { throw new LapackPositivityException("DPOTRF", "Minor " + info + " was negative. Matrix must be positive definite."); } clearLower(result); return result; }
static DoubleMatrix function(DoubleMatrix A) { DoubleMatrix result = A.dup(); int info = NativeBlas.dpotrf('U', A.rows, result.data, 0, A.rows); if (info < 0) { throw new LapackArgumentException(STR, -info); } else if (info > 0) { throw new LapackPositivityException(STR, STR + info + STR); } clearLower(result); return result; }
/** * Compute Cholesky decomposition of A * * @param A symmetric, positive definite matrix (only upper half is used) * @return upper triangular matrix U such that A = U' * U */
Compute Cholesky decomposition of A
cholesky
{ "repo_name": "Quantisan/jblas", "path": "src/main/java/org/jblas/Decompose.java", "license": "bsd-3-clause", "size": 3233 }
[ "org.jblas.exceptions.LapackArgumentException", "org.jblas.exceptions.LapackPositivityException" ]
import org.jblas.exceptions.LapackArgumentException; import org.jblas.exceptions.LapackPositivityException;
import org.jblas.exceptions.*;
[ "org.jblas.exceptions" ]
org.jblas.exceptions;
1,212,449
private static EncodingInfo[] loadEncodingInfo() { try { final InputStream is; SecuritySupport ss = SecuritySupport.getInstance(); is = ss.getResourceAsStream(ObjectFactory.findClassLoader(), ENCODINGS_FILE); Properties props = new Properties(); if (is != null) { props.load(is); is.close(); } else { // Seems to be no real need to force failure here, let the // system do its best... The issue is not really very critical, // and the output will be in any case _correct_ though maybe not // always human-friendly... :) // But maybe report/log the resource problem? // Any standard ways to report/log errors (in static context)? } int totalEntries = props.size(); List encodingInfo_list = new ArrayList(); Enumeration keys = props.keys(); for (int i = 0; i < totalEntries; ++i) { String javaName = (String) keys.nextElement(); String val = props.getProperty(javaName); int len = lengthOfMimeNames(val); String mimeName; char highChar; if (len == 0) { // There is no property value, only the javaName, so try and recover mimeName = javaName; highChar = '\u0000'; // don't know the high code point, will need to test every character } else { try { // Get the substring after the Mime names final String highVal = val.substring(len).trim(); highChar = (char) Integer.decode(highVal).intValue(); } catch( NumberFormatException e) { highChar = 0; } String mimeNames = val.substring(0, len); StringTokenizer st = new StringTokenizer(mimeNames, ","); for (boolean first = true; st.hasMoreTokens(); first = false) { mimeName = st.nextToken(); EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar); encodingInfo_list.add(ei); _encodingTableKeyMime.put(mimeName.toUpperCase(), ei); if (first) _encodingTableKeyJava.put(javaName.toUpperCase(), ei); } } } // Convert the Vector of EncodingInfo objects into an array of them, // as that is the kind of thing this method returns. EncodingInfo[] ret_ei = new EncodingInfo[encodingInfo_list.size()]; encodingInfo_list.toArray(ret_ei); return ret_ei; } catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); } catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); } }
static EncodingInfo[] function() { try { final InputStream is; SecuritySupport ss = SecuritySupport.getInstance(); is = ss.getResourceAsStream(ObjectFactory.findClassLoader(), ENCODINGS_FILE); Properties props = new Properties(); if (is != null) { props.load(is); is.close(); } else { } int totalEntries = props.size(); List encodingInfo_list = new ArrayList(); Enumeration keys = props.keys(); for (int i = 0; i < totalEntries; ++i) { String javaName = (String) keys.nextElement(); String val = props.getProperty(javaName); int len = lengthOfMimeNames(val); String mimeName; char highChar; if (len == 0) { mimeName = javaName; highChar = '\u0000'; } else { try { final String highVal = val.substring(len).trim(); highChar = (char) Integer.decode(highVal).intValue(); } catch( NumberFormatException e) { highChar = 0; } String mimeNames = val.substring(0, len); StringTokenizer st = new StringTokenizer(mimeNames, ","); for (boolean first = true; st.hasMoreTokens(); first = false) { mimeName = st.nextToken(); EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar); encodingInfo_list.add(ei); _encodingTableKeyMime.put(mimeName.toUpperCase(), ei); if (first) _encodingTableKeyJava.put(javaName.toUpperCase(), ei); } } } EncodingInfo[] ret_ei = new EncodingInfo[encodingInfo_list.size()]; encodingInfo_list.toArray(ret_ei); return ret_ei; } catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); } catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); } }
/** * Load a list of all the supported encodings. * * System property "encodings" formatted using URL syntax may define an * external encodings list. Thanks to Sergey Ushakov for the code * contribution! * @xsl.usage internal */
Load a list of all the supported encodings. System property "encodings" formatted using URL syntax may define an external encodings list. Thanks to Sergey Ushakov for the code contribution
loadEncodingInfo
{ "repo_name": "srnsw/xena", "path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xml/serializer/Encodings.java", "license": "gpl-3.0", "size": 17814 }
[ "java.io.InputStream", "java.util.ArrayList", "java.util.Enumeration", "java.util.List", "java.util.Properties", "java.util.StringTokenizer" ]
import java.io.InputStream; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Properties; import java.util.StringTokenizer;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,324,362
EReference getGlobalChoreographyTask_InitiatingParticipantRef();
EReference getGlobalChoreographyTask_InitiatingParticipantRef();
/** * Returns the meta object for the reference '{@link org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef <em>Initiating Participant Ref</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Initiating Participant Ref</em>'. * @see org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef() * @see #getGlobalChoreographyTask() * @generated */
Returns the meta object for the reference '<code>org.eclipse.bpmn2.GlobalChoreographyTask#getInitiatingParticipantRef Initiating Participant Ref</code>'.
getGlobalChoreographyTask_InitiatingParticipantRef
{ "repo_name": "lqjack/fixflow", "path": "modules/fixflow-core/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java", "license": "apache-2.0", "size": 1014933 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,408,161
ModelAndView getModelAndView(UifFormBase form, String pageId);
ModelAndView getModelAndView(UifFormBase form, String pageId);
/** * Configures the Spring model and view instance containing the form data and pointing to the * generic Uif view, and also changes the current page to the given page id. * * <p>The view to render is assumed to be set in the given form object.</p> * * @param form form instance containing the model data * @param pageId page id within the view to render * @return ModelAndView instance for rendering the view */
Configures the Spring model and view instance containing the form data and pointing to the generic Uif view, and also changes the current page to the given page id. The view to render is assumed to be set in the given form object
getModelAndView
{ "repo_name": "jruchcolo/rice-cd", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/web/service/ModelAndViewService.java", "license": "apache-2.0", "size": 7501 }
[ "org.kuali.rice.krad.web.form.UifFormBase", "org.springframework.web.servlet.ModelAndView" ]
import org.kuali.rice.krad.web.form.UifFormBase; import org.springframework.web.servlet.ModelAndView;
import org.kuali.rice.krad.web.form.*; import org.springframework.web.servlet.*;
[ "org.kuali.rice", "org.springframework.web" ]
org.kuali.rice; org.springframework.web;
1,140,715
private void put(Ignite node, int startIdx, int endIdx) { for (int i = startIdx; i < endIdx; i++) node.cache(CACHE_NAME).put(key(node, i), val(node, i)); }
void function(Ignite node, int startIdx, int endIdx) { for (int i = startIdx; i < endIdx; i++) node.cache(CACHE_NAME).put(key(node, i), val(node, i)); }
/** * Put to cache keys and values for range from startIdx to endIdx. * @param node Node. * @param startIdx Starting index. * @param endIdx Ending index. */
Put to cache keys and values for range from startIdx to endIdx
put
{ "repo_name": "psadusumilli/ignite", "path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicColumnsAbstractConcurrentSelfTest.java", "license": "apache-2.0", "size": 40302 }
[ "org.apache.ignite.Ignite" ]
import org.apache.ignite.Ignite;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,099,540
@Test public void testLoadSpecifiedAnnotationsVariousTypes() throws Exception { TagAnnotation tag = new TagAnnotationI(); tag.setTextValue(omero.rtypes.rstring("tag")); TagAnnotation tagReturned = (TagAnnotation) iUpdate .saveAndReturnObject(tag); Parameters param = new Parameters(); List<String> include = new ArrayList<String>(); List<String> exclude = new ArrayList<String>(); // First test the include condition List<Annotation> result = iMetadata.loadSpecifiedAnnotations( TagAnnotation.class.getName(), include, exclude, param); assertNotNull(result); Iterator<Annotation> i = result.iterator(); int count = 0; TagAnnotationData tagData = null; Annotation annotation; while (i.hasNext()) { annotation = i.next(); if (annotation instanceof TagAnnotation) count++; if (annotation.getId().getValue() == tagReturned.getId().getValue()) tagData = new TagAnnotationData(tagReturned); } assertEquals(result.size(), count); assertNotNull(tagData); // comment CommentAnnotation comment = new CommentAnnotationI(); comment.setTextValue(omero.rtypes.rstring("comment")); CommentAnnotation commentReturned = (CommentAnnotation) iUpdate .saveAndReturnObject(comment); result = iMetadata.loadSpecifiedAnnotations( CommentAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; TextualAnnotationData commentData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof CommentAnnotation) count++; if (annotation.getId().getValue() == commentReturned.getId() .getValue()) commentData = new TextualAnnotationData(commentReturned); } assertEquals(result.size(), count); assertNotNull(commentData); // boolean BooleanAnnotation bool = new BooleanAnnotationI(); bool.setBoolValue(omero.rtypes.rbool(true)); BooleanAnnotation boolReturned = (BooleanAnnotation) iUpdate .saveAndReturnObject(bool); result = iMetadata.loadSpecifiedAnnotations( BooleanAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; BooleanAnnotationData boolData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof BooleanAnnotation) count++; if (annotation.getId().getValue() == boolReturned.getId() .getValue()) boolData = new BooleanAnnotationData(boolReturned); } assertEquals(result.size(), count); assertNotNull(boolData); // long LongAnnotation l = new LongAnnotationI(); l.setLongValue(omero.rtypes.rlong(1)); LongAnnotation lReturned = (LongAnnotation) iUpdate .saveAndReturnObject(l); result = iMetadata.loadSpecifiedAnnotations( LongAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; LongAnnotationData lData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof LongAnnotation) count++; if (annotation.getId().getValue() == lReturned.getId().getValue()) lData = new LongAnnotationData(lReturned); } assertEquals(result.size(), count); assertNotNull(lData); // double DoubleAnnotation d = new DoubleAnnotationI(); d.setDoubleValue(omero.rtypes.rdouble(1)); DoubleAnnotation dReturned = (DoubleAnnotation) iUpdate .saveAndReturnObject(d); result = iMetadata.loadSpecifiedAnnotations( DoubleAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; DoubleAnnotationData dData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof DoubleAnnotation) count++; if (annotation.getId().getValue() == dReturned.getId().getValue()) dData = new DoubleAnnotationData(dReturned); } assertEquals(result.size(), count); assertNotNull(dData); }
void function() throws Exception { TagAnnotation tag = new TagAnnotationI(); tag.setTextValue(omero.rtypes.rstring("tag")); TagAnnotation tagReturned = (TagAnnotation) iUpdate .saveAndReturnObject(tag); Parameters param = new Parameters(); List<String> include = new ArrayList<String>(); List<String> exclude = new ArrayList<String>(); List<Annotation> result = iMetadata.loadSpecifiedAnnotations( TagAnnotation.class.getName(), include, exclude, param); assertNotNull(result); Iterator<Annotation> i = result.iterator(); int count = 0; TagAnnotationData tagData = null; Annotation annotation; while (i.hasNext()) { annotation = i.next(); if (annotation instanceof TagAnnotation) count++; if (annotation.getId().getValue() == tagReturned.getId().getValue()) tagData = new TagAnnotationData(tagReturned); } assertEquals(result.size(), count); assertNotNull(tagData); CommentAnnotation comment = new CommentAnnotationI(); comment.setTextValue(omero.rtypes.rstring(STR)); CommentAnnotation commentReturned = (CommentAnnotation) iUpdate .saveAndReturnObject(comment); result = iMetadata.loadSpecifiedAnnotations( CommentAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; TextualAnnotationData commentData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof CommentAnnotation) count++; if (annotation.getId().getValue() == commentReturned.getId() .getValue()) commentData = new TextualAnnotationData(commentReturned); } assertEquals(result.size(), count); assertNotNull(commentData); BooleanAnnotation bool = new BooleanAnnotationI(); bool.setBoolValue(omero.rtypes.rbool(true)); BooleanAnnotation boolReturned = (BooleanAnnotation) iUpdate .saveAndReturnObject(bool); result = iMetadata.loadSpecifiedAnnotations( BooleanAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; BooleanAnnotationData boolData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof BooleanAnnotation) count++; if (annotation.getId().getValue() == boolReturned.getId() .getValue()) boolData = new BooleanAnnotationData(boolReturned); } assertEquals(result.size(), count); assertNotNull(boolData); LongAnnotation l = new LongAnnotationI(); l.setLongValue(omero.rtypes.rlong(1)); LongAnnotation lReturned = (LongAnnotation) iUpdate .saveAndReturnObject(l); result = iMetadata.loadSpecifiedAnnotations( LongAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; LongAnnotationData lData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof LongAnnotation) count++; if (annotation.getId().getValue() == lReturned.getId().getValue()) lData = new LongAnnotationData(lReturned); } assertEquals(result.size(), count); assertNotNull(lData); DoubleAnnotation d = new DoubleAnnotationI(); d.setDoubleValue(omero.rtypes.rdouble(1)); DoubleAnnotation dReturned = (DoubleAnnotation) iUpdate .saveAndReturnObject(d); result = iMetadata.loadSpecifiedAnnotations( DoubleAnnotation.class.getName(), include, exclude, param); assertNotNull(result); count = 0; DoubleAnnotationData dData = null; i = result.iterator(); while (i.hasNext()) { annotation = i.next(); if (annotation instanceof DoubleAnnotation) count++; if (annotation.getId().getValue() == dReturned.getId().getValue()) dData = new DoubleAnnotationData(dReturned); } assertEquals(result.size(), count); assertNotNull(dData); }
/** * Tests the retrieval of annotations of different types i.e. tag, comment, * boolean, long and the conversion into the corresponding * <code>POJOS</code> object. * * @throws Exception * Thrown if an error occurred. */
Tests the retrieval of annotations of different types i.e. tag, comment, boolean, long and the conversion into the corresponding <code>POJOS</code> object
testLoadSpecifiedAnnotationsVariousTypes
{ "repo_name": "jballanc/openmicroscopy", "path": "components/tools/OmeroJava/test/integration/MetadataServiceTest.java", "license": "gpl-2.0", "size": 74475 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.testng.AssertJUnit" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.testng.AssertJUnit;
import java.util.*; import org.testng.*;
[ "java.util", "org.testng" ]
java.util; org.testng;
1,600,773
public void writeDataSetWithNSInfo(XMLStreamWriter writer, DataSet dataset, File directory) throws XMLStreamException, IOException { writeDataSetStartElement(writer); insertDSInfo(writer, dataset, directory); writer.writeEndElement(); }
void function(XMLStreamWriter writer, DataSet dataset, File directory) throws XMLStreamException, IOException { writeDataSetStartElement(writer); insertDSInfo(writer, dataset, directory); writer.writeEndElement(); }
/** * writes the dataset with a namespace-attributed start element and then * does the same thing as the above method. */
writes the dataset with a namespace-attributed start element and then does the same thing as the above method
writeDataSetWithNSInfo
{ "repo_name": "crotwell/fissuresUtil", "path": "src/main/java/edu/sc/seis/fissuresUtil/xml/DataSetToXMLStAX.java", "license": "gpl-2.0", "size": 8287 }
[ "java.io.File", "java.io.IOException", "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamWriter" ]
import java.io.File; import java.io.IOException; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter;
import java.io.*; import javax.xml.stream.*;
[ "java.io", "javax.xml" ]
java.io; javax.xml;
1,987,525
public Pair<String, Short> getTableCacheInfo(List<Long> cacheDirIds) { String cachePoolName = null; Short cacheReplication = 0; Long cacheDirId = HdfsCachingUtil.getCacheDirectiveId(msTable_.getParameters()); if (cacheDirId != null) { try { cachePoolName = HdfsCachingUtil.getCachePool(cacheDirId); cacheReplication = HdfsCachingUtil.getCacheReplication(cacheDirId); Preconditions.checkNotNull(cacheReplication); if (numClusteringCols_ == 0) cacheDirIds.add(cacheDirId); } catch (ImpalaRuntimeException e) { // Catch the error so that the actual update to the catalog can progress, // this resets caching for the table though LOG.error( String.format("Cache directive %d was not found, uncache the table %s " + "to remove this message.", cacheDirId, getFullName())); cacheDirId = null; } } return new Pair<String, Short>(cachePoolName, cacheReplication); }
Pair<String, Short> function(List<Long> cacheDirIds) { String cachePoolName = null; Short cacheReplication = 0; Long cacheDirId = HdfsCachingUtil.getCacheDirectiveId(msTable_.getParameters()); if (cacheDirId != null) { try { cachePoolName = HdfsCachingUtil.getCachePool(cacheDirId); cacheReplication = HdfsCachingUtil.getCacheReplication(cacheDirId); Preconditions.checkNotNull(cacheReplication); if (numClusteringCols_ == 0) cacheDirIds.add(cacheDirId); } catch (ImpalaRuntimeException e) { LOG.error( String.format(STR + STR, cacheDirId, getFullName())); cacheDirId = null; } } return new Pair<String, Short>(cachePoolName, cacheReplication); }
/** * If the table is cached, it returns a <cache pool name, replication factor> pair * and adds the table cached directive ID to 'cacheDirIds'. Otherwise, it * returns a <null, 0> pair. */
If the table is cached, it returns a pair and adds the table cached directive ID to 'cacheDirIds'. Otherwise, it returns a pair
getTableCacheInfo
{ "repo_name": "kapilrastogi/Impala", "path": "fe/src/main/java/com/cloudera/impala/catalog/Table.java", "license": "apache-2.0", "size": 18533 }
[ "com.cloudera.impala.common.ImpalaRuntimeException", "com.cloudera.impala.common.Pair", "com.cloudera.impala.util.HdfsCachingUtil", "com.google.common.base.Preconditions", "java.util.List" ]
import com.cloudera.impala.common.ImpalaRuntimeException; import com.cloudera.impala.common.Pair; import com.cloudera.impala.util.HdfsCachingUtil; import com.google.common.base.Preconditions; import java.util.List;
import com.cloudera.impala.common.*; import com.cloudera.impala.util.*; import com.google.common.base.*; import java.util.*;
[ "com.cloudera.impala", "com.google.common", "java.util" ]
com.cloudera.impala; com.google.common; java.util;
1,203,646
public StorageType getStorageType() { return storageType; }
StorageType function() { return storageType; }
/** * Returns Storage Type info. * * @return Storage Type of the bucket */
Returns Storage Type info
getStorageType
{ "repo_name": "xiao-chen/hadoop", "path": "hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/response/BucketInfo.java", "license": "apache-2.0", "size": 8011 }
[ "org.apache.hadoop.hdds.protocol.StorageType" ]
import org.apache.hadoop.hdds.protocol.StorageType;
import org.apache.hadoop.hdds.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
164,734
@Test(expected = IllegalArgumentException.class) public void testExceptionArrayParameterSize2() { Throwable[] input1 = new Throwable[] { new RuntimeException() }; int input2 = -1; checkExceptionCauses(input1, input2); }
@Test(expected = IllegalArgumentException.class) void function() { Throwable[] input1 = new Throwable[] { new RuntimeException() }; int input2 = -1; checkExceptionCauses(input1, input2); }
/** * Tests the check method with a negative size parameter. */
Tests the check method with a negative size parameter
testExceptionArrayParameterSize2
{ "repo_name": "gammalgris/jmul", "path": "Utilities/Checks-Tests/src/test/jmul/checks/ThrowableParameterTest.java", "license": "gpl-3.0", "size": 5042 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,356,170
public FeedMapping removeFeedMapping(FeedMapping feedMapping) throws RemoteException { return delegateLocator.getFeedMappingDelegate().remove(feedMapping); }
FeedMapping function(FeedMapping feedMapping) throws RemoteException { return delegateLocator.getFeedMappingDelegate().remove(feedMapping); }
/** * Removes the FeedMappings from the ExtendedManagedCustomer's ManagedCustomer. * * @param feedMapping the FeedMapping to remove * @return the updated FeedMapping * @throws RemoteException for communication-related exceptions */
Removes the FeedMappings from the ExtendedManagedCustomer's ManagedCustomer
removeFeedMapping
{ "repo_name": "raja15792/googleads-java-lib", "path": "modules/adwords_axis_utility_extension/src/main/java/com/google/api/ads/adwords/axis/utility/extension/ExtendedManagedCustomer.java", "license": "apache-2.0", "size": 39864 }
[ "com.google.api.ads.adwords.axis.v201506.cm.FeedMapping", "java.rmi.RemoteException" ]
import com.google.api.ads.adwords.axis.v201506.cm.FeedMapping; import java.rmi.RemoteException;
import com.google.api.ads.adwords.axis.v201506.cm.*; import java.rmi.*;
[ "com.google.api", "java.rmi" ]
com.google.api; java.rmi;
1,423,952
@Test public void testTripleDesGoodPasswordDecrypt() { CipherTextHandler lockBox = new CipherTextHandler(); KerberosPrincipal principal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" ); String algorithm = VendorHelper.getTripleDesAlgorithm(); KerberosKey kerberosKey = new KerberosKey( principal, "secret".toCharArray(), algorithm ); EncryptionKey key = new EncryptionKey( EncryptionType.DES3_CBC_SHA1_KD, kerberosKey.getEncoded() ); EncryptedData data = new EncryptedData( EncryptionType.DES3_CBC_SHA1_KD, 0, TRIPLE_DES_ENCRYPTED_TIME_STAMP ); try { byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY ); PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData ); assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString() ); assertEquals( "MicroSeconds", 460450, object.getPausec() ); } catch ( KerberosException ke ) { fail( "Should not have caught exception." ); } }
void function() { CipherTextHandler lockBox = new CipherTextHandler(); KerberosPrincipal principal = new KerberosPrincipal( STR ); String algorithm = VendorHelper.getTripleDesAlgorithm(); KerberosKey kerberosKey = new KerberosKey( principal, STR.toCharArray(), algorithm ); EncryptionKey key = new EncryptionKey( EncryptionType.DES3_CBC_SHA1_KD, kerberosKey.getEncoded() ); EncryptedData data = new EncryptedData( EncryptionType.DES3_CBC_SHA1_KD, 0, TRIPLE_DES_ENCRYPTED_TIME_STAMP ); try { byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY ); PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData ); assertEquals( STR, STR, object.getPaTimestamp().toString() ); assertEquals( STR, 460450, object.getPausec() ); } catch ( KerberosException ke ) { fail( STR ); } }
/** * Tests the unsealing of Kerberos CipherText with a good password. After decryption and * an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp. The * result is timestamp data. */
Tests the unsealing of Kerberos CipherText with a good password. After decryption and an integrity check, an attempt is made to decode the bytes as an EncryptedTimestamp. The result is timestamp data
testTripleDesGoodPasswordDecrypt
{ "repo_name": "drankye/directory-server", "path": "kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java", "license": "apache-2.0", "size": 21386 }
[ "javax.security.auth.kerberos.KerberosKey", "javax.security.auth.kerberos.KerberosPrincipal", "org.apache.directory.shared.kerberos.codec.KerberosDecoder", "org.apache.directory.shared.kerberos.codec.types.EncryptionType", "org.apache.directory.shared.kerberos.components.EncryptedData", "org.apache.direct...
import javax.security.auth.kerberos.KerberosKey; import javax.security.auth.kerberos.KerberosPrincipal; import org.apache.directory.shared.kerberos.codec.KerberosDecoder; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.apache.directory.shared.kerberos.components.EncryptedData; import org.apache.directory.shared.kerberos.components.EncryptionKey; import org.apache.directory.shared.kerberos.components.PaEncTsEnc; import org.apache.directory.shared.kerberos.exceptions.KerberosException; import org.junit.Assert;
import javax.security.auth.kerberos.*; import org.apache.directory.shared.kerberos.codec.*; import org.apache.directory.shared.kerberos.codec.types.*; import org.apache.directory.shared.kerberos.components.*; import org.apache.directory.shared.kerberos.exceptions.*; import org.junit.*;
[ "javax.security", "org.apache.directory", "org.junit" ]
javax.security; org.apache.directory; org.junit;
2,468,685
public static String join(Collection< ? > list, String delimeter) { return join(delimeter, list); }
static String function(Collection< ? > list, String delimeter) { return join(delimeter, list); }
/** * Join a list. */
Join a list
join
{ "repo_name": "lostiniceland/bnd", "path": "biz.aQute.bndlib/src/aQute/bnd/osgi/Processor.java", "license": "apache-2.0", "size": 70777 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,398,588
public void submit(Callable<?> task) { while (queue.isEmpty()) { int active0 = active.get(); if (active0 == maxTasks) break; if (active.compareAndSet(active0, active0 + 1)) { startThread(task); return; // Started in new thread bypassing queue. } } try { while (!queue.offer(task, 100, TimeUnit.MILLISECONDS)) { if (shutdown) return; // Rejected due to shutdown. } } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); return; } startFromQueue(); }
void function(Callable<?> task) { while (queue.isEmpty()) { int active0 = active.get(); if (active0 == maxTasks) break; if (active.compareAndSet(active0, active0 + 1)) { startThread(task); return; } } try { while (!queue.offer(task, 100, TimeUnit.MILLISECONDS)) { if (shutdown) return; } } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); return; } startFromQueue(); }
/** * Submit task. * * @param task Task. */
Submit task
submit
{ "repo_name": "SomeFire/ignite", "path": "modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopExecutorService.java", "license": "apache-2.0", "size": 6531 }
[ "java.util.concurrent.Callable", "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
659,242
private static double[][] generateCoordinates( int coordCount, int dimensions, int clusterCount, long randomSeed) throws InsufficientMemoryException { // Explicit garbage collection to reduce the likelihood of // having insufficient memory. System.gc(); long memRequired = 8L * (long) dimensions * (long) (coordCount + clusterCount); if (Runtime.getRuntime().freeMemory() < memRequired) { throw new InsufficientMemoryException(); } double[][] coordinates = new double[coordCount][dimensions]; double[][] exemplars = new double[clusterCount][dimensions]; Random random = new Random(randomSeed); for (int i=0; i<clusterCount; i++) { for (int j=0; j<dimensions; j++) { exemplars[i][j] = 100.0 * random.nextDouble(); } } for (int i=0; i<coordCount; i++) { int cluster = random.nextInt(clusterCount); double[] exemplar = exemplars[cluster]; double[] coord = coordinates[i]; for (int j=0; j<dimensions; j++) { coord[j] = exemplar[j] + 50*random.nextGaussian(); } } return coordinates; }
static double[][] function( int coordCount, int dimensions, int clusterCount, long randomSeed) throws InsufficientMemoryException { System.gc(); long memRequired = 8L * (long) dimensions * (long) (coordCount + clusterCount); if (Runtime.getRuntime().freeMemory() < memRequired) { throw new InsufficientMemoryException(); } double[][] coordinates = new double[coordCount][dimensions]; double[][] exemplars = new double[clusterCount][dimensions]; Random random = new Random(randomSeed); for (int i=0; i<clusterCount; i++) { for (int j=0; j<dimensions; j++) { exemplars[i][j] = 100.0 * random.nextDouble(); } } for (int i=0; i<coordCount; i++) { int cluster = random.nextInt(clusterCount); double[] exemplar = exemplars[cluster]; double[] coord = coordinates[i]; for (int j=0; j<dimensions; j++) { coord[j] = exemplar[j] + 50*random.nextGaussian(); } } return coordinates; }
/** * Generates the coordinates to be clustered. * * @param coordCount the number of coordinates. * @param dimensions the length of the coordinates. * @param clusterCount the number of clusters in the distribution. * @param randomSeed the seed used by the random number generator. * @return */
Generates the coordinates to be clustered
generateCoordinates
{ "repo_name": "ariesteam/thinklab", "path": "plugins/org.integratedmodelling.thinklab.geospace/src/org/integratedmodelling/geospace/kmeans/KMeansFrame.java", "license": "gpl-3.0", "size": 16656 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
960,954
public Stream<Node> flattenDescendants() { return children.values().stream().flatMap(Node::flatten); }
Stream<Node> function() { return children.values().stream().flatMap(Node::flatten); }
/** * Return a {@link Stream} of Nodes consisting of all the descendants of this Node. This Node is not included. * <p> * @return a {@link Stream} of Nodes consisting of all the descendants of this Node */
Return a <code>Stream</code> of Nodes consisting of all the descendants of this Node. This Node is not included.
flattenDescendants
{ "repo_name": "nitsanw/honest-profiler", "path": "src/main/java/com/insightfullogic/honest_profiler/core/aggregation/result/straight/Node.java", "license": "mit", "size": 6437 }
[ "java.util.stream.Stream" ]
import java.util.stream.Stream;
import java.util.stream.*;
[ "java.util" ]
java.util;
2,436,566
private int getShardCount() { try { Key counterKey = KeyFactory.createKey(Counter.KIND, counterName); Entity counter = DS.get(counterKey); Long shardCount = (Long) counter.getProperty(Counter.SHARD_COUNT); return shardCount.intValue(); } catch (EntityNotFoundException ignore) { return INITIAL_SHARDS; } }
int function() { try { Key counterKey = KeyFactory.createKey(Counter.KIND, counterName); Entity counter = DS.get(counterKey); Long shardCount = (Long) counter.getProperty(Counter.SHARD_COUNT); return shardCount.intValue(); } catch (EntityNotFoundException ignore) { return INITIAL_SHARDS; } }
/** * Get the number of shards in this counter. * * @return shard count */
Get the number of shards in this counter
getShardCount
{ "repo_name": "hieunguyen/tuongky", "path": "src/com/tuongky/model/datastore/ShardedCounter.java", "license": "mit", "size": 7447 }
[ "com.google.appengine.api.datastore.Entity", "com.google.appengine.api.datastore.EntityNotFoundException", "com.google.appengine.api.datastore.Key", "com.google.appengine.api.datastore.KeyFactory" ]
import com.google.appengine.api.datastore.Entity; import com.google.appengine.api.datastore.EntityNotFoundException; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.*;
[ "com.google.appengine" ]
com.google.appengine;
1,705,616
protected void handleElementAdded(CompositeGraphicsNode gn, Node parent, Element childElt) { // build the graphics node GVTBuilder builder = ctx.getGVTBuilder(); GraphicsNode childNode = builder.build(ctx, childElt); if (childNode == null) { return; // the added element is not a graphic element } // Find the index where the GraphicsNode should be added int idx = -1; for(Node ps = childElt.getPreviousSibling(); ps != null; ps = ps.getPreviousSibling()) { if (ps.getNodeType() != Node.ELEMENT_NODE) continue; Element pse = (Element)ps; GraphicsNode psgn = ctx.getGraphicsNode(pse); while ((psgn != null) && (psgn.getParent() != gn)) { // In some cases the GN linked is // a child (in particular for images). psgn = psgn.getParent(); } if (psgn == null) continue; idx = gn.indexOf(psgn); if (idx == -1) continue; break; } // insert after prevSibling, if // it was -1 this becomes 0 (first slot) idx++; gn.add(idx, childNode); }
void function(CompositeGraphicsNode gn, Node parent, Element childElt) { GVTBuilder builder = ctx.getGVTBuilder(); GraphicsNode childNode = builder.build(ctx, childElt); if (childNode == null) { return; } int idx = -1; for(Node ps = childElt.getPreviousSibling(); ps != null; ps = ps.getPreviousSibling()) { if (ps.getNodeType() != Node.ELEMENT_NODE) continue; Element pse = (Element)ps; GraphicsNode psgn = ctx.getGraphicsNode(pse); while ((psgn != null) && (psgn.getParent() != gn)) { psgn = psgn.getParent(); } if (psgn == null) continue; idx = gn.indexOf(psgn); if (idx == -1) continue; break; } idx++; gn.add(idx, childNode); }
/** * Invoked when an MutationEvent of type 'DOMNodeInserted' is fired. */
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired
handleElementAdded
{ "repo_name": "srnsw/xena", "path": "plugins/image/ext/src/batik-1.7/sources/org/apache/batik/bridge/SVGGElementBridge.java", "license": "gpl-3.0", "size": 4860 }
[ "org.apache.batik.gvt.CompositeGraphicsNode", "org.apache.batik.gvt.GraphicsNode", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; import org.w3c.dom.Element; import org.w3c.dom.Node;
import org.apache.batik.gvt.*; import org.w3c.dom.*;
[ "org.apache.batik", "org.w3c.dom" ]
org.apache.batik; org.w3c.dom;
1,303,911
public ClientConfiguration withInstance(String instanceName) { checkArgument(instanceName != null, "instanceName is null"); return with(ClientProperty.INSTANCE_NAME, instanceName); }
ClientConfiguration function(String instanceName) { checkArgument(instanceName != null, STR); return with(ClientProperty.INSTANCE_NAME, instanceName); }
/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_NAME * */
Same as <code>#with(ClientProperty, String)</code> for ClientProperty.INSTANCE_NAME
withInstance
{ "repo_name": "adamjshook/accumulo", "path": "core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java", "license": "apache-2.0", "size": 17727 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,504,322
return name; } private static final Map<String, Namespace> MAP; static { final Map<String, Namespace> map = new HashMap<String, Namespace>(); for (Namespace namespace : values()) { final String name = namespace.getUriString(); if (name != null) map.put(name, namespace); } MAP = map; }
return name; } private static final Map<String, Namespace> MAP; static { final Map<String, Namespace> map = new HashMap<String, Namespace>(); for (Namespace namespace : values()) { final String name = namespace.getUriString(); if (name != null) map.put(name, namespace); } MAP = map; }
/** * Get the URI of this namespace. * * @return the URI */
Get the URI of this namespace
getUriString
{ "repo_name": "immutant/immutant-release", "path": "modules/web/src/main/java/org/immutant/web/as/Namespace.java", "license": "lgpl-3.0", "size": 1930 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
967,256
public Class<?> getType(Object propertyId) { logger.executionTrace(); // TODO: refactor to use same code as EntityItemProperty#getType() // This will also fix incomplete implementation of this method (for association types). Not critical as // Components don't really rely on this methods. if (addedProperties.keySet().contains(propertyId)) return addedProperties.get(propertyId); if (propertyInEmbeddedKey(propertyId)) { final ComponentType idType = (ComponentType) classMetadata.getIdentifierType(); final String[] propertyNames = idType.getPropertyNames(); for (int i = 0; i < propertyNames.length; i++) { String name = propertyNames[i]; if (name.equals(propertyId)) { String idName = classMetadata.getIdentifierPropertyName(); try { Field idField = entityType.getDeclaredField(idName); Field propertyField = idField.getType().getDeclaredField((String) propertyId); return propertyField.getType(); } catch (NoSuchFieldException ex) { throw new RuntimeException("Could not find the type of specified container property.", ex); } } } } Type propertyType = classMetadata.getPropertyType(propertyId.toString()); return propertyType.getReturnedClass(); }
Class<?> function(Object propertyId) { logger.executionTrace(); if (addedProperties.keySet().contains(propertyId)) return addedProperties.get(propertyId); if (propertyInEmbeddedKey(propertyId)) { final ComponentType idType = (ComponentType) classMetadata.getIdentifierType(); final String[] propertyNames = idType.getPropertyNames(); for (int i = 0; i < propertyNames.length; i++) { String name = propertyNames[i]; if (name.equals(propertyId)) { String idName = classMetadata.getIdentifierPropertyName(); try { Field idField = entityType.getDeclaredField(idName); Field propertyField = idField.getType().getDeclaredField((String) propertyId); return propertyField.getType(); } catch (NoSuchFieldException ex) { throw new RuntimeException(STR, ex); } } } } Type propertyType = classMetadata.getPropertyType(propertyId.toString()); return propertyType.getReturnedClass(); }
/** * Gets the data type of all Properties identified by the given Property ID. This method does pretty much the same * thing as EntityItemProperty#getType() */
Gets the data type of all Properties identified by the given Property ID. This method does pretty much the same thing as EntityItemProperty#getType()
getType
{ "repo_name": "veronicawwashington/enterprise-app", "path": "src/enterpriseapp/hibernate/CustomHbnContainer.java", "license": "agpl-3.0", "size": 57727 }
[ "java.lang.reflect.Field", "org.hibernate.type.ComponentType", "org.hibernate.type.Type" ]
import java.lang.reflect.Field; import org.hibernate.type.ComponentType; import org.hibernate.type.Type;
import java.lang.reflect.*; import org.hibernate.type.*;
[ "java.lang", "org.hibernate.type" ]
java.lang; org.hibernate.type;
1,932,101
public void setAddedComponentIndex( final @Nullable Integer addedComponentIndex ) { addedComponentIndex_ = addedComponentIndex; }
void function( final @Nullable Integer addedComponentIndex ) { addedComponentIndex_ = addedComponentIndex; }
/** * Sets the index of the first component added to the container. * * @param addedComponentIndex * The index of the first component added to the container or * {@code null} if no components were added. */
Sets the index of the first component added to the container
setAddedComponentIndex
{ "repo_name": "gamegineer/dev", "path": "main/table/org.gamegineer.table.net.impl/src/org/gamegineer/table/internal/net/impl/node/ContainerIncrement.java", "license": "gpl-3.0", "size": 7689 }
[ "org.eclipse.jdt.annotation.Nullable" ]
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jdt.annotation.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
2,475,448
public BudgetDocument<DevelopmentProposal> getSyncableBudget(DevelopmentProposal childProposal) throws ProposalHierarchyException;
BudgetDocument<DevelopmentProposal> function(DevelopmentProposal childProposal) throws ProposalHierarchyException;
/** * Gets the budget for hierarchy sync. This will be the budget marked final or the most recently created budget. * @param childProposal * @return * @throws ProposalHierarchyException */
Gets the budget for hierarchy sync. This will be the budget marked final or the most recently created budget
getSyncableBudget
{ "repo_name": "blackcathacker/kc.preclean", "path": "coeus-code/src/main/java/org/kuali/coeus/propdev/impl/hierarchy/ProposalHierarchyService.java", "license": "apache-2.0", "size": 11725 }
[ "org.kuali.coeus.common.budget.framework.core.BudgetDocument", "org.kuali.coeus.propdev.impl.core.DevelopmentProposal" ]
import org.kuali.coeus.common.budget.framework.core.BudgetDocument; import org.kuali.coeus.propdev.impl.core.DevelopmentProposal;
import org.kuali.coeus.common.budget.framework.core.*; import org.kuali.coeus.propdev.impl.core.*;
[ "org.kuali.coeus" ]
org.kuali.coeus;
2,891,668
@Test public void testRevertToDefaultValue() { boolean valueOnly = true; FieldConfigWindBarbs field = new FieldConfigWindBarbs( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, "test label", valueOnly, false), null, null, null); field.revertToDefaultValue(); field.createUI(); field.revertToDefaultValue(); }
void function() { boolean valueOnly = true; FieldConfigWindBarbs field = new FieldConfigWindBarbs( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, STR, valueOnly, false), null, null, null); field.revertToDefaultValue(); field.createUI(); field.revertToDefaultValue(); }
/** * Test method for {@link * com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#revertToDefaultValue()}. */
Test method for <code>com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#revertToDefaultValue()</code>
testRevertToDefaultValue
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/ui/detail/vendor/geoserver/marker/windbarb/FieldConfigWindBarbsTest.java", "license": "gpl-3.0", "size": 20861 }
[ "com.sldeditor.common.xml.ui.FieldIdEnum", "com.sldeditor.ui.detail.config.FieldConfigCommonData", "com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs" ]
import com.sldeditor.common.xml.ui.FieldIdEnum; import com.sldeditor.ui.detail.config.FieldConfigCommonData; import com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs;
import com.sldeditor.common.xml.ui.*; import com.sldeditor.ui.detail.config.*; import com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.*;
[ "com.sldeditor.common", "com.sldeditor.ui" ]
com.sldeditor.common; com.sldeditor.ui;
204,161
public static Bitmap byteToBitmap(byte[] b) { return (b == null || b.length == 0) ? null : BitmapFactory .decodeByteArray(b, 0, b.length); }
static Bitmap function(byte[] b) { return (b == null b.length == 0) ? null : BitmapFactory .decodeByteArray(b, 0, b.length); }
/** * convert byte array to Bitmap * * @param b * @return */
convert byte array to Bitmap
byteToBitmap
{ "repo_name": "suzhugen/androidOddosonLibrary", "path": "src/com/oddoson/android/common/image/ImageUtils.java", "license": "apache-2.0", "size": 7989 }
[ "android.graphics.Bitmap", "android.graphics.BitmapFactory" ]
import android.graphics.Bitmap; import android.graphics.BitmapFactory;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,377,392
public void testToArray1_BadArg() { LinkedBlockingDeque q = populatedDeque(SIZE); try { q.toArray(new String[10]); shouldThrow(); } catch (ArrayStoreException success) {} }
void function() { LinkedBlockingDeque q = populatedDeque(SIZE); try { q.toArray(new String[10]); shouldThrow(); } catch (ArrayStoreException success) {} }
/** * toArray(incompatible array type) throws ArrayStoreException */
toArray(incompatible array type) throws ArrayStoreException
testToArray1_BadArg
{ "repo_name": "debian-pkg-android-tools/android-platform-libcore", "path": "jsr166-tests/src/test/java/jsr166/LinkedBlockingDequeTest.java", "license": "gpl-2.0", "size": 60349 }
[ "java.util.concurrent.LinkedBlockingDeque" ]
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,288,786
return LanguageUtil.getRename(typeName, BOXED_TYPE_MAP); }
return LanguageUtil.getRename(typeName, BOXED_TYPE_MAP); }
/** * Returns the Java representation of a basic type in boxed form. */
Returns the Java representation of a basic type in boxed form
boxedTypeName
{ "repo_name": "jmuk/toolkit", "path": "src/main/java/com/google/api/codegen/java/JavaContextCommon.java", "license": "apache-2.0", "size": 5227 }
[ "com.google.api.codegen.LanguageUtil" ]
import com.google.api.codegen.LanguageUtil;
import com.google.api.codegen.*;
[ "com.google.api" ]
com.google.api;
936,724
public double getOpinionOfPerson(Person person1, Person person2) { double result = 50D; if (hasRelationship(person1, person2)) { Relationship relationship = getRelationship(person1, person2); result = relationship.getPersonOpinion(person1); } return result; }
double function(Person person1, Person person2) { double result = 50D; if (hasRelationship(person1, person2)) { Relationship relationship = getRelationship(person1, person2); result = relationship.getPersonOpinion(person1); } return result; }
/** * Gets the opinion that a person has of another person. Note: If the people * don't have a relationship, return default value of 50. * * @param person1 the person holding the opinion. * @param person2 the person who the opinion is of. * @return opinion value from 0 (enemy) to 50 (indifferent) to 100 (close * friend). */
Gets the opinion that a person has of another person. Note: If the people don't have a relationship, return default value of 50
getOpinionOfPerson
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/ai/social/RelationshipManager.java", "license": "gpl-3.0", "size": 20543 }
[ "org.mars_sim.msp.core.person.Person" ]
import org.mars_sim.msp.core.person.Person;
import org.mars_sim.msp.core.person.*;
[ "org.mars_sim.msp" ]
org.mars_sim.msp;
638,080
public List<String> getSymbols(String filterTerm) throws HibernateException { List<String> targetList = new ArrayList(); List sourceList = null; try { getCurrentSession().beginTransaction(); sourceList = getCurrentSession() .createSQLQuery("SELECT DISTINCT symbol FROM genes WHERE symbol LIKE :symbol") .setParameter("symbol", "%" + filterTerm.trim() + "%") .list(); getCurrentSession().getTransaction().commit(); } catch (HibernateException e) { getCurrentSession().getTransaction().rollback(); throw e; } if (sourceList != null) { Iterator iterator = sourceList.iterator(); while (iterator.hasNext()) { String symbol = (String)iterator.next(); targetList.add(symbol); } } return targetList; }
List<String> function(String filterTerm) throws HibernateException { List<String> targetList = new ArrayList(); List sourceList = null; try { getCurrentSession().beginTransaction(); sourceList = getCurrentSession() .createSQLQuery(STR) .setParameter(STR, "%" + filterTerm.trim() + "%") .list(); getCurrentSession().getTransaction().commit(); } catch (HibernateException e) { getCurrentSession().getTransaction().rollback(); throw e; } if (sourceList != null) { Iterator iterator = sourceList.iterator(); while (iterator.hasNext()) { String symbol = (String)iterator.next(); targetList.add(symbol); } } return targetList; }
/** * Returns a distinct filtered list of gene symbols suitable for autocomplete * sourcing. * * @param filterTerm the filter term for the gene symbol (used in sql LIKE clause) * @return a <code>List&lt;String&gt;</code> of distinct gene symbols filtered * by <code>filterTerm</code> suitable for autocomplete sourcing. * @throws HibernateException if a hibernate error occurs */
Returns a distinct filtered list of gene symbols suitable for autocomplete sourcing
getSymbols
{ "repo_name": "InfraFrontier/CuratorialInterfaces", "path": "src/main/java/uk/ac/ebi/emma/manager/GenesManager.java", "license": "apache-2.0", "size": 32364 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.hibernate.HibernateException" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.hibernate.HibernateException;
import java.util.*; import org.hibernate.*;
[ "java.util", "org.hibernate" ]
java.util; org.hibernate;
188,913
public boolean canBeActivated(GameCharacter character, boolean noApCheck) { if (!isActivated() || !canBeLearned(character)) { return false; } if ((isCombatOnly() || isAttack()) && (character.getMap() == null || character.getMap().isWorldMap())) { return false; } Stats characterStats = character.stats(); if (getSpCost() > 0 && characterStats.getSPAct() < getSpCost()) { return false; } if (!noApCheck && GameState.isCombatInProgress() && getApCost(character) > 0 && characterStats.getAPAct() < getApCost(character)) { return false; } if (getMpCost(character) > 0 && characterStats.getMPAct() < getMpCost(character)) { return false; } if (s_activationRequirements != null) { return s_activationRequirements.execute(character, new Binding()); } return true; }
boolean function(GameCharacter character, boolean noApCheck) { if (!isActivated() !canBeLearned(character)) { return false; } if ((isCombatOnly() isAttack()) && (character.getMap() == null character.getMap().isWorldMap())) { return false; } Stats characterStats = character.stats(); if (getSpCost() > 0 && characterStats.getSPAct() < getSpCost()) { return false; } if (!noApCheck && GameState.isCombatInProgress() && getApCost(character) > 0 && characterStats.getAPAct() < getApCost(character)) { return false; } if (getMpCost(character) > 0 && characterStats.getMPAct() < getMpCost(character)) { return false; } if (s_activationRequirements != null) { return s_activationRequirements.execute(character, new Binding()); } return true; }
/** * Returns true if the supplied character fulfills all * requirements in order to activate this perk. Please note * that in order to be able to activate, the character * must also fulfill all the requirements required to learn * the perk. * * @param character * @param noApCheck - if true, actions points of the character are not considered * @return */
Returns true if the supplied character fulfills all requirements in order to activate this perk. Please note that in order to be able to activate, the character must also fulfill all the requirements required to learn the perk
canBeActivated
{ "repo_name": "mganzarcik/fabulae", "path": "core/src/mg/fishchicken/gamelogic/characters/perks/Perk.java", "license": "mit", "size": 14733 }
[ "groovy.lang.Binding" ]
import groovy.lang.Binding;
import groovy.lang.*;
[ "groovy.lang" ]
groovy.lang;
48,387
protected void initEntrances() { entranceIndex = 0; entranceRoles = new Role[]{Role.FLOOR,Role.BLOCK,Role.ITEM,Role.BOMB,Role.HERO}; entranceDelays = new Double[]{0d,0d,0d,0d,0d,0d,GameData.READY_TIME,GameData.SET_TIME,GameData.GO_TIME}; entranceTexts = new String[]{null,null,null,null,null,panel.getMessageTextReady(),panel.getMessageTextSet(),panel.getMessageTextGo()}; // set the roles for(int i=0;i<entranceRoles.length;i++) { double duration = level.getEntranceDuration(entranceRoles[i]); //System.out.println(entranceRoles[i]+":"+duration); if(i<entranceRoles.length-1) duration = duration/2; //so that sprites appear almost at the same time entranceDelays[i+1] = duration;// a little more time, just too be sure it goes OK //entranceTexts[i] = entranceRoles[i].toString(); //actually not used, but hey... } // unset the messages (for quicklaunch) for(int i=entranceRoles.length;i<entranceTexts.length;i++) { if(entranceTexts[i]==null) entranceDelays[i+1] = 0d; } // TODO debug //for(int i=0;i<entranceDelays.length;i++) // System.out.println("entranceDelays["+i+"]="+entranceDelays[i]); //for(int i=0;i<entranceRoles.length;i++) // entranceDelays[i] = entranceDelays[i] + 500; //entranceDelays[1] = entranceDelays[1] + 5000; }
void function() { entranceIndex = 0; entranceRoles = new Role[]{Role.FLOOR,Role.BLOCK,Role.ITEM,Role.BOMB,Role.HERO}; entranceDelays = new Double[]{0d,0d,0d,0d,0d,0d,GameData.READY_TIME,GameData.SET_TIME,GameData.GO_TIME}; entranceTexts = new String[]{null,null,null,null,null,panel.getMessageTextReady(),panel.getMessageTextSet(),panel.getMessageTextGo()}; for(int i=0;i<entranceRoles.length;i++) { double duration = level.getEntranceDuration(entranceRoles[i]); if(i<entranceRoles.length-1) duration = duration/2; entranceDelays[i+1] = duration; } for(int i=entranceRoles.length;i<entranceTexts.length;i++) { if(entranceTexts[i]==null) entranceDelays[i+1] = 0d; } }
/** * Handles how sprites enter the zone. */
Handles how sprites enter the zone
initEntrances
{ "repo_name": "vlabatut/totalboumboum", "path": "src/org/totalboumboum/engine/loop/VisibleLoop.java", "license": "gpl-2.0", "size": 38804 }
[ "org.totalboumboum.engine.content.feature.Role", "org.totalboumboum.tools.GameData" ]
import org.totalboumboum.engine.content.feature.Role; import org.totalboumboum.tools.GameData;
import org.totalboumboum.engine.content.feature.*; import org.totalboumboum.tools.*;
[ "org.totalboumboum.engine", "org.totalboumboum.tools" ]
org.totalboumboum.engine; org.totalboumboum.tools;
715,562
public static String getColumnString(Cursor cursor, String columnName) { int col = cursor.getColumnIndex(columnName); return getStringOrNull(cursor, col); }
static String function(Cursor cursor, String columnName) { int col = cursor.getColumnIndex(columnName); return getStringOrNull(cursor, col); }
/** * Gets the value of a string column by name. * * @param cursor Cursor to read the value from. * @param columnName The name of the column to read. * @return The value of the given column, or <code>null</null> * if the cursor does not contain the given column. */
Gets the value of a string column by name
getColumnString
{ "repo_name": "perrystreetsoftware/ActionBarSherlock", "path": "actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java", "license": "apache-2.0", "size": 28606 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
617,977
private static boolean isSimplePreferences(Context context) { return ALWAYS_SIMPLE_PREFS || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || !isXLargeTablet(context); }
static boolean function(Context context) { return ALWAYS_SIMPLE_PREFS Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB !isXLargeTablet(context); }
/** * Determines whether the simplified settings UI should be shown. This is * true if this is forced via {@link #ALWAYS_SIMPLE_PREFS}, or the device * doesn't have newer APIs like {@link PreferenceFragment}, or the device * doesn't have an extra-large screen. In these cases, a single-pane * "simplified" settings UI should be shown. */
Determines whether the simplified settings UI should be shown. This is true if this is forced via <code>#ALWAYS_SIMPLE_PREFS</code>, or the device doesn't have newer APIs like <code>PreferenceFragment</code>, or the device doesn't have an extra-large screen. In these cases, a single-pane "simplified" settings UI should be shown
isSimplePreferences
{ "repo_name": "ReliQ/FirstTipCalc", "path": "src/com/reliqartz/firsttipcalc/gui/SettingsActivity.java", "license": "apache-2.0", "size": 12356 }
[ "android.content.Context", "android.os.Build" ]
import android.content.Context; import android.os.Build;
import android.content.*; import android.os.*;
[ "android.content", "android.os" ]
android.content; android.os;
2,791,324
public ServiceResponseWithHeaders<Void, LROsDeleteAsyncRetrySucceededHeadersInner> beginDeleteAsyncRetrySucceeded() throws CloudException, IOException { return beginDeleteAsyncRetrySucceededAsync().toBlocking().single(); }
ServiceResponseWithHeaders<Void, LROsDeleteAsyncRetrySucceededHeadersInner> function() throws CloudException, IOException { return beginDeleteAsyncRetrySucceededAsync().toBlocking().single(); }
/** * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. * * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponseWithHeaders} object if successful. */
Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status
beginDeleteAsyncRetrySucceeded
{ "repo_name": "haocs/autorest", "path": "src/generator/AutoRest.Java.Azure.Fluent.Tests/src/main/java/fixtures/lro/implementation/LROsInner.java", "license": "mit", "size": 313853 }
[ "com.microsoft.azure.CloudException", "com.microsoft.rest.ServiceResponseWithHeaders", "java.io.IOException" ]
import com.microsoft.azure.CloudException; import com.microsoft.rest.ServiceResponseWithHeaders; import java.io.IOException;
import com.microsoft.azure.*; import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.azure", "com.microsoft.rest", "java.io" ]
com.microsoft.azure; com.microsoft.rest; java.io;
2,482,539
public static void showHide(@NonNull final Fragment show, @NonNull final List<Fragment> hide) { for (Fragment fragment : hide) { putArgs(fragment, fragment != show); } operateNoAnim(TYPE_SHOW_HIDE_FRAGMENT, show.getFragmentManager(), show, hide.toArray(new Fragment[0])); }
static void function(@NonNull final Fragment show, @NonNull final List<Fragment> hide) { for (Fragment fragment : hide) { putArgs(fragment, fragment != show); } operateNoAnim(TYPE_SHOW_HIDE_FRAGMENT, show.getFragmentManager(), show, hide.toArray(new Fragment[0])); }
/** * Show fragment then hide other fragment. * * @param show The fragment will be show. * @param hide The fragment will be hide. */
Show fragment then hide other fragment
showHide
{ "repo_name": "didi/DoraemonKit", "path": "Android/dokit-util/src/main/java/com/didichuxing/doraemonkit/util/FragmentUtils.java", "license": "apache-2.0", "size": 82370 }
[ "androidx.annotation.NonNull", "androidx.fragment.app.Fragment", "java.util.List" ]
import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import java.util.List;
import androidx.annotation.*; import androidx.fragment.app.*; import java.util.*;
[ "androidx.annotation", "androidx.fragment", "java.util" ]
androidx.annotation; androidx.fragment; java.util;
1,160,796
@Lookup(name = "By data provider name") TaskDataProvider findByName(@LookupField(name = "name") String name);
@Lookup(name = STR) TaskDataProvider findByName(@LookupField(name = "name") String name);
/** * Returns the data provider with the given name. * * @param name the name of the data provider * @return the provider with the given name */
Returns the data provider with the given name
findByName
{ "repo_name": "sebbrudzinski/motech", "path": "modules/tasks/tasks/src/main/java/org/motechproject/tasks/repository/DataProviderDataService.java", "license": "bsd-3-clause", "size": 698 }
[ "org.motechproject.mds.annotations.Lookup", "org.motechproject.mds.annotations.LookupField", "org.motechproject.tasks.domain.mds.task.TaskDataProvider" ]
import org.motechproject.mds.annotations.Lookup; import org.motechproject.mds.annotations.LookupField; import org.motechproject.tasks.domain.mds.task.TaskDataProvider;
import org.motechproject.mds.annotations.*; import org.motechproject.tasks.domain.mds.task.*;
[ "org.motechproject.mds", "org.motechproject.tasks" ]
org.motechproject.mds; org.motechproject.tasks;
1,215,384
@Test @SmallTest @Feature({"Preferences"}) public void testExportMenuItemNoLock() { mTestHelper.setPasswordSource( new SavedPasswordEntry("https://example.com", "test user", "password")); ReauthenticationManager.setApiOverride(ReauthenticationManager.OverrideState.AVAILABLE); ReauthenticationManager.setScreenLockSetUpOverride( ReauthenticationManager.OverrideState.UNAVAILABLE); final SettingsActivity settingsActivity = mTestHelper.startPasswordSettingsFromMainSettings(mSettingsActivityTestRule); View mainDecorView = settingsActivity.getWindow().getDecorView(); openActionBarOverflowOrOptionsMenu( InstrumentationRegistry.getInstrumentation().getTargetContext()); onViewWaiting( allOf(withText(R.string.password_settings_export_action_title), isCompletelyDisplayed())) .perform(click()); onView(withText(R.string.password_export_set_lock_screen)) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isCompletelyDisplayed())); }
@Feature({STR}) void function() { mTestHelper.setPasswordSource( new SavedPasswordEntry("https: ReauthenticationManager.setApiOverride(ReauthenticationManager.OverrideState.AVAILABLE); ReauthenticationManager.setScreenLockSetUpOverride( ReauthenticationManager.OverrideState.UNAVAILABLE); final SettingsActivity settingsActivity = mTestHelper.startPasswordSettingsFromMainSettings(mSettingsActivityTestRule); View mainDecorView = settingsActivity.getWindow().getDecorView(); openActionBarOverflowOrOptionsMenu( InstrumentationRegistry.getInstrumentation().getTargetContext()); onViewWaiting( allOf(withText(R.string.password_settings_export_action_title), isCompletelyDisplayed())) .perform(click()); onView(withText(R.string.password_export_set_lock_screen)) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isCompletelyDisplayed())); }
/** * Check whether the user is asked to set up a screen lock if attempting to export passwords. */
Check whether the user is asked to set up a screen lock if attempting to export passwords
testExportMenuItemNoLock
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsExportTest.java", "license": "bsd-3-clause", "size": 44067 }
[ "android.support.test.InstrumentationRegistry", "android.view.View", "androidx.test.espresso.Espresso", "androidx.test.espresso.matcher.ViewMatchers", "org.chromium.base.test.util.Feature", "org.chromium.chrome.browser.settings.SettingsActivity", "org.chromium.ui.test.util.ViewUtils", "org.hamcrest.Ma...
import android.support.test.InstrumentationRegistry; import android.view.View; import androidx.test.espresso.Espresso; import androidx.test.espresso.matcher.ViewMatchers; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.ui.test.util.ViewUtils; import org.hamcrest.Matchers;
import android.support.test.*; import android.view.*; import androidx.test.espresso.*; import androidx.test.espresso.matcher.*; import org.chromium.base.test.util.*; import org.chromium.chrome.browser.settings.*; import org.chromium.ui.test.util.*; import org.hamcrest.*;
[ "android.support", "android.view", "androidx.test", "org.chromium.base", "org.chromium.chrome", "org.chromium.ui", "org.hamcrest" ]
android.support; android.view; androidx.test; org.chromium.base; org.chromium.chrome; org.chromium.ui; org.hamcrest;
52,739
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<ApplicationGatewayInner>> listAllNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listAllNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<ApplicationGatewayInner>> function(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listAllNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
/** * Get the next page of items. * * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for ListApplicationGateways API service call. */
Get the next page of items
listAllNextSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java", "license": "mit", "size": 166717 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.Context", "com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
778,523
static ScoreDocComparator comparatorFloat (final IndexReader reader, final String fieldname) throws IOException { final String field = fieldname.intern(); final float[] fieldOrder = FieldCache.DEFAULT.getFloats (reader, field); return new ScoreDocComparator () {
static ScoreDocComparator comparatorFloat (final IndexReader reader, final String fieldname) throws IOException { final String field = fieldname.intern(); final float[] fieldOrder = FieldCache.DEFAULT.getFloats (reader, field); return new ScoreDocComparator () {
/** * Returns a comparator for sorting hits according to a field containing floats. * @param reader Index to use. * @param fieldname Fieldable containg float values. * @return Comparator for sorting hits. * @throws IOException If an error occurs reading the index. */
Returns a comparator for sorting hits according to a field containing floats
comparatorFloat
{ "repo_name": "lpxz/grail-lucene477083", "path": "src/java/org/apache/lucene/search/FieldSortedHitQueue.java", "license": "apache-2.0", "size": 13280 }
[ "java.io.IOException", "org.apache.lucene.index.IndexReader" ]
import java.io.IOException; import org.apache.lucene.index.IndexReader;
import java.io.*; import org.apache.lucene.index.*;
[ "java.io", "org.apache.lucene" ]
java.io; org.apache.lucene;
1,837,745
private static String generateUniqueName(final String suffix) { String name = UUID.randomUUID().toString().replaceAll("-", ""); if (suffix != null) name += suffix; return name; }
static String function(final String suffix) { String name = UUID.randomUUID().toString().replaceAll("-", ""); if (suffix != null) name += suffix; return name; }
/** * Generate a unique file name, used by createTempName() and commitStoreFile() * @param suffix extra information to append to the generated name * @return Unique file name */
Generate a unique file name, used by createTempName() and commitStoreFile()
generateUniqueName
{ "repo_name": "intel-hadoop/hbase-rhino", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java", "license": "apache-2.0", "size": 41756 }
[ "java.util.UUID" ]
import java.util.UUID;
import java.util.*;
[ "java.util" ]
java.util;
119,303
public OnExceptionDefinition handled(@AsPredicate Predicate handled) { setHandledPolicy(handled); return this; }
OnExceptionDefinition function(@AsPredicate Predicate handled) { setHandledPolicy(handled); return this; }
/** * Sets whether the exchange should be marked as handled or not. * * @param handled predicate that determines true or false * @return the builder */
Sets whether the exchange should be marked as handled or not
handled
{ "repo_name": "punkhorn/camel-upstream", "path": "core/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java", "license": "apache-2.0", "size": 29346 }
[ "org.apache.camel.Predicate", "org.apache.camel.spi.AsPredicate" ]
import org.apache.camel.Predicate; import org.apache.camel.spi.AsPredicate;
import org.apache.camel.*; import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
1,447,847
private void markAsExported(ValueSet valueSet, OnyxDataExportDestination destination, String destinationTableName) { Date exportDate = new Date(); // Find the earliest and latest entity capture date-time Date captureStartDate = null; Date captureEndDate = null; CaptureAndExportStrategy captureAndExportStrategy = captureAndExportStrategyMap.get(valueSet.getVariableEntity().getType()); if(captureAndExportStrategy != null) { captureStartDate = captureAndExportStrategy.getCaptureStartDate(valueSet.getVariableEntity().getIdentifier()); captureEndDate = captureAndExportStrategy.getCaptureEndDate(valueSet.getVariableEntity().getIdentifier()); } // If capture dates null, default to export date (could happen for instruments and workstations). captureStartDate = (captureStartDate != null) ? captureStartDate : exportDate; captureEndDate = (captureEndDate != null) ? captureEndDate : exportDate; // Write an entry in ExportLog to flag the set of entities as exported. ExportLog exportLog = ExportLog.Builder.newLog().type(valueSet.getVariableEntity().getType()).identifier(valueSet.getVariableEntity().getIdentifier()).start(captureStartDate).end(captureEndDate).destination(destination.getName() + '.' + destinationTableName).exportDate(exportDate).user(userSessionService.getUserName()).build(); exportLogService.save(exportLog); } private class HibernateCacheReaderListener implements MultithreadedDatasourceCopier.ReaderListener {
void function(ValueSet valueSet, OnyxDataExportDestination destination, String destinationTableName) { Date exportDate = new Date(); Date captureStartDate = null; Date captureEndDate = null; CaptureAndExportStrategy captureAndExportStrategy = captureAndExportStrategyMap.get(valueSet.getVariableEntity().getType()); if(captureAndExportStrategy != null) { captureStartDate = captureAndExportStrategy.getCaptureStartDate(valueSet.getVariableEntity().getIdentifier()); captureEndDate = captureAndExportStrategy.getCaptureEndDate(valueSet.getVariableEntity().getIdentifier()); } captureStartDate = (captureStartDate != null) ? captureStartDate : exportDate; captureEndDate = (captureEndDate != null) ? captureEndDate : exportDate; ExportLog exportLog = ExportLog.Builder.newLog().type(valueSet.getVariableEntity().getType()).identifier(valueSet.getVariableEntity().getIdentifier()).start(captureStartDate).end(captureEndDate).destination(destination.getName() + '.' + destinationTableName).exportDate(exportDate).user(userSessionService.getUserName()).build(); exportLogService.save(exportLog); } private class HibernateCacheReaderListener implements MultithreadedDatasourceCopier.ReaderListener {
/** * Creates an {@code ExportLog} entry for the specified {@code valueSet} and {@code destination}. * @param valueSet * @param destination */
Creates an ExportLog entry for the specified valueSet and destination
markAsExported
{ "repo_name": "apruden/onyx", "path": "onyx-core/src/main/java/org/obiba/onyx/engine/variable/export/OnyxDataExport.java", "license": "gpl-3.0", "size": 14699 }
[ "java.util.Date", "org.obiba.magma.ValueSet", "org.obiba.magma.support.MultithreadedDatasourceCopier", "org.obiba.onyx.core.domain.statistics.ExportLog", "org.obiba.onyx.engine.variable.CaptureAndExportStrategy" ]
import java.util.Date; import org.obiba.magma.ValueSet; import org.obiba.magma.support.MultithreadedDatasourceCopier; import org.obiba.onyx.core.domain.statistics.ExportLog; import org.obiba.onyx.engine.variable.CaptureAndExportStrategy;
import java.util.*; import org.obiba.magma.*; import org.obiba.magma.support.*; import org.obiba.onyx.core.domain.statistics.*; import org.obiba.onyx.engine.variable.*;
[ "java.util", "org.obiba.magma", "org.obiba.onyx" ]
java.util; org.obiba.magma; org.obiba.onyx;
229,327
void setModel(ScenarioModel model);
void setModel(ScenarioModel model);
/** * Sets model to be managed with this manager. * * @param model model */
Sets model to be managed with this manager
setModel
{ "repo_name": "PerfCake/pc4ide", "path": "pc4ide-editor/src/main/java/org/perfcake/ide/editor/form/FormManager.java", "license": "apache-2.0", "size": 3468 }
[ "org.perfcake.ide.core.model.components.ScenarioModel" ]
import org.perfcake.ide.core.model.components.ScenarioModel;
import org.perfcake.ide.core.model.components.*;
[ "org.perfcake.ide" ]
org.perfcake.ide;
2,015,260
private String getContentString () throws SerializationException { String typeAttr; String sContent; if ( content instanceof XmlAble ) { typeAttr = "XmlAble"; sContent = ((XmlAble)content).toXmlString(); } else { typeAttr = "Serializable"; sContent = Base64.encodeBase64String( SerializeTools.serialize((Serializable) content )); } String response = ""; if ( responseToId != null ) response = " responseTo=\"" + responseToId + "\""; return "<las2peer:messageContent" +" id=\"" + id + "\"" +" sender=\""+sender.getId()+"\"" +" recipient=\""+recipient.getId()+"\"" +" class=\"" + content.getClass().getCanonicalName() + "\"" +" type=\"" + typeAttr + "\"" +" timestamp=\"" + timestampMs + "\"" +" timeout=\"" + validMs + "\"" + response +">" + sContent +"</las2peer:messageContent>"; }
String function () throws SerializationException { String typeAttr; String sContent; if ( content instanceof XmlAble ) { typeAttr = STR; sContent = ((XmlAble)content).toXmlString(); } else { typeAttr = STR; sContent = Base64.encodeBase64String( SerializeTools.serialize((Serializable) content )); } String response = STR responseTo=\STR\STR<las2peer:messageContentSTR id=\STR\"STR sender=\STR\"STR recipient=\STR\"STR class=\STR\"STR type=\STR\"STR timestamp=\STR\"STR timeout=\STR\STR>STR</las2peer:messageContent>"; }
/** * get the contents of this message as base 64 encoded string * * @return message contents in xml format with all important attributes and the actual content as base64 encoded string * * @throws SerializationException */
get the contents of this message as base 64 encoded string
getContentString
{ "repo_name": "AlexRuppert/las2peer_project", "path": "java/i5/las2peer/communication/Message.java", "license": "mit", "size": 25709 }
[ "java.io.Serializable", "org.apache.commons.codec.binary.Base64" ]
import java.io.Serializable; import org.apache.commons.codec.binary.Base64;
import java.io.*; import org.apache.commons.codec.binary.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
1,022,590
//----------------------------------------------------------------------- public static <E> int indexOf(final List<E> list, final Predicate<E> predicate) { if (list != null && predicate != null) { for (int i = 0; i < list.size(); i++) { final E item = list.get(i); if (predicate.evaluate(item)) { return i; } } } return -1; } //----------------------------------------------------------------------- /** * Returns the longest common subsequence (LCS) of two sequences (lists). * * @param <E> the element type * @param a the first list * @param b the second list * @return the longest common subsequence * @throws NullPointerException if either list is {@code null}
static <E> int function(final List<E> list, final Predicate<E> predicate) { if (list != null && predicate != null) { for (int i = 0; i < list.size(); i++) { final E item = list.get(i); if (predicate.evaluate(item)) { return i; } } } return -1; } /** * Returns the longest common subsequence (LCS) of two sequences (lists). * * @param <E> the element type * @param a the first list * @param b the second list * @return the longest common subsequence * @throws NullPointerException if either list is {@code null}
/** * Finds the first index in the given List which matches the given predicate. * <p> * If the input List or predicate is null, or no element of the List * matches the predicate, -1 is returned. * * @param <E> the element type * @param list the List to search, may be null * @param predicate the predicate to use, may be null * @return the first index of an Object in the List which matches the predicate or -1 if none could be found */
Finds the first index in the given List which matches the given predicate. If the input List or predicate is null, or no element of the List matches the predicate, -1 is returned
indexOf
{ "repo_name": "AffogatoLang/Moka", "path": "lib/Apache_Commons_Collections/src/main/java/org/apache/commons/collections4/ListUtils.java", "license": "bsd-3-clause", "size": 27973 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
457,871
// readLines //----------------------------------------------------------------------- public static List<String> readLines(InputStream input) throws IOException { InputStreamReader reader = new InputStreamReader(input); return readLines(reader); }
static List<String> function(InputStream input) throws IOException { InputStreamReader reader = new InputStreamReader(input); return readLines(reader); }
/** * Get the contents of an <code>InputStream</code> as a list of Strings, * one entry per line, using the default character encoding of the platform. * <p> * This method buffers the input internally, so there is no need to use a * <code>BufferedInputStream</code>. * * @param input the <code>InputStream</code> to read from, not null * @return the list of Strings, never null * @throws NullPointerException if the input is null * @throws IOException if an I/O error occurs * @since Commons IO 1.1 */
Get the contents of an <code>InputStream</code> as a list of Strings, one entry per line, using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>
readLines
{ "repo_name": "rytina/dukecon_appsgenerator", "path": "org.apache.commons.io/source-bundle/org/apache/commons/io/IOUtils.java", "license": "epl-1.0", "size": 62217 }
[ "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader", "java.util.List" ]
import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
531,381
private static Optional<InternalRexNode> translateOp2(String op, String name, RexLiteral right, RexNode originNode, KeyMeta keyMeta) { String value = literalValue(right); InternalRexNode node = new InternalRexNode(); node.node = originNode; node.ordinalInKey = keyMeta.getKeyColumnNames().indexOf(name); // For variable length column, Innodb-java-reader have a limitation, // left-prefix index length should be less than search value literal. // For example, we cannot leverage index of EMAIL(3) upon search value // `someone@apache.org`, because the value length is longer than 3. if (keyMeta.getVarLen(name).isPresent() && keyMeta.getVarLen(name).get() < value.length()) { return Optional.empty(); } node.fieldName = name; node.op = op; node.right = value; return Optional.of(node); }
static Optional<InternalRexNode> function(String op, String name, RexLiteral right, RexNode originNode, KeyMeta keyMeta) { String value = literalValue(right); InternalRexNode node = new InternalRexNode(); node.node = originNode; node.ordinalInKey = keyMeta.getKeyColumnNames().indexOf(name); if (keyMeta.getVarLen(name).isPresent() && keyMeta.getVarLen(name).get() < value.length()) { return Optional.empty(); } node.fieldName = name; node.op = op; node.right = value; return Optional.of(node); }
/** * Combines a field name, operator, and literal to produce a predicate string. */
Combines a field name, operator, and literal to produce a predicate string
translateOp2
{ "repo_name": "datametica/calcite", "path": "innodb/src/main/java/org/apache/calcite/adapter/innodb/InnodbFilterTranslator.java", "license": "apache-2.0", "size": 19093 }
[ "com.alibaba.innodb.java.reader.schema.KeyMeta", "java.util.Optional", "org.apache.calcite.rex.RexLiteral", "org.apache.calcite.rex.RexNode" ]
import com.alibaba.innodb.java.reader.schema.KeyMeta; import java.util.Optional; import org.apache.calcite.rex.RexLiteral; import org.apache.calcite.rex.RexNode;
import com.alibaba.innodb.java.reader.schema.*; import java.util.*; import org.apache.calcite.rex.*;
[ "com.alibaba.innodb", "java.util", "org.apache.calcite" ]
com.alibaba.innodb; java.util; org.apache.calcite;
371,491
public static int ConvertDipToPx(Context context, float dips) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dips, context.getResources().getDisplayMetrics()); }
static int function(Context context, float dips) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dips, context.getResources().getDisplayMetrics()); }
/** Converts the given number of density independent pixels to the corresponding number of pixels using the formula: px = dip * (dpi / 160). * * @param context the current Context * @param dips a value in DIPs * @return the corresponding value in Pixels * */
Converts the given number of density independent pixels to the corresponding number of pixels using the formula: px = dip * (dpi / 160)
ConvertDipToPx
{ "repo_name": "dave-cassettari/sapelli", "path": "CollectorAndroid/src/uk/ac/ucl/excites/sapelli/collector/util/ScreenMetrics.java", "license": "unlicense", "size": 3700 }
[ "android.content.Context", "android.util.TypedValue" ]
import android.content.Context; import android.util.TypedValue;
import android.content.*; import android.util.*;
[ "android.content", "android.util" ]
android.content; android.util;
2,054,990
void setChannel(Channel value);
void setChannel(Channel value);
/** * Sets the value of the '{@link org.roboid.studio.timeline.ChannelTrack#getChannel <em>Channel</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Channel</em>' reference. * @see #getChannel() * @generated */
Sets the value of the '<code>org.roboid.studio.timeline.ChannelTrack#getChannel Channel</code>' reference.
setChannel
{ "repo_name": "roboidstudio/embedded", "path": "org.roboid.studio.timeline.model/src/org/roboid/studio/timeline/ChannelTrack.java", "license": "lgpl-2.1", "size": 5238 }
[ "org.roboid.robot.Channel" ]
import org.roboid.robot.Channel;
import org.roboid.robot.*;
[ "org.roboid.robot" ]
org.roboid.robot;
781,349
public JMenuItem[] getFileMenuSecondaries() { return null; }
JMenuItem[] function() { return null; }
/** * Get secondary file menu opereations for this tool. These are placed after * all primary actions from all tools, but before the global operations like * preferences, close and exit. * They will be shown in the order given in the array. There * are none provided by default (null). * @return Array of menu items to be shown for this tool. Nill if none. * @see #getFileMenuActions */
Get secondary file menu opereations for this tool. These are placed after all primary actions from all tools, but before the global operations like preferences, close and exit. They will be shown in the order given in the array. There are none provided by default (null)
getFileMenuSecondaries
{ "repo_name": "otmarjr/jtreg-fork", "path": "dist-with-aspectj/jtreg/lib/javatest/com/sun/javatest/tool/ToolManager.java", "license": "gpl-2.0", "size": 7898 }
[ "javax.swing.JMenuItem" ]
import javax.swing.JMenuItem;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,015,889
@Test public void testHMSClientWithoutFilter() throws Exception { MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_CLIENT_FILTER_ENABLED, false); DBNAME1 = "db_testHMSClientWithoutFilter_1"; DBNAME2 = "db_testHMSClientWithoutFilter_2"; creatEnv(conf); assertNotNull(client.getTable(DBNAME1, TAB1)); assertEquals(2, client.getTables(DBNAME1, "*").size()); assertEquals(2, client.getAllTables(DBNAME1).size()); assertEquals(1, client.getTables(DBNAME1, TAB2).size()); assertEquals(0, client.getAllTables(DBNAME2).size()); assertNotNull(client.getDatabase(DBNAME1)); assertEquals(2, client.getDatabases("*testHMSClientWithoutFilter*").size()); assertEquals(1, client.getDatabases(DBNAME1).size()); assertNotNull(client.getPartition(DBNAME1, TAB2, "name=value1")); assertEquals(1, client.getPartitionsByNames(DBNAME1, TAB2, Lists.newArrayList("name=value1")).size()); assertEquals(2, client.showCompactions().getCompacts().size()); }
void function() throws Exception { MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_CLIENT_FILTER_ENABLED, false); DBNAME1 = STR; DBNAME2 = STR; creatEnv(conf); assertNotNull(client.getTable(DBNAME1, TAB1)); assertEquals(2, client.getTables(DBNAME1, "*").size()); assertEquals(2, client.getAllTables(DBNAME1).size()); assertEquals(1, client.getTables(DBNAME1, TAB2).size()); assertEquals(0, client.getAllTables(DBNAME2).size()); assertNotNull(client.getDatabase(DBNAME1)); assertEquals(2, client.getDatabases(STR).size()); assertEquals(1, client.getDatabases(DBNAME1).size()); assertNotNull(client.getPartition(DBNAME1, TAB2, STR)); assertEquals(1, client.getPartitionsByNames(DBNAME1, TAB2, Lists.newArrayList(STR)).size()); assertEquals(2, client.showCompactions().getCompacts().size()); }
/** * Disable filtering at HMS client * By default, the HMS server side filtering is disabled, so we can see HMS client filtering behavior * @throws Exception */
Disable filtering at HMS client By default, the HMS server side filtering is disabled, so we can see HMS client filtering behavior
testHMSClientWithoutFilter
{ "repo_name": "nishantmonu51/hive", "path": "standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestFilterHooks.java", "license": "apache-2.0", "size": 14449 }
[ "com.google.common.collect.Lists", "org.apache.hadoop.hive.metastore.conf.MetastoreConf", "org.junit.Assert" ]
import com.google.common.collect.Lists; import org.apache.hadoop.hive.metastore.conf.MetastoreConf; import org.junit.Assert;
import com.google.common.collect.*; import org.apache.hadoop.hive.metastore.conf.*; import org.junit.*;
[ "com.google.common", "org.apache.hadoop", "org.junit" ]
com.google.common; org.apache.hadoop; org.junit;
765,284
@Test public void testPartitionedRegionAndCopyOnRead() throws Exception { final Host h = getHost(0); final VM accessor = h.getVM(2); final VM datastore = h.getVM(3); final String rName = getUniqueName(); final String k1 = "k1";
void function() throws Exception { final Host h = getHost(0); final VM accessor = h.getVM(2); final VM datastore = h.getVM(3); final String rName = getUniqueName(); final String k1 = "k1";
/** * Test to ensure that a PartitionedRegion doesn't make more than the expected number of copies * when copy-on-read is set to true */
Test to ensure that a PartitionedRegion doesn't make more than the expected number of copies when copy-on-read is set to true
testPartitionedRegionAndCopyOnRead
{ "repo_name": "pdxrunner/geode", "path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientDeserializationCopyOnReadRegressionTest.java", "license": "apache-2.0", "size": 19945 }
[ "org.apache.geode.test.dunit.Host" ]
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.*;
[ "org.apache.geode" ]
org.apache.geode;
1,725,447
public CallHandle loadRatings(SecurityContext ctx, Class nodeType, List<Long> nodeIDs, long userID, AgentEventListener observer);
CallHandle function(SecurityContext ctx, Class nodeType, List<Long> nodeIDs, long userID, AgentEventListener observer);
/** * Loads all the ratings attached by a given user to the specified objects. * Retrieves the files if the userID is not <code>-1</code>. * * @param ctx The security context. * @param nodeType The class identifying the object. * Mustn't be <code>null</code>. * @param nodeIDs The collection of ids of the passed node type. * @param userID Pass <code>-1</code> if no user specified. * @param observer Call-back handler. * @return A handle that can be used to cancel the call. */
Loads all the ratings attached by a given user to the specified objects. Retrieves the files if the userID is not <code>-1</code>
loadRatings
{ "repo_name": "simleo/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/views/MetadataHandlerView.java", "license": "gpl-2.0", "size": 20883 }
[ "java.util.List", "org.openmicroscopy.shoola.env.event.AgentEventListener" ]
import java.util.List; import org.openmicroscopy.shoola.env.event.AgentEventListener;
import java.util.*; import org.openmicroscopy.shoola.env.event.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
1,185,705
public void testParseTemplateConsidersAttachment() throws XWikiException { XWikiDocument skin = new XWikiDocument(new DocumentReference("Wiki", "XWiki", "Skin")); XWikiAttachment attachment = new XWikiAttachment(); skin.getAttachmentList().add(attachment); attachment.setContent("parsing an attachment".getBytes()); attachment.setFilename("template.vm"); attachment.setDoc(skin); this.xwiki.saveDocument(skin, getContext()); getContext().put("skin", "XWiki.Skin"); assertEquals("XWiki.Skin", this.xwiki.getSkin(getContext())); assertFalse(this.xwiki.getDocument("XWiki.Skin", getContext()).isNew()); assertEquals(skin, this.xwiki.getDocument("XWiki.Skin", getContext())); assertEquals("parsing an attachment", this.xwiki.parseTemplate("template.vm", getContext())); }
void function() throws XWikiException { XWikiDocument skin = new XWikiDocument(new DocumentReference("Wiki", "XWiki", "Skin")); XWikiAttachment attachment = new XWikiAttachment(); skin.getAttachmentList().add(attachment); attachment.setContent(STR.getBytes()); attachment.setFilename(STR); attachment.setDoc(skin); this.xwiki.saveDocument(skin, getContext()); getContext().put("skin", STR); assertEquals(STR, this.xwiki.getSkin(getContext())); assertFalse(this.xwiki.getDocument(STR, getContext()).isNew()); assertEquals(skin, this.xwiki.getDocument(STR, getContext())); assertEquals(STR, this.xwiki.parseTemplate(STR, getContext())); }
/** * See XWIKI-2096 */
See XWIKI-2096
testParseTemplateConsidersAttachment
{ "repo_name": "pbondoer/xwiki-platform", "path": "xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/XWikiTest.java", "license": "lgpl-2.1", "size": 28982 }
[ "com.xpn.xwiki.doc.XWikiAttachment", "com.xpn.xwiki.doc.XWikiDocument", "org.xwiki.model.reference.DocumentReference" ]
import com.xpn.xwiki.doc.XWikiAttachment; import com.xpn.xwiki.doc.XWikiDocument; import org.xwiki.model.reference.DocumentReference;
import com.xpn.xwiki.doc.*; import org.xwiki.model.reference.*;
[ "com.xpn.xwiki", "org.xwiki.model" ]
com.xpn.xwiki; org.xwiki.model;
2,673,199
char getArrayDelimiter(int oid) throws SQLException;
char getArrayDelimiter(int oid) throws SQLException;
/** * Determine the delimiter for the elements of the given array type oid. * * @param oid the array type's OID * @return the base type's array type delimiter * @throws SQLException if an error occurs when retrieving array delimiter */
Determine the delimiter for the elements of the given array type oid
getArrayDelimiter
{ "repo_name": "sehrope/pgjdbc", "path": "pgjdbc/src/main/java/org/postgresql/core/TypeInfo.java", "license": "bsd-2-clause", "size": 3769 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,835,129
public void setSageEmployeePersistence( SageEmployeePersistence sageEmployeePersistence) { this.sageEmployeePersistence = sageEmployeePersistence; }
void function( SageEmployeePersistence sageEmployeePersistence) { this.sageEmployeePersistence = sageEmployeePersistence; }
/** * Sets the sage employee persistence. * * @param sageEmployeePersistence the sage employee persistence */
Sets the sage employee persistence
setSageEmployeePersistence
{ "repo_name": "RMarinDTI/CloubityRepo", "path": "Servicio-portlet/docroot/WEB-INF/src/es/davinciti/liferay/service/base/CurrencyServiceBaseImpl.java", "license": "unlicense", "size": 52888 }
[ "es.davinciti.liferay.service.persistence.SageEmployeePersistence" ]
import es.davinciti.liferay.service.persistence.SageEmployeePersistence;
import es.davinciti.liferay.service.persistence.*;
[ "es.davinciti.liferay" ]
es.davinciti.liferay;
2,247,458
@GET @NoCache @Produces(MediaType.APPLICATION_JSON) public Stream<RoleRepresentation> getRoles(@QueryParam("search") @DefaultValue("") String search, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults, @QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation) { auth.roles().requireList(roleContainer); Set<RoleModel> roleModels; if(search != null && search.trim().length() > 0) { roleModels = roleContainer.searchForRoles(search, firstResult, maxResults); } else if (!Objects.isNull(firstResult) && !Objects.isNull(maxResults)) { roleModels = roleContainer.getRoles(firstResult, maxResults); } else { roleModels = roleContainer.getRoles(); } Function<RoleModel, RoleRepresentation> toRoleRepresentation = briefRepresentation ? ModelToRepresentation::toBriefRepresentation : ModelToRepresentation::toRepresentation; return roleModels.stream().map(toRoleRepresentation); }
@Produces(MediaType.APPLICATION_JSON) Stream<RoleRepresentation> function(@QueryParam(STR) @DefaultValue(STRfirstSTRmaxSTRbriefRepresentationSTRtrue") boolean briefRepresentation) { auth.roles().requireList(roleContainer); Set<RoleModel> roleModels; if(search != null && search.trim().length() > 0) { roleModels = roleContainer.searchForRoles(search, firstResult, maxResults); } else if (!Objects.isNull(firstResult) && !Objects.isNull(maxResults)) { roleModels = roleContainer.getRoles(firstResult, maxResults); } else { roleModels = roleContainer.getRoles(); } Function<RoleModel, RoleRepresentation> toRoleRepresentation = briefRepresentation ? ModelToRepresentation::toBriefRepresentation : ModelToRepresentation::toRepresentation; return roleModels.stream().map(toRoleRepresentation); }
/** * Get all roles for the realm or client * * @return */
Get all roles for the realm or client
getRoles
{ "repo_name": "mhajas/keycloak", "path": "services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java", "license": "apache-2.0", "size": 16537 }
[ "java.util.Objects", "java.util.Set", "java.util.function.Function", "java.util.stream.Stream", "javax.ws.rs.DefaultValue", "javax.ws.rs.Produces", "javax.ws.rs.QueryParam", "javax.ws.rs.core.MediaType", "org.keycloak.models.RoleModel", "org.keycloak.models.utils.ModelToRepresentation", "org.key...
import java.util.Objects; import java.util.Set; import java.util.function.Function; import java.util.stream.Stream; import javax.ws.rs.DefaultValue; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import org.keycloak.models.RoleModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.representations.idm.RoleRepresentation;
import java.util.*; import java.util.function.*; import java.util.stream.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.keycloak.models.*; import org.keycloak.models.utils.*; import org.keycloak.representations.idm.*;
[ "java.util", "javax.ws", "org.keycloak.models", "org.keycloak.representations" ]
java.util; javax.ws; org.keycloak.models; org.keycloak.representations;
1,412,393
public void run() { char[] buf = new char[8192]; // Run until we're interrupted. while (!runningThread.isInterrupted()) { try { int len = incomingReader.read(buf); if (len == -1) { // Die if no input is available. break; } else if (len > 0) { String str = new String(buf, 0, len); // Writing to the JTextArea is synchronized. synchronized (outgoingTextArea) { appending = true; outgoingTextArea.append(str); appending = false; outgoingTextArea.notify(); } } } catch (IOException ioe) { // Bail out when things go wrong, including when we are // interrupted. break; } } } // run
void function() { char[] buf = new char[8192]; while (!runningThread.isInterrupted()) { try { int len = incomingReader.read(buf); if (len == -1) { break; } else if (len > 0) { String str = new String(buf, 0, len); synchronized (outgoingTextArea) { appending = true; outgoingTextArea.append(str); appending = false; outgoingTextArea.notify(); } } } catch (IOException ioe) { break; } } }
/** * Read input from the reader and append it to the text area. Runs * until the <code>stop()</code> method is called or an I/O * exception occurs. * * @see #start * @see #stop */
Read input from the reader and append it to the text area. Runs until the <code>stop()</code> method is called or an I/O exception occurs
run
{ "repo_name": "mbertacca/JSwat2", "path": "classes/com/bluemarsh/jswat/ui/ReaderToTextArea.java", "license": "gpl-2.0", "size": 5106 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
733,389
default<T1> Case<T1,R,Function<T1,R>> or(Predicate<T1> or, Function<T1,T> fn){ return composeOr(Case.of(or,fn)); }
default<T1> Case<T1,R,Function<T1,R>> or(Predicate<T1> or, Function<T1,T> fn){ return composeOr(Case.of(or,fn)); }
/** * Syntax sugar for composeOr * @see #composeOr * * Provide a Case that will be executed before the current one. The function from the supplied Case will be executed * first and it;s output will be provided to the function of the current case - if either predicate holds. * * <pre> * case1 =Case.of(input-&gt;false,input-&gt;input+10); * assertThat(case1.composeOr(Case.of((Integer input)-&gt;false,input-&gt;input*2)).match(100).get(),is(210)); * </pre> * * @param or Predicate for before case * @param fn Function for before case * @return New Case which chains the supplied case and the current one */
Syntax sugar for composeOr
or
{ "repo_name": "sjfloat/cyclops", "path": "cyclops-pattern-matching/src/main/java/com/aol/cyclops/matcher/Case.java", "license": "mit", "size": 17901 }
[ "java.util.function.Function", "java.util.function.Predicate" ]
import java.util.function.Function; import java.util.function.Predicate;
import java.util.function.*;
[ "java.util" ]
java.util;
1,367,328
public static String getAlgoList(Provider p) { StringBuilder b = new StringBuilder(); Set<String> types = new HashSet<String>(); for(Provider.Service svc: p.getServices()) { types.add(svc.getType()); if("KeyGenerator".equals(svc.getType())) b.append("\n\t").append("[").append(svc.getType()).append("] ").append(svc.getAlgorithm()); } System.out.println("Types:\n" + types); // for(Map.Entry<Object, Object> entry: p.entrySet()) { // String key = (String)entry.getKey(); // String value = (String)entry.getValue(); // if(key.startsWith("Cipher.")) // b.append("\n\t[").append(key).append("]:").append(value); // if(key!=null && key.startsWith("Cipher.") && !key.contains(" ")) { // key = key.split("\\.")[1]; // b.append("\n\t[").append(key).append("]:").append(value); // } // } return b.toString(); }
static String function(Provider p) { StringBuilder b = new StringBuilder(); Set<String> types = new HashSet<String>(); for(Provider.Service svc: p.getServices()) { types.add(svc.getType()); if(STR.equals(svc.getType())) b.append("\n\t").append("[").append(svc.getType()).append(STR).append(svc.getAlgorithm()); } System.out.println(STR + types); return b.toString(); }
/** * Returns the algo list for the passed provider * @param p the provder * @return the algo list */
Returns the algo list for the passed provider
getAlgoList
{ "repo_name": "nickman/HeliosStreams", "path": "collector-server/src/test/java/test/com/heliosapm/streams/collector/ssh/server/ApacheSSHDServer.java", "license": "apache-2.0", "size": 10805 }
[ "java.security.Provider", "java.util.HashSet", "java.util.Set" ]
import java.security.Provider; import java.util.HashSet; import java.util.Set;
import java.security.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
1,172,807
private void mergeObjectTable(ObjectTable methodObjectTable, boolean stringsOnly) { Enumeration e = methodObjectTable.objectTable.elements(); while (e.hasMoreElements()) { ObjectCounter moc = (ObjectCounter)e.nextElement(); if (!stringsOnly || (moc.getObject() instanceof String)) { mergeConstantObject(moc); } } }
void function(ObjectTable methodObjectTable, boolean stringsOnly) { Enumeration e = methodObjectTable.objectTable.elements(); while (e.hasMoreElements()) { ObjectCounter moc = (ObjectCounter)e.nextElement(); if (!stringsOnly (moc.getObject() instanceof String)) { mergeConstantObject(moc); } } }
/** * Merge the objects and usage counts from methodObjectTable into this object table * @param methodObjectTable * @param stringsOnly if true only merge in string objects (for to preserve strings used by vm2c) */
Merge the objects and usage counts from methodObjectTable into this object table
mergeObjectTable
{ "repo_name": "squawk-mirror/squawk", "path": "translator/src/com/sun/squawk/translator/ObjectTable.java", "license": "gpl-2.0", "size": 14242 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,681,456
public static long getTimestampAsLong(Timestamp timestamp) { return millisToSeconds(timestamp.getTime()); }
static long function(Timestamp timestamp) { return millisToSeconds(timestamp.getTime()); }
/** * Return a long representation of a Timestamp. * @param timestamp * @return */
Return a long representation of a Timestamp
getTimestampAsLong
{ "repo_name": "vergilchiu/hive", "path": "storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/TimestampColumnVector.java", "license": "apache-2.0", "size": 12182 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,066,294
public static int getRequiredHeightBoundingClientRect( com.google.gwt.dom.client.Element element) { return (int) Math .ceil(getRequiredHeightBoundingClientRectDouble(element)); }
static int function( com.google.gwt.dom.client.Element element) { return (int) Math .ceil(getRequiredHeightBoundingClientRectDouble(element)); }
/** * Calculates the height of the element's bounding rectangle. * <p> * In case the browser doesn't support bounding rectangles, the returned * value is the offset height. * * @param element * the element of which to calculate the height * @return the height of the element */
Calculates the height of the element's bounding rectangle. In case the browser doesn't support bounding rectangles, the returned value is the offset height
getRequiredHeightBoundingClientRect
{ "repo_name": "mstahv/framework", "path": "client/src/main/java/com/vaadin/client/WidgetUtil.java", "license": "apache-2.0", "size": 65738 }
[ "com.google.gwt.dom.client.Element" ]
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,968,990
@MethodSource("com.azure.messaging.servicebus.IntegrationTestBase#messagingEntityWithSessions") @ParameterizedTest void receiveMessageAndComplete(MessagingEntityType entityType, boolean isSessionEnabled) { // Arrange setSenderAndReceiver(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); int maxMessages = 1; final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); sendMessage(message); // Act final Stream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(maxMessages, TIMEOUT) .stream() .map(ServiceBusReceivedMessageContext::getMessage); // Assert final AtomicInteger receivedMessageCount = new AtomicInteger(); messages.forEach(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); receiver.complete(receivedMessage); messagesPending.decrementAndGet(); receivedMessageCount.incrementAndGet(); }); assertEquals(maxMessages, receivedMessageCount.get()); }
@MethodSource(STR) void receiveMessageAndComplete(MessagingEntityType entityType, boolean isSessionEnabled) { setSenderAndReceiver(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); int maxMessages = 1; final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); sendMessage(message); final Stream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(maxMessages, TIMEOUT) .stream() .map(ServiceBusReceivedMessageContext::getMessage); final AtomicInteger receivedMessageCount = new AtomicInteger(); messages.forEach(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); receiver.complete(receivedMessage); messagesPending.decrementAndGet(); receivedMessageCount.incrementAndGet(); }); assertEquals(maxMessages, receivedMessageCount.get()); }
/** * Verifies that we can send and receive one messages. */
Verifies that we can send and receive one messages
receiveMessageAndComplete
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverClientIntegrationTest.java", "license": "mit", "size": 36855 }
[ "com.azure.messaging.servicebus.implementation.MessagingEntityType", "java.util.UUID", "java.util.concurrent.atomic.AtomicInteger", "java.util.stream.Stream", "org.junit.jupiter.api.Assertions", "org.junit.jupiter.params.provider.MethodSource" ]
import com.azure.messaging.servicebus.implementation.MessagingEntityType; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.provider.MethodSource;
import com.azure.messaging.servicebus.implementation.*; import java.util.*; import java.util.concurrent.atomic.*; import java.util.stream.*; import org.junit.jupiter.api.*; import org.junit.jupiter.params.provider.*;
[ "com.azure.messaging", "java.util", "org.junit.jupiter" ]
com.azure.messaging; java.util; org.junit.jupiter;
2,844,468
public DataObjectModification<VtnNode> newCreatedModification() { List<DataObjectModification<?>> children = new ArrayList<>(); for (VtnPortBuildHelper child: portBuilders.values()) { children.add(child.newCreatedModification()); } return newKeyedModification(null, build(), children); }
DataObjectModification<VtnNode> function() { List<DataObjectModification<?>> children = new ArrayList<>(); for (VtnPortBuildHelper child: portBuilders.values()) { children.add(child.newCreatedModification()); } return newKeyedModification(null, build(), children); }
/** * Create a new data object modification that represents creation of * this vtn-node. * * @return A {@link DataObjectModification} instance. */
Create a new data object modification that represents creation of this vtn-node
newCreatedModification
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/inventory/VtnNodeBuildHelper.java", "license": "epl-1.0", "size": 7702 }
[ "java.util.ArrayList", "java.util.List", "org.opendaylight.controller.md.sal.binding.api.DataObjectModification", "org.opendaylight.vtn.manager.internal.TestBase", "org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.impl.inventory.rev150209.vtn.nodes.VtnNode" ]
import java.util.ArrayList; import java.util.List; import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; import org.opendaylight.vtn.manager.internal.TestBase; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.impl.inventory.rev150209.vtn.nodes.VtnNode;
import java.util.*; import org.opendaylight.controller.md.sal.binding.api.*; import org.opendaylight.vtn.manager.internal.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.impl.inventory.rev150209.vtn.nodes.*;
[ "java.util", "org.opendaylight.controller", "org.opendaylight.vtn", "org.opendaylight.yang" ]
java.util; org.opendaylight.controller; org.opendaylight.vtn; org.opendaylight.yang;
1,714,883
@Deprecated void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws ActiveMQException;
void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws ActiveMQException;
/** * Creates a <em>temporary</em> queue with a filter. * * @param address the queue will be bound to this address * @param queueName the name of the queue * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue */
Creates a temporary queue with a filter
createTemporaryQueue
{ "repo_name": "tabish121/activemq-artemis", "path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java", "license": "apache-2.0", "size": 54407 }
[ "org.apache.activemq.artemis.api.core.ActiveMQException", "org.apache.activemq.artemis.api.core.SimpleString" ]
import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.*;
[ "org.apache.activemq" ]
org.apache.activemq;
1,555,923
private void addChannelSenderListenerIfAny( WebSocketProxy webSocketProxy, HandshakeConfig handshakeConfig) { List<WebSocketSenderListener> webSocketSenderListenerList = handshakeConfig.getWebSocketSenderListeners(); if (webSocketSenderListenerList != null) { for (WebSocketSenderListener senderListener : webSocketSenderListenerList) { webSocketProxy.addSenderListener(senderListener); } } }
void function( WebSocketProxy webSocketProxy, HandshakeConfig handshakeConfig) { List<WebSocketSenderListener> webSocketSenderListenerList = handshakeConfig.getWebSocketSenderListeners(); if (webSocketSenderListenerList != null) { for (WebSocketSenderListener senderListener : webSocketSenderListenerList) { webSocketProxy.addSenderListener(senderListener); } } }
/** * Set other sender listeners and handshake reference, before starting listeners * * @param webSocketProxy * @param handshakeConfig */
Set other sender listeners and handshake reference, before starting listeners
addChannelSenderListenerIfAny
{ "repo_name": "kingthorin/zap-extensions", "path": "addOns/websocket/src/main/java/org/zaproxy/zap/extension/websocket/client/ServerConnectionEstablisher.java", "license": "apache-2.0", "size": 14478 }
[ "java.util.List", "org.zaproxy.zap.extension.websocket.WebSocketProxy", "org.zaproxy.zap.extension.websocket.WebSocketSenderListener" ]
import java.util.List; import org.zaproxy.zap.extension.websocket.WebSocketProxy; import org.zaproxy.zap.extension.websocket.WebSocketSenderListener;
import java.util.*; import org.zaproxy.zap.extension.websocket.*;
[ "java.util", "org.zaproxy.zap" ]
java.util; org.zaproxy.zap;
2,358,135
@SuppressWarnings("unchecked") private Iterable<AbstractTreeNode<C, K, ?>> sentinelSafeChildren(AbstractTreeNode<?, ?, ?> n) { if (n instanceof SentinelNode) { return ImmutableList.of(); } else { return (Iterable<AbstractTreeNode<C, K, ?>>) n.children(); } }
@SuppressWarnings(STR) Iterable<AbstractTreeNode<C, K, ?>> function(AbstractTreeNode<?, ?, ?> n) { if (n instanceof SentinelNode) { return ImmutableList.of(); } else { return (Iterable<AbstractTreeNode<C, K, ?>>) n.children(); } }
/** * Return existing children of node, unless node is a sentinel node, in which * case the empty list is returned. * @param n node * @return child list of n, or the empty iterable for sentinel nodes. */
Return existing children of node, unless node is a sentinel node, in which case the empty list is returned
sentinelSafeChildren
{ "repo_name": "hczhang/htmlmerge", "path": "java/com/google/documents/core/treesync/TreeMerger.java", "license": "apache-2.0", "size": 34973 }
[ "com.google.common.collect.ImmutableList" ]
import com.google.common.collect.ImmutableList;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
1,894,966
public Map<String, Object> getMetrics() { return metrics; } private static final ConstructingObjectParser<TopMetrics, Void> PARSER = new ConstructingObjectParser<>("top", true, (args, name) -> { @SuppressWarnings("unchecked") List<Object> sort = (List<Object>) args[0]; @SuppressWarnings("unchecked") Map<String, Object> metrics = (Map<String, Object>) args[1]; return new TopMetrics(sort, metrics); }); static { PARSER.declareFieldArray(constructorArg(), (p, c) -> XContentParserUtils.parseFieldsValue(p), SORT_FIELD, ObjectParser.ValueType.VALUE_ARRAY); PARSER.declareObject(constructorArg(), (p, c) -> p.map(), METRICS_FIELD); }
Map<String, Object> function() { return metrics; } private static final ConstructingObjectParser<TopMetrics, Void> PARSER = new ConstructingObjectParser<>("top", true, (args, name) -> { @SuppressWarnings(STR) List<Object> sort = (List<Object>) args[0]; @SuppressWarnings(STR) Map<String, Object> metrics = (Map<String, Object>) args[1]; return new TopMetrics(sort, metrics); }); static { PARSER.declareFieldArray(constructorArg(), (p, c) -> XContentParserUtils.parseFieldsValue(p), SORT_FIELD, ObjectParser.ValueType.VALUE_ARRAY); PARSER.declareObject(constructorArg(), (p, c) -> p.map(), METRICS_FIELD); }
/** * The top metric values returned by the aggregation. */
The top metric values returned by the aggregation
getMetrics
{ "repo_name": "ern/elasticsearch", "path": "client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedTopMetrics.java", "license": "apache-2.0", "size": 4506 }
[ "java.util.List", "java.util.Map", "org.elasticsearch.common.xcontent.ConstructingObjectParser", "org.elasticsearch.common.xcontent.ObjectParser", "org.elasticsearch.common.xcontent.XContentParserUtils" ]
import java.util.List; import java.util.Map; import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentParserUtils;
import java.util.*; import org.elasticsearch.common.xcontent.*;
[ "java.util", "org.elasticsearch.common" ]
java.util; org.elasticsearch.common;
2,424,858
@MediumTest @Feature({"Browser", "Main"}) @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES) public void testTranslateNeverPanel() throws InterruptedException { loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); assertTrue("InfoBar not opened.", mListener.addInfoBarAnimationFinished()); InfoBar infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0); assertTrue(InfoBarUtil.clickCloseButton(infoBar)); assertTrue(mListener.removeInfoBarAnimationFinished()); // Reload the page so the infobar shows again loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); assertTrue("InfoBar not opened", mListener.addInfoBarAnimationFinished()); infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0); assertTrue(InfoBarUtil.clickCloseButton(infoBar)); assertTrue("InfoBar not swapped", mListener.swapInfoBarAnimationFinished()); TranslateUtil.assertInfoBarText(infoBar, NEVER_TRANSLATE_MESSAGE); }
@Feature({STR, "Main"}) @Restriction(ChromeRestriction.RESTRICTION_TYPE_GOOGLE_PLAY_SERVICES) void function() throws InterruptedException { loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); assertTrue(STR, mListener.addInfoBarAnimationFinished()); InfoBar infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0); assertTrue(InfoBarUtil.clickCloseButton(infoBar)); assertTrue(mListener.removeInfoBarAnimationFinished()); loadUrl(mTestServer.getURL(TRANSLATE_PAGE)); assertTrue(STR, mListener.addInfoBarAnimationFinished()); infoBar = mInfoBarContainer.getInfoBarsForTesting().get(0); assertTrue(InfoBarUtil.clickCloseButton(infoBar)); assertTrue(STR, mListener.swapInfoBarAnimationFinished()); TranslateUtil.assertInfoBarText(infoBar, NEVER_TRANSLATE_MESSAGE); }
/** * Test the "never translate" panel. */
Test the "never translate" panel
testTranslateNeverPanel
{ "repo_name": "axinging/chromium-crosswalk", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/translate/TranslateInfoBarTest.java", "license": "bsd-3-clause", "size": 5139 }
[ "org.chromium.base.test.util.Feature", "org.chromium.base.test.util.Restriction", "org.chromium.chrome.browser.infobar.InfoBar", "org.chromium.chrome.test.util.ChromeRestriction", "org.chromium.chrome.test.util.InfoBarUtil", "org.chromium.chrome.test.util.TranslateUtil" ]
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.infobar.InfoBar; import org.chromium.chrome.test.util.ChromeRestriction; import org.chromium.chrome.test.util.InfoBarUtil; import org.chromium.chrome.test.util.TranslateUtil;
import org.chromium.base.test.util.*; import org.chromium.chrome.browser.infobar.*; import org.chromium.chrome.test.util.*;
[ "org.chromium.base", "org.chromium.chrome" ]
org.chromium.base; org.chromium.chrome;
78,253
EReference getCallList_AsynchCall();
EReference getCallList_AsynchCall();
/** * Returns the meta object for the containment reference list '{@link lqn.CallList#getAsynchCall <em>Asynch Call</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Asynch Call</em>'. * @see lqn.CallList#getAsynchCall() * @see #getCallList() * @generated */
Returns the meta object for the containment reference list '<code>lqn.CallList#getAsynchCall Asynch Call</code>'.
getCallList_AsynchCall
{ "repo_name": "aciancone/klapersuite", "path": "klapersuite.metamodel.lqn/src/lqn/LqnPackage.java", "license": "epl-1.0", "size": 116938 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,131,675
protected void connect(InetAddress address, int port) throws IOException { this.port = port; this.address = address; try { connectToAddress(address, port, timeout); return; } catch (IOException e) { // everything failed close(); throw e; } }
void function(InetAddress address, int port) throws IOException { this.port = port; this.address = address; try { connectToAddress(address, port, timeout); return; } catch (IOException e) { close(); throw e; } }
/** * Creates a socket and connects it to the specified address on * the specified port. * @param address the address * @param port the specified port */
Creates a socket and connects it to the specified address on the specified port
connect
{ "repo_name": "universsky/openjdk", "path": "jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java", "license": "gpl-2.0", "size": 23431 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,763,306
public ServiceFuture<VpnGatewayInner> beginUpdateTagsAsync(String resourceGroupName, String gatewayName, Map<String, String> tags, final ServiceCallback<VpnGatewayInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); }
ServiceFuture<VpnGatewayInner> function(String resourceGroupName, String gatewayName, Map<String, String> tags, final ServiceCallback<VpnGatewayInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, gatewayName, tags), serviceCallback); }
/** * Updates virtual wan vpn gateway tags. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param tags Resource tags. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Updates virtual wan vpn gateway tags
beginUpdateTagsAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/implementation/VpnGatewaysInner.java", "license": "mit", "size": 120434 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture", "java.util.Map" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.Map;
import com.microsoft.rest.*; import java.util.*;
[ "com.microsoft.rest", "java.util" ]
com.microsoft.rest; java.util;
2,533,474
public RowSet findOutputRowSet(String targetStep) throws KettleStepException { // Check to see that "targetStep" only runs in a single copy // Otherwise you'll see problems during execution. // StepMeta targetStepMeta = transMeta.findStep(targetStep); if (targetStepMeta==null) { throw new KettleStepException(BaseMessages.getString(PKG, "BaseStep.Exception.TargetStepToWriteToDoesntExist", targetStep)); } if (targetStepMeta.getCopies()>1) { throw new KettleStepException(BaseMessages.getString(PKG, "BaseStep.Exception.TargetStepToWriteToCantRunInMultipleCopies", targetStep, Integer.toString(targetStepMeta.getCopies()))); } return findOutputRowSet(getStepname(), getCopy(), targetStep, 0); }
RowSet function(String targetStep) throws KettleStepException { if (targetStepMeta==null) { throw new KettleStepException(BaseMessages.getString(PKG, STR, targetStep)); } if (targetStepMeta.getCopies()>1) { throw new KettleStepException(BaseMessages.getString(PKG, STR, targetStep, Integer.toString(targetStepMeta.getCopies()))); } return findOutputRowSet(getStepname(), getCopy(), targetStep, 0); }
/** * Find output row set. * * @param targetStep the target step * @return the row set * @throws KettleStepException the kettle step exception */
Find output row set
findOutputRowSet
{ "repo_name": "bsspirit/kettle-4.4.0-stable", "path": "src/org/pentaho/di/trans/step/BaseStep.java", "license": "apache-2.0", "size": 116654 }
[ "org.pentaho.di.core.RowSet", "org.pentaho.di.core.exception.KettleStepException", "org.pentaho.di.i18n.BaseMessages" ]
import org.pentaho.di.core.RowSet; import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.core.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.i18n.*;
[ "org.pentaho.di" ]
org.pentaho.di;
896,650
@Test public void snapshotClusterWithNullNodePools() { Cluster emptyCluster = new Cluster().setNodePools(null); ClusterSnapshot snapshot = new ClusterSnapshotter(this.mockedClient, emptyCluster).call(); assertThat(snapshot, is(new ClusterSnapshot(emptyCluster, null, UtcTime.now()))); // verify that no API calls were needed verifyZeroInteractions(this.mockedClient); }
void function() { Cluster emptyCluster = new Cluster().setNodePools(null); ClusterSnapshot snapshot = new ClusterSnapshotter(this.mockedClient, emptyCluster).call(); assertThat(snapshot, is(new ClusterSnapshot(emptyCluster, null, UtcTime.now()))); verifyZeroInteractions(this.mockedClient); }
/** * {@link Cluster} can lack node pools (for example, while it is being * created). In such cases, the snapshotter should just return an empty * {@link ClusterSnapshot}. */
<code>Cluster</code> can lack node pools (for example, while it is being created). In such cases, the snapshotter should just return an empty <code>ClusterSnapshot</code>
snapshotClusterWithNullNodePools
{ "repo_name": "Eeemil/scale.cloudpool", "path": "google/container/src/test/java/com/elastisys/scale/cloudpool/google/container/TestClusterSnapshotter.java", "license": "apache-2.0", "size": 6000 }
[ "com.elastisys.scale.cloudpool.google.container.client.ClusterSnapshot", "com.elastisys.scale.commons.util.time.UtcTime", "com.google.api.services.container.model.Cluster", "org.hamcrest.CoreMatchers", "org.junit.Assert", "org.mockito.Mockito" ]
import com.elastisys.scale.cloudpool.google.container.client.ClusterSnapshot; import com.elastisys.scale.commons.util.time.UtcTime; import com.google.api.services.container.model.Cluster; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.mockito.Mockito;
import com.elastisys.scale.cloudpool.google.container.client.*; import com.elastisys.scale.commons.util.time.*; import com.google.api.services.container.model.*; import org.hamcrest.*; import org.junit.*; import org.mockito.*;
[ "com.elastisys.scale", "com.google.api", "org.hamcrest", "org.junit", "org.mockito" ]
com.elastisys.scale; com.google.api; org.hamcrest; org.junit; org.mockito;
28,930
private void tdsOrderByToken() throws IOException { // Skip this packet type int pktLen = in.readShort(); in.skip(pktLen); }
void function() throws IOException { int pktLen = in.readShort(); in.skip(pktLen); }
/** * Process an order by token. * <p>Sent to describe columns in an order by clause. * @throws IOException */
Process an order by token. Sent to describe columns in an order by clause
tdsOrderByToken
{ "repo_name": "kassak/jtds", "path": "src/main/net/sourceforge/jtds/jdbc/TdsCore.java", "license": "lgpl-2.1", "size": 169087 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
191,382
public static void renderAutoScrollHiddenInput(FacesContext facesContext, ResponseWriter writer) throws IOException { writer.startElement(HTML.INPUT_ELEM, null); writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null); writer.writeAttribute(HTML.NAME_ATTR, AUTO_SCROLL_PARAM, null); writer.endElement(HTML.INPUT_ELEM); }
static void function(FacesContext facesContext, ResponseWriter writer) throws IOException { writer.startElement(HTML.INPUT_ELEM, null); writer.writeAttribute(HTML.TYPE_ATTR, STR, null); writer.writeAttribute(HTML.NAME_ATTR, AUTO_SCROLL_PARAM, null); writer.endElement(HTML.INPUT_ELEM); }
/** * Renders the hidden form input that is necessary for the autoscroll feature. */
Renders the hidden form input that is necessary for the autoscroll feature
renderAutoScrollHiddenInput
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java", "license": "epl-1.0", "size": 26012 }
[ "java.io.IOException", "javax.faces.context.FacesContext", "javax.faces.context.ResponseWriter" ]
import java.io.IOException; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter;
import java.io.*; import javax.faces.context.*;
[ "java.io", "javax.faces" ]
java.io; javax.faces;
2,224,362
@Override public final Object lookup(Name name) throws NamingException { return lookup(name.toString()); }
final Object function(Name name) throws NamingException { return lookup(name.toString()); }
/** * Retrieves the named object. If name is empty, returns a new instance * of this context (which represents the same naming context as this * context, but its environment may be modified independently and it may * be accessed concurrently). * * @param name the name of the object to look up * @return the object bound to name * @exception NamingException if a naming exception is encountered */
Retrieves the named object. If name is empty, returns a new instance of this context (which represents the same naming context as this context, but its environment may be modified independently and it may be accessed concurrently)
lookup
{ "repo_name": "GazeboHub/ghub-portal-doc", "path": "doc/modelio/GHub Portal/mda/JavaDesigner/res/java/tomcat/java/org/apache/naming/resources/BaseDirContext.java", "license": "epl-1.0", "size": 61067 }
[ "javax.naming.Name", "javax.naming.NamingException" ]
import javax.naming.Name; import javax.naming.NamingException;
import javax.naming.*;
[ "javax.naming" ]
javax.naming;
89,683
public void testEquals() { DefaultCategoryDataset d1 = new DefaultCategoryDataset(); d1.setValue(23.4, "R1", "C1"); DefaultCategoryDataset d2 = new DefaultCategoryDataset(); d2.setValue(23.4, "R1", "C1"); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1.setValue(36.5, "R1", "C2"); assertFalse(d1.equals(d2)); d2.setValue(36.5, "R1", "C2"); assertTrue(d1.equals(d2)); d1.setValue(null, "R1", "C1"); assertFalse(d1.equals(d2)); d2.setValue(null, "R1", "C1"); assertTrue(d1.equals(d2)); }
void function() { DefaultCategoryDataset d1 = new DefaultCategoryDataset(); d1.setValue(23.4, "R1", "C1"); DefaultCategoryDataset d2 = new DefaultCategoryDataset(); d2.setValue(23.4, "R1", "C1"); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1.setValue(36.5, "R1", "C2"); assertFalse(d1.equals(d2)); d2.setValue(36.5, "R1", "C2"); assertTrue(d1.equals(d2)); d1.setValue(null, "R1", "C1"); assertFalse(d1.equals(d2)); d2.setValue(null, "R1", "C1"); assertTrue(d1.equals(d2)); }
/** * Confirm that the equals method can distinguish all the required fields. */
Confirm that the equals method can distinguish all the required fields
testEquals
{ "repo_name": "integrated/jfreechart", "path": "tests/org/jfree/data/category/junit/DefaultCategoryDatasetTests.java", "license": "lgpl-2.1", "size": 12218 }
[ "org.jfree.data.category.DefaultCategoryDataset" ]
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.category.*;
[ "org.jfree.data" ]
org.jfree.data;
1,830,430
public void handleEvent(Event evt) { handleDOMChildNodeRemovedEvent((MutationEvent)evt); } } protected DOMSubtreeModifiedEventListener subtreeModifiedEventListener; protected class DOMSubtreeModifiedEventListener implements EventListener {
void function(Event evt) { handleDOMChildNodeRemovedEvent((MutationEvent)evt); } } protected DOMSubtreeModifiedEventListener subtreeModifiedEventListener; protected class DOMSubtreeModifiedEventListener implements EventListener {
/** * Handles 'DOMNodeRemoved' event type. */
Handles 'DOMNodeRemoved' event type
handleEvent
{ "repo_name": "sflyphotobooks/crp-batik", "path": "sources/org/apache/batik/bridge/SVGTextElementBridge.java", "license": "apache-2.0", "size": 114566 }
[ "org.w3c.dom.events.Event", "org.w3c.dom.events.EventListener", "org.w3c.dom.events.MutationEvent" ]
import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.MutationEvent;
import org.w3c.dom.events.*;
[ "org.w3c.dom" ]
org.w3c.dom;
2,201,973
public static MozuUrl assignDiscountUrl(String couponSetCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts"); formatter.formatUrl("couponSetCode", couponSetCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
static MozuUrl function(String couponSetCode) { UrlFormatter formatter = new UrlFormatter(STR); formatter.formatUrl(STR, couponSetCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
/** * Get Resource Url for AssignDiscount * @param couponSetCode The unique identifier of the coupon set. * @return String Resource Url */
Get Resource Url for AssignDiscount
assignDiscountUrl
{ "repo_name": "Mozu/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/couponsets/AssignedDiscountUrl.java", "license": "mit", "size": 2036 }
[ "com.mozu.api.MozuUrl", "com.mozu.api.utils.UrlFormatter" ]
import com.mozu.api.MozuUrl; import com.mozu.api.utils.UrlFormatter;
import com.mozu.api.*; import com.mozu.api.utils.*;
[ "com.mozu.api" ]
com.mozu.api;
177,838
public final boolean weakCompareAndSet(int i, double expect, double update) { return longs.weakCompareAndSet(i, doubleToRawLongBits(expect), doubleToRawLongBits(update)); }
final boolean function(int i, double expect, double update) { return longs.weakCompareAndSet(i, doubleToRawLongBits(expect), doubleToRawLongBits(update)); }
/** * Atomically sets the element at position {@code i} to the given * updated value * if the current value is <a href="#bitEquals">bitwise equal</a> * to the expected value. * * <p>May <a * href="http://download.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html#Spurious"> * fail spuriously</a> * and does not provide ordering guarantees, so is only rarely an * appropriate alternative to {@code compareAndSet}. * * @param i the index * @param expect the expected value * @param update the new value * @return true if successful */
Atomically sets the element at position i to the given updated value if the current value is bitwise equal to the expected value. May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet
weakCompareAndSet
{ "repo_name": "geekboxzone/lollipop_external_guava", "path": "guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java", "license": "apache-2.0", "size": 8134 }
[ "java.lang.Double" ]
import java.lang.Double;
import java.lang.*;
[ "java.lang" ]
java.lang;
1,560,997
void run() throws BOMException;
void run() throws BOMException;
/** * Runs this action. * * @throws BOMException */
Runs this action
run
{ "repo_name": "aktion-hip/relations", "path": "org.elbe.relations/src/org/elbe/relations/db/IAction.java", "license": "gpl-3.0", "size": 1433 }
[ "org.elbe.relations.data.bom.BOMException" ]
import org.elbe.relations.data.bom.BOMException;
import org.elbe.relations.data.bom.*;
[ "org.elbe.relations" ]
org.elbe.relations;
2,501,759
public void existsAsync(GetIndexRequest request, RequestOptions options, ActionListener<Boolean> listener) { restHighLevelClient.performRequestAsync( request, IndicesRequestConverters::indicesExist, options, RestHighLevelClient::convertExistsResponse, listener, Collections.emptySet() ); }
void function(GetIndexRequest request, RequestOptions options, ActionListener<Boolean> listener) { restHighLevelClient.performRequestAsync( request, IndicesRequestConverters::indicesExist, options, RestHighLevelClient::convertExistsResponse, listener, Collections.emptySet() ); }
/** * Asynchronously checks if the index (indices) exists or not. * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html"> * Indices Exists API on elastic.co</a> * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion */
Asynchronously checks if the index (indices) exists or not. See Indices Exists API on elastic.co
existsAsync
{ "repo_name": "strapdata/elassandra", "path": "client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java", "license": "apache-2.0", "size": 103949 }
[ "java.util.Collections", "org.elasticsearch.action.ActionListener", "org.elasticsearch.client.indices.GetIndexRequest" ]
import java.util.Collections; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.indices.GetIndexRequest;
import java.util.*; import org.elasticsearch.action.*; import org.elasticsearch.client.indices.*;
[ "java.util", "org.elasticsearch.action", "org.elasticsearch.client" ]
java.util; org.elasticsearch.action; org.elasticsearch.client;
1,888,950
private void addNewSourceFile(String finalFilename, String sourceFilename) throws FileNotFoundException { File sourceFile = new File(sourceDir, sourceFilename); addNewSourceFile(finalFilename, sourceFile); }
void function(String finalFilename, String sourceFilename) throws FileNotFoundException { File sourceFile = new File(sourceDir, sourceFilename); addNewSourceFile(finalFilename, sourceFile); }
/** * Logs an addition of a new source file. * * @param finalFilename the final file name * @param sourceFilename the source file name * @throws FileNotFoundException when the given source file does not exist */
Logs an addition of a new source file
addNewSourceFile
{ "repo_name": "agabrys/minify-maven-plugin", "path": "src/main/java/com/samaxes/maven/minify/plugin/ProcessFilesTask.java", "license": "apache-2.0", "size": 13295 }
[ "java.io.File", "java.io.FileNotFoundException" ]
import java.io.File; import java.io.FileNotFoundException;
import java.io.*;
[ "java.io" ]
java.io;
1,477,752
public static String getXML(final NodeInfo nodeInfo) { try { final StringWriter sw = new StringWriter(); final StreamResult sr = new StreamResult(sw); QueryResult.serialize(nodeInfo, sr, getOutputProperties()); return sw.toString(); } catch (final XPathException | RuntimeException e) { throw new ProcessException(e.getMessage()); } }
static String function(final NodeInfo nodeInfo) { try { final StringWriter sw = new StringWriter(); final StreamResult sr = new StreamResult(sw); QueryResult.serialize(nodeInfo, sr, getOutputProperties()); return sw.toString(); } catch (final XPathException RuntimeException e) { throw new ProcessException(e.getMessage()); } }
/** * Creates an XML string from the event stack captured for the matched * record. */
Creates an XML string from the event stack captured for the matched record
getXML
{ "repo_name": "gchq/stroom", "path": "stroom-pipeline/src/main/java/stroom/pipeline/xml/event/EventListUtils.java", "license": "apache-2.0", "size": 7452 }
[ "java.io.StringWriter", "javax.xml.transform.stream.StreamResult", "net.sf.saxon.om.NodeInfo", "net.sf.saxon.query.QueryResult", "net.sf.saxon.trans.XPathException" ]
import java.io.StringWriter; import javax.xml.transform.stream.StreamResult; import net.sf.saxon.om.NodeInfo; import net.sf.saxon.query.QueryResult; import net.sf.saxon.trans.XPathException;
import java.io.*; import javax.xml.transform.stream.*; import net.sf.saxon.om.*; import net.sf.saxon.query.*; import net.sf.saxon.trans.*;
[ "java.io", "javax.xml", "net.sf.saxon" ]
java.io; javax.xml; net.sf.saxon;
384,599
public void setContextValves(Collection<? extends Valve> contextValves) { Assert.notNull(contextValves, "Valves must not be null"); this.contextValves = new ArrayList<Valve>(contextValves); }
void function(Collection<? extends Valve> contextValves) { Assert.notNull(contextValves, STR); this.contextValves = new ArrayList<Valve>(contextValves); }
/** * Set {@link Valve}s that should be applied to the Tomcat {@link Context}. Calling * this method will replace any existing valves. * @param contextValves the valves to set */
Set <code>Valve</code>s that should be applied to the Tomcat <code>Context</code>. Calling this method will replace any existing valves
setContextValves
{ "repo_name": "jvz/spring-boot", "path": "spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java", "license": "apache-2.0", "size": 30815 }
[ "java.util.ArrayList", "java.util.Collection", "org.apache.catalina.Valve", "org.springframework.util.Assert" ]
import java.util.ArrayList; import java.util.Collection; import org.apache.catalina.Valve; import org.springframework.util.Assert;
import java.util.*; import org.apache.catalina.*; import org.springframework.util.*;
[ "java.util", "org.apache.catalina", "org.springframework.util" ]
java.util; org.apache.catalina; org.springframework.util;
70,023
boolean assertConnection() { try { if (getDatabaseConnection() == null || getDatabaseConnection().getConnection() == null) { return error(loc("no-current-connection")); } if (getDatabaseConnection().getConnection().isClosed()) { return error(loc("connection-is-closed")); } } catch (SQLException sqle) { return error(loc("no-current-connection")); } return true; }
boolean assertConnection() { try { if (getDatabaseConnection() == null getDatabaseConnection().getConnection() == null) { return error(loc(STR)); } if (getDatabaseConnection().getConnection().isClosed()) { return error(loc(STR)); } } catch (SQLException sqle) { return error(loc(STR)); } return true; }
/** * Assert that we have an active, living connection. Print * an error message if we do not. * * @return true if there is a current, active connection */
Assert that we have an active, living connection. Print an error message if we do not
assertConnection
{ "repo_name": "BUPTAnderson/apache-hive-2.1.1-src", "path": "beeline/src/java/org/apache/hive/beeline/BeeLine.java", "license": "apache-2.0", "size": 69017 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
343,339
public void initMetaData() { EiColumn eiColumn; eiColumn = new EiColumn("segNo"); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(20); eiColumn.setDescName("业务单元代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("sDraftId"); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(20); eiColumn.setDescName("销售草约号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("sDraftSubId"); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(23); eiColumn.setDescName("草约子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("sDraftSubStatus"); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(23); eiColumn.setDescName("草约子状态"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("quoteType"); eiColumn.setFieldLength(23); eiColumn.setDescName("挂牌方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("contractId"); eiColumn.setFieldLength(20); eiColumn.setDescName("销售订单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("contractSubid"); eiColumn.setFieldLength(23); eiColumn.setDescName("订单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("businessType"); eiColumn.setFieldLength(2); eiColumn.setDescName("合同类型"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("buyingContractSubid"); eiColumn.setFieldLength(23); eiColumn.setDescName("购销合同子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("xsContractSubid"); eiColumn.setFieldLength(23); eiColumn.setDescName("销售订单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("internalSegNo"); eiColumn.setFieldLength(20); eiColumn.setDescName("内往业务单元代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("s_providerContNum"); eiColumn.setFieldLength(50); eiColumn.setDescName("供应商销售订单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("s_providerContSubnum"); eiColumn.setFieldLength(50); eiColumn.setDescName("供应商销售子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("contractSubstatus"); eiColumn.setFieldLength(2); eiColumn.setDescName("子项状态"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("p_contractSubid"); eiColumn.setFieldLength(23); eiColumn.setDescName("采购订单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("areaCode"); eiColumn.setFieldLength(10); eiColumn.setDescName("地区代码(区域)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("goodSegNo"); eiColumn.setFieldLength(20); eiColumn.setDescName("货号业务单元代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("goodId"); eiColumn.setFieldLength(10); eiColumn.setDescName("货号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("productTypeId"); eiColumn.setFieldLength(10); eiColumn.setDescName("品种代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("shopsign"); eiColumn.setFieldLength(100); eiColumn.setDescName("牌号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("techStandard"); eiColumn.setFieldLength(200); eiColumn.setDescName("技术标准"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("producingAreaCode"); eiColumn.setFieldLength(10); eiColumn.setDescName("产地代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("qualityGrade"); eiColumn.setFieldLength(10); eiColumn.setDescName("质量等级"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("goodFrom"); eiColumn.setFieldLength(10); eiColumn.setDescName("货物来源"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("spec"); eiColumn.setFieldLength(300); eiColumn.setDescName("规格"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("saleType"); eiColumn.setFieldLength(10); eiColumn.setDescName("销售方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("saleModule"); eiColumn.setFieldLength(10); eiColumn.setDescName("销售模式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("warehouseFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("是否指定配货仓库"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("resourceType"); eiColumn.setFieldLength(10); eiColumn.setDescName("配货资源性质"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("weightMethod"); eiColumn.setFieldLength(10); eiColumn.setDescName("计重方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("valuationType"); eiColumn.setFieldLength(10); eiColumn.setDescName("计价方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("weightQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("订货重量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("quantityQty"); eiColumn.setType("N"); eiColumn.setScaleLength(0); eiColumn.setFieldLength(18); eiColumn.setDescName("订货数量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("assignWeightQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("配货重量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("assignQuantityQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("配货数量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("weightUnit"); eiColumn.setFieldLength(10); eiColumn.setDescName("重量单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("quantityUnit"); eiColumn.setFieldLength(10); eiColumn.setDescName("数量单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("unitConversion"); eiColumn.setType("N"); eiColumn.setScaleLength(4); eiColumn.setFieldLength(10); eiColumn.setDescName("重量数量转化关系"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("bpFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("特价标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("directFavor"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("直供优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("agencyFavor"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("代理优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("hockmeteFavor"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("积分优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("hockmeteNum"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("使用积分数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("periodId"); eiColumn.setFieldLength(10); eiColumn.setDescName("积分期间"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("otherFavor1"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("其他优惠1"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("otherFavor2"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("其他优惠2"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("discountFavor"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("折扣优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("freightFavor"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("运杂费加价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("overloadFee"); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName("预收超发费"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("deliverType"); eiColumn.setFieldLength(10); eiColumn.setDescName("交货方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("freightSettleType"); eiColumn.setFieldLength(10); eiColumn.setDescName("运费结算方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("freightPrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("运杂费单价(价外)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("outSettleType"); eiColumn.setFieldLength(10); eiColumn.setDescName("出库费结算方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("outPrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("出库费单价(价外)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("machineTrustFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("加工委托标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("machineFee"); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName("加工费金额(价外)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("otherPrice1"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("其他费用单价1(价外)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("otherPrice2"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("其他费用单价2(价外)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("otherAmount"); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName("价外费用金额"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("taxRate"); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(3); eiColumn.setDescName("税率"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("basePrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("基价(含税)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("publicPrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("挂牌价格(含税)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("salePrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("销售价格"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("salePriceAt"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("销售价格(含税)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("qulityObjectionFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("可提质量异议标志"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("addContent"); eiColumn.setFieldLength(1000); eiColumn.setDescName("附加内容"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("specialDesc"); eiColumn.setFieldLength(1000); eiColumn.setDescName("特殊说明"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("packingRequire"); eiColumn.setFieldLength(500); eiColumn.setDescName("包装要求"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("equalPiece"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("等片包装数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("moreorlessUp"); eiColumn.setType("N"); eiColumn.setScaleLength(3); eiColumn.setFieldLength(4); eiColumn.setDescName("溢短装上限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("moreorlessDown"); eiColumn.setType("N"); eiColumn.setScaleLength(3); eiColumn.setFieldLength(4); eiColumn.setDescName("溢短装下限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("eachQuantityStandard"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("目标件重"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("upEachQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("捆包上限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("downEachQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("捆包下限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("copyNCertificate"); eiColumn.setType("N"); eiColumn.setScaleLength(0); eiColumn.setFieldLength(2); eiColumn.setDescName("质保书份数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserId"); eiColumn.setFieldLength(30); eiColumn.setDescName("最终用户编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserName"); eiColumn.setFieldLength(100); eiColumn.setDescName("最终用户名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserAddr"); eiColumn.setFieldLength(100); eiColumn.setDescName("最终用户地址"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserRespnder"); eiColumn.setFieldLength(20); eiColumn.setDescName("最终用户联系人"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserTele"); eiColumn.setFieldLength(30); eiColumn.setDescName("最终用户联系电话"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserFax"); eiColumn.setFieldLength(30); eiColumn.setDescName("最终用户传真"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserZipcode"); eiColumn.setFieldLength(6); eiColumn.setDescName("最终用户邮政编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeId"); eiColumn.setFieldLength(20); eiColumn.setDescName("收货单位编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeName"); eiColumn.setFieldLength(80); eiColumn.setDescName("收货单位名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeAddr"); eiColumn.setFieldLength(80); eiColumn.setDescName("收货单位地址"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeRespnder"); eiColumn.setFieldLength(20); eiColumn.setDescName("收货单位联系人"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeTele"); eiColumn.setFieldLength(20); eiColumn.setDescName("收货单位联系电话"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeFax"); eiColumn.setFieldLength(40); eiColumn.setDescName("收货单位传真"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consigneeZipcode"); eiColumn.setFieldLength(20); eiColumn.setDescName("收货单位邮政编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("deliveryDate"); eiColumn.setDescName("交货日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("deliverSite"); eiColumn.setFieldLength(200); eiColumn.setDescName("交货地点"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transType"); eiColumn.setFieldLength(10); eiColumn.setDescName("运输方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transRequire"); eiColumn.setFieldLength(200); eiColumn.setDescName("装运要求"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("rainCoatFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("加盖雨布标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserStationId"); eiColumn.setFieldLength(20); eiColumn.setDescName("整车到站编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserStationSeq"); eiColumn.setFieldLength(20); eiColumn.setDescName("整车到站编码序号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserStation"); eiColumn.setFieldLength(80); eiColumn.setDescName("整车到站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserPortId"); eiColumn.setFieldLength(20); eiColumn.setDescName("水运到港编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserPortSeq"); eiColumn.setFieldLength(20); eiColumn.setDescName("水运到港编码序号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("actuserPort"); eiColumn.setFieldLength(80); eiColumn.setDescName("水运到港"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("railwayShareLineId"); eiColumn.setFieldLength(20); eiColumn.setDescName("零担到站编码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("railwayShareLineSeq"); eiColumn.setFieldLength(20); eiColumn.setDescName("零担到站编码序号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("railwayShareLine"); eiColumn.setFieldLength(80); eiColumn.setDescName("零担到站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transLineNo"); eiColumn.setFieldLength(20); eiColumn.setDescName("装运线代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transLineName"); eiColumn.setFieldLength(80); eiColumn.setDescName("装运线名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("permitConsignFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("准发标志"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("permitConsignPerson"); eiColumn.setFieldLength(30); eiColumn.setDescName("准发人员"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("permitConsignDate"); eiColumn.setDescName("准发日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("billQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("累计开单量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("outQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("累计出库量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("settleQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("累计结算量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("billExpiateQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("提单补偿量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("contractExpiateQty"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("订单补偿量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("remark"); eiColumn.setFieldLength(1000); eiColumn.setDescName("备注"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("modiPerson"); eiColumn.setFieldLength(30); eiColumn.setDescName("更新人"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("modiDate"); eiColumn.setDescName("更新日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("startStation"); eiColumn.setFieldLength(80); eiColumn.setDescName("始发站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("invoiceTitle"); eiColumn.setFieldLength(200); eiColumn.setDescName("运费发票抬头"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("tproviderId"); eiColumn.setFieldLength(20); eiColumn.setDescName("交单指定运输单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("documentRemark"); eiColumn.setFieldLength(200); eiColumn.setDescName("交单备注"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("depositOrdFlag"); eiColumn.setFieldLength(1); eiColumn.setDescName("直发标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("oldSalePrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("对外销售价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("insuranceCompany"); eiColumn.setFieldLength(100); eiColumn.setDescName("保险公司"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("insurancePriceJw"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("价外保险费单价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("insurancePriceJn"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("价内保险费单价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("insuranceRate"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("保险费率(默认0.008)"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("freightAmount"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("价内运费"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("overloadPrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("超发费单价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("wproviderId"); eiColumn.setFieldLength(20); eiColumn.setDescName("目的仓库"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("settleLock"); eiColumn.setFieldLength(6); eiColumn.setDescName("子项封锁"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transferUnit"); eiColumn.setFieldLength(10); eiColumn.setDescName("转换单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transferWeight"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("转换量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transferPrice"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("转换不含税单价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("transConfirmDate"); eiColumn.setDescName("储运指定日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("insuranceFlag"); eiColumn.setFieldLength(2); eiColumn.setDescName("保险费标记(空或10:默认规则,00不收保险费,20价内,30价外 )"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("webContractId"); eiColumn.setFieldLength(20); eiColumn.setDescName("东钢订单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("webContractSubid"); eiColumn.setFieldLength(20); eiColumn.setDescName("东钢订单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("publicWproviderId"); eiColumn.setFieldLength(20); eiColumn.setDescName("挂牌仓库代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("storageSite"); eiColumn.setFieldLength(20); eiColumn.setDescName("挂牌仓库代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("productTypeName"); eiColumn.setFieldLength(100); eiColumn.setDescName("品种名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("producingAreaName"); eiColumn.setFieldLength(100); eiColumn.setDescName("产地名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("reduceApply"); eiColumn.setFieldLength(2); eiColumn.setDescName("降价审批code(空或00:无降价,10已提交,15审批通过,20审批不通过 )"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("reduceApplyDesc"); eiColumn.setFieldLength(20); eiColumn.setDescName("降价审批"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("productId"); eiColumn.setFieldLength(20); eiColumn.setDescName("资源号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("rowid"); eiColumn.setFieldLength(100); eiColumn.setDescName(""); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("saleTypeName"); eiColumn.setFieldLength(25); eiColumn.setDescName("挂牌方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("packId"); eiColumn.setFieldLength(30); eiColumn.setDescName(""); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("palletXsId"); eiColumn.setFieldLength(30); eiColumn.setDescName(""); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("deliveryWeight"); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName("送货重量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("deliveryAmount"); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName("送货金额"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn("consignmentFlag"); eiColumn.setFieldLength(2); eiColumn.setDescName("暂寄标记"); eiMetadata.addMeta(eiColumn); } public STXS0202() { initMetaData(); }
void function() { EiColumn eiColumn; eiColumn = new EiColumn("segNo"); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(20); eiColumn.setDescName("销售草约号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(23); eiColumn.setDescName("草约子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setPrimaryKey(true); eiColumn.setFieldLength(23); eiColumn.setDescName("草约子状态"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(23); eiColumn.setDescName("挂牌方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("销售订单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(23); eiColumn.setDescName("订单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(2); eiColumn.setDescName("合同类型"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(23); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(23); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(50); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(50); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(2); eiColumn.setDescName("子项状态"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(23); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("货号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("品种代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName("牌号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(200); eiColumn.setDescName("技术标准"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("产地代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("质量等级"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("货物来源STRspec"); eiColumn.setFieldLength(300); eiColumn.setDescName("规格"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("销售方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("销售模式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("计重方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("计价方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR订货重量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(0); eiColumn.setFieldLength(18); eiColumn.setDescName("订货数量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR配货重量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR配货数量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("重量单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("数量单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(4); eiColumn.setFieldLength(10); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName("特价标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR直供优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR代理优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR积分优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR使用积分数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("积分期间"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR其他优惠1"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR其他优惠2"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR折扣优惠"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR运杂费加价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR预收超发费"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("交货方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(14); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(2); eiColumn.setFieldLength(3); eiColumn.setDescName("税率"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR销售价格"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1000); eiColumn.setDescName("附加内容"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1000); eiColumn.setDescName("特殊说明"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(500); eiColumn.setDescName("包装要求"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR等片包装数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(3); eiColumn.setFieldLength(4); eiColumn.setDescName("溢短装上限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(3); eiColumn.setFieldLength(4); eiColumn.setDescName("溢短装下限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR目标件重"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR捆包上限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR捆包下限"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(0); eiColumn.setFieldLength(2); eiColumn.setDescName("质保书份数"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(30); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(30); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(30); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(6); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(40); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setDescName("交货日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(200); eiColumn.setDescName("交货地点"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("运输方式"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(200); eiColumn.setDescName("装运要求"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName("整车到站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName("水运到港"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName("零担到站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("装运线代码"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName("装运线名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName("准发标志"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(30); eiColumn.setDescName("准发人员"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setDescName("准发日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR累计开单量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR累计出库量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR累计结算量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR提单补偿量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR订单补偿量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1000); eiColumn.setDescName("备注"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(30); eiColumn.setDescName("更新人"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setDescName("更新日期"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(80); eiColumn.setDescName("始发站"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(200); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(200); eiColumn.setDescName("交单备注"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(1); eiColumn.setDescName("直发标记"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR对外销售价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName("保险公司"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR价内运费"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR超发费单价"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("目的仓库"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(6); eiColumn.setDescName("子项封锁"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(10); eiColumn.setDescName("转换单位"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("NSTR转换量"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setType("N"); eiColumn.setScaleLength(6); eiColumn.setFieldLength(18); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(2); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("东钢订单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName("品种名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(100); eiColumn.setDescName("产地名称"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(2); eiColumn.setDescName(STR); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("降价审批"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(20); eiColumn.setDescName("资源号STRrowid"); eiColumn.setFieldLength(100); eiColumn.setDescName(STRsaleTypeNameSTR挂牌方式STRpackId"); eiColumn.setFieldLength(30); eiColumn.setDescName(STRpalletXsId"); eiColumn.setFieldLength(30); eiColumn.setDescName(STRdeliveryWeightSTRNSTR送货重量STRdeliveryAmountSTRNSTR送货金额STRconsignmentFlagSTR暂寄标记"); eiMetadata.addMeta(eiColumn); } STXS0202() { function(); }
/** * initialize the metadata */
initialize the metadata
initMetaData
{ "repo_name": "stserp/erp1", "path": "source/src/com/baosight/sts/st/xs/domain/STXS0202.java", "license": "apache-2.0", "size": 123037 }
[ "com.baosight.iplat4j.core.ei.EiColumn" ]
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.ei.*;
[ "com.baosight.iplat4j" ]
com.baosight.iplat4j;
841,582
private JTextField getTxtUser() { if (txtUser == null) { txtUser = new JTextField(); txtUser.setPreferredSize(new java.awt.Dimension(170, 19)); txtUser.setName("txtUser"); } return txtUser; }
JTextField function() { if (txtUser == null) { txtUser = new JTextField(); txtUser.setPreferredSize(new java.awt.Dimension(170, 19)); txtUser.setName(STR); } return txtUser; }
/** * This method initializes txtUser * * @return javax.swing.JTextField */
This method initializes txtUser
getTxtUser
{ "repo_name": "iCarto/siga", "path": "appgvSIG/src/com/iver/cit/gvsig/vectorialdb/ConnectionPanel.java", "license": "gpl-3.0", "size": 23674 }
[ "java.awt.Dimension", "javax.swing.JTextField" ]
import java.awt.Dimension; import javax.swing.JTextField;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
520,716
public Index getIndex(int id) { if (id >= indices.length) { return null; } return indices[id]; }
Index function(int id) { if (id >= indices.length) { return null; } return indices[id]; }
/** * Get a single index from the cache. * @param id The id of the index to get. * @return The index instance. */
Get a single index from the cache
getIndex
{ "repo_name": "Displee/RS2-Cache-Library", "path": "src/main/java/org/displee/CacheLibrary.java", "license": "mit", "size": 11677 }
[ "org.displee.cache.index.Index" ]
import org.displee.cache.index.Index;
import org.displee.cache.index.*;
[ "org.displee.cache" ]
org.displee.cache;
2,014,499
public void clear(); public static class Entry { public byte[] data; public String etag; public long serverDate; public long lastModified; public long ttl; public long softTtl; public Map<String, String> responseHeaders = Collections.emptyMap();
void function(); public static class Entry { public byte[] data; public String etag; public long serverDate; public long lastModified; public long ttl; public long softTtl; public Map<String, String> responseHeaders = Collections.emptyMap();
/** * Empties the cache. */
Empties the cache
clear
{ "repo_name": "YoungPeanut/YoungNews", "path": "youngnews/src/main/java/com/android/volley/Cache.java", "license": "apache-2.0", "size": 2932 }
[ "java.util.Collections", "java.util.Map" ]
import java.util.Collections; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,427,310
void setDueDate(String taskId, Date dueDate);
void setDueDate(String taskId, Date dueDate);
/** * Changes the due date of the task * * @param taskId * id of the task, cannot be null. * @param dueDate * the new due date for the task * @throws ActivitiException * when the task doesn't exist. */
Changes the due date of the task
setDueDate
{ "repo_name": "robsoncardosoti/flowable-engine", "path": "modules/flowable5-engine/src/main/java/org/activiti/engine/TaskService.java", "license": "apache-2.0", "size": 24405 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,779,623
public List<MBeanOperationInfo> getOperationList(Environment targetEnv) { setNeedReset(false); List<MBeanOperationInfo> operationList = new ArrayList<MBeanOperationInfo>(); if (targetEnv != null) { operationList.add(OP_CLEAN_INFO); operationList.add(OP_EVICT_INFO); operationList.add(OP_ENV_STAT_INFO); operationList.add(OP_DB_NAMES_INFO); operationList.add(OP_DB_STAT_INFO); boolean isTransactional = false; try { EnvironmentConfig config = targetEnv.getConfig(); isTransactional = config.getTransactional(); } catch (DatabaseException e) { return new ArrayList<MBeanOperationInfo>(); } if (isTransactional) { operationList.add(OP_CHECKPOINT_INFO); operationList.add(OP_TXN_STAT_INFO); } else { operationList.add(OP_SYNC_INFO); } } return operationList; }
List<MBeanOperationInfo> function(Environment targetEnv) { setNeedReset(false); List<MBeanOperationInfo> operationList = new ArrayList<MBeanOperationInfo>(); if (targetEnv != null) { operationList.add(OP_CLEAN_INFO); operationList.add(OP_EVICT_INFO); operationList.add(OP_ENV_STAT_INFO); operationList.add(OP_DB_NAMES_INFO); operationList.add(OP_DB_STAT_INFO); boolean isTransactional = false; try { EnvironmentConfig config = targetEnv.getConfig(); isTransactional = config.getTransactional(); } catch (DatabaseException e) { return new ArrayList<MBeanOperationInfo>(); } if (isTransactional) { operationList.add(OP_CHECKPOINT_INFO); operationList.add(OP_TXN_STAT_INFO); } else { operationList.add(OP_SYNC_INFO); } } return operationList; }
/** * Get mbean operation metadata for this environment. * * @param targetEnv The target JE environment. May be null if the * environment is not open. * @return List of MBeanOperationInfo describing available operations. */
Get mbean operation metadata for this environment
getOperationList
{ "repo_name": "prat0318/dbms", "path": "mini_dbms/je-5.0.103/src/com/sleepycat/je/jmx/JEMBeanHelper.java", "license": "mit", "size": 31637 }
[ "com.sleepycat.je.DatabaseException", "com.sleepycat.je.Environment", "com.sleepycat.je.EnvironmentConfig", "java.util.ArrayList", "java.util.List", "javax.management.MBeanOperationInfo" ]
import com.sleepycat.je.DatabaseException; import com.sleepycat.je.Environment; import com.sleepycat.je.EnvironmentConfig; import java.util.ArrayList; import java.util.List; import javax.management.MBeanOperationInfo;
import com.sleepycat.je.*; import java.util.*; import javax.management.*;
[ "com.sleepycat.je", "java.util", "javax.management" ]
com.sleepycat.je; java.util; javax.management;
885,170
private void readUsedComponent(CommonACAction dbac, VM_Bean vm, boolean isStatFilter, String orderBy) { Vector<CommonACBean> vAC = dbac.getAssociated(vmData.getCurationServlet().getConn(), vm.getVM_IDSEQ(), isStatFilter, orderBy); //set data to vm dbac.setUsedAttributes(vm, vAC, isStatFilter, null); }
void function(CommonACAction dbac, VM_Bean vm, boolean isStatFilter, String orderBy) { Vector<CommonACBean> vAC = dbac.getAssociated(vmData.getCurationServlet().getConn(), vm.getVM_IDSEQ(), isStatFilter, orderBy); dbac.setUsedAttributes(vm, vAC, isStatFilter, null); }
/** * action to read one used component at a time * @param dbac CommonACAction object action file common to all ACs * @param vm VM_Bean name of the vm bean * @param isStatFilter boolean to check if should the query filter the data by workflow status * @param orderBy String sort the query at the time of getting the data */
action to read one used component at a time
readUsedComponent
{ "repo_name": "NCIP/cadsr-cdecurate", "path": "src/gov/nih/nci/cadsr/cdecurate/tool/VMServlet.java", "license": "bsd-3-clause", "size": 44641 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
1,375,746
@GET @ResponseParser(ParseOptionsFromJsonResponse.class) @Path("/common/lookup/list") @QueryParams(keys = LOOKUP_LIST_KEY, values = "loadbalancer.datacenter") Set<Option> getDatacenters();
@ResponseParser(ParseOptionsFromJsonResponse.class) @Path(STR) @QueryParams(keys = LOOKUP_LIST_KEY, values = STR) Set<Option> getDatacenters();
/** * Retrieves the list of supported Datacenters to launch servers into. The objects will have * datacenter ID, name and description. In most cases, id or name will be used for * {@link #addLoadBalancer}. * * @return supported datacenters */
Retrieves the list of supported Datacenters to launch servers into. The objects will have datacenter ID, name and description. In most cases, id or name will be used for <code>#addLoadBalancer</code>
getDatacenters
{ "repo_name": "yanzhijun/jclouds-aliyun", "path": "providers/gogrid/src/main/java/org/jclouds/gogrid/features/GridLoadBalancerApi.java", "license": "apache-2.0", "size": 7370 }
[ "java.util.Set", "javax.ws.rs.Path", "org.jclouds.gogrid.domain.Option", "org.jclouds.gogrid.functions.ParseOptionsFromJsonResponse", "org.jclouds.rest.annotations.QueryParams", "org.jclouds.rest.annotations.ResponseParser" ]
import java.util.Set; import javax.ws.rs.Path; import org.jclouds.gogrid.domain.Option; import org.jclouds.gogrid.functions.ParseOptionsFromJsonResponse; import org.jclouds.rest.annotations.QueryParams; import org.jclouds.rest.annotations.ResponseParser;
import java.util.*; import javax.ws.rs.*; import org.jclouds.gogrid.domain.*; import org.jclouds.gogrid.functions.*; import org.jclouds.rest.annotations.*;
[ "java.util", "javax.ws", "org.jclouds.gogrid", "org.jclouds.rest" ]
java.util; javax.ws; org.jclouds.gogrid; org.jclouds.rest;
1,222,006
@Test public void test111AssignAccountMorgan() throws Exception { final String TEST_NAME = "test111AssignAccountMorgan"; TestUtil.displayTestTile(this, TEST_NAME); // GIVEN Task task = taskManager.createTaskInstance(ConsistencyTest.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); dummyAuditService.clear(); //prepare new OU in opendj Entry entry = openDJController.addEntryFromLdifFile(LDIF_CREATE_USERS_OU_FILENAME); PrismObject<UserType> user = repositoryService.getObject(UserType.class, USER_MORGAN_OID, null, result); display("User Morgan: ", user); PrismReference linkRef = user.findReference(UserType.F_LINK_REF); ExpressionType expression = new ExpressionType(); ObjectFactory of = new ObjectFactory(); RawType raw = new RawType(new PrimitiveXNode("uid=morgan,ou=users,dc=example,dc=com"), prismContext); JAXBElement val = of.createValue(raw); expression.getExpressionEvaluator().add(val); MappingType mapping = new MappingType(); mapping.setExpression(expression); ResourceAttributeDefinitionType attrDefType = new ResourceAttributeDefinitionType(); attrDefType.setRef(new ItemPathType(new ItemPath(getOpenDjSecondaryIdentifierQName()))); attrDefType.setOutbound(mapping); ConstructionType construction = new ConstructionType(); construction.getAttribute().add(attrDefType); construction.setResourceRef(ObjectTypeUtil.createObjectRef(resourceTypeOpenDjrepo)); AssignmentType assignment = new AssignmentType(); assignment.setConstruction(construction); ObjectDelta<UserType> userDelta = ObjectDelta.createModificationAddContainer(UserType.class, USER_MORGAN_OID, UserType.F_ASSIGNMENT, prismContext, assignment.asPrismContainerValue()); Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN TestUtil.displayWhen(TEST_NAME); modelService.executeChanges(deltas, null, task, result); // THEN TestUtil.displayThen(TEST_NAME); result.computeStatus(); // assertEquals("Expected handled error but got: " + result.getStatus(), OperationResultStatus.HANDLED_ERROR, result.getStatus()); PrismObject<UserType> userMorgan = modelService.getObject(UserType.class, USER_MORGAN_OID, null, task, result); display("User morgan after", userMorgan); UserType userMorganType = userMorgan.asObjectable(); assertEquals("Unexpected number of accountRefs", 1, userMorganType.getLinkRef().size()); String accountOid = userMorganType.getLinkRef().iterator().next().getOid(); // Check shadow PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); assertShadowRepo(accountShadow, accountOid, "uid=morgan,ou=people,dc=example,dc=com", resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); // Check account PrismObject<ShadowType> accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); assertShadowModel(accountModel, accountOid, "uid=morgan,ou=people,dc=example,dc=com", resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); ResourceAttribute attributes = ShadowUtil.getAttribute(accountModel, new QName(resourceTypeOpenDjrepo.getNamespace(), "uid")); assertEquals("morgan", attributes.getAnyRealValue()); // TODO: check OpenDJ Account }
void function() throws Exception { final String TEST_NAME = STR; TestUtil.displayTestTile(this, TEST_NAME); Task task = taskManager.createTaskInstance(ConsistencyTest.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); dummyAuditService.clear(); Entry entry = openDJController.addEntryFromLdifFile(LDIF_CREATE_USERS_OU_FILENAME); PrismObject<UserType> user = repositoryService.getObject(UserType.class, USER_MORGAN_OID, null, result); display(STR, user); PrismReference linkRef = user.findReference(UserType.F_LINK_REF); ExpressionType expression = new ExpressionType(); ObjectFactory of = new ObjectFactory(); RawType raw = new RawType(new PrimitiveXNode(STR), prismContext); JAXBElement val = of.createValue(raw); expression.getExpressionEvaluator().add(val); MappingType mapping = new MappingType(); mapping.setExpression(expression); ResourceAttributeDefinitionType attrDefType = new ResourceAttributeDefinitionType(); attrDefType.setRef(new ItemPathType(new ItemPath(getOpenDjSecondaryIdentifierQName()))); attrDefType.setOutbound(mapping); ConstructionType construction = new ConstructionType(); construction.getAttribute().add(attrDefType); construction.setResourceRef(ObjectTypeUtil.createObjectRef(resourceTypeOpenDjrepo)); AssignmentType assignment = new AssignmentType(); assignment.setConstruction(construction); ObjectDelta<UserType> userDelta = ObjectDelta.createModificationAddContainer(UserType.class, USER_MORGAN_OID, UserType.F_ASSIGNMENT, prismContext, assignment.asPrismContainerValue()); Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(userDelta); TestUtil.displayWhen(TEST_NAME); modelService.executeChanges(deltas, null, task, result); TestUtil.displayThen(TEST_NAME); result.computeStatus(); PrismObject<UserType> userMorgan = modelService.getObject(UserType.class, USER_MORGAN_OID, null, task, result); display(STR, userMorgan); UserType userMorganType = userMorgan.asObjectable(); assertEquals(STR, 1, userMorganType.getLinkRef().size()); String accountOid = userMorganType.getLinkRef().iterator().next().getOid(); PrismObject<ShadowType> accountShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result); assertShadowRepo(accountShadow, accountOid, STR, resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); PrismObject<ShadowType> accountModel = modelService.getObject(ShadowType.class, accountOid, null, task, result); assertShadowModel(accountModel, accountOid, STR, resourceTypeOpenDjrepo, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); ResourceAttribute attributes = ShadowUtil.getAttribute(accountModel, new QName(resourceTypeOpenDjrepo.getNamespace(), "uid")); assertEquals(STR, attributes.getAnyRealValue()); }
/** * assign account to the user morgan. Account with the same 'uid' (not dn, nut other secondary identifier already exists) * account should be linked to the user. * @throws Exception */
assign account to the user morgan. Account with the same 'uid' (not dn, nut other secondary identifier already exists) account should be linked to the user
test111AssignAccountMorgan
{ "repo_name": "gureronder/midpoint", "path": "testing/consistency-mechanism/src/test/java/com/evolveum/midpoint/testing/consistency/ConsistencyTest.java", "license": "apache-2.0", "size": 116472 }
[ "com.evolveum.midpoint.prism.PrismObject", "com.evolveum.midpoint.prism.PrismReference", "com.evolveum.midpoint.prism.delta.ObjectDelta", "com.evolveum.midpoint.prism.path.ItemPath", "com.evolveum.midpoint.prism.xnode.PrimitiveXNode", "com.evolveum.midpoint.schema.processor.ResourceAttribute", "com.evol...
import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismReference; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.xnode.PrimitiveXNode; import com.evolveum.midpoint.schema.processor.ResourceAttribute; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.MiscSchemaUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.ShadowUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.IntegrationTestTools; import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectFactory; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceAttributeDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; import com.evolveum.prism.xml.ns._public.types_3.RawType; import java.util.Collection; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import org.opends.server.types.Entry; import org.testng.AssertJUnit;
import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.*; import com.evolveum.midpoint.prism.path.*; import com.evolveum.midpoint.prism.xnode.*; import com.evolveum.midpoint.schema.processor.*; import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.schema.util.*; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.test.*; import com.evolveum.midpoint.test.util.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.prism.xml.ns._public.types_3.*; import java.util.*; import javax.xml.bind.*; import javax.xml.namespace.*; import org.opends.server.types.*; import org.testng.*;
[ "com.evolveum.midpoint", "com.evolveum.prism", "java.util", "javax.xml", "org.opends.server", "org.testng" ]
com.evolveum.midpoint; com.evolveum.prism; java.util; javax.xml; org.opends.server; org.testng;
1,445,772
private static int getColorIndex(List<Color> list, Color item) { int pos = list.indexOf(item); if (pos==-1) { list.add(item); pos = list.size()-1; } return pos; }
static int function(List<Color> list, Color item) { int pos = list.indexOf(item); if (pos==-1) { list.add(item); pos = list.size()-1; } return pos; }
/** * Returns the index of the specified item in a list. If the item * is not in the list, it is added, and its new index is returned. * * @param list The list (possibly) containing the item. * @param item The item to get the index of. * @return The index of the item. */
Returns the index of the specified item in a list. If the item is not in the list, it is added, and its new index is returned
getColorIndex
{ "repo_name": "Thecarisma/powertext", "path": "Power Text/src/com/power/text/ui/pteditor/RtfGenerator.java", "license": "gpl-3.0", "size": 13717 }
[ "java.awt.Color", "java.util.List" ]
import java.awt.Color; import java.util.List;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,750,455
protected ReturnedURL autoCreateSub(CSPRequestCredentials creds, CSPRequestCache cache, JSONObject jsonObject, Document doc, String savePrefix, Record r) throws JSONException, UnderlyingStorageException, ConnectionException, ExistException { ReturnedURL url; Map<String,Document> parts=new HashMap<String,Document>(); Document doc2 = doc; for(String section : r.getServicesRecordPathKeys()) { String path=r.getServicesRecordPath(section); String[] record_path=path.split(":",2); doc2=XmlJsonConversion.convertToXml(r,jsonObject,section,"POST"); if(doc2!=null){ doc = doc2; parts.put(record_path[0],doc2); //log.info(doc.asXML()); //log.info(savePrefix); } } // This checks for hierarchy support, and does nothing if not appropriate. handleHierarchyPayloadSend(r, parts, jsonObject, null); //some records are accepted as multipart in the service layers, others arent, that's why we split up here if(r.isMultipart()) url = conn.getMultipartURL(RequestMethod.POST,savePrefix,parts,creds,cache); else url = conn.getURL(RequestMethod.POST, savePrefix, doc, creds, cache); if(url.getStatus()>299 || url.getStatus()<200) throw new UnderlyingStorageException("Bad response ",url.getStatus(),savePrefix); return url; }
ReturnedURL function(CSPRequestCredentials creds, CSPRequestCache cache, JSONObject jsonObject, Document doc, String savePrefix, Record r) throws JSONException, UnderlyingStorageException, ConnectionException, ExistException { ReturnedURL url; Map<String,Document> parts=new HashMap<String,Document>(); Document doc2 = doc; for(String section : r.getServicesRecordPathKeys()) { String path=r.getServicesRecordPath(section); String[] record_path=path.split(":",2); doc2=XmlJsonConversion.convertToXml(r,jsonObject,section,"POST"); if(doc2!=null){ doc = doc2; parts.put(record_path[0],doc2); } } handleHierarchyPayloadSend(r, parts, jsonObject, null); if(r.isMultipart()) url = conn.getMultipartURL(RequestMethod.POST,savePrefix,parts,creds,cache); else url = conn.getURL(RequestMethod.POST, savePrefix, doc, creds, cache); if(url.getStatus()>299 url.getStatus()<200) throw new UnderlyingStorageException(STR,url.getStatus(),savePrefix); return url; }
/** * create sub records so can be connected to their parent record * e.g. blob/media contact/person * @param creds * @param cache * @param jsonObject * @param doc * @param savePrefix * @param r * @return * @throws JSONException * @throws UnderlyingStorageException * @throws ConnectionException * @throws ExistException */
create sub records so can be connected to their parent record e.g. blob/media contact/person
autoCreateSub
{ "repo_name": "cherryhill/collectionspace-application", "path": "cspi-services/src/main/java/org/collectionspace/chain/csp/persistence/services/GenericStorage.java", "license": "apache-2.0", "size": 93300 }
[ "java.util.HashMap", "java.util.Map", "org.collectionspace.chain.csp.persistence.services.connection.ConnectionException", "org.collectionspace.chain.csp.persistence.services.connection.RequestMethod", "org.collectionspace.chain.csp.persistence.services.connection.ReturnedURL", "org.collectionspace.chain....
import java.util.HashMap; import java.util.Map; import org.collectionspace.chain.csp.persistence.services.connection.ConnectionException; import org.collectionspace.chain.csp.persistence.services.connection.RequestMethod; import org.collectionspace.chain.csp.persistence.services.connection.ReturnedURL; import org.collectionspace.chain.csp.schema.Record; import org.collectionspace.csp.api.core.CSPRequestCache; import org.collectionspace.csp.api.core.CSPRequestCredentials; import org.collectionspace.csp.api.persistence.ExistException; import org.collectionspace.csp.api.persistence.UnderlyingStorageException; import org.dom4j.Document; import org.json.JSONException; import org.json.JSONObject;
import java.util.*; import org.collectionspace.chain.csp.persistence.services.connection.*; import org.collectionspace.chain.csp.schema.*; import org.collectionspace.csp.api.core.*; import org.collectionspace.csp.api.persistence.*; import org.dom4j.*; import org.json.*;
[ "java.util", "org.collectionspace.chain", "org.collectionspace.csp", "org.dom4j", "org.json" ]
java.util; org.collectionspace.chain; org.collectionspace.csp; org.dom4j; org.json;
1,472,962