signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HttpRequest { /** * < pre > * The referer URL of the request , as defined in * [ HTTP / 1.1 Header Field Definitions ] ( http : / / www . w3 . org / Protocols / rfc2616 / rfc2616 - sec14 . html ) . * < / pre > * < code > string referer = 8 ; < / code > */ public java . lang . String getReferer ( ) { } }
java . lang . Object ref = referer_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; referer_ = s ; return s ; }
public class UpgradeScanner10 { /** * Upgrade a table page . */ private void upgradeLeaf ( TableEntry10 table , TableUpgrade upgradeTable , Page10 page ) throws IOException { } }
try ( ReadStream is = openRead ( page . segment ( ) . address ( ) , page . segment ( ) . length ( ) ) ) { is . position ( page . address ( ) ) ; byte [ ] minKey = new byte [ table . keyLength ( ) ] ; byte [ ] maxKey = new byte [ table . keyLength ( ) ] ; is . read ( minKey , 0 , minKey . length ) ; is . read ( maxKey , 0 , maxKey . length ) ; int blocks = BitsUtil . readInt16 ( is ) ; for ( int i = 0 ; i < blocks ; i ++ ) { upgradeLeafBlock ( is , table , upgradeTable , page ) ; } }
public class Messenger { /** * Send document with preview * @ param peer destination peer * @ param fileName File name ( without path ) * @ param mimeType mimetype of document * @ param descriptor File Descriptor * @ param fastThumb FastThumb of preview */ @ ObjectiveCName ( "sendDocumentWithPeer:withName:withMime:withThumb:withDescriptor:" ) public void sendDocument ( Peer peer , String fileName , String mimeType , FastThumb fastThumb , String descriptor ) { } }
modules . getMessagesModule ( ) . sendDocument ( peer , fileName , mimeType , fastThumb , descriptor ) ;
public class NotificationUtils { /** * TODO allow customizing the channel name and color */ @ RequiresApi ( api = Build . VERSION_CODES . O ) public static void setupNotificationChannel ( ) { } }
NotificationManager manager = ( NotificationManager ) getApplicationContext ( ) . getSystemService ( Context . NOTIFICATION_SERVICE ) ; NotificationChannel channel = new NotificationChannel ( OfflineConstants . NOTIFICATION_CHANNEL , "Offline" , NotificationManager . IMPORTANCE_DEFAULT ) ; channel . setLightColor ( Color . GREEN ) ; channel . setLockscreenVisibility ( Notification . VISIBILITY_PRIVATE ) ; manager . createNotificationChannel ( channel ) ;
public class EntropyStatistic { /** * Maximal entropy */ private double upperBoundReduction ( double classes ) { } }
double p = 1 / classes ; double r = p * Math . log ( p ) / log2 * classes ; return - r ;
public class ServicesInner { /** * Get compatible SKUs . * The services resource is the top - level resource that represents the Data Migration Service . The skus action returns the list of SKUs that a service resource can be updated to . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; AvailableServiceSkuInner & gt ; object */ public Observable < Page < AvailableServiceSkuInner > > listSkusNextAsync ( final String nextPageLink ) { } }
return listSkusNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < AvailableServiceSkuInner > > , Page < AvailableServiceSkuInner > > ( ) { @ Override public Page < AvailableServiceSkuInner > call ( ServiceResponse < Page < AvailableServiceSkuInner > > response ) { return response . body ( ) ; } } ) ;
public class SoyFileSet { /** * Helper method to compile SoySauce from { @ link ServerCompilationPrimitives } */ private SoySauce doCompileSoySauce ( ServerCompilationPrimitives primitives , Map < String , Supplier < Object > > pluginInstances ) { } }
Optional < CompiledTemplates > templates = BytecodeCompiler . compile ( primitives . registry , primitives . soyTree , // if there is an AST cache , assume we are in ' dev mode ' and trigger lazy compilation . cache != null , errorReporter , soyFileSuppliers , typeRegistry ) ; throwIfErrorsPresent ( ) ; return new SoySauceImpl ( templates . get ( ) , scopedData . enterable ( ) , soyFunctionMap , printDirectives , ImmutableMap . copyOf ( pluginInstances ) ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public FNDFtWdClass createFNDFtWdClassFromString ( EDataType eDataType , String initialValue ) { } }
FNDFtWdClass result = FNDFtWdClass . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class CollectionManager { /** * An empty iterator with hasNext always false . * @ param < T > generic type , * since java can ' t infer it will be Object * @ return the null iterator */ private < T > Iterator < T > emptyIt ( ) { } }
return new Iterator < T > ( ) { @ Override public boolean hasNext ( ) { return false ; } @ Override public T next ( ) { return null ; } } ;
public class DialogRootView { /** * Applies the dialog ' s top padding to the view of a specific area . * @ param area * The area , the view , the padding should be applied to , corresponds to , as an instance * of the class { @ link Area } . The area may not be null * @ param view * The view , the padding should be applied to , as an instance of the class { @ link View } . * The view may not be null */ private boolean applyDialogPaddingTop ( @ NonNull final Area area , @ NonNull final View view ) { } }
if ( area != Area . HEADER && area != Area . CONTENT && area != Area . BUTTON_BAR && view . getVisibility ( ) == View . VISIBLE ) { view . setPadding ( view . getPaddingLeft ( ) , dialogPadding [ 1 ] , view . getPaddingRight ( ) , view . getPaddingBottom ( ) ) ; return true ; } return false ;
public class HomeWS { /** * get uploaded filename , is there a easy way in RESTEasy ? */ private String getFileName ( MultivaluedMap < String , String > header ) { } }
String [ ] contentDisposition = header . getFirst ( "Content-Disposition" ) . split ( ";" ) ; for ( String filename : contentDisposition ) { if ( ( filename . trim ( ) . startsWith ( "filename" ) ) ) { String [ ] name = filename . split ( "=" ) ; String finalFileName = name [ 1 ] . trim ( ) . replaceAll ( "\"" , "" ) ; return finalFileName ; } } return "unknown" ;
public class BccClient { /** * Getting the vnc url to access the instance . * The vnc url can be used once . * @ param request The request containing all options for getting the vnc url . */ public GetInstanceVncResponse getInstanceVnc ( GetInstanceVncRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . GET , INSTANCE_PREFIX , request . getInstanceId ( ) , "vnc" ) ; return this . invokeHttpClient ( internalRequest , GetInstanceVncResponse . class ) ;
public class ThriftInvertedIndexHandler { /** * / * ( non - Javadoc ) * @ see com . impetus . client . cassandra . index . InvertedIndexHandlerBase # searchSuperColumnsInRange ( java . lang . String , org . apache . cassandra . thrift . ConsistencyLevel , java . lang . String , java . lang . String , byte [ ] , java . util . List , byte [ ] , byte [ ] ) */ @ Override protected void searchSuperColumnsInRange ( String columnFamilyName , ConsistencyLevel consistencyLevel , String persistenceUnit , String rowKey , byte [ ] searchSuperColumnName , List < SuperColumn > thriftSuperColumns , byte [ ] start , byte [ ] finish ) { } }
SlicePredicate colPredicate = new SlicePredicate ( ) ; SliceRange sliceRange = new SliceRange ( ) ; sliceRange . setStart ( start ) ; sliceRange . setFinish ( finish ) ; colPredicate . setSlice_range ( sliceRange ) ; Connection conn = thriftClient . getConnection ( ) ; List < ColumnOrSuperColumn > coscList = null ; try { coscList = conn . getClient ( ) . get_slice ( ByteBuffer . wrap ( rowKey . getBytes ( ) ) , new ColumnParent ( columnFamilyName ) , colPredicate , consistencyLevel ) ; } catch ( InvalidRequestException e ) { log . error ( "Unable to search from inverted index, Caused by: ." , e ) ; throw new IndexingException ( e ) ; } catch ( UnavailableException e ) { log . error ( "Unable to search from inverted index, Caused by: ." , e ) ; throw new IndexingException ( e ) ; } catch ( TimedOutException e ) { log . error ( "Unable to search from inverted index, Caused by: ." , e ) ; throw new IndexingException ( e ) ; } catch ( TException e ) { log . error ( "Unable to search from inverted index, Caused by: " , e ) ; throw new IndexingException ( e ) ; } finally { thriftClient . releaseConnection ( conn ) ; } List < SuperColumn > allThriftSuperColumns = ThriftDataResultHelper . transformThriftResult ( coscList , ColumnFamilyType . SUPER_COLUMN , null ) ; for ( SuperColumn superColumn : allThriftSuperColumns ) { if ( superColumn == null ) continue ; if ( superColumn . getName ( ) == searchSuperColumnName ) { thriftSuperColumns . add ( superColumn ) ; } }
public class TypeHandler { /** * Create an Object from the classname and empty constructor . * @ param classname the argument value * @ return the initialised object * @ throws ParseException if the class could not be found or the object could not be created */ public static Object createObject ( String classname ) throws ParseException { } }
Class < ? > cl ; try { cl = Class . forName ( classname ) ; } catch ( ClassNotFoundException cnfe ) { throw new ParseException ( "Unable to find the class: " + classname ) ; } try { return cl . newInstance ( ) ; } catch ( Exception e ) { throw new ParseException ( e . getClass ( ) . getName ( ) + "; Unable to create an instance of: " + classname ) ; }
public class DataTransferServiceClient { /** * Returns information about running and completed jobs . * < p > Sample code : * < pre > < code > * try ( DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient . create ( ) ) { * TransferConfigName parent = ProjectTransferConfigName . of ( " [ PROJECT ] " , " [ TRANSFER _ CONFIG ] " ) ; * for ( TransferRun element : dataTransferServiceClient . listTransferRuns ( parent ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param parent Name of transfer configuration for which transfer runs should be retrieved . * Format of transfer configuration resource name is : * ` projects / { project _ id } / transferConfigs / { config _ id } ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final ListTransferRunsPagedResponse listTransferRuns ( TransferConfigName parent ) { } }
ListTransferRunsRequest request = ListTransferRunsRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . build ( ) ; return listTransferRuns ( request ) ;
public class CmsAreaSelectPanel { /** * Moves the select area to the specified position , while keeping the size . < p > * @ param posX the new X position * @ param posY the new Y position */ private void moveTo ( int posX , int posY ) { } }
posX = ( posX < 0 ) ? 0 : ( ( ( posX + m_currentSelection . getWidth ( ) ) >= m_elementWidth ) ? m_elementWidth - m_currentSelection . getWidth ( ) : posX ) ; posY = ( posY < 0 ) ? 0 : ( ( ( posY + m_currentSelection . getHeight ( ) ) >= m_elementHeight ) ? m_elementHeight - m_currentSelection . getHeight ( ) : posY ) ; m_markerStyle . setTop ( posY , Unit . PX ) ; m_markerStyle . setLeft ( posX , Unit . PX ) ; m_overlayLeftStyle . setWidth ( posX , Unit . PX ) ; m_overlayTopStyle . setLeft ( posX , Unit . PX ) ; m_overlayTopStyle . setHeight ( posY , Unit . PX ) ; m_overlayBottomStyle . setLeft ( posX , Unit . PX ) ; m_overlayBottomStyle . setHeight ( m_elementHeight - posY - m_currentSelection . getHeight ( ) , Unit . PX ) ; m_overlayRightStyle . setWidth ( m_elementWidth - posX - m_currentSelection . getWidth ( ) , Unit . PX ) ; m_currentSelection . setTop ( posY ) ; m_currentSelection . setLeft ( posX ) ;
public class AbstractWatchService { /** * Returns the given key , throwing an exception if it ' s the poison . */ @ Nullable private WatchKey check ( @ Nullable WatchKey key ) { } }
if ( key == poison ) { // ensure other blocking threads get the poison queue . offer ( poison ) ; throw new ClosedWatchServiceException ( ) ; } return key ;
public class LssClient { /** * Create a live session in the live stream service . * @ param request The request object containing all options for creating live session . * @ return the response */ public CreateSessionResponse createSession ( CreateSessionRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; if ( request . getPreset ( ) == null && request . getPresets ( ) == null ) { throw new IllegalArgumentException ( "The parameter preset and presets should NOT both be null or empty." ) ; } InternalRequest internalRequest = createRequest ( HttpMethodName . POST , request , LIVE_SESSION ) ; return invokeHttpClient ( internalRequest , CreateSessionResponse . class ) ;
public class TrackedTorrent { /** * Update this torrent ' s swarm from an announce event . * This will automatically create a new peer on a ' started ' announce event , * and remove the peer on a ' stopped ' announce event . * @ param event The reported event . If < em > null < / em > , means a regular * interval announce event , as defined in the BitTorrent specification . * @ param peerId The byte - encoded peer ID . * @ param hexPeerId The hexadecimal representation of the peer ' s ID . * @ param ip The peer ' s IP address . * @ param port The peer ' s inbound port . * @ param uploaded The peer ' s reported uploaded byte count . * @ param downloaded The peer ' s reported downloaded byte count . * @ param left The peer ' s reported left to download byte count . * @ return The peer that sent us the announce request . */ public TrackedPeer update ( RequestEvent event , ByteBuffer peerId , String hexPeerId , String ip , int port , long uploaded , long downloaded , long left ) throws UnsupportedEncodingException { } }
logger . trace ( "event {}, Peer: {}:{}" , new Object [ ] { event . getEventName ( ) , ip , port } ) ; TrackedPeer peer = null ; TrackedPeer . PeerState state = TrackedPeer . PeerState . UNKNOWN ; PeerUID peerUID = new PeerUID ( new InetSocketAddress ( ip , port ) , getHexInfoHash ( ) ) ; if ( RequestEvent . STARTED . equals ( event ) ) { state = TrackedPeer . PeerState . STARTED ; } else if ( RequestEvent . STOPPED . equals ( event ) ) { peer = this . removePeer ( peerUID ) ; state = TrackedPeer . PeerState . STOPPED ; } else if ( RequestEvent . COMPLETED . equals ( event ) ) { peer = this . getPeer ( peerUID ) ; state = TrackedPeer . PeerState . COMPLETED ; } else if ( RequestEvent . NONE . equals ( event ) ) { peer = this . getPeer ( peerUID ) ; state = TrackedPeer . PeerState . STARTED ; } else { throw new IllegalArgumentException ( "Unexpected announce event type!" ) ; } if ( peer == null ) { peer = new TrackedPeer ( this , ip , port , peerId ) ; this . addPeer ( peer ) ; } peer . update ( state , uploaded , downloaded , left ) ; return peer ;
public class ScaleAnimation { /** * Java wants the first call in a constructor to be super ( ) if it exists at all , so we have to * trick it with this function . * Oh , and this function computes how big the bounding box needs to be to bound the inputted * image scaled to the inputted size centered around the inputted center point . */ public static Rectangle getBounds ( float scale , Point center , Mirage image ) { } }
Point size = getSize ( scale , image ) ; Point corner = getCorner ( center , size ) ; return new Rectangle ( corner . x , corner . y , size . x , size . y ) ;
public class AmazonApiGatewayClient { /** * Changes information about an < a > ClientCertificate < / a > resource . * @ param updateClientCertificateRequest * A request to change information about an < a > ClientCertificate < / a > resource . * @ return Result of the UpdateClientCertificate operation returned by the service . * @ throws UnauthorizedException * The request is denied because the caller has insufficient permissions . * @ throws TooManyRequestsException * The request has reached its throttling limit . Retry after the specified time period . * @ throws BadRequestException * The submitted request is not valid , for example , the input is incomplete or incorrect . See the * accompanying error message for details . * @ throws NotFoundException * The requested resource is not found . Make sure that the request URI is correct . * @ sample AmazonApiGateway . UpdateClientCertificate */ @ Override public UpdateClientCertificateResult updateClientCertificate ( UpdateClientCertificateRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateClientCertificate ( request ) ;
public class Resources { /** * Build a color item . * @ param colorParams the primitive values for the color * @ return a new fresh color item object */ public static ColorItem create ( final ColorParams colorParams ) { } }
return ColorItemImpl . create ( ) . uid ( colorIdGenerator . incrementAndGet ( ) ) . set ( colorParams ) ;
public class SiteRegistrationScreen { /** * GetSiteProperties Method . */ public Map < String , Object > getSiteProperties ( ) { } }
Map < String , Object > properties = super . getSiteProperties ( ) ; properties . put ( BaseRegistrationScreen . SITE_TEMPLATE_CODE_PARAM , DEFAULT_SITE_TEMPLATE ) ; properties . put ( BaseRegistrationScreen . SITE_NAME_TEMPLATE_PARAM , "{0} Site" ) ; properties . put ( MenusMessageData . SITE_TEMPLATE_MENU , "site" ) ; properties . put ( MenusMessageData . SITE_HOME_MENU , "siteStart" ) ; properties . put ( TrxMessageHeader . DESTINATION_PARAM , "http://tour-0020.tourgeek.com:8181/xmlws" ) ; return properties ;
public class TagsApi { /** * Returns a list of hot tags for the given period . * This method does not require authentication . * @ param period period for which to fetch hot tags . Optional . * @ param count number of tags to return . Defaults to 20 . Maximum allowed value is 200 . Optional . * @ return hot tags for the given period . * @ throws JinxException if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . tags . getHotList . html " > flickr . tags . getHotList < / a > */ public HotList getHotList ( JinxConstants . Period period , Integer count ) throws JinxException { } }
Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getHotList" ) ; if ( period != null ) { params . put ( "period" , period . toString ( ) ) ; } if ( count != null && count > 0 ) { params . put ( "count" , count . toString ( ) ) ; } return jinx . flickrGet ( params , HotList . class , false ) ;
public class Collections { /** * Creates a { @ code Spliterator } with only the specified element * @ param < T > Type of elements * @ return A singleton { @ code Spliterator } */ static < T > Spliterator < T > singletonSpliterator ( final T element ) { } }
return new Spliterator < T > ( ) { long est = 1 ; @ Override public Spliterator < T > trySplit ( ) { return null ; } @ Override public boolean tryAdvance ( Consumer < ? super T > consumer ) { Objects . requireNonNull ( consumer ) ; if ( est > 0 ) { est -- ; consumer . accept ( element ) ; return true ; } return false ; } @ Override public void forEachRemaining ( Consumer < ? super T > consumer ) { tryAdvance ( consumer ) ; } @ Override public long estimateSize ( ) { return est ; } @ Override public int characteristics ( ) { int value = ( element != null ) ? Spliterator . NONNULL : 0 ; return value | Spliterator . SIZED | Spliterator . SUBSIZED | Spliterator . IMMUTABLE | Spliterator . DISTINCT | Spliterator . ORDERED ; } } ;
public class POP3Handler { /** * Quit . */ public void exit ( ) { } }
this . quit = true ; try { if ( this . clientSocket != null && ! this . clientSocket . isClosed ( ) ) { this . clientSocket . close ( ) ; this . clientSocket = null ; } } catch ( final IOException e ) { LOGGER . log ( Level . SEVERE , "Error" , e ) ; }
public class ElementMatchers { /** * Matches a { @ link MethodDescription } that is { @ code synchronized } . * @ param < T > The type of the matched object . * @ return A matcher for a { @ code synchronized } method description . */ public static < T extends ModifierReviewable . ForMethodDescription > ElementMatcher . Junction < T > isSynchronized ( ) { } }
return new ModifierMatcher < T > ( ModifierMatcher . Mode . SYNCHRONIZED ) ;
public class BufferDump { /** * Debug print the input byte [ ] up to the input maximum length . This will be * a sequence of 16 byte lines , starting with a line indicator , the hex * bytes and then the ASCII representation . * @ param data * @ param length * @ return String */ static public String getHexDump ( byte [ ] data , int length ) { } }
// boundary checks . . . . if ( null == data || 0 > length ) { return null ; } // if we have less than the target amount , just print what we have if ( data . length < length ) { length = data . length ; } int numlines = ( length / 16 ) + ( ( ( length % 16 ) > 0 ) ? 1 : 0 ) ; StringBuilder buffer = new StringBuilder ( 73 * numlines ) ; for ( int i = 0 , line = 0 ; line < numlines ; line ++ , i += 16 ) { buffer = formatLineId ( buffer , i ) ; buffer . append ( ": " ) ; // format the first 8 bytes as hex data buffer = formatHexData ( buffer , data , i ) ; buffer . append ( " " ) ; // format the second 8 bytes as hex data buffer = formatHexData ( buffer , data , i + 8 ) ; buffer . append ( " " ) ; // now print the ascii version , filtering out non - ascii chars buffer = formatTextData ( buffer , data , i ) ; buffer . append ( '\n' ) ; } return buffer . toString ( ) ;
public class SkillDetailsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SkillDetails skillDetails , ProtocolMarshaller protocolMarshaller ) { } }
if ( skillDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( skillDetails . getProductDescription ( ) , PRODUCTDESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getInvocationPhrase ( ) , INVOCATIONPHRASE_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getReleaseDate ( ) , RELEASEDATE_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getEndUserLicenseAgreement ( ) , ENDUSERLICENSEAGREEMENT_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getGenericKeywords ( ) , GENERICKEYWORDS_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getBulletPoints ( ) , BULLETPOINTS_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getNewInThisVersionBulletPoints ( ) , NEWINTHISVERSIONBULLETPOINTS_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getSkillTypes ( ) , SKILLTYPES_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getReviews ( ) , REVIEWS_BINDING ) ; protocolMarshaller . marshall ( skillDetails . getDeveloperInfo ( ) , DEVELOPERINFO_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class NavigationViewModel { /** * This method will pass { @ link MapboxNavigationOptions } from the { @ link NavigationViewOptions } * to this view model to be used to initialize { @ link MapboxNavigation } . * @ param options to init MapboxNavigation */ void initialize ( NavigationViewOptions options ) { } }
MapboxNavigationOptions navigationOptions = options . navigationOptions ( ) ; navigationOptions = navigationOptions . toBuilder ( ) . isFromNavigationUi ( true ) . build ( ) ; initializeLanguage ( options ) ; initializeTimeFormat ( navigationOptions ) ; initializeDistanceFormatter ( options ) ; if ( ! isRunning ( ) ) { LocationEngine locationEngine = initializeLocationEngineFrom ( options ) ; initializeNavigation ( getApplication ( ) , navigationOptions , locationEngine ) ; addMilestones ( options ) ; initializeVoiceInstructionLoader ( ) ; initializeVoiceInstructionCache ( ) ; initializeNavigationSpeechPlayer ( options ) ; } router . extractRouteOptions ( options ) ;
public class LocatableInputSplitList { /** * Returns the next locatable input split to be consumed by the given instance . The returned input split is selected * in a * way that the distance between the split ' s storage location and the requesting { @ link AbstractInstance } is as * short as possible . * @ param instance * the instance requesting the next file input split * @ return the next input split to be consumed by the given instance or < code > null < / code > if all input splits have * already been consumed . */ synchronized LocatableInputSplit getNextInputSplit ( final AbstractInstance instance ) { } }
final Queue < QueueElem > instanceSplitList = getInstanceSplitList ( instance ) ; while ( true ) { final QueueElem candidate = instanceSplitList . poll ( ) ; if ( candidate == null ) { return null ; } if ( this . masterSet . remove ( candidate . getInputSplit ( ) ) ) { if ( LOG . isInfoEnabled ( ) ) { if ( candidate . distance == 0 ) { LOG . info ( instance + " receives local file input split" ) ; } else { LOG . info ( instance + " receives remote file input split (distance " + candidate . distance + ")" ) ; } } return candidate . getInputSplit ( ) ; } if ( this . masterSet . isEmpty ( ) ) { return null ; } }
public class ToolBarWindowIsActiveState { /** * { @ inheritDoc } */ public boolean isInState ( JComponent c ) { } }
Component parent = c ; while ( parent . getParent ( ) != null ) { if ( parent instanceof JInternalFrame || parent instanceof Window ) { break ; } parent = parent . getParent ( ) ; } if ( parent instanceof JInternalFrame ) { return ( ( JInternalFrame ) parent ) . isSelected ( ) ; } else if ( parent instanceof Window ) { return ( ( Window ) parent ) . isActive ( ) ; } // Default to true . return true ;
public class ManifestEntryVerifier { /** * update the digests for the digests we are interested in */ public void update ( byte buffer ) { } }
if ( skip ) return ; for ( int i = 0 ; i < digests . size ( ) ; i ++ ) { digests . get ( i ) . update ( buffer ) ; }
public class LibertyCustomizeBindingOutInterceptor { /** * build the qname with the given , and make sure the namespace is ended with " / " if specified . * @ param portNameSpace * @ param portLocalName * @ return */ public static QName buildQName ( String namespace , String localName ) { } }
String namespaceURI = namespace ; if ( ! isEmpty ( namespace ) && ! namespace . trim ( ) . endsWith ( "/" ) ) { namespaceURI += "/" ; } return new QName ( namespaceURI , localName ) ;
public class ExtendedMessageFormat { /** * Parse the format component of a format element . * @ param pattern string to parse * @ param pos current parse position * @ return Format description String */ private String parseFormatDescription ( final String pattern , final ParsePosition pos ) { } }
final int start = pos . getIndex ( ) ; seekNonWs ( pattern , pos ) ; final int text = pos . getIndex ( ) ; int depth = 1 ; for ( ; pos . getIndex ( ) < pattern . length ( ) ; next ( pos ) ) { switch ( pattern . charAt ( pos . getIndex ( ) ) ) { case START_FE : depth ++ ; break ; case END_FE : depth -- ; if ( depth == 0 ) { return pattern . substring ( text , pos . getIndex ( ) ) ; } break ; case QUOTE : getQuotedString ( pattern , pos ) ; break ; default : break ; } } throw new IllegalArgumentException ( "Unterminated format element at position " + start ) ;
public class TargetMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Target target , ProtocolMarshaller protocolMarshaller ) { } }
if ( target == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( target . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( target . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( target . getRoleArn ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( target . getInput ( ) , INPUT_BINDING ) ; protocolMarshaller . marshall ( target . getInputPath ( ) , INPUTPATH_BINDING ) ; protocolMarshaller . marshall ( target . getInputTransformer ( ) , INPUTTRANSFORMER_BINDING ) ; protocolMarshaller . marshall ( target . getKinesisParameters ( ) , KINESISPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( target . getRunCommandParameters ( ) , RUNCOMMANDPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( target . getEcsParameters ( ) , ECSPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( target . getBatchParameters ( ) , BATCHPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( target . getSqsParameters ( ) , SQSPARAMETERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BufferUtils { /** * Convert buffer to an integer . Parses up to the first non - numeric character . If no number is found an * IllegalArgumentException is thrown * @ param buffer A buffer containing an integer in flush mode . The position is not changed . * @ param position the position in the buffer to start reading from * @ param length the length of the buffer to use for conversion * @ return an int of the buffer bytes */ public static int toInt ( ByteBuffer buffer , int position , int length ) { } }
int val = 0 ; boolean started = false ; boolean minus = false ; int limit = position + length ; if ( length <= 0 ) throw new NumberFormatException ( toString ( buffer , position , length , StandardCharsets . UTF_8 ) ) ; for ( int i = position ; i < limit ; i ++ ) { byte b = buffer . get ( i ) ; if ( b <= SPACE ) { if ( started ) break ; } else if ( b >= '0' && b <= '9' ) { val = val * 10 + ( b - '0' ) ; started = true ; } else if ( b == MINUS && ! started ) { minus = true ; } else break ; } if ( started ) return minus ? ( - val ) : val ; throw new NumberFormatException ( toString ( buffer ) ) ;
public class TypeVariableName { /** * Returns type variable named { @ code name } with { @ code bounds } . */ public static TypeVariableName get ( String name , TypeName ... bounds ) { } }
return TypeVariableName . of ( name , Arrays . asList ( bounds ) ) ;
public class GraphUtils { /** * Debugging : dot representation of a set of connected nodes . The resulting * dot representation will use { @ code Node . toString } to display node labels * and { @ code Node . printDependency } to display edge labels . The resulting * representation is also customizable with a graph name and a header . */ public static < D > String toDot ( Iterable < ? extends TarjanNode < D > > nodes , String name , String header ) { } }
StringBuilder buf = new StringBuilder ( ) ; buf . append ( String . format ( "digraph %s {\n" , name ) ) ; buf . append ( String . format ( "label = \"%s\";\n" , header ) ) ; // dump nodes for ( TarjanNode < D > n : nodes ) { buf . append ( String . format ( "%s [label = \"%s\"];\n" , n . hashCode ( ) , n . toString ( ) ) ) ; } // dump arcs for ( TarjanNode < D > from : nodes ) { for ( DependencyKind dk : from . getSupportedDependencyKinds ( ) ) { for ( TarjanNode < D > to : from . getDependenciesByKind ( dk ) ) { buf . append ( String . format ( "%s -> %s [label = \" %s \" style = %s ];\n" , from . hashCode ( ) , to . hashCode ( ) , from . getDependencyName ( to , dk ) , dk . getDotStyle ( ) ) ) ; } } } buf . append ( "}\n" ) ; return buf . toString ( ) ;
public class ReferencePipeline { /** * Stateless intermediate operations from Stream */ @ Override public Stream < P_OUT > unordered ( ) { } }
if ( ! isOrdered ( ) ) return this ; return new StatelessOp < P_OUT , P_OUT > ( this , StreamShape . REFERENCE , StreamOpFlag . NOT_ORDERED ) { @ Override public Sink < P_OUT > opWrapSink ( int flags , Sink < P_OUT > sink ) { return sink ; } } ;
public class JmsSessionImpl { /** * Return a count of the number of Producers currently open on this Session . */ public int getProducerCount ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getProducerCount" ) ; int producerCount = producers . size ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getProducerCount" , producerCount ) ; return producerCount ;
public class BeanPropertyAccessor { /** * Returns an array of Lists of BeanProperties . The first index * matches a switch case , the second index provides a list of all the * BeanProperties whose name hash matched on the case . */ private static List [ ] caseMethods ( int caseCount , BeanProperty [ ] props ) { } }
List [ ] cases = new List [ caseCount ] ; for ( int i = 0 ; i < props . length ; i ++ ) { BeanProperty prop = props [ i ] ; int hashCode = prop . getName ( ) . hashCode ( ) ; int caseValue = ( hashCode & 0x7fffffff ) % caseCount ; List matches = cases [ caseValue ] ; if ( matches == null ) { matches = cases [ caseValue ] = new ArrayList ( ) ; } matches . add ( prop ) ; } return cases ;
public class RunWithinInterceptionDecorationContextGenerator { /** * Ends interception context if it was previously stated . This is indicated by a local variable with index 0. */ void endIfStarted ( CodeAttribute b , ClassMethod method ) { } }
b . aload ( getLocalVariableIndex ( 0 ) ) ; b . dup ( ) ; final BranchEnd ifnotnull = b . ifnull ( ) ; b . checkcast ( Stack . class ) ; b . invokevirtual ( Stack . class . getName ( ) , END_INTERCEPTOR_CONTEXT_METHOD_NAME , EMPTY_PARENTHESES + VOID_CLASS_DESCRIPTOR ) ; BranchEnd ifnull = b . gotoInstruction ( ) ; b . branchEnd ( ifnotnull ) ; b . pop ( ) ; // remove null Stack b . branchEnd ( ifnull ) ;
public class StringBlock { /** * Reads whole ( including chunk type ) string block from stream . * Stream must be at the chunk type . */ public static StringBlock read ( IntReader reader ) throws IOException { } }
ReadUtil . readCheckType ( reader , CHUNK_TYPE ) ; int chunkSize = reader . readInt ( ) ; int stringCount = reader . readInt ( ) ; int styleOffsetCount = reader . readInt ( ) ; int flags = reader . readInt ( ) ; int stringsOffset = reader . readInt ( ) ; int stylesOffset = reader . readInt ( ) ; StringBlock block = new StringBlock ( ) ; block . m_stringOffsets = reader . readIntArray ( stringCount ) ; if ( styleOffsetCount != 0 ) { block . m_styleOffsets = reader . readIntArray ( styleOffsetCount ) ; } { int size = ( ( stylesOffset == 0 ) ? chunkSize : stylesOffset ) - stringsOffset ; if ( ( size % 4 ) != 0 ) { throw new IOException ( "String data size is not multiple of 4 (" + size + ")." ) ; } block . m_stringPool = reader . readByteArray ( size ) ; } if ( stylesOffset != 0 ) { int size = ( chunkSize - stylesOffset ) ; if ( ( size % 4 ) != 0 ) { throw new IOException ( "Style data size is not multiple of 4 (" + size + ")." ) ; } block . m_styles = reader . readIntArray ( size / 4 ) ; } // Set field flag to determine if stored in UTF - 8 ( or false for UTF - 16 ) . block . m_isUtf8 = ( flags & UTF8_FLAG ) == UTF8_FLAG ; block . m_strings = new String [ block . getCount ( ) ] ; for ( int i = 0 ; i != block . getCount ( ) ; ++ i ) { block . m_strings [ i ] = block . stringAt ( i ) ; } return block ;
public class InvokerServlet { /** * 从请求信息中反序列化 */ private HttpRequest getHttpServiceRequest ( HttpServletRequest request ) throws IOException { } }
HttpRequest httpServiceRequest = null ; ObjectInputStream ois = null ; try { ois = new ObjectInputStream ( request . getInputStream ( ) ) ; httpServiceRequest = ( HttpRequest ) ois . readObject ( ) ; } catch ( Exception e ) { Debug . logError ( e , module ) ; } finally { if ( ois != null ) ois . close ( ) ; } return httpServiceRequest ;
public class InjectionBinding { /** * d446474 */ protected final Class < ? > loadClass ( String className ) throws InjectionConfigurationException { } }
ClassLoader classLoader = ivNameSpaceConfig . getClassLoader ( ) ; if ( className == null || className . equals ( "" ) || classLoader == null ) // F743-32443 { return null ; } final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "loadClass : " + className ) ; Class < ? > loadedClass = null ; try { loadedClass = classLoader . loadClass ( className ) ; } catch ( ClassNotFoundException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".loadClass" , "675" , this , new Object [ ] { className } ) ; InjectionConfigurationException icex = new InjectionConfigurationException ( "Referenced class could not be loaded : " + className , ex ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "loadClass : " + icex ) ; throw icex ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "loadClass : " + loadedClass ) ; return loadedClass ;
public class FeatureSearch { /** * Empty the grid , thereby removing all rows . When that is done , a new empty row will be displayed . */ public void empty ( ) { } }
searchButton . setDisabled ( true ) ; resetButton . setDisabled ( true ) ; for ( AttributeCriterionPane criterionPane : criterionPanes ) { criterionStack . removeMember ( criterionPane ) ; } criterionPanes . clear ( ) ; for ( HLayout criterionPane : buttonPanes ) { buttonStack . removeMember ( criterionPane ) ; } buttonPanes . clear ( ) ; for ( HandlerRegistration handlerRegistration : addHandlers ) { handlerRegistration . removeHandler ( ) ; } addHandlers . clear ( ) ; for ( HandlerRegistration handlerRegistration : removeHandlers ) { handlerRegistration . removeHandler ( ) ; } removeHandlers . clear ( ) ; addEmptyRow ( 0 ) ;
public class ThriftCodecByteCodeGenerator { /** * Declares a field for each delegate codec * @ return a map from field id to the codec for the field */ private Map < Short , FieldDefinition > declareCodecFields ( ) { } }
Map < Short , FieldDefinition > codecFields = new TreeMap < > ( ) ; for ( ThriftFieldMetadata fieldMetadata : metadata . getFields ( ) ) { if ( needsCodec ( fieldMetadata ) ) { ThriftCodec < ? > codec = codecManager . getCodec ( fieldMetadata . getThriftType ( ) ) ; String fieldName = fieldMetadata . getName ( ) + "Codec" ; FieldDefinition codecField = new FieldDefinition ( a ( PRIVATE , FINAL ) , fieldName , type ( codec . getClass ( ) ) ) ; classDefinition . addField ( codecField ) ; codecFields . put ( fieldMetadata . getId ( ) , codecField ) ; parameters . add ( codecField , codec ) ; } } return codecFields ;
public class ExcelReport { /** * The first method that gets called when generating the report . Generates data in way the Excel should appear . * Creates the Excel Report and writes it to a file . */ public void generateReport ( List < XmlSuite > xmlSuites , List < ISuite > suites , String sOpDirectory ) { } }
logger . entering ( new Object [ ] { xmlSuites , suites , sOpDirectory } ) ; if ( ListenerManager . isCurrentMethodSkipped ( this ) ) { logger . exiting ( ListenerManager . THREAD_EXCLUSION_MSG ) ; return ; } if ( logger . isLoggable ( Level . INFO ) ) { logger . log ( Level . INFO , "Generating ExcelReport" ) ; } TestCaseResult . setOutputDirectory ( sOpDirectory ) ; // Generate data to suit excel report . this . generateSummaryData ( suites ) ; this . generateTCBasedData ( allTestsResults ) ; // Create the Excel Report this . createExcelReport ( ) ; // Render the report Path p = Paths . get ( sOpDirectory , reportFileName ) ; try { Path opDirectory = Paths . get ( sOpDirectory ) ; if ( ! Files . exists ( opDirectory ) ) { Files . createDirectories ( Paths . get ( sOpDirectory ) ) ; } FileOutputStream fOut = new FileOutputStream ( p . toFile ( ) ) ; wb . write ( fOut ) ; fOut . flush ( ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , e . getMessage ( ) , e ) ; } if ( logger . isLoggable ( Level . INFO ) ) { logger . log ( Level . INFO , "Excel File Created @ " + p . toAbsolutePath ( ) . toString ( ) ) ; }
public class DecisionTableImpl { /** * Evaluates this decision table returning the result * @ param ctx * @ param params these are the required information items , not to confuse with the columns of the * decision table that are expressions derived from these parameters * @ return */ public FEELFnResult < Object > evaluate ( EvaluationContext ctx , Object [ ] params ) { } }
if ( decisionRules . isEmpty ( ) ) { return FEELFnResult . ofError ( new FEELEventBase ( Severity . WARN , "Decision table is empty" , null ) ) ; } Object [ ] actualInputs = resolveActualInputs ( ctx , feel ) ; Either < FEELEvent , Object > actualInputMatch = actualInputsMatchInputValues ( ctx , actualInputs ) ; if ( actualInputMatch . isLeft ( ) ) { return actualInputMatch . cata ( e -> FEELFnResult . ofError ( e ) , e -> FEELFnResult . ofError ( null ) ) ; } List < DTDecisionRule > matches = findMatches ( ctx , actualInputs ) ; if ( ! matches . isEmpty ( ) ) { List < Object > results = evaluateResults ( ctx , feel , actualInputs , matches ) ; Map < Integer , String > msgs = checkResults ( ctx , matches , results ) ; if ( msgs . isEmpty ( ) ) { Object result = hitPolicy . getDti ( ) . dti ( ctx , this , matches , results ) ; return FEELFnResult . ofResult ( result ) ; } else { List < Integer > offending = msgs . keySet ( ) . stream ( ) . collect ( Collectors . toList ( ) ) ; return FEELFnResult . ofError ( new HitPolicyViolationEvent ( Severity . ERROR , "Errors found evaluating decision table '" + getName ( ) + "': \n" + ( msgs . values ( ) . stream ( ) . collect ( Collectors . joining ( "\n" ) ) ) , name , offending ) ) ; } } else { // check if there is a default value set for the outputs if ( hasDefaultValues ) { Object result = defaultToOutput ( ctx , feel ) ; return FEELFnResult . ofResult ( result ) ; } else { if ( hitPolicy . getDefaultValue ( ) != null ) { return FEELFnResult . ofResult ( hitPolicy . getDefaultValue ( ) ) ; } return FEELFnResult . ofError ( new HitPolicyViolationEvent ( Severity . WARN , "No rule matched for decision table '" + name + "' and no default values were defined. Setting result to null." , name , Collections . EMPTY_LIST ) ) ; } }
public class PDTXMLConverter { /** * Get the passed object as { @ link XMLGregorianCalendar } with date and time . * @ param aBase * The source object . May be < code > null < / code > . * @ return < code > null < / code > if the parameter is < code > null < / code > . */ @ Nullable public static XMLGregorianCalendar getXMLCalendar ( @ Nullable final ZonedDateTime aBase ) { } }
if ( aBase == null ) return null ; return s_aDTFactory . newXMLGregorianCalendar ( GregorianCalendar . from ( aBase ) ) ;
public class MmtfUtils { /** * Convert a four - d matrix to a double array . Row - packed . * @ param transformationMatrix the input matrix4d object * @ return the double array ( 16 long ) . */ public static double [ ] convertToDoubleArray ( Matrix4d transformationMatrix ) { } }
// Initialise the output array double [ ] outArray = new double [ 16 ] ; // Iterate over the matrix for ( int i = 0 ; i < 4 ; i ++ ) { for ( int j = 0 ; j < 4 ; j ++ ) { // Now set this element outArray [ i * 4 + j ] = transformationMatrix . getElement ( i , j ) ; } } return outArray ;
public class MessageHeader { /** * return the location of the key */ public synchronized int getKey ( String k ) { } }
for ( int i = nkeys ; -- i >= 0 ; ) if ( ( keys [ i ] == k ) || ( k != null && k . equalsIgnoreCase ( keys [ i ] ) ) ) return i ; return - 1 ;
public class CmsJspResourceAccessBean { /** * Returns a map that lazily reads properties of the resource . < p > * Usage example on a JSP with the < code > & lt ; cms : resourceaccess & gt ; < / code > tag : < pre > * & lt ; cms : resourceload . . . & gt ; * & lt ; cms : resourceaccess var = " res " / & gt ; * " Title " property value of the resource : $ { res . readProperties [ ' Title ' ] } * & lt ; / cms : resourceload & gt ; < / pre > * @ return a map that lazily reads properties of the resource * @ see # getProperty ( ) for a short form of this method */ public Map < String , String > getReadProperties ( ) { } }
if ( m_properties == null ) { // create lazy map only on demand m_properties = CmsCollectionsGenericWrapper . createLazyMap ( new CmsJspValueTransformers . CmsPropertyLoaderTransformer ( m_cms , m_resource , false ) ) ; } return m_properties ;
public class ApiOvhMe { /** * Alter this object properties * REST : PUT / me / installationTemplate / { templateName } / partitionScheme / { schemeName } / hardwareRaid / { name } * @ param body [ required ] New object properties * @ param templateName [ required ] This template name * @ param schemeName [ required ] name of this partitioning scheme * @ param name [ required ] Hardware RAID name */ public void installationTemplate_templateName_partitionScheme_schemeName_hardwareRaid_name_PUT ( String templateName , String schemeName , String name , OvhHardwareRaid body ) throws IOException { } }
String qPath = "/me/installationTemplate/{templateName}/partitionScheme/{schemeName}/hardwareRaid/{name}" ; StringBuilder sb = path ( qPath , templateName , schemeName , name ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class ProteinPocketFinder { /** * Method writes the PSP points ( & ge ; minPSPocket ) to pmesh format . */ public void pspGridToPmesh ( String outPutFileName ) { } }
try { gridGenerator . writeGridInPmeshFormat ( outPutFileName , minPSPocket ) ; } catch ( IOException e ) { logger . debug ( e ) ; }
public class S3ConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( S3Configuration s3Configuration , ProtocolMarshaller protocolMarshaller ) { } }
if ( s3Configuration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( s3Configuration . getRoleARN ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( s3Configuration . getBucketARN ( ) , BUCKETARN_BINDING ) ; protocolMarshaller . marshall ( s3Configuration . getFileKey ( ) , FILEKEY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SslHandler { /** * Call when data read from net . Will perform inial hanshake or decrypt provided * Buffer . * Decrytpted data reurned by getAppBuffer ( ) , if any . * @ param buf buffer to decrypt * @ param nextFilter Next filter in chain * @ throws SSLException on errors */ public void messageReceived ( NextFilter nextFilter , ByteBuffer buf ) throws SSLException { } }
// append buf to inNetBuffer if ( inNetBuffer == null ) { inNetBuffer = IoBuffer . allocate ( buf . remaining ( ) ) . setAutoExpand ( true ) ; } inNetBuffer . put ( buf ) ; if ( ! handshakeComplete ) { handshake ( nextFilter ) ; } else { decrypt ( nextFilter ) ; } if ( isInboundDone ( ) ) { // Rewind the MINA buffer if not all data is processed and inbound is finished . int inNetBufferPosition = inNetBuffer == null ? 0 : inNetBuffer . position ( ) ; buf . position ( buf . position ( ) - inNetBufferPosition ) ; inNetBuffer = null ; }
public class Configuration { /** * Retrieve the list of the version directories for the project * @ param category The category * @ param projectName The project name * @ return The list of version directories or empty list if none are present */ private List < File > getUidFilesForProject ( String category , String projectName ) { } }
// Check that the category directory exists File categoryDirectory = new File ( uidDirectory , category ) ; if ( ! categoryDirectory . exists ( ) || ( categoryDirectory . exists ( ) && categoryDirectory . isFile ( ) ) ) { return new ArrayList < > ( ) ; } // Check that the project directory exists File projectDirectory = new File ( categoryDirectory , projectName ) ; if ( ! projectDirectory . exists ( ) || ( projectDirectory . exists ( ) && projectDirectory . isFile ( ) ) ) { return new ArrayList < > ( ) ; } // Get all the version directories List < File > versionDirectories = new ArrayList < > ( ) ; for ( File electableDirectory : projectDirectory . listFiles ( ) ) { if ( electableDirectory . isDirectory ( ) ) { versionDirectories . add ( electableDirectory ) ; } } return versionDirectories ;
public class CryptoServiceImpl { /** * { @ inheritDoc } */ @ Override public String encrypt ( String cryptoKey , String text ) throws TechnicalException { } }
Key aesKey = null ; if ( cryptoKey != null && ! "" . equals ( cryptoKey ) ) { aesKey = buildKey16char ( cryptoKey ) ; } if ( aesKey == null ) { logger . error ( TechnicalException . TECHNICAL_ERROR_MESSAGE_DECRYPT_CONFIGURATION_EXCEPTION ) ; throw new TechnicalException ( Messages . getMessage ( TechnicalException . TECHNICAL_ERROR_MESSAGE_DECRYPT_CONFIGURATION_EXCEPTION ) ) ; } try { Cipher cipher = Cipher . getInstance ( "AES" ) ; cipher . init ( Cipher . ENCRYPT_MODE , aesKey ) ; return getPrefix ( ) + Base64 . encodeBase64String ( cipher . doFinal ( text . getBytes ( ) ) ) ; } catch ( NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e ) { logger . error ( Messages . getMessage ( TechnicalException . TECHNICAL_ERROR_MESSAGE_ENCRYPT_EXCEPTION ) , e ) ; throw new TechnicalException ( Messages . getMessage ( TechnicalException . TECHNICAL_ERROR_MESSAGE_ENCRYPT_EXCEPTION ) , e ) ; }
public class QueryCriteriaUtil { /** * This method retrieves the entity " field " that can be used as the LHS of a { @ link Predicate } * This method is overridden in some extended { @ link QueryCriteriaUtil } implementations * @ param query The { @ link CriteriaQuery } that we ' re building * @ param listId The list id of the given { @ link QueryCriteria } * @ return An { @ link Expression } with the { @ link Path } to the field represented by the { @ link QueryCriteria # getListId ( ) } value */ protected < T > Expression getEntityField ( CriteriaQuery < T > query , String listId , Attribute attr ) { } }
return defaultGetEntityField ( query , listId , attr ) ;
public class WebSocketReportingEngine { /** * { @ inheritDoc } */ @ Override public void onAdd ( Response response ) { } }
notifyWebSocket ( "response" , response ) ; logger . info ( "Reporter observed response for user [" + response . getUser ( ) . getUsername ( ) + "]" ) ;
public class PipeNode { /** * private boolean pendingSend ( T value , Result < Void > result ) * if ( _ init = = StateInit . INIT ) { * return false ; * _ pendingInit . add ( ( ) - > send ( value , result ) ) ; * return true ; */ private void send ( T value ) { } }
for ( SubscriberNode sub : _subscribers ) { sub . next ( value ) ; } long seq = _sequence ++ ; int size = _consumers . size ( ) ; if ( size > 0 ) { int index = ( int ) ( seq % size ) ; _consumers . get ( index ) . next ( value ) ; }
public class PhaseOptimizer { /** * Add the passes generated by the given factories to the compile sequence . * Automatically pulls multi - run passes into fixed point loops . If there * are 1 or more multi - run passes in a row , they will run together in * the same fixed point loop . The passes will run until they are finished * making changes . * The PhaseOptimizer is free to tweak the order and frequency of multi - run * passes in a fixed - point loop . */ void consume ( List < PassFactory > factories ) { } }
Loop currentLoop = new Loop ( ) ; for ( PassFactory factory : factories ) { if ( factory . isOneTimePass ( ) ) { if ( currentLoop . isPopulated ( ) ) { passes . add ( currentLoop ) ; currentLoop = new Loop ( ) ; } addOneTimePass ( factory ) ; } else { currentLoop . addLoopedPass ( factory ) ; } } if ( currentLoop . isPopulated ( ) ) { passes . add ( currentLoop ) ; }
public class GrailsWebRequest { /** * Obtains the PropertyEditorRegistry instance . * @ return The PropertyEditorRegistry */ public PropertyEditorRegistry getPropertyEditorRegistry ( ) { } }
final HttpServletRequest servletRequest = getCurrentRequest ( ) ; PropertyEditorRegistry registry = ( PropertyEditorRegistry ) servletRequest . getAttribute ( GrailsApplicationAttributes . PROPERTY_REGISTRY ) ; if ( registry == null ) { registry = new PropertyEditorRegistrySupport ( ) ; PropertyEditorRegistryUtils . registerCustomEditors ( this , registry , RequestContextUtils . getLocale ( servletRequest ) ) ; servletRequest . setAttribute ( GrailsApplicationAttributes . PROPERTY_REGISTRY , registry ) ; } return registry ;
public class MalisisGui { /** * Sends a GUI action to the server . * @ param action the action * @ param slot the slot * @ param code the keyboard code */ public static void sendAction ( ActionType action , MalisisSlot slot , int code ) { } }
if ( action == null || current ( ) == null || current ( ) . inventoryContainer == null ) return ; int inventoryId = slot != null ? slot . getInventoryId ( ) : 0 ; int slotNumber = slot != null ? slot . getSlotIndex ( ) : 0 ; current ( ) . inventoryContainer . handleAction ( action , inventoryId , slotNumber , code ) ; InventoryActionMessage . sendAction ( action , inventoryId , slotNumber , code ) ;
public class RowMajorSparseMatrix { /** * Creates a block { @ link RowMajorSparseMatrix } of the given blocks { @ code a } , * { @ code b } , { @ code c } and { @ code d } . */ public static RowMajorSparseMatrix block ( Matrix a , Matrix b , Matrix c , Matrix d ) { } }
return CRSMatrix . block ( a , b , c , d ) ;
public class ClusteringTreeHeadNode { /** * Projects a point to a random projection . * @ param pointA * the point to project * @ param i * the projection * @ return the position of the point */ private double project ( double [ ] pointA , double [ ] i ) { } }
assert ( i . length == pointA . length ) ; return Metric . dotProduct ( pointA , i ) ;
public class Dao { /** * Executes the a query */ private QueryObservable executeQuery ( QueryBuilder queryBuilder ) { } }
// Raw query properties as default String sql = queryBuilder . rawStatement ; Iterable < String > affectedTables = queryBuilder . rawStatementAffectedTables ; // If SqlFinishedStatement is set then use that one if ( queryBuilder . statement != null ) { SqlCompileable . CompileableStatement compileableStatement = queryBuilder . statement . asCompileableStatement ( ) ; sql = compileableStatement . sql ; affectedTables = compileableStatement . tables ; } // Check for auto update if ( ! queryBuilder . autoUpdate || affectedTables == null ) { affectedTables = Collections . emptySet ( ) ; } return db . createQuery ( affectedTables , sql , queryBuilder . args ) ;
public class TargetAttribute { /** * Gets the flags associated with this attribute . * @ return the flags . Will not return { @ code null } */ public Set < AttributeAccess . Flag > getFlags ( ) { } }
if ( attributeAccess == null ) { return Collections . emptySet ( ) ; } return attributeAccess . getFlags ( ) ;
public class PlatformEntitlementCheck { /** * Starts asynchronous check . Result will be delivered to the listener on the main thread . * @ param context * @ param appId application id from the oculus dashboard * @ param listener listener to invoke when the result is available * @ throws IllegalStateException in case the platform sdk cannot be initialized * @ throws IllegalArgumentException if listener is null */ public static void start ( final GVRContext context , final String appId , final ResultListener listener ) { } }
if ( null == listener ) { throw new IllegalArgumentException ( "listener cannot be null" ) ; } final Activity activity = context . getActivity ( ) ; final long result = create ( activity , appId ) ; if ( 0 != result ) { throw new IllegalStateException ( "Could not initialize the platform sdk; error code: " + result ) ; } context . registerDrawFrameListener ( new GVRDrawFrameListener ( ) { @ Override public void onDrawFrame ( float frameTime ) { final int result = processEntitlementCheckResponse ( ) ; if ( 0 != result ) { context . unregisterDrawFrameListener ( this ) ; final Runnable runnable ; if ( - 1 == result ) { runnable = new Runnable ( ) { @ Override public void run ( ) { listener . onFailure ( ) ; } } ; } else { runnable = new Runnable ( ) { @ Override public void run ( ) { listener . onSuccess ( ) ; } } ; } activity . runOnUiThread ( runnable ) ; } } } ) ;
public class NativeLoader { /** * Load the shared libraries . */ static void loadLibrary ( ) { } }
try { File dir = Files . createTempDirectory ( "libjsass-" ) . toFile ( ) ; dir . deleteOnExit ( ) ; if ( System . getProperty ( "os.name" ) . toLowerCase ( ) . startsWith ( "win" ) ) { System . load ( saveLibrary ( dir , "sass" ) ) ; } System . load ( saveLibrary ( dir , "jsass" ) ) ; } catch ( Exception exception ) { LOG . warn ( exception . getMessage ( ) , exception ) ; throw new LoaderException ( exception ) ; }
public class RollingLog { /** * Given the log file , finds out the smallest allowed zxid for thi file . It ' s * infered by looking at the name of the file . * @ return the smallest allowed zxid in this log file . */ Zxid getZxidFromFileName ( File file ) { } }
String fileName = file . getName ( ) ; String strZxid = fileName . substring ( fileName . indexOf ( '.' ) + 1 ) ; return Zxid . fromSimpleString ( strZxid ) ;
public class WSConnectionRequestInfoImpl { /** * Determine if two objects , either of which may be null , are equal . * @ param obj1 * one object . * @ param obj2 * another object . * @ return true if the objects are equal or are both null , otherwise false . */ private static final boolean match ( Object obj1 , Object obj2 ) { } }
return obj1 == obj2 || ( obj1 != null && obj1 . equals ( obj2 ) ) ;
public class KeyUtils { /** * Checks if the elements of the given key up the given length are 0 , or the whole array is null . * @ param key * @ param length * @ return true , if the key is null or all elements in the array are 0. */ public static boolean isNull ( byte [ ] key , int length ) { } }
if ( key == null ) { return true ; } for ( int i = 0 ; i < Math . min ( key . length , length ) ; i ++ ) { if ( key [ i ] != 0 ) { return false ; } } return true ;
public class AmazonElasticLoadBalancingClient { /** * Creates a listener for the specified Application Load Balancer or Network Load Balancer . * To update a listener , use < a > ModifyListener < / a > . When you are finished with a listener , you can delete it using * < a > DeleteListener < / a > . If you are finished with both the listener and the load balancer , you can delete them both * using < a > DeleteLoadBalancer < / a > . * This operation is idempotent , which means that it completes at most one time . If you attempt to create multiple * listeners with the same settings , each call succeeds . * For more information , see < a * href = " https : / / docs . aws . amazon . com / elasticloadbalancing / latest / application / load - balancer - listeners . html " > Listeners * for Your Application Load Balancers < / a > in the < i > Application Load Balancers Guide < / i > and < a * href = " https : / / docs . aws . amazon . com / elasticloadbalancing / latest / network / load - balancer - listeners . html " > Listeners for * Your Network Load Balancers < / a > in the < i > Network Load Balancers Guide < / i > . * @ param createListenerRequest * @ return Result of the CreateListener operation returned by the service . * @ throws DuplicateListenerException * A listener with the specified port already exists . * @ throws TooManyListenersException * You ' ve reached the limit on the number of listeners per load balancer . * @ throws TooManyCertificatesException * You ' ve reached the limit on the number of certificates per load balancer . * @ throws LoadBalancerNotFoundException * The specified load balancer does not exist . * @ throws TargetGroupNotFoundException * The specified target group does not exist . * @ throws TargetGroupAssociationLimitException * You ' ve reached the limit on the number of load balancers per target group . * @ throws InvalidConfigurationRequestException * The requested configuration is not valid . * @ throws IncompatibleProtocolsException * The specified configuration is not valid with this protocol . * @ throws SSLPolicyNotFoundException * The specified SSL policy does not exist . * @ throws CertificateNotFoundException * The specified certificate does not exist . * @ throws UnsupportedProtocolException * The specified protocol is not supported . * @ throws TooManyRegistrationsForTargetIdException * You ' ve reached the limit on the number of times a target can be registered with a load balancer . * @ throws TooManyTargetsException * You ' ve reached the limit on the number of targets . * @ throws TooManyActionsException * You ' ve reached the limit on the number of actions per rule . * @ throws InvalidLoadBalancerActionException * The requested action is not valid . * @ sample AmazonElasticLoadBalancing . CreateListener * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / elasticloadbalancingv2-2015-12-01 / CreateListener " * target = " _ top " > AWS API Documentation < / a > */ @ Override public CreateListenerResult createListener ( CreateListenerRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCreateListener ( request ) ;
public class RedisJobStore { /** * Get the names of all of the < code > { @ link org . quartz . Trigger } < / code > s * that have the given group name . * If there are no triggers in the given group name , the result should be a * zero - length array ( not < code > null < / code > ) . * @ param matcher the matcher with which to compare trigger groups */ @ Override public Set < TriggerKey > getTriggerKeys ( final GroupMatcher < TriggerKey > matcher ) throws JobPersistenceException { } }
return doWithLock ( new LockCallback < Set < TriggerKey > > ( ) { @ Override public Set < TriggerKey > doWithLock ( JedisCommands jedis ) throws JobPersistenceException { return storage . getTriggerKeys ( matcher , jedis ) ; } } , "Could not retrieve TriggerKeys." ) ;
public class CmsXmlContentDefinition { /** * Factory method to unmarshal ( read ) a XML content definition instance from a given XML schema location . < p > * The XML content definition data to unmarshal will be read from the provided schema location using * an XML InputSource . < p > * @ param schemaLocation the location from which to read the XML schema ( system id ) * @ param resolver the XML entity resolver to use * @ return a XML content definition instance unmarshalled from the InputSource * @ throws CmsXmlException if something goes wrong * @ throws SAXException if the XML schema location could not be converted to an XML InputSource * @ throws IOException if the XML schema location could not be converted to an XML InputSource */ public static CmsXmlContentDefinition unmarshal ( String schemaLocation , EntityResolver resolver ) throws CmsXmlException , SAXException , IOException { } }
schemaLocation = translateSchema ( schemaLocation ) ; CmsXmlContentDefinition result = getCachedContentDefinition ( schemaLocation , resolver ) ; if ( result == null ) { // content definition was not found in the cache , unmarshal the XML document InputSource source = resolver . resolveEntity ( null , schemaLocation ) ; result = unmarshalInternal ( CmsXmlUtils . unmarshalHelper ( source , resolver ) , schemaLocation , resolver ) ; } return result ;
public class GeometryEngine { /** * Imports geometry from the ESRI shape file format . * See OperatorImportFromESRIShape . * @ param esriShapeBuffer * The buffer containing geometry in the ESRI shape file format . * @ param geometryType * The required type of the Geometry to be imported . Use * Geometry . Type . Unknown if the geometry type needs to be * determined from the buffer content . * @ return The geometry or null if the buffer contains null shape . * @ throws GeometryException * when the geometryType is not Geometry . Type . Unknown and the * buffer contains geometry that cannot be converted to the * given geometryType . or the buffer is corrupt . Another * exception possible is IllegalArgumentsException . */ public static Geometry geometryFromEsriShape ( byte [ ] esriShapeBuffer , Geometry . Type geometryType ) { } }
OperatorImportFromESRIShape op = ( OperatorImportFromESRIShape ) factory . getOperator ( Operator . Type . ImportFromESRIShape ) ; return op . execute ( ShapeImportFlags . ShapeImportNonTrusted , geometryType , ByteBuffer . wrap ( esriShapeBuffer ) . order ( ByteOrder . LITTLE_ENDIAN ) ) ;
public class MessageRunner { /** * This method is called from the provided executor . */ @ Override public void onFailure ( Throwable t ) { } }
if ( cancelled ) { return ; } t = adjustThrowable ( t ) ; if ( handleInternalException ( t ) ) { next ( ) ; } else { cancel ( ) ; }
public class CouchbaseUtils { /** * Converts a { @ link JsonObject } list into a { @ link CouchbaseQueryResult } so that it can * be { @ link Stream } - ed and returned by the procedures * @ param jsonObjects * the { @ link JsonObject } list to convert * @ return the converted list in the form of a CouchbaseQueryResult */ public static CouchbaseQueryResult convertToCouchbaseQueryResult ( List < JsonObject > jsonObjects ) { } }
CouchbaseQueryResult result = null ; if ( jsonObjects != null && jsonObjects . size ( ) > 0 ) { List < Map < String , Object > > list = new ArrayList < Map < String , Object > > ( jsonObjects . size ( ) ) ; for ( JsonObject jsonObject : jsonObjects ) { list . add ( jsonObject . toMap ( ) ) ; } result = new CouchbaseQueryResult ( list ) ; } return result ;
public class Cluster { /** * add the ClusterMarker to the Layers if is within Viewport , otherwise remove . */ public void redraw ( ) { } }
Layers mapOverlays = clusterManager . getMapView ( ) . getLayerManager ( ) . getLayers ( ) ; if ( clusterMarker != null && ! clusterManager . getCurBounds ( ) . contains ( center ) && mapOverlays . contains ( clusterMarker ) ) { mapOverlays . remove ( clusterMarker ) ; return ; } if ( clusterMarker != null && mapOverlays . size ( ) > 0 && ! mapOverlays . contains ( clusterMarker ) && ! clusterManager . isClustering ) { mapOverlays . add ( 1 , clusterMarker ) ; }
public class BasicBinder { /** * Registers a set of configurations for the given list of URLs . * This is typically used to process all the various bindings . xml files discovered in * jars on the classpath . It is given protected scope to allow subclasses to register * additional configurations * @ param bindingsConfiguration An enumeration of the URLs to process * @ param < X > Internally used type argument */ protected < X > void registerConfigurations ( Enumeration < URL > bindingsConfiguration ) { } }
List < BindingConfiguration > configs = new ArrayList < BindingConfiguration > ( ) ; for ( URL nextLocation : IterableEnumeration . wrapEnumeration ( bindingsConfiguration ) ) { // Filter built in bindings - these are already registered by calling registerConfiguration directly URL builtIn = getBuiltInBindingsURL ( ) ; if ( ! builtIn . toString ( ) . equals ( nextLocation . toString ( ) ) ) { configs . add ( BindingXmlLoader . load ( nextLocation ) ) ; } } for ( BindingConfiguration nextConfig : configs ) { for ( Provider nextProvider : nextConfig . getProviders ( ) ) { try { registerConverterProvider ( nextProvider . getProviderClass ( ) . newInstance ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding provider class: " + nextProvider . getProviderClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding provider class: " + nextProvider . getProviderClass ( ) . getName ( ) ) ; } } for ( Extension < ? > nextExtension : nextConfig . getExtensions ( ) ) { try { @ SuppressWarnings ( "unchecked" ) Extension < X > myExtension = ( Extension < X > ) nextExtension ; @ SuppressWarnings ( "unchecked" ) X myImplementation = ( X ) nextExtension . getImplementationClass ( ) . newInstance ( ) ; registerExtendedBinder ( myExtension . getExtensionClass ( ) , myImplementation ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binder extension class: " + nextExtension . getExtensionClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binder extension class: " + nextExtension . getExtensionClass ( ) . getName ( ) ) ; } } registerBindingConfigurationEntries ( nextConfig . getBindingEntries ( ) ) ; }
public class PlayerStatsService { /** * Retrieve player stats * @ param accountId The player ' s id * @ param season The target season * @ return Player stats */ public PlayerLifetimeStats retrievePlayerStatsByAccountId ( long accountId , Season season ) { } }
return client . sendRpcAndWait ( SERVICE , "retrievePlayerStatsByAccountId" , accountId , season ) ;
public class Horizon { /** * Sets the custom color that will be used for visualization of the ground * @ param CUSTOM _ GROUND _ COLOR */ public void setCustomGroundColor ( final Color CUSTOM_GROUND_COLOR ) { } }
customGroundColor = CUSTOM_GROUND_COLOR ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ;
public class ProcessorConfigurationUtils { /** * Wraps an implementation of { @ link ITemplateBoundariesProcessor } into an object that adds some information * required internally ( like e . g . the dialect this processor was registered for ) . * This method is meant for < strong > internal < / strong > use only . * @ param processor the processor to be wrapped . * @ param dialect the dialect this processor was configured for . * @ return the wrapped processor . */ public static ITemplateBoundariesProcessor wrap ( final ITemplateBoundariesProcessor processor , final IProcessorDialect dialect ) { } }
Validate . notNull ( dialect , "Dialect cannot be null" ) ; if ( processor == null ) { return null ; } return new TemplateBoundariesProcessorWrapper ( processor , dialect ) ;
public class MulticastTransport { /** * Actually send the probe out on the wire . * @ param probe the Probe instance that has been pre - configured * @ throws TransportException if something bad happened when sending the * probe */ @ Override public void sendProbe ( Probe probe ) throws TransportException { } }
LOGGER . info ( "Sending probe [" + probe . getProbeID ( ) + "] on network inteface [" + networkInterface . getName ( ) + "] at port [" + multicastAddress + ":" + multicastPort + "]" ) ; LOGGER . debug ( "Probe requesting TTL of [" + probe . getHopLimit ( ) + "]" ) ; try { String msg = probe . asXML ( ) ; LOGGER . debug ( "Probe payload (always XML): \n" + msg ) ; byte [ ] msgBytes ; msgBytes = msg . getBytes ( StandardCharsets . UTF_8 ) ; // send discovery string InetAddress group = InetAddress . getByName ( multicastAddress ) ; DatagramPacket packet = new DatagramPacket ( msgBytes , msgBytes . length , group , multicastPort ) ; outboundSocket . setTimeToLive ( probe . getHopLimit ( ) ) ; outboundSocket . send ( packet ) ; LOGGER . debug ( "Probe sent on port [" + multicastAddress + ":" + multicastPort + "]" ) ; } catch ( IOException e ) { throw new TransportException ( "Unable to send probe. Issue sending UDP packets." , e ) ; } catch ( JAXBException e ) { throw new TransportException ( "Unable to send probe because it could not be serialized to XML" , e ) ; }
public class AppsImpl { /** * Gets all the available custom prebuilt domains for a specific culture . * @ param culture Culture . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < PrebuiltDomain > > listAvailableCustomPrebuiltDomainsForCultureAsync ( String culture , final ServiceCallback < List < PrebuiltDomain > > serviceCallback ) { } }
return ServiceFuture . fromResponse ( listAvailableCustomPrebuiltDomainsForCultureWithServiceResponseAsync ( culture ) , serviceCallback ) ;
public class TransientPropertyData { /** * Factory method . * @ param parent NodeData * @ param name InternalQName * @ param type int * @ param multiValued boolean * @ return TransientPropertyData */ public static TransientPropertyData createPropertyData ( NodeData parent , InternalQName name , int type , boolean multiValued ) { } }
QPath path = QPath . makeChildPath ( parent . getQPath ( ) , name ) ; TransientPropertyData propData = new TransientPropertyData ( path , IdGenerator . generate ( ) , - 1 , type , parent . getIdentifier ( ) , multiValued ) ; return propData ;
public class TraceComponent { /** * Update the active trace settings for this component based on the provided string . * Protected : Not an SPI method . * @ param ts TraceSpecification */ @ Deprecated protected void setTraceSpec ( String s ) { } }
if ( s != null ) { TraceSpecification ts = new TraceSpecification ( s , null , false ) ; setTraceSpec ( ts ) ; }
public class CommerceAddressPersistenceImpl { /** * Returns all the commerce addresses where groupId = & # 63 ; and classNameId = & # 63 ; and classPK = & # 63 ; and defaultBilling = & # 63 ; . * @ param groupId the group ID * @ param classNameId the class name ID * @ param classPK the class pk * @ param defaultBilling the default billing * @ return the matching commerce addresses */ @ Override public List < CommerceAddress > findByG_C_C_DB ( long groupId , long classNameId , long classPK , boolean defaultBilling ) { } }
return findByG_C_C_DB ( groupId , classNameId , classPK , defaultBilling , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class CmsDriverManager { /** * Reads all property definitions for the given mapping type . < p > * @ param dbc the current database context * @ return a list with the < code > { @ link CmsPropertyDefinition } < / code > objects ( may be empty ) * @ throws CmsException if something goes wrong */ public List < CmsPropertyDefinition > readAllPropertyDefinitions ( CmsDbContext dbc ) throws CmsException { } }
List < CmsPropertyDefinition > result = getVfsDriver ( dbc ) . readPropertyDefinitions ( dbc , dbc . currentProject ( ) . getUuid ( ) ) ; Collections . sort ( result ) ; return result ;
public class CommonCodeReview { /** * Calculates if the PR was looked at by a peer * @ param pr * @ return true if PR was looked at by at least one peer */ private static boolean isPRLookedAtByPeer ( GitRequest pr ) { } }
Set < String > commentUsers = pr . getComments ( ) != null ? pr . getComments ( ) . stream ( ) . map ( Comment :: getUser ) . collect ( Collectors . toCollection ( HashSet :: new ) ) : new HashSet < > ( ) ; Set < String > reviewAuthors = pr . getReviews ( ) != null ? pr . getReviews ( ) . stream ( ) . map ( Review :: getAuthor ) . collect ( Collectors . toCollection ( HashSet :: new ) ) : new HashSet < > ( ) ; reviewAuthors . remove ( "unknown" ) ; Set < String > prCommitAuthors = pr . getCommits ( ) != null ? pr . getCommits ( ) . stream ( ) . map ( Commit :: getScmAuthorLogin ) . collect ( Collectors . toCollection ( HashSet :: new ) ) : new HashSet < > ( ) ; prCommitAuthors . add ( pr . getUserId ( ) ) ; prCommitAuthors . remove ( "unknown" ) ; commentUsers . removeAll ( prCommitAuthors ) ; reviewAuthors . removeAll ( prCommitAuthors ) ; return ( commentUsers . size ( ) > 0 ) || ( reviewAuthors . size ( ) > 0 ) ;
public class JMCollections { /** * Split into sub list list . * @ param < E > the type parameter * @ param list the list * @ param targetSize the target size * @ return the list */ public static < E > List < List < E > > splitIntoSubList ( List < E > list , int targetSize ) { } }
int listSize = list . size ( ) ; return JMStream . numberRange ( 0 , listSize , targetSize ) . mapToObj ( index -> list . subList ( index , Math . min ( index + targetSize , listSize ) ) ) . collect ( toList ( ) ) ;
public class ResourceUtil { /** * This method reads all data from an { @ code InputStream } into a String object . This method will close the stream . * @ param inputStream { @ code InputStream } to read text from * @ return < code > String < / code > containing all input stream data * @ throws IOException IO exception */ public static String readFromInputStreamIntoString ( InputStream inputStream ) throws IOException { } }
BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream , "UTF-8" ) ) ; StringBuilder text = new StringBuilder ( ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { text . append ( line ) . append ( "\n" ) ; } inputStream . close ( ) ; return text . toString ( ) ;
public class CmsSecurityManager { /** * Reads all property definitions for the given mapping type . < p > * @ param context the current request context * @ return a list with the < code > { @ link CmsPropertyDefinition } < / code > objects ( may be empty ) * @ throws CmsException if something goes wrong */ public List < CmsPropertyDefinition > readAllPropertyDefinitions ( CmsRequestContext context ) throws CmsException { } }
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; List < CmsPropertyDefinition > result = null ; try { result = m_driverManager . readAllPropertyDefinitions ( dbc ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_ALL_PROPDEF_0 ) , e ) ; } finally { dbc . clear ( ) ; } return result ;
public class Stripe { /** * Blocking method to create a { @ link Token } for CVC updating . Do not call this on the UI thread * or your app will crash . The method uses the currently set { @ link # mDefaultPublishableKey } . * @ param cvc the CVC to use for this token * @ return a { @ link Token } that can be used for this card * @ throws AuthenticationException failure to properly authenticate yourself ( check your key ) * @ throws InvalidRequestException your request has invalid parameters * @ throws APIConnectionException failure to connect to Stripe ' s API * @ throws APIException any other type of problem ( for instance , a temporary issue with * Stripe ' s servers ) */ @ Nullable public Token createCvcUpdateTokenSynchronous ( @ NonNull String cvc ) throws AuthenticationException , InvalidRequestException , APIConnectionException , CardException , APIException { } }
return createCvcUpdateTokenSynchronous ( cvc , mDefaultPublishableKey ) ;
public class OparamTag { /** * Ensure that the tag implemented by this class is enclosed by an { @ code IncludeTag } . * If the tag is not enclosed by an { @ code IncludeTag } then a { @ code JspException } is thrown . * @ return If this tag is enclosed within an { @ code IncludeTag } , then the default return value * from this method is the { @ code TagSupport . EVAL _ BODY _ TAG } value . * @ throws JspException */ public int doStartTag ( ) throws JspException { } }
// checkEnclosedInIncludeTag ( ) ; / / Moved to TagLibValidator // Get request HttpServletRequest request = ( HttpServletRequest ) pageContext . getRequest ( ) ; // Get filename subpage = createFileNameFromRequest ( request ) ; // Get include tag , and add to parameters IncludeTag includeTag = ( IncludeTag ) getParent ( ) ; includeTag . addParameter ( parameterName , new Oparam ( subpage . getName ( ) ) ) ; // if ! subpage . exist | | jsp newer than subpage , write new File jsp = new File ( pageContext . getServletContext ( ) . getRealPath ( request . getServletPath ( ) ) ) ; if ( ! subpage . exists ( ) || jsp . lastModified ( ) > subpage . lastModified ( ) ) { return EVAL_BODY_BUFFERED ; } // No need to evaluate body again ! return SKIP_BODY ;
public class FsCrawlerUtil { /** * Copy a single resource file from the classpath or from a JAR . * @ param target The target * @ throws IOException If copying does not work */ public static void copyResourceFile ( String source , Path target ) throws IOException { } }
InputStream resource = FsCrawlerUtil . class . getResourceAsStream ( source ) ; FileUtils . copyInputStreamToFile ( resource , target . toFile ( ) ) ;
public class ClassFileImporter { /** * Imports all class files at the given { @ link Location locations } . The behavior will depend on the type of { @ link Location } , * i . e . the target of the underlying URI : * < ul > * < li > a single class file = & lt ; that file will be imported < / li > * < li > a directory = & lt ; all class files from that directory as well as sub directories will be imported < / li > * < li > a JAR file = & lt ; all class files from that archive will be imported < / li > * < li > a JAR URI representing a class ( e . g . ' < code > jar : file : / / / some . jar ! / some / MyClass . class < / code > ' ) = & lt ; that file will be imported < / li > * < li > a JAR URI representing a folder ( e . g . ' < code > jar : file : / / / some . jar ! / some / pkg < / code > ' ) = & lt ; all class files from that folder as well as * sub folders within the JAR archive will be imported < / li > * < / ul > * For information about the impact of the imported classes on the evaluation of rules , * as well as configuration and details , refer to { @ link ClassFileImporter } . */ @ PublicAPI ( usage = ACCESS ) public JavaClasses importLocations ( Collection < Location > locations ) { } }
List < ClassFileSource > sources = new ArrayList < > ( ) ; for ( Location location : locations ) { tryAdd ( sources , location ) ; } return new ClassFileProcessor ( ) . process ( unify ( sources ) ) ;