signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ServicesInner { /** * Start service .
* The services resource is the top - level resource that represents the Data Migration Service . This action starts the service and the service can be used for data migration .
* @ param groupName Name of the resource group
* @ param serviceName Name of the servi... | startWithServiceResponseAsync ( groupName , serviceName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class MethodCompiler { /** * Store into local variable
* < p > Stack : . . . , value = & gt ; . . .
* @ param name local variable name
* @ throws IOException
* @ see nameArgument
* @ see addVariable */
public void tstore ( String name ) throws IOException { } } | TypeMirror cn = getLocalType ( name ) ; int index = getLocalVariableIndex ( name ) ; if ( Typ . isPrimitive ( cn ) ) { tstore ( cn , index ) ; } else { astore ( index ) ; } |
public class BufferMgr { /** * Unpins the specified buffer . If the buffer ' s pin count becomes 0 , then
* the threads on the wait list are notified .
* @ param buff
* the buffer to be unpinned */
public void unpin ( Buffer buff ) { } } | BlockId blk = buff . block ( ) ; PinnedBuffer pinnedBuff = pinnedBuffers . get ( blk ) ; if ( pinnedBuff != null ) { pinnedBuff . pinnedCount -- ; if ( pinnedBuff . pinnedCount == 0 ) { bufferPool . unpin ( buff ) ; pinnedBuffers . remove ( blk ) ; synchronized ( bufferPool ) { bufferPool . notifyAll ( ) ; } } } |
public class ReplacedStepTree { /** * This happens when a SqlgVertexStep has a SelectOne step where the label is for an element on the path
* that is before the current optimized steps .
* @ return */
public boolean orderByHasSelectOneStepAndForLabelNotInTree ( ) { } } | Set < String > labels = new HashSet < > ( ) ; for ( ReplacedStep < ? , ? > replacedStep : linearPathToLeafNode ( ) ) { for ( String label : labels ) { labels . add ( SqlgUtil . originalLabel ( label ) ) ; } for ( Pair < Traversal . Admin < ? , ? > , Comparator < ? > > objects : replacedStep . getSqlgComparatorHolder ( ... |
public class ContentType { /** * < p > getInstance . < / p >
* @ param type a { @ link java . lang . String } object .
* @ return a { @ link com . greenpepper . server . domain . component . ContentType } object . */
public static ContentType getInstance ( String type ) { } } | if ( type . equals ( TEST . toString ( ) ) ) { return TEST ; } else if ( type . equals ( REQUIREMENT . toString ( ) ) ) { return REQUIREMENT ; } else if ( type . equals ( BOTH . toString ( ) ) ) { return BOTH ; } return UNKNOWN ; |
public class CommerceSubscriptionEntryPersistenceImpl { /** * Returns the last commerce subscription entry in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matchin... | CommerceSubscriptionEntry commerceSubscriptionEntry = fetchByGroupId_Last ( groupId , orderByComparator ) ; if ( commerceSubscriptionEntry != null ) { return commerceSubscriptionEntry ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append... |
public class UserInfo { /** * Get the table name . */
public String getTableNames ( boolean bAddQuotes ) { } } | return ( m_tableName == null ) ? Record . formatTableNames ( USER_INFO_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ; |
public class GosuStringUtil { /** * < p > Right pad a String with a specified String . < / p >
* < p > The String is padded to the size of < code > size < / code > . < / p >
* < pre >
* GosuStringUtil . rightPad ( null , * , * ) = null
* GosuStringUtil . rightPad ( " " , 3 , " z " ) = " zzz "
* GosuStringUtil... | if ( str == null ) { return null ; } if ( isEmpty ( padStr ) ) { padStr = " " ; } int padLen = padStr . length ( ) ; int strLen = str . length ( ) ; int pads = size - strLen ; if ( pads <= 0 ) { return str ; // returns original String when possible
} if ( padLen == 1 && pads <= PAD_LIMIT ) { return rightPad ( str , siz... |
public class CalendarPicker { /** * / * [ deutsch ]
* < p > Erzeugt einen neuen { @ code CalendarPicker } f & uuml ; r den hebr & auml ; ischen ( j & uuml ; dischen ) Kalender . < / p >
* @ param locale the language and country configuration
* @ param todaySupplier determines the current calendar date
* @ retur... | return CalendarPicker . create ( HebrewCalendar . axis ( ) , new FXCalendarSystemHebrew ( ) , locale , todaySupplier ) ; |
public class JSONObject { /** * Equivalent to { @ code put ( name , value ) } when both parameters are non - null ; does
* nothing otherwise .
* @ param name the name of the property
* @ param value the value of the property
* @ return this object .
* @ throws JSONException if an error occurs */
public JSONOb... | if ( name == null || value == null ) { return this ; } return put ( name , value ) ; |
public class JpaToOneRelation { private String getManyToOneCascade ( ) { } } | Assert . isTrue ( relation . isManyToOne ( ) ) ; return jpaCascade ( this , relation . getFromAttribute ( ) . getColumnConfig ( ) . getManyToOneConfig ( ) , relation . getFromEntity ( ) . getConfig ( ) . getCelerio ( ) . getConfiguration ( ) . getDefaultManyToOneConfig ( ) ) ; |
public class ParaProcessorBuilder { /** * 注册一个类型对应的参数获取器
* ParameterGetterBuilder . me ( ) . regist ( java . lang . String . class , StringParaGetter . class , null ) ;
* @ param typeClass 类型 , 例如 java . lang . Integer . class
* @ param pgClass 参数获取器实现类 , 必须继承ParaGetter
* @ param defaultValue , 默认值 , 比如int的默认值为... | this . typeMap . put ( typeClass . getName ( ) , new Holder ( pgClass , defaultValue ) ) ; |
public class DateAdapter { /** * SECTION : PRE - PROCESSING */
protected String beforeParse ( String string ) { } } | if ( preParseCallback == null ) { return string ; } return preParseCallback . process ( string ) ; |
public class SqlParamUtils { /** * SQLパラメータの解析
* @ param sql 解析対象SQL
* @ return SQLを解析して取得したパラメータキーのセット */
public static Set < String > getSqlParams ( final String sql ) { } } | SqlParser parser = new SqlParserImpl ( sql ) ; ContextTransformer transformer = parser . parse ( ) ; Node rootNode = transformer . getRoot ( ) ; Set < String > params = new LinkedHashSet < > ( ) ; traverseNode ( rootNode , params ) ; params . removeIf ( s -> CONSTANT_PAT . matcher ( s ) . matches ( ) ) ; return params ... |
public class LogManager { /** * Attemps to delete all provided segments from a log and returns how many it was able to */
private int deleteSegments ( Log log , List < LogSegment > segments ) { } } | int total = 0 ; for ( LogSegment segment : segments ) { boolean deleted = false ; try { try { segment . getMessageSet ( ) . close ( ) ; } catch ( IOException e ) { logger . warn ( e . getMessage ( ) , e ) ; } if ( ! segment . getFile ( ) . delete ( ) ) { deleted = true ; } else { total += 1 ; } } finally { logger . war... |
public class DRL6StrictParser { /** * positionalConstraints : = constraint ( COMMA constraint ) * SEMICOLON
* @ param pattern
* @ throws org . antlr . runtime . RecognitionException */
private void positionalConstraints ( PatternDescrBuilder < ? > pattern ) throws RecognitionException { } } | constraint ( pattern , true , "" ) ; if ( state . failed ) return ; while ( input . LA ( 1 ) == DRL6Lexer . COMMA ) { match ( input , DRL6Lexer . COMMA , null , null , DroolsEditorType . SYMBOL ) ; if ( state . failed ) return ; constraint ( pattern , true , "" ) ; if ( state . failed ) return ; } match ( input , DRL6L... |
public class FlowConfigV2Client { /** * Delete a flow configuration
* @ param flowId identifier of flow configuration to delete
* @ throws RemoteInvocationException */
public void deleteFlowConfigWithStateStore ( FlowId flowId ) throws RemoteInvocationException { } } | LOG . debug ( "deleteFlowConfig and state store with groupName " + flowId . getFlowGroup ( ) + " flowName " + flowId . getFlowName ( ) ) ; DeleteRequest < FlowConfig > deleteRequest = _flowconfigsV2RequestBuilders . delete ( ) . id ( new ComplexResourceKey < > ( flowId , new FlowStatusId ( ) ) ) . setHeader ( DELETE_ST... |
public class PropertyTypeRef { /** * Specifies the
* < a href = " http : / / docs . oracle . com / javase / tutorial / javabeans / index . html " target = " _ blank " > JavaBean < / a > to access the
* property from .
* Examples :
* < pre >
* / / import static { @ link org . fest . reflect . core . Reflection... | return new PropertyAccessor < T > ( propertyName , value . rawType ( ) , target ) ; |
public class ValueTaglet { /** * Given the name of the field , return the corresponding VariableElement . Return null
* due to invalid use of value tag if the name is null or empty string and if
* the value tag is not used on a field .
* @ param holder the element holding the tag
* @ param config the current co... | Utils utils = config . utils ; CommentHelper ch = utils . getCommentHelper ( holder ) ; String signature = ch . getReferencedSignature ( tag ) ; if ( signature == null ) { // no reference
// Base case : no label .
if ( utils . isVariableElement ( holder ) ) { return ( VariableElement ) ( holder ) ; } else { // If the v... |
public class LongMatrix { /** * Update all elements based on points
* @ param func */
public < E extends Exception > void updateAll ( final Try . IntBiFunction < Long , E > func ) throws E { } } | if ( isParallelable ( ) ) { if ( rows <= cols ) { IntStream . range ( 0 , rows ) . parallel ( ) . forEach ( new Try . IntConsumer < E > ( ) { @ Override public void accept ( final int i ) throws E { for ( int j = 0 ; j < cols ; j ++ ) { a [ i ] [ j ] = func . apply ( i , j ) ; } } } ) ; } else { IntStream . range ( 0 ,... |
public class RPUtils { /** * Scan for leaves accumulating
* the nodes in the passed in list
* @ param nodes the nodes so far
* @ param scan the tree to scan */
public static void scanForLeaves ( List < RPNode > nodes , RPTree scan ) { } } | scanForLeaves ( nodes , scan . getRoot ( ) ) ; |
public class EnvironmentSettingsInner { /** * Provisions / deprovisions required resources for an environment setting based on current state of the lab / environment setting .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The ... | publishWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , useExistingImage ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class CmsWebdavServlet { /** * Handles the special WebDAV methods . < p >
* @ param req the servlet request we are processing
* @ param resp the servlet response we are creating
* @ throws IOException if an input / output error occurs
* @ throws ServletException if a servlet - specified error occurs */
@... | String method = req . getMethod ( ) ; if ( LOG . isDebugEnabled ( ) ) { String path = getRelativePath ( req ) ; LOG . debug ( "[" + method + "] " + path ) ; } // check authorization
String auth = req . getHeader ( HEADER_AUTHORIZATION ) ; if ( ( auth == null ) || ! auth . toUpperCase ( ) . startsWith ( AUTHORIZATION_BA... |
public class CreateCodeRepositoryRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateCodeRepositoryRequest createCodeRepositoryRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createCodeRepositoryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createCodeRepositoryRequest . getCodeRepositoryName ( ) , CODEREPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( createCodeRepositoryRequest . getGit... |
public class DirtyItemList { /** * Paints all the dirty items in this list using the supplied graphics context . The items are
* removed from the dirty list after being painted and the dirty list ends up empty . */
public void paintAndClear ( Graphics2D gfx ) { } } | int icount = _items . size ( ) ; for ( int ii = 0 ; ii < icount ; ii ++ ) { DirtyItem item = _items . get ( ii ) ; item . paint ( gfx ) ; item . clear ( ) ; _freelist . add ( item ) ; } _items . clear ( ) ; |
public class Expressions { /** * Create a new Template expression
* @ param template template
* @ param args template parameters
* @ return template expression */
public static BooleanTemplate booleanTemplate ( String template , Object ... args ) { } } | return booleanTemplate ( createTemplate ( template ) , ImmutableList . copyOf ( args ) ) ; |
public class ModelConstraints { /** * Checks the foreignkeys of a reference .
* @ param modelDef The model
* @ param refDef The reference descriptor
* @ exception ConstraintException If the value for foreignkey is invalid */
private void checkReferenceForeignkeys ( ModelDef modelDef , ReferenceDescriptorDef refDe... | String foreignkey = refDef . getProperty ( PropertyHelper . OJB_PROPERTY_FOREIGNKEY ) ; if ( ( foreignkey == null ) || ( foreignkey . length ( ) == 0 ) ) { throw new ConstraintException ( "The reference " + refDef . getName ( ) + " in class " + refDef . getOwner ( ) . getName ( ) + " has no foreignkeys" ) ; } // we kno... |
public class Json { /** * Escape quotation mark , reverse solidus and control characters ( U + 0000 through U + 001F ) .
* @ param value
* @ return escaped value
* @ see < a href = " http : / / www . ietf . org / rfc / rfc4627 . txt " > http : / / www . ietf . org / rfc / rfc4627 . txt < / a > */
static String es... | StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { char c = value . charAt ( i ) ; String replacement = REPLACEMENTS . get ( c ) ; if ( replacement != null ) { builder . append ( replacement ) ; } else { builder . append ( c ) ; } } return builder . toString ( ) ; |
public class InjectProgram { /** * Configures a bean given a class to instantiate . */
final protected < T > T configureImpl ( Class < T > type ) // , ContextConfig env )
throws ConfigException { } } | try { T value = type . newInstance ( ) ; InjectContext context = null ; injectTop ( value , context ) ; // Config . init ( value ) ;
return value ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw ConfigException . wrap ( e ) ; } |
public class ProcessStore { /** * Stores a process ( eg . a running script ) , so that the
* process can be reached later ( eg . to cancel it when blocked ) .
* @ param process The process to be stored */
public static synchronized void setProcess ( String applicationName , String scopedInstancePath , Process proce... | PROCESS_MAP . put ( toAgentId ( applicationName , scopedInstancePath ) , process ) ; |
public class Cargo { /** * Does not take into account the possibility of the cargo having been
* ( errouneously ) loaded onto another carrier after it has been unloaded at
* the final destination .
* @ return True if the cargo has been unloaded at the final destination . */
public boolean isUnloadedAtDestination ... | for ( HandlingEvent event : deliveryHistory ( ) . eventsOrderedByCompletionTime ( ) ) { if ( Type . UNLOAD . equals ( event . getType ( ) ) && getDestination ( ) . equals ( event . getLocation ( ) ) ) { return true ; } } return false ; |
public class ModelsImpl { /** * Update an entity role for a given entity .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param hEntityId The hierarchical entity extractor ID .
* @ param roleId The entity role ID .
* @ param updateHierarchicalEntityRoleOptionalParameter the obje... | return ServiceFuture . fromResponse ( updateHierarchicalEntityRoleWithServiceResponseAsync ( appId , versionId , hEntityId , roleId , updateHierarchicalEntityRoleOptionalParameter ) , serviceCallback ) ; |
public class GaloisField { /** * Perform Gaussian elimination on the given matrix . This matrix has to be a
* fat matrix ( number of rows > number of columns ) . */
public void gaussianElimination ( int [ ] [ ] matrix ) { } } | assert ( matrix != null && matrix . length > 0 && matrix [ 0 ] . length > 0 && matrix . length < matrix [ 0 ] . length ) ; int height = matrix . length ; int width = matrix [ 0 ] . length ; for ( int i = 0 ; i < height ; i ++ ) { boolean pivotFound = false ; // scan the column for a nonzero pivot and swap it to the dia... |
public class AbstractExternalAuthenticationController { /** * Checks if the IsPassive flag is set in the AuthnRequest and fails with a NO _ PASSIVE error code if this is the case .
* Implementations that do support passive authentication MUST override this method and handle the IsPassive
* processing themselves .
... | final AuthnRequest authnRequest = this . getAuthnRequest ( profileRequestContext ) ; if ( authnRequest != null && authnRequest . isPassive ( ) != null && authnRequest . isPassive ( ) == Boolean . TRUE ) { logger . info ( "AuthnRequest contains IsPassive=true, can not continue ..." ) ; Status status = IdpErrorStatusExce... |
public class Cluster { /** * In the event that the node has been evicted and is reconnecting , this method
* clears out all existing state before relaunching to ensure a clean launch . */
private void ensureCleanStartup ( ) { } } | forceShutdown ( ) ; ScheduledThreadPoolExecutor oldPool = pool . getAndSet ( createScheduledThreadExecutor ( ) ) ; oldPool . shutdownNow ( ) ; claimedForHandoff . clear ( ) ; workUnitsPeggedToMe . clear ( ) ; state . set ( NodeState . Fresh ) ; |
public class ReflectUtil { /** * Returns a setter method based on the fieldName and the java beans setter naming convention or null if none exists .
* If multiple setters with different parameter types are present , an exception is thrown .
* If they have the same parameter type , one of those methods is returned .... | String setterName = buildSetterName ( fieldName ) ; try { // Using getMathods ( ) , getMathod ( . . . ) expects exact parameter type
// matching and ignores inheritance - tree .
Method [ ] methods = clazz . getMethods ( ) ; List < Method > candidates = new ArrayList < Method > ( ) ; Set < Class < ? > > parameterTypes =... |
public class MessageDigestFileDigester { /** * { @ inheritDoc } */
public String calculate ( File file ) throws DigesterException , NoSuchAlgorithmException { } } | // Try to open the file .
FileInputStream fis ; try { fis = new FileInputStream ( file ) ; } catch ( Exception e ) { throw new DigesterException ( "Unable not read " + file . getPath ( ) + ": " + e . getMessage ( ) ) ; } String result ; try { MessageDigest messageDigest = MessageDigest . getInstance ( algorithm ) ; // ... |
public class GanttDesignerReader { /** * Read task data from a Gantt Designer file .
* @ param gantt Gantt Designer file */
private void processTasks ( Gantt gantt ) { } } | ProjectCalendar calendar = m_projectFile . getDefaultCalendar ( ) ; for ( Gantt . Tasks . Task ganttTask : gantt . getTasks ( ) . getTask ( ) ) { String wbs = ganttTask . getID ( ) ; ChildTaskContainer parentTask = getParentTask ( wbs ) ; Task task = parentTask . addTask ( ) ; // ganttTask . getB ( ) / / bar type
// ga... |
public class FileSystem { /** * create a directory with the provided permission
* The permission of the directory is set to be the provided permission as in
* setPermission , not permission & ~ umask
* @ see # create ( FileSystem , Path , FsPermission )
* @ param fs file system handle
* @ param dir the name o... | // create the directory using the default permission
boolean result = fs . mkdirs ( dir ) ; // set its permission to be the supplied one
fs . setPermission ( dir , permission ) ; return result ; |
public class Measure { /** * setter for unit - sets iso
* @ generated
* @ param v value to set into the feature */
public void setUnit ( String v ) { } } | if ( Measure_Type . featOkTst && ( ( Measure_Type ) jcasType ) . casFeat_unit == null ) jcasType . jcas . throwFeatMissing ( "unit" , "ch.epfl.bbp.uima.types.Measure" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Measure_Type ) jcasType ) . casFeatCode_unit , v ) ; |
public class ManagementPoliciesInner { /** * Sets the managementpolicy to the specified storage account .
* @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive .
* @ param accountName The name of the storage account within the specified resource g... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , accountName , policy ) . map ( new Func1 < ServiceResponse < ManagementPolicyInner > , ManagementPolicyInner > ( ) { @ Override public ManagementPolicyInner call ( ServiceResponse < ManagementPolicyInner > response ) { return response . body ( ) ; } } ... |
public class GenJsCodeVisitor { /** * Example :
* < pre >
* { for $ foo in $ boo . foos }
* { ifempty }
* { / for }
* < / pre >
* might generate
* < pre >
* var foo2List = opt _ data . boo . foos ;
* var foo2ListLen = foo2List . length ;
* if ( foo2ListLen > 0 ) {
* } else {
* < / pre > */
@ Ove... | boolean hasIfempty = ( node . numChildren ( ) == 2 ) ; // NOTE : below we call id ( varName ) on a number of variables instead of using
// VariableDeclaration . ref ( ) , this is because the refs ( ) might be referenced on the other side
// of a call to visitChildrenReturningCodeChunk .
// That will break the normal be... |
public class DbEntityManager { /** * Flushes the entity cache :
* Depending on the entity state , the required { @ link DbOperation } is performed and the cache is updated . */
protected void flushEntityCache ( ) { } } | List < CachedDbEntity > cachedEntities = dbEntityCache . getCachedEntities ( ) ; for ( CachedDbEntity cachedDbEntity : cachedEntities ) { flushCachedEntity ( cachedDbEntity ) ; } // log cache state after flush
LOG . flushedCacheState ( dbEntityCache . getCachedEntities ( ) ) ; |
public class AbstractOAuthGetToken { /** * Executes the HTTP request for a temporary or long - lived token .
* @ return OAuth credentials response object */
public final OAuthCredentialsResponse execute ( ) throws IOException { } } | HttpRequestFactory requestFactory = transport . createRequestFactory ( ) ; HttpRequest request = requestFactory . buildRequest ( usePost ? HttpMethods . POST : HttpMethods . GET , this , null ) ; createParameters ( ) . intercept ( request ) ; HttpResponse response = request . execute ( ) ; response . setContentLoggingL... |
public class ElemTemplateElement { /** * This after the template ' s children have been composed . */
public void endCompose ( StylesheetRoot sroot ) throws TransformerException { } } | StylesheetRoot . ComposeState cstate = sroot . getComposeState ( ) ; cstate . popStackMark ( ) ; |
public class CmsSitemapController { /** * Loads the model pages . < p > */
public void loadModelPages ( ) { } } | CmsRpcAction < CmsModelInfo > action = new CmsRpcAction < CmsModelInfo > ( ) { @ Override public void execute ( ) { start ( 500 , false ) ; getService ( ) . getModelInfos ( m_data . getRoot ( ) . getId ( ) , this ) ; } @ Override protected void onResponse ( CmsModelInfo result ) { stop ( false ) ; CmsSitemapView . getI... |
public class Bootstrap { /** * Support customized language config
* @ param dataMaster master of the config
* @ param locale The Locale to set .
* @ param randomGenerator specific random generator
* @ return FariyModule instance in accordance with locale */
private static FairyModule getFairyModuleForLocale ( D... | LanguageCode code ; try { code = LanguageCode . valueOf ( locale . getLanguage ( ) . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { LOG . warn ( "Uknown locale " + locale ) ; code = LanguageCode . EN ; } switch ( code ) { case PL : return new PlFairyModule ( dataMaster , randomGenerator ) ; case EN : retu... |
public class RemediationConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RemediationConfiguration remediationConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( remediationConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( remediationConfiguration . getConfigRuleName ( ) , CONFIGRULENAME_BINDING ) ; protocolMarshaller . marshall ( remediationConfiguration . getTargetType ( ) , TAR... |
public class BshArray { /** * Find a more specific type if the element type is Object . class .
* @ param baseType the element type
* @ param fromValue the array to inspect
* @ param length the length of the array
* @ return baseType unless baseType is Object . class and common is not */
public static Class < ?... | if ( Object . class != baseType ) return baseType ; Class < ? > common = null ; int len = length . getAsInt ( ) ; for ( int i = 0 ; i < len ; i ++ ) if ( Object . class == ( common = Types . getCommonType ( common , Types . getType ( Array . get ( fromValue , 0 ) ) ) ) ) break ; if ( null != common && common != baseTyp... |
public class AnnotationDB { /** * Scanns both the method and its parameters for annotations .
* @ param cf */
protected void scanMethods ( ClassFile cf ) { } } | List < ClassFile > methods = cf . getMethods ( ) ; if ( methods == null ) return ; for ( Object obj : methods ) { MethodInfo method = ( MethodInfo ) obj ; if ( scanMethodAnnotations ) { AnnotationsAttribute visible = ( AnnotationsAttribute ) method . getAttribute ( AnnotationsAttribute . visibleTag ) ; AnnotationsAttri... |
public class SerializedFormBuilder { /** * Build the serialized form . */
public void build ( ) throws IOException { } } | if ( ! serialClassFoundToDocument ( configuration . root . classes ( ) ) ) { // Nothing to document .
return ; } try { writer = configuration . getWriterFactory ( ) . getSerializedFormWriter ( ) ; if ( writer == null ) { // Doclet does not support this output .
return ; } } catch ( Exception e ) { throw new DocletAbort... |
public class MultifactorTrustedDevicesReportEndpoint { /** * Devices registered and trusted .
* @ return the set */
@ ReadOperation public Set < ? extends MultifactorAuthenticationTrustRecord > devices ( ) { } } | val onOrAfter = expireRecordsByDate ( ) ; return this . mfaTrustEngine . get ( onOrAfter ) ; |
public class StatefulRandomIntSpout { /** * These two methods are required to implement the IStatefulComponent interface */
@ Override public void preSave ( String checkpointId ) { } } | System . out . println ( String . format ( "Saving spout state at checkpoint %s" , checkpointId ) ) ; |
public class SynchronousParameterUpdater { /** * Returns the current status of this parameter server
* updater
* @ return */
@ Override public Map < String , Number > status ( ) { } } | Map < String , Number > ret = new HashMap < > ( ) ; ret . put ( "workers" , workers ) ; ret . put ( "accumulatedUpdates" , numUpdates ( ) ) ; return ret ; |
public class ReadOnlyStyledDocument { /** * Note : there must be a " ensureValid _ ( ) " call preceding the call of this method */
private Tuple3 < ReadOnlyStyledDocument < PS , SEG , S > , RichTextChange < PS , SEG , S > , MaterializedListModification < Paragraph < PS , SEG , S > > > replace ( BiIndex start , BiIndex ... | int pos = tree . getSummaryBetween ( 0 , start . major ) . map ( s -> s . length ( ) + 1 ) . orElse ( 0 ) + start . minor ; List < Paragraph < PS , SEG , S > > removedPars = getParagraphs ( ) . subList ( start . major , end . major + 1 ) ; return end . map ( this :: split ) . map ( ( l0 , r ) -> { return start . map ( ... |
public class BitapPattern { /** * Returns a BitapMatcher preforming a fuzzy search in a whole { @ code sequence } . Search allows no more than { @ code
* maxNumberOfErrors } number of substitutions / insertions / deletions . Matcher will return positions of last matched
* letter in the motif in ascending order .
... | return substitutionAndIndelMatcherLast ( maxNumberOfErrors , sequence , 0 , sequence . size ( ) ) ; |
public class OtterController { /** * = = = = = mbean info = = = = = */
public String getHeapMemoryUsage ( ) { } } | MemoryUsage memoryUsage = ManagementFactory . getMemoryMXBean ( ) . getHeapMemoryUsage ( ) ; return JsonUtils . marshalToString ( memoryUsage ) ; |
public class RedisClient { /** * Deletes inverted indexes from redis .
* @ param connection
* redis instance .
* @ param wrapper
* attribute wrapper
* @ param member
* sorted set member name . */
private void unIndex ( final Object connection , final AttributeWrapper wrapper , final String member ) { } } | Set < String > keys = wrapper . getIndexes ( ) . keySet ( ) ; for ( String key : keys ) { if ( resource != null && resource . isActive ( ) ) { ( ( Transaction ) connection ) . zrem ( key , member ) ; } else { ( ( Pipeline ) connection ) . zrem ( key , member ) ; } } |
public class BottomSheet { /** * Sets the sensitivity , which specifies the distance after which dragging has an effect on the
* bottom sheet , in relation to an internal value range .
* @ param dragSensitivity
* The drag sensitivity , which should be set , as a { @ link Float } value . The drag
* sensitivity m... | Condition . INSTANCE . ensureAtLeast ( dragSensitivity , 0 , "The drag sensitivity must be at least 0" ) ; Condition . INSTANCE . ensureAtMaximum ( dragSensitivity , 1 , "The drag sensitivity must be at maximum 1" ) ; this . dragSensitivity = dragSensitivity ; adaptDragSensitivity ( ) ; |
public class EglCore { /** * Makes our EGL context current , using the supplied surface for both " draw " and " read " . */
public void makeCurrent ( EGLSurface eglSurface ) { } } | if ( mEGLDisplay == EGL14 . EGL_NO_DISPLAY ) { // called makeCurrent ( ) before create ?
Log . d ( TAG , "NOTE: makeCurrent w/o display" ) ; } if ( ! EGL14 . eglMakeCurrent ( mEGLDisplay , eglSurface , eglSurface , mEGLContext ) ) { throw new RuntimeException ( "eglMakeCurrent failed" ) ; } |
public class ConnectionWatcher { /** * 含有重试机制的retry , 加锁 , 一直尝试连接 , 直至成功 */
public synchronized void reconnect ( ) { } } | LOGGER . info ( "start to reconnect...." ) ; int retries = 0 ; while ( true ) { try { if ( ! zk . getState ( ) . equals ( States . CLOSED ) ) { break ; } LOGGER . warn ( "zookeeper lost connection, reconnect" ) ; close ( ) ; connect ( internalHost ) ; } catch ( Exception e ) { LOGGER . error ( retries + "\t" + e . toSt... |
public class SparseMatrix { /** * Applies the given { @ code procedure } to each non - zero element of the specified column of this matrix .
* @ param j the column index .
* @ param procedure the { @ link VectorProcedure } . */
public void eachNonZeroInColumn ( int j , VectorProcedure procedure ) { } } | VectorIterator it = nonZeroIteratorOfColumn ( j ) ; while ( it . hasNext ( ) ) { double x = it . next ( ) ; int i = it . index ( ) ; procedure . apply ( i , x ) ; } |
public class AbstractDatatypeDetector { /** * Called from { @ link # registerDefaultDatatypes ( ) } to add JSR310 datatypes . Can also be called standalone or
* overridden for customization . */
protected void registerJavaTimeDatatypes ( ) { } } | // prevent compile - time dependencies and GWT availability problems
registerStandardDatatype ( "java.time.LocalTime" ) ; registerStandardDatatype ( "java.time.LocalDate" ) ; registerStandardDatatype ( "java.time.LocalDateTime" ) ; registerStandardDatatype ( "java.time.MonthDay" ) ; registerStandardDatatype ( "java.tim... |
public class StringCharacterIterator { /** * Implements CharacterIterator . next ( ) for String .
* @ see CharacterIterator # next
* @ deprecated ICU 2.4 . Use java . text . StringCharacterIterator instead . */
@ Deprecated public char next ( ) { } } | if ( pos < end - 1 ) { pos ++ ; return text . charAt ( pos ) ; } else { pos = end ; return DONE ; } |
public class FSNamesystem { /** * Counts the number of live nodes in the given list */
private int countLiveNodes ( Block b , Iterator < DatanodeDescriptor > nodeIter ) { } } | int live = 0 ; Collection < DatanodeDescriptor > nodesCorrupt = null ; if ( corruptReplicas . size ( ) != 0 ) { nodesCorrupt = corruptReplicas . getNodes ( b ) ; } while ( nodeIter . hasNext ( ) ) { DatanodeDescriptor node = nodeIter . next ( ) ; if ( ( ( nodesCorrupt != null ) && ( nodesCorrupt . contains ( node ) ) )... |
public class ExceptionUtils { /** * < p > Returns the list of < code > Throwable < / code > objects in the
* exception chain . < / p >
* < p > A throwable without cause will return a list containing
* one element - the input throwable .
* A throwable with one cause will return a list containing
* two elements... | final List < Throwable > list = new ArrayList < > ( ) ; while ( throwable != null && ! list . contains ( throwable ) ) { list . add ( throwable ) ; throwable = throwable . getCause ( ) ; } return list ; |
public class PCA { /** * Returns the first non zero column
* @ param x the matrix to get a column from
* @ return the first non zero column */
private static Vec getColumn ( Matrix x ) { } } | Vec t ; for ( int i = 0 ; i < x . cols ( ) ; i ++ ) { t = x . getColumn ( i ) ; if ( t . dot ( t ) > 0 ) return t ; } throw new ArithmeticException ( "Matrix is essentially zero" ) ; |
public class SimonUtils { /** * Shrinks the middle of the input string if it is too long , so it does not exceed limitTo .
* @ since 3.2 */
public static String compact ( String input , int limitTo ) { } } | if ( input == null || input . length ( ) <= limitTo ) { return input ; } int headLength = limitTo / 2 ; int tailLength = limitTo - SHRINKED_STRING . length ( ) - headLength ; if ( tailLength < 0 ) { tailLength = 1 ; } return input . substring ( 0 , headLength ) + SHRINKED_STRING + input . substring ( input . length ( )... |
public class Portmapper { /** * Given program and version of a service , query its tcp port number
* @ param program
* The program number , used to identify it for RPC calls .
* @ param version
* The program version number , used to identify it for RPC calls .
* @ param serverIP
* The server IP address .
... | GetPortResponse response = null ; GetPortRequest request = new GetPortRequest ( program , version ) ; for ( int i = 0 ; i < _maxRetry ; ++ i ) { try { Xdr portmapXdr = new Xdr ( PORTMAP_MAX_REQUEST_SIZE ) ; request . marshalling ( portmapXdr ) ; Xdr reply = NetMgr . getInstance ( ) . sendAndWait ( serverIP , PMAP_PORT ... |
public class ClassUtils { /** * Gets the constructor with the specified signature from the given class type .
* @ param < T > the generic class type from which to get the constructor .
* @ param type the Class type from which to get the Constructor .
* @ param parameterTypes an array of class types indicating the... | try { return type . getDeclaredConstructor ( parameterTypes ) ; } catch ( NoSuchMethodException cause ) { throw new ConstructorNotFoundException ( cause ) ; } |
public class ConstantsSummaryBuilder { /** * Build the summary for the current class .
* @ param node the XML element that specifies which components to document
* @ param summariesTree the tree to which the class constant summary will be added */
public void buildClassConstantSummary ( XMLNode node , Content summa... | ClassDoc [ ] classes = currentPackage . name ( ) . length ( ) > 0 ? currentPackage . allClasses ( ) : configuration . classDocCatalog . allClasses ( DocletConstants . DEFAULT_PACKAGE_NAME ) ; Arrays . sort ( classes ) ; Content classConstantTree = writer . getClassConstantHeader ( ) ; for ( int i = 0 ; i < classes . le... |
public class AmazonNeptuneClient { /** * Lists all the subscription descriptions for a customer account . The description for a subscription includes
* SubscriptionName , SNSTopicARN , CustomerID , SourceType , SourceID , CreationTime , and Status .
* If you specify a SubscriptionName , lists the description for th... | request = beforeClientExecution ( request ) ; return executeDescribeEventSubscriptions ( request ) ; |
public class NumberChineseFormater { /** * 阿拉伯数字转换成中文 , 小数点后四舍五入保留两位 . 使用于整数 、 小数的转换 .
* @ param amount 数字
* @ param isUseTraditional 是否使用繁体
* @ param isMoneyMode 是否为金额模式
* @ return 中文 */
public static String format ( double amount , boolean isUseTraditional , boolean isMoneyMode ) { } } | final String [ ] numArray = isUseTraditional ? traditionalDigits : simpleDigits ; if ( amount > 99999999999999.99 || amount < - 99999999999999.99 ) { throw new IllegalArgumentException ( "Number support only: (-99999999999999.99 ~ 99999999999999.99)!" ) ; } boolean negative = false ; if ( amount < 0 ) { negative = true... |
public class DatabaseRelationDefinition { /** * gets attribute with the specified position
* @ param index is position < em > starting at 1 < / em >
* @ return attribute at the position */
@ Override public Attribute getAttribute ( int index ) { } } | Attribute attribute = attributes . get ( index - 1 ) ; return attribute ; |
public class HandyDateExpressionObject { protected AccessibleConfig getApplicationConfig ( ) { } } | if ( cachedApplicationConfig != null ) { return cachedApplicationConfig ; } synchronized ( this ) { if ( cachedApplicationConfig != null ) { return cachedApplicationConfig ; } cachedApplicationConfig = ContainerUtil . getComponent ( AccessibleConfig . class ) ; } return cachedApplicationConfig ; |
public class MessageMgr { /** * Creates a new information message .
* @ param what the what part of the message ( what has happened )
* @ param obj objects to add to the message
* @ return new information message */
public static Message5WH createInfoMessage ( String what , Object ... obj ) { } } | return new Message5WH_Builder ( ) . addWhat ( FormattingTupleWrapper . create ( what , obj ) ) . setType ( E_MessageType . INFO ) . build ( ) ; |
public class TaskLockbox { /** * Release lock held for a task on a particular interval . Does nothing if the task does not currently
* hold the mentioned lock .
* @ param task task to unlock
* @ param interval interval to unlock */
public void unlock ( final Task task , final Interval interval ) { } } | giant . lock ( ) ; try { final String dataSource = task . getDataSource ( ) ; final NavigableMap < DateTime , SortedMap < Interval , List < TaskLockPosse > > > dsRunning = running . get ( task . getDataSource ( ) ) ; if ( dsRunning == null || dsRunning . isEmpty ( ) ) { return ; } final SortedMap < Interval , List < Ta... |
public class SolrIndex { /** * Wait for all the collection shards to be ready . */
private static void waitForRecoveriesToFinish ( CloudSolrClient server , String collection ) throws KeeperException , InterruptedException { } } | ZkStateReader zkStateReader = server . getZkStateReader ( ) ; try { boolean cont = true ; while ( cont ) { boolean sawLiveRecovering = false ; zkStateReader . updateClusterState ( true ) ; ClusterState clusterState = zkStateReader . getClusterState ( ) ; Map < String , Slice > slices = clusterState . getSlicesMap ( col... |
public class LogTransferListener { /** * ( non - Javadoc )
* @ see org . sonatype . aether . util . listener . AbstractTransferListener # transferInitiated
* ( org . sonatype . aether . transfer . TransferEvent ) */
@ Override public void transferInitiated ( TransferEvent event ) { } } | TransferResource resource = event . getResource ( ) ; StringBuilder sb = new StringBuilder ( ) . append ( event . getRequestType ( ) == TransferEvent . RequestType . PUT ? "Uploading" : "Downloading" ) . append ( ":" ) . append ( resource . getRepositoryUrl ( ) ) . append ( resource . getResourceName ( ) ) ; downloads ... |
public class ScanIterator { /** * Sequentially iterate over elements in a set identified by { @ code key } . This method uses { @ code SSCAN } to perform an
* iterative scan .
* @ param commands the commands interface , must not be { @ literal null } .
* @ param key the set to scan .
* @ param scanArgs the scan... | LettuceAssert . notNull ( scanArgs , "ScanArgs must not be null" ) ; return sscan ( commands , key , Optional . of ( scanArgs ) ) ; |
public class IterationSegmentStages { /** * During iteration , nextTier ( ) is called in doReplaceValue ( ) - > relocation ( ) - > alloc ( ) .
* When the entry is relocated to the next tier , an entry should be inserted into hash
* lookup . To insert an entry into hashLookup , should 1 ) locate empty slot , see { @... | super . nextTier ( ) ; if ( it . hashLookupEntryInit ( ) ) hls . initSearchKey ( hh . h ( ) . hashLookup . key ( it . hashLookupEntry ) ) ; |
public class Helpers { /** * Checks if a parameter exists . If it exists , it is updated . If it doesn ' t , it is created . Only works for parameters which key is
* unique . Will create a transaction on the given entity manager . */
static void setSingleParam ( String key , String value , DbConn cnx ) { } } | QueryResult r = cnx . runUpdate ( "globalprm_update_value_by_key" , value , key ) ; if ( r . nbUpdated == 0 ) { cnx . runUpdate ( "globalprm_insert" , key , value ) ; } cnx . commit ( ) ; |
public class JobHistoryService { /** * Returns a specific job ' s data by job ID
* @ param jobId the fully qualified cluster + job identifier
* @ param populateTasks if { @ code true } populate the { @ link TaskDetails }
* records for the job */
public JobDetails getJobByJobID ( QualifiedJobId jobId , boolean pop... | JobDetails job = null ; JobKey key = idService . getJobKeyById ( jobId ) ; if ( key != null ) { byte [ ] historyKey = jobKeyConv . toBytes ( key ) ; Table historyTable = hbaseConnection . getTable ( TableName . valueOf ( Constants . HISTORY_TABLE ) ) ; Result result = historyTable . get ( new Get ( historyKey ) ) ; his... |
public class FunctionUtils { /** * Do if function .
* @ param < R > the type parameter
* @ param condition the condition
* @ param trueFunction the true function
* @ param falseFunction the false function
* @ return the function */
@ SneakyThrows public static < R > Supplier < R > doIf ( final boolean conditi... | return ( ) -> { try { if ( condition ) { return trueFunction . get ( ) ; } return falseFunction . get ( ) ; } catch ( final Throwable e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; return falseFunction . get ( ) ; } } ; |
public class MessageSource { /** * Get a raw message from the resource bundles using the given code . */
public String getMessage ( final String code ) { } } | assert code != null ; MissingResourceException error = null ; ResourceBundle [ ] bundles = getBundles ( ) ; for ( int i = 0 ; i < bundles . length ; i ++ ) { try { return bundles [ i ] . getString ( code ) ; } catch ( MissingResourceException e ) { // FIXME : For now just save the first error , should really roll a new... |
public class JoinableResourceBundlePropertySerializer { /** * Returns the list of bundle names
* @ param bundles
* the bundles
* @ return the list of bundle names */
private static List < String > getBundleNames ( List < JoinableResourceBundle > bundles ) { } } | List < String > bundleNames = new ArrayList < > ( ) ; for ( Iterator < JoinableResourceBundle > iterator = bundles . iterator ( ) ; iterator . hasNext ( ) ; ) { bundleNames . add ( iterator . next ( ) . getName ( ) ) ; } return bundleNames ; |
public class ListTagsLogGroupRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListTagsLogGroupRequest listTagsLogGroupRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listTagsLogGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listTagsLogGroupRequest . getLogGroupName ( ) , LOGGROUPNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ... |
public class DatabaseSpec { /** * Truncate table in MongoDB .
* @ param database Mongo database
* @ param table Mongo table */
@ Given ( "^I drop every document at a MongoDB database '(.+?)' and table '(.+?)'" ) public void truncateTableInMongo ( String database , String table ) { } } | commonspec . getMongoDBClient ( ) . connectToMongoDBDataBase ( database ) ; commonspec . getMongoDBClient ( ) . dropAllDataMongoDBCollection ( table ) ; |
public class DateFunctions { /** * Returned expression results in Date part as an integer .
* The date expression is a string in a supported format , and part is one of the supported date part strings . */
public static Expression datePartStr ( Expression expression , DatePartExt part ) { } } | return x ( "DATE_PART_STR(" + expression . toString ( ) + ", \"" + part . toString ( ) + "\")" ) ; |
public class SaneSession { /** * Lists the devices known to the SANE daemon .
* @ return a list of devices that may be opened , see { @ link SaneDevice # open }
* @ throws IOException if an error occurs while communicating with the SANE daemon
* @ throws SaneException if the SANE backend returns an error in respo... | outputStream . write ( SaneRpcCode . SANE_NET_GET_DEVICES ) ; outputStream . flush ( ) ; return inputStream . readDeviceList ( ) ; |
public class AWSCodeCommitClient { /** * Returns the base - 64 encoded content of an individual blob within a repository .
* @ param getBlobRequest
* Represents the input of a get blob operation .
* @ return Result of the GetBlob operation returned by the service .
* @ throws RepositoryNameRequiredException
*... | request = beforeClientExecution ( request ) ; return executeGetBlob ( request ) ; |
public class ProtoUtils { /** * Given a protobuf rebalance - partition info , converts it into our
* rebalance - partition info
* @ param rebalanceTaskInfoMap Proto - buff version of
* RebalanceTaskInfoMap
* @ return RebalanceTaskInfo object . */
public static RebalanceTaskInfo decodeRebalanceTaskInfoMap ( VAdm... | RebalanceTaskInfo rebalanceTaskInfo = new RebalanceTaskInfo ( rebalanceTaskInfoMap . getStealerId ( ) , rebalanceTaskInfoMap . getDonorId ( ) , decodeStoreToPartitionIds ( rebalanceTaskInfoMap . getPerStorePartitionIdsList ( ) ) , new ClusterMapper ( ) . readCluster ( new StringReader ( rebalanceTaskInfoMap . getInitia... |
public class BroadleafPayPalCheckoutController { /** * Completes checkout for a PayPal payment . If there ' s already a PayPal payment we go ahead and make sure the details
* of the payment are updated to all of the forms filled out by the customer since they could ' ve updated shipping
* information , added a prom... | paymentService . updatePayPalPaymentForFulfillment ( ) ; String paymentId = paymentService . getPayPalPaymentIdFromCurrentOrder ( ) ; String payerId = paymentService . getPayPalPayerIdFromCurrentOrder ( ) ; if ( StringUtils . isBlank ( paymentId ) ) { throw new PaymentException ( "Unable to complete checkout because no... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CovarianceElementType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link CovarianceElementType } { ... | return new JAXBElement < CovarianceElementType > ( _IncludesElement_QNAME , CovarianceElementType . class , null , value ) ; |
public class RPMBuilder { /** * Add file to package from path .
* @ param source
* @ param target Target path like / opt / application / bin / foo
* @ return
* @ throws IOException */
@ Override public FileBuilder addFile ( Path source , Path target ) throws IOException { } } | checkTarget ( target ) ; FileBuilder fb = new FileBuilder ( ) ; fb . target = target ; fb . size = ( int ) Files . size ( source ) ; try ( FileChannel fc = FileChannel . open ( source , READ ) ) { fb . content = fc . map ( FileChannel . MapMode . READ_ONLY , 0 , fb . size ) ; } FileTime fileTime = Files . getLastModifi... |
public class MiniSatStyleSolver { /** * Computes the next number in the Luby sequence .
* @ param y the restart increment
* @ param x the current number of restarts
* @ return the next number in the Luby sequence */
protected static double luby ( double y , int x ) { } } | int intX = x ; int size = 1 ; int seq = 0 ; while ( size < intX + 1 ) { seq ++ ; size = 2 * size + 1 ; } while ( size - 1 != intX ) { size = ( size - 1 ) >> 1 ; seq -- ; intX = intX % size ; } return Math . pow ( y , seq ) ; |
public class BatchListIncomingTypedLinksResponseMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchListIncomingTypedLinksResponse batchListIncomingTypedLinksResponse , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchListIncomingTypedLinksResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchListIncomingTypedLinksResponse . getLinkSpecifiers ( ) , LINKSPECIFIERS_BINDING ) ; protocolMarshaller . marshall ( batchListIncomingTypedLinksR... |
public class WatchTextBatchSpout { /** * { @ inheritDoc } */
@ SuppressWarnings ( { } } | "rawtypes" } ) @ Override public void open ( Map conf , TopologyContext context ) { this . taskIndex = context . getThisTaskIndex ( ) ; this . dataFileName = this . baseFileName + "_" + this . taskIndex ; this . targetFile = new File ( this . dataFileDir , this . dataFileName ) ; |
public class GregorianCalendar { /** * Sets the GregorianCalendar change date . This is the point when the switch
* from Julian dates to Gregorian dates occurred . Default is October 15,
* 1582 . Previous to this , dates will be in the Julian calendar .
* To obtain a pure Julian calendar , set the change date to ... | gregorianCutover = date . getTime ( ) ; // If the cutover has an extreme value , then create a pure
// Gregorian or pure Julian calendar by giving the cutover year and
// JD extreme values .
if ( gregorianCutover <= MIN_MILLIS ) { gregorianCutoverYear = cutoverJulianDay = Integer . MIN_VALUE ; } else if ( gregorianCuto... |
public class BELUtilities { /** * Returns the first message available in a stack trace .
* This method can be used to obtain the first occurrence of
* { @ link Exception # getMessage ( ) the exception message } through a series of
* { @ link Exception # getCause ( ) causes } .
* @ param t the { @ link Throwable... | if ( t == null ) { return null ; } String ret = t . getMessage ( ) ; Throwable cause = t ; while ( cause . getCause ( ) != null ) { cause = cause . getCause ( ) ; if ( cause . getMessage ( ) != null ) { ret = cause . getMessage ( ) ; } } return ret ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.