signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class StringUtils { /** * < p > Checks if a String is empty ( " " ) or null . < / p > * < pre > * StringUtils . isEmpty ( null ) = true * StringUtils . isEmpty ( " " ) = true * StringUtils . isEmpty ( " " ) = false * StringUtils . isEmpty ( " bob " ) = false * StringUtils . isEmpty ( " bob " ) = false * < / pre > * < p > NOTE : This method changed in Lang version 2.0. * It no longer trims the String . * That functionality is available in isBlank ( ) . < / p > * @ param str the String to check , may be null * @ return < code > true < / code > if the String is empty or null */ public static boolean isEmpty ( final CharSequence str ) { } }
if ( str == null || str . length ( ) == 0 ) { return true ; } for ( int i = 0 , length = str . length ( ) ; i < length ; i ++ ) { if ( ! isWhitespace ( str . charAt ( i ) ) ) { return false ; } } return true ;
public class GeopaparazziDatabaseProperties { /** * Create the properties table . * @ param database the db to use . * @ throws Exception */ public static void createPropertiesTable ( ASpatialDb database ) throws Exception { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( "CREATE TABLE " ) ; sb . append ( PROPERTIESTABLE ) ; sb . append ( " (" ) ; sb . append ( ID ) ; sb . append ( " INTEGER PRIMARY KEY AUTOINCREMENT, " ) ; sb . append ( NAME ) . append ( " TEXT, " ) ; sb . append ( SIZE ) . append ( " REAL, " ) ; sb . append ( FILLCOLOR ) . append ( " TEXT, " ) ; sb . append ( STROKECOLOR ) . append ( " TEXT, " ) ; sb . append ( FILLALPHA ) . append ( " REAL, " ) ; sb . append ( STROKEALPHA ) . append ( " REAL, " ) ; sb . append ( SHAPE ) . append ( " TEXT, " ) ; sb . append ( WIDTH ) . append ( " REAL, " ) ; sb . append ( LABELSIZE ) . append ( " REAL, " ) ; sb . append ( LABELFIELD ) . append ( " TEXT, " ) ; sb . append ( LABELVISIBLE ) . append ( " INTEGER, " ) ; sb . append ( ENABLED ) . append ( " INTEGER, " ) ; sb . append ( ORDER ) . append ( " INTEGER," ) ; sb . append ( DASH ) . append ( " TEXT," ) ; sb . append ( MINZOOM ) . append ( " INTEGER," ) ; sb . append ( MAXZOOM ) . append ( " INTEGER," ) ; sb . append ( DECIMATION ) . append ( " REAL," ) ; sb . append ( THEME ) . append ( " TEXT" ) ; sb . append ( " );" ) ; String query = sb . toString ( ) ; database . executeInsertUpdateDeleteSql ( query ) ;
public class Postconditions { /** * A { @ code long } specialized version of { @ link # checkPostconditions ( Object , * ContractConditionType [ ] ) } * @ param value The value * @ param conditions The conditions the value must obey * @ return value * @ throws PostconditionViolationException If any of the conditions are false */ public static long checkPostconditionsL ( final long value , final ContractLongConditionType ... conditions ) throws PostconditionViolationException { } }
final Violations violations = innerCheckAllLong ( value , conditions ) ; if ( violations != null ) { throw failed ( null , Long . valueOf ( value ) , violations ) ; } return value ;
public class LastaShowbaseFilter { protected void viaOutsideHook ( HttpServletRequest request , HttpServletResponse response , FilterChain chain ) throws IOException , ServletException { } }
viaOutsideHookDeque ( request , response , chain , prepareOutsideHook ( ) ) ; // # to _ action
public class DependencyBundlingAnalyzer { /** * Evaluates the dependencies * @ param dependency a dependency to compare * @ param nextDependency a dependency to compare * @ param dependenciesToRemove a set of dependencies that will be removed * @ return true if a dependency is removed ; otherwise false */ @ Override protected boolean evaluateDependencies ( final Dependency dependency , final Dependency nextDependency , final Set < Dependency > dependenciesToRemove ) { } }
if ( hashesMatch ( dependency , nextDependency ) ) { if ( ! containedInWar ( dependency . getFilePath ( ) ) && ! containedInWar ( nextDependency . getFilePath ( ) ) ) { if ( firstPathIsShortest ( dependency . getFilePath ( ) , nextDependency . getFilePath ( ) ) ) { mergeDependencies ( dependency , nextDependency , dependenciesToRemove ) ; } else { mergeDependencies ( nextDependency , dependency , dependenciesToRemove ) ; return true ; // since we merged into the next dependency - skip forward to the next in mainIterator } } } else if ( isShadedJar ( dependency , nextDependency ) ) { if ( dependency . getFileName ( ) . toLowerCase ( ) . endsWith ( "pom.xml" ) ) { mergeDependencies ( nextDependency , dependency , dependenciesToRemove ) ; nextDependency . removeRelatedDependencies ( dependency ) ; return true ; } else { mergeDependencies ( dependency , nextDependency , dependenciesToRemove ) ; dependency . removeRelatedDependencies ( nextDependency ) ; } } else if ( cpeIdentifiersMatch ( dependency , nextDependency ) && hasSameBasePath ( dependency , nextDependency ) && vulnerabilitiesMatch ( dependency , nextDependency ) && fileNameMatch ( dependency , nextDependency ) ) { if ( isCore ( dependency , nextDependency ) ) { mergeDependencies ( dependency , nextDependency , dependenciesToRemove ) ; } else { mergeDependencies ( nextDependency , dependency , dependenciesToRemove ) ; return true ; // since we merged into the next dependency - skip forward to the next in mainIterator } } else if ( ecoSystemIs ( AbstractNpmAnalyzer . NPM_DEPENDENCY_ECOSYSTEM , dependency , nextDependency ) && namesAreEqual ( dependency , nextDependency ) && npmVersionsMatch ( dependency . getVersion ( ) , nextDependency . getVersion ( ) ) ) { if ( ! dependency . isVirtual ( ) ) { DependencyMergingAnalyzer . mergeDependencies ( dependency , nextDependency , dependenciesToRemove ) ; } else { DependencyMergingAnalyzer . mergeDependencies ( nextDependency , dependency , dependenciesToRemove ) ; return true ; } } return false ;
public class PathOverrideService { /** * Sets the content type for this ID * @ param pathId ID of path * @ param contentType content type value */ public void setContentType ( int pathId , String contentType ) { } }
PreparedStatement statement = null ; try ( Connection sqlConnection = sqlService . getConnection ( ) ) { statement = sqlConnection . prepareStatement ( "UPDATE " + Constants . DB_TABLE_PATH + " SET " + Constants . PATH_PROFILE_CONTENT_TYPE + " = ? " + " WHERE " + Constants . GENERIC_ID + " = ?" ) ; statement . setString ( 1 , contentType ) ; statement . setInt ( 2 , pathId ) ; statement . executeUpdate ( ) ; statement . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } finally { try { if ( statement != null ) { statement . close ( ) ; } } catch ( Exception e ) { } }
public class XMLJaspiConfiguration { /** * Register in AuthConfigFactory all persistent registrations found in the JASPI configuration file . * < p > This method assumes the registrations have already been loaded from the file into the Java in - memory objects when the * registration was created in method { @ link # registerProvider ( String , Map , String , String , String ) } . */ private void registerPersistentProviders ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerPersistentProviders" ) ; if ( jaspiConfig != null ) for ( JaspiProvider p : jaspiConfig . getJaspiProvider ( ) ) { String className = p . getClassName ( ) ; String desc = p . getDescription ( ) ; String layer = p . getMsgLayer ( ) ; String appContext = p . getAppContext ( ) ; Map < String , String > props = convertOptionsToMap ( p . getOption ( ) ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Register persistent provider" , new Object [ ] { "className=" + className , "msgLayer=" + layer , "appContext=" + appContext , "description=" + desc , "properties=" + props } ) ; if ( registry != null ) { registry . registerConfigProvider ( className , props , layer , appContext , desc ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerPersistentProviders" ) ;
public class RemoveUnusedShapes { /** * Adds the shape . Recursively adds the shapes represented by its members . */ private static void addShapeAndMembers ( String shapeName , Map < String , ShapeModel > in , Map < String , ShapeModel > out ) { } }
if ( shapeName == null ) return ; final ShapeModel shape = in . get ( shapeName ) ; if ( shape == null ) return ; if ( ! out . containsKey ( shapeName ) ) { out . put ( shapeName , in . get ( shapeName ) ) ; List < MemberModel > members = shape . getMembers ( ) ; if ( members != null ) { for ( MemberModel member : members ) { List < String > memberShapes = resolveMemberShapes ( member ) ; if ( memberShapes == null ) continue ; for ( String memberShape : memberShapes ) { addShapeAndMembers ( memberShape , in , out ) ; } } } }
public class CommerceWishListItemPersistenceImpl { /** * Returns all the commerce wish list items where commerceWishListId = & # 63 ; and CProductId = & # 63 ; . * @ param commerceWishListId the commerce wish list ID * @ param CProductId the c product ID * @ return the matching commerce wish list items */ @ Override public List < CommerceWishListItem > findByCW_CP ( long commerceWishListId , long CProductId ) { } }
return findByCW_CP ( commerceWishListId , CProductId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class CondVar { /** * Blocks until condition is true or the time elapsed * @ param condition The condition * @ param timeout The timeout to wait . A value < = 0 causes immediate return * @ param unit TimeUnit * @ return The condition ' s status */ public boolean waitFor ( Condition condition , long timeout , TimeUnit unit ) { } }
boolean intr = false ; final long timeout_ns = TimeUnit . NANOSECONDS . convert ( timeout , unit ) ; lock . lock ( ) ; try { for ( long wait_time = timeout_ns , start = System . nanoTime ( ) ; wait_time > 0 && ! condition . isMet ( ) ; ) { try { wait_time = cond . awaitNanos ( wait_time ) ; } catch ( InterruptedException e ) { wait_time = timeout_ns - ( System . nanoTime ( ) - start ) ; intr = true ; } } return condition . isMet ( ) ; } finally { lock . unlock ( ) ; if ( intr ) Thread . currentThread ( ) . interrupt ( ) ; }
public class FilmeSuchen { /** * es werden alle Filme gesucht * @ param listeFilme */ public synchronized void filmeBeimSenderLaden ( ListeFilme listeFilme ) { } }
initStart ( listeFilme ) ; // die mReader nach Prio starten mrStarten ( 0 ) ; if ( ! Config . getStop ( ) ) { // waren und wenn Suchlauf noch nicht abgebrochen weiter mit dem Rest mrWarten ( ) ; mrStarten ( 1 ) ; allStarted = true ; }
public class VersionableWorkspaceDataManager { /** * { @ inheritDoc } */ @ Override public boolean getChildNodesDataByPage ( NodeData nodeData , int fromOrderNum , int offset , int pageSize , List < NodeData > childs ) throws RepositoryException { } }
if ( ! this . equals ( versionDataManager ) && isSystemDescendant ( nodeData . getQPath ( ) ) ) { return versionDataManager . getChildNodesDataByPage ( nodeData , fromOrderNum , offset , pageSize , childs ) ; } return super . getChildNodesDataByPage ( nodeData , fromOrderNum , offset , pageSize , childs ) ;
public class MvpPresenter { /** * < p > Detach view from view state or from presenter ( if view state not exists ) . < / p > * < p > If you use { @ link MvpDelegate } , you should not call this method directly . * It will be called on { @ link MvpDelegate # onDetach ( ) } . < / p > * @ param view view to detach */ @ SuppressWarnings ( "WeakerAccess" ) public void detachView ( View view ) { } }
if ( mViewState != null ) { mViewState . detachView ( view ) ; } else { mViews . remove ( view ) ; }
public class Reader { /** * Create a new reader for the new mapped type { @ code B } . * @ param mapper the mapper function * @ param < B > the target type of the new reader * @ return a new reader * @ throws NullPointerException if the given { @ code mapper } function is * { @ code null } */ public < B > Reader < B > map ( final Function < ? super T , ? extends B > mapper ) { } }
requireNonNull ( mapper ) ; return new Reader < B > ( _name , _type ) { @ Override public B read ( final XMLStreamReader xml ) throws XMLStreamException { try { return mapper . apply ( Reader . this . read ( xml ) ) ; } catch ( RuntimeException e ) { throw new XMLStreamException ( e ) ; } } } ;
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 1133:1 : entryRuleXWhileExpression : ruleXWhileExpression EOF ; */ public final void entryRuleXWhileExpression ( ) throws RecognitionException { } }
try { // InternalXbaseWithAnnotations . g : 1134:1 : ( ruleXWhileExpression EOF ) // InternalXbaseWithAnnotations . g : 1135:1 : ruleXWhileExpression EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXWhileExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXWhileExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getXWhileExpressionRule ( ) ) ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
public class AmazonS3EncryptionClientBuilder { /** * Construct a synchronous implementation of AmazonS3Encryption using the current builder configuration . * @ return Fully configured implementation of AmazonS3Encryption . */ @ Override protected AmazonS3Encryption build ( AwsSyncClientParams clientParams ) { } }
return new AmazonS3EncryptionClient ( new AmazonS3EncryptionClientParamsWrapper ( clientParams , resolveS3ClientOptions ( ) , encryptionMaterials , cryptoConfig != null ? cryptoConfig : new CryptoConfiguration ( ) , kms ) ) ;
public class RequestMessage { /** * @ see javax . servlet . ServletRequest # getLocales ( ) */ @ Override public Enumeration < Locale > getLocales ( ) { } }
if ( null == this . locales ) { this . locales = connection . getEncodingUtils ( ) . getLocales ( this . request . getHeader ( "Accept-Language" ) ) ; } return Collections . enumeration ( this . locales ) ;
public class BriefLogFormatter { /** * A Custom format implementation that is designed for brevity . */ public String format ( LogRecord record ) { } }
String s = record . getLevel ( ) + " : " + format . format ( new Date ( record . getMillis ( ) ) ) + " -:- " + record . getMessage ( ) + lineSep ; return s ;
public class FatClockSkin { /** * * * * * * Resizing * * * * * */ @ Override protected void resize ( ) { } }
double width = clock . getWidth ( ) - clock . getInsets ( ) . getLeft ( ) - clock . getInsets ( ) . getRight ( ) ; double height = clock . getHeight ( ) - clock . getInsets ( ) . getTop ( ) - clock . getInsets ( ) . getBottom ( ) ; size = width < height ? width : height ; if ( size > 0 ) { double center = size * 0.5 ; pane . setMaxSize ( size , size ) ; pane . relocate ( ( clock . getWidth ( ) - size ) * 0.5 , ( clock . getHeight ( ) - size ) * 0.5 ) ; dropShadow . setRadius ( 0.008 * size ) ; dropShadow . setOffsetY ( 0.008 * size ) ; sectionsAndAreasCanvas . setWidth ( size ) ; sectionsAndAreasCanvas . setHeight ( size ) ; tickCanvas . setWidth ( size ) ; tickCanvas . setHeight ( size ) ; alarmPane . setMaxSize ( size , size ) ; createHourPointer ( ) ; hour . setFill ( clock . getHourColor ( ) ) ; hour . relocate ( ( size - hour . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , size * 0.12733333 ) ; createMinutePointer ( ) ; minute . setFill ( clock . getMinuteColor ( ) ) ; minute . relocate ( ( size - minute . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , 0 ) ; title . setFill ( clock . getTextColor ( ) ) ; title . setFont ( Fonts . latoLight ( size * 0.12 ) ) ; title . relocate ( ( size - title . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , size * 0.25 ) ; dateText . setFill ( clock . getDateColor ( ) ) ; dateText . setFont ( Fonts . latoLight ( size * 0.05 ) ) ; dateText . relocate ( ( center - dateText . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 + ( size * 0.45 ) , ( size - dateText . getLayoutBounds ( ) . getHeight ( ) ) * 0.5 ) ; text . setFill ( clock . getTextColor ( ) ) ; text . setFont ( Fonts . latoLight ( size * 0.12 ) ) ; text . relocate ( ( size - text . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 , size * 0.6 ) ; minuteRotate . setPivotX ( minute . getLayoutBounds ( ) . getWidth ( ) * 0.5 ) ; minuteRotate . setPivotY ( minute . getLayoutBounds ( ) . getHeight ( ) * 0.91119221 ) ; hourRotate . setPivotX ( hour . getLayoutBounds ( ) . getWidth ( ) * 0.5 ) ; hourRotate . setPivotY ( hour . getLayoutBounds ( ) . getHeight ( ) * 0.88431062 ) ; }
public class TmdbChanges { /** * Get a list of Media IDs that have been edited . * You can then use the movie / TV / person changes API to get the actual data that has been changed . * @ param method The method base to get * @ param page * @ param startDate the start date of the changes , optional * @ param endDate the end date of the changes , optional * @ return List of changed movie * @ throws MovieDbException */ public ResultList < ChangeListItem > getChangeList ( MethodBase method , Integer page , String startDate , String endDate ) throws MovieDbException { } }
TmdbParameters params = new TmdbParameters ( ) ; params . add ( Param . PAGE , page ) ; params . add ( Param . START_DATE , startDate ) ; params . add ( Param . END_DATE , endDate ) ; URL url = new ApiUrl ( apiKey , method ) . subMethod ( MethodSub . CHANGES ) . buildUrl ( params ) ; WrapperGenericList < ChangeListItem > wrapper = processWrapper ( getTypeReference ( ChangeListItem . class ) , url , "changes" ) ; return wrapper . getResultsList ( ) ;
public class ApiOvhCaasregistry { /** * Inspect namespace * REST : GET / caas / registry / { serviceName } / namespaces / { namespaceId } * @ param namespaceId [ required ] Namespace id * @ param serviceName [ required ] Service name * API beta */ public OvhNamespace serviceName_namespaces_namespaceId_GET ( String serviceName , String namespaceId ) throws IOException { } }
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}" ; StringBuilder sb = path ( qPath , serviceName , namespaceId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhNamespace . class ) ;
public class ElementBase { /** * Recurses the component subtree for a child belonging to the specified class . * @ param < T > The type of child being sought . * @ param clazz Class of child being sought . * @ return A child of the specified class , or null if not found . */ @ SuppressWarnings ( "unchecked" ) public < T extends ElementBase > T findChildElement ( Class < T > clazz ) { } }
for ( ElementBase child : getChildren ( ) ) { if ( clazz . isInstance ( child ) ) { return ( T ) child ; } } for ( ElementBase child : getChildren ( ) ) { T child2 = child . findChildElement ( clazz ) ; if ( child2 != null ) { return child2 ; } } return null ;
public class RequestFromVertx { /** * Get the preferred content media type that is acceptable for the client . For instance , in Accept : text / * ; q = 0.3, * text / html ; q = 0.7 , text / html ; level = 1 , text / html ; level = 2 ; q = 0.4 , text / html is returned . * The Accept request - header field can be used to specify certain media * types which are acceptable for the response . Accept headers can be used * to indicate that the request is specifically limited to a small set of * desired types , as in the case of a request for an in - line image . * @ return a MediaType that is acceptable for the * client or { @ see MediaType # HTML _ UTF _ 8 } if not set * @ see < a href = " http : / / www . w3 . org / Protocols / rfc2616 / rfc2616 - sec14 . html " * > http : / / www . w3 . org / Protocols / rfc2616 / rfc2616 - sec14 . html < / a > */ @ Override public MediaType mediaType ( ) { } }
Collection < MediaType > types = mediaTypes ( ) ; if ( types == null || types . isEmpty ( ) ) { return MediaType . ANY_TEXT_TYPE ; } else if ( types . size ( ) == 1 && types . iterator ( ) . next ( ) . equals ( MediaType . ANY_TYPE ) ) { return MediaType . ANY_TEXT_TYPE ; } else { return types . iterator ( ) . next ( ) ; }
public class IntsRef { /** * Signed int order comparison */ @ Override public int compareTo ( IntsRef other ) { } }
if ( this == other ) return 0 ; final int [ ] aInts = this . ints ; int aUpto = this . offset ; final int [ ] bInts = other . ints ; int bUpto = other . offset ; final int aStop = aUpto + Math . min ( this . length , other . length ) ; while ( aUpto < aStop ) { int aInt = aInts [ aUpto ++ ] ; int bInt = bInts [ bUpto ++ ] ; if ( aInt > bInt ) { return 1 ; } else if ( aInt < bInt ) { return - 1 ; } } // One is a prefix of the other , or , they are equal : return this . length - other . length ;
public class AbstractLIBORCovarianceModelParametric { /** * Get the parameters of determining this parametric * covariance model . The parameters are usually free parameters * which may be used in calibration . * @ return Parameter vector . */ public RandomVariable [ ] getParameter ( ) { } }
double [ ] parameterAsDouble = this . getParameterAsDouble ( ) ; RandomVariable [ ] parameter = new RandomVariable [ parameterAsDouble . length ] ; for ( int i = 0 ; i < parameter . length ; i ++ ) { parameter [ i ] = new Scalar ( parameterAsDouble [ i ] ) ; } return parameter ;
public class BucketManager { /** * TODO : 准备干掉setImage 、 unsetImage , 重写 */ public Response unsetImage ( String bucket ) throws QiniuException { } }
String path = String . format ( "/unimage/%s" , bucket ) ; return pubPost ( path ) ;
public class AsciiString { /** * Copies the content of this string to a byte array . * @ param srcIdx the starting offset of characters to copy . * @ param dst the destination byte array . * @ param dstIdx the starting offset in the destination byte array . * @ param length the number of characters to copy . */ public void copy ( int srcIdx , byte [ ] dst , int dstIdx , int length ) { } }
if ( isOutOfBounds ( srcIdx , length , length ( ) ) ) { throw new IndexOutOfBoundsException ( "expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length(" + length + ") <= srcLen(" + length ( ) + ')' ) ; } System . arraycopy ( value , srcIdx + offset , checkNotNull ( dst , "dst" ) , dstIdx , length ) ;
public class DateTimeBrowser { /** * getADate Returns a new DateTime object reference if possible , * otherwise null . * @ return retDT A DateTime object reference . */ private DateTime getADate ( String s ) { } }
DateTime retDT = null ; try { retDT = new DateTime ( s ) ; } // the try catch ( IllegalArgumentException pe ) { // ignore it here , caller sees null } // the catch return retDT ;
public class CSVWriter { /** * writes the header for the example download spreadsheet * @ param variableTokenNames */ public void writeDownloadSpreadsheetHeader ( List < TemplateTokenInfo > variableTokenNames ) { } }
StringBuilder headerBuilder = new StringBuilder ( ) ; headerBuilder . append ( UPLOAD_COMMENTS ) ; headerBuilder . append ( "\n" ) ; for ( TemplateTokenInfo tokenInfo : variableTokenNames ) { if ( tokenInfo . getName ( ) . equals ( TemplateProcessorConstants . COMMENTS_TOKEN ) ) { headerBuilder . append ( "#The field '" + tokenInfo . getDisplayName ( ) + "' allows return characters. To add return characters add '<br>'; e.g. line1<br>line2" ) ; headerBuilder . append ( "\n" ) ; } } headerBuilder . append ( HEADER_TOKEN ) ; headerBuilder . append ( UPLOAD_DELIMITER ) ; for ( TemplateTokenInfo variable : variableTokenNames ) { headerBuilder . append ( variable . getDisplayName ( ) ) ; headerBuilder . append ( UPLOAD_DELIMITER ) ; } String headerLine = headerBuilder . toString ( ) ; headerLine = headerLine . substring ( 0 , headerLine . length ( ) - 1 ) ; // get rid of trailing delimiter this . lineWriter . println ( headerLine ) ;
public class RegistrationGridScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; // This is all temporary . It will be much better to display the resources next to the EY for each record this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LANGUAGE ) . addListener ( new FieldReSelectHandler ( this ) ) ; this . getMainRecord ( ) . addListener ( new CompareFileFilter ( Registration . LANGUAGE , this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LANGUAGE ) , DBConstants . EQUALS , null , false ) ) ; this . getMainRecord ( ) . getField ( Registration . LANGUAGE ) . addListener ( new InitFieldHandler ( this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LANGUAGE ) ) ) ; this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LOCALE ) . addListener ( new FieldReSelectHandler ( this ) ) ; this . getMainRecord ( ) . addListener ( new CompareFileFilter ( Registration . LOCALE , this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LOCALE ) , DBConstants . EQUALS , null , false ) ) ; this . getMainRecord ( ) . getField ( Registration . LOCALE ) . addListener ( new InitFieldHandler ( this . getScreenRecord ( ) . getField ( ResourceScreenRecord . LOCALE ) ) ) ; this . getMainRecord ( ) . getField ( Registration . CODE ) . addListener ( new InitFieldHandler ( this . getHeaderRecord ( ) . getField ( Resource . CODE ) ) ) ;
public class MutableBigInteger { /** * This is for internal use in converting from a MutableBigInteger * object into a long value given a specified sign . * returns INFLATED if value is not fit into long */ long toCompactValue ( int sign ) { } }
if ( intLen == 0 || sign == 0 ) return 0L ; int [ ] mag = getMagnitudeArray ( ) ; int len = mag . length ; int d = mag [ 0 ] ; // If this MutableBigInteger can not be fitted into long , we need to // make a BigInteger object for the resultant BigDecimal object . if ( len > 2 || ( d < 0 && len == 2 ) ) return INFLATED ; long v = ( len == 2 ) ? ( ( mag [ 1 ] & LONG_MASK ) | ( d & LONG_MASK ) << 32 ) : d & LONG_MASK ; return sign == - 1 ? - v : v ;
public class EditorView { /** * { @ inheritDoc } */ @ Override protected void initView ( ) { } }
// getRootNode ( ) . setFitToWidth ( false ) ; // getRootNode ( ) . setFitToHeight ( false ) ; this . panel = new Pane ( ) ; this . panel . setPrefSize ( 600 , 500 ) ; this . panel . getStyleClass ( ) . add ( "editor" ) ; final Circle c = new Circle ( 200 + 25 , Color . BEIGE ) ; c . centerXProperty ( ) . bind ( node ( ) . widthProperty ( ) . divide ( 2 ) /* . add ( 70) */ ) ; c . centerYProperty ( ) . bind ( node ( ) . heightProperty ( ) . divide ( 2 ) ) ; this . panel . getChildren ( ) . add ( c ) ; node ( ) . setContent ( this . panel ) ; // this . panel . scaleXProperty ( ) . bind ( this . panel . prefWidthProperty ( ) . divide ( getRootNode ( ) . widthProperty ( ) ) ) ; // this . panel . scaleYProperty ( ) . bind ( this . panel . prefHeightProperty ( ) . divide ( getRootNode ( ) . heightProperty ( ) ) ) ;
public class AbstractResource { /** * Get the location header as URI . Returns null if there is no location header . */ public URI location ( ) { } }
String loc = http ( ) . getHeaderField ( "Location" ) ; if ( loc != null ) { return URI . create ( loc ) ; } return null ;
public class DefaultDatastoreWriter { /** * Deletes an entity given its key . * @ param key * the entity ' s key * @ throws EntityManagerException * if any error occurs while deleting . */ public void deleteByKey ( DatastoreKey key ) { } }
try { nativeWriter . delete ( key . nativeKey ( ) ) ; } catch ( DatastoreException exp ) { throw DatastoreUtils . wrap ( exp ) ; }
public class ConnectionUtility { /** * Closes database Connection . * No exception will be thrown even if occurred during closing , * instead , the exception will be logged at warning level . * @ param conndatabase connection that need to be closed */ public static void closeConnection ( Connection conn ) { } }
if ( conn != null ) { try { conn . close ( ) ; } catch ( Exception e ) { log . warn ( "Exception when closing database connection." , e ) ; } }
public class StructuredQueryBuilder { /** * Specifies a geospatial region as a circle , * supplying a point for the center . * @ param center the point defining the center * @ param radius the radius of the circle * @ return the definition of the circle */ public Circle circle ( Point center , double radius ) { } }
return new CircleImpl ( center . getLatitude ( ) , center . getLongitude ( ) , radius ) ;
public class LoggerHelpers { /** * Traces the fact that a method entry has occurred . * @ param log The Logger to log to . * @ param method The name of the method . * @ param args The arguments to the method . * @ return A generated identifier that can be used to correlate this traceEnter with its corresponding traceLeave . * This is usually generated from the current System time , and when used with traceLeave it can be used to log * elapsed call times . */ public static long traceEnter ( Logger log , String method , Object ... args ) { } }
if ( ! log . isTraceEnabled ( ) ) { return 0 ; } long time = CURRENT_TIME . get ( ) ; log . trace ( "ENTER {}@{} {}." , method , time , args ) ; return time ;
public class Property { /** * Retrieves the proxy property if it is set . This could be to something local , or in the cloud . * Provide the protocol , address , and port * @ return String : the set proxy address , null if none are set */ public static String getProxy ( ) throws InvalidProxyException { } }
String proxy = getProgramProperty ( PROXY ) ; if ( proxy == null ) { throw new InvalidProxyException ( PROXY_ISNT_SET ) ; } String [ ] proxyParts = proxy . split ( ":" ) ; if ( proxyParts . length != 2 ) { throw new InvalidProxyException ( "Proxy '" + proxy + "' isn't valid. Must contain address and port, without protocol" ) ; } try { Integer . parseInt ( proxyParts [ 1 ] ) ; } catch ( NumberFormatException e ) { throw new InvalidProxyException ( "Proxy '" + proxy + "' isn't valid. Must contain address and port, without protocol. Invalid port provided. " + e ) ; } return proxy ;
public class ExampleHelpers { /** * Opens a new FileOutputStream for a file of the given name in the example * output directory ( { @ link ExampleHelpers # EXAMPLE _ OUTPUT _ DIRECTORY } ) . Any * file of this name that exists already will be replaced . The caller is * responsible for eventually closing the stream . * @ param filename * the name of the file to write to * @ return FileOutputStream for the file * @ throws IOException * if the file or example output directory could not be created */ public static FileOutputStream openExampleFileOuputStream ( String filename ) throws IOException { } }
Path directoryPath ; if ( "" . equals ( lastDumpFileName ) ) { directoryPath = Paths . get ( EXAMPLE_OUTPUT_DIRECTORY ) ; } else { directoryPath = Paths . get ( EXAMPLE_OUTPUT_DIRECTORY ) ; createDirectory ( directoryPath ) ; directoryPath = directoryPath . resolve ( lastDumpFileName ) ; } createDirectory ( directoryPath ) ; Path filePath = directoryPath . resolve ( filename ) ; return new FileOutputStream ( filePath . toFile ( ) ) ;
public class RowExtractors { /** * Obtain an extractor of a tuple containing each of the values from the supplied extractors . * @ param first the first extractor ; may not be null * @ param second the second extractor ; may not be null * @ return the tuple extractor */ public static ExtractFromRow extractorWith ( final ExtractFromRow first , final ExtractFromRow second ) { } }
final TypeFactory < ? > type = Tuples . typeFactory ( first . getType ( ) , second . getType ( ) ) ; return new ExtractFromRow ( ) { @ Override public TypeFactory < ? > getType ( ) { return type ; } @ Override public Object getValueInRow ( RowAccessor row ) { return Tuples . tuple ( first . getValueInRow ( row ) , second . getValueInRow ( row ) ) ; } } ;
public class SARLDescriptionLabelProvider { /** * Replies the image for an action . * @ param action describes the action . * @ return the image descriptor . */ public ImageDescriptor image ( SarlAction action ) { } }
final JvmOperation jvmElement = this . jvmModelAssociations . getDirectlyInferredOperation ( action ) ; return this . images . forOperation ( action . getVisibility ( ) , this . adornments . get ( jvmElement ) ) ;
public class Resolve { /** * Find an unqualified identifier which matches a specified kind set . * @ param env The current environment . * @ param name The identifier ' s name . * @ param kind Indicates the possible symbol kinds * ( a subset of VAL , TYP , PCK ) . */ Symbol findIdent ( Env < AttrContext > env , Name name , KindSelector kind ) { } }
Symbol bestSoFar = typeNotFound ; Symbol sym ; if ( kind . contains ( KindSelector . VAL ) ) { sym = findVar ( env , name ) ; if ( sym . exists ( ) ) return sym ; else bestSoFar = bestOf ( bestSoFar , sym ) ; } if ( kind . contains ( KindSelector . TYP ) ) { sym = findType ( env , name ) ; if ( sym . exists ( ) ) return sym ; else bestSoFar = bestOf ( bestSoFar , sym ) ; } if ( kind . contains ( KindSelector . PCK ) ) return lookupPackage ( env , name ) ; else return bestSoFar ;
public class JPAAccessor { /** * Return the default JPAComponent object in the application server . */ public static void setJPAComponent ( JPAComponent instance ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setJPAComponent" , instance ) ; jpaComponent = instance ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setJPAComponent" ) ;
public class ItemAPI { /** * Returns the items that have a reference to the given item . The references * are grouped by app . Both the apps and the items are sorted by title . * @ param itemId * The id of the item * @ return The references to the given item */ public List < ItemReference > getItemReference ( int itemId ) { } }
return getResourceFactory ( ) . getApiResource ( "/item/" + itemId + "/reference/" ) . get ( new GenericType < List < ItemReference > > ( ) { } ) ;
public class SarlBatchCompiler { /** * Clean the folders . * @ param parentFolder the parent folder . * @ param filter the file filter for the file to remove . . * @ param continueOnError indicates if the cleaning should continue on error . * @ param deleteParentFolder indicates if the parent folder should be removed . * @ return the success status . */ protected boolean cleanFolder ( File parentFolder , FileFilter filter , boolean continueOnError , boolean deleteParentFolder ) { } }
try { if ( getLogger ( ) . isDebugEnabled ( ) ) { getLogger ( ) . debug ( Messages . SarlBatchCompiler_9 , parentFolder . toString ( ) ) ; } return Files . cleanFolder ( parentFolder , null , continueOnError , deleteParentFolder ) ; } catch ( FileNotFoundException e ) { return true ; }
public class MtasSolrComponentStats { /** * Generate permutations query variables . * @ param result the result * @ param keys the keys * @ param queryVariables the query variables */ private void generatePermutationsQueryVariables ( ArrayList < HashMap < String , String [ ] > > result , Set < String > keys , HashMap < String , String [ ] > queryVariables ) { } }
if ( keys != null && ! keys . isEmpty ( ) ) { Set < String > newKeys = new HashSet < > ( ) ; Iterator < String > it = keys . iterator ( ) ; String key = it . next ( ) ; String [ ] value = queryVariables . get ( key ) ; if ( result . isEmpty ( ) ) { HashMap < String , String [ ] > newItem ; if ( value == null || value . length == 0 ) { newItem = new HashMap < > ( ) ; newItem . put ( key , value ) ; result . add ( newItem ) ; } else { for ( int j = 0 ; j < value . length ; j ++ ) { newItem = new HashMap < > ( ) ; newItem . put ( key , new String [ ] { value [ j ] } ) ; result . add ( newItem ) ; } } } else { ArrayList < HashMap < String , String [ ] > > newResult = new ArrayList < > ( ) ; for ( int i = 0 ; i < result . size ( ) ; i ++ ) { HashMap < String , String [ ] > newItem ; if ( value == null || value . length == 0 ) { newItem = ( HashMap < String , String [ ] > ) result . get ( i ) . clone ( ) ; newItem . put ( key , value ) ; newResult . add ( newItem ) ; } else { for ( int j = 0 ; j < value . length ; j ++ ) { newItem = ( HashMap < String , String [ ] > ) result . get ( i ) . clone ( ) ; newItem . put ( key , new String [ ] { value [ j ] } ) ; newResult . add ( newItem ) ; } } } result . clear ( ) ; result . addAll ( newResult ) ; } while ( it . hasNext ( ) ) { newKeys . add ( it . next ( ) ) ; } generatePermutationsQueryVariables ( result , newKeys , queryVariables ) ; }
public class MessageBirdClient { /** * Function to create web hook * @ param webhook title , url and token of webHook * @ return WebHookResponseData * @ throws UnauthorizedException if client is unauthorized * @ throws GeneralException general exception */ public WebhookResponseData createWebHook ( Webhook webhook ) throws UnauthorizedException , GeneralException { } }
if ( webhook . getTitle ( ) == null ) { throw new IllegalArgumentException ( "Title of webhook must be specified." ) ; } if ( webhook . getUrl ( ) == null ) { throw new IllegalArgumentException ( "URL of webhook must be specified." ) ; } String url = String . format ( "%s%s" , VOICE_CALLS_BASE_URL , WEBHOOKS ) ; return messageBirdService . sendPayLoad ( url , webhook , WebhookResponseData . class ) ;
public class Accumulation { /** * Enables further validation on an existing accumulating Or by passing validation functions . * @ param < G > the Good type of the argument Or * @ param < ERR > the type of the error message contained in the accumulating failure * @ param or the accumulating or * @ param validations the validation functions * @ return the original or if it passed all validations or a Bad with all failures */ @ SuppressWarnings ( "unchecked" ) @ SafeVarargs public static < G , ERR > Or < G , Every < ERR > > when ( Or < ? extends G , ? extends Every < ? extends ERR > > or , Function < ? super G , ? extends Validation < ERR > > ... validations ) { } }
return when ( or , Stream . of ( validations ) ) ;
public class FieldConstraintDescrVisitor { /** * End * @ param descr */ private void visit ( QualifiedIdentifierRestrictionDescr descr ) { } }
String text = descr . getText ( ) ; String base = text . substring ( 0 , text . indexOf ( "." ) ) ; String fieldName = text . substring ( text . indexOf ( "." ) ) ; Variable patternVariable = data . getVariableByRuleAndVariableName ( pattern . getRuleName ( ) , base ) ; if ( patternVariable != null ) { QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction ( pattern ) ; restriction . setPatternIsNot ( pattern . isPatternNot ( ) ) ; restriction . setFieldPath ( field . getPath ( ) ) ; restriction . setOperator ( Operator . determineOperator ( descr . getEvaluator ( ) , descr . isNegated ( ) ) ) ; restriction . setVariablePath ( patternVariable . getPath ( ) ) ; restriction . setVariableName ( base ) ; restriction . setVariablePath ( fieldName ) ; restriction . setOrderNumber ( orderNumber ) ; restriction . setParentPath ( pattern . getPath ( ) ) ; restriction . setParentType ( pattern . getVerifierComponentType ( ) ) ; // Set field value , if it is not set . field . setFieldType ( Field . VARIABLE ) ; data . add ( restriction ) ; solvers . addPatternComponent ( restriction ) ; } else { EnumField enumField = ( EnumField ) data . getFieldByObjectTypeAndFieldName ( base , fieldName ) ; if ( enumField == null ) { ObjectType objectType = data . getObjectTypeByFullName ( base ) ; if ( objectType == null ) { Import objectImport = data . getImportByName ( base ) ; if ( objectImport != null ) { objectType = ObjectTypeFactory . createObjectType ( descr , objectImport ) ; } else { objectType = ObjectTypeFactory . createObjectType ( descr , base ) ; } data . add ( objectType ) ; } enumField = new EnumField ( descr ) ; enumField . setObjectTypePath ( objectType . getPath ( ) ) ; enumField . setObjectTypeName ( objectType . getName ( ) ) ; enumField . setName ( fieldName ) ; objectType . getFields ( ) . add ( enumField ) ; data . add ( enumField ) ; } EnumRestriction restriction = new EnumRestriction ( pattern ) ; restriction . setPatternIsNot ( pattern . isPatternNot ( ) ) ; restriction . setFieldPath ( field . getPath ( ) ) ; restriction . setOperator ( Operator . determineOperator ( descr . getEvaluator ( ) , descr . isNegated ( ) ) ) ; restriction . setEnumBasePath ( enumField . getPath ( ) ) ; restriction . setEnumBase ( base ) ; restriction . setEnumName ( fieldName ) ; restriction . setOrderNumber ( orderNumber ) ; restriction . setParentPath ( pattern . getPath ( ) ) ; restriction . setParentType ( pattern . getVerifierComponentType ( ) ) ; // Set field value , if it is not set . field . setFieldType ( Field . ENUM ) ; data . add ( restriction ) ; solvers . addPatternComponent ( restriction ) ; }
public class AppsImpl { /** * Gets the application available usage scenarios . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; String & gt ; object */ public Observable < List < String > > listUsageScenariosAsync ( ) { } }
return listUsageScenariosWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < List < String > > , List < String > > ( ) { @ Override public List < String > call ( ServiceResponse < List < String > > response ) { return response . body ( ) ; } } ) ;
public class MetadataCol52 { /** * Clones this metadata column instance . * @ return The cloned instance . */ public MetadataCol52 cloneColumn ( ) { } }
MetadataCol52 cloned = new MetadataCol52 ( ) ; cloned . setMetadata ( getMetadata ( ) ) ; cloned . cloneCommonColumnConfigFrom ( this ) ; return cloned ;
public class PersonGroupPersonsImpl { /** * Update name or userData of a person . * @ param personGroupId Id referencing a particular person group . * @ param personId Id referencing a particular person . * @ param updateOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws APIErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void update ( String personGroupId , UUID personId , UpdatePersonGroupPersonsOptionalParameter updateOptionalParameter ) { } }
updateWithServiceResponseAsync ( personGroupId , personId , updateOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class A_CmsListDialog { /** * Calls the < code > { @ link # getListItems } < / code > method and catches any exception . < p > */ protected void fillList ( ) { } }
try { getList ( ) . setContent ( getListItems ( ) ) ; // initialize detail columns Iterator < CmsListItemDetails > itDetails = getList ( ) . getMetadata ( ) . getItemDetailDefinitions ( ) . iterator ( ) ; while ( itDetails . hasNext ( ) ) { initializeDetail ( itDetails . next ( ) . getId ( ) ) ; } } catch ( Exception e ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_LIST_FILL_1 , getList ( ) . getName ( ) . key ( getLocale ( ) ) , null ) , e ) ; }
public class DefaultExportationLinker { /** * Unbind the { @ link ExporterService } . */ @ Unbind ( id = "exporterServices" ) void unbindExporterService ( ServiceReference < ExporterService > serviceReference ) { } }
LOG . debug ( linkerName + " : Unbind the ExporterService " + exportersManager . getDeclarationBinder ( serviceReference ) ) ; synchronized ( lock ) { exportersManager . removeLinks ( serviceReference ) ; exportersManager . remove ( serviceReference ) ; }
public class Elasticsearch { /** * Configures how to buffer elements before sending them in bulk to the cluster for efficiency . * < p > Sets the maximum size of buffered actions per bulk request ( using the syntax of { @ link MemorySize } ) . */ public Elasticsearch bulkFlushMaxSize ( String maxSize ) { } }
internalProperties . putMemorySize ( CONNECTOR_BULK_FLUSH_MAX_SIZE , MemorySize . parse ( maxSize , MemorySize . MemoryUnit . BYTES ) ) ; return this ;
public class SparkDDFManager { /** * TODO : check more than a few lines in case some lines have NA * @ param fileRDD * @ return */ public String [ ] getMetaInfo ( JavaRDD < String > fileRDD , String fieldSeparator ) { } }
String [ ] headers = null ; int sampleSize = 5 ; // sanity check if ( sampleSize < 1 ) { mLog . info ( "DATATYPE_SAMPLE_SIZE must be bigger than 1" ) ; return null ; } List < String > sampleStr = fileRDD . take ( sampleSize ) ; sampleSize = sampleStr . size ( ) ; // actual sample size mLog . info ( "Sample size: " + sampleSize ) ; // create sample list for getting data type String [ ] firstSplit = sampleStr . get ( 0 ) . split ( fieldSeparator ) ; // get header boolean hasHeader = false ; if ( hasHeader ) { headers = firstSplit ; } else { headers = new String [ firstSplit . length ] ; int size = headers . length ; for ( int i = 0 ; i < size ; ) { headers [ i ] = "V" + ( ++ i ) ; } } String [ ] [ ] samples = hasHeader ? ( new String [ firstSplit . length ] [ sampleSize - 1 ] ) : ( new String [ firstSplit . length ] [ sampleSize ] ) ; String [ ] metaInfoArray = new String [ firstSplit . length ] ; int start = hasHeader ? 1 : 0 ; for ( int j = start ; j < sampleSize ; j ++ ) { firstSplit = sampleStr . get ( j ) . split ( fieldSeparator ) ; for ( int i = 0 ; i < firstSplit . length ; i ++ ) { samples [ i ] [ j - start ] = firstSplit [ i ] ; } } boolean doPreferDouble = true ; for ( int i = 0 ; i < samples . length ; i ++ ) { String [ ] vector = samples [ i ] ; metaInfoArray [ i ] = headers [ i ] + " " + determineType ( vector , doPreferDouble ) ; } return metaInfoArray ;
public class GeoHash { /** * Returns a map to be used in hash border calculations . * @ return map of borders */ private static Map < Direction , Map < Parity , String > > createBorders ( ) { } }
Map < Direction , Map < Parity , String > > m = createDirectionParityMap ( ) ; m . get ( Direction . RIGHT ) . put ( Parity . EVEN , "bcfguvyz" ) ; m . get ( Direction . LEFT ) . put ( Parity . EVEN , "0145hjnp" ) ; m . get ( Direction . TOP ) . put ( Parity . EVEN , "prxz" ) ; m . get ( Direction . BOTTOM ) . put ( Parity . EVEN , "028b" ) ; addOddParityEntries ( m ) ; return m ;
public class AWSCodeCommitClient { /** * Replaces the contents of the description of a pull request . * @ param updatePullRequestDescriptionRequest * @ return Result of the UpdatePullRequestDescription operation returned by the service . * @ throws PullRequestDoesNotExistException * The pull request ID could not be found . Make sure that you have specified the correct repository name and * pull request ID , and then try again . * @ throws InvalidPullRequestIdException * The pull request ID is not valid . Make sure that you have provided the full ID and that the pull request * is in the specified repository , and then try again . * @ throws PullRequestIdRequiredException * A pull request ID is required , but none was provided . * @ throws InvalidDescriptionException * The pull request description is not valid . Descriptions are limited to 1,000 characters in length . * @ throws PullRequestAlreadyClosedException * The pull request status cannot be updated because it is already closed . * @ sample AWSCodeCommit . UpdatePullRequestDescription * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codecommit - 2015-04-13 / UpdatePullRequestDescription " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdatePullRequestDescriptionResult updatePullRequestDescription ( UpdatePullRequestDescriptionRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdatePullRequestDescription ( request ) ;
public class AbstractQueryLogEntryCreator { /** * populate param map with sorted by key . * @ param params list of ParameterSetOperation * @ return a map : key = index / name as string , value = first value * @ since 1.4 */ protected SortedMap < String , String > getParametersToDisplay ( List < ParameterSetOperation > params ) { } }
// populate param map with sorted by key : key = index / name , value = first value SortedMap < String , String > paramMap = new TreeMap < String , String > ( new StringAsIntegerComparator ( ) ) ; for ( ParameterSetOperation param : params ) { String key = getParameterKeyToDisplay ( param ) ; String value = getParameterValueToDisplay ( param ) ; paramMap . put ( key , value ) ; } return paramMap ;
public class TimePickerDialog { /** * Try to start keyboard mode with the specified key , as long as the timepicker is not in the * middle of a touch - event . * @ param keyCode The key to use as the first press . Keyboard mode will not be started if the * key is not legal to start with . Or , pass in - 1 to get into keyboard mode without a starting * key . */ private void tryStartingKbMode ( int keyCode ) { } }
if ( mTimePicker . trySettingInputEnabled ( false ) && ( keyCode == - 1 || addKeyIfLegal ( keyCode ) ) ) { mInKbMode = true ; mDoneButton . setEnabled ( false ) ; updateDisplay ( false ) ; }
public class ClusterNode { /** * This method is used to initialize the resource type to max CPU mapping * based upon the cpuToResourcePartitioning instance given * @ param cpuToResourcePartitioning Mapping of cpus to resources to be used */ public void initResourceTypeToMaxCpuMap ( Map < Integer , Map < ResourceType , Integer > > cpuToResourcePartitioning ) { } }
resourceTypeToMaxCpu = getResourceTypeToCountMap ( ( int ) clusterNodeInfo . total . numCpus , cpuToResourcePartitioning ) ;
public class SecurityActions { /** * Close an URLClassLoader * @ param cl The class loader */ static void closeURLClassLoader ( final URLClassLoader cl ) { } }
AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { public Object run ( ) { if ( cl != null ) { try { cl . close ( ) ; } catch ( IOException ioe ) { // Ignore } } return null ; } } ) ;
public class Processor { /** * Reads all lines from our reader . * Takes care of markdown link references . * @ return A Block containing all lines . * @ throws IOException * If an IO error occurred . */ private Block readLines ( ) throws IOException { } }
final Block block = new Block ( ) ; final StringBuilder sb = new StringBuilder ( 80 ) ; int c = this . reader . read ( ) ; LinkRef lastLinkRef = null ; while ( c != - 1 ) { sb . setLength ( 0 ) ; int pos = 0 ; boolean eol = false ; while ( ! eol ) { switch ( c ) { case - 1 : eol = true ; break ; case '\n' : c = this . reader . read ( ) ; if ( c == '\r' ) { c = this . reader . read ( ) ; } eol = true ; break ; case '\r' : c = this . reader . read ( ) ; if ( c == '\n' ) { c = this . reader . read ( ) ; } eol = true ; break ; case '\t' : { final int np = pos + ( 4 - ( pos & 3 ) ) ; while ( pos < np ) { sb . append ( ' ' ) ; pos ++ ; } c = this . reader . read ( ) ; break ; } default : if ( c != '<' || ! this . config . panicMode ) { pos ++ ; sb . append ( ( char ) c ) ; } else { pos += 4 ; sb . append ( "&lt;" ) ; } c = this . reader . read ( ) ; break ; } } final Line line = new Line ( ) ; line . value = sb . toString ( ) ; line . init ( ) ; // Check for link definitions boolean isLinkRef = false ; String id = null , link = null , comment = null ; if ( ! line . isEmpty && line . leading < 4 && line . value . charAt ( line . leading ) == '[' ) { line . pos = line . leading + 1 ; // Read ID up to ' ] ' id = line . readUntil ( ']' ) ; // Is ID valid and are there any more characters ? if ( id != null && line . pos + 2 < line . value . length ( ) ) { // Check for ' : ' ( [ . . . ] : . . . ) if ( line . value . charAt ( line . pos + 1 ) == ':' ) { line . pos += 2 ; line . skipSpaces ( ) ; // Check for link syntax if ( line . value . charAt ( line . pos ) == '<' ) { line . pos ++ ; link = line . readUntil ( '>' ) ; line . pos ++ ; } else { link = line . readUntil ( ' ' , '\n' ) ; } // Is link valid ? if ( link != null ) { // Any non - whitespace characters following ? if ( line . skipSpaces ( ) ) { final char ch = line . value . charAt ( line . pos ) ; // Read comment if ( ch == '\"' || ch == '\'' || ch == '(' ) { line . pos ++ ; comment = line . readUntil ( ch == '(' ? ')' : ch ) ; // Valid linkRef only if comment is valid if ( comment != null ) { isLinkRef = true ; } } } else { isLinkRef = true ; } } } } } // To make compiler happy : add ! = null checks if ( isLinkRef && id != null && link != null ) { if ( id . toLowerCase ( ) . equals ( "$profile$" ) ) { this . emitter . useExtensions = this . useExtensions = link . toLowerCase ( ) . equals ( "extended" ) ; lastLinkRef = null ; } else { // Store linkRef and skip line final LinkRef lr = new LinkRef ( link , comment , comment != null && ( link . length ( ) == 1 && link . charAt ( 0 ) == '*' ) ) ; this . emitter . addLinkRef ( id , lr ) ; if ( comment == null ) { lastLinkRef = lr ; } } } else { comment = null ; // Check for multi - line linkRef if ( ! line . isEmpty && lastLinkRef != null ) { line . pos = line . leading ; final char ch = line . value . charAt ( line . pos ) ; if ( ch == '\"' || ch == '\'' || ch == '(' ) { line . pos ++ ; comment = line . readUntil ( ch == '(' ? ')' : ch ) ; } if ( comment != null ) { lastLinkRef . title = comment ; } lastLinkRef = null ; } // No multi - line linkRef , store line if ( comment == null ) { line . pos = 0 ; block . appendLine ( line ) ; } } } return block ;
public class CmsContentEditor { /** * Switches to the selected locale . Will save changes first . < p > * @ param locale the locale to switch to */ void switchLocale ( final String locale ) { } }
if ( locale . equals ( m_locale ) ) { return ; } m_locale = locale ; m_basePanel . clear ( ) ; destroyForm ( false ) ; final CmsEntity entity = m_entityBackend . getEntity ( m_entityId ) ; m_entityId = getIdForLocale ( locale ) ; // if the content does not contain the requested locale yet , a new node will be created final boolean addedNewLocale = ! m_contentLocales . contains ( locale ) ; if ( m_registeredEntities . contains ( m_entityId ) ) { unregistereEntity ( m_entityId ) ; } if ( addedNewLocale ) { loadNewDefinition ( m_entityId , entity , new I_CmsSimpleCallback < CmsContentDefinition > ( ) { public void execute ( final CmsContentDefinition contentDefinition ) { setContentDefinition ( contentDefinition ) ; renderFormContent ( ) ; setChanged ( ) ; } } ) ; } else { loadDefinition ( m_entityId , entity , new I_CmsSimpleCallback < CmsContentDefinition > ( ) { public void execute ( CmsContentDefinition contentDefinition ) { setContentDefinition ( contentDefinition ) ; renderFormContent ( ) ; } } ) ; }
public class ParagraphVectors { /** * Predict several labels based on the document . * Computes a similarity wrt the mean of the * representation of words in the document * @ param rawText raw text of the document * @ return possible labels in descending order */ public Collection < String > predictSeveral ( String rawText , int limit ) { } }
if ( tokenizerFactory == null ) throw new IllegalStateException ( "TokenizerFactory should be defined, prior to predict() call" ) ; List < String > tokens = tokenizerFactory . create ( rawText ) . getTokens ( ) ; List < VocabWord > document = new ArrayList < > ( ) ; for ( String token : tokens ) { if ( vocab . containsWord ( token ) ) { document . add ( vocab . wordFor ( token ) ) ; } } return predictSeveral ( document , limit ) ;
public class SaturationChecker { /** * Calculate the number of missing hydrogens by subtracting the number of * bonds for the atom from the expected number of bonds . Charges are included * in the calculation . The number of expected bonds is defined by the AtomType * generated with the AtomTypeFactory . * @ param atom Description of the Parameter * @ param throwExceptionForUnknowAtom Should an exception be thrown if an unknown atomtype is found or 0 returned ? * @ return Description of the Return Value * @ see AtomTypeFactory */ public int calculateNumberOfImplicitHydrogens ( IAtom atom , double bondOrderSum , double singleElectronSum , List < IBond > connectedBonds , boolean throwExceptionForUnknowAtom ) throws CDKException { } }
int missingHydrogen = 0 ; if ( atom instanceof IPseudoAtom ) { // don ' t figure it out . . . it simply does not lack H ' s } else if ( atom . getAtomicNumber ( ) != null && atom . getAtomicNumber ( ) == 1 || atom . getSymbol ( ) . equals ( "H" ) ) { missingHydrogen = ( int ) ( 1 - bondOrderSum - singleElectronSum - atom . getFormalCharge ( ) ) ; } else { logger . info ( "Calculating number of missing hydrogen atoms" ) ; // get default atom IAtomType [ ] atomTypes = getAtomTypeFactory ( atom . getBuilder ( ) ) . getAtomTypes ( atom . getSymbol ( ) ) ; if ( atomTypes . length == 0 && throwExceptionForUnknowAtom ) return 0 ; logger . debug ( "Found atomtypes: " + atomTypes . length ) ; if ( atomTypes . length > 0 ) { IAtomType defaultAtom = atomTypes [ 0 ] ; logger . debug ( "DefAtom: " , defaultAtom ) ; Integer formalCharge = atom . getFormalCharge ( ) ; if ( formalCharge == null ) formalCharge = 0 ; Double tmpBondOrderSum = defaultAtom . getBondOrderSum ( ) ; if ( tmpBondOrderSum == null ) tmpBondOrderSum = 0.0 ; missingHydrogen = ( int ) ( tmpBondOrderSum - bondOrderSum - singleElectronSum + formalCharge ) ; if ( atom . getFlag ( CDKConstants . ISAROMATIC ) ) { boolean subtractOne = true ; for ( int i = 0 ; i < connectedBonds . size ( ) ; i ++ ) { IBond conBond = ( IBond ) connectedBonds . get ( i ) ; if ( conBond . getOrder ( ) == IBond . Order . DOUBLE || conBond . getFlag ( CDKConstants . ISAROMATIC ) ) subtractOne = false ; } if ( subtractOne ) missingHydrogen -- ; } logger . debug ( "Atom: " , atom . getSymbol ( ) ) ; logger . debug ( " max bond order: " + tmpBondOrderSum ) ; logger . debug ( " bond order sum: " + bondOrderSum ) ; logger . debug ( " charge : " + formalCharge ) ; } else { logger . warn ( "Could not find atom type for " , atom . getSymbol ( ) ) ; } } return missingHydrogen ;
public class ColumnInformation { /** * Constructor . * @ param name column name * @ param type column type * @ return ColumnInformation */ public static ColumnInformation create ( String name , ColumnType type ) { } }
byte [ ] nameBytes = name . getBytes ( ) ; byte [ ] arr = new byte [ 23 + 2 * nameBytes . length ] ; int pos = 0 ; // lenenc _ str catalog // lenenc _ str schema // lenenc _ str table // lenenc _ str org _ table for ( int i = 0 ; i < 4 ; i ++ ) { arr [ pos ++ ] = 1 ; arr [ pos ++ ] = 0 ; } // lenenc _ str name // lenenc _ str org _ name for ( int i = 0 ; i < 2 ; i ++ ) { arr [ pos ++ ] = ( byte ) name . length ( ) ; System . arraycopy ( nameBytes , 0 , arr , pos , nameBytes . length ) ; pos += nameBytes . length ; } // lenenc _ int length of fixed - length fields [ 0c ] arr [ pos ++ ] = 0xc ; // 2 character set arr [ pos ++ ] = 33 ; /* charset = UTF8 */ arr [ pos ++ ] = 0 ; int len ; /* Sensible predefined length - since we ' re dealing with I _ S here , most char fields are 64 char long */ switch ( type . getSqlType ( ) ) { case Types . VARCHAR : case Types . CHAR : len = 64 * 3 ; /* 3 bytes per UTF8 char */ break ; case Types . SMALLINT : len = 5 ; break ; case Types . NULL : len = 0 ; break ; default : len = 1 ; break ; } arr [ pos ] = ( byte ) len ; /* 4 bytes : column length */ pos += 4 ; arr [ pos ++ ] = ( byte ) ColumnType . toServer ( type . getSqlType ( ) ) . getType ( ) ; /* 1 byte : type */ arr [ pos ++ ] = ( byte ) len ; /* 2 bytes : flags */ arr [ pos ++ ] = 0 ; arr [ pos ++ ] = 0 ; /* decimals */ arr [ pos ++ ] = 0 ; /* 2 bytes filler */ arr [ pos ] = 0 ; return new ColumnInformation ( new Buffer ( arr ) ) ;
public class ContainerAliasResolver { /** * Looks up container id for given alias that is associated with case instance * @ param alias container alias * @ param caseId unique case instance id * @ return * @ throws IllegalArgumentException in case there are no containers for given alias */ public String forCaseInstance ( String alias , String caseId ) { } }
return registry . getContainerId ( alias , new ByCaseIdContainerLocator ( caseId ) ) ;
public class CachedConnectionManagerImpl { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) public void popContext ( Set unsharableResources ) throws ResourceException { } }
LinkedList < Context > stack = threadContexts . get ( ) ; if ( stack == null || stack . isEmpty ( ) ) return ; Context context = stack . removeLast ( ) ; if ( log . isTraceEnabled ( ) ) { if ( ! stack . isEmpty ( ) ) { log . tracef ( "pop: old stack for context: %s" , context ) ; log . tracef ( "pop: new stack for context: %s" , stack . getLast ( ) ) ; } else { log . tracef ( "pop: old stack for context: %s" , context ) ; } } if ( Tracer . isEnabled ( ) ) Tracer . popCCMContext ( context . toString ( ) , new Throwable ( "CALLSTACK" ) ) ; if ( debug && closeAll ( context ) && error ) { throw new ResourceException ( bundle . someConnectionsWereNotClosed ( ) ) ; } context . clear ( ) ;
public class DefaultLanguagesRepository { /** * Get list of all supported languages . */ @ Override public Collection < Language > all ( ) { } }
org . sonar . api . resources . Language [ ] all = languages . all ( ) ; Collection < Language > result = new ArrayList < > ( all . length ) ; for ( org . sonar . api . resources . Language language : all ) { result . add ( new Language ( language . getKey ( ) , language . getName ( ) , language . getFileSuffixes ( ) ) ) ; } return result ;
public class BigDecimalRenderer { /** * returns the instance . * @ return CurrencyDoubleRenderer */ public static final Renderer < BigDecimal > instance ( ) { } }
// NOPMD it ' s thread save ! if ( BigDecimalRenderer . instanceRenderer == null ) { synchronized ( BigDecimalRenderer . class ) { if ( BigDecimalRenderer . instanceRenderer == null ) { BigDecimalRenderer . instanceRenderer = new BigDecimalRenderer ( ) ; } } } return BigDecimalRenderer . instanceRenderer ;
public class NumberParser { /** * Parses a long out of a string . * @ param str string to parse for a long . * @ param def default value to return if it is not possible to parse the the string . * @ return the long represented by the given string , or the default . */ public static long parseLong ( final String str , final long def ) { } }
final Long ret = parseLong ( str ) ; if ( ret == null ) { return def ; } else { return ret . longValue ( ) ; }
public class GDLLoader { /** * Parses an { @ code EdgeLengthContext } and returns the indicated Range * @ param lengthCtx the edges length context * @ return int array representing lower and upper bound */ private int [ ] parseEdgeLengthContext ( GDLParser . EdgeLengthContext lengthCtx ) { } }
int lowerBound = 0 ; int upperBound = 0 ; if ( lengthCtx != null ) { int children = lengthCtx . getChildCount ( ) ; if ( children == 4 ) { // [ * 1 . . 2] lowerBound = terminalNodeToInt ( lengthCtx . IntegerLiteral ( 0 ) ) ; upperBound = terminalNodeToInt ( lengthCtx . IntegerLiteral ( 1 ) ) ; } else if ( children == 3 ) { upperBound = terminalNodeToInt ( lengthCtx . IntegerLiteral ( 0 ) ) ; } else if ( children == 2 ) { lowerBound = terminalNodeToInt ( lengthCtx . IntegerLiteral ( 0 ) ) ; } else { lowerBound = 0 ; upperBound = 0 ; } } else { // regular edge lowerBound = 1 ; upperBound = 1 ; } return new int [ ] { lowerBound , upperBound } ;
public class DataSynchronizer { /** * Replaces a single synchronized document by its given id with the given full document * replacement . No replacement will occur if the _ id is not being synchronized . * @ param nsConfig the namespace synchronization config of the namespace where the document * lives . * @ param documentId the _ id of the document . * @ param remoteDocument the replacement document . */ @ CheckReturnValue private LocalSyncWriteModelContainer replaceOrUpsertOneFromRemote ( final NamespaceSynchronizationConfig nsConfig , final BsonValue documentId , final BsonDocument remoteDocument , final BsonDocument atVersion ) { } }
final MongoNamespace namespace = nsConfig . getNamespace ( ) ; final ChangeEvent < BsonDocument > event ; final Lock lock = this . syncConfig . getNamespaceConfig ( namespace ) . getLock ( ) . writeLock ( ) ; lock . lock ( ) ; final BsonDocument docForStorage ; final CoreDocumentSynchronizationConfig config ; try { config = syncConfig . getSynchronizedDocument ( namespace , documentId ) ; if ( config == null ) { return null ; } docForStorage = sanitizeDocument ( remoteDocument ) ; config . setPendingWritesComplete ( HashUtils . hash ( docForStorage ) , atVersion ) ; event = ChangeEvents . changeEventForLocalReplace ( namespace , documentId , docForStorage , false ) ; } finally { lock . unlock ( ) ; } final LocalSyncWriteModelContainer container = newWriteModelContainer ( nsConfig ) ; container . addDocIDs ( documentId ) ; container . addLocalWrite ( new ReplaceOneModel < > ( getDocumentIdFilter ( documentId ) , docForStorage , new ReplaceOptions ( ) . upsert ( true ) ) ) ; container . addLocalChangeEvent ( event ) ; container . addConfigWrite ( new ReplaceOneModel < > ( CoreDocumentSynchronizationConfig . getDocFilter ( namespace , config . getDocumentId ( ) ) , config ) ) ; return container ;
public class ConnectionDescriptorImpl { /** * Set all of the stored information based on the input strings . * @ param _ rhn * @ param _ rha * @ param _ lhn * @ param _ lha */ public void setAll ( String _rhn , String _rha , String _lhn , String _lha ) { } }
this . remoteHostName = _rhn ; this . remoteHostAddress = _rha ; this . localHostName = _lhn ; this . localHostAddress = _lha ; this . addrLocal = null ; this . addrRemote = null ;
public class CommerceTaxMethodLocalServiceBaseImpl { /** * Updates the commerce tax method in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceTaxMethod the commerce tax method * @ return the commerce tax method that was updated */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public CommerceTaxMethod updateCommerceTaxMethod ( CommerceTaxMethod commerceTaxMethod ) { } }
return commerceTaxMethodPersistence . update ( commerceTaxMethod ) ;
public class PDTXMLConverter { /** * Create a Java representation of XML Schema builtin datatype * < code > date < / code > or < code > g * < / code > . * For example , an instance of < code > gYear < / code > can be created invoking this * factory with < code > month < / code > and < code > day < / code > parameters set to * { @ link DatatypeConstants # FIELD _ UNDEFINED } . * A { @ link DatatypeConstants # FIELD _ UNDEFINED } value indicates that field is * not set . * @ param nHour * Hour to be created . * @ param nMinute * Minute to be created . * @ param nSecond * Second to be created . * @ param nMilliSecond * Milli second to be created . * @ return < code > XMLGregorianCalendar < / code > created from parameter values . * @ see DatatypeConstants # FIELD _ UNDEFINED * @ throws IllegalArgumentException * If any individual parameter ' s value is outside the maximum value * constraint for the field as determined by the Date / Time Data * Mapping table in { @ link XMLGregorianCalendar } or if the composite * values constitute an invalid < code > XMLGregorianCalendar < / code > * instance as determined by { @ link XMLGregorianCalendar # isValid ( ) } . */ @ Nonnull public static XMLGregorianCalendar getXMLCalendarTime ( final int nHour , final int nMinute , final int nSecond , final int nMilliSecond ) { } }
return getXMLCalendarTime ( nHour , nMinute , nSecond , nMilliSecond , DatatypeConstants . FIELD_UNDEFINED ) ;
public class ExtraFieldUtils { /** * Register a ZipExtraField implementation . * The given class must have a no - arg constructor and implement the { @ link ZipExtraField ZipExtraField interface } . * @ param c the class to register * @ since 1.1 */ public static void register ( Class < ? > c ) { } }
try { ZipExtraField ze = ( ZipExtraField ) c . newInstance ( ) ; implementations . put ( ze . getHeaderId ( ) , c ) ; } catch ( ClassCastException cc ) { throw new RuntimeException ( c + " doesn\'t implement ZipExtraField" ) ; } catch ( InstantiationException ie ) { throw new RuntimeException ( c + " is not a concrete class" ) ; } catch ( IllegalAccessException ie ) { throw new RuntimeException ( c + "\'s no-arg constructor is not public" ) ; }
public class CouchDbRepositorySupport { /** * Allows subclasses to query views with simple String value keys * and load the result as the repository ' s handled type . * The viewName must be defined in this repository ' s design document . * @ param viewName * @ param key * @ return */ protected List < T > queryView ( String viewName , ComplexKey key ) { } }
return db . queryView ( createQuery ( viewName ) . includeDocs ( true ) . key ( key ) , type ) ;
public class SealedObject { /** * Retrieves the original ( encapsulated ) object . * < p > The encapsulated object is unsealed ( using the given Cipher , * assuming that the Cipher is already properly initialized ) and * de - serialized , before it is returned . * @ param c the cipher used to unseal the object * @ return the original object . * @ exception NullPointerException if the given cipher is null . * @ exception IOException if an error occurs during de - serialiazation * @ exception ClassNotFoundException if an error occurs during * de - serialiazation * @ exception IllegalBlockSizeException if the given cipher is a block * cipher , no padding has been requested , and the total input length is * not a multiple of the cipher ' s block size * @ exception BadPaddingException if the given cipher has been * initialized for decryption , and padding has been specified , but * the input data does not have proper expected padding bytes */ public final Object getObject ( Cipher c ) throws IOException , ClassNotFoundException , IllegalBlockSizeException , BadPaddingException { } }
/* * Unseal the object */ byte [ ] content = c . doFinal ( this . encryptedContent ) ; /* * De - serialize it */ // creating a stream pipe - line , from b to a ByteArrayInputStream b = new ByteArrayInputStream ( content ) ; ObjectInput a = new extObjectInputStream ( b ) ; try { Object obj = a . readObject ( ) ; return obj ; } finally { a . close ( ) ; }
public class A_CmsUserDataImexportDialog { /** * Returns the role names to show in the select box . < p > * @ return the role names to show in the select box */ protected List < CmsSelectWidgetOption > getSelectRoles ( ) { } }
List < CmsSelectWidgetOption > retVal = new ArrayList < CmsSelectWidgetOption > ( ) ; try { boolean inRootOu = CmsStringUtil . isEmptyOrWhitespaceOnly ( getParamOufqn ( ) ) || CmsOrganizationalUnit . SEPARATOR . equals ( getParamOufqn ( ) ) ; List < CmsRole > roles = OpenCms . getRoleManager ( ) . getRolesOfUser ( getCms ( ) , getCms ( ) . getRequestContext ( ) . getCurrentUser ( ) . getName ( ) , getParamOufqn ( ) , false , false , false ) ; Iterator < CmsRole > itRoles = roles . iterator ( ) ; while ( itRoles . hasNext ( ) ) { CmsRole role = itRoles . next ( ) ; if ( role . isOrganizationalUnitIndependent ( ) && ! inRootOu ) { continue ; } retVal . add ( new CmsSelectWidgetOption ( role . getGroupName ( ) , false , role . getName ( getLocale ( ) ) ) ) ; } } catch ( CmsException e ) { // noop } Collections . sort ( retVal , new Comparator < CmsSelectWidgetOption > ( ) { public int compare ( CmsSelectWidgetOption arg0 , CmsSelectWidgetOption arg1 ) { return arg0 . getOption ( ) . compareTo ( arg1 . getOption ( ) ) ; } } ) ; return retVal ;
public class CmsSiteManagerImpl { /** * Sets the shared folder path . < p > * @ param sharedFolder the shared folder path */ public void setSharedFolder ( String sharedFolder ) { } }
if ( m_frozen ) { throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_CONFIG_FROZEN_0 ) ) ; } m_sharedFolder = CmsStringUtil . joinPaths ( "/" , sharedFolder , "/" ) ;
public class Callbacks { /** * Invokes the given Consumer with the given argument , and catches any exceptions that it may throw . * @ param consumer The consumer to invoke . * @ param argument1 The first argument to pass to the consumer . * @ param argument2 The second argument to pass to the consumer . * @ param failureHandler An optional callback to invoke if the consumer threw any exceptions . * @ param < T1 > The type of the first argument . * @ param < T2 > The type of the second argument . * @ throws NullPointerException If the consumer is null . */ public static < T1 , T2 > void invokeSafely ( BiConsumer < T1 , T2 > consumer , T1 argument1 , T2 argument2 , Consumer < Throwable > failureHandler ) { } }
Preconditions . checkNotNull ( consumer , "consumer" ) ; try { consumer . accept ( argument1 , argument2 ) ; } catch ( Exception ex ) { if ( failureHandler != null ) { invokeSafely ( failureHandler , ex , null ) ; } }
public class GeometryUtils { /** * Gets the WKID for the given hive geometry bytes * @ param geomref reference to hive geometry bytes * @ return WKID set in the first 4 bytes of the hive geometry bytes */ public static int getWKID ( BytesWritable geomref ) { } }
ByteBuffer bb = ByteBuffer . wrap ( geomref . getBytes ( ) ) ; return bb . getInt ( 0 ) ;
public class RoaringArray { /** * Gets the last value in the array * @ return the last value in the array * @ throws NoSuchElementException if empty */ public int last ( ) { } }
assertNonEmpty ( ) ; short lastKey = keys [ size - 1 ] ; Container container = values [ size - 1 ] ; return lastKey << 16 | container . last ( ) ;
public class TranStrategy { /** * d173641 */ final boolean globalTxExists ( boolean failIfNonInterop ) throws CSIException { } }
Transaction tx = null ; try { tx = txManager . getTransaction ( ) ; // d173641 } catch ( SystemException se ) { // FFDCFilter . processException ( se , CLASS _ NAME + " . globalTxExists " , " 217 " , this ) ; / / d174358.3 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Could not determine if there is a global tx active" ) ; } } if ( ( failIfNonInterop ) && ( tx != null ) && // LIDB1673.2.1.5 ( ( ( UOWCoordinator ) tx ) . getTxType ( ) == // LIDB1673.2.1.5 UOWCoordinator . TXTYPE_NONINTEROP_GLOBAL ) ) // LIDB1673.2.1.5 { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Cannot proceed under a non-interoperable transaction context" ) ; } throw new CSITransactionRequiredException ( "Interoperable global transaction required" ) ; } return ( tx != null ) ; // LIDB1673.2.1.5
public class ProTrackerMixer { /** * Sets the borders for Portas * @ since 17.06.2010 * @ param aktMemo */ protected void setPeriodBorders ( ChannelMemory aktMemo ) { } }
if ( frequencyTableType == Helpers . AMIGA_TABLE ) { aktMemo . portaStepUpEnd = getFineTunePeriod ( aktMemo , Helpers . getNoteIndexForPeriod ( 113 ) + 1 ) ; aktMemo . portaStepDownEnd = getFineTunePeriod ( aktMemo , Helpers . getNoteIndexForPeriod ( 856 ) + 1 ) ; } else { aktMemo . portaStepUpEnd = getFineTunePeriod ( aktMemo , 119 ) ; aktMemo . portaStepDownEnd = getFineTunePeriod ( aktMemo , 0 ) ; }
public class AtomContainerRenderer { /** * Reset the draw center and model center , and set the zoom to 100 % . */ public void reset ( ) { } }
modelCenter = new Point2d ( 0 , 0 ) ; drawCenter = new Point2d ( 200 , 200 ) ; rendererModel . getParameter ( ZoomFactor . class ) . setValue ( 1.0 ) ; setup ( ) ;
public class ByteBufUtil { /** * Writes a big - endian 16 - bit short integer to the buffer . */ @ SuppressWarnings ( "deprecation" ) public static ByteBuf writeShortBE ( ByteBuf buf , int shortValue ) { } }
return buf . order ( ) == ByteOrder . BIG_ENDIAN ? buf . writeShort ( shortValue ) : buf . writeShortLE ( shortValue ) ;
public class CPDefinitionOptionValueRelUtil { /** * Returns the first cp definition option value rel in the ordered set where CPDefinitionOptionRelId = & # 63 ; . * @ param CPDefinitionOptionRelId the cp definition option rel ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition option value rel , or < code > null < / code > if a matching cp definition option value rel could not be found */ public static CPDefinitionOptionValueRel fetchByCPDefinitionOptionRelId_First ( long CPDefinitionOptionRelId , OrderByComparator < CPDefinitionOptionValueRel > orderByComparator ) { } }
return getPersistence ( ) . fetchByCPDefinitionOptionRelId_First ( CPDefinitionOptionRelId , orderByComparator ) ;
public class RuleProviderSorter { /** * Initializes lookup caches that are used during sort to lookup providers by ID or Java { @ link Class } . */ private void initializeLookupCaches ( ) { } }
for ( RuleProvider provider : providers ) { Class < ? extends RuleProvider > unproxiedClass = unwrapType ( provider . getClass ( ) ) ; classToProviderMap . put ( unproxiedClass , provider ) ; idToProviderMap . put ( provider . getMetadata ( ) . getID ( ) , provider ) ; }
public class GeoShapeMapper { /** * { @ inheritDoc } */ @ Override public SortField sortField ( String field , boolean reverse ) { } }
return new SortField ( field , Type . LONG , reverse ) ;
public class ChartComputator { /** * Check if given coordinates lies inside contentRectMinusAllMargins . */ public boolean isWithinContentRect ( float x , float y , float precision ) { } }
if ( x >= contentRectMinusAllMargins . left - precision && x <= contentRectMinusAllMargins . right + precision ) { if ( y <= contentRectMinusAllMargins . bottom + precision && y >= contentRectMinusAllMargins . top - precision ) { return true ; } } return false ;
public class RoboconfErrorHelpers { /** * Resolves errors with their location when it is possible . * Parsing and conversion errors already have location information ( file and line * number ) . This is not the case of runtime errors ( validation of the runtime model ) . * However , these errors keep a reference to the object that contains the error . * When we load an application from a file , we keep an association between a runtime model * object and its location ( file and line number ) . Therefore , we can resolve the location * of runtime errors too ( provided the model was loaded from a file ) . * So , this method replaces ( runtime ) model errors by errors that contain location data . * @ param alr the result of an application load operation * @ return a non - null list of errors */ public static List < RoboconfError > resolveErrorsWithLocation ( ApplicationLoadResult alr ) { } }
List < RoboconfError > result = new ArrayList < > ( ) ; for ( RoboconfError error : alr . getLoadErrors ( ) ) { RoboconfError errorToAdd = error ; if ( error instanceof ModelError ) { Object modelObject = ( ( ModelError ) error ) . getModelObject ( ) ; SourceReference sr = alr . getObjectToSource ( ) . get ( modelObject ) ; if ( sr != null ) errorToAdd = new ParsingError ( error . getErrorCode ( ) , sr . getSourceFile ( ) , sr . getLine ( ) , error . getDetails ( ) ) ; } result . add ( errorToAdd ) ; } return result ;
public class TimestampStats { /** * Use { @ link # getGranularStatsMap ( ) } instead . */ @ java . lang . Deprecated public java . util . Map < java . lang . String , com . google . cloud . automl . v1beta1 . TimestampStats . GranularStats > getGranularStats ( ) { } }
return getGranularStatsMap ( ) ;
public class JsonInput { /** * Writes a JSON null . * @ throws IOException if an error occurs */ JsonEvent readEvent ( ) throws IOException { } }
char next = readNext ( ) ; // whitespace while ( next == ' ' || next == '\t' || next == '\n' || next == '\r' ) { next = readNext ( ) ; } // identify token switch ( next ) { case '{' : return JsonEvent . OBJECT ; case '}' : return JsonEvent . OBJECT_END ; case '[' : return JsonEvent . ARRAY ; case ']' : return JsonEvent . ARRAY_END ; case '"' : return JsonEvent . STRING ; case '-' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : return acceptNumber ( next ) ; case 'n' : return acceptNull ( ) ; case 't' : return acceptTrue ( ) ; case 'f' : return acceptFalse ( ) ; case ',' : return JsonEvent . COMMA ; case ':' : return JsonEvent . COLON ; default : throw new IllegalArgumentException ( "Invalid JSON data: Expected JSON character but found '" + next + "'" ) ; }
public class ServerUpdater { /** * Queues a user ' s nickname to be updated . * @ param user The user whose nickname should be updated . * @ param nickname The new nickname of the user . * @ return The current instance in order to chain call methods . */ public ServerUpdater setNickname ( User user , String nickname ) { } }
delegate . setNickname ( user , nickname ) ; return this ;
public class Pickler { /** * Check the memo table and output a memo lookup if the object is found */ private boolean lookupMemo ( Class < ? > objectType , Object obj ) throws IOException { } }
if ( ! this . useMemo ) return false ; if ( ! objectType . isPrimitive ( ) ) { int hash = valueCompare ? obj . hashCode ( ) : System . identityHashCode ( obj ) ; if ( memo . containsKey ( hash ) && ( valueCompare ? memo . get ( hash ) . obj . equals ( obj ) : memo . get ( hash ) . obj == obj ) ) { // same object or value int memo_index = memo . get ( hash ) . index ; if ( memo_index <= 0xff ) { out . write ( Opcodes . BINGET ) ; out . write ( ( byte ) memo_index ) ; } else { out . write ( Opcodes . LONG_BINGET ) ; byte [ ] index_bytes = PickleUtils . integer_to_bytes ( memo_index ) ; out . write ( index_bytes , 0 , 4 ) ; } return true ; } } return false ;
public class StaticFileImpl { /** * / * ( non - Javadoc ) * @ see org . opoo . press . StaticFile # write ( java . io . File ) */ @ Override public void write ( File dest ) { } }
if ( origin instanceof FileOrigin ) { File target = getOutputFile ( dest ) ; FileOrigin fo = ( FileOrigin ) origin ; if ( target . exists ( ) && target . length ( ) == fo . getLength ( ) && target . lastModified ( ) >= fo . getLastModified ( ) ) { // log . debug ( " Target file is newer than source file , skip copying . " ) ; return ; } try { File parentFile = target . getParentFile ( ) ; if ( ! parentFile . exists ( ) ) { parentFile . mkdirs ( ) ; } log . debug ( "Copying static file to " + target ) ; FileUtils . copyFile ( fo . getFile ( ) , target ) ; } catch ( IOException e ) { log . error ( "Copying static file error: " + target , e ) ; throw new RuntimeException ( e ) ; } } else { log . warn ( "Origin not support yet: " + origin ) ; }
public class FlowTypeCheck { /** * In this case , we are threading each environment as is through to the next * statement . For example , consider this example : * < pre > * function f ( int | null x ) - > ( bool r ) : * return ( x is int ) & & ( x > = 0) * < / pre > * The environment going into < code > x is int < / code > will be * < code > { x - > ( int | null ) } < / code > . The environment coming out of this statement * will be < code > { x - & gt ; int } < / code > and this is just threaded directly into the * next statement < code > x & gt ; 0 < / code > * @ param operands * @ param sign * @ param environment * @ return */ private Environment checkLogicalConjunction ( Expr . LogicalAnd expr , boolean sign , Environment environment ) { } }
Tuple < Expr > operands = expr . getOperands ( ) ; if ( sign ) { for ( int i = 0 ; i != operands . size ( ) ; ++ i ) { environment = checkCondition ( operands . get ( i ) , sign , environment ) ; } return environment ; } else { Environment [ ] refinements = new Environment [ operands . size ( ) ] ; for ( int i = 0 ; i != operands . size ( ) ; ++ i ) { refinements [ i ] = checkCondition ( operands . get ( i ) , sign , environment ) ; // The clever bit . Recalculate assuming opposite sign . environment = checkCondition ( operands . get ( i ) , ! sign , environment ) ; } // Done . return FlowTypeUtils . union ( refinements ) ; }