signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InconsistentProperty { /** * < code > map & lt ; string , . alluxio . grpc . meta . InconsistentPropertyValues & gt ; values = 2 ; < / code > */ public java . util . Map < java . lang . String , alluxio . grpc . InconsistentPropertyValues > getValuesMap ( ) { } }
return internalGetValues ( ) . getMap ( ) ;
public class SafeTraceLevelIndexFactory { /** * Create the package index from the contents of the resource . * @ param resourceName The resource name to load the trace list from . */ public static PackageIndex < Integer > createPackageIndex ( String resourceName ) { } }
PackageIndex < Integer > packageIndex = new PackageIndex < Integer > ( ) ; BufferedReader br = null ; try { br = getLibertyTraceListReader ( resourceName ) ; addFiltersAndValuesToIndex ( br , packageIndex ) ; } catch ( IOException e ) { System . err . println ( "Unable to load " + resourceName ) ; } finally { tryToClos...
public class NoRegExpMatching { /** * opens and returns the requested filename string * @ throws SftpStatusException */ public String [ ] matchFileNamesWithPattern ( File [ ] files , String fileNameRegExp ) throws SshException , SftpStatusException { } }
String [ ] thefile = new String [ 1 ] ; thefile [ 0 ] = files [ 0 ] . getName ( ) ; return thefile ;
public class ProtoNetworkMerger { /** * Remaps { @ link TableProtoEdge proto edges } for a * { @ link TableStatement statement } . A new statement index is created from * a merge which requires the old { @ link TableProtoEdge proto edges } to be * associated with it . * @ see https : / / github . com / OpenBEL ...
ProtoNodeTable nt = protoNetwork2 . getProtoNodeTable ( ) ; Map < Integer , Integer > nodeTermIndex = nt . getNodeTermIndex ( ) ; TableProtoEdge [ ] remappedEdges = new TableProtoEdge [ edgeIndices . size ( ) ] ; int i = 0 ; for ( Integer edgeIndex : edgeIndices ) { TableProtoEdge edge = edges . get ( edgeIndex ) ; int...
public class UniqueId { /** * Converts a Long to a byte array with the proper UID width * @ param uid The UID to convert * @ param width The width of the UID in bytes * @ return The UID as a byte array * @ throws IllegalStateException if the UID is larger than the width would * allow * @ since 2.1 */ public...
// Verify that we ' re going to drop bytes that are 0. final byte [ ] padded = Bytes . fromLong ( uid ) ; for ( int i = 0 ; i < padded . length - width ; i ++ ) { if ( padded [ i ] != 0 ) { final String message = "UID " + Long . toString ( uid ) + " was too large for " + width + " bytes" ; LOG . error ( "OMG " + messag...
public class AbstractParsedStmt { /** * Order by Columns or expressions has to operate on the display columns or expressions . * @ return */ protected boolean orderByColumnsCoverUniqueKeys ( ) { } }
// In theory , if EVERY table in the query has a uniqueness constraint // ( primary key or other unique index ) on columns that are all listed in the ORDER BY values , // the result is deterministic . // This holds regardless of whether the associated index is actually used in the selected plan , // so this check is pl...
public class ApplicationMetadata { /** * Gets the metamodel . * @ param persistenceUnit * the persistence unit * @ return the metamodel */ public Metamodel getMetamodel ( String persistenceUnit ) { } }
Map < String , Metamodel > model = getMetamodelMap ( ) ; return persistenceUnit != null && model . containsKey ( persistenceUnit ) ? model . get ( persistenceUnit ) : null ;
public class SeleniumActionBuilder { /** * Make screenshot with custom output directory . */ public SeleniumActionBuilder screenshot ( String outputDir ) { } }
MakeScreenshotAction action = new MakeScreenshotAction ( ) ; action . setOutputDir ( outputDir ) ; action ( action ) ; return this ;
public class WebCommonInterceptor { /** * 当拦截器内发生错误时 , 返回json格式的错误信息 * @ param request * 请求request * @ param response * 返回response * @ param message * 错误消息 * @ throws IOException */ protected void returnJsonSystemError ( HttpServletRequest request , HttpServletResponse response , ResultCode resultCode ) t...
Map < String , Object > errors = new HashMap < String , Object > ( ) ; errors . put ( WebResponseConstant . MESSAGE_GLOBAL , resultCode . getMessage ( ) . getMessage ( ) ) ; JsonObject < ? > json = JsonObject . create ( ) ; json . setStatus ( resultCode . getCode ( ) ) ; json . setStatusInfo ( errors ) ; response . set...
public class CmsDateRestrictionParser { /** * Parses a positive integer . < p > * @ param loc the location of the positive number * @ return the number , or null if it could not be parsed */ private Integer parsePositiveNumber ( CmsXmlContentValueLocation loc ) { } }
if ( loc == null ) { return null ; } try { Integer result = Integer . valueOf ( loc . getValue ( ) . getStringValue ( m_cms ) . trim ( ) ) ; if ( result . intValue ( ) < 0 ) { return null ; } else { return result ; } } catch ( Exception e ) { LOG . info ( e . getLocalizedMessage ( ) , e ) ; return null ; }
public class FilterableTableExample { /** * Sets the state of the clearAllActions button based on the visibility of the filter menus and if the button is * visible sets its disabled state if nothing is filtered . * This is usability sugar , it is not necessary for the functionality of the filters . */ private void ...
/* if one or fewer of the filter menus are visible then we don ' t need the clear all menus button */ int visibleMenus = 0 ; if ( firstNameFilterMenu . isVisible ( ) ) { visibleMenus ++ ; } if ( lastNameFilterMenu . isVisible ( ) ) { visibleMenus ++ ; } if ( dobFilterMenu . isVisible ( ) ) { visibleMenus ++ ; } clearAl...
public class CmsShellCommands { /** * Returns the Locales available on the system ready to use on Method * { @ link # setLocale ( String ) } from the < code > { @ link CmsShell } < / code > . < p > * Note that the full name containing language , country and optional variant seperated * by underscores is returned ...
m_shell . getOut ( ) . println ( getMessages ( ) . key ( Messages . GUI_SHELL_LOCALES_AVAILABLE_0 ) ) ; Locale [ ] locales = Locale . getAvailableLocales ( ) ; for ( int i = locales . length - 1 ; i >= 0 ; i -- ) { m_shell . getOut ( ) . println ( " \"" + locales [ i ] . toString ( ) + "\"" ) ; }
public class WTabSet { /** * Retrieves the tab index for the given tab content . * @ param content the tab content * @ return the tab index , or - 1 if the content is not in a tab in this tab set . */ public int getTabIndex ( final WComponent content ) { } }
List < WTab > tabs = getTabs ( ) ; final int count = tabs . size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { WTab tab = tabs . get ( i ) ; if ( content == tab . getContent ( ) ) { return i ; } } return - 1 ;
public class HeadersUtils { /** * { @ link Headers # names ( ) } and convert each element of { @ link Set } to a { @ link String } . * @ param headers the headers to get the names from * @ return a { @ link Set } of header values or an empty { @ link Set } if no values are found . */ public static Set < String > na...
return new CharSequenceDelegatingStringSet ( headers . names ( ) ) ;
public class DoubleAccessor { /** * To long . * @ param data * the data * @ return the long */ private long toLong ( byte [ ] data ) { } }
if ( data == null || data . length != 8 ) return 0x0 ; return ( long ) ( // ( Below ) convert to longs before shift because digits // are lost with ints beyond the 32 - bit limit ( long ) ( 0xff & data [ 0 ] ) << 56 | ( long ) ( 0xff & data [ 1 ] ) << 48 | ( long ) ( 0xff & data [ 2 ] ) << 40 | ( long ) ( 0xff & data [...
public class AbstractCassandraStorage { /** * convert CfDef to string */ protected static String cfdefToString ( CfDef cfDef ) throws IOException { } }
assert cfDef != null ; // this is so awful it ' s kind of cool ! TSerializer serializer = new TSerializer ( new TBinaryProtocol . Factory ( ) ) ; try { return Hex . bytesToHex ( serializer . serialize ( cfDef ) ) ; } catch ( TException e ) { throw new IOException ( e ) ; }
public class CitrusAnnotations { /** * Inject Citrus framework instance to the test class fields with { @ link CitrusFramework } annotation . * @ param testCase * @ param citrusFramework */ public static final void injectCitrusFramework ( final Object testCase , final Citrus citrusFramework ) { } }
ReflectionUtils . doWithFields ( testCase . getClass ( ) , new ReflectionUtils . FieldCallback ( ) { @ Override public void doWith ( Field field ) throws IllegalArgumentException , IllegalAccessException { log . debug ( String . format ( "Injecting Citrus framework instance on test class field '%s'" , field . getName (...
public class ObjectGraphDump { /** * Visits all the keys and entries of the given map . * @ param node the ObjectGraphNode containing the map . */ private void visitMap ( final ObjectGraphNode node ) { } }
Map map = ( Map ) node . getValue ( ) ; for ( Iterator i = map . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) i . next ( ) ; Object key = entry . getKey ( ) ; if ( key != null ) { ObjectGraphNode keyNode = new ObjectGraphNode ( ++ nodeCount , "key" , key . getClass ( ) . getNa...
public class TransactionState { /** * Directs the TransactionState to recover its state after a failure , based on * the given RecoverableUnit object . If the TransactionState has already been * defined or recovered , the operation returns the current state of the * transaction . If the state cannot be recovered ...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "reconstruct" , new Object [ ] { this , log } ) ; int result = STATE_NONE ; int logState = 0 ; // Lookup the TransactionState RecoverableUnitSection _logSection = log . lookupSection ( TransactionImpl . TRAN_STATE_SECTION ) ; if ( _logSection != null ) { try { final byte...
public class Files { /** * Deletes a path from the filesystem * If the path is a directory its contents * will be recursively deleted before it itself * is deleted . * Note that removal of a directory is not an atomic - operation * and so if an error occurs during removal , some of the directories * descend...
if ( ! java . nio . file . Files . isDirectory ( path ) ) { java . nio . file . Files . delete ( path ) ; } else { java . nio . file . Files . walkFileTree ( path , DeleteDirVisitor . getInstance ( ) ) ; }
public class Model { /** * Gets attribute value as < code > Double < / code > . * If there is a { @ link Converter } registered for the attribute that converts from Class < code > S < / code > to Class * < code > java . lang . Double < / code > , given the attribute value is an instance of < code > S < / code > , t...
Object value = getRaw ( attributeName ) ; Converter < Object , Double > converter = modelRegistryLocal . converterForValue ( attributeName , value , Double . class ) ; return converter != null ? converter . convert ( value ) : Convert . toDouble ( value ) ;
public class Streams { /** * Perform a flatMap operation where the result will be a flattened stream of Strings * from the text loaded from the supplied URLs * < pre > * { @ code * List < String > result = Streams . liftAndBindURL ( Stream . of ( " input . file " ) * , getClass ( ) . getClassLoader ( ) : : ge...
return stream . flatMap ( fn . andThen ( url -> ExceptionSoftener . softenSupplier ( ( ) -> { final BufferedReader in = new BufferedReader ( new InputStreamReader ( url . openStream ( ) ) ) ; return in . lines ( ) ; } ) . get ( ) ) ) ;
public class SQSConnection { /** * This method is not supported . */ @ Override public ConnectionConsumer createConnectionConsumer ( Queue queue , String messageSelector , ServerSessionPool sessionPool , int maxMessages ) throws JMSException { } }
throw new JMSException ( SQSMessagingClientConstants . UNSUPPORTED_METHOD ) ;
public class IndianCalendar { /** * / * [ deutsch ] * < p > Erzeugt ein neues indisches Kalenderdatum . < / p > * @ param iyear Indian year in the range 1-9999921 * @ param imonth Indian month in range 1-12 * @ param idom Indian day of month in range 1-31 * @ return new instance of { @ code IndianCalendar } ...
if ( ! CALSYS . isValid ( IndianEra . SAKA , iyear , imonth , idom ) ) { throw new IllegalArgumentException ( "Invalid Indian date: year=" + iyear + ", month=" + imonth + ", day=" + idom ) ; } return new IndianCalendar ( iyear , imonth , idom ) ;
public class TypeSystem { /** * DO NOT USE OR DELETE . Called form the debugging process ( IDE ) . * @ param filePaths */ public static void refreshedFiles ( String [ ] filePaths ) { } }
for ( String filePath : filePaths ) { IFile file = CommonServices . getFileSystem ( ) . getIFile ( new File ( filePath ) ) ; if ( file != null ) { TypeSystem . refreshed ( file ) ; } }
public class ConnectionReadCompletedCallback { /** * Called by the next channel in the chain when an outstanding read request has completed * successfully . * @ see TCPReadCompletedCallback # complete ( VirtualConnection , TCPReadRequestContext ) */ public void complete ( NetworkConnection vc , IOReadRequestContext...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "complete" , new Object [ ] { vc , rctx } ) ; if ( thisConnection . isLoggingIOEvents ( ) ) thisConnection . getConnectionEventRecorder ( ) . logDebug ( "complete method invoked on read context " + System . identityHa...
public class RGroupQuery { /** * Recursive function to produce valid configurations * for { @ link # getAllConfigurations ( ) } . */ private void findConfigurationsRecursively ( List < Integer > rGroupNumbers , List < List < Integer > > occurrences , List < Integer > occurIndexes , List < Integer [ ] > distributions ...
if ( level == rGroupNumbers . size ( ) ) { if ( ! checkIfThenConditionsMet ( rGroupNumbers , distributions ) ) return ; // Clone the root to get a scaffold to plug the substitutes into . IAtomContainer root = this . getRootStructure ( ) ; IAtomContainer rootClone = null ; try { rootClone = ( IAtomContainer ) root . clo...
public class EnglishTreebankParserParams { /** * Set language - specific options according to flags . * This routine should process the option starting in args [ i ] ( which * might potentially be several arguments long if it takes arguments ) . * It should return the index after the last index it consumed in *...
// [ CDM 2008 : there are no generic options ! ] first , see if it ' s a generic option // int j = super . setOptionFlag ( args , i ) ; // if ( i ! = j ) return j ; // lang . specific options if ( args [ i ] . equalsIgnoreCase ( "-splitIN" ) ) { englishTrain . splitIN = Integer . parseInt ( args [ i + 1 ] ) ; i += 2 ; ...
public class FunctionRewriter { /** * Parse helper code needed by a reducer . * @ return Helper code root . If parse fails , return null . */ public Node parseHelperCode ( Reducer reducer ) { } }
Node root = compiler . parseSyntheticCode ( reducer . getClass ( ) + ":helper" , reducer . getHelperSource ( ) ) ; return ( root != null ) ? root . removeFirstChild ( ) : null ;
public class XMLSerializer { /** * End document . * @ throws IOException Signals that an I / O exception has occurred . */ public void endDocument ( ) throws IOException { } }
// close all unclosed tag ; while ( depth > 0 ) { endTag ( elNamespace [ depth ] , elName [ depth ] ) ; } // assert depth = = 0; // assert startTagIncomplete = = false ; finished = pastRoot = startTagIncomplete = true ; out . flush ( ) ;
public class ParallelInference { /** * This method gracefully shuts down ParallelInference instance */ public synchronized void shutdown ( ) { } }
if ( zoo == null ) return ; for ( int e = 0 ; e < zoo . length ; e ++ ) { if ( zoo [ e ] == null ) continue ; zoo [ e ] . interrupt ( ) ; zoo [ e ] . shutdown ( ) ; zoo [ e ] = null ; } zoo = null ; System . gc ( ) ;
public class DiagnosticsInner { /** * Get Site Analyses . * Get Site Analyses . * ServiceResponse < PageImpl < AnalysisDefinitionInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ re...
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listSiteAnalysesSlotNext ( nextUrl , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMa...
public class BasicHttpClient { /** * Override this method in case you want to make the Charset response differently for your project . * Otherwise the framework falls back to this implementation by default which means - If the Charset * is not set by the server framework will default to Charset . defaultCharset ( )...
HttpEntity entity = httpResponse . getEntity ( ) ; Charset charset = ContentType . getOrDefault ( httpResponse . getEntity ( ) ) . getCharset ( ) ; charset = ( charset == null ) ? Charset . defaultCharset ( ) : charset ; return Response . status ( httpResponse . getStatusLine ( ) . getStatusCode ( ) ) . entity ( entity...
public class PropertiesManager { /** * Save the current value of the given property to the file without * modifying the values of any other properties in the file . In other words , * { @ link # isModified ( Object ) } will return < code > false < / code > for the given * property after this call completes , but ...
Callable < Void > task = new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { properties . save ( getFile ( ) , comment , isSavingDefaults ( ) , getTranslator ( ) . getPropertyName ( property ) ) ; firePropertySaved ( property ) ; return null ; } } ; return executor . submit ( task ) ;
public class NonBlockingBufferedWriter { /** * Writes a portion of a String . * If the value of the < tt > len < / tt > parameter is negative then no characters * are written . This is contrary to the specification of this method in the * { @ linkplain java . io . Writer # write ( java . lang . String , int , int...
_ensureOpen ( ) ; int b = off ; final int t = off + len ; while ( b < t ) { final int d = Math . min ( m_nChars - m_nNextChar , t - b ) ; s . getChars ( b , b + d , m_aBuf , m_nNextChar ) ; b += d ; m_nNextChar += d ; if ( m_nNextChar >= m_nChars ) flushBuffer ( ) ; }
public class CmsADESessionCache { /** * Gets the cached template bean for a given container page uri . < p > * @ param uri the container page uri * @ param safe if true , return a valid template bean even if it hasn ' t been cached before * @ return the template bean */ public TemplateBean getTemplateBean ( Strin...
TemplateBean templateBean = m_templateBeanCache . get ( uri ) ; if ( ( templateBean != null ) || ! safe ) { return templateBean ; } return new TemplateBean ( "" , "" ) ;
public class ElasticSearchHelper { /** * 获取elasticSearch对应的elasticSearch服务器对象 * @ param elasticSearch * @ return */ public static ElasticSearch getElasticSearchSink ( String elasticSearch ) { } }
init ( ) ; if ( elasticSearch == null || elasticSearch . equals ( "" ) ) { return elasticSearchSink ; } ElasticSearch elasticSearchSink = elasticSearchMap . get ( elasticSearch ) ; if ( elasticSearchSink == null ) { synchronized ( elasticSearchMap ) { elasticSearchSink = elasticSearchMap . get ( elasticSearch ) ; if ( ...
public class Array { /** * Returns the length of the specified array object , as an { @ code int } . * @ param array the array * @ return the length of the array * @ exception IllegalArgumentException if the object argument is not * an array */ public static int getLength ( Object array ) { } }
if ( array instanceof Object [ ] ) { return ( ( Object [ ] ) array ) . length ; } else if ( array instanceof boolean [ ] ) { return ( ( boolean [ ] ) array ) . length ;
public class SightResourcesImpl { /** * Get a specified Sight . * It mirrors to the following Smartsheet REST API method : GET / sights / { sightId } * @ param sightId the Id of the Sight * @ param level compatibility level * @ return the Sight resource . * @ throws IllegalArgumentException if any argument is...
String path = "sights/" + sightId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( level != null ) { parameters . put ( "level" , level ) ; } path += QueryUtil . generateUrl ( null , parameters ) ; return this . getResource ( path , Sight . class ) ;
public class ComponentFactory { /** * Factory method for create a new { @ link Label } with the for attribute . * @ param id * the id * @ param forId * the for id * @ param resourceBundleKey * the resource key * @ param component * the component to find resource keys * @ return the new { @ link Label ...
return ComponentFactory . newLabel ( id , forId , ResourceModelFactory . newResourceModel ( resourceBundleKey , component ) ) ;
public class Rollbar { /** * Record a debugging message with extra information attached . * @ param message the message . * @ param custom the extra information . */ public void debug ( String message , Map < String , Object > custom ) { } }
debug ( null , custom , message ) ;
public class ArrayUtils { /** * Concatenates the specified arrays . * @ param < T > the type of array element * @ param first the specified first array * @ param rest the specified rest arrays * @ return concatenated array */ public static < T > T [ ] concatenate ( final T [ ] first , final T [ ] ... rest ) { }...
int totalLength = first . length ; for ( final T [ ] array : rest ) { totalLength += array . length ; } final T [ ] ret = Arrays . copyOf ( first , totalLength ) ; int offset = first . length ; for ( final T [ ] array : rest ) { System . arraycopy ( array , 0 , ret , offset , array . length ) ; offset += array . length...
public class Sendinblue { /** * Delete already existing users in the SendinBlue contacts from the list . * @ param { Object } data contains json objects as a key value pair from HashMap . * @ options data { Integer } id : Id of list to unlink users from it [ Mandatory ] * @ options data { Array } users : Email ad...
String id = data . get ( "id" ) . toString ( ) ; Gson gson = new Gson ( ) ; String json = gson . toJson ( data ) ; return delete ( "list/" + id + "/delusers" , json ) ;
public class ResourceUtil { /** * return diffrents of one file to a other if first is child of second otherwise return null * @ param file file to search * @ param dir directory to search */ public static String getPathToChild ( Resource file , Resource dir ) { } }
if ( dir == null || ! file . getResourceProvider ( ) . getScheme ( ) . equals ( dir . getResourceProvider ( ) . getScheme ( ) ) ) return null ; boolean isFile = file . isFile ( ) ; String str = "/" ; while ( file != null ) { if ( file . equals ( dir ) ) { if ( isFile ) return str . substring ( 0 , str . length ( ) - 1 ...
public class CheckGlobalThis { /** * Since this pass reports errors only when a global { @ code this } keyword * is encountered , there is no reason to traverse non global contexts . */ @ Override public boolean shouldTraverse ( NodeTraversal t , Node n , Node parent ) { } }
if ( n . isFunction ( ) ) { // Arrow functions automatically get the " this " value from the // enclosing scope . e . g . the " this " in // Foo . prototype . getBar = ( ) = > this . bar ; // is the global " this " , not an instance of Foo . if ( n . isArrowFunction ( ) ) { return true ; } // Don ' t traverse functions...
public class HangingExecutors { /** * finds ExecutorService objects that don ' t get a call to the terminating methods , and thus , never appear to be shutdown properly ( the threads exist until * shutdown is called ) * @ param classContext * the class context object of the currently parsed java class */ @ Overri...
localHEDetector . visitClassContext ( classContext ) ; try { hangingFieldCandidates = new HashMap < > ( ) ; exemptExecutors = new HashMap < > ( ) ; parseFieldsForHangingCandidates ( classContext ) ; if ( ! hangingFieldCandidates . isEmpty ( ) ) { stack = new OpcodeStack ( ) ; super . visitClassContext ( classContext ) ...
public class CProductPersistenceImpl { /** * Returns the last c product in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return...
CProduct cProduct = fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; if ( cProduct != null ) { return cProduct ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( co...
public class ResultIterator { /** * On query . * @ param m * the m * @ param client * the client */ private void onQuery ( EntityMetadata m , Client client ) { } }
String tableName = HBaseUtils . getHTableName ( m . getSchema ( ) , m . getTableName ( ) ) ; try { handler . readData ( tableName , m , null , translator . getStartRow ( ) , translator . getEndRow ( ) , getColumnsToOuput ( ) , ( FilterList ) translator . getFilters ( ) ) ; } catch ( IOException e ) { log . error ( e . ...
public class SetOperation { /** * Returns true if given Family id is one of the set operations * @ param id the given Family id * @ return true if given Family id is one of the set operations */ static boolean isValidSetOpID ( final int id ) { } }
final Family family = Family . idToFamily ( id ) ; final boolean ret = ( ( family == Family . UNION ) || ( family == Family . INTERSECTION ) || ( family == Family . A_NOT_B ) ) ; return ret ;
public class Json4SpoonGenerator { /** * Decorates a node with the affected operator , if any . * @ param context * @ param tree * @ param operations * @ return */ public JsonObject getJSONwithOperations ( TreeContext context , ITree tree , List < Operation > operations ) { } }
OperationNodePainter opNodePainter = new OperationNodePainter ( operations ) ; Collection < NodePainter > painters = new ArrayList < NodePainter > ( ) ; painters . add ( opNodePainter ) ; return getJSONwithCustorLabels ( context , tree , painters ) ;
public class PluralRulesLoader { /** * Gets the rule from the rulesId . If there is no rule for this rulesId , * return null . */ public PluralRules getRulesForRulesId ( String rulesId ) { } }
// synchronize on the map . release the lock temporarily while we build the rules . PluralRules rules = null ; boolean hasRules ; // Separate boolean because stored rules can be null . synchronized ( rulesIdToRules ) { hasRules = rulesIdToRules . containsKey ( rulesId ) ; if ( hasRules ) { rules = rulesIdToRules . get ...
public class SelectorReplayDispatcher { /** * check if mime - type detection is suggested for mimeType . * @ param mimeType mime - type to test ( must not be null / empty / " unk " ) * @ return { @ code true } if mime - type should be determined * by looking into Resource . */ protected boolean shouldDetectMimeTy...
for ( String prefix : untrustfulMimeTypes ) { if ( mimeType . startsWith ( prefix ) ) return true ; } return false ;
public class VersionInfo { /** * Returns a VersionInfo that reflects any inherited version information . * @ return merged version information . */ public VersionInfo merge ( ) { } }
if ( isReference ( ) ) { final VersionInfo refVersion = ( VersionInfo ) getCheckedRef ( VersionInfo . class , "VersionInfo" ) ; return refVersion . merge ( ) ; } Reference currentRef = this . getExtends ( ) ; if ( currentRef == null ) { return this ; } final Vector < VersionInfo > stack = new Vector < > ( 5 ) ; stack ....
public class Complex { /** * Returns { @ code true } , if at least on of the sub - constraints still has to process a case i . e . * there is at least one sub - constraint with { @ code hasNextCase ( ) = = * true } . * @ return true , if one of the sub - constrains still has cases */ @ Override public boolean has...
// this method only returns true if dependent values are grouped if ( ! dependent ) { return false ; } for ( Constraint c : constraints ) { if ( c . hasNextCase ( ) ) { return true ; } } return false ;
public class DynamicOutputBuffer { /** * Puts the given string as UTF - 8 into the buffer at the * given position . This method does not increase the write position . * @ param pos the position where to put the string * @ param s the string to put * @ return the number of UTF - 8 bytes put */ public int putUTF8...
ByteBuffer minibb = null ; CharsetEncoder enc = getUTF8Encoder ( ) ; CharBuffer in = CharBuffer . wrap ( s ) ; int pos2 = pos ; ByteBuffer bb = getBuffer ( pos2 ) ; int index = pos2 % _bufferSize ; bb . position ( index ) ; while ( in . remaining ( ) > 0 ) { CoderResult res = enc . encode ( in , bb , true ) ; // flush ...
public class CodecUtil { /** * Term prefix . * @ param term * the term * @ return the string */ public static String termPrefix ( String term ) { } }
int i = term . indexOf ( MtasToken . DELIMITER ) ; String prefix = term ; if ( i >= 0 ) { prefix = term . substring ( 0 , i ) ; } return prefix . replace ( "\u0000" , "" ) ;
public class SVGPath { /** * Quadratic Bezier line to the given coordinates . * @ param c1x first control point x * @ param c1y first control point y * @ param x new coordinates * @ param y new coordinates * @ return path object , for compact syntax . */ public SVGPath quadTo ( double c1x , double c1y , doubl...
return append ( PATH_QUAD_TO ) . append ( c1x ) . append ( c1y ) . append ( x ) . append ( y ) ;
public class AbstractSARLLaunchConfigurationDelegate { /** * Replies the SRE installation to be used for the given configuration . * @ param configuration the configuration to check . * @ param configAccessor the accessor to the SRE configuration . * @ param projectAccessor the accessor to the Java project . * ...
assert configAccessor != null ; assert projectAccessor != null ; final ISREInstall sre ; if ( configAccessor . getUseProjectSREFlag ( configuration ) ) { sre = getProjectSpecificSRE ( configuration , true , projectAccessor ) ; } else if ( configAccessor . getUseSystemSREFlag ( configuration ) ) { sre = SARLRuntime . ge...
public class MorphiaUtils { /** * Joins strings with the given delimiter * @ param strings the strings to join * @ param delimiter the delimiter * @ return the joined string */ public static String join ( final List < String > strings , final char delimiter ) { } }
StringBuilder builder = new StringBuilder ( ) ; for ( String element : strings ) { if ( builder . length ( ) != 0 ) { builder . append ( delimiter ) ; } builder . append ( element ) ; } return builder . toString ( ) ;
public class TransformedRenditionHandler { /** * Searches for the biggest web - enabled rendition that matches the crop dimensions width and height or is bigger . * @ param candidates * @ return Rendition or null if no match found */ private VirtualTransformedRenditionMetadata getCropRendition ( NavigableSet < Rend...
RenditionMetadata original = getOriginalRendition ( ) ; if ( original == null ) { return null ; } Double scaleFactor = getCropScaleFactor ( ) ; CropDimension scaledCropDimension = new CropDimension ( Math . round ( cropDimension . getLeft ( ) * scaleFactor ) , Math . round ( cropDimension . getTop ( ) * scaleFactor ) ,...
public class AsteriskChannelImpl { /** * Sets the caller id of this channel . * @ param callerId the caller id of this channel . */ void setCallerId ( final CallerId callerId ) { } }
final CallerId oldCallerId = this . callerId ; this . callerId = callerId ; firePropertyChange ( PROPERTY_CALLER_ID , oldCallerId , callerId ) ;
public class AwsSecurityFindingFilters { /** * An ISO8601 - formatted timestamp that indicates when the finding record was last updated by the security findings * provider . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUpdatedAt ( java . util . Collec...
if ( this . updatedAt == null ) { setUpdatedAt ( new java . util . ArrayList < DateFilter > ( updatedAt . length ) ) ; } for ( DateFilter ele : updatedAt ) { this . updatedAt . add ( ele ) ; } return this ;
public class SpringCamelContextFactory { /** * Create a { @ link SpringCamelContext } list from the given URL */ public static List < SpringCamelContext > createCamelContextList ( URL contextUrl , ClassLoader classsLoader ) throws Exception { } }
SpringCamelContextBootstrap bootstrap = new SpringCamelContextBootstrap ( contextUrl , classsLoader ) ; return bootstrap . createSpringCamelContexts ( ) ;
public class SimpleBase { /** * Returns a matrix which is the result of an element by element exp of ' this ' * c < sub > i , j < / sub > = Math . log ( a < sub > i , j < / sub > ) * @ return The element by element power of ' this ' and ' b ' . */ public T elementLog ( ) { } }
T c = createLike ( ) ; ops . elementLog ( mat , c . mat ) ; return c ;
public class Server { /** * Accepts any new connections and reads or writes any pending data for the current connections . * @ param timeout Wait for up to the specified milliseconds for a connection to be ready to process . May be zero to return * immediately if there are no connections to process . */ public void...
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 Functions { /** * Create a { @ link Map } by applying a function that extracts the key from an array of values . * @ param key the key extraction function . * @ param values the values of the map ( from which the keys are extracted ) . * @ param < K > the type of the keys . * @ param < V > the type...
return values == null || values . length == 0 ? emptyMap ( ) : map ( asList ( values ) , key ) ;
public class ActivityUtils { /** * Checks if a package is installed . * @ param context Context to be used to verify the existence of the package . * @ param packageName Package name to be searched . * @ return true if the package is discovered ; false otherwise */ public static boolean isPackageInstalled ( Conte...
try { context . getPackageManager ( ) . getApplicationInfo ( packageName , 0 ) ; return true ; } catch ( Exception e ) { return false ; }
public class StatsTraceContext { /** * Factory method for the server - side . */ public static StatsTraceContext newServerContext ( List < ? extends ServerStreamTracer . Factory > factories , String fullMethodName , Metadata headers ) { } }
if ( factories . isEmpty ( ) ) { return NOOP ; } StreamTracer [ ] tracers = new StreamTracer [ factories . size ( ) ] ; for ( int i = 0 ; i < tracers . length ; i ++ ) { tracers [ i ] = factories . get ( i ) . newServerStreamTracer ( fullMethodName , headers ) ; } return new StatsTraceContext ( tracers ) ;
public class VoldemortBuildAndPushJob { /** * This function takes care of interrogating the servers to know which optional * features are supported and enabled , including : * 1 ) block - level compression , * 2 ) high - availability push , * 3 ) build primary replicas only . * TODO : Eventually , it ' d be n...
// 1 . Get block - level compression settings // FIXME : Currently this code requests only one cluster for its supported compression codec . log . info ( "Requesting block-level compression codec expected by Server" ) ; String chosenCodec = null ; List < String > supportedCodecs ; try { supportedCodecs = adminClientPer...
public class XMLEncoder { /** * Writes an XML declaration with double quotes . * @ param out the character stream to write to , not < code > null < / code > . * @ param quotationMark the quotationMark to use , either < code > ' \ ' ' < / code > or < code > ' " ' < / code > . * @ throws IllegalArgumentException if...
if ( quotationMark == '"' ) { out . write ( _declarationDoubleQuotes ) ; } else if ( quotationMark == '\'' ) { out . write ( _declarationSingleQuotes ) ; }
public class Cursor { /** * Fetches single entity or null . * @ return Single entity if result set have one more , otherwise null . * @ throws InstantiationException * @ throws IllegalAccessException * @ throws SQLException */ public T fetchSingleOrNull ( ) throws InstantiationException , IllegalAccessException...
if ( ! finished ) { T result = primitive ? fetchSinglePrimitiveInternal ( ) : fetchSingleInternal ( ) ; next ( ) ; return result ; } else { return null ; }
public class JSONWriter { /** * Begin appending a new array . < p > * All values until the balancing * < code > endArray < / code > will be appended to this array . The * < code > endArray < / code > method must be called to mark the array ' s end . < p > * @ return this * @ throws JSONException if the nestin...
if ( ( m_mode == 'i' ) || ( m_mode == 'o' ) || ( m_mode == 'a' ) ) { push ( 'a' ) ; append ( "[" ) ; m_comma = false ; return this ; } throw new JSONException ( "Misplaced array." ) ;
public class JmsUtils { /** * Close a message producer . * @ param producer */ public static void closeQuietly ( final MessageProducer producer ) { } }
if ( producer != null ) { try { producer . close ( ) ; } catch ( JMSException je ) { if ( je . getCause ( ) instanceof InterruptedException ) { LOG . trace ( "ActiveMQ caught and wrapped InterruptedException" ) ; } if ( je . getCause ( ) instanceof InterruptedIOException ) { LOG . trace ( "ActiveMQ caught and wrapped I...
public class AutoBytePool { /** * 设置缓冲区大小 * @ param size 大小 */ private void resizeBuf ( int size ) { } }
int capacity ; if ( size >= _capacity * 2 ) { capacity = size ; } else { capacity = 1 ; while ( capacity < size ) { capacity <<= 1 ; } } byte [ ] buf = new byte [ capacity ] ; if ( _size > 0 ) { System . arraycopy ( _buf , 0 , buf , 0 , _size ) ; } _buf = buf ; _capacity = capacity ;
public class UserHousingComplexUnit { /** * Returns the entity with the required fields for an insert set . * @ return */ public UserHousingComplexUnit instantiateForInsert ( ) { } }
UserHousingComplexUnit entity = new UserHousingComplexUnit ( ) ; entity . setIsDeleted ( Boolean . FALSE ) ; return entity ;
public class SAXSerializer { /** * Generate a text event . * @ param mRtx * Read Transaction . */ private void generateText ( final INodeReadTrx paramRtx ) { } }
try { mContHandler . characters ( paramRtx . getValueOfCurrentNode ( ) . toCharArray ( ) , 0 , paramRtx . getValueOfCurrentNode ( ) . length ( ) ) ; } catch ( final SAXException exc ) { exc . printStackTrace ( ) ; }
public class IOUtil { /** * Recurse in the folder to get the list all files and folders of all non svn files * @ param folder the folder to parse */ @ SuppressWarnings ( "unchecked" ) public Collection < String > listFolders ( File folder ) { } }
IOFileFilter ioFileFilter = FileFilterUtils . makeSVNAware ( FileFilterUtils . makeCVSAware ( FileFilterUtils . trueFileFilter ( ) ) ) ; Collection < File > files = FileUtils . listFiles ( folder , FileFilterUtils . fileFileFilter ( ) , ioFileFilter ) ; Set < String > ret = newTreeSet ( ) ; for ( File file : files ) { ...
public class DateTimeUtils { /** * Add / Subtract the specified amount of days to the given { @ link Calendar } . * The returned { @ link Calendar } has its fields synced . * @ param origin * @ param value * @ return * @ since 0.9.2 */ public static Calendar addDays ( Calendar origin , int value ) { } }
Calendar cal = sync ( ( Calendar ) origin . clone ( ) ) ; cal . add ( Calendar . DATE , value ) ; return sync ( cal ) ;
public class SoapWebServiceAdapter { /** * Overriding this method affords the opportunity to parse the response and * populate process variables as needed . */ @ Override public void onSuccess ( String response ) throws ActivityException , ConnectionException , AdapterException { } }
try { // set the variable value based on the unwrapped soap content soapResponse = getSoapResponse ( response ) ; Node childElem = unwrapSoapResponse ( soapResponse ) ; String responseXml = DomHelper . toXml ( childElem ) ; String responseVarName = getAttributeValue ( RESPONSE_VARIABLE ) ; if ( responseVarName == null ...
public class DefaultDataStore { /** * Convenience call to { @ link # resolve ( Record , ReadConsistency , boolean ) } which always schedules asynchronous * compaction is applicable . */ private Resolved resolve ( Record record , ReadConsistency consistency ) { } }
return resolve ( record , consistency , true ) ;
public class BasicEvaluationCtx { /** * Private helper that figures out if we need to resolve new values , * and returns either the current moment ( if we ' re not caching ) or * - 1 ( if we are caching ) */ private synchronized Date dateTimeHelper ( ) { } }
// if we already have current values , then we can stop ( note this // always means that we ' re caching ) if ( currentTime != null ) return null ; // get the current moment Date time = new Date ( ) ; // if we ' re not caching then we just return the current moment if ( ! useCachedEnvValues ) { return time ; } else { /...
public class UtilFile { /** * It solves the problem in xml responses because some fullPaths * are file : / / / opt / . . . and other are like / opt / . . . * @ param fullPath * @ return */ public static String getNmtAbsolutePath ( String fullPath ) { } }
String absolutePath = "" ; if ( fullPath . startsWith ( "file://" ) ) { absolutePath = fullPath . replace ( "file://" , "" ) ; } else { absolutePath = fullPath ; } return absolutePath ;
public class InterfaceService { /** * Allows to smoothly close the application by hiding the current screen and calling * { @ link com . badlogic . gdx . Application # exit ( ) } . */ public void exitApplication ( ) { } }
if ( currentController != null ) { currentController . hide ( Actions . sequence ( hidingActionProvider . provideAction ( currentController , null ) , Actions . run ( CommonActionRunnables . getApplicationClosingRunnable ( ) ) ) ) ; } else { Gdx . app . exit ( ) ; }
public class SoftDeleteHandler { /** * Set up / do the local criteria . * @ param strbFilter The SQL query string to add to . * @ param bIncludeFileName Include the file name with this query ? * @ param vParamList The param list to add the raw data to ( for prepared statements ) . * @ return True if you should ...
boolean bDontSkip = super . doLocalCriteria ( strbFilter , bIncludeFileName , vParamList ) ; if ( bDontSkip == true ) { if ( m_bFilterThisRecord ) bDontSkip = ! this . isRecordSoftDeleted ( ) ; // If set , skip it ! } return bDontSkip ; // Don ' t skip ( no criteria )
public class AbstractStandardTransformationOperation { /** * Generates a matcher for the given valueString with the given regular expression . */ protected Matcher generateMatcher ( String regex , String valueString ) throws TransformationOperationException { } }
if ( regex == null ) { throw new TransformationOperationException ( "No regex defined. The step will be skipped." ) ; } try { Pattern pattern = Pattern . compile ( regex ) ; return pattern . matcher ( valueString ) ; } catch ( PatternSyntaxException e ) { String message = String . format ( "Given regex string %s can't ...
public class BaseCrawler { /** * If the HTTP HEAD request was redirected , it returns the final redirected URL . If not , it * returns the original URL of the candidate . * @ param context the current HTTP client context * @ param candidateUrl the URL of the candidate * @ return the final response URL */ privat...
List < URI > redirectLocations = context . getRedirectLocations ( ) ; if ( redirectLocations != null ) { return redirectLocations . get ( redirectLocations . size ( ) - 1 ) . toString ( ) ; } return candidateUrl ;
public class BucketManager { /** * 复制文件 , 要求空间在同一账号下 , 可以设置force参数为true强行覆盖空间已有同名文件 * @ param fromBucket 源空间名称 * @ param fromFileKey 源文件名称 * @ param toBucket 目的空间名称 * @ param toFileKey 目的文件名称 * @ param force 强制覆盖空间中已有同名 ( 和 toFileKey 相同 ) 的文件 * @ throws QiniuException */ public Response copy ( String fromBu...
String from = encodedEntry ( fromBucket , fromFileKey ) ; String to = encodedEntry ( toBucket , toFileKey ) ; String path = String . format ( "/copy/%s/%s/force/%s" , from , to , force ) ; return rsPost ( fromBucket , path , null ) ;
public class SegmentFelzenszwalbHuttenlocher04 { /** * Look at the remaining regions and if there are any small ones marge them into a larger region */ protected void mergeSmallRegions ( ) { } }
for ( int i = 0 ; i < edgesNotMatched . size ( ) ; i ++ ) { Edge e = edgesNotMatched . get ( i ) ; int rootA = find ( e . indexA ) ; int rootB = find ( e . indexB ) ; // see if they are already part of the same segment if ( rootA == rootB ) continue ; int sizeA = regionSize . get ( rootA ) ; int sizeB = regionSize . ge...
public class DownloadProperties { /** * Builds a new DownloadProperties for downloading Galaxy from galaxy - dist . * @ param destination The destination directory to store Galaxy , null if a directory * should be chosen by default . * @ param revision The revision to use for Galaxy . * @ return A new DownloadP...
return new DownloadProperties ( GALAXY_DIST_REPOSITORY_URL , BRANCH_STABLE , revision , destination ) ;
public class FsParserAbstract { /** * Update the job metadata * @ param jobName job name * @ param scanDate last date we scan the dirs * @ throws Exception In case of error */ private void updateFsJob ( String jobName , LocalDateTime scanDate ) throws Exception { } }
// We need to round that latest date to the lower second and // remove 2 seconds . // See # 82 : https : / / github . com / dadoonet / fscrawler / issues / 82 scanDate = scanDate . minus ( 2 , ChronoUnit . SECONDS ) ; FsJob fsJob = FsJob . builder ( ) . setName ( jobName ) . setLastrun ( scanDate ) . setIndexed ( stats...
public class CreateRobotApplicationResult { /** * The sources of the robot application . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSources ( java . util . Collection ) } or { @ link # withSources ( java . util . Collection ) } if you want to override...
if ( this . sources == null ) { setSources ( new java . util . ArrayList < Source > ( sources . length ) ) ; } for ( Source ele : sources ) { this . sources . add ( ele ) ; } return this ;
public class AesKit { /** * AES解密 * @ param base64Data * @ param key * @ return * @ throws Exception */ public static String decryptData ( String base64Data , String key ) throws Exception { } }
Cipher cipher = Cipher . getInstance ( ALGORITHM_MODE_PADDING ) ; cipher . init ( Cipher . DECRYPT_MODE , new SecretKeySpec ( HashKit . md5 ( key ) . toLowerCase ( ) . getBytes ( ) , ALGORITHM ) ) ; return new String ( cipher . doFinal ( Base64Kit . decode ( base64Data ) ) ) ;
public class BottomSheetDialog { /** * Dismiss Dialog immediately without showing out animation . */ public void dismissImmediately ( ) { } }
super . dismiss ( ) ; if ( mAnimation != null ) mAnimation . cancel ( ) ; if ( mHandler != null ) mHandler . removeCallbacks ( mDismissAction ) ;
public class ObjectMapperCreator { /** * Creates the implementation of the interface denoted by interfaceClass and extending { @ link ObjectMapper } * @ param interfaceClass the interface to generate an implementation * @ return the fully qualified name of the created class * @ throws com . google . gwt . core . ...
// We concatenate the name of all the enclosing class . StringBuilder builder = new StringBuilder ( interfaceClass . getSimpleSourceName ( ) + "Impl" ) ; JClassType enclosingType = interfaceClass . getEnclosingType ( ) ; while ( null != enclosingType ) { builder . insert ( 0 , enclosingType . getSimpleSourceName ( ) + ...
public class ObjectUtil { /** * 实例化一个类 , 如果不成功 , 返回null * @ param clsName * @ return */ public static Object tryInstance ( String clsName , ClassLoader loader ) { } }
try { return instance ( clsName , loader ) ; } catch ( Exception ex ) { return null ; }
public class JibxConvertToNative { /** * Convert this tree to a DOM object . * Currently this is lame because I convert the tree to text , then to DOM . * In the future , jaxb will be able to convert directly . * @ return The dom tree . */ public Node getDOM ( ) { } }
Object root = m_message . getRawData ( ) ; try { String packageName = ( String ) ( ( TrxMessageHeader ) this . getMessage ( ) . getMessageHeader ( ) ) . get ( SOAPMessageTransport . JIBX_PACKAGE_NAME ) ; String bindingName = ( String ) ( ( TrxMessageHeader ) this . getMessage ( ) . getMessageHeader ( ) ) . get ( SOAPMe...
public class Utility { /** * Get the domain name from this URL . * @ param strDomain * @ return */ public static String getDomainFromURL ( String strURL , String strContextPathAtEnd , boolean includePortNumber ) { } }
String strDomain = strURL ; if ( strDomain . indexOf ( ':' ) < 8 ) strDomain = strDomain . substring ( strDomain . indexOf ( ':' ) + 1 ) ; // Get rid of protocol if ( strDomain . indexOf ( "//" ) == 0 ) strDomain = strDomain . substring ( 2 ) ; // Get rid of ' / / ' if ( strDomain . indexOf ( '?' ) != - 1 ) strDomain =...
public class Favorites { /** * Remove an item as a favorite for a user * Fires { @ link FavoriteListener # fireOnRemoveFavourite ( Item , User ) } * @ param user to remove the favorite from * @ param item to favorite * @ throws FavoriteException */ public static void removeFavorite ( @ Nonnull User user , @ Non...
try { if ( isFavorite ( user , item ) ) { FavoriteUserProperty fup = user . getProperty ( FavoriteUserProperty . class ) ; fup . removeFavorite ( item . getFullName ( ) ) ; FavoriteListener . fireOnRemoveFavourite ( item , user ) ; } else { throw new FavoriteException ( "Favourite is already unset for User: <" + user ....
public class SessionUtil { /** * Open a new session * @ param loginInput login information * @ return information get after login such as token information * @ throws SFException if unexpected uri syntax * @ throws SnowflakeSQLException if failed to establish connection with snowflake */ static public LoginOutp...
AssertUtil . assertTrue ( loginInput . getServerUrl ( ) != null , "missing server URL for opening session" ) ; AssertUtil . assertTrue ( loginInput . getAppId ( ) != null , "missing app id for opening session" ) ; AssertUtil . assertTrue ( loginInput . getLoginTimeout ( ) >= 0 , "negative login timeout for opening sess...
public class HDFSStorage { /** * Gets the full HDFS path when sealed . */ private Path getSealedFilePath ( String segmentName ) { } }
Preconditions . checkState ( segmentName != null && segmentName . length ( ) > 0 , "segmentName must be non-null and non-empty" ) ; return new Path ( String . format ( NAME_FORMAT , getPathPrefix ( segmentName ) , SEALED ) ) ;