signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RunnerBuilder { /** * Always returns a runner for the given test class . * < p > In case of an exception a runner will be returned that prints an error instead of running * tests . * < p > Note that some of the internal JUnit implementations of RunnerBuilder will return * { @ code null } from this method , but no RunnerBuilder passed to a Runner constructor will * return { @ code null } from this method . * @ param testClass class to be run * @ return a Runner */ public Runner safeRunnerForClass ( Class < ? > testClass ) { } }
try { Runner runner = runnerForClass ( testClass ) ; if ( runner != null ) { configureRunner ( runner ) ; } return runner ; } catch ( Throwable e ) { return new ErrorReportingRunner ( testClass , e ) ; }
public class XMLResourceBundle { /** * Return a message value with the supplied values integrated into it . * @ param aMessage A message in which to include the supplied string values * @ param aArray The string values to insert into the supplied message * @ return A message with the supplied values integrated into it */ public String get ( final String aMessage , final String ... aArray ) { } }
return StringUtils . format ( super . getString ( aMessage ) , aArray ) ;
public class ResponseMessage { /** * Initialize this response message with the input connection . * @ param conn * @ param req */ public void init ( HttpInboundConnection conn , RequestMessage req ) { } }
this . request = req ; this . response = conn . getResponse ( ) ; this . connection = conn ; this . outStream = new ResponseBody ( this . response . getBody ( ) ) ; this . locale = Locale . getDefault ( ) ;
public class InjectorImpl { /** * Create a program for method arguments . */ @ Override public Provider < ? > [ ] program ( Parameter [ ] params ) { } }
Provider < ? > [ ] program = new Provider < ? > [ params . length ] ; for ( int i = 0 ; i < program . length ; i ++ ) { // Key < ? > key = Key . of ( params [ i ] ) ; program [ i ] = provider ( InjectionPoint . of ( params [ i ] ) ) ; } return program ;
public class StringFunctions { /** * Returned expression results in the string with all leading and trailing chars removed * ( any char in the characters string ) . */ public static Expression trim ( Expression expression , String characters ) { } }
return x ( "TRIM(" + expression . toString ( ) + ", \"" + characters + "\")" ) ;
public class SQLiteModelMethod { /** * ( non - Javadoc ) * @ see com . abubusoft . kripton . processor . sqlite . grammars . jql . JQLContext # * getContextDescription ( ) */ @ Override public String getContextDescription ( ) { } }
String msg = String . format ( "In method '%s.%s'" , getParent ( ) . getElement ( ) . getSimpleName ( ) . toString ( ) , getElement ( ) . getSimpleName ( ) . toString ( ) ) ; return msg ;
public class ExclusionRandomizerRegistry { /** * { @ inheritDoc } */ @ Override public void init ( EasyRandomParameters parameters ) { } }
fieldPredicates . add ( FieldPredicates . isAnnotatedWith ( Exclude . class ) ) ; typePredicates . add ( TypePredicates . isAnnotatedWith ( Exclude . class ) ) ;
public class WebhookMessage { /** * Creates a new WebhookMessage instance with the provided { @ link net . dv8tion . jda . core . entities . Message Message } * as layout for copying . * < br > < b > This does not copy the attachments of the provided message ! < / b > * @ param message * The message to copy * @ throws java . lang . IllegalArgumentException * If the provided message is { @ code null } * @ return The resulting WebhookMessage instance */ public static WebhookMessage from ( Message message ) { } }
Checks . notNull ( message , "Message" ) ; final String content = message . getContentRaw ( ) ; final List < MessageEmbed > embeds = message . getEmbeds ( ) ; final boolean isTTS = message . isTTS ( ) ; return new WebhookMessage ( null , null , content , embeds , isTTS , null ) ;
public class InternalXtextParser { /** * InternalXtext . g : 2231:1 : entryRulePredicatedRuleCall returns [ EObject current = null ] : iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF ; */ public final EObject entryRulePredicatedRuleCall ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_rulePredicatedRuleCall = null ; try { // InternalXtext . g : 2231:59 : ( iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF ) // InternalXtext . g : 2232:2 : iv _ rulePredicatedRuleCall = rulePredicatedRuleCall EOF { newCompositeNode ( grammarAccess . getPredicatedRuleCallRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; iv_rulePredicatedRuleCall = rulePredicatedRuleCall ( ) ; state . _fsp -- ; current = iv_rulePredicatedRuleCall ; match ( input , EOF , FollowSets000 . FOLLOW_2 ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class BugsnagAppender { /** * Calculates the severity based on the logging event * @ param event the event * @ return The Bugsnag severity */ private Severity calculateSeverity ( ILoggingEvent event ) { } }
if ( event . getLevel ( ) . equals ( Level . ERROR ) ) { return Severity . ERROR ; } else if ( event . getLevel ( ) . equals ( Level . WARN ) ) { return Severity . WARNING ; } return Severity . INFO ;
public class Geometry { /** * Create geometry . * @ param geometryType * geometry type * @ param srid * srid * @ param precision * precision */ @ ExportConstructor public static org . geomajas . geometry . Geometry constructor ( String geometryType , int srid , int precision ) { } }
return new org . geomajas . geometry . Geometry ( geometryType , srid , precision ) ;
public class ExcelItemReader { /** * readTitle . * @ return an array of { @ link java . lang . String } objects . */ public String [ ] readTitle ( ) { } }
if ( workbook . getNumberOfSheets ( ) < 1 ) { return new String [ 0 ] ; } else { HSSFSheet sheet = workbook . getSheetAt ( 0 ) ; String [ ] attrs = readComments ( sheet , headIndex ) ; attrCount = attrs . length ; return attrs ; }
public class A_CmsSelectBox { /** * Positions the select popup . < p > */ void positionPopup ( ) { } }
if ( m_popup . isShowing ( ) ) { int width = m_popup . getOffsetWidth ( ) ; int openerHeight = CmsDomUtil . getCurrentStyleInt ( m_opener . getElement ( ) , CmsDomUtil . Style . height ) ; int popupHeight = getPopupHeight ( ) ; int dx = 0 ; if ( width > ( m_opener . getOffsetWidth ( ) ) ) { int spaceOnTheRight = ( Window . getClientWidth ( ) + Window . getScrollLeft ( ) ) - m_opener . getAbsoluteLeft ( ) - width ; dx = spaceOnTheRight < 0 ? spaceOnTheRight : 0 ; } // Calculate top position for the popup int top = m_opener . getAbsoluteTop ( ) ; // Make sure scrolling is taken into account , since // box . getAbsoluteTop ( ) takes scrolling into account . int windowTop = Window . getScrollTop ( ) ; int windowBottom = Window . getScrollTop ( ) + Window . getClientHeight ( ) ; // Distance from the top edge of the window to the top edge of the // text box int distanceFromWindowTop = top - windowTop ; // Distance from the bottom edge of the window to the bottom edge of // the text box int distanceToWindowBottom = windowBottom - ( top + m_opener . getOffsetHeight ( ) ) ; boolean displayAbove = displayingAbove ( ) ; // in case there is not enough space , add a scroll panel to the selector popup if ( ( displayAbove && ( distanceFromWindowTop < popupHeight ) ) || ( ! displayAbove && ( distanceToWindowBottom < popupHeight ) ) ) { setScrollingSelector ( ( displayAbove ? distanceFromWindowTop : distanceToWindowBottom ) - 10 ) ; popupHeight = m_popup . getOffsetHeight ( ) ; } if ( displayAbove ) { // Position above the text box CmsDomUtil . positionElement ( m_popup . getElement ( ) , m_panel . getElement ( ) , dx , - ( popupHeight - 2 ) ) ; m_selectBoxState . setValue ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . cornerBottom ( ) ) ; m_selectorState . setValue ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . cornerTop ( ) ) ; } else { CmsDomUtil . positionElement ( m_popup . getElement ( ) , m_panel . getElement ( ) , dx , openerHeight - 1 ) ; m_selectBoxState . setValue ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . cornerTop ( ) ) ; m_selectorState . setValue ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . cornerBottom ( ) ) ; } }
public class GifHeaderParser { /** * Reads GIF file header information . */ private void readHeader ( ) { } }
String id = "" ; for ( int i = 0 ; i < 6 ; i ++ ) { id += ( char ) read ( ) ; } if ( ! id . startsWith ( "GIF" ) ) { header . status = GifDecoder . STATUS_FORMAT_ERROR ; return ; } readLSD ( ) ; if ( header . gctFlag && ! err ( ) ) { header . gct = readColorTable ( header . gctSize ) ; header . bgColor = header . gct [ header . bgIndex ] ; }
public class URLConnection { /** * Return the key for the nth header field . Returns null if * there are fewer than n fields . This can be used to iterate * through all the headers in the message . */ public String getHeaderFieldKey ( int n ) { } }
try { getInputStream ( ) ; } catch ( Exception e ) { return null ; } MessageHeader props = properties ; return props == null ? null : props . getKey ( n ) ;
public class AmazonWebServiceClient { /** * Convenient method to end the client execution without logging the * awsRequestMetrics . */ protected final void endClientExecution ( AWSRequestMetrics awsRequestMetrics , Request < ? > request , Response < ? > response ) { } }
this . endClientExecution ( awsRequestMetrics , request , response , ! LOGGING_AWS_REQUEST_METRIC ) ;
public class URLNormalizer { /** * < p > Removes a URL - based session id . It removes PHP ( PHPSESSID ) , * ASP ( ASPSESSIONID ) , and Java EE ( jsessionid ) session ids . < / p > * < code > http : / / www . example . com / servlet ; jsessionid = 1E6FEC0D14D044541DD84D2D013D29ED ? a = b * & rarr ; http : / / www . example . com / servlet ? a = b < / code > * < p > < b > Please Note : < / b > Removing session IDs from URLs is often * a good way to have the URL return an error once invoked . < / p > * @ return this instance */ public URLNormalizer removeSessionIds ( ) { } }
if ( StringUtils . containsIgnoreCase ( url , ";jsessionid=" ) ) { url = url . replaceFirst ( "(;jsessionid=([A-F0-9]+)((\\.\\w+)*))" , "" ) ; } else { String u = StringUtils . substringBefore ( url , "?" ) ; String q = StringUtils . substringAfter ( url , "?" ) ; if ( StringUtils . containsIgnoreCase ( url , "PHPSESSID=" ) ) { q = q . replaceFirst ( "(&|^)(PHPSESSID=[0-9a-zA-Z]*)" , "" ) ; } else if ( StringUtils . containsIgnoreCase ( url , "ASPSESSIONID" ) ) { q = q . replaceFirst ( "(&|^)(ASPSESSIONID[a-zA-Z]{8}=[a-zA-Z]*)" , "" ) ; } if ( ! StringUtils . isBlank ( q ) ) { u += "?" + StringUtils . removeStart ( q , "&" ) ; } url = u ; } return this ;
public class Sample { /** * Return the index of the next free { @ code double } < i > slot < / i > . If all * < i > slots < / i > are occupied , { @ code - 1 } is returned . * @ return the index of the next free { @ code double } < i > slot < / i > , or * { @ code - 1 } if all < i > slots < / i > are occupied */ public int nextIndex ( ) { } }
int index = - 1 ; for ( int i = 0 ; i < _values . length && index == - 1 ; ++ i ) { if ( Double . isNaN ( _values [ i ] ) ) { index = i ; } } return index ;
public class SimpleWorkQueue { /** * Clean - up the worker thread when all the tasks are done */ private void doInterruptAllWaitingThreads ( ) { } }
// Interrupt all the threads for ( int i = 0 ; i < nThreads ; i ++ ) { threads [ i ] . interrupt ( ) ; } synchronized ( lock ) { lock . notify ( ) ; }
public class ReflectionUtils { /** * Get all inner classes and interfaces declared by the given class . * @ param clazz Class to reflect inner classes from . * @ return An { @ code Array } of inner classes and interfaces declared by the given class . * @ throws RuntimeException If any error occurs . */ public static Class < ? > [ ] getDeclaredClasses ( Class < ? > clazz ) { } }
assertReflectionAccessor ( ) ; try { return accessor . getDeclaredClasses ( clazz ) ; } catch ( Exception e ) { throw SneakyException . sneakyThrow ( e ) ; }
public class MetaMethod { /** * Returns the signature of this method * @ return The signature of this method */ public synchronized String getSignature ( ) { } }
if ( signature == null ) { CachedClass [ ] parameters = getParameterTypes ( ) ; final String name = getName ( ) ; StringBuilder buf = new StringBuilder ( name . length ( ) + parameters . length * 10 ) ; buf . append ( getReturnType ( ) . getName ( ) ) ; buf . append ( ' ' ) ; buf . append ( name ) ; buf . append ( '(' ) ; for ( int i = 0 ; i < parameters . length ; i ++ ) { if ( i > 0 ) { buf . append ( ", " ) ; } buf . append ( parameters [ i ] . getName ( ) ) ; } buf . append ( ')' ) ; signature = buf . toString ( ) ; } return signature ;
public class Proto { /** * Returns the package name that was configured in the proto . Note that { @ link # getPackageName ( ) } will have the same * value as this , if the compiler options did not have entries that override it . */ public String getOriginalPackageName ( ) { } }
if ( packageName == null ) return null ; String original = packageName . getLast ( ) ; return original != null ? original : packageName . getValue ( ) ;
public class Matrix3f { /** * Apply a model transformation to this matrix for a right - handed coordinate system , * that aligns the local < code > + Z < / code > axis with < code > direction < / code > * and store the result in < code > dest < / code > . * If < code > M < / code > is < code > this < / code > matrix and < code > L < / code > the lookat matrix , * then the new matrix will be < code > M * L < / code > . So when transforming a * vector < code > v < / code > with the new matrix by using < code > M * L * v < / code > , * the lookat transformation will be applied first ! * In order to set the matrix to a rotation transformation without post - multiplying it , * use { @ link # rotationTowards ( Vector3fc , Vector3fc ) rotationTowards ( ) } . * This method is equivalent to calling : < code > mul ( new Matrix3f ( ) . lookAlong ( new Vector3f ( dir ) . negate ( ) , up ) . invert ( ) , dest ) < / code > * @ see # rotateTowards ( float , float , float , float , float , float , Matrix3f ) * @ see # rotationTowards ( Vector3fc , Vector3fc ) * @ param direction * the direction to rotate towards * @ param up * the model ' s up vector * @ param dest * will hold the result * @ return dest */ public Matrix3f rotateTowards ( Vector3fc direction , Vector3fc up , Matrix3f dest ) { } }
return rotateTowards ( direction . x ( ) , direction . y ( ) , direction . z ( ) , up . x ( ) , up . y ( ) , up . z ( ) , dest ) ;
public class GetFaceDetectionResult { /** * An array of faces detected in the video . Each element contains a detected face ' s details and the time , in * milliseconds from the start of the video , the face was detected . * @ param faces * An array of faces detected in the video . Each element contains a detected face ' s details and the time , in * milliseconds from the start of the video , the face was detected . */ public void setFaces ( java . util . Collection < FaceDetection > faces ) { } }
if ( faces == null ) { this . faces = null ; return ; } this . faces = new java . util . ArrayList < FaceDetection > ( faces ) ;
public class CoreRemoteMongoCollectionImpl { /** * Update all documents in the collection according to the specified arguments . * @ param filter a document describing the query filter , which may not be null . * @ param update a document describing the update , which may not be null . The update to * apply must include only update operators . * @ param updateOptions the options to apply to the update operation * @ return the result of the update many operation */ public RemoteUpdateResult updateMany ( final Bson filter , final Bson update , final RemoteUpdateOptions updateOptions ) { } }
return executeUpdate ( filter , update , updateOptions , true ) ;
public class Classfile { /** * Get a field constant from the constant pool . * @ param tag * the tag * @ param fieldTypeDescriptorFirstChar * the first char of the field type descriptor * @ param cpIdx * the constant pool index * @ return the field constant pool value * @ throws ClassfileFormatException * If a problem occurs . * @ throws IOException * If an IO exception occurs . */ private Object getFieldConstantPoolValue ( final int tag , final char fieldTypeDescriptorFirstChar , final int cpIdx ) throws ClassfileFormatException , IOException { } }
switch ( tag ) { case 1 : // Modified UTF8 case 7 : // Class - - N . B . Unused ? Class references do not seem to actually be stored as constant initalizers case 8 : // String // Forward or backward indirect reference to a modified UTF8 entry return getConstantPoolString ( cpIdx ) ; case 3 : // int , short , char , byte , boolean are all represented by Constant _ INTEGER final int intVal = cpReadInt ( cpIdx ) ; switch ( fieldTypeDescriptorFirstChar ) { case 'I' : return intVal ; case 'S' : return ( short ) intVal ; case 'C' : return ( char ) intVal ; case 'B' : return ( byte ) intVal ; case 'Z' : return intVal != 0 ; default : // Fall through } throw new ClassfileFormatException ( "Unknown Constant_INTEGER type " + fieldTypeDescriptorFirstChar + ", " + "cannot continue reading class. Please report this at " + "https://github.com/classgraph/classgraph/issues" ) ; case 4 : // float return Float . intBitsToFloat ( cpReadInt ( cpIdx ) ) ; case 5 : // long return cpReadLong ( cpIdx ) ; case 6 : // double return Double . longBitsToDouble ( cpReadLong ( cpIdx ) ) ; default : // ClassGraph doesn ' t expect other types // ( N . B . in particular , enum values are not stored in the constant pool , so don ' t need to be handled ) throw new ClassfileFormatException ( "Unknown constant pool tag " + tag + ", " + "cannot continue reading class. Please report this at " + "https://github.com/classgraph/classgraph/issues" ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcEnergyConversionDeviceType ( ) { } }
if ( ifcEnergyConversionDeviceTypeEClass == null ) { ifcEnergyConversionDeviceTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 232 ) ; } return ifcEnergyConversionDeviceTypeEClass ;
public class RemoteDatastoreEntityManager { /** * Initializes all relation properties of the given node state with empty * collections . * @ param types * The types . * @ param nodeState * The state of the entity . */ private void initializeEntity ( Collection < ? extends TypeMetadata > types , NodeState nodeState ) { } }
for ( TypeMetadata type : types ) { Collection < TypeMetadata > superTypes = type . getSuperTypes ( ) ; initializeEntity ( superTypes , nodeState ) ; for ( MethodMetadata < ? , ? > methodMetadata : type . getProperties ( ) ) { if ( methodMetadata instanceof AbstractRelationPropertyMethodMetadata ) { AbstractRelationPropertyMethodMetadata < ? > relationPropertyMethodMetadata = ( AbstractRelationPropertyMethodMetadata ) methodMetadata ; RelationTypeMetadata < RelationshipMetadata < RemoteRelationshipType > > relationshipMetadata = relationPropertyMethodMetadata . getRelationshipMetadata ( ) ; RemoteRelationshipType relationshipType = relationshipMetadata . getDatastoreMetadata ( ) . getDiscriminator ( ) ; RelationTypeMetadata . Direction direction = relationPropertyMethodMetadata . getDirection ( ) ; RemoteDirection remoteDirection ; switch ( direction ) { case FROM : remoteDirection = RemoteDirection . OUTGOING ; break ; case TO : remoteDirection = RemoteDirection . INCOMING ; break ; default : throw new XOException ( "Unsupported direction: " + direction ) ; } if ( nodeState . getRelationships ( remoteDirection , relationshipType ) == null ) { nodeState . setRelationships ( remoteDirection , relationshipType , new StateTracker < > ( new LinkedHashSet < > ( ) ) ) ; } } } }
public class JQMColumnToggle { /** * Swatch header color " ui - bar - " + value will be used */ public void setHeaderTheme ( String value ) { } }
headerTheme = value ; ComplexPanel r = findHeadRow ( ) ; if ( r != null ) setEltHeaderTheme ( r . getElement ( ) , value ) ; r = findHeadGroupsRow ( ) ; if ( r != null ) setEltHeaderTheme ( r . getElement ( ) , value ) ;
public class TokenExpression { /** * This method will cast { @ code Set < ? > } to { @ code List < T > } * assuming { @ code ? } is castable to { @ code T } . * @ param < T > the generic type * @ param list a { @ code List } object * @ return a casted { @ code List } object */ @ SuppressWarnings ( "unchecked" ) private static < T > List < T > cast ( List < ? > list ) { } }
return ( List < T > ) list ;
public class ConverterHelper { /** * Find one field in a list of fields . * @ param domainFields list of fields in domain object * @ param fieldName field to search * @ param path list of intermediate fields for transitive fields * @ param type type of object to find fields in * @ param readOnlyField is the requested field read only * @ return field with requested name or null when not found * @ throws JTransfoException cannot find fields */ SyntheticField [ ] findField ( List < SyntheticField > domainFields , String fieldName , String [ ] path , Class < ? > type , boolean readOnlyField ) throws JTransfoException { } }
List < SyntheticField > fields = domainFields ; SyntheticField [ ] result = new SyntheticField [ path . length + 1 ] ; int index = 0 ; Class < ? > currentType = type ; for ( ; index < path . length ; index ++ ) { boolean found = false ; for ( SyntheticField field : fields ) { if ( field . getName ( ) . equals ( path [ index ] ) ) { found = true ; result [ index ] = field ; break ; } } if ( ! found ) { result [ index ] = new AccessorSyntheticField ( reflectionHelper , currentType , path [ index ] , readOnlyField ) ; } currentType = result [ index ] . getType ( ) ; fields = reflectionHelper . getSyntheticFields ( currentType ) ; } for ( SyntheticField field : fields ) { if ( field . getName ( ) . equals ( fieldName ) ) { result [ index ] = field ; return result ; } } result [ index ] = new AccessorSyntheticField ( reflectionHelper , currentType , fieldName , readOnlyField ) ; return result ;
public class QueueFile { /** * If necessary , expands the file to accommodate an additional element of the given length . * @ param dataLength length of data being added */ private void expandIfNecessary ( long dataLength ) throws IOException { } }
long elementLength = Element . HEADER_LENGTH + dataLength ; long remainingBytes = remainingBytes ( ) ; if ( remainingBytes >= elementLength ) return ; // Expand . long previousLength = fileLength ; long newLength ; // Double the length until we can fit the new data . do { remainingBytes += previousLength ; newLength = previousLength << 1 ; previousLength = newLength ; } while ( remainingBytes < elementLength ) ; setLength ( newLength ) ; // Calculate the position of the tail end of the data in the ring buffer long endOfLastElement = wrapPosition ( last . position + Element . HEADER_LENGTH + last . length ) ; long count = 0 ; // If the buffer is split , we need to make it contiguous if ( endOfLastElement <= first . position ) { FileChannel channel = raf . getChannel ( ) ; channel . position ( fileLength ) ; // destination position count = endOfLastElement - headerLength ; if ( channel . transferTo ( headerLength , count , channel ) != count ) { throw new AssertionError ( "Copied insufficient number of bytes!" ) ; } } // Commit the expansion . if ( last . position < first . position ) { long newLastPosition = fileLength + last . position - headerLength ; writeHeader ( newLength , elementCount , first . position , newLastPosition ) ; last = new Element ( newLastPosition , last . length ) ; } else { writeHeader ( newLength , elementCount , first . position , last . position ) ; } fileLength = newLength ; if ( zero ) { ringErase ( headerLength , count ) ; }
public class LocalityPreservingProjection { /** * Invokes Octave to run the LPP script */ private static void invokeOctave ( File dataMatrixFile , File affMatrixFile , int dimensions , File outputFile ) throws IOException { } }
// Create the octave file for executing File octaveFile = File . createTempFile ( "octave-LPP" , ".m" ) ; // Create the Matlab - specified output code for the saving the matrix String outputStr = "save(\"-ascii\", \"" + outputFile . getAbsolutePath ( ) + "\", \"projection\");\n" ; String octaveProgram = null ; try { // Fill in the Matlab - specific I / O octaveProgram = String . format ( SR_LPP_M , dataMatrixFile . getAbsolutePath ( ) , affMatrixFile . getAbsolutePath ( ) , dimensions , outputStr ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; } PrintWriter pw = new PrintWriter ( octaveFile ) ; pw . println ( octaveProgram ) ; pw . close ( ) ; // build a command line where octave executes the previously constructed // file String commandLine = "octave " + octaveFile . getAbsolutePath ( ) ; LOGGER . fine ( commandLine ) ; Process octave = Runtime . getRuntime ( ) . exec ( commandLine ) ; BufferedReader stdout = new BufferedReader ( new InputStreamReader ( octave . getInputStream ( ) ) ) ; BufferedReader stderr = new BufferedReader ( new InputStreamReader ( octave . getErrorStream ( ) ) ) ; // Capture the output for logging StringBuilder output = new StringBuilder ( "Octave LPP output:\n" ) ; for ( String line = null ; ( line = stdout . readLine ( ) ) != null ; ) { output . append ( line ) . append ( "\n" ) ; } LOGGER . fine ( output . toString ( ) ) ; int exitStatus = - 1 ; try { exitStatus = octave . waitFor ( ) ; } catch ( InterruptedException ie ) { throw new Error ( ie ) ; } LOGGER . fine ( "Octave LPP exit status: " + exitStatus ) ; // If Octave wasn ' t successful , throw an exception with the output if ( exitStatus != 0 ) { StringBuilder sb = new StringBuilder ( ) ; for ( String line = null ; ( line = stderr . readLine ( ) ) != null ; ) { sb . append ( line ) . append ( "\n" ) ; } throw new IllegalStateException ( "Octave LPP did not finish normally: " + sb ) ; }
public class ParametersFactory { /** * StartMain passes in the command line args here . * @ param args The command line arguments . If null is given then an empty * array will be used instead . */ public void setArgs ( String [ ] args ) { } }
if ( args == null ) { args = new String [ ] { } ; } this . args = args ; this . argsList = Collections . unmodifiableList ( new ArrayList < String > ( Arrays . asList ( args ) ) ) ;
public class TraceNLS { /** * Retrieve the localized text corresponding to the specified key from the * ResourceBundle that this instance wrappers . If the text cannot be found * for any reason , an appropriate error message is returned instead . * @ param key * the key to use in the ResourceBundle lookup . Null is * tolerated . * @ return the appropriate non - null message . */ public String getString ( String key ) { } }
return resolver . getMessage ( caller , null , ivBundleName , key , null , null , false , null , false ) ;
public class DirectClient { /** * If there is a job with an updated { @ link DirectJobStatus status } , the returned object contains * necessary information to act on the status change . The returned object can be queried using * { @ link DirectJobStatusResponse # is ( DirectJobStatus ) . is ( } { @ link DirectJobStatus # NO _ CHANGES NO _ CHANGES ) } * to determine if there has been a status change . When processing of the status change is complete , ( e . g . retrieving * { @ link # getPAdES ( PAdESReference ) PAdES } and / or { @ link # getXAdES ( XAdESReference ) XAdES } documents for a * { @ link DirectJobStatus # COMPLETED _ SUCCESSFULLY completed } job where all signers have { @ link SignerStatus # SIGNED signed } their documents , * the returned status must be { @ link # confirm ( DirectJobStatusResponse ) confirmed } . * Only jobs with { @ link DirectJob . Builder # retrieveStatusBy ( StatusRetrievalMethod ) status retrieval method } set * to { @ link StatusRetrievalMethod # POLLING POLLING } will be returned . * @ return the changed status for a job , or an instance indicating { @ link DirectJobStatus # NO _ CHANGES no changes } , * never { @ code null } . */ public DirectJobStatusResponse getStatusChange ( Sender sender ) { } }
JobStatusResponse < XMLDirectSignatureJobStatusResponse > statusChangeResponse = client . getDirectStatusChange ( Optional . ofNullable ( sender ) ) ; if ( statusChangeResponse . gotStatusChange ( ) ) { return fromJaxb ( statusChangeResponse . getStatusResponse ( ) , statusChangeResponse . getNextPermittedPollTime ( ) ) ; } else { return noUpdatedStatus ( statusChangeResponse . getNextPermittedPollTime ( ) ) ; }
public class AbstractJcrNode { /** * Removes an existing property with the supplied name . Note that if a property with the given name does not exist , then this * method returns null and does not throw an exception . * @ param name the name of the property ; may not be null * @ return the property that was removed * @ throws VersionException if the node is checked out * @ throws LockException if the node is locked * @ throws RepositoryException if some other error occurred */ final AbstractJcrProperty removeExistingProperty ( Name name ) throws VersionException , LockException , RepositoryException { } }
AbstractJcrProperty existing = getProperty ( name ) ; if ( existing != null ) { existing . remove ( ) ; return existing ; } // Return without throwing an exception to match behavior of the reference implementation . // This is also in conformance with the spec . See MODE - 956 for details . return null ;
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query . * @ param dynamicQuery the dynamic query * @ param projection the projection to apply to the query * @ return the number of rows matching the dynamic query */ @ Override public long dynamicQueryCount ( DynamicQuery dynamicQuery , Projection projection ) { } }
return cpAttachmentFileEntryPersistence . countWithDynamicQuery ( dynamicQuery , projection ) ;
public class CollectUtils { /** * newLinkedHashMap . * @ param size a int . * @ param < K > a K object . * @ param < V > a V object . * @ return a { @ link java . util . Map } object . */ public static < K , V > Map < K , V > newLinkedHashMap ( int size ) { } }
return new LinkedHashMap < K , V > ( size ) ;
public class SymmetryTools { /** * Converts a self alignment into a directed jGraphT of aligned residues , * where each vertex is a residue and each edge means the equivalence * between the two residues in the self - alignment . * @ param selfAlignment * AFPChain * @ return alignment Graph */ public static Graph < Integer , DefaultEdge > buildSymmetryGraph ( AFPChain selfAlignment ) { } }
Graph < Integer , DefaultEdge > graph = new SimpleGraph < Integer , DefaultEdge > ( DefaultEdge . class ) ; for ( int i = 0 ; i < selfAlignment . getOptAln ( ) . length ; i ++ ) { for ( int j = 0 ; j < selfAlignment . getOptAln ( ) [ i ] [ 0 ] . length ; j ++ ) { Integer res1 = selfAlignment . getOptAln ( ) [ i ] [ 0 ] [ j ] ; Integer res2 = selfAlignment . getOptAln ( ) [ i ] [ 1 ] [ j ] ; graph . addVertex ( res1 ) ; graph . addVertex ( res2 ) ; graph . addEdge ( res1 , res2 ) ; } } return graph ;
public class Items { /** * Returns all the registered { @ link TopLevelItemDescriptor } s . */ public static DescriptorExtensionList < TopLevelItem , TopLevelItemDescriptor > all ( ) { } }
return Jenkins . getInstance ( ) . < TopLevelItem , TopLevelItemDescriptor > getDescriptorList ( TopLevelItem . class ) ;
public class Histogram3D { /** * Create a plot canvas with the histogram plot of given data . * @ param data a sample set . * @ param k the number of bins . * @ param prob if true , the z - axis will be in the probability scale . * @ param palette the color palette . */ public static PlotCanvas plot ( double [ ] [ ] data , int k , boolean prob , Color [ ] palette ) { } }
return plot ( data , k , k , prob , palette ) ;
public class InstanceClient { /** * Performs a reset on the instance . This is a hard reset the VM does not do a graceful shutdown . * For more information , see Resetting an instance . * < p > Sample code : * < pre > < code > * try ( InstanceClient instanceClient = InstanceClient . create ( ) ) { * ProjectZoneInstanceName instance = ProjectZoneInstanceName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ INSTANCE ] " ) ; * Operation response = instanceClient . resetInstance ( instance ) ; * < / code > < / pre > * @ param instance Name of the instance scoping this request . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation resetInstance ( ProjectZoneInstanceName instance ) { } }
ResetInstanceHttpRequest request = ResetInstanceHttpRequest . newBuilder ( ) . setInstance ( instance == null ? null : instance . toString ( ) ) . build ( ) ; return resetInstance ( request ) ;
public class ConvergedServletInitialHandler { /** * FIXME : kakonyii : This method is copied form the base class : */ private void dispatchRequest ( final HttpServerExchange exchange , final ServletRequestContext servletRequestContext , final ServletChain servletChain , final DispatcherType dispatcherType ) throws Exception { } }
HttpHandler next = null ; try { // lets get access of superclass private fields using reflection : Field nextField = ServletInitialHandler . class . getDeclaredField ( "next" ) ; nextField . setAccessible ( true ) ; next = ( HttpHandler ) nextField . get ( this ) ; nextField . setAccessible ( false ) ; } catch ( NoSuchFieldException | IllegalAccessException e ) { throw new ServletException ( e ) ; } servletRequestContext . setDispatcherType ( dispatcherType ) ; servletRequestContext . setCurrentServlet ( servletChain ) ; if ( dispatcherType == DispatcherType . REQUEST || dispatcherType == DispatcherType . ASYNC ) { super . handleFirstRequest ( exchange , servletChain , servletRequestContext , servletRequestContext . getServletRequest ( ) , servletRequestContext . getServletResponse ( ) ) ; } else { next . handleRequest ( exchange ) ; }
public class SliderBar { /** * Stop sliding the knob . * @ param unhighlight * true to change the style * @ param fireEvent * true to fire the event */ private void stopSliding ( boolean unhighlight , boolean fireEvent ) { } }
if ( unhighlight ) { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE ) ; DOM . setElementProperty ( knobImage . getElement ( ) , "className" , SLIDER_KNOB ) ; }
public class LoggingUtil { /** * Expensive logging function that is convenient , but should only be used in * rare conditions . * For ' frequent ' logging , use more efficient techniques , such as explained in * the { @ link de . lmu . ifi . dbs . elki . logging logging package documentation } . * @ param level Logging level * @ param message Message to log . */ public static void logExpensive ( Level level , String message ) { } }
LogRecord rec = new ELKILogRecord ( level , message ) ; String [ ] caller = inferCaller ( ) ; if ( caller != null ) { rec . setSourceClassName ( caller [ 0 ] ) ; rec . setSourceMethodName ( caller [ 1 ] ) ; Logger logger = Logger . getLogger ( caller [ 0 ] ) ; logger . log ( rec ) ; } else { Logger . getAnonymousLogger ( ) . log ( rec ) ; }
public class FessMessages { /** * Add the created action message for the key ' errors . invalid _ query _ unsupported _ sort _ field ' with parameters . * < pre > * message : The given sort ( { 0 } ) is not supported . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ param arg0 The parameter arg0 for message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsInvalidQueryUnsupportedSortField ( String property , String arg0 ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_invalid_query_unsupported_sort_field , arg0 ) ) ; return this ;
public class ProtoUtils { /** * not an api */ public static boolean computeUpdate ( String channelId , Configtx . Config original , Configtx . Config update , Configtx . ConfigUpdate . Builder configUpdateBuilder ) { } }
Configtx . ConfigGroup . Builder readSetBuilder = Configtx . ConfigGroup . newBuilder ( ) ; Configtx . ConfigGroup . Builder writeSetBuilder = Configtx . ConfigGroup . newBuilder ( ) ; if ( computeGroupUpdate ( original . getChannelGroup ( ) , update . getChannelGroup ( ) , readSetBuilder , writeSetBuilder ) ) { configUpdateBuilder . setReadSet ( readSetBuilder . build ( ) ) . setWriteSet ( writeSetBuilder . build ( ) ) . setChannelId ( channelId ) ; return true ; } return false ;
public class X509NameEntryConverter { /** * return true if the passed in String can be represented without * loss as a PrintableString , false otherwise . */ protected boolean canBePrintable ( String str ) { } }
for ( int i = str . length ( ) - 1 ; i >= 0 ; i -- ) { char ch = str . charAt ( i ) ; if ( str . charAt ( i ) > 0x007f ) { return false ; } if ( 'a' <= ch && ch <= 'z' ) { continue ; } if ( 'A' <= ch && ch <= 'Z' ) { continue ; } if ( '0' <= ch && ch <= '9' ) { continue ; } switch ( ch ) { case ' ' : case '\'' : case '(' : case ')' : case '+' : case '-' : case '.' : case ':' : case '=' : case '?' : continue ; } return false ; } return true ;
public class CommerceWishListUtil { /** * Returns all the commerce wish lists where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce wish lists */ public static List < CommerceWishList > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class GraphPath { /** * Split this path and retains the first part of the * part in this object and reply the second part . * The first occurrence of this specified element * will be in the second part . * < p > This function removes until the < i > last occurence < / i > * of the given object . * @ param obj the reference segment . * @ param startPoint is the starting point of the searched segment . * @ return the rest of the path after the first occurence of the given element . */ public GP splitAt ( ST obj , PT startPoint ) { } }
return splitAt ( indexOf ( obj , startPoint ) , true ) ;
public class StreamService { /** * Send NetStream . Status to the client . * @ param conn * connection * @ param statusCode * NetStream status code * @ param description * description * @ param name * name * @ param status * The status - error , warning , or status * @ param streamId * stream id */ public static void sendNetStreamStatus ( IConnection conn , String statusCode , String description , String name , String status , Number streamId ) { } }
if ( conn instanceof RTMPConnection ) { Status s = new Status ( statusCode ) ; s . setClientid ( streamId ) ; s . setDesciption ( description ) ; s . setDetails ( name ) ; s . setLevel ( status ) ; // get the channel RTMPConnection rtmpConn = ( RTMPConnection ) conn ; Channel channel = rtmpConn . getChannel ( rtmpConn . getChannelIdForStreamId ( streamId ) ) ; channel . sendStatus ( s ) ; } else { throw new RuntimeException ( "Connection is not RTMPConnection: " + conn ) ; }
public class CmsGalleryController { /** * Remove the type from the search object . < p > * @ param resourceType the resource type as id */ public void removeType ( String resourceType ) { } }
m_searchObject . removeType ( resourceType ) ; m_searchObjectChanged = true ; ValueChangeEvent . fire ( this , m_searchObject ) ;
public class UserManagedCacheBuilder { /** * Adds { @ link ExpiryPolicy } configuration to the returned builder . * @ param expiry the expiry to use * @ return a new builer with the added expiry */ public final UserManagedCacheBuilder < K , V , T > withExpiry ( ExpiryPolicy < ? super K , ? super V > expiry ) { } }
if ( expiry == null ) { throw new NullPointerException ( "Null expiry" ) ; } UserManagedCacheBuilder < K , V , T > otherBuilder = new UserManagedCacheBuilder < > ( this ) ; otherBuilder . expiry = expiry ; return otherBuilder ;
public class ExtractionResult { /** * Returns all entities . * @ return all entities . */ public List < Object > getEntities ( ) { } }
List < Object > entitiesList = new LinkedList < Object > ( ) ; for ( Result result : results ) { entitiesList . add ( result . getObject ( ) ) ; } return entitiesList ;
public class Record { /** * Add sort key * @ param object Java primitive sort key * @ param sort sort type SORT _ NON or SORT _ LOWER or SORT _ UPPER * @ param priority sort order */ public void addSort ( Object object , int sort , int priority ) { } }
key . addPrimitiveValue ( String . format ( SORT_LABEL , priority ) , object , sort , priority ) ;
public class Counters { /** * Returns a string representation of a Counter , displaying the keys and their * counts in decreasing order of count . At most k keys are displayed . * Note that this method subsumes many of the other toString methods , e . g . : * toString ( c , k ) and toBiggestValuesFirstString ( c , k ) = > toSortedString ( c , k , * " % s = % f " , " , " , " [ % s ] " ) * toVerticalString ( c , k ) = > toSortedString ( c , k , " % 2 $ g \ t % 1 $ s " , " \ n " , " % s \ n " ) * @ param counter * A Counter . * @ param k * The number of keys to include . Use Integer . MAX _ VALUE to include * all keys . * @ param itemFormat * The format string for key / count pairs , where the key is first and * the value is second . To display the value first , use argument * indices , e . g . " % 2 $ f % 1 $ s " . * @ param joiner * The string used between pairs of key / value strings . * @ param wrapperFormat * The format string for wrapping text around the joined items , where * the joined item string value is " % s " . * @ return The top k values from the Counter , formatted as specified . */ public static < T > String toSortedString ( Counter < T > counter , int k , String itemFormat , String joiner , String wrapperFormat ) { } }
PriorityQueue < T > queue = toPriorityQueue ( counter ) ; List < String > strings = new ArrayList < String > ( ) ; for ( int rank = 0 ; rank < k && ! queue . isEmpty ( ) ; ++ rank ) { T key = queue . removeFirst ( ) ; double value = counter . getCount ( key ) ; strings . add ( String . format ( itemFormat , key , value ) ) ; } return String . format ( wrapperFormat , StringUtils . join ( strings , joiner ) ) ;
public class RepositoryBrowser { /** * Normalize the URL so that it ends with ' / ' . * An attention is paid to preserve the query parameters in URL if any . */ protected static URL normalizeToEndWithSlash ( URL url ) { } }
if ( url . getPath ( ) . endsWith ( "/" ) ) return url ; // normalize String q = url . getQuery ( ) ; q = q != null ? ( '?' + q ) : "" ; try { return new URL ( url , url . getPath ( ) + '/' + q ) ; } catch ( MalformedURLException e ) { // impossible throw new Error ( e ) ; }
public class DeleteAggregationAuthorizationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteAggregationAuthorizationRequest deleteAggregationAuthorizationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteAggregationAuthorizationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteAggregationAuthorizationRequest . getAuthorizedAccountId ( ) , AUTHORIZEDACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( deleteAggregationAuthorizationRequest . getAuthorizedAwsRegion ( ) , AUTHORIZEDAWSREGION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class MolecularFormulaManipulator { /** * Simplify the molecular formula . E . g the dot ' . ' character convention is * used when dividing a formula into parts . In this case any numeral following a dot refers * to all the elements within that part of the formula that follow it . * @ param formula The molecular formula * @ return The simplified molecular formula */ public static String simplifyMolecularFormula ( String formula ) { } }
String newFormula = formula ; char thisChar ; if ( formula . contains ( " " ) ) { newFormula = newFormula . replace ( " " , "" ) ; } if ( ! formula . contains ( "." ) ) return breakExtractor ( formula ) ; List < String > listMF = new ArrayList < String > ( ) ; while ( newFormula . contains ( "." ) ) { int pos = newFormula . indexOf ( '.' ) ; String thisFormula = newFormula . substring ( 0 , pos ) ; if ( thisFormula . charAt ( 0 ) >= '0' && thisFormula . charAt ( 0 ) <= '9' ) thisFormula = multipleExtractor ( thisFormula ) ; if ( thisFormula . contains ( "(" ) ) thisFormula = breakExtractor ( thisFormula ) ; listMF . add ( thisFormula ) ; thisFormula = newFormula . substring ( pos + 1 , newFormula . length ( ) ) ; if ( ! thisFormula . contains ( "." ) ) { if ( thisFormula . charAt ( 0 ) >= '0' && thisFormula . charAt ( 0 ) <= '9' ) thisFormula = multipleExtractor ( thisFormula ) ; if ( thisFormula . contains ( "(" ) ) thisFormula = breakExtractor ( thisFormula ) ; listMF . add ( thisFormula ) ; } newFormula = thisFormula ; } if ( newFormula . contains ( "(" ) ) newFormula = breakExtractor ( newFormula ) ; String recentElementSymbol = "" ; String recentElementCountString = "0" ; List < String > eleSymb = new ArrayList < String > ( ) ; List < Integer > eleCount = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < listMF . size ( ) ; i ++ ) { String thisFormula = listMF . get ( i ) ; for ( int f = 0 ; f < thisFormula . length ( ) ; f ++ ) { thisChar = thisFormula . charAt ( f ) ; if ( f < thisFormula . length ( ) ) { if ( thisChar >= 'A' && thisChar <= 'Z' ) { recentElementSymbol = String . valueOf ( thisChar ) ; recentElementCountString = "0" ; } if ( thisChar >= 'a' && thisChar <= 'z' ) { recentElementSymbol += thisChar ; } if ( thisChar >= '0' && thisChar <= '9' ) { recentElementCountString += thisChar ; } } if ( f == thisFormula . length ( ) - 1 || ( thisFormula . charAt ( f + 1 ) >= 'A' && thisFormula . charAt ( f + 1 ) <= 'Z' ) ) { int posit = eleSymb . indexOf ( recentElementSymbol ) ; int count = Integer . valueOf ( recentElementCountString ) ; if ( posit == - 1 ) { eleSymb . add ( recentElementSymbol ) ; eleCount . add ( count ) ; } else { int countP = Integer . valueOf ( recentElementCountString ) ; if ( countP == 0 ) countP = 1 ; int countA = eleCount . get ( posit ) ; if ( countA == 0 ) countA = 1 ; int value = countP + countA ; eleCount . remove ( posit ) ; eleCount . add ( posit , value ) ; } } } } String newF = "" ; for ( int i = 0 ; i < eleCount . size ( ) ; i ++ ) { String element = eleSymb . get ( i ) ; int num = eleCount . get ( i ) ; if ( num == 0 ) newF += element ; else newF += element + num ; } return newF ;
public class StringUtils { /** * < p > Checks if the CharSequence contains only uppercase characters . < / p > * < p > { @ code null } will return { @ code false } . * An empty String ( length ( ) = 0 ) will return { @ code false } . < / p > * < pre > * StringUtils . isAllUpperCase ( null ) = false * StringUtils . isAllUpperCase ( " " ) = false * StringUtils . isAllUpperCase ( " " ) = false * StringUtils . isAllUpperCase ( " ABC " ) = true * StringUtils . isAllUpperCase ( " aBC " ) = false * StringUtils . isAllUpperCase ( " A C " ) = false * StringUtils . isAllUpperCase ( " A1C " ) = false * StringUtils . isAllUpperCase ( " A / C " ) = false * < / pre > * @ param cs the CharSequence to check , may be null * @ return { @ code true } if only contains uppercase characters , and is non - null * @ since 2.5 * @ since 3.0 Changed signature from isAllUpperCase ( String ) to isAllUpperCase ( CharSequence ) */ public static boolean isAllUpperCase ( final CharSequence cs ) { } }
if ( cs == null || isEmpty ( cs ) ) { return false ; } final int sz = cs . length ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { if ( ! Character . isUpperCase ( cs . charAt ( i ) ) ) { return false ; } } return true ;
public class SeLionGridLauncherV3 { /** * Shutdown the instance * @ throws Exception */ public void shutdown ( ) throws Exception { } }
if ( type == null ) { return ; } if ( type instanceof Hub ) { ( ( Hub ) type ) . stop ( ) ; } if ( type instanceof SelfRegisteringRemote ) { ( ( SelfRegisteringRemote ) type ) . stopRemoteServer ( ) ; } if ( type instanceof SeleniumServer ) { ( ( SeleniumServer ) type ) . stop ( ) ; } LOGGER . info ( "Selenium is shut down" ) ;
public class DefaultOrphanResponseReporter { /** * Reports the given { @ link CouchbaseRequest } as a orphan response . * @ param request the request that shpuld be reported . */ @ Override public void report ( final CouchbaseResponse request ) { } }
if ( ! queue . offer ( request ) ) { LOGGER . debug ( "Could not enqueue CouchbaseRequest {} for orphan reporting, discarding." , request ) ; }
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write an attribute update operation . < / p > * @ param targetId ID of the node to be updated * @ param attributes Map of attribute name / value pairs to be updated * @ throws IOException if an input / output error occurs * @ since 2.0 */ public void updateAttributes ( String targetId , Map < String , String > attributes ) throws IOException { } }
startChangesIfNecessary ( ) ; ResponseWriter writer = getWrapped ( ) ; writer . startElement ( "attributes" , null ) ; writer . writeAttribute ( "id" , targetId , null ) ; for ( Map . Entry < String , String > entry : attributes . entrySet ( ) ) { writer . startElement ( "attribute" , null ) ; writer . writeAttribute ( "name" , entry . getKey ( ) , null ) ; writer . writeAttribute ( "value" , entry . getValue ( ) , null ) ; writer . endElement ( "attribute" ) ; } writer . endElement ( "attributes" ) ;
public class InputStreamProvider { /** * Get an InputStream for the file . * The caller is responsible for closing the stream or otherwise * a resource leak can occur . * @ param f a File * @ return an InputStream for the file * @ throws IOException */ public InputStream getInputStream ( File f ) throws IOException { } }
// use the magic numbers to determine the compression type , // use file extension only as 2nd choice int magic = 0 ; InputStream test = getInputStreamFromFile ( f ) ; magic = getMagicNumber ( test ) ; test . close ( ) ; InputStream inputStream = null ; String fileName = f . getName ( ) ; if ( magic == UncompressInputStream . LZW_MAGIC ) { // a Z compressed file return openCompressedFile ( f ) ; } else if ( magic == GZIP_MAGIC ) { return openGZIPFile ( f ) ; } else if ( fileName . endsWith ( ".gz" ) ) { return openGZIPFile ( f ) ; } else if ( fileName . endsWith ( ".zip" ) ) { ZipFile zipfile = new ZipFile ( f ) ; // stream to first entry is returned . . . ZipEntry entry ; Enumeration < ? extends ZipEntry > e = zipfile . entries ( ) ; if ( e . hasMoreElements ( ) ) { entry = e . nextElement ( ) ; inputStream = zipfile . getInputStream ( entry ) ; } else { throw new IOException ( "Zip file has no entries" ) ; } } else if ( fileName . endsWith ( ".jar" ) ) { JarFile jarFile = new JarFile ( f ) ; // stream to first entry is returned JarEntry entry ; Enumeration < JarEntry > e = jarFile . entries ( ) ; if ( e . hasMoreElements ( ) ) { entry = e . nextElement ( ) ; inputStream = jarFile . getInputStream ( entry ) ; } else { throw new IOException ( "Jar file has no entries" ) ; } } else if ( fileName . endsWith ( ".Z" ) ) { // unix compressed return openCompressedFile ( f ) ; } else { // no particular extension found , assume that it is an uncompressed file inputStream = getInputStreamFromFile ( f ) ; } return inputStream ;
public class Prefser { /** * Removes value defined by a given key . * @ param key key of the preference to be removed */ public void remove ( @ NonNull String key ) { } }
Preconditions . checkNotNull ( key , KEY_IS_NULL ) ; if ( ! contains ( key ) ) { return ; } editor . remove ( key ) . apply ( ) ;
public class ServiceCreator { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( uniqueName != null ) { request . addPostParam ( "UniqueName" , uniqueName ) ; } if ( defaultTtl != null ) { request . addPostParam ( "DefaultTtl" , defaultTtl . toString ( ) ) ; } if ( callbackUrl != null ) { request . addPostParam ( "CallbackUrl" , callbackUrl . toString ( ) ) ; } if ( geoMatchLevel != null ) { request . addPostParam ( "GeoMatchLevel" , geoMatchLevel . toString ( ) ) ; } if ( numberSelectionBehavior != null ) { request . addPostParam ( "NumberSelectionBehavior" , numberSelectionBehavior . toString ( ) ) ; } if ( interceptCallbackUrl != null ) { request . addPostParam ( "InterceptCallbackUrl" , interceptCallbackUrl . toString ( ) ) ; } if ( outOfSessionCallbackUrl != null ) { request . addPostParam ( "OutOfSessionCallbackUrl" , outOfSessionCallbackUrl . toString ( ) ) ; } if ( chatInstanceSid != null ) { request . addPostParam ( "ChatInstanceSid" , chatInstanceSid ) ; }
public class WorkerInfo { /** * < code > map & lt ; string , int64 & gt ; capacityBytesOnTiers = 8 ; < / code > */ public java . util . Map < java . lang . String , java . lang . Long > getCapacityBytesOnTiersMap ( ) { } }
return internalGetCapacityBytesOnTiers ( ) . getMap ( ) ;
public class CreateRouteResponseRequest { /** * The response models for the route response . * @ param responseModels * The response models for the route response . * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateRouteResponseRequest withResponseModels ( java . util . Map < String , String > responseModels ) { } }
setResponseModels ( responseModels ) ; return this ;
public class N { /** * Adds all the elements of the given arrays into a new array . * @ param a * the first array whose elements are added to the new array . * @ param b * the second array whose elements are added to the new array . * @ return A new array containing the elements from a and b */ @ SafeVarargs public static boolean [ ] addAll ( final boolean [ ] a , final boolean ... b ) { } }
if ( N . isNullOrEmpty ( a ) ) { return N . isNullOrEmpty ( b ) ? N . EMPTY_BOOLEAN_ARRAY : b . clone ( ) ; } final boolean [ ] newArray = new boolean [ a . length + b . length ] ; copy ( a , 0 , newArray , 0 , a . length ) ; copy ( b , 0 , newArray , a . length , b . length ) ; return newArray ;
public class FhirValidator { /** * Validates a resource instance , throwing a { @ link ValidationFailureException } if the validation fails * @ param theResource * The resource to validate * @ throws ValidationFailureException * If the validation fails * @ deprecated use { @ link # validateWithResult ( IBaseResource ) } instead */ @ Deprecated public void validate ( IResource theResource ) throws ValidationFailureException { } }
applyDefaultValidators ( ) ; ValidationResult validationResult = validateWithResult ( theResource ) ; if ( ! validationResult . isSuccessful ( ) ) { throw new ValidationFailureException ( myContext , validationResult . toOperationOutcome ( ) ) ; }
public class Trie { /** * The child corresponding to the given character . * @ return null if no such trie . */ public Trie lookup ( char ch ) { } }
int i = Arrays . binarySearch ( childMap , ch ) ; return i >= 0 ? children [ i ] : null ;
public class AbstractFindBugsTask { /** * Set the classpath to use . * @ param src * classpath to use */ public void setClasspath ( Path src ) { } }
if ( classpath == null ) { classpath = src ; } else { classpath . append ( src ) ; }
public class RangeUtils { /** * Gets a calendar using the default time zone and locale . The Calendar * returned is based on the given time in the default time zone with the * default locale . * @ return an calendar instance . */ private static Calendar buildCalendar ( final Date date ) { } }
Calendar calendar = buildCalendar ( ) ; calendar . setTime ( date ) ; return calendar ;
public class AmazonPinpointClient { /** * Delete an Voice channel * @ param deleteVoiceChannelRequest * @ return Result of the DeleteVoiceChannel operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 500 response * @ throws ForbiddenException * 403 response * @ throws NotFoundException * 404 response * @ throws MethodNotAllowedException * 405 response * @ throws TooManyRequestsException * 429 response * @ sample AmazonPinpoint . DeleteVoiceChannel * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / pinpoint - 2016-12-01 / DeleteVoiceChannel " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DeleteVoiceChannelResult deleteVoiceChannel ( DeleteVoiceChannelRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteVoiceChannel ( request ) ;
public class StepExecution { /** * Strategies used when step fails , we support Continue and Abort . Abort will fail the automation when the step * fails . Continue will ignore the failure of current step and allow automation to run the next step . With * conditional branching , we add step : stepName to support the automation to go to another specific step . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setValidNextSteps ( java . util . Collection ) } or { @ link # withValidNextSteps ( java . util . Collection ) } if you want * to override the existing values . * @ param validNextSteps * Strategies used when step fails , we support Continue and Abort . Abort will fail the automation when the * step fails . Continue will ignore the failure of current step and allow automation to run the next step . * With conditional branching , we add step : stepName to support the automation to go to another specific step . * @ return Returns a reference to this object so that method calls can be chained together . */ public StepExecution withValidNextSteps ( String ... validNextSteps ) { } }
if ( this . validNextSteps == null ) { setValidNextSteps ( new com . amazonaws . internal . SdkInternalList < String > ( validNextSteps . length ) ) ; } for ( String ele : validNextSteps ) { this . validNextSteps . add ( ele ) ; } return this ;
public class Scope { /** * 获取全局变量 * 全局作用域是指本次请求的整个 template */ public Object getGlobal ( Object key ) { } }
for ( Scope cur = this ; true ; cur = cur . parent ) { if ( cur . parent == null ) { return cur . data . get ( key ) ; } }
public class AzureVPNSupport { /** * Create local network for connecting VPN ? */ @ Override public VpnGateway createVpnGateway ( String endpoint , String name , String description , VpnProtocol protocol , String bgpAsn ) throws CloudException , InternalException { } }
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "ENTER: " + AzureVPNSupport . class . getName ( ) + ".createVPNGateway()" ) ; } try { ProviderContext ctx = provider . getContext ( ) ; if ( ctx == null ) { throw new AzureConfigException ( "No context was specified for this request" ) ; } AzureMethod method = new AzureMethod ( provider ) ; StringBuilder xml = new StringBuilder ( ) ; xml . append ( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" ) ; xml . append ( "<NetworkConfiguration xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">" ) ; xml . append ( "<VirtualNetworkConfiguration>" ) ; xml . append ( "<LocalNetworkSites>" ) ; xml . append ( "<LocalNetworkSite name=\"" + name + "\">" ) ; xml . append ( "<AddressSpace>" ) ; xml . append ( "<AddressPrefix>" + endpoint + "/32" + "</AddressPrefix>" ) ; xml . append ( "</AddressSpace>" ) ; xml . append ( "<VPNGatewayAddress>" + endpoint + "</VPNGatewayAddress>" ) ; xml . append ( "</LocalNetworkSite>" ) ; xml . append ( "</LocalNetworkSites>" ) ; xml . append ( "</VirtualNetworkConfiguration>" ) ; xml . append ( "</NetworkConfiguration>" ) ; if ( logger . isDebugEnabled ( ) ) { try { method . parseResponse ( xml . toString ( ) , false ) ; } catch ( Exception e ) { logger . warn ( "Unable to parse outgoing XML locally: " + e . getMessage ( ) ) ; logger . warn ( "XML:" ) ; logger . warn ( xml . toString ( ) ) ; } } String resourceDir = NETWORKING_SERVICES + "/media" ; method . post ( ctx . getAccountNumber ( ) , resourceDir , xml . toString ( ) ) ; // TODO : VPNGateway return null ; } finally { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "EXIT: " + AzureVPNSupport . class . getName ( ) + ".createVPNGateway()" ) ; } }
public class CommandLineTools { /** * Check the given text and print results to System . out . * @ param contents a text to check ( may be more than one sentence ) * @ param lt Initialized LanguageTool * @ param isXmlFormat whether to print the result in XML format * @ param isJsonFormat whether to print the result in JSON format * @ param contextSize error text context size : - 1 for default * @ param lineOffset line number offset to be added to line numbers in matches * @ param prevMatches number of previously matched rules * @ param apiMode mode of xml / json printout for simple xml / json output * @ return Number of rule matches to the input text . */ public static int checkText ( String contents , JLanguageTool lt , boolean isXmlFormat , boolean isJsonFormat , int contextSize , int lineOffset , int prevMatches , StringTools . ApiPrintMode apiMode , boolean listUnknownWords , List < String > unknownWords ) throws IOException { } }
if ( contextSize == - 1 ) { contextSize = DEFAULT_CONTEXT_SIZE ; } long startTime = System . currentTimeMillis ( ) ; List < RuleMatch > ruleMatches = lt . check ( contents ) ; // adjust line numbers for ( RuleMatch r : ruleMatches ) { r . setLine ( r . getLine ( ) + lineOffset ) ; r . setEndLine ( r . getEndLine ( ) + lineOffset ) ; } if ( isXmlFormat ) { if ( listUnknownWords && apiMode == StringTools . ApiPrintMode . NORMAL_API ) { unknownWords = lt . getUnknownWords ( ) ; } RuleMatchAsXmlSerializer serializer = new RuleMatchAsXmlSerializer ( ) ; String xml = serializer . ruleMatchesToXml ( ruleMatches , contents , contextSize , apiMode , lt . getLanguage ( ) , unknownWords ) ; PrintStream out = new PrintStream ( System . out , true , "UTF-8" ) ; out . print ( xml ) ; } else if ( isJsonFormat ) { RuleMatchesAsJsonSerializer serializer = new RuleMatchesAsJsonSerializer ( ) ; String json = serializer . ruleMatchesToJson ( ruleMatches , contents , contextSize , new DetectedLanguage ( lt . getLanguage ( ) , lt . getLanguage ( ) ) ) ; PrintStream out = new PrintStream ( System . out , true , "UTF-8" ) ; out . print ( json ) ; } else { printMatches ( ruleMatches , prevMatches , contents , contextSize ) ; } // display stats if it ' s not in a buffered mode if ( apiMode == StringTools . ApiPrintMode . NORMAL_API && ! isJsonFormat ) { SentenceTokenizer sentenceTokenizer = lt . getLanguage ( ) . getSentenceTokenizer ( ) ; int sentenceCount = sentenceTokenizer . tokenize ( contents ) . size ( ) ; displayTimeStats ( startTime , sentenceCount , isXmlFormat ) ; } return ruleMatches . size ( ) ;
public class JulianMath { /** * / * [ deutsch ] * < p > Berechnet das gepackte Datum auf Basis des angegebenen * modifizierten julianischen Datums . < / p > * < p > Mit Hilfe von { @ code readYear ( ) } , { @ code readMonth ( ) } und * { @ code readDayOfMonth ( ) } k & ouml ; nnen aus dem Ergebnis die einzelnen * Datumselemente extrahiert werden . < / p > * @ param mjd days since [ 1858-11-17 ] ( modified julian date ) * @ return packed date in binary format * @ throws IllegalArgumentException if the calculated year is not in * range [ ( - 99999 ) - 99999 ) ] * @ see # readYear ( long ) * @ see # readMonth ( long ) * @ see # readDayOfMonth ( long ) */ public static long toPackedDate ( long mjd ) { } }
long y ; int m ; int d ; long days = MathUtils . safeAdd ( mjd , OFFSET ) ; long q4 = MathUtils . floorDivide ( days , 1461 ) ; int r4 = MathUtils . floorModulo ( days , 1461 ) ; if ( r4 == 1460 ) { y = ( q4 + 1 ) * 4 ; m = 2 ; d = 29 ; } else { int q1 = ( r4 / 365 ) ; int r1 = ( r4 % 365 ) ; y = q4 * 4 + q1 ; m = ( ( ( r1 + 31 ) * 5 ) / 153 ) + 2 ; d = r1 - ( ( ( m + 1 ) * 153 ) / 5 ) + 123 ; if ( m > 12 ) { y ++ ; m -= 12 ; } } if ( y < JulianMath . MIN_YEAR || y > JulianMath . MAX_YEAR ) { throw new IllegalArgumentException ( "Year out of range: " + y ) ; } long result = ( y << 32 ) ; result |= ( m << 16 ) ; result |= d ; return result ;
public class DynamicMessage { /** * Returns a map of option names as keys and option values as values . . */ public Map < String , Object > toMap ( ) { } }
Map < String , Object > result = new HashMap < > ( ) ; for ( Entry < Key , Value > keyValueEntry : fields . entrySet ( ) ) { Key key = keyValueEntry . getKey ( ) ; Value value = keyValueEntry . getValue ( ) ; if ( ! key . isExtension ( ) ) { result . put ( key . getName ( ) , transformValueToObject ( value ) ) ; } else { result . put ( "(" + key . getName ( ) + ")" , transformValueToObject ( value ) ) ; } } return result ;
public class bit { /** * Convert a string which was created with the { @ link # toByteString ( byte . . . ) } * method back to an byte array . * @ see # toByteString ( byte . . . ) * @ param data the string to convert . * @ return the byte array . * @ throws IllegalArgumentException if the given data string could not be * converted . */ public static byte [ ] fromByteString ( final String data ) { } }
final String [ ] parts = data . split ( "\\|" ) ; final byte [ ] bytes = new byte [ parts . length ] ; for ( int i = 0 ; i < parts . length ; ++ i ) { if ( parts [ i ] . length ( ) != Byte . SIZE ) { throw new IllegalArgumentException ( "Byte value doesn't contain 8 bit: " + parts [ i ] ) ; } try { bytes [ parts . length - 1 - i ] = ( byte ) parseInt ( parts [ i ] , 2 ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( e ) ; } } return bytes ;
public class ContactsApi { /** * Get contacts Return contacts of a character - - - This route is cached for * up to 300 seconds SSO Scope : esi - characters . read _ contacts . v1 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param page * Which page of results to return ( optional , default to 1) * @ param token * Access token to use if unable to set a header ( optional ) * @ return ApiResponse & lt ; List & lt ; ContactsResponse & gt ; & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < List < ContactsResponse > > getCharactersCharacterIdContactsWithHttpInfo ( Integer characterId , String datasource , String ifNoneMatch , Integer page , String token ) throws ApiException { } }
com . squareup . okhttp . Call call = getCharactersCharacterIdContactsValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < ContactsResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class StrTokenizer { /** * Gets a new tokenizer instance which parses Comma Separated Value strings * initializing it with the given input . The default for CSV processing * will be trim whitespace from both ends ( which can be overridden with * the setTrimmer method ) . * @ param input the text to parse * @ return a new tokenizer instance which parses Comma Separated Value strings */ public static StrTokenizer getCSVInstance ( final String input ) { } }
final StrTokenizer tok = getCSVClone ( ) ; tok . reset ( input ) ; return tok ;
public class NodeSequence { /** * Add the node into a vector of nodes where it should occur in * document order . * @ param node The node to be added . * @ return insertIndex . * @ throws RuntimeException thrown if this NodeSetDTM is not of * a mutable type . */ protected int addNodeInDocOrder ( int node ) { } }
assertion ( hasCache ( ) , "addNodeInDocOrder must be done on a mutable sequence!" ) ; int insertIndex = - 1 ; NodeVector vec = getVector ( ) ; // This needs to do a binary search , but a binary search // is somewhat tough because the sequence test involves // two nodes . int size = vec . size ( ) , i ; for ( i = size - 1 ; i >= 0 ; i -- ) { int child = vec . elementAt ( i ) ; if ( child == node ) { i = - 2 ; // Duplicate , suppress insert break ; } DTM dtm = m_dtmMgr . getDTM ( node ) ; if ( ! dtm . isNodeAfter ( node , child ) ) { break ; } } if ( i != - 2 ) { insertIndex = i + 1 ; vec . insertElementAt ( node , insertIndex ) ; } // checkDups ( ) ; return insertIndex ;
public class X509CRLImpl { /** * Gets the raw Signature bits from the CRL . * @ return the signature . */ public byte [ ] getSignature ( ) { } }
if ( signature == null ) return null ; byte [ ] dup = new byte [ signature . length ] ; System . arraycopy ( signature , 0 , dup , 0 , dup . length ) ; return dup ;
public class ValueFilterAdapter { /** * { @ inheritDoc } */ @ Override public FilterSupportStatus isFilterSupported ( FilterAdapterContext context , ValueFilter filter ) { } }
if ( filter . getComparator ( ) instanceof BinaryComparator || ( filter . getComparator ( ) instanceof RegexStringComparator && filter . getOperator ( ) == CompareOp . EQUAL ) ) { return FilterSupportStatus . SUPPORTED ; } return FilterSupportStatus . newNotSupported ( String . format ( "ValueFilter must have either a BinaryComparator with any compareOp " + "or a RegexStringComparator with an EQUAL compareOp. Found (%s, %s)" , filter . getComparator ( ) . getClass ( ) . getSimpleName ( ) , filter . getOperator ( ) ) ) ;
public class CommerceRegionLocalServiceWrapper { /** * Deletes the commerce region from the database . Also notifies the appropriate model listeners . * @ param commerceRegion the commerce region * @ return the commerce region that was removed * @ throws PortalException */ @ Override public com . liferay . commerce . model . CommerceRegion deleteCommerceRegion ( com . liferay . commerce . model . CommerceRegion commerceRegion ) throws com . liferay . portal . kernel . exception . PortalException { } }
return _commerceRegionLocalService . deleteCommerceRegion ( commerceRegion ) ;
public class Try { /** * Tries to run the given ThrowingRunnable and throws a RuntimeException with the given message in case it fails . * If the given ThrowingRunnable throws a RuntimeException it is not rethrown but wrapped in a new RuntimeException * with the given message ( just like a checked Exception ) . * @ param message The message to create the RuntimeException with in case it fails . * @ param runnable A runnable which might throw a checked Exception . */ public static void run ( final @ Nonnull String message , final @ Nonnull ThrowingRunnable runnable ) { } }
Objects . requireNonNull ( message , "message must not be null" ) ; Objects . requireNonNull ( runnable , "runnable must not be null" ) ; try { runnable . run ( ) ; } catch ( final Exception exc ) { throw new RuntimeException ( message , exc ) ; }
public class JoblogUtil { /** * logs the message to joblog and trace . * If Level > FINE , this method will reduce the level to FINE while logging to trace . log * to prevent the message to be logged in console . log and messages . log file * Joblog messages will be logged as per supplied logging level * Use this method when you don ' t want a very verbose stack in messages . log and console . log * @ param level Original logging level the message was logged at by the code writing the log msg . * @ param rawMsg Message is complete , it has already been translated with parameters a filled in , * or it is a raw , non - translated message like an exception or similar trace . * @ param traceLogger Logger to use to attempt to log message to trace . log ( whether it will or not * depends on config ) */ @ Trivial public static void logRawMsgToJobLogAndTraceOnly ( Level level , String msg , Logger traceLogger ) { } }
if ( level . intValue ( ) > Level . FINE . intValue ( ) ) { traceLogger . log ( Level . FINE , msg ) ; logToJoblogIfNotTraceLoggable ( Level . FINE , msg , traceLogger ) ; } else { traceLogger . log ( level , msg ) ; logToJoblogIfNotTraceLoggable ( level , msg , traceLogger ) ; }
public class StaticMethodInjectionPoint { /** * Helper method for getting the current parameter values from a list of annotated parameters . * @ param parameters The list of annotated parameter to look up * @ param manager The Bean manager * @ return The object array of looked up values */ protected Object [ ] getParameterValues ( Object specialVal , BeanManagerImpl manager , CreationalContext < ? > ctx , CreationalContext < ? > transientReferenceContext ) { } }
if ( getInjectionPoints ( ) . isEmpty ( ) ) { if ( specialInjectionPointIndex == - 1 ) { return Arrays2 . EMPTY_ARRAY ; } else { return new Object [ ] { specialVal } ; } } Object [ ] parameterValues = new Object [ getParameterInjectionPoints ( ) . size ( ) ] ; List < ParameterInjectionPoint < ? , X > > parameters = getParameterInjectionPoints ( ) ; for ( int i = 0 ; i < parameterValues . length ; i ++ ) { ParameterInjectionPoint < ? , ? > param = parameters . get ( i ) ; if ( i == specialInjectionPointIndex ) { parameterValues [ i ] = specialVal ; } else if ( hasTransientReferenceParameter && param . getAnnotated ( ) . isAnnotationPresent ( TransientReference . class ) ) { parameterValues [ i ] = param . getValueToInject ( manager , transientReferenceContext ) ; } else { parameterValues [ i ] = param . getValueToInject ( manager , ctx ) ; } } return parameterValues ;
public class DefaultIOUtil { /** * { @ inheritDoc } */ public void createArchive ( File directory , File archive ) throws MojoExecutionException { } }
// package the zip . Note this is very simple . Look at the JarMojo which does more things . // we should perhaps package as a war when inside a project with war packaging ? makeDirectoryIfNecessary ( archive . getParentFile ( ) ) ; deleteFile ( archive ) ; zipArchiver . addDirectory ( directory ) ; zipArchiver . setDestFile ( archive ) ; try { zipArchiver . createArchive ( ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Could not create zip archive: " + archive , e ) ; }
public class GVRSkeletonAnimation { /** * Create a skeleton from the target hierarchy which has the given bones . * The structure of the target hierarchy is used to determine bone parentage . * The skeleton will have only the bones designated in the list . * The hierarchy is expected to be connected with no gaps or unnamed nodes . * @ param boneNames names of bones in the skeleton . * @ return { @ link GVRSkeleton } created from the target hierarchy . */ public GVRSkeleton createSkeleton ( List < String > boneNames ) { } }
int numBones = boneNames . size ( ) ; GVRSceneObject root = ( GVRSceneObject ) mTarget ; mSkeleton = new GVRSkeleton ( root , boneNames ) ; for ( int boneId = 0 ; boneId < numBones ; ++ boneId ) { mSkeleton . setBoneOptions ( boneId , GVRSkeleton . BONE_ANIMATE ) ; } mBoneChannels = new GVRAnimationChannel [ numBones ] ; return mSkeleton ;
public class Localizable { /** * Adds or overrides a value to the internal hash . * @ param value * If set to null , removes the value from the internal hash ( the local will no longer * show up in { @ link # getAllLocales ( ) } * @ throws NullPointerException * if locale is null . * @ return The value previously associated with the locale , or null if none . */ public E set ( E value , Locale locale ) { } }
if ( defaultLocale == null ) defaultLocale = locale ; if ( value != null ) return values . put ( locale , value ) ; values . remove ( locale ) ; return null ;
public class SurtPrefixSet { /** * Changes all prefixes so that they enforce an exact host . For * prefixes that already include a ' ) ' , this means discarding * anything after ' ) ' ( path info ) . For prefixes that don ' t include * a ' ) ' - - domain prefixes open to subdomains - - add the closing * ' ) ' ( or " , ) " ) . */ public void convertAllPrefixesToHosts ( ) { } }
SurtPrefixSet iterCopy = ( SurtPrefixSet ) this . clone ( ) ; Iterator < String > iter = iterCopy . iterator ( ) ; while ( iter . hasNext ( ) ) { String prefix = ( String ) iter . next ( ) ; String convPrefix = convertPrefixToHost ( prefix ) ; if ( prefix != convPrefix ) { // if returned value not unchanged , update set this . remove ( prefix ) ; this . add ( convPrefix ) ; } }
public class Source { /** * Sets whether or not the position , velocity , etc . , of the source are relative to the * listener . */ public void setSourceRelative ( boolean relative ) { } }
if ( _sourceRelative != relative ) { _sourceRelative = relative ; AL10 . alSourcei ( _id , AL10 . AL_SOURCE_RELATIVE , relative ? AL10 . AL_TRUE : AL10 . AL_FALSE ) ; }
public class WColumnLayout { /** * Sets the content of the given column and updates the column widths and visibilities . * @ param column the column being updated . * @ param heading the column heading . * @ param content the content . */ private void setContent ( final WColumn column , final WHeading heading , final WComponent content ) { } }
column . removeAll ( ) ; if ( heading != null ) { column . add ( heading ) ; } if ( content != null ) { column . add ( content ) ; } // Update column widths & visibility if ( hasLeftContent ( ) && hasRightContent ( ) ) { // Set columns 50% leftColumn . setWidth ( 50 ) ; rightColumn . setWidth ( 50 ) ; // Set both visible leftColumn . setVisible ( true ) ; rightColumn . setVisible ( true ) ; } else { // Set columns 100 % ( only one visible ) leftColumn . setWidth ( 100 ) ; rightColumn . setWidth ( 100 ) ; // Set visibility leftColumn . setVisible ( hasLeftContent ( ) ) ; rightColumn . setVisible ( hasRightContent ( ) ) ; }
public class Branch { /** * Check for forced session restart . The Branch session is restarted if the incoming intent has branch _ force _ new _ session set to true . * This is for supporting opening a deep link path while app is already running in the foreground . Such as clicking push notification while app in foreground . * We are catching BadParcelableException because of the issue reported here : https : / / github . com / BranchMetrics / android - branch - deep - linking / issues / 464 * Which is also reported here , affecting Chrome : https : / / bugs . chromium . org / p / chromium / issues / detail ? id = 412527 * Explanation : In some cases the parcel inside the intent we ' re parsing from Chrome can be malformed , so we need some protection ! * The commit which resolved the issue in Chrome lives here : https : / / chromium . googlesource . com / chromium / src / + / 4bca3b37801c502a164536b804879c00aba7d304 * We decided for now to protect this one line with a try / catch . */ private boolean checkIntentForSessionRestart ( Intent intent ) { } }
boolean isRestartSessionRequested = false ; if ( intent != null ) { try { // Force new session parameters if ( intent . getBooleanExtra ( Defines . Jsonkey . ForceNewBranchSession . getKey ( ) , false ) ) { isRestartSessionRequested = true ; intent . putExtra ( Defines . Jsonkey . ForceNewBranchSession . getKey ( ) , false ) ; // Also check if there is a new , unconsumed push notification intent which would indicate it ' s coming // from foreground } else if ( intent . getStringExtra ( Defines . Jsonkey . AndroidPushNotificationKey . getKey ( ) ) != null && ! intent . getBooleanExtra ( Defines . Jsonkey . BranchLinkUsed . getKey ( ) , false ) ) { isRestartSessionRequested = true ; } } catch ( Throwable ignore ) { } } return isRestartSessionRequested ;
public class WebApp { /** * Process any annotation which could not be managed by an update * to the the descriptor based configuration . * @ param servletConfig The servlet configuration embedding a class * which is to be processed for annotations . */ private void initializeNonDDRepresentableAnnotation ( IServletConfig servletConfig ) { } }
if ( com . ibm . ws . webcontainer . osgi . WebContainer . isServerStopping ( ) ) return ; String methodName = "initializeNonDDRepresentableAnnotation" ; String configClassName = servletConfig . getClassName ( ) ; if ( configClassName == null ) { return ; // Strange ; but impossible to process ; ignore . } if ( ! acceptAnnotationsFrom ( configClassName , DO_NOT_ACCEPT_PARTIAL , DO_NOT_ACCEPT_EXCLUDED ) ) { return ; // Ignore : In a metadata - complete or excluded region . } // Process : In a non - metadata - complete , non - excluded region . Class < ? > configClass ; try { configClass = Class . forName ( configClassName , false , this . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { LoggingUtil . logParamsAndException ( logger , Level . FINE , CLASS_NAME , methodName , "unable to load class [{0}] which is benign if the class is never used" , new Object [ ] { configClassName } , e ) ; } return ; } catch ( NoClassDefFoundError e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { LoggingUtil . logParamsAndException ( logger , Level . FINE , CLASS_NAME , methodName , "unable to load class [{0}] which is benign if the class is never used" , new Object [ ] { configClassName } , e ) ; } return ; } checkForServletSecurityAnnotation ( configClass , servletConfig ) ;
public class ServiceDiscoveryManager { /** * Add discover info response data . * @ see < a href = " http : / / xmpp . org / extensions / xep - 0030 . html # info - basic " > XEP - 30 Basic Protocol ; Example 2 < / a > * @ param response the discover info response packet */ public synchronized void addDiscoverInfoTo ( DiscoverInfo response ) { } }
// First add the identities of the connection response . addIdentities ( getIdentities ( ) ) ; // Add the registered features to the response for ( String feature : getFeatures ( ) ) { response . addFeature ( feature ) ; } response . addExtension ( extendedInfo ) ;