signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Input { /** * Check if the controller has the left direction pressed * @ param controller The index of the controller to check * @ return True if the controller is pressed to the left */ public boolean isControllerLeft ( int controller ) { } }
if ( controller >= getControllerCount ( ) ) { return false ; } if ( controller == ANY_CONTROLLER ) { for ( int i = 0 ; i < controllers . size ( ) ; i ++ ) { if ( isControllerLeft ( i ) ) { return true ; } } return false ; } return ( ( Controller ) controllers . get ( controller ) ) . getXAxisValue ( ) < - 0.5f || ( ( Controller ) controllers . get ( controller ) ) . getPovX ( ) < - 0.5f ;
public class PrettyTime { /** * Get the unmodifiable { @ link List } of the current configured { @ link TimeUnit } instances in calculations . */ public List < TimeUnit > getUnits ( ) { } }
if ( cachedUnits == null ) { List < TimeUnit > result = new ArrayList < TimeUnit > ( units . keySet ( ) ) ; Collections . sort ( result , new TimeUnitComparator ( ) ) ; cachedUnits = Collections . unmodifiableList ( result ) ; } return cachedUnits ;
public class ExpressionUtil { /** * Find any listed expressions that qualify as potential partitioning where filters , * which is to say are equality comparisons with a TupleValueExpression on at least one side , * and a TupleValueExpression , ConstantValueExpression , or ParameterValueExpression on the other . * Add them to a map keyed by the TupleValueExpression ( s ) involved . * @ param filterList a list of candidate expressions * @ param the running result * @ return a Collection containing the qualifying filter expressions . */ public static void collectPartitioningFilters ( Collection < AbstractExpression > filterList , HashMap < AbstractExpression , Set < AbstractExpression > > equivalenceSet ) { } }
for ( AbstractExpression expr : filterList ) { if ( ! expr . isColumnEquivalenceFilter ( ) ) { continue ; } AbstractExpression leftExpr = expr . getLeft ( ) ; AbstractExpression rightExpr = expr . getRight ( ) ; // Any two asserted - equal expressions need to map to the same equivalence set , // which must contain them and must be the only such set that contains them . Set < AbstractExpression > eqSet1 = null ; if ( equivalenceSet . containsKey ( leftExpr ) ) { eqSet1 = equivalenceSet . get ( leftExpr ) ; } if ( equivalenceSet . containsKey ( rightExpr ) ) { Set < AbstractExpression > eqSet2 = equivalenceSet . get ( rightExpr ) ; if ( eqSet1 == null ) { // Add new leftExpr into existing rightExpr ' s eqSet . equivalenceSet . put ( leftExpr , eqSet2 ) ; eqSet2 . add ( leftExpr ) ; } else { // Merge eqSets , re - mapping all the rightExpr ' s equivalents into leftExpr ' s eqset . for ( AbstractExpression eqMember : eqSet2 ) { eqSet1 . add ( eqMember ) ; equivalenceSet . put ( eqMember , eqSet1 ) ; } } } else { if ( eqSet1 == null ) { // Both leftExpr and rightExpr are new - - add leftExpr to the new eqSet first . eqSet1 = new HashSet < AbstractExpression > ( ) ; equivalenceSet . put ( leftExpr , eqSet1 ) ; eqSet1 . add ( leftExpr ) ; } // Add new rightExpr into leftExpr ' s eqSet . equivalenceSet . put ( rightExpr , eqSet1 ) ; eqSet1 . add ( rightExpr ) ; } }
public class MockArtifactStore { /** * { @ inheritDoc } */ public synchronized void set ( Artifact artifact , InputStream content ) throws IOException { } }
try { set ( artifact , new BytesContent ( IOUtils . toByteArray ( content ) ) ) ; } finally { IOUtils . closeQuietly ( content ) ; }
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcPhysicalOrVirtualEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class UniformDistributionTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case BpsimPackage . UNIFORM_DISTRIBUTION_TYPE__MAX : setMax ( ( Double ) newValue ) ; return ; case BpsimPackage . UNIFORM_DISTRIBUTION_TYPE__MIN : setMin ( ( Double ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class ExecutionTimesReport { /** * Remember execution time for all executed suites . */ @ Subscribe public void onSuiteResult ( AggregatedSuiteResultEvent e ) { } }
long millis = e . getExecutionTime ( ) ; String suiteName = e . getDescription ( ) . getDisplayName ( ) ; List < Long > values = hints . get ( suiteName ) ; if ( values == null ) { hints . put ( suiteName , values = new ArrayList < > ( ) ) ; } values . add ( millis ) ; while ( values . size ( ) > historyLength ) values . remove ( 0 ) ;
public class PermitMonitor { /** * 查询是否允许授权处理 , 非阻塞 , 指定是否强制刷新 */ public boolean isPermit ( boolean reload ) { } }
if ( reload ) { // 判断是否需要重新reload reload ( ) ; } boolean result = channelStatus . isStart ( ) && mainStemStatus . isOverTake ( ) ; if ( existOpposite ) { // 判断是否存在反向同步 result &= oppositeMainStemStatus . isOverTake ( ) ; } return result ;
public class ThrottledApiHandler { /** * All champions in the game . * This method does not count towards the rate limit and is not affected by the throttle * @ param champData Additional information to retrieve * @ return All champions in the game */ public Future < Collection < Champion > > getChampions ( ChampData champData ) { } }
return new DummyFuture < > ( handler . getChampions ( champData ) ) ;
public class FileWatcher { /** * Start watching file path and notify watcher for updates on that file . * The watcher will be kept in a weak reference and will allow GC to delete * the instance . * @ param file The file path to watch . * @ param watcher The watcher to be notified . */ public void weakAddWatcher ( Path file , Listener watcher ) { } }
synchronized ( mutex ) { startWatchingInternal ( file ) . add ( new WeakReference < > ( watcher ) :: get ) ; }
public class MinimalWordCount { /** * 输出有向无环图的结构 * @ param dag */ private void dumpDAG ( Node [ ] [ ] dag ) { } }
if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "有向无环图:" ) ; for ( int i = 0 ; i < dag . length - 1 ; i ++ ) { Node [ ] nodes = dag [ i ] ; StringBuilder line = new StringBuilder ( ) ; for ( Node node : nodes ) { int following = node . getFollowing ( ) ; StringBuilder followingNodeTexts = new StringBuilder ( ) ; for ( int k = 0 ; k < dag [ following ] . length ; k ++ ) { String followingNodeText = dag [ following ] [ k ] . getText ( ) ; followingNodeTexts . append ( "(" ) . append ( followingNodeText ) . append ( ")" ) ; } line . append ( "【" ) . append ( node . getText ( ) ) . append ( "->" ) . append ( followingNodeTexts . toString ( ) ) . append ( "】\t" ) ; } LOGGER . debug ( line . toString ( ) ) ; } }
public class BluetoothEndpoint { /** * Helpers */ protected BluetoothDevicesProvider resolveBluetoothDeviceProvider ( ) { } }
if ( bluetoothDevicesProvider == null ) { Set < BluetoothDevicesProvider > providers = getCamelContext ( ) . getRegistry ( ) . findByType ( BluetoothDevicesProvider . class ) ; if ( providers . size ( ) == 1 ) { BluetoothDevicesProvider provider = providers . iterator ( ) . next ( ) ; LOG . info ( "Found single instance of the BluetoothDevicesProvider in the registry. {} will be used." , provider ) ; return provider ; } else if ( getComponent ( ) . getBluetoothDevicesProvider ( ) != null ) { return getComponent ( ) . getBluetoothDevicesProvider ( ) ; } else { return new BluecoveBluetoothDeviceProvider ( ) ; } } else { return bluetoothDevicesProvider ; }
public class Status { /** * Create a derived instance of { @ link Status } augmenting the current description with * additional detail . Leading and trailing whitespace may be removed ; this may change in the * future . */ public Status augmentDescription ( String additionalDetail ) { } }
if ( additionalDetail == null ) { return this ; } else if ( this . description == null ) { return new Status ( this . code , additionalDetail , this . cause ) ; } else { return new Status ( this . code , this . description + "\n" + additionalDetail , this . cause ) ; }
public class DateTimePeriod { /** * Converts this period to a list of five minute periods . Partial five minute periods will not be * included . For example , a period of " January 20 , 2009 7 to 8 AM " will return a list * of 12 five minute periods - one for each 5 minute block of time 0 , 5 , 10 , 15 , etc . * On the other hand , a period of " January 20 , 2009 at 13:04 " would return an empty list since partial * five minute periods are not included . * @ return A list of five minute periods contained within this period */ public List < DateTimePeriod > toFiveMinutes ( ) { } }
ArrayList < DateTimePeriod > list = new ArrayList < DateTimePeriod > ( ) ; // default " current " five minutes to start datetime DateTime currentStart = getStart ( ) ; // calculate " next " five minutes DateTime nextStart = currentStart . plusMinutes ( 5 ) ; // continue adding until we ' ve reached the end while ( nextStart . isBefore ( getEnd ( ) ) || nextStart . isEqual ( getEnd ( ) ) ) { // its okay to add the current list . add ( new DateTimeFiveMinutes ( currentStart , nextStart ) ) ; // increment both currentStart = nextStart ; nextStart = currentStart . plusMinutes ( 5 ) ; } return list ;
public class DirectoryLoaderAdaptor { /** * Load implementation for FileCacheKey : must return the metadata of the * requested file . */ private FileMetadata loadIntern ( final FileCacheKey key ) throws IOException { } }
final String fileName = key . getFileName ( ) ; final long fileLength = directory . fileLength ( fileName ) ; // We ' re forcing the buffer size of a to - be - read segment to the full file size : final int bufferSize = ( int ) Math . min ( fileLength , ( long ) autoChunkSize ) ; final FileMetadata meta = new FileMetadata ( bufferSize ) ; meta . setSize ( fileLength ) ; return meta ;
public class TopicPool { /** * Rolls back any new topics that were created . Since existing topics are stored * in revision data when edited we can ' t roll back that data properly . */ public void rollbackPool ( ) { } }
if ( newTopicPool == null || newTopicPool . isEmpty ( ) ) return ; final List < Integer > topicIds = new ArrayList < Integer > ( ) ; for ( final TopicWrapper topic : newTopicPool . getItems ( ) ) { topicIds . add ( topic . getTopicId ( ) ) ; } try { topicProvider . deleteTopics ( topicIds ) ; initialised = false ; } catch ( Exception e ) { log . error ( "An error occurred while trying to rollback the Topic Pool" , e ) ; }
public class AtomixFuture { /** * Returns a new completed Atomix future . * @ param result the future result * @ param < T > the future result type * @ return the completed future */ public static < T > CompletableFuture < T > completedFuture ( T result ) { } }
CompletableFuture < T > future = new AtomixFuture < > ( ) ; future . complete ( result ) ; return future ;
public class LegacySpy { /** * Alias for { @ link # verifyBetween ( int , int , Threads , Query ) } with arguments 0 , 1 , { @ code threads } , { @ link Query # ANY } * @ since 2.0 */ @ Deprecated public C verifyAtMostOnce ( Threads threadMatcher ) throws WrongNumberOfQueriesError { } }
return verify ( SqlQueries . atMostOneQuery ( ) . threads ( threadMatcher ) ) ;
public class CompositeInputSplit { /** * Write splits in the following format . * { @ code * < count > < class1 > < class2 > . . . < classn > < split1 > < split2 > . . . < splitn > */ public void write ( DataOutput out ) throws IOException { } }
WritableUtils . writeVInt ( out , splits . length ) ; for ( InputSplit s : splits ) { Text . writeString ( out , s . getClass ( ) . getName ( ) ) ; } for ( InputSplit s : splits ) { s . write ( out ) ; }
public class InJamp { /** * Reads the next HMTP packet from the stream , returning false on * end of file . */ public int readMessages ( Reader is ) throws IOException { } }
// InboxAmp oldInbox = null ; try ( OutboxAmp outbox = OutboxAmp . currentOrCreate ( getManager ( ) ) ) { // OutboxThreadLocal . setCurrent ( _ outbox ) ; return readMessages ( is , outbox ) ; } finally { // OutboxThreadLocal . setCurrent ( null ) ; }
public class DescribeVpcEndpointsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeVpcEndpointsRequest > getDryRunRequest ( ) { } }
Request < DescribeVpcEndpointsRequest > request = new DescribeVpcEndpointsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class SinkExecutor { /** * Add task to invoke processRecord method when the WakeableLooper is waken up */ private void addSinkTasks ( ) { } }
Runnable sinkTasks = new Runnable ( ) { @ Override public void run ( ) { while ( ! metricsInSinkQueue . isEmpty ( ) ) { metricsSink . processRecord ( metricsInSinkQueue . poll ( ) ) ; } } } ; slaveLooper . addTasksOnWakeup ( sinkTasks ) ;
public class GlobalTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setIdentifier ( String newIdentifier ) { } }
String oldIdentifier = identifier ; identifier = newIdentifier ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , DroolsPackage . GLOBAL_TYPE__IDENTIFIER , oldIdentifier , identifier ) ) ;
public class Analysis { /** * 一整句话分词 , 用户设置的歧异优先 * @ param temp * @ return */ private List < Term > analysisStr ( String temp ) { } }
Graph gp = new Graph ( temp ) ; int startOffe = 0 ; if ( this . ambiguityForest != null ) { GetWord gw = new GetWord ( this . ambiguityForest , gp . chars ) ; String [ ] params = null ; while ( ( gw . getFrontWords ( ) ) != null ) { if ( gw . offe > startOffe ) { analysis ( gp , startOffe , gw . offe ) ; } params = gw . getParams ( ) ; startOffe = gw . offe ; for ( int i = 0 ; i < params . length ; i += 2 ) { gp . addTerm ( new Term ( params [ i ] , startOffe , new TermNatures ( new TermNature ( params [ i + 1 ] , 1 ) ) ) ) ; startOffe += params [ i ] . length ( ) ; } } } if ( startOffe < gp . chars . length ) { analysis ( gp , startOffe , gp . chars . length ) ; } List < Term > result = this . getResult ( gp ) ; return result ;
public class Participant { /** * Create a ParticipantCreator to execute create . * @ param pathAccountSid The SID of the Account that will create the resource * @ param pathConferenceSid The SID of the participant ' s conference * @ param from The ` from ` phone number used to invite a participant * @ param to The number , client id , or sip address of the new participant * @ return ParticipantCreator capable of executing the create */ public static ParticipantCreator creator ( final String pathAccountSid , final String pathConferenceSid , final com . twilio . type . PhoneNumber from , final com . twilio . type . PhoneNumber to ) { } }
return new ParticipantCreator ( pathAccountSid , pathConferenceSid , from , to ) ;
public class LexiconAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LexiconAttributes lexiconAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( lexiconAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lexiconAttributes . getAlphabet ( ) , ALPHABET_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getLastModified ( ) , LASTMODIFIED_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getLexiconArn ( ) , LEXICONARN_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getLexemesCount ( ) , LEXEMESCOUNT_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getSize ( ) , SIZE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class IdolFieldPathNormaliserImpl { /** * We have to do it this way to break the circular dependency between the FieldsInfo deserializer and this . */ public Pattern updatePattern ( final Collection < String > prefixes ) { } }
final String XML_PREFIX = prefixes . stream ( ) . map ( s -> Pattern . quote ( s + "/" ) ) . collect ( Collectors . joining ( "|" ) ) ; return XML_PATH_PATTERN = Pattern . compile ( "^/?(?:" + XML_PREFIX + ")?(?:" + IDX_PREFIX + ")?(?<fieldPath>[^/]+(?:/[^/]+)*)$" ) ;
public class NewYearStrategy { /** * < p > Determines the date of New Year . < / p > * @ param era historic era * @ param yearOfDisplay historic year of era as displayed ( deviating from standard calendar year ) * @ return historic date of New Year * @ since 3.14/4.11 */ HistoricDate newYear ( HistoricEra era , int yearOfDisplay ) { } }
return rule ( era , yearOfDisplay ) . newYear ( era , yearOfDisplay ) ;
public class MSExcelParser { /** * Parses the given InputStream containing Excel data . The type of InputStream ( e . g . FileInputStream , BufferedInputStream etc . ) does not matter here , but it is recommended to use an appropriate * type to avoid performance issues . * @ param in InputStream containing Excel data * @ throws org . zuinnote . hadoop . office . format . common . parser . FormatNotUnderstoodException in case there are issues reading from the Excel file , e . g . wrong password or unknown format */ @ Override public void parse ( InputStream in ) throws FormatNotUnderstoodException { } }
// read xls try { this . currentWorkbook = WorkbookFactory . create ( in , this . hocr . getPassword ( ) ) ; } catch ( EncryptedDocumentException | IOException e ) { LOG . error ( e ) ; throw new FormatNotUnderstoodException ( e . toString ( ) ) ; } finally { if ( this . in != null ) { try { this . in . close ( ) ; } catch ( IOException e ) { LOG . error ( e ) ; } } } // check if signature should be verified if ( this . hocr . getVerifySignature ( ) ) { LOG . info ( "Verifying signature of document" ) ; if ( ! ( this . currentWorkbook instanceof XSSFWorkbook ) ) { throw new FormatNotUnderstoodException ( "Can only verify signatures for files using the OOXML (.xlsx) format" ) ; } else { OPCPackage pgk = ( ( XSSFWorkbook ) this . currentWorkbook ) . getPackage ( ) ; SignatureConfig sic = new SignatureConfig ( ) ; sic . setOpcPackage ( pgk ) ; SignatureInfo si = new SignatureInfo ( ) ; si . setSignatureConfig ( sic ) ; if ( ! si . verifySignature ( ) ) { throw new FormatNotUnderstoodException ( "Cannot verify signature of OOXML (.xlsx) file: " + this . hocr . getFileName ( ) ) ; } else { LOG . info ( "Successfully verifed first part signature of OXXML (.xlsx) file: " + this . hocr . getFileName ( ) ) ; } Iterator < SignaturePart > spIter = si . getSignatureParts ( ) . iterator ( ) ; while ( spIter . hasNext ( ) ) { SignaturePart currentSP = spIter . next ( ) ; if ( ! ( currentSP . validate ( ) ) ) { throw new FormatNotUnderstoodException ( "Could not validate all signature parts for file: " + this . hocr . getFileName ( ) ) ; } else { X509Certificate currentCertificate = currentSP . getSigner ( ) ; try { if ( ( this . hocr . getX509CertificateChain ( ) . size ( ) > 0 ) && ( ! CertificateChainVerificationUtil . verifyCertificateChain ( currentCertificate , this . hocr . getX509CertificateChain ( ) ) ) ) { throw new FormatNotUnderstoodException ( "Could not validate signature part for principal \"" + currentCertificate . getSubjectX500Principal ( ) . getName ( ) + "\" : " + this . hocr . getFileName ( ) ) ; } } catch ( CertificateException | NoSuchAlgorithmException | NoSuchProviderException | InvalidAlgorithmParameterException e ) { LOG . error ( "Could not validate signature part for principal \"" + currentCertificate . getSubjectX500Principal ( ) . getName ( ) + "\" : " + this . hocr . getFileName ( ) , e ) ; throw new FormatNotUnderstoodException ( "Could not validate signature part for principal \"" + currentCertificate . getSubjectX500Principal ( ) . getName ( ) + "\" : " + this . hocr . getFileName ( ) ) ; } } } LOG . info ( "Successfully verifed all signatures of OXXML (.xlsx) file: " + this . hocr . getFileName ( ) ) ; } } // formulaEvaluator this . formulaEvaluator = this . currentWorkbook . getCreationHelper ( ) . createFormulaEvaluator ( ) ; // add the formulator evaluator of this file as well or we will see a strange Exception this . addedFormulaEvaluators . put ( this . hocr . getFileName ( ) , this . formulaEvaluator ) ; this . formulaEvaluator . setIgnoreMissingWorkbooks ( this . hocr . getIgnoreMissingLinkedWorkbooks ( ) ) ; this . filtered = this . checkFiltered ( ) ; this . currentRow = 0 ; if ( this . sheets == null ) { this . currentSheetName = this . currentWorkbook . getSheetAt ( 0 ) . getSheetName ( ) ; } else if ( sheets . length < 1 ) { throw new FormatNotUnderstoodException ( "Error: no sheets selected" ) ; } else { this . currentSheetName = sheets [ 0 ] ; } // check skipping of additional lines this . currentRow += this . hocr . getSkipLines ( ) ; // check header if ( this . hocr . getReadHeader ( ) ) { LOG . debug ( "Reading header..." ) ; Object [ ] firstRow = this . getNext ( ) ; if ( firstRow != null ) { this . header = new String [ firstRow . length ] ; for ( int i = 0 ; i < firstRow . length ; i ++ ) { if ( ( firstRow [ i ] != null ) && ( ! "" . equals ( ( ( SpreadSheetCellDAO ) firstRow [ i ] ) . getFormattedValue ( ) ) ) ) { this . header [ i ] = ( ( SpreadSheetCellDAO ) firstRow [ i ] ) . getFormattedValue ( ) ; } } this . header = MSExcelParser . sanitizeHeaders ( this . header , this . hocr . getColumnNameRegex ( ) , this . hocr . getColumnNameReplace ( ) ) ; } else { this . header = new String [ 0 ] ; } }
public class ClasspathFileReader { /** * Finds a file if it exists in a list of provided paths * @ param fileName the name of the file * @ param path a list of file paths * @ return a file or null if none is found */ private File findFile ( String fileName , List path ) { } }
final String methodName = "findFile(): " ; String fileSeparator = System . getProperty ( "file.separator" ) ; for ( Iterator i = path . iterator ( ) ; i . hasNext ( ) ; ) { String directory = ( String ) i . next ( ) ; if ( ! directory . endsWith ( fileSeparator ) && ! fileName . startsWith ( fileSeparator ) ) { directory = directory + fileSeparator ; } File file = new File ( directory + fileName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( methodName + " checking '" + file . getAbsolutePath ( ) + "'" ) ; } if ( file . exists ( ) && file . canRead ( ) ) { log . debug ( methodName + " found it - file is '" + file . getAbsolutePath ( ) + "'" ) ; cache . put ( fileName , new CacheEntry ( file ) ) ; return file ; } } return null ;
public class CrossOriginResourceSharingFilter { /** * ( non - Javadoc ) * @ see org . restlet . routing . Filter # afterHandle ( org . restlet . Request , org . restlet . Response ) */ @ SuppressWarnings ( "unchecked" ) @ Override protected void afterHandle ( final Request request , final Response response ) { } }
super . afterHandle ( request , response ) ; final ConcurrentMap < String , Object > responseAttributes = response . getAttributes ( ) ; Series < Header > responseHeaders = ( Series < Header > ) responseAttributes . get ( HeaderConstants . ATTRIBUTE_HEADERS ) ; if ( responseHeaders == null ) { responseHeaders = new Series < Header > ( Header . class ) ; final Series < Header > putIfAbsent = ( Series < Header > ) responseAttributes . putIfAbsent ( HeaderConstants . ATTRIBUTE_HEADERS , responseHeaders ) ; if ( putIfAbsent != null ) { responseHeaders = putIfAbsent ; } } // Allow all origins responseHeaders . add ( "Access-Control-Allow-Origin" , "*" ) ;
public class MkdirCommand { /** * - - - - - private methods - - - - - */ private void createFolder ( final StructrShellCommand parent , final Folder currentFolder , final String target ) throws FrameworkException , IOException { } }
final App app = StructrApp . getInstance ( ) ; if ( target . contains ( "/" ) ) { final int lastSlashIndex = target . lastIndexOf ( "/" ) ; final String targetFolderPath = target . substring ( 0 , lastSlashIndex ) ; final String targetFolderName = target . substring ( lastSlashIndex + 1 ) ; final Folder parentFolder = parent . findRelativeFolder ( currentFolder , targetFolderPath ) ; if ( parentFolder != null ) { checkAndCreateFolder ( app , parent , parentFolder , targetFolderName ) ; } else { term . println ( "Folder " + targetFolderPath + " does not exist" ) ; } } else { checkAndCreateFolder ( app , parent , currentFolder , target ) ; }
public class Compatibility { /** * Check whether data already written to a provided partition can be read * using the new partition type . * For example , existing ints can be read as strings , but existing strings * can ' t be read as ints . * @ param providedClass the class from a provided partitioner * @ param replacementClass the partition class of the replacement partitioner * @ return { @ code true } iff replacement class can be used with existing data */ private static boolean isCompatibleWithProvidedType ( Class < ? > providedClass , Class < ? > replacementClass ) { } }
if ( Integer . class . isAssignableFrom ( providedClass ) ) { return ( replacementClass == String . class || replacementClass == Integer . class || replacementClass == Long . class ) ; } else if ( Long . class . isAssignableFrom ( providedClass ) ) { return ( replacementClass == String . class || replacementClass == Long . class ) ; } else if ( String . class . isAssignableFrom ( providedClass ) ) { return replacementClass == String . class ; } return false ;
public class LBiObjSrtPredicateBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V1 extends T1 , V2 extends T2 > LBiObjSrtPredicateBuilder < T1 , T2 > aCase ( Class < V1 > argC1 , Class < V2 > argC2 , LBiObjSrtPredicate < V1 , V2 > function ) { } }
PartialCaseWithBoolProduct . The pc = partialCaseFactoryMethod ( ( a1 , a2 , a3 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) && ( argC2 == null || argC2 . isInstance ( a2 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class SemaphoreGuard { /** * Acquires the semaphore . Also , the first execution of this method retrieves the semaphore by name and stores it locally . * This method is called when the task is entered . */ @ Override public void start ( ) { } }
if ( semaphore == null ) { semaphore = NonBlockingSemaphoreRepository . getSemaphore ( name ) ; } semaphoreAcquired = semaphore . acquire ( ) ; super . start ( ) ;
public class EditorComponentPane { /** * Returns the view specific menubar if the underlying view * implementation supports it . */ protected JComponent createViewMenuBar ( ) { } }
if ( getPageComponent ( ) instanceof AbstractEditor ) { AbstractEditor editor = ( AbstractEditor ) getPageComponent ( ) ; return editor . getEditorMenuBar ( ) ; } return null ;
public class ChainLight { /** * Calculates ray positions and angles along chain . This should be called * any time the number or values of elements changes in { @ link # chain } . */ public void updateChain ( ) { } }
Vector2 v1 = Pools . obtain ( Vector2 . class ) ; Vector2 v2 = Pools . obtain ( Vector2 . class ) ; Vector2 vSegmentStart = Pools . obtain ( Vector2 . class ) ; Vector2 vDirection = Pools . obtain ( Vector2 . class ) ; Vector2 vRayOffset = Pools . obtain ( Vector2 . class ) ; Spinor tmpAngle = Pools . obtain ( Spinor . class ) ; // Spinors used to represent perpendicular angle of each segment Spinor previousAngle = Pools . obtain ( Spinor . class ) ; Spinor currentAngle = Pools . obtain ( Spinor . class ) ; Spinor nextAngle = Pools . obtain ( Spinor . class ) ; // Spinors used to represent start , end and interpolated ray // angles for a given segment Spinor startAngle = Pools . obtain ( Spinor . class ) ; Spinor endAngle = Pools . obtain ( Spinor . class ) ; Spinor rayAngle = Pools . obtain ( Spinor . class ) ; int segmentCount = chain . size / 2 - 1 ; segmentAngles . clear ( ) ; segmentLengths . clear ( ) ; float remainingLength = 0 ; for ( int i = 0 , j = 0 ; i < chain . size - 2 ; i += 2 , j ++ ) { v1 . set ( chain . items [ i + 2 ] , chain . items [ i + 3 ] ) . sub ( chain . items [ i ] , chain . items [ i + 1 ] ) ; segmentLengths . add ( v1 . len ( ) ) ; segmentAngles . add ( v1 . rotate90 ( rayDirection ) . angle ( ) * MathUtils . degreesToRadians ) ; remainingLength += segmentLengths . items [ j ] ; } int rayNumber = 0 ; int remainingRays = rayNum ; for ( int i = 0 ; i < segmentCount ; i ++ ) { // get this and adjacent segment angles previousAngle . set ( ( i == 0 ) ? segmentAngles . items [ i ] : segmentAngles . items [ i - 1 ] ) ; currentAngle . set ( segmentAngles . items [ i ] ) ; nextAngle . set ( ( i == segmentAngles . size - 1 ) ? segmentAngles . items [ i ] : segmentAngles . items [ i + 1 ] ) ; // interpolate to find actual start and end angles startAngle . set ( previousAngle ) . slerp ( currentAngle , 0.5f ) ; endAngle . set ( currentAngle ) . slerp ( nextAngle , 0.5f ) ; int segmentVertex = i * 2 ; vSegmentStart . set ( chain . items [ segmentVertex ] , chain . items [ segmentVertex + 1 ] ) ; vDirection . set ( chain . items [ segmentVertex + 2 ] , chain . items [ segmentVertex + 3 ] ) . sub ( vSegmentStart ) . nor ( ) ; float raySpacing = remainingLength / remainingRays ; int segmentRays = ( i == segmentCount - 1 ) ? remainingRays : ( int ) ( ( segmentLengths . items [ i ] / remainingLength ) * remainingRays ) ; for ( int j = 0 ; j < segmentRays ; j ++ ) { float position = j * raySpacing ; // interpolate ray angle based on position within segment rayAngle . set ( startAngle ) . slerp ( endAngle , position / segmentLengths . items [ i ] ) ; float angle = rayAngle . angle ( ) ; vRayOffset . set ( this . rayStartOffset , 0 ) . rotateRad ( angle ) ; v1 . set ( vDirection ) . scl ( position ) . add ( vSegmentStart ) . add ( vRayOffset ) ; this . startX [ rayNumber ] = v1 . x ; this . startY [ rayNumber ] = v1 . y ; v2 . set ( distance , 0 ) . rotateRad ( angle ) . add ( v1 ) ; this . endX [ rayNumber ] = v2 . x ; this . endY [ rayNumber ] = v2 . y ; rayNumber ++ ; } remainingRays -= segmentRays ; remainingLength -= segmentLengths . items [ i ] ; } Pools . free ( v1 ) ; Pools . free ( v2 ) ; Pools . free ( vSegmentStart ) ; Pools . free ( vDirection ) ; Pools . free ( vRayOffset ) ; Pools . free ( previousAngle ) ; Pools . free ( currentAngle ) ; Pools . free ( nextAngle ) ; Pools . free ( startAngle ) ; Pools . free ( endAngle ) ; Pools . free ( rayAngle ) ; Pools . free ( tmpAngle ) ;
public class SyntaxHighlighter { /** * / * ( non - Javadoc ) * @ see org . opoo . press . converter . Highlighter # containsHighlightCodeBlock ( java . lang . String ) */ @ Override public boolean containsHighlightCodeBlock ( String content ) { } }
return StringUtils . contains ( content , "<pre class='brush:" ) || StringUtils . contains ( content , "<pre class=\"brush:" ) ;
public class Proposal { /** * Gets the billingBase value for this Proposal . * @ return billingBase * The billing base of this { @ code Proposal } . For example , for * a flat fee * { @ link BillingSource # CONTRACTED contracted } { @ link * # billingSource } , set this to * { @ link BillingBase # REVENUE } . This attribute is optional * and defaults to * { @ link BillingBase # VOLUME } . * This attribute can be configured as editable after * the proposal has been submitted . * Please check with your network administrator for editable * fields configuration . * < span class = " constraint Applicable " > This attribute * is applicable when : < ul > < li > not using programmatic , using sales management . < / li > < / ul > < / span > */ public com . google . api . ads . admanager . axis . v201808 . BillingBase getBillingBase ( ) { } }
return billingBase ;
public class SvgPathData { /** * Checks an ' L ' command . */ private void checkL ( ) throws DatatypeException , IOException { } }
if ( context . length ( ) == 0 ) { appendToContext ( current ) ; } current = reader . read ( ) ; appendToContext ( current ) ; skipSpaces ( ) ; _checkL ( 'L' , true ) ;
public class Tokenizer { /** * Determines if the underlying input is looking at a bracket . * By default all supplied < tt > brackets < / tt > are checked . If < tt > treatSinglePipeAsBracket < / tt > is true , a * single ' | ' is also treated as bracket . * @ param inSymbol determines if we ' re already parsing a symbol or just trying to decide what the next token is * @ return < tt > true < / tt > if the current input is an opening or closing bracket */ @ SuppressWarnings ( "squid:S1067" ) protected boolean isAtBracket ( boolean inSymbol ) { } }
return input . current ( ) . is ( brackets ) || ! inSymbol && treatSinglePipeAsBracket && input . current ( ) . is ( '|' ) && ! input . next ( ) . is ( '|' ) ;
public class ControlFlowAnalysis { /** * Determines if the subtree might throw an exception . */ public static boolean mayThrowException ( Node n ) { } }
switch ( n . getToken ( ) ) { case CALL : case TAGGED_TEMPLATELIT : case GETPROP : case GETELEM : case THROW : case NEW : case ASSIGN : case INC : case DEC : case INSTANCEOF : case IN : case YIELD : case AWAIT : return true ; case FUNCTION : return false ; default : break ; } for ( Node c = n . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { if ( ! ControlFlowGraph . isEnteringNewCfgNode ( c ) && mayThrowException ( c ) ) { return true ; } } return false ;
public class MessageProcessor { /** * Set _ discardMsgsAfterQueueDeletion to true . */ public void setDiscardMsgsAfterQueueDeletion ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "setDiscardMsgsAfterQueueDeletion" ) ; SibTr . exit ( tc , "setDiscardMsgsAfterQueueDeletion" ) ; } _discardMsgsAfterQueueDeletion = true ;
public class XsdEmitter { /** * Create an XML schema totalDigits facet . * @ param totalDigits the value to set * @ return an XML schema totalDigits facet */ protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet ( final int totalDigits ) { } }
XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet ( ) ; xmlSchemaTotalDigitsFacet . setValue ( totalDigits ) ; return xmlSchemaTotalDigitsFacet ;
public class AbstractFileRoutesLoader { /** * Helper method . Creates a { @ link Route } object from the input string . * @ param input the string to parse . * @ return a { @ link Route } object . * @ throws ParseException if the line has an invalid format . */ private Route parse ( String input , int line ) throws ParseException { } }
StringTokenizer st = new StringTokenizer ( input , " \t" ) ; if ( st . countTokens ( ) != 3 ) { throw new ParseException ( "Unrecognized format" , line ) ; } // retrieve and validate the three arguments String httpMethod = validateHttpMethod ( st . nextToken ( ) . trim ( ) , line ) ; String path = validatePath ( st . nextToken ( ) . trim ( ) , line ) ; String controllerAndMethod = validateControllerAndMethod ( st . nextToken ( ) . trim ( ) , line ) ; // retrieve controller name int hashPos = controllerAndMethod . indexOf ( '#' ) ; String controllerName = controllerAndMethod . substring ( 0 , hashPos ) ; // retrieve controller method String controllerMethod = controllerAndMethod . substring ( hashPos + 1 ) ; return buildRoute ( httpMethod , path , controllerName , controllerMethod ) ;
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the cp attachment file entry where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCPAttachmentFileEntryException } if it could not be found . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cp attachment file entry * @ throws NoSuchCPAttachmentFileEntryException if a matching cp attachment file entry could not be found */ @ Override public CPAttachmentFileEntry findByUUID_G ( String uuid , long groupId ) throws NoSuchCPAttachmentFileEntryException { } }
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByUUID_G ( uuid , groupId ) ; if ( cpAttachmentFileEntry == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", groupId=" ) ; msg . append ( groupId ) ; msg . append ( "}" ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( msg . toString ( ) ) ; } throw new NoSuchCPAttachmentFileEntryException ( msg . toString ( ) ) ; } return cpAttachmentFileEntry ;
public class UploadObjectObserver { /** * Notified from { @ link MultiFileOutputStream # fos ( ) } when a part ready for * upload has been successfully created on disk . By default , this method * performs the following : * < ol > * < li > calls { @ link # newUploadPartRequest ( PartCreationEvent , File ) } to * create an upload - part request for the newly created ciphertext file < / li > * < li > call { @ link # appendUserAgent ( AmazonWebServiceRequest , String ) } to * append the necessary user agent string to the request < / li > * < li > and finally submit a concurrent task , which calls the method * { @ link # uploadPart ( UploadPartRequest ) } , to be performed < / li > * < / ol > * To enable parallel uploads , implementation of this method should never * block . * @ param event * to represent the completion of a ciphertext file creation * which is ready for multipart upload to S3. */ public void onPartCreate ( PartCreationEvent event ) { } }
final File part = event . getPart ( ) ; final UploadPartRequest reqUploadPart = newUploadPartRequest ( event , part ) ; final OnFileDelete fileDeleteObserver = event . getFileDeleteObserver ( ) ; appendUserAgent ( reqUploadPart , AmazonS3EncryptionClient . USER_AGENT ) ; futures . add ( es . submit ( new Callable < UploadPartResult > ( ) { @ Override public UploadPartResult call ( ) { // Upload the ciphertext directly via the non - encrypting // s3 client try { return uploadPart ( reqUploadPart ) ; } finally { // clean up part already uploaded if ( ! part . delete ( ) ) { LogFactory . getLog ( getClass ( ) ) . debug ( "Ignoring failure to delete file " + part + " which has already been uploaded" ) ; } else { if ( fileDeleteObserver != null ) fileDeleteObserver . onFileDelete ( null ) ; } } } } ) ) ;
public class QueryInfo { /** * Deprecated : Since return doesn ' t contain method information , { @ link # getParametersList ( ) } is now used . * @ return list of parameter map , key is first arg as string , value is second arg . * @ deprecated use { @ link # getParametersList ( ) } */ @ Deprecated public List < Map < String , Object > > getQueryArgsList ( ) { } }
// simulate old implementation behavior List < Map < String , Object > > result = new ArrayList < Map < String , Object > > ( ) ; for ( List < ParameterSetOperation > paramsList : this . parametersList ) { Map < String , Object > map = new HashMap < String , Object > ( ) ; for ( ParameterSetOperation param : paramsList ) { Object [ ] args = param . getArgs ( ) ; map . put ( args [ 0 ] . toString ( ) , args [ 1 ] ) ; } result . add ( map ) ; } return result ;
public class AuthenticationApi { /** * Perform authorization * Perform authorization based on the code grant type & amp ; mdash ; either Authorization Code Grant or Implicit Grant . For more information , see [ Authorization Endpoint ] ( https : / / tools . ietf . org / html / rfc6749 # section - 3.1 ) . * * Note : * * For the optional * * scope * * parameter , the Authentication API supports only the & # x60 ; * & # x60 ; value . * @ param clientId The ID of the application or service that is registered as the client . You & # 39 ; ll need to get this value from your PureEngage Cloud representative . ( required ) * @ param redirectUri The URI that you want users to be redirected to after entering valid credentials during an Implicit or Authorization Code grant . The Authentication API includes this as part of the URI it returns in the & # 39 ; Location & # 39 ; header . ( required ) * @ param responseType The response type to let the Authentication API know which grant flow you & # 39 ; re using . Possible values are & # x60 ; code & # x60 ; for Authorization Code Grant or & # x60 ; token & # x60 ; for Implicit Grant . For more information about this parameter , see [ Response Type ] ( https : / / tools . ietf . org / html / rfc6749 # section - 3.1.1 ) . ( required ) * @ param authorization Basic authorization . For example : & # 39 ; Authorization : Basic Y3 . . . MQ & # x3D ; & # x3D ; & # 39 ; ( optional ) * @ param hideTenant Hide the * * tenant * * field in the UI for Authorization Code Grant . ( optional , default to false ) * @ param scope The scope of the access request . The Authentication API supports only the & # x60 ; * & # x60 ; value . ( optional ) * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public void authorize ( String clientId , String redirectUri , String responseType , String authorization , Boolean hideTenant , String scope ) throws ApiException { } }
authorizeWithHttpInfo ( clientId , redirectUri , responseType , authorization , hideTenant , scope ) ;
public class BoundCodeableConceptDt { /** * Sets the { @ link # getCoding ( ) } to contain a coding with the code and * system defined by the given enumerated types , AND clearing any existing * codings first . If theValue is null , existing codings are cleared and no * codings are added . * @ param theValues * The value to add , or < code > null < / code > */ public void setValueAsEnum ( Collection < T > theValues ) { } }
Validate . notNull ( myBinder , "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!" ) ; getCoding ( ) . clear ( ) ; if ( theValues != null ) { for ( T next : theValues ) { getCoding ( ) . add ( new CodingDt ( myBinder . toSystemString ( next ) , myBinder . toCodeString ( next ) ) ) ; } }
public class MaterialNavigationDrawer { /** * / * Chiamata dopo l ' invalidateOptionsMenu ( ) */ @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } }
if ( layout . isDrawerOpen ( drawer ) && ! deviceSupportMultiPane ( ) ) { menu . clear ( ) ; } return super . onPrepareOptionsMenu ( menu ) ;
public class AssetFiltersInner { /** * Get an Asset Filter . * Get the details of an Asset Filter associated with the specified Asset . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param assetName The Asset name . * @ param filterName The Asset Filter name * @ 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 < AssetFilterInner > getAsync ( String resourceGroupName , String accountName , String assetName , String filterName , final ServiceCallback < AssetFilterInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , accountName , assetName , filterName ) , serviceCallback ) ;
public class CmdLine { /** * Parse command line arguments for the example * @ param args Command - line arguments for HDFS example * @ return a ChartExec object resulting from the parsing of command - line options * @ throws ParseException when args cannot be parsed * @ throws IOException when input file cannot be found */ public Engine parseCommandLine ( final String [ ] args ) throws ParseException , IOException { } }
// create the command line parser CommandLineParser parser = new GnuParser ( ) ; // create the Options final Options options = new Options ( ) . addOption ( "h" , "help" , false , "print help." ) . addOption ( "i" , "inputfile" , true , "the scxml input file" ) . addOption ( "n" , "numberoftimes" , true , "an integer, the number of TIME to run the template of a row" ) . addOption ( "H" , "hdfssequencefile" , true , "the path of the hdfs sequence file to write to" ) . addOption ( "L" , "loglevel" , true , "set the log level" ) . addOption ( "s" , "maxscenarios" , true , "Maximum number of scenarios to generate. Default 10,000" ) . addOption ( "m" , "minbootstrapstates" , true , "Minimum number of states to explore using BFS before using parallel DFS search. Default is 0" + " (no BFS)." ) ; CommandLine cmd = parser . parse ( options , args ) ; Engine chartExec = new SCXMLEngine ( ) ; hdfsDist = new HDFSDistributor ( ) ; if ( cmd . hasOption ( "i" ) ) { Path inFile = new Path ( cmd . getOptionValue ( 'i' ) ) ; FileSystem fs = FileSystem . get ( this . getConf ( ) ) ; FSDataInputStream in = fs . open ( inFile ) ; String model = IOUtils . toString ( in , "UTF-8" ) ; chartExec . setModelByText ( model ) ; hdfsDist . setStateMachineText ( model ) ; } else { System . err . println ( "\nERROR: you must state option -i with an input file\n" ) ; } int n = 1 ; if ( cmd . hasOption ( "n" ) ) { n = Integer . valueOf ( cmd . getOptionValue ( "n" ) ) ; } if ( cmd . hasOption ( "h" ) || cmd . getOptions ( ) . length == 0 ) { printHelp ( options ) ; } if ( cmd . hasOption ( 'L' ) ) { LogInitializer . initialize ( cmd . getOptionValue ( 'L' ) ) ; } else { LogInitializer . initialize ( "WARN" ) ; } if ( cmd . hasOption ( 'm' ) ) { String stringValue = cmd . getOptionValue ( 'm' ) ; if ( StringUtils . isNotEmpty ( stringValue ) ) { chartExec . setBootstrapMin ( Integer . parseInt ( stringValue ) ) ; } else { System . err . println ( "Unparsable numeric value for option 'm':" + stringValue ) ; } } long maxLines = 0 ; if ( cmd . hasOption ( 's' ) ) { String stringValue = cmd . getOptionValue ( 's' ) ; maxLines = Long . valueOf ( stringValue ) ; if ( StringUtils . isNotEmpty ( stringValue ) ) { hdfsDist . setMaxNumberOfLines ( maxLines ) ; } else { System . err . println ( "Unparsable numeric value for option 's':" + stringValue ) ; } } else if ( ! cmd . hasOption ( 's' ) ) { maxLines = 10000 ; hdfsDist . setMaxNumberOfLines ( maxLines ) ; } LineCountManager jetty = new LineCountManager ( maxLines , 500000 ) ; jetty . prepareServer ( ) ; jetty . prepareStatus ( ) ; hdfsDist = hdfsDist . setFileRoot ( "brownbag_demo" ) . setReportingHost ( jetty . getHostName ( ) + ":" + jetty . getListeningPort ( ) ) ; return chartExec ;
public class Gravatar { /** * Set the default image which will be retrieved when there is no avatar * for the given email , when the avatar can ' t be shown due to the rating * or when you enforce the default avatar . * @ param standardDefaultImage One of multiple default avatar choices . * @ return Fluent interface */ public Gravatar setStandardDefaultImage ( DefaultImage standardDefaultImage ) { } }
assert standardDefaultImage != null ; this . standardDefaultImage = standardDefaultImage ; customDefaultImage = null ; return this ;
public class PlayRecordContext { /** * If set to true , clears the digit buffer before playing the initial prompt . * < b > Defaults to false . < / b > Valid values are the text strings " true " and " false " . * @ return */ public boolean getClearDigitBuffer ( ) { } }
String value = Optional . fromNullable ( getParameter ( SignalParameters . CLEAR_DIGIT_BUFFER . symbol ( ) ) ) . or ( "false" ) ; return Boolean . parseBoolean ( value ) ;
public class DefaultBlitz4jConfig { /** * ( non - Javadoc ) * @ see * com . netflix . blitz4j . BlitzConfig # getAsyncAppenderImplementationNames ( ) */ @ Override public String [ ] getAsyncAppenderImplementationNames ( ) { } }
return CONFIGURATION . getStringProperty ( BLITZ4J_ASYNC_APPENDERS , this . getPropertyValue ( BLITZ4J_ASYNC_APPENDERS , "com.netflix.blitz4j.AsyncAppender" ) ) . get ( ) . split ( "," ) ;
public class SiteTracker { /** * Get an array of local sites that need heartbeats . This will get individually generated heartbeats . */ public long [ ] getLocalSites ( ) { } }
int hostId = VoltDB . instance ( ) . getHostMessenger ( ) . getHostId ( ) ; return longListToArray ( m_hostsToSitesImmutable . get ( hostId ) ) ;
public class TextStylist { @ Override public void formatMap ( Map < Object , Object > map ) throws FormatException { } }
if ( map == null || map . isEmpty ( ) ) return ; // nothing to process // format properties Object key = null ; Object value = null ; String text = null ; for ( Map . Entry < Object , Object > entry : map . entrySet ( ) ) { key = entry . getKey ( ) ; value = entry . getValue ( ) ; if ( ! ( value instanceof String ) ) continue ; // skip text = ( String ) value ; // overwrite value with formatted version if ( text . indexOf ( getTemplatePrefix ( ) ) > - 1 ) map . put ( key , format ( text , map ) ) ; }
public class ReconciliationReportRow { /** * Gets the manualRevenue value for this ReconciliationReportRow . * @ return manualRevenue * The revenue calculated based on the { @ link # costPerUnit } , { @ link * # costType } , * { @ link # manualClicks } , { @ link # manualImpressions } * and { @ link # manualLineItemDays } . * This attribute is calculated by Google and is read - only . */ public com . google . api . ads . admanager . axis . v201805 . Money getManualRevenue ( ) { } }
return manualRevenue ;
public class GVRCameraRig { /** * Map a three - component { @ code float } vector to { @ code key } . * @ param key * Key to map the vector to . * @ param x * ' X ' component of vector . * @ param y * ' Y ' component of vector . * @ param z * ' Z ' component of vector . */ public void setVec3 ( String key , float x , float y , float z ) { } }
checkStringNotNullOrEmpty ( "key" , key ) ; NativeCameraRig . setVec3 ( getNative ( ) , key , x , y , z ) ;
public class PostalCodeManager { /** * Check if the passed postal code is valid for the passed country . * @ param aCountry * The country to check . May be < code > null < / code > . * @ param sPostalCode * The postal code to check . May be < code > null < / code > . * @ return { @ link ETriState # UNDEFINED } if no information for the passed * country are present , { @ link ETriState # TRUE } if the postal code is * valid or { @ link ETriState # FALSE } if the passed postal code is * explicitly not valid for the passed country . */ @ Nonnull public ETriState isValidPostalCode ( @ Nullable final Locale aCountry , @ Nullable final String sPostalCode ) { } }
final IPostalCodeCountry aPostalCountry = getPostalCountryOfCountry ( aCountry ) ; if ( aPostalCountry == null ) return ETriState . UNDEFINED ; return ETriState . valueOf ( aPostalCountry . isValidPostalCode ( sPostalCode ) ) ;
public class Director { /** * Uninstalls product depending on dependencies * @ param checkDependency if uninstall should check for dependencies * @ param productIds Ids of product to uninstall * @ param toBeDeleted Collection of files to uninstall * @ throws InstallException */ public void uninstall ( boolean checkDependency , String [ ] productIds , Collection < File > toBeDeleted ) throws InstallException { } }
getUninstallDirector ( ) . uninstall ( checkDependency , productIds , toBeDeleted ) ;
public class CrossTab { /** * Returns a table containing the column percents made from a source table , after first calculating the counts * cross - tabulated from the given columns */ public static Table columnPercents ( Table table , String column1 , String column2 ) { } }
return columnPercents ( table , table . categoricalColumn ( column1 ) , table . categoricalColumn ( column2 ) ) ;
public class Partition { /** * Fill the elements of a permutation from the first element of each * cell , up to the point < code > upTo < / code > . * @ param upTo take values from cells up to this one * @ return the permutation representing the first element of each cell */ public Permutation setAsPermutation ( int upTo ) { } }
int [ ] p = new int [ upTo ] ; for ( int i = 0 ; i < upTo ; i ++ ) { p [ i ] = this . cells . get ( i ) . first ( ) ; } return new Permutation ( p ) ;
public class CudaMemoryManager { /** * This method detaches off - heap memory from passed INDArray instances , and optionally stores them in cache for future reuse * PLEASE NOTE : Cache options depend on specific implementations * @ param arrays */ @ Override public void collect ( INDArray ... arrays ) { } }
// we basically want to free memory , without touching INDArray itself . // so we don ' t care when gc is going to release object : memory is already cached Nd4j . getExecutioner ( ) . commit ( ) ; int cnt = - 1 ; AtomicAllocator allocator = AtomicAllocator . getInstance ( ) ; for ( INDArray array : arrays ) { cnt ++ ; // we don ' t collect views , since they don ' t have their own memory if ( array == null || array . isView ( ) ) continue ; AllocationPoint point = allocator . getAllocationPoint ( array ) ; if ( point . getAllocationStatus ( ) == AllocationStatus . HOST ) allocator . getMemoryHandler ( ) . free ( point , AllocationStatus . HOST ) ; else if ( point . getAllocationStatus ( ) == AllocationStatus . DEVICE ) { allocator . getMemoryHandler ( ) . free ( point , AllocationStatus . DEVICE ) ; allocator . getMemoryHandler ( ) . free ( point , AllocationStatus . HOST ) ; } else if ( point . getAllocationStatus ( ) == AllocationStatus . DEALLOCATED ) { // do nothing } else throw new RuntimeException ( "Unknown AllocationStatus: " + point . getAllocationStatus ( ) + " for argument: " + cnt ) ; point . setAllocationStatus ( AllocationStatus . DEALLOCATED ) ; }
public class Cache { /** * Special handling for msg . */ private boolean handleMessageMessengerMsg ( Message . MSG message ) { } }
if ( ! message . isMessenger ( ) ) return false ; if ( receiver == null ) return true ; setOwnerClockPut ( message ) ; if ( message . getLine ( ) == - 1 ) { receiver . receive ( message ) ; if ( message . isReplyRequired ( ) ) send ( Message . MSGACK ( message ) ) ; return true ; } CacheLine line = getLine ( message . getLine ( ) ) ; if ( line == null ) { boolean res = handleMessageNoLine ( message ) ; assert res ; return true ; } synchronized ( line ) { if ( handleNotOwner ( message , line ) ) return true ; receiver . receive ( message ) ; } if ( message . isReplyRequired ( ) ) send ( Message . MSGACK ( message ) ) ; return true ;
public class CliState { /** * This method initializes the { @ link BasicDoubleLinkedNode node } { @ link BasicDoubleLinkedNode # getValue ( ) containing } * an { @ link CliArgumentContainer } in order to determine the appropriate order of the { @ link CliArgument } s . * @ param node is the node to initialize ( link into the node - list ) . * @ param argumentMap maps the { @ link CliArgumentContainer # getId ( ) id } to the according argument - node . * @ return a { @ link List } of { @ link CliArgumentContainer # getId ( ) CLI argument IDs } ( in reverse order ) of a cyclic * dependency that was detected , or { @ code null } if the initialization was successful . */ protected List < String > initializeArgumentRecursive ( BasicDoubleLinkedNode < CliArgumentContainer > node , Map < String , BasicDoubleLinkedNode < CliArgumentContainer > > argumentMap ) { } }
CliArgumentContainer argumentContainer = node . getValue ( ) ; InitializationState state = argumentContainer . getState ( ) ; if ( ! state . isInitialized ( ) ) { if ( state . isInitializing ( ) ) { // cycle detected List < String > cycle = new ArrayList < > ( ) ; cycle . add ( argumentContainer . getId ( ) ) ; return cycle ; } else { state . setInitializing ( ) ; } CliArgument cliArgument = argumentContainer . getArgument ( ) ; String nextTo = cliArgument . addCloseTo ( ) ; assert ( ! CliArgument . ID_FIRST . equals ( nextTo ) && ! CliArgument . ID_LAST . equals ( nextTo ) ) ; BasicDoubleLinkedNode < CliArgumentContainer > nextToNode = argumentMap . get ( nextTo ) ; if ( nextToNode == null ) { throw new CliArgumentReferenceMissingException ( argumentContainer ) ; } boolean addAfter = cliArgument . addAfter ( ) ; List < String > cycle = initializeArgumentRecursive ( nextToNode , argumentMap ) ; if ( cycle != null ) { return cycle ; } if ( addAfter ) { nextToNode . insertAsNext ( node ) ; } else { nextToNode . insertAsPrevious ( node ) ; } state . setInitialized ( ) ; } return null ;
public class RPCParameter { /** * Adds ( or removes ) a vector value at the specified subscript . * @ param subscript Subscript specifier * @ param value Value ( if null , any existing value is removed ) . */ public void put ( String subscript , Object value ) { } }
if ( value == null ) { values . remove ( subscript ) ; } else { values . put ( subscript , value ) ; }
public class EditText { /** * Returns the value of the enum { @ link Typeface } , which corresponds to a specific value . * @ param value * The value * @ return The value of the enum { @ link Typeface } , which corresponds to the given value */ private Typeface parseTypeface ( final int value ) { } }
switch ( value ) { case TYPEFACE_SANS_SERIF_VALUE : return Typeface . SANS_SERIF ; case TYPEFACE_SERIF_VALUE : return Typeface . SERIF ; case TYPEFACE_MONOSPACE_VALUE : return Typeface . MONOSPACE ; default : return Typeface . DEFAULT ; }
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertTextOrientationBAxisToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class AbstractSocket { /** * Sets the most recently seen remote address . * If the provided value is different than the previous , will notify all listeners . */ protected void setRemoteSocketAddress ( final SocketAddress newRemoteSocketAddress ) { } }
synchronized ( remoteSocketAddressLock ) { final SocketAddress oldRemoteSocketAddress = this . remoteSocketAddress ; if ( ! newRemoteSocketAddress . equals ( oldRemoteSocketAddress ) ) { this . remoteSocketAddress = newRemoteSocketAddress ; listenerManager . enqueueEvent ( new ConcurrentListenerManager . Event < SocketListener > ( ) { @ Override public Runnable createCall ( final SocketListener listener ) { return new Runnable ( ) { @ Override public void run ( ) { listener . onRemoteSocketAddressChange ( AbstractSocket . this , oldRemoteSocketAddress , newRemoteSocketAddress ) ; } } ; } } ) ; } }
public class VehicleManager { /** * Remove a previously registered source from the data pipeline . */ public void removeSource ( VehicleDataSource source ) { } }
if ( source != null ) { Log . i ( TAG , "Removing data source " + source ) ; mUserOriginPipeline . removeSource ( source ) ; }
public class SFSUtilities { /** * Find the first geometry field name of a resultSet . * Return - 1 if there is no geometry column * @ param resultSet ResultSet to analyse * @ return The name of first geometry field * @ throws SQLException */ public static String getFirstGeometryFieldName ( ResultSet resultSet ) throws SQLException { } }
ResultSetMetaData meta = resultSet . getMetaData ( ) ; int columnCount = meta . getColumnCount ( ) ; for ( int i = 1 ; i <= columnCount ; i ++ ) { if ( meta . getColumnTypeName ( i ) . equalsIgnoreCase ( "geometry" ) ) { return meta . getColumnName ( i ) ; } } throw new SQLException ( "The query doesn't contain any geometry field" ) ;
public class JavaSoundPlayer { /** * = = = = End of public methods = = = = */ @ Override protected void play ( String pkgPath , String key , float pan ) { } }
addToPlayQueue ( new SoundKey ( PLAY , pkgPath , key , 0 , _clipVol , pan ) ) ;
public class SamlAssertionDecoder { /** * { @ inheritDoc } */ protected void doDecode ( MessageContext messageContext ) throws MessageDecodingException { } }
if ( ! ( messageContext instanceof SAMLMessageContext ) ) { log . error ( "Invalid message context type, this decoder only support SAMLMessageContext" ) ; throw new MessageDecodingException ( "Invalid message context type, this decoder only support SAMLMessageContext" ) ; } if ( ! ( messageContext . getInboundMessageTransport ( ) instanceof HTTPInTransport ) ) { log . error ( "Invalid inbound message transport type, this decoder only support HTTPInTransport" ) ; throw new MessageDecodingException ( "Invalid inbound message transport type, this decoder only support HTTPInTransport" ) ; } SAMLMessageContext samlMsgCtx = ( SAMLMessageContext ) messageContext ; HTTPInTransport inTransport = ( HTTPInTransport ) samlMsgCtx . getInboundMessageTransport ( ) ; if ( ! inTransport . getHTTPMethod ( ) . equalsIgnoreCase ( "POST" ) ) { throw new MessageDecodingException ( "This message decoder only supports the HTTP POST method" ) ; } String relayState = inTransport . getParameterValue ( "RelayState" ) ; samlMsgCtx . setRelayState ( relayState ) ; log . debug ( "Decoded SAML relay state of: {}" , relayState ) ; InputStream base64DecodedMessage = getBase64DecodedMessage ( inTransport ) ; Assertion inboundMessage = ( Assertion ) unmarshallMessage ( base64DecodedMessage ) ; Response response = SamlRedirectUtils . wrapAssertionIntoResponse ( inboundMessage , inboundMessage . getIssuer ( ) . getValue ( ) ) ; samlMsgCtx . setInboundMessage ( response ) ; samlMsgCtx . setInboundSAMLMessage ( response ) ; log . debug ( "Decoded SAML message" ) ; populateMessageContext ( samlMsgCtx ) ;
public class RecurringData { /** * Retrieve the ordinal text for a given integer . * @ param value integer value * @ return ordinal text */ private String getOrdinal ( Integer value ) { } }
String result ; int index = value . intValue ( ) ; if ( index >= ORDINAL . length ) { result = "every " + index + "th" ; } else { result = ORDINAL [ index ] ; } return result ;
public class TrafficEstimatorServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
try { if ( com . google . api . ads . adwords . axis . v201809 . o . TrafficEstimatorServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . adwords . axis . v201809 . o . TrafficEstimatorServiceSoapBindingStub _stub = new com . google . api . ads . adwords . axis . v201809 . o . TrafficEstimatorServiceSoapBindingStub ( new java . net . URL ( TrafficEstimatorServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getTrafficEstimatorServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
public class DifferentialFunctionFactory { /** * Max pooling 3d operation . * @ param input the inputs to pooling * @ param pooling3DConfig the configuration * @ return */ public SDVariable maxPooling3d ( SDVariable input , Pooling3DConfig pooling3DConfig ) { } }
pooling3DConfig . setType ( Pooling3D . Pooling3DType . MAX ) ; return pooling3d ( input , pooling3DConfig ) ;
public class InstancesController { /** * Register an instance . * @ param registration registration info * @ param builder UriComponentsBuilder * @ return The registered instance id ; */ @ PostMapping ( path = "/instances" , consumes = MediaType . APPLICATION_JSON_VALUE ) public Mono < ResponseEntity < Map < String , InstanceId > > > register ( @ RequestBody Registration registration , UriComponentsBuilder builder ) { } }
Registration withSource = Registration . copyOf ( registration ) . source ( "http-api" ) . build ( ) ; LOGGER . debug ( "Register instance {}" , withSource ) ; return registry . register ( withSource ) . map ( id -> { URI location = builder . replacePath ( "/instances/{id}" ) . buildAndExpand ( id ) . toUri ( ) ; return ResponseEntity . created ( location ) . body ( Collections . singletonMap ( "id" , id ) ) ; } ) ;
public class CPOptionUtil { /** * Returns the last cp option in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp option , or < code > null < / code > if a matching cp option could not be found */ public static CPOption fetchByUuid_C_Last ( String uuid , long companyId , OrderByComparator < CPOption > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ;
public class Bean { /** * Read the accelerometer range . * @ param callback the callback for the result */ public void readAccelerometerRange ( Callback < AccelerometerRange > callback ) { } }
addCallback ( BeanMessageID . CC_ACCEL_GET_RANGE , callback ) ; sendMessageWithoutPayload ( BeanMessageID . CC_ACCEL_GET_RANGE ) ;
public class AsyncBenchmark { /** * Main routine creates a benchmark instance and kicks off the run method . * @ param args Command line arguments . * @ throws Exception if anything goes wrong . * @ see { @ link VoterConfig } */ public static void main ( String [ ] args ) throws Exception { } }
// create a configuration from the arguments VoterConfig config = new VoterConfig ( ) ; config . parse ( AsyncBenchmark . class . getName ( ) , args ) ; AsyncBenchmark benchmark = new AsyncBenchmark ( config ) ; benchmark . runBenchmark ( ) ;
public class Right { /** * Supports column level rights */ boolean canTrigger ( Table table , boolean [ ] columnCheckList ) { } }
if ( isFull || isFullTrigger ) { return true ; } return containsAllColumns ( triggerColumnSet , table , columnCheckList ) ;
public class RelatedObjectSet { /** * Returns whether the current user has permission to alter the status of * the relation between the parent object and the given child objects . * @ param identifiers * The identifiers of all objects on the child side of the one - to - many * relation being changed . * @ return * true if the user has permission to make the described changes , * false otherwise . * @ throws GuacamoleException * If permission to query permission status is denied . */ private boolean canAlterRelation ( Collection < String > identifiers ) throws GuacamoleException { } }
// System administrators may alter any relations if ( getCurrentUser ( ) . getUser ( ) . isAdministrator ( ) ) return true ; // Non - admin users require UPDATE permission on the parent object . . . if ( ! getParentObjectEffectivePermissionSet ( ) . hasPermission ( ObjectPermission . Type . UPDATE , parent . getIdentifier ( ) ) ) return false ; // . . . as well as UPDATE permission on all child objects being changed Collection < String > accessibleIdentifiers = getChildObjectEffectivePermissionSet ( ) . getAccessibleObjects ( Collections . singleton ( ObjectPermission . Type . UPDATE ) , identifiers ) ; return accessibleIdentifiers . size ( ) == identifiers . size ( ) ;
public class CacheManagementHelper { /** * Call { @ link # clearCache ( String ) } on ALL caches . */ public void clearAllCaches ( ) { } }
logger . warn ( "beginning request to clear all caches" ) ; for ( final String cacheName : this . cacheManager . getCacheNames ( ) ) { clearCache ( cacheName ) ; } logger . warn ( "completed request to clear all caches" ) ;
public class KnowledgeBuilderImpl { /** * This adds a package from a Descr / AST This will also trigger a compile , if * there are any generated classes to compile of course . */ public void addPackage ( final PackageDescr packageDescr ) { } }
PackageRegistry pkgRegistry = getOrCreatePackageRegistry ( packageDescr ) ; if ( pkgRegistry == null ) { return ; } // merge into existing package mergePackage ( pkgRegistry , packageDescr ) ; compileKnowledgePackages ( packageDescr , pkgRegistry ) ; wireAllRules ( ) ; compileRete ( packageDescr ) ;
public class Index { /** * Browse all index content */ public IndexBrowser browse ( Query params ) throws AlgoliaException { } }
return new IndexBrowser ( client , encodedIndexName , params , null , RequestOptions . empty ) ;
public class Command { /** * Finds out if a command is supported by Doradus * @ param commandsJson * @ param commandName * @ param storageService * @ return */ public static JsonObject matchCommand ( JsonObject commandsJson , String commandName , String storageService ) { } }
for ( String key : commandsJson . keySet ( ) ) { if ( key . equals ( storageService ) ) { JsonObject commandCats = commandsJson . getJsonObject ( key ) ; if ( commandCats . containsKey ( commandName ) ) { return commandCats . getJsonObject ( commandName ) ; } } } return null ;
public class State { /** * necessary different ) mode , and then a code . */ State latchAndAppend ( int mode , int value ) { } }
// assert binaryShiftByteCount = = 0; int bitCount = this . bitCount ; Token token = this . token ; if ( mode != this . mode ) { int latch = HighLevelEncoder . LATCH_TABLE [ this . mode ] [ mode ] ; token = token . add ( latch & 0xFFFF , latch >> 16 ) ; bitCount += latch >> 16 ; } int latchModeBitCount = mode == HighLevelEncoder . MODE_DIGIT ? 4 : 5 ; token = token . add ( value , latchModeBitCount ) ; return new State ( token , mode , 0 , bitCount + latchModeBitCount ) ;
public class EmptyOperator { /** * Applies the operator to the given value */ public Object apply ( Object pValue , Object pContext , Logger pLogger ) throws ELException { } }
// See if the value is null if ( pValue == null ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is a zero - length String else if ( "" . equals ( pValue ) ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is a zero - length array else if ( pValue . getClass ( ) . isArray ( ) && Array . getLength ( pValue ) == 0 ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is an empty Collection else if ( pValue instanceof Collection && ( ( Collection ) pValue ) . isEmpty ( ) ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is an empty Map else if ( pValue instanceof Map && ( ( Map ) pValue ) . isEmpty ( ) ) { return PrimitiveObjects . getBoolean ( true ) ; } // Otherwise , not empty else { return PrimitiveObjects . getBoolean ( false ) ; }
public class Beacon { /** * Required for making object Parcelable . If you override this class , you must override this * method if you add any additional fields . */ @ Deprecated public void writeToParcel ( Parcel out , int flags ) { } }
out . writeInt ( mIdentifiers . size ( ) ) ; for ( Identifier identifier : mIdentifiers ) { out . writeString ( identifier == null ? null : identifier . toString ( ) ) ; } out . writeDouble ( getDistance ( ) ) ; out . writeInt ( mRssi ) ; out . writeInt ( mTxPower ) ; out . writeString ( mBluetoothAddress ) ; out . writeInt ( mBeaconTypeCode ) ; out . writeInt ( mServiceUuid ) ; out . writeInt ( mDataFields . size ( ) ) ; for ( Long dataField : mDataFields ) { out . writeLong ( dataField ) ; } out . writeInt ( mExtraDataFields . size ( ) ) ; for ( Long dataField : mExtraDataFields ) { out . writeLong ( dataField ) ; } out . writeInt ( mManufacturer ) ; out . writeString ( mBluetoothName ) ; out . writeString ( mParserIdentifier ) ; out . writeByte ( ( byte ) ( mMultiFrameBeacon ? 1 : 0 ) ) ; out . writeValue ( mRunningAverageRssi ) ; out . writeInt ( mRssiMeasurementCount ) ; out . writeInt ( mPacketCount ) ;
public class ExampleLookupTable { /** * { @ inheritDoc } */ @ Override public List < Object > getTable ( final Object table ) { } }
List < Object > data = new ArrayList < > ( ) ; String tableName ; if ( table instanceof TableWithNullOption ) { // Get source table name tableName = ( ( TableWithNullOption ) table ) . getTableName ( ) ; // Insert null option data . add ( null ) ; } else { tableName = ( String ) table ; } for ( String [ ] row : TABLE_DATA ) { if ( row [ 0 ] . equals ( tableName ) ) { data . add ( new TableEntry ( row [ 1 ] , row [ 2 ] ) ) ; } } return data ;
public class RiakClient { /** * Static factory method to create a new client instance . * @ since 2.0.6 */ public static RiakClient newClient ( Collection < HostAndPort > hosts , RiakNode . Builder nodeBuilder ) throws UnknownHostException { } }
final RiakCluster cluster = new RiakCluster . Builder ( hosts , nodeBuilder ) . build ( ) ; cluster . start ( ) ; return new RiakClient ( cluster ) ;
public class WebJsMessageFactoryImpl { /** * Decode a map message */ private static JsJmsMessage decodeMapBody ( String body ) throws MessageDecodeFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "decodeMapBody" ) ; JsJmsMapMessage result = new JsJmsMapMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; if ( body != null ) { try { StringTokenizer st = new StringTokenizer ( body , "&" ) ; while ( st . hasMoreTokens ( ) ) { Object [ ] pair = decodePair ( st . nextToken ( ) ) ; result . setObject ( ( String ) pair [ 0 ] , pair [ 1 ] ) ; } } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.WebJsJmsMessageFactoryImpl.decodeMapBody" , "218" ) ; // This can ' t happen , as the Exception can only be thrown for an MQ message // which isn ' t what we have . } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "decodeMapBody" ) ; return result ;
public class LazySetterMethod { /** * Invokes the getter / setter chain based on the source object . First of all * the actual arguments are determined by invoking LazyGetterMethod objects * that have been passed during construction . Then the getter chain is * invoked to determine the actual object on which to invoke the setter . * Finally the setter is invoked with the actual arguments * Example of how the chaining works : * < code > * class A { * private B b ; * public A ( B b ) { * this . b = b ; * public B getB ( ) { * return b ; * class B { * private String s ; * public B ( String s ) { * this . s = s ; * public void setS ( String s ) { * this . s = s ; * < / code > * < code > * new LazySetterMethod ( new A ( new B ( " " ) ) , " b . s " , " value " ) . invoke ( ) * < / code > * is equal to * < code > * new A ( new B ( " " ) ) . getB ( ) . setS ( " test " ) ; * < / code > * and * < code > * new LazySetterMethod ( new A ( new B ( " " ) ) , " b . s " , new LazyGetterMethod ( new B ( " lazyValue " ) , " s " ) . invoke ( ) * < / code > * is equal to * < code > * new A ( new B ( " " ) ) . getB ( ) . setS ( new B ( " lazyValue " ) . getS ( ) ) ; * < / code > * @ throws InvocationTargetException # { @ link Method # invoke ( java . lang . Object , java . lang . Object [ ] ) } * @ throws IllegalAccessException # { @ link Method # invoke ( java . lang . Object , java . lang . Object [ ] ) } */ public void invoke ( ) throws InvocationTargetException , IllegalAccessException { } }
Object valueToPass = value ; if ( valueToPass != null && valueToPass instanceof LazyGetterMethod ) { valueToPass = ( ( LazyGetterMethod ) valueToPass ) . invoke ( ) ; } expression . setValue ( target , valueToPass ) ;
public class A_CmsAjaxGallery { /** * Creates a JSON object with the information found on the given gallery URL . < p > * @ param galleryUrl the given gallery URL */ protected void buildJsonGalleryItem ( String galleryUrl ) { } }
try { JspWriter out = getJsp ( ) . getJspContext ( ) . getOut ( ) ; if ( getCms ( ) . existsResource ( galleryUrl ) ) { JSONObject jsonObj = new JSONObject ( ) ; try { CmsResource res = getCms ( ) . readResource ( galleryUrl ) ; String path = getCms ( ) . getSitePath ( res ) ; // read the gallery title String title = getCms ( ) . readPropertyObject ( res , CmsPropertyDefinition . PROPERTY_TITLE , false ) . getValue ( "" ) ; try { // 1 : gallery title jsonObj . put ( "title" , title ) ; // 2 : gallery path jsonObj . put ( "path" , path ) ; // 3 : active flag jsonObj . put ( "active" , true ) ; out . print ( jsonObj ) ; } catch ( JSONException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } } catch ( CmsException e ) { // error reading title property if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } } else { out . print ( RETURNVALUE_NONE ) ; } } catch ( IOException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } }
public class CloudwatchLogsExportConfiguration { /** * The list of log types to disable . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDisableLogTypes ( java . util . Collection ) } or { @ link # withDisableLogTypes ( java . util . Collection ) } if you * want to override the existing values . * @ param disableLogTypes * The list of log types to disable . * @ return Returns a reference to this object so that method calls can be chained together . */ public CloudwatchLogsExportConfiguration withDisableLogTypes ( String ... disableLogTypes ) { } }
if ( this . disableLogTypes == null ) { setDisableLogTypes ( new com . amazonaws . internal . SdkInternalList < String > ( disableLogTypes . length ) ) ; } for ( String ele : disableLogTypes ) { this . disableLogTypes . add ( ele ) ; } return this ;
public class RowSetUtil { /** * Splits the provided { @ link RowSet } into segments partitioned by the provided { @ code * splitPoints } . Each split point represents the last row of the corresponding segment . The row * keys contained in the provided { @ link RowSet } will be distributed across the segments . Each * range in the { @ link RowSet } will be split up across each segment . * @ see # split ( RowSet , SortedSet , boolean ) for more details . */ @ Nonnull public static List < RowSet > shard ( @ Nonnull RowSet rowSet , @ Nonnull SortedSet < ByteString > splitPoints ) { } }
return split ( rowSet , splitPoints , false ) ;
public class MESubscription { /** * Gets the object that was stored in the Matchspace * @ return */ public ControllableProxySubscription getMatchspaceSub ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMatchspaceSub" ) ; SibTr . exit ( tc , "getMatchspaceSub" , _controllableProxySubscription ) ; } return _controllableProxySubscription ;
public class UTF8String { /** * Concatenates input strings together into a single string using the separator . * A null input is skipped . For example , concat ( " , " , " a " , null , " c " ) would yield " a , c " . */ public static UTF8String concatWs ( UTF8String separator , UTF8String ... inputs ) { } }
if ( separator == null ) { return null ; } int numInputBytes = 0 ; // total number of bytes from the inputs int numInputs = 0 ; // number of non - null inputs for ( int i = 0 ; i < inputs . length ; i ++ ) { if ( inputs [ i ] != null ) { numInputBytes += inputs [ i ] . numBytes ; numInputs ++ ; } } if ( numInputs == 0 ) { // Return an empty string if there is no input , or all the inputs are null . return EMPTY_UTF8 ; } // Allocate a new byte array , and copy the inputs one by one into it . // The size of the new array is the size of all inputs , plus the separators . final byte [ ] result = new byte [ numInputBytes + ( numInputs - 1 ) * separator . numBytes ] ; int offset = 0 ; for ( int i = 0 , j = 0 ; i < inputs . length ; i ++ ) { if ( inputs [ i ] != null ) { int len = inputs [ i ] . numBytes ; copyMemory ( inputs [ i ] . base , inputs [ i ] . offset , result , BYTE_ARRAY_OFFSET + offset , len ) ; offset += len ; j ++ ; // Add separator if this is not the last input . if ( j < numInputs ) { copyMemory ( separator . base , separator . offset , result , BYTE_ARRAY_OFFSET + offset , separator . numBytes ) ; offset += separator . numBytes ; } } } return fromBytes ( result ) ;