signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BacktrackingSearch { /** * See { @ link # compute ( MealyMachine , Alphabet , Set ) } . Internal version , that uses the { @ link SplitTree } * representation . */ static < S , I , O > Optional < ADSNode < S , I , O > > compute ( final MealyMachine < S , I , ? , O > automaton , final Alphabet < I > input...
return compute ( automaton , input , node , node . getPartition ( ) . size ( ) ) ;
public class Utils { /** * Get the string resource for the given key . Returns null if not found . */ public static String getResourceString ( Context context , String key ) { } }
int id = getIdentifier ( context , "string" , key ) ; if ( id != 0 ) { return context . getResources ( ) . getString ( id ) ; } else { return null ; }
public class CassandraSchemaManager { /** * On set sub comparator . * @ param cfDef * the cf def * @ param cfProperties * the cf properties * @ param builder * the builder */ private void onSetSubComparator ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { } }
String subComparatorType = cfProperties . getProperty ( CassandraConstants . SUBCOMPARATOR_TYPE ) ; if ( subComparatorType != null && ColumnFamilyType . valueOf ( cfDef . getColumn_type ( ) ) == ColumnFamilyType . Super ) { if ( builder != null ) { // super column are not supported for composite key as of // now , leav...
public class ListStringInputFormat { /** * Creates a reader from an input split * @ param split the split to read * @ return the reader from the given input split */ @ Override public RecordReader createReader ( InputSplit split ) throws IOException , InterruptedException { } }
RecordReader reader = new ListStringRecordReader ( ) ; reader . initialize ( split ) ; return reader ;
public class LIBSVMLoader { /** * Loads a new regression data set from a LIBSVM file , assuming the label is * a numeric target value to predict . * @ param reader the reader for the file to load * @ param sparseRatio the fraction of non zero values to qualify a data * point as sparse * @ param vectorLength t...
return loadR ( reader , sparseRatio , vectorLength , DataStore . DEFAULT_STORE ) ;
public class SpdySessionStatus { /** * Returns the { @ link SpdySessionStatus } represented by the specified code . * If the specified code is a defined SPDY status code , a cached instance * will be returned . Otherwise , a new instance will be returned . */ public static SpdySessionStatus valueOf ( int code ) { }...
switch ( code ) { case 0 : return OK ; case 1 : return PROTOCOL_ERROR ; case 2 : return INTERNAL_ERROR ; } return new SpdySessionStatus ( code , "UNKNOWN (" + code + ')' ) ;
public class RegistriesInner { /** * Schedules a new run based on the request parameters and add it to the run queue . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runRequest The parameter...
return beginScheduleRunWithServiceResponseAsync ( resourceGroupName , registryName , runRequest ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Java9ConnectionDecoratorFactory { /** * { @ inheritDoc } */ @ Override protected Connection proxyConnection ( Connection target , ConnectionCallback callback ) { } }
return new Java9ConnectionDecorator ( target , callback ) ;
public class Channel { /** * Send Query proposal * @ param queryByChaincodeRequest * @ param peers * @ return responses from peers . * @ throws InvalidArgumentException * @ throws ProposalException */ public Collection < ProposalResponse > queryByChaincode ( QueryByChaincodeRequest queryByChaincodeRequest , C...
return sendProposal ( queryByChaincodeRequest , peers ) ;
public class TimerServiceRamp { /** * Implements { @ link Timers # runAfter ( Runnable , long , TimeUnit ) } */ @ Override public void runEvery ( @ Pin Consumer < ? super Cancel > task , long delay , TimeUnit unit , Result < ? super Cancel > result ) { } }
// cancel ( task ) ; long period = unit . toMillis ( delay ) ; if ( period <= 0 ) { throw new IllegalArgumentException ( ) ; } schedule ( task , new RunEveryScheduler ( period ) , result ) ;
public class HTCashbillServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . HTCashbillService # registDeptUser ( java . lang . String , java . lang . String , java . lang . String ) */ public Response registDeptUser ( String CorpNum , String DeptUserID , String DeptUserPWD ) throws PopbillException { } ...
if ( CorpNum == null || CorpNum . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "μ—°λ™νšŒμ› μ‚¬μ—…μžλ²ˆν˜Έ(CorpNum)κ°€ μž…λ ₯λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€." ) ; if ( DeptUserID == null || DeptUserID . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "ν™ˆνƒμŠ€ λΆ€μ„œμ‚¬μš©μž 계정 아이디(DeptUserID)κ°€ μž…λ ₯λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€." ) ; if ( DeptUserPWD == null || DeptUserPWD . isEmp...
public class TableSnippets { /** * [ VARIABLE " rowId2 " ] */ public InsertAllResponse insert ( String rowId1 , String rowId2 ) { } }
// [ START ] List < RowToInsert > rows = new ArrayList < > ( ) ; Map < String , Object > row1 = new HashMap < > ( ) ; row1 . put ( "stringField" , "value1" ) ; row1 . put ( "booleanField" , true ) ; Map < String , Object > row2 = new HashMap < > ( ) ; row2 . put ( "stringField" , "value2" ) ; row2 . put ( "booleanField...
public class AliasMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Alias alias , ProtocolMarshaller protocolMarshaller ) { } }
if ( alias == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( alias . getAliasId ( ) , ALIASID_BINDING ) ; protocolMarshaller . marshall ( alias . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( alias . getAliasArn ( ) , ALIAS...
public class Client { /** * Reads or writes any pending data for this client . Multiple threads should not call this method at the same time . * @ param timeout Wait for up to the specified milliseconds for data to be ready to process . May be zero to return immediately * if there is no data to process . */ public ...
updateThread = Thread . currentThread ( ) ; synchronized ( updateLock ) { // Blocks to avoid a select while the selector is used to bind the server connection . } long startTime = System . currentTimeMillis ( ) ; int select = 0 ; if ( timeout > 0 ) { select = selector . select ( timeout ) ; } else { select = selector ....
public class DescribeUserRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeUserRequest describeUserRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeUserRequest . getUserName ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( describeUserRequest . getAwsAccountId ( ) , AWSACCOUNTID_BINDING ) ; pro...
public class DeviceLocal { /** * This method returns object local to target device * @ param deviceId * @ return */ @ Nullable public T get ( int deviceId ) { } }
try { locksMap . get ( deviceId ) . readLock ( ) . lock ( ) ; return backingMap . get ( deviceId ) ; } finally { locksMap . get ( deviceId ) . readLock ( ) . unlock ( ) ; }
public class NullnessPropagationTransfer { /** * We can ' t use ASTHelpers here . It ' s in core , which depends on jdk8 , so we can ' t make jdk8 depend * back on core . */ @ Nullable private static Symbol tryGetSymbol ( Tree tree ) { } }
if ( tree instanceof JCIdent ) { return ( ( JCIdent ) tree ) . sym ; } if ( tree instanceof JCFieldAccess ) { return ( ( JCFieldAccess ) tree ) . sym ; } if ( tree instanceof JCVariableDecl ) { return ( ( JCVariableDecl ) tree ) . sym ; } return null ;
public class MutableBigInteger { /** * Return the index of the lowest set bit in this MutableBigInteger . If the * magnitude of this MutableBigInteger is zero , - 1 is returned . */ private final int getLowestSetBit ( ) { } }
if ( intLen == 0 ) return - 1 ; int j , b ; for ( j = intLen - 1 ; ( j > 0 ) && ( value [ j + offset ] == 0 ) ; j -- ) ; b = value [ j + offset ] ; if ( b == 0 ) return - 1 ; return ( ( intLen - 1 - j ) << 5 ) + Integer . numberOfTrailingZeros ( b ) ;
public class RemoveTagsFromResourceRequest { /** * The tag key or keys to remove . * Specify only the tag key to remove ( not the value ) . To overwrite the value for an existing tag , use * < a > AddTagsToResource < / a > . * @ return The tag key or keys to remove . < / p > * Specify only the tag key to remove...
if ( tagKeyList == null ) { tagKeyList = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return tagKeyList ;
public class SegmentServiceImpl { /** * metadata for a segment * < pre > < code > * address int48 * length int16 * crc int32 * < / code > < / pre > */ private boolean readMetaSegment ( ReadStream is , int crc ) throws IOException { } }
long value = BitsUtil . readLong ( is ) ; crc = Crc32Caucho . generate ( crc , value ) ; int crcFile = BitsUtil . readInt ( is ) ; if ( crcFile != crc ) { log . fine ( "meta-segment crc mismatch" ) ; return false ; } long address = value & ~ 0xffff ; int length = ( int ) ( ( value & 0xffff ) << 16 ) ; SegmentExtent seg...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public RenderingIntentReserved createRenderingIntentReservedFromString ( EDataType eDataType , String initialValue ) { } }
RenderingIntentReserved result = RenderingIntentReserved . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class LanguageToolHttpHandler { /** * A ( reverse ) proxy can set the ' X - forwarded - for ' header so we can see a user ' s original IP . * But that ' s just a common header than can also be set by the client . So we restrict access to this * server to the load balancer , which should add the header origin...
if ( config . getTrustXForwardForHeader ( ) ) { List < String > forwardedIpsStr = httpExchange . getRequestHeaders ( ) . get ( "X-forwarded-for" ) ; if ( forwardedIpsStr != null && forwardedIpsStr . size ( ) > 0 ) { return forwardedIpsStr . get ( 0 ) ; } } return null ;
public class PhoneNumberUtil { /** * format phone number in E123 format . * @ param pphoneNumberData phone number to format * @ param pcountryData country data * @ return formated phone number as String */ public final String formatE123 ( final PhoneNumberInterface pphoneNumberData , final PhoneCountryData pcount...
if ( pphoneNumberData != null && pcountryData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getCountryCode ( ) ) ) { return this . formatE123National ( pphoneNumberData ) ; } else { return this . formatE123International ( pphoneNumberData ) ; }
public class AsyncLibrary { /** * Find or create the AIO provider . * @ return IAsyncProvider * @ throws AsyncException */ public static synchronized IAsyncProvider createInstance ( ) throws AsyncException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "createInstance" ) ; } if ( instance == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "instance is null. Instantiating new AsyncLibrary " ) ; } instance = new AsyncLi...
public class ThriftClusterImpl { /** * Get the version from the cluster * @ return * @ throws OperationException */ @ Override public String getVersion ( ) throws ConnectionException { } }
return connectionPool . executeWithFailover ( new AbstractOperationImpl < String > ( tracerFactory . newTracer ( CassandraOperationType . GET_VERSION ) ) { @ Override public String internalExecute ( Client client , ConnectionContext state ) throws Exception { return client . describe_version ( ) ; } } , config . getRet...
public class GADImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GAD__GOC_ADAT : setGOCAdat ( ( byte [ ] ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class Gold { /** * getter for typeS - gets * @ generated * @ return value of the feature */ public String getTypeS ( ) { } }
if ( Gold_Type . featOkTst && ( ( Gold_Type ) jcasType ) . casFeat_typeS == null ) jcasType . jcas . throwFeatMissing ( "typeS" , "ch.epfl.bbp.uima.types.Gold" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Gold_Type ) jcasType ) . casFeatCode_typeS ) ;
public class SpringIOUtils { /** * Copy the contents of the given input File to the given output File . * @ param in the file to copy from * @ param out the file to copy to * @ return the number of bytes copied * @ throws java . io . IOException in case of I / O errors */ public static int copy ( Resource in , ...
assert in != null : "No input File specified" ; assert out != null : "No output File specified" ; return copy ( new BufferedInputStream ( in . getInputStream ( ) ) , new BufferedOutputStream ( Files . newOutputStream ( out . toPath ( ) ) ) ) ;
public class CmsFlexController { /** * Returns the combined " last modified " date for all resources read during this request . < p > * @ return the combined " last modified " date for all resources read during this request */ public long getDateLastModified ( ) { } }
int pos = m_flexContextInfoList . size ( ) - 1 ; if ( pos < 0 ) { // ensure a valid position is used return CmsResource . DATE_RELEASED_DEFAULT ; } return ( m_flexContextInfoList . get ( pos ) ) . getDateLastModified ( ) ;
public class Log { /** * Performs all the commands in the . script file . */ private void processScript ( ) { } }
ScriptReaderBase scr = null ; try { if ( database . isFilesInJar ( ) || fa . isStreamElement ( scriptFileName ) ) { scr = ScriptReaderBase . newScriptReader ( database , scriptFileName , scriptFormat ) ; Session session = database . sessionManager . getSysSessionForScript ( database ) ; scr . readAll ( session ) ; scr ...
public class CompactionAuditCountVerifier { /** * Obtain a client factory * @ param state job state * @ return a factory which creates { @ link AuditCountClient } . * If no factory is set or an error occurred , a { @ link EmptyAuditCountClientFactory } is * returned which creates a < code > null < / code > { @ ...
if ( ! state . contains ( AuditCountClientFactory . AUDIT_COUNT_CLIENT_FACTORY ) ) { return new EmptyAuditCountClientFactory ( ) ; } try { String factoryName = state . getProp ( AuditCountClientFactory . AUDIT_COUNT_CLIENT_FACTORY ) ; ClassAliasResolver < AuditCountClientFactory > conditionClassAliasResolver = new Clas...
public class BeanUtil { /** * Get map with key / value pairs for properties of a java bean ( using { @ link BeanUtils # describe ( Object ) } ) . * An array of property names can be passed that should be masked with " * * * " because they contain sensitive * information . * @ param beanObject Bean object * @ pa...
try { SortedMap < String , Object > configProperties = new TreeMap < String , Object > ( BeanUtils . describe ( beanObject ) ) ; // always ignore " class " properties which is added by BeanUtils . describe by default configProperties . remove ( "class" ) ; // Mask some properties with confidential information ( if set ...
public class DSResultIterator { /** * ( non - Javadoc ) * @ see * com . impetus . client . cassandra . query . ResultIterator # populateEntities ( com * . impetus . kundera . metadata . model . EntityMetadata , * com . impetus . kundera . client . Client ) */ @ Override protected List < E > populateEntities ( E...
int count = 0 ; List results = new ArrayList ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( entityMetadata . getEntityClazz ( ) ) ; Map < String , Object > relationalValues = new ...
public class Matrix3x2f { /** * Set the elements of this matrix to the ones in < code > m < / code > . * @ param m * the matrix to copy the elements from * @ return this */ public Matrix3x2f set ( Matrix3x2fc m ) { } }
if ( m instanceof Matrix3x2f ) { MemUtil . INSTANCE . copy ( ( Matrix3x2f ) m , this ) ; } else { setMatrix3x2fc ( m ) ; } return this ;
public class InvocationHandlerAdapter { /** * Creates an implementation for any { @ link java . lang . reflect . InvocationHandler } that delegates * all method interceptions to a field with the given name . This field has to be of a subtype of invocation * handler and needs to be set before any invocations are int...
return toField ( name , FieldLocator . ForClassHierarchy . Factory . INSTANCE ) ;
public class CodeGenBase { /** * Translates an IR expression into target language code . * @ param expStatus * The IR status that holds the expressions that we want to code generate . * @ param mergeVisitor * The visitor that translates the IR expression into target language code . * @ return The generated co...
StringWriter writer = new StringWriter ( ) ; SExpIR expCg = expStatus . getIrNode ( ) ; if ( expStatus . canBeGenerated ( ) ) { mergeVisitor . init ( ) ; expCg . apply ( mergeVisitor , writer ) ; if ( mergeVisitor . hasMergeErrors ( ) ) { return new Generated ( mergeVisitor . getMergeErrors ( ) ) ; } else if ( mergeVis...
public class CmsDomUtil { /** * Creates a hidden input field with the given name and value . < p > * @ param name the field name * @ param value the field value * @ return the input element */ private static InputElement createHiddenInput ( String name , String value ) { } }
InputElement input = Document . get ( ) . createHiddenInputElement ( ) ; input . setName ( name ) ; input . setValue ( value ) ; return input ;
public class Timer { /** * Create a new time slot with a given timeout time , and add this new * time slot at the end of the time slot list . * @ param newSlotTimeout * - timeout time for the new slot * @ return time slot that was created and added */ public TimeSlot insertSlotAtEnd ( long newSlotTimeout ) { } ...
// this routine assumes that list could be empty TimeSlot retSlot = new TimeSlot ( newSlotTimeout ) ; if ( this . lastSlot == null ) { // list was empty this . lastSlot = retSlot ; this . firstSlot = retSlot ; } else { retSlot . prevEntry = this . lastSlot ; this . lastSlot . nextEntry = retSlot ; this . lastSlot = ret...
public class CmsListItemWidget { /** * Removes all registered mouse event handlers including the context menu handler . < p > */ public void removeMouseHandlers ( ) { } }
Iterator < HandlerRegistration > it = m_handlerRegistrations . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . removeHandler ( ) ; } m_handlerRegistrations . clear ( ) ;
public class KieModuleModelImpl { /** * / * ( non - Javadoc ) * @ see org . kie . kModule . KieProject # removeKieBaseModel ( org . kie . kModule . KieBaseModel ) */ public void moveKBase ( String oldQName , String newQName ) { } }
Map < String , KieBaseModel > newMap = new HashMap < String , KieBaseModel > ( ) ; newMap . putAll ( this . kBases ) ; KieBaseModel kieBaseModel = newMap . remove ( oldQName ) ; newMap . put ( newQName , kieBaseModel ) ; setKBases ( newMap ) ;
public class EnvironmentImage { /** * A list of environment image versions . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVersions ( java . util . Collection ) } or { @ link # withVersions ( java . util . Collection ) } if you want to override * the e...
if ( this . versions == null ) { setVersions ( new java . util . ArrayList < String > ( versions . length ) ) ; } for ( String ele : versions ) { this . versions . add ( ele ) ; } return this ;
public class DescribeLoadBalancerPoliciesResult { /** * Information about the policies . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicyDescriptions ( java . util . Collection ) } or { @ link # withPolicyDescriptions ( java . util . Collection ) } i...
if ( this . policyDescriptions == null ) { setPolicyDescriptions ( new com . amazonaws . internal . SdkInternalList < PolicyDescription > ( policyDescriptions . length ) ) ; } for ( PolicyDescription ele : policyDescriptions ) { this . policyDescriptions . add ( ele ) ; } return this ;
public class BackboneGeneration { /** * Computes the negative backbone variables for a given collection of formulas . * @ param formulas the given collection of formulas * @ return the negative backbone or { @ code null } if the formula is UNSAT */ public static Backbone computeNegative ( final Collection < Formula...
return compute ( formulas , allVariablesInFormulas ( formulas ) , BackboneType . ONLY_NEGATIVE ) ;
public class FormatUtils { /** * Returns an indexed format by placing the specified index before the given * format . * @ param index * Desired index for the given format * @ param format * Format to be indexed * @ return The format < code > format < / code > indexed with < code > index < / code > */ public...
if ( index < 1 ) throw new IllegalArgumentException ( ) ; if ( format == null ) throw new NullPointerException ( ) ; if ( format . length ( ) == 0 ) throw new IllegalArgumentException ( ) ; return String . format ( INDEXED_FORMAT , index , format ) ;
public class Range { /** * Clamps { @ code value } to this range . * < p > If the value is within this range , it is returned . Otherwise , if it * is { @ code < } than the lower endpoint , the lower endpoint is returned , * else the upper endpoint is returned . Comparisons are performed using the * { @ link Co...
if ( value == null ) throw new IllegalArgumentException ( "value must not be null" ) ; if ( value . compareTo ( mLower ) < 0 ) { return mLower ; } else if ( value . compareTo ( mUpper ) > 0 ) { return mUpper ; } else { return value ; }
public class IpHelper { /** * Validates a netmask * @ param netmask * String A netmask to test * @ return boolean True if it validates , otherwise false */ public static boolean isValidNetmask ( String netmask ) { } }
try { return isValidNetmask ( InetAddress . getByName ( netmask ) ) ; } catch ( UnknownHostException e ) { return false ; }
public class WorkflowJPA { /** * / * ( non - Javadoc ) * @ see nz . co . senanque . workflow . WorkflowDAO # removeDeferredEvent ( nz . co . senanque . workflow . instances . ProcessInstance , nz . co . senanque . process . instances . TaskBase ) */ @ Transactional public DeferredEvent removeDeferredEvent ( ProcessIn...
List < DeferredEvent > deferredEvents = processInstance . getDeferredEvents ( ) ; for ( DeferredEvent deferredEvent : deferredEvents ) { if ( deferredEvent . getEventType ( ) != EventType . DONE && deferredEvent . getTaskId ( ) . longValue ( ) == task . getTaskId ( ) && task . getProcessDefinitionName ( ) . equals ( de...
public class LongRadixHeap { /** * { @ inheritDoc } */ @ Override protected int compare ( Long o1 , Long o2 ) { } }
if ( o1 < o2 ) { return - 1 ; } else if ( o1 > o2 ) { return 1 ; } else { return 0 ; }
public class DObject { /** * Get the DSet with the specified name . */ public final < T extends DSet . Entry > DSet < T > getSet ( String setName ) { } }
@ SuppressWarnings ( "unchecked" ) DSet < T > casted = ( DSet < T > ) getAccessor ( setName ) . get ( this ) ; return casted ;
public class LaTeXListingsGenerator2 { /** * Add a TeX requirement . * @ param requirement the name of the TeX package . */ public void addRequirement ( String requirement ) { } }
if ( ! Strings . isEmpty ( requirement ) ) { if ( this . requirements == null ) { this . requirements = new ArrayList < > ( ) ; } this . requirements . add ( requirement ) ; }
public class ST_Graph { /** * Make a big table of all points in the coords table with an envelope around each point . * We will use this table to remove duplicate points . */ private static void makeEnvelopes ( Statement st , double tolerance , boolean isH2 , int srid ) throws SQLException { } }
st . execute ( "DROP TABLE IF EXISTS" + PTS_TABLE + ";" ) ; if ( tolerance > 0 ) { LOGGER . info ( "Calculating envelopes around coordinates..." ) ; if ( isH2 ) { // Putting all points and their envelopes together . . . st . execute ( "CREATE TABLE " + PTS_TABLE + "( " + "ID SERIAL PRIMARY KEY, " + "THE_GEOM POINT, " ...
public class EfficientViewHolder { /** * Get the OnClickListener to call when the user click on the item . * @ param adapterHasListener true if the calling adapter has a global listener on the item . * @ return the click listener to be put into the view . */ public View . OnClickListener getOnClickListener ( boolea...
if ( isClickable ( ) && adapterHasListener ) { if ( mViewHolderClickListener == null ) { mViewHolderClickListener = new ViewHolderClickListener < > ( this ) ; } } else { mViewHolderClickListener = null ; } return mViewHolderClickListener ;
public class DomUtils { /** * Adds the attribute to each node in the Document with the given name . * @ param doc * the Document to add attributes to * @ param tagName * the local name of the nodes to add the attribute to * @ param tagNamespaceURI * the namespace uri of the nodes to add the attribute to *...
// Create a Document to work on Document newDoc = null ; try { System . setProperty ( "javax.xml.parsers.DocumentBuilderFactory" , "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" ) ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setNamespaceAware ( true ) ; DocumentBuilder db = dbf ....
public class AbstractHttpQuery { /** * Returns the non - empty value of the given required query string parameter . * If this parameter occurs multiple times in the URL , only the last value * is returned and others are silently ignored . * @ param paramname Name of the query string parameter to get . * @ retur...
final String value = getQueryStringParam ( paramname ) ; if ( value == null || value . isEmpty ( ) ) { throw BadRequestException . missingParameter ( paramname ) ; } return value ;
public class BigramExtractor { /** * Returns the score of the contingency table using the specified * significance test * @ param contingencyTable a contingency table specified as four { @ code int } * values * @ param test the significance test to use in evaluating the table */ private double getScore ( int [ ...
switch ( test ) { case PMI : return pmi ( contingencyTable ) ; case CHI_SQUARED : return chiSq ( contingencyTable ) ; case LOG_LIKELIHOOD : return logLikelihood ( contingencyTable ) ; default : throw new Error ( test + " not implemented yet" ) ; }
public class CmsOrgUnitsAdminList { /** * Checks if the user has more then one organizational unit to administrate . < p > * @ return true if the user has more then then one organizational unit to administrate * otherwise false * @ throws CmsException if the organizational units can not be read */ public boolean ...
List < CmsOrganizationalUnit > orgUnits = getOrgUnits ( ) ; if ( orgUnits == null ) { return false ; } if ( orgUnits . size ( ) <= 1 ) { return false ; } return true ;
public class ListOfEDoubleImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < Double > getList ( ) { } }
return ( EList < Double > ) eGet ( Ifc4Package . Literals . LIST_OF_EDOUBLE__LIST , true ) ;
public class ParamValidators { /** * return the relevant Validator by the given class type and required indication */ public static < T extends ParamValidator > T getValidator ( Class < T > clazz , boolean required ) { } }
List < ParamValidator > validators = validatorsMap . get ( clazz ) ; if ( validators != null ) { if ( required ) { return ( T ) validators . get ( 0 ) ; } return ( T ) validators . get ( 1 ) ; } return null ;
public class Repeater { /** * Complete rendering the repeater . * @ return { @ link # EVAL _ PAGE } * @ throws JspException if an error occurs that can not be reported in the page */ public int doEndTag ( ) throws JspException { } }
if ( hasErrors ( ) ) reportErrors ( ) ; else if ( _contentBuffer != null ) write ( _contentBuffer . toString ( ) ) ; return EVAL_PAGE ;
public class FamilyNavigator { /** * Get the family for this child to build the navigator with . * @ param child the child * @ return the family */ private static Family findFamily ( final Child child ) { } }
if ( ! child . isSet ( ) ) { return new Family ( ) ; } final Family foundFamily = ( Family ) child . find ( child . getFromString ( ) ) ; if ( foundFamily == null ) { return new Family ( ) ; } return foundFamily ;
public class IndexUpdateTransactionEventHandler { /** * might be run from a scheduler , so we need to make sure we have a transaction */ private synchronized Map < String , Map < String , Collection < Index < Node > > > > initIndexConfiguration ( ) { } }
Map < String , Map < String , Collection < Index < Node > > > > indexesByLabelAndProperty = new HashMap < > ( ) ; try ( Transaction tx = graphDatabaseService . beginTx ( ) ) { final IndexManager indexManager = graphDatabaseService . index ( ) ; for ( String indexName : indexManager . nodeIndexNames ( ) ) { final Index ...
public class ManagementClient { /** * Retrieves the runtime information of a subscription in a given topic * @ param topicPath - The path of the topic relative to service bus namespace . * @ param subscriptionName - The name of the subscription * @ return - SubscriptionRuntimeInfo containing the runtime informati...
return Utils . completeFuture ( this . asyncClient . getSubscriptionRuntimeInfoAsync ( topicPath , subscriptionName ) ) ;
public class SendGridBuilder { /** * Set password for SendGrid HTTP API . * You can specify a direct value . For example : * < pre > * . password ( " foo " ) ; * < / pre > * You can also specify one or several property keys . For example : * < pre > * . password ( " $ { custom . property . high - priority...
for ( String p : password ) { if ( p != null ) { passwords . add ( p ) ; } } return this ;
public class Matrix4f { /** * Set the upper left 3x3 submatrix of this { @ link Matrix4f } to that of the given { @ link Matrix4f } * and don ' t change the other elements . * @ param mat * the { @ link Matrix4f } * @ return this */ public Matrix4f set3x3 ( Matrix4f mat ) { } }
MemUtil . INSTANCE . copy3x3 ( mat , this ) ; properties &= mat . properties & ~ ( PROPERTY_PERSPECTIVE ) ; return this ;
public class ArchivalUrlCSSReplayRenderer { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . replay . HTMLReplayRenderer # updatePage ( org . archive . wayback . replay . HTMLPage , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , org . archive . wayback . core...
page . resolveCSSUrls ( ) ; // if any CSS - specific jsp inserts are configured , run and insert . . . // Switch to end of document , resolving issue with @ import CSS syntax which must be at the start of the file . // See # 91 ( https : / / github . com / iipc / openwayback / pull / 91) page . insertAtEndOfDocument ( ...
public class MultipleAlignmentJmol { /** * Colors every Block of the structures with a different color , following * the palette . It colors each Block differently , no matter if it is from * the same or different BlockSet . */ public static String getMultiBlockJmolString ( MultipleAlignment multAln , List < Atom [...
StringWriter jmol = new StringWriter ( ) ; jmol . append ( DEFAULT_SCRIPT ) ; jmol . append ( "select *; color lightgrey; backbone 0.1; " ) ; int blockNum = multAln . getBlocks ( ) . size ( ) ; Color [ ] colors = colorPalette . getColorPalette ( blockNum ) ; // For every structure color all the blocks with the printBlo...
public class CorporationApi { /** * Get corporation starbases ( POSes ) Returns list of corporation starbases * ( POSes ) - - - This route is cached for up to 3600 seconds - - - Requires one * of the following EVE corporation role ( s ) : Director SSO Scope : * esi - corporations . read _ starbases . v1 * @ par...
com . squareup . okhttp . Call call = getCorporationsCorporationIdStarbasesValidateBeforeCall ( corporationId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < CorporationStarbasesResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnT...
public class NamedResolverMap { /** * Create a GroupName from this NamedResolverMap . * @ param prefixPath Additional path elements to put in front of the * returned path . * @ param extraTags Additional tags to put in the tag set . The extraTags * argument will override any values present in the NamedResolverM...
final Stream < String > suffixPath = data . entrySet ( ) . stream ( ) . filter ( entry -> entry . getKey ( ) . getLeft ( ) . isPresent ( ) ) // Only retain int keys . . sorted ( Comparator . comparing ( entry -> entry . getKey ( ) . getLeft ( ) . get ( ) ) ) // Sort by int key . . map ( Map . Entry :: getValue ) . map ...
public class RefreshEvent { /** * refresh metric settings of topologies and sync metric meta from local cache */ @ SuppressWarnings ( "unchecked" ) private void doRefreshTopologies ( ) { } }
for ( String topology : JStormMetrics . SYS_TOPOLOGIES ) { if ( ! context . getTopologyMetricContexts ( ) . containsKey ( topology ) ) { LOG . info ( "adding {} to metric context." , topology ) ; Map conf = new HashMap ( ) ; if ( topology . equals ( JStormMetrics . CLUSTER_METRIC_KEY ) ) { // there ' s no need to consi...
public class AreaPositions { /** * Merge this Positions with another one . If the given { @ link Positions } is : * - SinglePosition , it will raise an IllegalArgumentException . * - LinearPositions , it will return a new AreaPosition by appending the given LinearPositions to this . * - AreaPositions , it will re...
if ( other instanceof SinglePosition ) { throw new IllegalArgumentException ( "Cannot merge single position and area children" ) ; } else if ( other instanceof LinearPositions ) { LinearPositions that = ( LinearPositions ) other ; return builder ( ) . addLinearPosition ( that ) . build ( ) ; } else if ( other instanceo...
public class MetaModel { /** * TODO AY : add prepared association ' s lists by type */ protected List < OneToManyAssociation > getOneToManyAssociations ( List < Association > exclusions ) { } }
List < OneToManyAssociation > one2Manies = new ArrayList < > ( ) ; for ( Association association : associations ) { if ( association . getClass ( ) . equals ( OneToManyAssociation . class ) && ! exclusions . contains ( association ) ) { one2Manies . add ( ( OneToManyAssociation ) association ) ; } } return one2Manies ;
public class Val { /** * As class . * @ param < T > the type parameter * @ param defaultValue the default value * @ return The object as a class */ @ SuppressWarnings ( "unchecked" ) public < T > Class < T > asClass ( Class < T > defaultValue ) { } }
return as ( Class . class , defaultValue ) ;
public class HadoopUtil { /** * Extracts from the configuration all properties having the same base a Map of Key / value pair . Example : base : " hadoopoffice . read . filter . metadata . " , properties in JobConf " hadoopoffice . read . filter . metadata . author " = " Martha Musterfrau " , " hadoopoffice . read . fi...
HashMap < String , String > result = new HashMap < > ( ) ; for ( Map . Entry < String , String > currentItem : conf ) { String currentKey = currentItem . getKey ( ) ; if ( currentKey . startsWith ( base ) ) { String strippedKey = currentKey . substring ( base . length ( ) ) ; result . put ( strippedKey , currentItem . ...
public class AbstractBitcoinFlinkInputFormat { /** * Reads data supplied by Flink with @ see org . zuinnote . hadoop . bitcoin . format . common . BitcoinBlockReader * ( non - Javadoc ) * @ see org . apache . flink . api . common . io . FileInputFormat # open ( org . apache . flink . core . fs . FileInputSplit ) */...
super . open ( split ) ; LOG . debug ( "Initialize Bitcoin reader" ) ; // temporary measure to set buffer size to 1 , otherwise we cannot guarantee that checkpointing works bbr = new BitcoinBlockReader ( this . stream , this . maxSizeBitcoinBlock , 1 , this . specificMagicArray , this . useDirectBuffer , this . readAux...
public class MIDDCombiner { /** * Combine two MIDD with same level of attribute at their roots * @ param n1 * @ param n2 * @ return */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) private InternalNode < ? > combineIDDSameLevel ( InternalNode n1 , InternalNode n2 ) throws MIDDException { if ( n1 . getID ( ) != n2 . getID ( ) ) { throw new IllegalArgumentException ( "Both params should have the same variable level at their root" ) ; } if ( n1 . getType ( ) != n2 . getT...
public class FastFourierTransform { /** * This is the Gold rader bit - reversal algorithm */ public static void bitreverse ( DoubleVector data , int i0 , int stride ) { } }
int n = data . length ( ) ; for ( int i = 0 , j = 0 ; i < n - 1 ; i ++ ) { int k = n / 2 ; if ( i < j ) { double tmp = data . get ( i0 + stride * i ) ; data . set ( i0 + stride * i , data . get ( i0 + stride * j ) ) ; data . set ( i0 + stride * j , tmp ) ; } while ( k <= j ) { j = j - k ; k = k / 2 ; } j += k ; }
public class ExcelDataProvider { /** * { @ inheritDoc } */ @ Override public String [ ] readLine ( int line , boolean readResult ) throws TechnicalException { } }
final Sheet sheet = workbook . getSheetAt ( 0 ) ; final Row row = sheet . getRow ( line ) ; if ( row == null || "" . equals ( readCell ( row . getCell ( 0 ) ) ) ) { return null ; } else { final String [ ] ret = readResult ? new String [ columns . size ( ) ] : new String [ columns . size ( ) - 1 ] ; Cell cell ; for ( in...
public class Facet { /** * Creates a { @ link RequestDispatcher } that handles the given view , or * return null if no such view was found . * @ param type * If " it " is non - null , { @ code it . getClass ( ) } . Otherwise the class * from which the view is searched . */ public RequestDispatcher createRequest...
return null ; // should be really abstract , but not
public class Log { /** * Send an ERROR log message with specified subsystem . If subsystem is not enabled the message * will not be logged * @ param subsystem logging subsystem * @ param tag Used to identify the source of a log message . It usually identifies the class or * activity where the log call occurs . ...
return isEnabled ( subsystem ) ? currentLog . e ( tag , getMsg ( subsystem , msg ) ) : 0 ;
public class InstrumentedDataWriterBase { /** * Build a { @ link ScheduledThreadPoolExecutor } that updates record - level and byte - level metrics . */ private static ScheduledThreadPoolExecutor buildWriterMetricsUpdater ( ) { } }
return new ScheduledThreadPoolExecutor ( 1 , ExecutorsUtils . newThreadFactory ( Optional . of ( log ) , Optional . of ( "WriterMetricsUpdater-%d" ) ) ) ;
public class ExceptionUtils { /** * < p > Returns an array where each element is a line from the argument . < / p > * < p > The end of line is determined by the value of { @ link System # lineSeparator ( ) } . < / p > * @ param stackTrace a stack trace String * @ return an array where each element is a line from ...
final String linebreak = System . lineSeparator ( ) ; final StringTokenizer frames = new StringTokenizer ( stackTrace , linebreak ) ; final List < String > list = new ArrayList < > ( ) ; while ( frames . hasMoreTokens ( ) ) { list . add ( frames . nextToken ( ) ) ; } return list . toArray ( new String [ list . size ( )...
public class JSTypeRegistry { /** * Given a node , get a human - readable name for the type of that node so * that will be easy for the programmer to find the original declaration . * For example , if SubFoo ' s property " bar " might have the human - readable * name " Foo . prototype . bar " . * @ param n The ...
JSType type = getJSTypeOrUnknown ( n ) ; if ( dereference ) { JSType autoboxed = type . autobox ( ) ; if ( ! autoboxed . isNoType ( ) ) { type = autoboxed ; } } String name = getSimpleReadableJSTypeName ( type ) ; if ( name != null ) { return name ; } // If we ' re analyzing a GETPROP , the property may be inherited by...
public class User { /** * Generates a new password reset token . Sent via email for pass reset . * @ return the pass reset token */ public final String generatePasswordResetToken ( ) { } }
if ( StringUtils . isBlank ( identifier ) ) { return "" ; } Sysprop s = CoreUtils . getInstance ( ) . getDao ( ) . read ( getAppid ( ) , identifier ) ; if ( s != null ) { String token = Utils . generateSecurityToken ( 42 , true ) ; s . addProperty ( Config . _RESET_TOKEN , token ) ; CoreUtils . getInstance ( ) . getDao...
public class Visibility { /** * The default implementation of this method calls * { @ link # onAppear ( ViewGroup , View , TransitionValues , TransitionValues ) } . * Subclasses should override this method or * { @ link # onAppear ( ViewGroup , View , TransitionValues , TransitionValues ) } . * if they need to ...
if ( ( mMode & MODE_IN ) != MODE_IN || endValues == null ) { return null ; } if ( startValues == null ) { VisibilityInfo parentVisibilityInfo = null ; View endParent = ( View ) endValues . view . getParent ( ) ; TransitionValues startParentValues = getMatchedTransitionValues ( endParent , false ) ; TransitionValues end...
public class PersistenceController { /** * Wraps loading all conversations from store implementation into an Observable . * @ return Observable returning all conversations from store . */ Observable < List < ChatConversationBase > > loadAllConversations ( ) { } }
return Observable . create ( emitter -> storeFactory . execute ( new StoreTransaction < ChatStore > ( ) { @ Override protected void execute ( ChatStore store ) { store . open ( ) ; List < ChatConversationBase > conversations = store . getAllConversations ( ) ; store . close ( ) ; emitter . onNext ( conversations ) ; em...
public class FactorGraph { /** * Get all of the variables that the two factors have in common . */ public Set < Integer > getSharedVariables ( int factor1 , int factor2 ) { } }
Set < Integer > varNums = new HashSet < Integer > ( factorVariableMap . get ( factor1 ) ) ; varNums . retainAll ( factorVariableMap . get ( factor2 ) ) ; return varNums ;
public class CmsAvailability { /** * Creates an input field for the notification interval . < p > * @ return HTML code for the notification interval input field . */ public String buildInputNotificationInterval ( ) { } }
String propVal = null ; if ( ! isMultiOperation ( ) ) { try { propVal = getCms ( ) . readPropertyObject ( getParamResource ( ) , CmsPropertyDefinition . PROPERTY_NOTIFICATION_INTERVAL , false ) . getValue ( ) ; } catch ( CmsException e ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( e . getLocalizedMessage ( ) ) ; } ...
public class ProofObligation { /** * Create the context ( forall x , y , z . . . ) for a Proof Obligation for * eq and ord relations . */ protected AForAllExp makeRelContext ( ATypeDefinition node , AVariableExp ... exps ) { } }
AForAllExp forall_exp = new AForAllExp ( ) ; forall_exp . setType ( new ABooleanBasicType ( ) ) ; ATypeMultipleBind tmb = new ATypeMultipleBind ( ) ; List < PPattern > pats = new LinkedList < > ( ) ; for ( AVariableExp exp : exps ) { pats . add ( AstFactory . newAIdentifierPattern ( exp . getName ( ) . clone ( ) ) ) ; ...
public class ConfluentRegistryAvroDeserializationSchema { /** * Creates { @ link AvroDeserializationSchema } that produces classes that were generated from avro * schema and looks up writer schema in Confluent Schema Registry . * @ param tClass class of record to be produced * @ param url url of schema registry t...
return forSpecific ( tClass , url , DEFAULT_IDENTITY_MAP_CAPACITY ) ;
public class XTraceBufferedImpl { /** * ( non - Javadoc ) * @ see java . util . List # lastIndexOf ( java . lang . Object ) */ public int lastIndexOf ( Object o ) { } }
int index = - 1 ; try { for ( int i = 0 ; i < events . size ( ) ; i ++ ) { if ( events . get ( i ) . equals ( o ) ) { index = i ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } return index ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMechanicalSteelMaterialProperties ( ) { } }
if ( ifcMechanicalSteelMaterialPropertiesEClass == null ) { ifcMechanicalSteelMaterialPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 319 ) ; } return ifcMechanicalSteelMaterialPropertiesEClass ;
public class CatalogContext { /** * Given a class name in the catalog jar , loads it from the jar , even if the * jar is served from an URL and isn ' t in the classpath . * @ param procedureClassName The name of the class to load . * @ return A java Class variable associated with the class . * @ throws ClassNot...
return classForProcedureOrUDF ( procedureClassName , m_catalogInfo . m_jarfile . getLoader ( ) ) ;
public class QuickConstructorGenerator { /** * Returns a factory instance for one type of object . Each method in the * interface defines a constructor via its parameters . Any checked * exceptions declared thrown by the constructor must also be declared by * the method . The method return types can be the same t...
try { return org . cojen . util . QuickConstructorGenerator . getInstance ( objectType , factory ) ; } catch ( NoClassDefFoundError e ) { // Use older code instead . } SoftValuedCache < Class < ? > , Object > innerCache = cCache . get ( factory ) ; if ( innerCache == null ) { innerCache = SoftValuedCache . newCache ( 7...
public class HDUtils { /** * The path is a human - friendly representation of the deterministic path . For example : * " 44H / 0H / 0H / 1 / 1" * Where a letter " H " means hardened key . Spaces are ignored . */ public static List < ChildNumber > parsePath ( @ Nonnull String path ) { } }
String [ ] parsedNodes = path . replace ( "M" , "" ) . split ( "/" ) ; List < ChildNumber > nodes = new ArrayList < > ( ) ; for ( String n : parsedNodes ) { n = n . replaceAll ( " " , "" ) ; if ( n . length ( ) == 0 ) continue ; boolean isHard = n . endsWith ( "H" ) ; if ( isHard ) n = n . substring ( 0 , n . length ( ...
public class RestService { /** * Also audit logs . */ protected void authorizeExport ( Map < String , String > headers ) throws AuthorizationException { } }
String path = headers . get ( Listener . METAINFO_REQUEST_PATH ) ; User user = authorize ( path , new JsonObject ( ) , headers ) ; Action action = Action . Export ; Entity entity = getEntity ( path , null , headers ) ; Long entityId = new Long ( 0 ) ; String descrip = path ; if ( descrip . length ( ) > 1000 ) descrip =...
public class Attendee { /** * { @ inheritDoc } */ public final void validate ( ) throws ValidationException { } }
/* * ; the following are optional , ; but MUST NOT occur more than once ( " ; " cutypeparam ) / ( " ; " memberparam ) / ( " ; " * roleparam ) / ( " ; " partstatparam ) / ( " ; " rsvpparam ) / ( " ; " deltoparam ) / ( " ; " delfromparam ) / ( " ; " * sentbyparam ) / ( " ; " cnparam ) / ( " ; " dirparam ) / ( " ; " l...
public class FnShort { /** * It performs the operation target < sup > power < / sup > and returns its value . The result * precision and rounding mode is specified by the given { @ link MathContext } * @ param power the power to raise the target to * @ param mathContext the { @ link MathContext } to specify preci...
return new Pow ( power , mathContext ) ;
public class Log { /** * Logs warning message about the given element . < br > * @ param msg Message * @ param element Offending element * @ author vvakame */ public static void w ( String msg , Element element ) { } }
messager . printMessage ( Diagnostic . Kind . WARNING , msg , element ) ;
public class LssClient { /** * Get your live preset by live preset name . * @ param request The request object containing all parameters for getting live preset . * @ return Your live preset */ public GetPresetResponse getPreset ( GetPresetRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getName ( ) , "The parameter name should NOT be null or empty string." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . GET , request , LIVE_PRESET , request . getName ( ) ) ; return invokeHttp...
public class BinaryClass { /** * Returns the given input stream ' s contents as a byte array . * If a length is specified ( i . e . if length ! = - 1 ) , only length bytes * are returned . Otherwise all bytes in the stream are returned . * Note this doesn ' t close the stream . * @ throws IOException if a probl...
byte [ ] contents ; if ( length == - 1 ) { contents = new byte [ 0 ] ; int contentsLength = 0 ; int amountRead = - 1 ; do { int amountRequested = Math . max ( stream . available ( ) , DEFAULT_READING_SIZE ) ; // read at least 8K // resize contents if needed if ( contentsLength + amountRequested > contents . length ) { ...