signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SepaUtil { /** * Fuegt einen Index in den Property - Key ein . Wurde kein Index angegeben , wird der Key
* unveraendert zurueckgeliefert .
* @ param key Key , der mit einem Index ergaenzt werden soll
* @ param index Index oder { @ code null } , wenn kein Index gesetzt werden soll
* @ return Key mit... | if ( index == null ) return key ; int pos = key . indexOf ( '.' ) ; if ( pos >= 0 ) { return key . substring ( 0 , pos ) + '[' + index + ']' + key . substring ( pos ) ; } else { return key + '[' + index + ']' ; } |
public class ConfigClient { /** * Creates a sink that exports specified log entries to a destination . The export of
* newly - ingested log entries begins immediately , unless the sink ' s ` writer _ identity ` is not
* permitted to write to the destination . A sink can export log entries only from the resource
*... | CreateSinkRequest request = CreateSinkRequest . newBuilder ( ) . setParent ( parent ) . setSink ( sink ) . build ( ) ; return createSink ( request ) ; |
public class BsSearchLogCA { public void filter ( String name , EsAbstractConditionQuery . OperatorCall < BsSearchLogCQ > queryLambda , ConditionOptionCall < FilterAggregationBuilder > opLambda , OperatorCall < BsSearchLogCA > aggsLambda ) { } } | SearchLogCQ cq = new SearchLogCQ ( ) ; if ( queryLambda != null ) { queryLambda . callback ( cq ) ; } FilterAggregationBuilder builder = regFilterA ( name , cq . getQuery ( ) ) ; if ( opLambda != null ) { opLambda . callback ( builder ) ; } if ( aggsLambda != null ) { SearchLogCA ca = new SearchLogCA ( ) ; aggsLambda .... |
public class ServicesInner { /** * Get DMS Service Instance .
* The services resource is the top - level resource that represents the Data Migration Service . The GET method retrieves information about a service instance .
* @ param groupName Name of the resource group
* @ param serviceName Name of the service
... | return getByResourceGroupWithServiceResponseAsync ( groupName , serviceName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class LdapAdapter { @ Override protected Scalar transform ( ActivityContext context , Scalar scalar ) throws ActivityException { } } | if ( ! ( scalar . get ( ) instanceof LdapQuery ) ) { throw new ActivityException ( "Input to LdapAdapter must be an LDAP query" ) ; } LdapQuery query = ( LdapQuery ) scalar . get ( ) ; logger . trace ( "running LDAP query: '{}'" , query . toString ( ) ) ; return null ; |
public class Matrix3D { /** * Calculate the determinant of a 3x3 matrix .
* @ return result */
private double determinant3x3 ( double t00 , double t01 , double t02 , double t10 , double t11 , double t12 , double t20 , double t21 , double t22 ) { } } | return ( t00 * ( t11 * t22 - t12 * t21 ) + t01 * ( t12 * t20 - t10 * t22 ) + t02 * ( t10 * t21 - t11 * t20 ) ) ; |
public class Weeks { /** * Obtains an instance of < code > Weeks < / code > that may be cached .
* < code > Weeks < / code > is immutable , so instances can be cached and shared .
* This factory method provides access to shared instances .
* @ param weeks the number of weeks to obtain an instance for
* @ return... | switch ( weeks ) { case 0 : return ZERO ; case 1 : return ONE ; case 2 : return TWO ; case 3 : return THREE ; case Integer . MAX_VALUE : return MAX_VALUE ; case Integer . MIN_VALUE : return MIN_VALUE ; default : return new Weeks ( weeks ) ; } |
public class WhitespaceLexer { /** * Refills the input buffer .
* @ return < code > false < / code > , iff there was new input .
* @ exception java . io . IOException if any I / O - Error occurs */
private boolean zzRefill ( ) throws java . io . IOException { } } | /* first : make room ( if you can ) */
if ( zzStartRead > 0 ) { System . arraycopy ( zzBuffer , zzStartRead , zzBuffer , 0 , zzEndRead - zzStartRead ) ; /* translate stored positions */
zzEndRead -= zzStartRead ; zzCurrentPos -= zzStartRead ; zzMarkedPos -= zzStartRead ; zzStartRead = 0 ; } /* is the buffer big enough ... |
public class Graphics { /** * Returns the array normalized from 0-255 to 0-1.0. */
private static float [ ] normalize ( float [ ] in ) { } } | float [ ] out = new float [ in . length ] ; for ( int i = 0 ; i < in . length ; i ++ ) { out [ i ] = ( in [ i ] / 255.0f ) ; } return out ; |
public class JobTracker { /** * Adds a job to the jobtracker . Make sure that the checks are inplace before
* adding a job . This is the core job submission logic
* @ param jobId The id for the job submitted which needs to be added */
protected synchronized JobStatus addJob ( JobID jobId , JobInProgress job ) { } } | totalSubmissions ++ ; synchronized ( jobs ) { synchronized ( taskScheduler ) { jobs . put ( job . getProfile ( ) . getJobID ( ) , job ) ; for ( JobInProgressListener listener : jobInProgressListeners ) { try { listener . jobAdded ( job ) ; } catch ( IOException ioe ) { LOG . warn ( "Failed to add and so skipping the jo... |
public class EncodingHandler { /** * This should ONLY be called once all training threads have completed
* @ return */
public ThresholdAlgorithm getAverageThresholdAlgorithm ( ) { } } | Collection < ThresholdAlgorithm > c = this . allThreadThresholdAlgorithms . values ( ) ; if ( c . isEmpty ( ) ) { return null ; } if ( c . size ( ) == 1 ) { return c . iterator ( ) . next ( ) ; } Iterator < ThresholdAlgorithm > iter = c . iterator ( ) ; ThresholdAlgorithmReducer r = null ; while ( iter . hasNext ( ) ) ... |
public class DescribeFleetCapacityRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFleetCapacityRequest describeFleetCapacityRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFleetCapacityRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFleetCapacityRequest . getFleetIds ( ) , FLEETIDS_BINDING ) ; protocolMarshaller . marshall ( describeFleetCapacityRequest . getLimit ( ) , LIMIT_BI... |
public class PlatformSummary { /** * The tiers in which the platform runs .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSupportedTierList ( java . util . Collection ) } or { @ link # withSupportedTierList ( java . util . Collection ) } if
* you want ... | if ( this . supportedTierList == null ) { setSupportedTierList ( new com . amazonaws . internal . SdkInternalList < String > ( supportedTierList . length ) ) ; } for ( String ele : supportedTierList ) { this . supportedTierList . add ( ele ) ; } return this ; |
public class ZapToggleButton { /** * Helper method that takes care to instantiate and add ( as an ItemListener ) the instance variable
* { @ code toolTipTextUpdaterOnSelectionStateChange } when a tool tip text that depends on the selection state ( either
* selectedToolTipText or disabledSelectedToolTipText ) is not... | if ( selectedToolTipText == null && disabledSelectedToolTipText == null ) { if ( toolTipTextUpdaterOnSelectionStateChange != null ) { removeItemListener ( toolTipTextUpdaterOnSelectionStateChange ) ; toolTipTextUpdaterOnSelectionStateChange = null ; } } else if ( toolTipTextUpdaterOnSelectionStateChange == null ) { too... |
public class RestoreManagerImpl { /** * / * ( non - Javadoc )
* @ see org . duracloud . snapshot . service . RestoreManager # cancelRestore ( java . lang . String ) */
@ Override @ Transactional public void cancelRestore ( String restoreId ) throws SnapshotException { } } | this . jobManager . cancelRestore ( restoreId ) ; this . restoreRepo . deleteByRestorationId ( restoreId ) ; |
public class HDFSDistributor { /** * Convert a set of SearchProblem objects to Strings of JSON text , writing the array to
* the HDFS location given by the HDFS file root . The written file serves as input to the
* Mapper tasks ( one Mapper per line in the file , which is also one SearchProblem )
* @ param proble... | FileSystem fs = FileSystem . get ( configuration ) ; log . info ( "hdfsFileRoot = " + hdfsFileRoot ) ; StringBuilder sb = new StringBuilder ( ) ; for ( Frontier problem : problems ) { SCXMLGapper gapper = new SCXMLGapper ( ) ; Map < String , String > decomposition = gapper . decompose ( problem , stateMachineText ) ; S... |
public class CmsImportResultList { /** * Adds a single line of the import result to the widget . < p >
* @ param leftText the text to display on the left
* @ param rightText the text to display on the right
* @ param styleName the style which should be applied to the right text */
public void addRow ( String left... | ensureTable ( ) ; ensureNoEmptyLabel ( ) ; int row = m_table . getRowCount ( ) ; m_table . setWidget ( row , 0 , new Label ( leftText ) ) ; Label rightLabel = new Label ( rightText ) ; rightLabel . addStyleName ( styleName ) ; rightLabel . addStyleName ( RESOURCES . css ( ) . rightLabel ( ) ) ; m_table . setWidget ( ro... |
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createFOT ( ) */
@ Override public ForwardTransferMessage createFOT ( ) { } } | ForwardTransferMessage msg = new ForwardTransferMessageImpl ( _FOT_HOLDER . mandatoryCodes , _FOT_HOLDER . mandatoryVariableCodes , _FOT_HOLDER . optionalCodes , _FOT_HOLDER . mandatoryCodeToIndex , _FOT_HOLDER . mandatoryVariableCodeToIndex , _FOT_HOLDER . optionalCodeToIndex ) ; return msg ; |
public class CucumberITGeneratorByScenario { /** * Generates a Cucumber runner for each scenario , or example in a scenario outline .
* @ param outputDirectory the output directory to place generated files
* @ param featureFiles The feature files to create runners for
* @ throws MojoExecutionException if somethin... | Parser < GherkinDocument > parser = new Parser < GherkinDocument > ( new AstBuilder ( ) ) ; TagPredicate tagPredicate = new TagPredicate ( overriddenParameters . getTags ( ) ) ; TokenMatcher matcher = new TokenMatcher ( ) ; for ( final File file : featureFiles ) { GherkinDocument gherkinDocument = null ; final List < P... |
public class NettyUtils { /** * Returns the correct ( client ) SocketChannel class based on IOMode . */
public static Class < ? extends Channel > getClientChannelClass ( IOMode mode ) { } } | switch ( mode ) { case NIO : return NioSocketChannel . class ; case EPOLL : return EpollSocketChannel . class ; default : throw new IllegalArgumentException ( "Unknown io mode: " + mode ) ; } |
public class PairtreeFactory { /** * Gets a file system based Pairtree using the supplied directory as the Pairtree root and the supplied prefix as
* the Pairtree prefix .
* @ param aPrefix A Pairtree prefix
* @ param aDirectory A directory to use for the Pairtree root
* @ return A Pairtree root
* @ throws Pa... | return new FsPairtree ( aPrefix , myVertx , getDirPath ( aDirectory ) ) ; |
public class Viewer { /** * main .
* @ param args String [ ]
* @ throws Exception e */
public static void main ( String [ ] args ) throws Exception { } } | final String storageDirectory = Parameter . STORAGE_DIRECTORY . getValue ( ) ; if ( storageDirectory == null ) { throw new IllegalArgumentException ( "Please give the javamelody storage directory with -Djavamelody.storage-directory=... containing directories with the data of one or more instances of an application" ) ;... |
public class TemplateImportVisitor { /** * - - - - - private methods - - - - - */
private DOMNode getExistingTemplate ( final String name ) { } } | try ( final Tx tx = app . tx ( ) ) { return Importer . findSharedComponentByName ( name ) ; } catch ( FrameworkException fex ) { logger . warn ( "Unable to determine if template {} already exists, ignoring." , name ) ; } return null ; |
public class SeleniumActionBuilder { /** * Page action . */
public PageActionBuilder page ( WebPage page ) { } } | PageAction action = new PageAction ( ) ; action . setPage ( page ) ; action ( action ) ; return new PageActionBuilder ( action ) ; |
public class HttpMessageConverter { /** * Determines whether the given message type supports a message body
* @ param method The HttpMethod to evaluate
* @ return Whether a message body is supported */
private boolean httpMethodSupportsBody ( HttpMethod method ) { } } | return HttpMethod . POST . equals ( method ) || HttpMethod . PUT . equals ( method ) || HttpMethod . DELETE . equals ( method ) || HttpMethod . PATCH . equals ( method ) ; |
public class Applications { /** * Creates an iterator yielding the result of the transformation applied by
* the function on the elements of the source iterator . This transformation
* is evaluated lazily when the resulting iterator is consumed . E . g :
* < code >
* transform ( [ 1,2,3 ] , toStringTransformer ... | return new TransformingIterator < > ( iterator , function ) ; |
public class AWSsignerWaiters { /** * Builds a SuccessfulSigningJob waiter by using custom parameters waiterParameters and other parameters defined in
* the waiters specification , and then polls until it determines whether the resource entered the desired state or
* not , where polling criteria is bound by either ... | return new WaiterBuilder < DescribeSigningJobRequest , DescribeSigningJobResult > ( ) . withSdkFunction ( new DescribeSigningJobFunction ( client ) ) . withAcceptors ( new SuccessfulSigningJob . IsSucceededMatcher ( ) , new SuccessfulSigningJob . IsFailedMatcher ( ) , new SuccessfulSigningJob . IsResourceNotFoundExcept... |
public class LogEvent { /** * Returns null if there is no exception logged . */
public String getExceptionStackTrace ( ) { } } | Throwable t = getException ( ) ; if ( t == null ) { return null ; } StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; t . printStackTrace ( pw ) ; return sw . toString ( ) ; |
public class DatabaseUtils { /** * Reads a Long out of a field in a Cursor and writes it to a Map .
* @ param cursor The cursor to read from
* @ param field The INTEGER field to read
* @ param values The { @ link ContentValues } to put the value into , with the field as the key */
public static void cursorLongToC... | cursorLongToContentValues ( cursor , field , values , field ) ; |
public class Perl5Util { /** * return index of the first occurence of the pattern in input text
* @ param strPattern pattern to search
* @ param strInput text to search pattern
* @ param offset
* @ param caseSensitive
* @ return position of the first occurence
* @ throws MalformedPatternException */
public ... | // Perl5Compiler compiler = new Perl5Compiler ( ) ;
PatternMatcherInput input = new PatternMatcherInput ( strInput ) ; Perl5Matcher matcher = new Perl5Matcher ( ) ; int compileOptions = caseSensitive ? 0 : Perl5Compiler . CASE_INSENSITIVE_MASK ; compileOptions += Perl5Compiler . SINGLELINE_MASK ; if ( offset < 1 ) offs... |
public class FeatureIO { /** * Reads features from a text file and returns them in an ArrayList < double [ ] > .
* @ param featuresFileName
* The text file containing the features .
* @ param featureLength
* The length of each feature .
* @ return
* @ throws Exception */
public static ArrayList < double [ ]... | ArrayList < double [ ] > features = new ArrayList < double [ ] > ( ) ; BufferedReader in = new BufferedReader ( new FileReader ( new File ( featuresFileName ) ) ) ; String line ; while ( ( line = in . readLine ( ) ) != null ) { String [ ] stringVals = line . split ( "," ) ; if ( stringVals . length != featureLength ) {... |
public class ISO9075 { /** * Decodes the < code > name < / code > .
* @ param name
* the < code > String < / code > to decode .
* @ return the decoded < code > String < / code > . */
public static String decode ( String name ) { } } | // quick check
if ( name . indexOf ( "_x" ) < 0 ) { // not encoded
return name ; } StringBuffer decoded = new StringBuffer ( ) ; Matcher m = ENCODE_PATTERN . matcher ( name ) ; while ( m . find ( ) ) { m . appendReplacement ( decoded , Character . toString ( ( char ) Integer . parseInt ( m . group ( ) . substring ( 2 ,... |
public class StringUtils { /** * region Parsing */
public static int parseInt ( String value , int defaultValue ) { } } | try { return Integer . parseInt ( value ) ; } catch ( Exception e ) { return defaultValue ; } |
public class UrlBinary { /** * ( non - Javadoc )
* @ see org . fcrepo . kernel . modeshape . FedoraBinaryImpl # getContent ( ) */
@ Override public InputStream getContent ( ) { } } | // todo - this needs to be more complete so the proxy information will
// make it up to the higher levels . Ie , so one can pass back the response information
try { return getResourceUri ( ) . toURL ( ) . openStream ( ) ; } catch ( final IOException e ) { throw new ExternalContentAccessException ( "Problems getting ext... |
public class RuleClassifier { /** * Get best and second best attributes */
protected double [ ] getBestSecondBestEntropy ( DoubleVector entropy ) { } } | double [ ] entropyValues = new double [ 2 ] ; double best = Double . MAX_VALUE ; double secondBest = Double . MAX_VALUE ; for ( int i = 0 ; i < entropy . numValues ( ) ; i ++ ) { if ( entropy . getValue ( i ) < best ) { secondBest = best ; best = entropy . getValue ( i ) ; } else { if ( entropy . getValue ( i ) < secon... |
public class BuilderSpec { /** * Returns a representation of the given { @ code @ AutoValue . Builder } class or interface . If the
* class or interface has abstract methods that could not be part of any builder , emits error
* messages and returns Optional . empty ( ) . */
private Optional < Builder > builderFrom ... | // We require the builder to have the same type parameters as the @ AutoValue class , meaning the
// same names and bounds . In principle the type parameters could have different names , but that
// would be confusing , and our code would reject it anyway because it wouldn ' t consider that
// the return type of Foo < ... |
public class AuditNotifier { /** * Returns the trigger detail information .
* @ param trigger The source trigger .
* @ return The trigger detail information . */
protected String getTriggerDetails ( Trigger trigger , NotificationContext context ) { } } | if ( trigger != null ) { String triggerString = trigger . toString ( ) ; triggerString = TemplateReplacer . applyTemplateChanges ( context , triggerString ) ; return triggerString . substring ( triggerString . indexOf ( "{" ) + 1 , triggerString . indexOf ( "}" ) ) ; } else { return "" ; } |
public class MediaChannel { /** * Enables ICE on the channel .
* An ICE - enabled channel will start an ICE Agent which gathers local
* candidates and listens to incoming STUN requests as a mean to select the
* proper address to be used during the call .
* @ param externalAddress
* The public address of the M... | if ( ! this . ice ) { this . ice = true ; this . rtcpMux = rtcpMux ; this . iceAuthenticator . generateIceCredentials ( ) ; // Enable ICE on RTP channels
this . rtpChannel . enableIce ( this . iceAuthenticator ) ; if ( ! rtcpMux ) { this . rtcpChannel . enableIce ( this . iceAuthenticator ) ; } if ( logger . isDebugEna... |
public class ResourceRegistryImpl { /** * / * ( non - Javadoc )
* @ see com . google . code . siren4j . converter . ResourceRegistry # getClassByEntityName ( java . lang . String ) */
public Class < ? > getClassByEntityName ( String name ) { } } | if ( StringUtils . isBlank ( name ) ) { throw new IllegalArgumentException ( "name cannot be null or empty." ) ; } return entries . get ( name ) ; |
public class SeaGlassRootPaneUI { /** * Uninstalls the previously installed < code > LayoutManager < / code > .
* @ param root the JRootPane . */
private void uninstallLayout ( JRootPane root ) { } } | if ( savedOldLayout != null ) { root . setLayout ( savedOldLayout ) ; savedOldLayout = null ; } |
public class Struct { /** * Returns a Map of the Fields belonging to this Struct and all its ancestors .
* Keys are the Field names . */
public Map < String , Field > getFieldsPlusParents ( ) { } } | Map < String , Field > tmp = new HashMap < String , Field > ( ) ; tmp . putAll ( fields ) ; if ( extend != null && ! extend . equals ( "" ) ) { Struct parent = contract . getStructs ( ) . get ( extend ) ; tmp . putAll ( parent . getFieldsPlusParents ( ) ) ; } return tmp ; |
public class Template { /** * Get the processor graph to use for executing all the processors for the template .
* @ return the processor graph . */
public final ProcessorDependencyGraph getProcessorGraph ( ) { } } | if ( this . processorGraph == null ) { synchronized ( this ) { if ( this . processorGraph == null ) { final Map < String , Class < ? > > attcls = new HashMap < > ( ) ; for ( Map . Entry < String , Attribute > attribute : this . attributes . entrySet ( ) ) { attcls . put ( attribute . getKey ( ) , attribute . getValue (... |
public class ActorDispatcher { /** * Processing of envelope
* @ param envelope envelope */
private void processEnvelope ( Envelope envelope ) { } } | ActorScope scope = envelope . getScope ( ) ; if ( actorSystem . getTraceInterface ( ) != null ) { actorSystem . getTraceInterface ( ) . onEnvelopeDelivered ( envelope ) ; } long start = ActorTime . currentTime ( ) ; if ( scope . getActor ( ) == null ) { if ( envelope . getMessage ( ) == PoisonPill . INSTANCE ) { // Not... |
public class App { /** * Dismiss ( click ' Cancel ' on ) a confirmation box */
public void dismissConfirmation ( ) { } } | String action = "Clicking 'Cancel' on a confirmation" ; String expected = "Confirmation is present to be clicked" ; if ( isNotConfirmation ( action , expected ) ) { return ; } dismiss ( action , expected , "confirmation" ) ; |
public class GoogleToken { /** * so we use getTokenizer ( ) and simple ignore the LT tokens . Also adds POS tags from original sentence if trivially possible . */
static List < GoogleToken > getGoogleTokens ( AnalyzedSentence sentence , boolean addStartToken , Tokenizer wordTokenizer ) { } } | List < GoogleToken > result = new ArrayList < > ( ) ; if ( addStartToken ) { result . add ( new GoogleToken ( LanguageModel . GOOGLE_SENTENCE_START , 0 , 0 ) ) ; } List < String > tokens = wordTokenizer . tokenize ( sentence . getText ( ) ) ; int startPos = 0 ; for ( String token : tokens ) { if ( ! StringTools . isWhi... |
public class TypeInference { /** * Sets the types of a named / non - destructuring function parameter to an inferred type .
* < p > This method is responsible for typing :
* < ul >
* < li > The scope slot
* < li > The param node
* < / ul > */
@ CheckReturnValue @ SuppressWarnings ( "ReferenceEquality" ) // un... | TypedVar var = containerScope . getVar ( paramName . getString ( ) ) ; checkNotNull ( var , "Missing var for parameter %s" , paramName ) ; paramName . setJSType ( inferredType ) ; if ( var . isTypeInferred ( ) ) { var . setType ( inferredType ) ; } else if ( hasDefaultValue ) { // If this is a declared type with a defa... |
public class TranslatorTypes { /** * Creates a DPT translator for the given datapoint type ID .
* The translation behavior of a DPT translator instance is uniquely defined by the
* supplied datapoint type ID .
* If the < code > dptID < / code > argument is built up the recommended way , that is " < i > main
* n... | try { final int main = getMainNumber ( mainNumber , dptID ) ; final MainType type = ( MainType ) map . get ( new Integer ( main ) ) ; if ( type != null ) return type . createTranslator ( dptID ) ; } catch ( final NumberFormatException e ) { } throw new KNXException ( "main number not found for " + dptID ) ; |
public class Message { /** * Create a MessageCreator to execute create .
* @ param pathAccountSid The SID of the Account that will create the resource
* @ param to The destination phone number
* @ param messagingServiceSid The SID of the Messaging Service you want to
* associate with the message .
* @ param b... | return new MessageCreator ( pathAccountSid , to , messagingServiceSid , body ) ; |
public class JMRandom { /** * Build random int stream int stream .
* @ param streamSize the stream size
* @ param random the random
* @ param inclusiveLowerBound the inclusive lower bound
* @ param exclusiveUpperBound the exclusive upper bound
* @ return the int stream */
public static IntStream buildRandomIn... | return buildRandomIntStream ( streamSize , ( ) -> getBoundedNumber ( random , inclusiveLowerBound , exclusiveUpperBound ) ) ; |
public class HtmlMessages { /** * < p > Set the value of the < code > infoStyle < / code > property . < / p > */
public void setInfoStyle ( java . lang . String infoStyle ) { } } | getStateHelper ( ) . put ( PropertyKeys . infoStyle , infoStyle ) ; |
public class Message { /** * Extracts the menu item type from a { @ link KnownType # MENU _ ITEM } response .
* @ return the reported type of this menu item
* @ throws IllegalArgumentException if this is not a { @ link KnownType # MENU _ ITEM } response . */
public MenuItemType getMenuItemType ( ) { } } | if ( knownType != KnownType . MENU_ITEM ) { throw new IllegalArgumentException ( "getMenuItemType() can only be used with MENU_ITEM responses." ) ; } final NumberField type = ( NumberField ) arguments . get ( 6 ) ; final MenuItemType result = MENU_ITEM_TYPE_MAP . get ( type . getValue ( ) ) ; if ( result == null ) { re... |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public BDMDatFmt createBDMDatFmtFromString ( EDataType eDataType , String initialValue ) { } } | BDMDatFmt result = BDMDatFmt . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class MultiIndex { /** * Enqueues unused segments for deletion in { @ link # deletable } . This method
* does not synchronize on { @ link # deletable } ! A caller must ensure that it
* is the only one acting on the { @ link # deletable } map .
* @ throws IOException
* if an error occurs while reading dir... | // walk through index segments
String [ ] dirNames = directoryManager . getDirectoryNames ( ) ; for ( int i = 0 ; i < dirNames . length ; i ++ ) { if ( dirNames [ i ] . startsWith ( "_" ) && ! indexNames . contains ( dirNames [ i ] ) ) { deletable . add ( dirNames [ i ] ) ; } } |
public class ExcelModuleDemoToDoItemBulkUpdateMenu { String mementoFor ( final ExcelModuleDemoToDoItemBulkUpdateManager tdieim ) { } } | final Memento memento = mementoService . create ( ) ; memento . set ( "fileName" , tdieim . getFileName ( ) ) ; memento . set ( "category" , tdieim . getCategory ( ) ) ; memento . set ( "subcategory" , tdieim . getSubcategory ( ) ) ; memento . set ( "completed" , tdieim . isComplete ( ) ) ; return memento . asString ( ... |
public class PKITools { /** * Write a single string to a file . Used to write keys
* @ param fileName String file to write to
* @ param bs bytes to write
* @ param append true to add the key to the file .
* @ throws IOException */
private void writeFile ( final String fileName , final byte [ ] bs , final boolea... | FileOutputStream fstr = null ; try { fstr = new FileOutputStream ( fileName , append ) ; fstr . write ( bs ) ; // Terminate key with newline
fstr . write ( '\n' ) ; fstr . flush ( ) ; } finally { if ( fstr != null ) { fstr . close ( ) ; } } |
public class Properties { /** * Replaces the entry for the specified key only if it is
* currently mapped to some value . */
public V replace ( K key , V value ) { } } | V curValue ; if ( ( ( curValue = get ( key ) ) != null ) || containsKey ( key ) ) { curValue = put ( key , value ) ; } return curValue ; |
public class ClobConverter { /** * { @ inheritDoc } */
public Object convert ( String value , TypeLiteral < ? > toType ) { } } | try { return new SerialClob ( value . toCharArray ( ) ) ; } catch ( Exception e ) { throw new ProvisionException ( "String value '" + value + "' is not a valid InetAddress" , e ) ; } |
public class JSDocInfoBuilder { /** * Records a parameter type to an enum .
* @ return { @ code true } if the enum ' s parameter type was recorded and
* { @ code false } if it was invalid or already defined */
public boolean recordEnumParameterType ( JSTypeExpression type ) { } } | if ( type != null && ! hasAnyTypeRelatedTags ( ) ) { currentInfo . setEnumParameterType ( type ) ; populated = true ; return true ; } else { return false ; } |
public class TreeWalker { /** * Perform a pre - order traversal non - recursive style .
* In contrast to the traverse ( ) method this method will not issue
* startDocument ( ) and endDocument ( ) events to the SAX listener .
* @ param pos Node in the tree where to start traversal
* @ throws TransformerException... | Node top = pos ; while ( null != pos ) { startNode ( pos ) ; Node nextNode = pos . getFirstChild ( ) ; while ( null == nextNode ) { endNode ( pos ) ; if ( top . equals ( pos ) ) break ; nextNode = pos . getNextSibling ( ) ; if ( null == nextNode ) { pos = pos . getParentNode ( ) ; if ( ( null == pos ) || ( top . equals... |
public class UTFDataOutputStream { /** * This method uses the { @ link String # getBytes ( String ) } method to write
* < ol >
* < li > the size of the byte array < / li >
* < li > the unicode byte sequence of this string < / li >
* < / ol >
* @ param str
* String to be written in the output stream
* @ th... | byte [ ] buffer = str . getBytes ( "UTF-8" ) ; super . writeInt ( buffer . length ) ; super . write ( buffer , 0 , buffer . length ) ; |
public class AudioMetadata { /** * Parse tags common for all audio files . */
private boolean checkSupportedAudio ( ) { } } | AudioHeader header = audioFile . getAudioHeader ( ) ; bitrate = header . getBitRateAsNumber ( ) ; sampleRate = header . getSampleRateAsNumber ( ) ; channels = header . getChannels ( ) ; if ( header . getChannels ( ) . toLowerCase ( ) . contains ( "stereo" ) ) { channels = "2" ; } if ( header instanceof MP3AudioHeader )... |
public class AWSWAFRegionalClient { /** * Permanently deletes a < a > GeoMatchSet < / a > . You can ' t delete a < code > GeoMatchSet < / code > if it ' s still used in any
* < code > Rules < / code > or if it still includes any countries .
* If you just want to remove a < code > GeoMatchSet < / code > from a < cod... | request = beforeClientExecution ( request ) ; return executeDeleteGeoMatchSet ( request ) ; |
public class VersionsImpl { /** * Gets the version info .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the VersionInfo object */
public Observable < VersionInfo > getAsync ( UUI... | return getWithServiceResponseAsync ( appId , versionId ) . map ( new Func1 < ServiceResponse < VersionInfo > , VersionInfo > ( ) { @ Override public VersionInfo call ( ServiceResponse < VersionInfo > response ) { return response . body ( ) ; } } ) ; |
public class ZoomToRectangleAddon { /** * Paint this zoom to rectangle button ! */
public void accept ( PainterVisitor visitor , Object group , Bbox bounds , boolean recursive ) { } } | map . getVectorContext ( ) . drawGroup ( group , this ) ; Coordinate c = getUpperLeftCorner ( ) ; PictureStyle pictureStyle = new PictureStyle ( 1 ) ; pictureStyle . setClassName ( "gm-ZoomToRectangleControl" ) ; map . getVectorContext ( ) . drawImage ( this , "zoom-rect-img" , Geomajas . getIsomorphicDir ( ) + "geomaj... |
public class TimeZoneNames { /** * Finds time zone name prefix matches for the input text at the
* given offset and returns a collection of the matches .
* @ param text the text .
* @ param start the starting offset within the text .
* @ param types the set of name types , or < code > null < / code > for all na... | throw new UnsupportedOperationException ( "The method is not implemented in TimeZoneNames base class." ) ; |
public class MarkLogicClient { /** * remove single triple
* @ param baseURI
* @ param subject
* @ param predicate
* @ param object
* @ param contexts */
public void sendRemove ( String baseURI , Resource subject , URI predicate , Value object , Resource ... contexts ) throws MarkLogicSesameException { } } | if ( DELETE_CACHE_ENABLED ) { timerDeleteCache . add ( subject , predicate , object , contexts ) ; } else { if ( WRITE_CACHE_ENABLED ) sync ( ) ; getClient ( ) . performRemove ( baseURI , ( Resource ) skolemize ( subject ) , ( URI ) skolemize ( predicate ) , skolemize ( object ) , this . tx , contexts ) ; } |
public class JacksonUtils { /** * Read a JSON string and parse to { @ link JsonNode } instance , with a custom class loader .
* @ param source
* @ param classLoader
* @ return */
public static JsonNode readJson ( InputStream source , ClassLoader classLoader ) { } } | return SerializationUtils . readJson ( source , classLoader ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getBFG ( ) { } } | if ( bfgEClass == null ) { bfgEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 205 ) ; } return bfgEClass ; |
public class NodeExecStats { /** * < code > optional string timeline _ label = 8 ; < / code > */
public com . google . protobuf . ByteString getTimelineLabelBytes ( ) { } } | java . lang . Object ref = timelineLabel_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; timelineLabel_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class UdpWorker { /** * On complete .
* @ param response
* the response
* @ param error
* the error
* @ param errorMessage
* the error message
* @ param stackTrace
* the stack trace
* @ param statusCode
* the status code
* @ param statusCodeInt
* the status code int */
public void onCompl... | cancelCancellable ( ) ; reply ( response , error , errorMessage , stackTrace , statusCode , statusCodeInt ) ; |
public class AsynchronousExecution { /** * If there is a pending completion notification , deliver it to the executor .
* Must be called after { @ link # setExecutorWithoutCompleting ( Executor ) } . */
@ Restricted ( NoExternalUse . class ) public synchronized final void maybeComplete ( ) { } } | assert this . executor != null ; if ( result != null ) { executor . completedAsynchronous ( result != NULL ? result : null ) ; result = null ; } |
public class NumberPath { /** * Method to construct the greater than expression for double
* @ param value the double
* @ return Expression */
public Expression < Double > gt ( double value ) { } } | String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . gt , valueString ) ; |
public class Element { /** * Scroll to this element */
@ Override public void scrollTo ( ) throws WidgetException { } } | WebElement we = findElement ( ) ; Locatable l = ( ( Locatable ) we ) ; l . getCoordinates ( ) . inViewPort ( ) ; |
public class MLSparse { /** * Gets column indices
* < tt > ic < / tt > points to an integer array of length nzmax containing the column indices of
* the corresponding elements in < tt > pr < / tt > and < tt > pi < / tt > . */
public int [ ] getIC ( ) { } } | int [ ] ic = new int [ nzmax ] ; int i = 0 ; for ( IndexMN index : indexSet ) { ic [ i ++ ] = index . n ; } return ic ; |
public class appfwpolicy_stats { /** * Use this API to fetch the statistics of all appfwpolicy _ stats resources that are configured on netscaler . */
public static appfwpolicy_stats [ ] get ( nitro_service service ) throws Exception { } } | appfwpolicy_stats obj = new appfwpolicy_stats ( ) ; appfwpolicy_stats [ ] response = ( appfwpolicy_stats [ ] ) obj . stat_resources ( service ) ; return response ; |
public class TiffEPProfile { /** * Validates that the IFD conforms the Tiff / EP standard . */
@ Override public void validate ( ) { } } | try { IFD ifd = model . getFirstIFD ( ) ; int n = 0 ; while ( ifd != null ) { validateIfd ( ifd , n ) ; ifd = ifd . getNextIFD ( ) ; n ++ ; } } catch ( Exception e ) { } |
public class Javalin { /** * Adds a WebSocket exception mapper to the instance .
* @ see < a href = " https : / / javalin . io / documentation # exception - mapping " > Exception mapping in docs < / a > */
public < T extends Exception > Javalin wsException ( @ NotNull Class < T > exceptionClass , @ NotNull WsExceptio... | wsServlet . getWsExceptionMapper ( ) . getHandlers ( ) . put ( exceptionClass , ( WsExceptionHandler < Exception > ) exceptionHandler ) ; return this ; |
public class FactorGraph { /** * Adds a variable to this factor graph , if not already present .
* @ param var The variable to add .
* @ return The node for this variable . */
public void addVar ( Var var ) { } } | int id = var . getId ( ) ; boolean alreadyAdded = ( 0 <= id && id < vars . size ( ) ) ; if ( alreadyAdded ) { if ( vars . get ( id ) != var ) { throw new IllegalStateException ( "Var id already set, but factor not yet added." ) ; } } else { // Var was not yet in the factor graph .
// Check and set the id .
if ( id != -... |
public class DefaultGroovyMethodsSupport { /** * helper method for getAt and putAt */
protected static RangeInfo subListBorders ( int size , Range range ) { } } | if ( range instanceof IntRange ) { return ( ( IntRange ) range ) . subListBorders ( size ) ; } int from = normaliseIndex ( DefaultTypeTransformation . intUnbox ( range . getFrom ( ) ) , size ) ; int to = normaliseIndex ( DefaultTypeTransformation . intUnbox ( range . getTo ( ) ) , size ) ; boolean reverse = range . isR... |
public class RetryAbsoluteAsRelativeResourceAccessor { /** * Intercepts getResourcesAsStream , the method used to retrieve resources for the master changeset
* @ param path
* @ return
* @ throws IOException */
@ Override public Set < InputStream > getResourcesAsStream ( final String path ) throws IOException { } ... | // First , try the path as specified
final Set < InputStream > streams = inner . getResourcesAsStream ( path ) ; // If no results were found and the path was absolute , retry without the leading slash
if ( ( streams == null || streams . isEmpty ( ) ) && ! path . isEmpty ( ) && path . charAt ( 0 ) == '/' ) { // Strip th... |
public class SetSubnetsRequest { /** * The IDs of the public subnets . You must specify subnets from at least two Availability Zones . You can specify
* only one subnet per Availability Zone . You must specify either subnets or subnet mappings .
* You cannot specify Elastic IP addresses for your subnets .
* @ par... | if ( subnetMappings == null ) { this . subnetMappings = null ; return ; } this . subnetMappings = new java . util . ArrayList < SubnetMapping > ( subnetMappings ) ; |
public class TreeTaggerWrapper { /** * tokenizes a given JCas object ' s document text using the treetagger program
* and adds the recognized tokens to the JCas object .
* @ param jcas JCas object supplied by the pipeline */
private void tokenize ( JCas jcas ) { } } | // read tokenized text to add tokens to the jcas
Logger . printDetail ( component , "TreeTagger (tokenization) with: " + ttprops . abbFileName ) ; EnumSet < Flag > flags = Flag . getSet ( ttprops . languageSwitch ) ; TreeTaggerTokenizer ttt ; ttprops . abbFileName = "english-abbreviations" ; if ( ttprops . abbFileName ... |
public class CommercePriceListUserSegmentEntryRelPersistenceImpl { /** * Returns the commerce price list user segment entry rels before and after the current commerce price list user segment entry rel in the ordered set where commercePriceListId = & # 63 ; .
* @ param commercePriceListUserSegmentEntryRelId the primar... | CommercePriceListUserSegmentEntryRel commercePriceListUserSegmentEntryRel = findByPrimaryKey ( commercePriceListUserSegmentEntryRelId ) ; Session session = null ; try { session = openSession ( ) ; CommercePriceListUserSegmentEntryRel [ ] array = new CommercePriceListUserSegmentEntryRelImpl [ 3 ] ; array [ 0 ] = getByCo... |
public class SpringSecurityUserManager { /** * { @ inheritDoc } */
@ Override public void disable ( User appSensorUser ) { } } | logger . info ( "Request received to disable user <{}>." , appSensorUser . getUsername ( ) ) ; if ( userDetailsManager == null ) { logger . warn ( "Could not disable user [" + appSensorUser . getUsername ( ) + "] since the spring security " + "UserDetailsManager is not properly configured." ) ; return ; } UserDetails s... |
public class AponReader { /** * Converts into a given Parameters object from a file .
* @ param < T > the generic type
* @ param file the file to parse
* @ param encoding the character encoding
* @ param parameters the Parameters object
* @ return the Parameters object
* @ throws AponParseException if readi... | if ( file == null ) { throw new IllegalArgumentException ( "file must not be null" ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "parameters must not be null" ) ; } AponReader aponReader = null ; try { if ( encoding == null ) { aponReader = new AponReader ( new FileReader ( file ) ) ; } else { ... |
public class SlotManager { /** * Removes a pending slot request identified by the given allocation id from a slot identified
* by the given slot id .
* @ param slotId identifying the slot
* @ param allocationId identifying the presumable assigned pending slot request */
private void removeSlotRequestFromSlot ( Sl... | TaskManagerSlot taskManagerSlot = slots . get ( slotId ) ; if ( null != taskManagerSlot ) { if ( taskManagerSlot . getState ( ) == TaskManagerSlot . State . PENDING && Objects . equals ( allocationId , taskManagerSlot . getAssignedSlotRequest ( ) . getAllocationId ( ) ) ) { TaskManagerRegistration taskManagerRegistrati... |
public class DescribeSnapshotsRequest { /** * The IDs of the AWS accounts that can create volumes from the snapshot .
* @ return The IDs of the AWS accounts that can create volumes from the snapshot . */
public java . util . List < String > getRestorableByUserIds ( ) { } } | if ( restorableByUserIds == null ) { restorableByUserIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return restorableByUserIds ; |
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 684:1 : assignmentOperator : ( EQUALS _ ASSIGN | PLUS _ ASSIGN | MINUS _ ASSIGN | MULT _ ASSIGN | DIV _ ASSIGN | AND _ ASSIGN | OR _ ASSIGN | XOR _ ASSIGN | MOD _ ASSIGN | LESS LESS EQUALS _ ASSIGN | ( G... | try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 685:5 : ( EQUALS _ ASSIGN | PLUS _ ASSIGN | MINUS _ ASSIGN | MULT _ ASSIGN | DIV _ ASSIGN | AND _ ASSIGN | OR _ ASSIGN | XOR _ ASSIGN | MOD _ ASSIGN | LESS LESS EQUALS _ ASSIGN | ( GREATER GREATER GREATER ) = > GREATER GREATER GREA... |
public class JChromeTabbedPane { /** * the event was consumed - DO NOT PAINT */
public void mouseReleased ( MouseEvent e ) { } } | if ( ! hasFocus ) { return ; } boolean repaint = tabRowPainter . mouseReleased ( e ) ; if ( ! repaint ) { repaint = toolbarPainter . mouseReleased ( e ) ; } |
public class AbstractMutableTimecode { /** * Sets the timecode to the provided hours , minutes , seconds and frames
* @ param hours
* @ param minutes
* @ param seconds
* @ param frames */
public void setHMSF ( int hours , int minutes , int seconds , int frames ) { } } | innerSetHMSF ( hours , minutes , seconds , frames ) ; |
public class GBSIterator { /** * Find first key in index using optimistic locking
* @ param stack The stack to use to record the traversal */
private boolean optimisticFindFirst ( DeleteStack stack ) { } } | Object q = null ; int v1 = _index . vno ( ) ; int x1 = _index . xno ( ) ; if ( ( v1 & 1 ) != 0 ) return pessimisticNeeded ; synchronized ( this ) { } try { q = getFirst ( stack ) ; } catch ( NullPointerException npe ) { // No FFDC Code Needed .
_nullPointerExceptions ++ ; return GBSTree . checkForPossibleIndexChange ( ... |
public class CqlBlockedDataReaderDAO { /** * Converts rows from a single C * row to a Record . */
private Iterator < Record > decodeRows ( Iterator < Iterable < Row > > rowGroups , final AstyanaxTable table , Placement placement ) { } } | return Iterators . transform ( rowGroups , rowGroup -> { String key = AstyanaxStorage . getContentKey ( getRawKeyFromRowGroup ( rowGroup ) ) ; return newRecordFromCql ( new Key ( table , key ) , rowGroup , placement , ByteBufferUtil . bytesToHex ( getRawKeyFromRowGroupOrNull ( rowGroup ) ) ) ; } ) ; |
public class Aggregation { /** * is within XFF , otherwise return NaN . */
private Double aggregate ( Datasource ds , Collection < Double > values ) { } } | return ( ( values . size ( ) / m_intervalsPer ) > ds . getXff ( ) ) ? ds . getAggregationFuction ( ) . apply ( values ) : Double . NaN ; |
public class ISOS { /** * Vote for neighbors not being outliers . The key method of SOS .
* @ param ignore Object to ignore
* @ param di Neighbor object IDs .
* @ param p Probabilities
* @ param norm Normalization factor ( 1 / sum )
* @ param scores Output score storage */
public static void nominateNeighbors... | for ( di . seek ( 0 ) ; di . valid ( ) ; di . advance ( ) ) { if ( DBIDUtil . equal ( ignore , di ) ) { continue ; } double v = p [ di . getOffset ( ) ] * norm ; // Normalize
if ( ! ( v > 0 ) ) { break ; } scores . increment ( di , FastMath . log1p ( - v ) ) ; } |
public class ListUtil { /** * cast a Object Array to a String Array
* @ param array
* @ return String Array
* @ throws PageException */
public static String [ ] toStringArray ( Array array ) throws PageException { } } | String [ ] arr = new String [ array . size ( ) ] ; for ( int i = 0 ; i < arr . length ; i ++ ) { arr [ i ] = Caster . toString ( array . get ( i + 1 , null ) ) ; } return arr ; |
public class JodaBeanXmlReader { /** * reader can be anywhere , but normally at StartDocument */
private StartElement advanceToStartElement ( ) throws Exception { } } | while ( reader . hasNext ( ) ) { XMLEvent event = nextEvent ( "advnc " ) ; if ( event . isStartElement ( ) ) { return event . asStartElement ( ) ; } } throw new IllegalArgumentException ( "Unexpected end of document" ) ; |
public class Random { /** * Generates a permutation of given array . */
public void permutate ( int [ ] x ) { } } | for ( int i = 0 ; i < x . length ; i ++ ) { int j = i + nextInt ( x . length - i ) ; Math . swap ( x , i , j ) ; } |
public class ManagedApplication { /** * Check the scoped instances states with respect to missed heart beats .
* @ param notificationMngr */
public void checkStates ( INotificationMngr notificationMngr ) { } } | // Check the status of scoped instances
Collection < Instance > scopedInstances = InstanceHelpers . findAllScopedInstances ( this . application ) ; for ( Instance scopedInstance : scopedInstances ) { // Never started instances ,
// or scoped instances that have been stopped by an agent ,
// are not processed anymore he... |
public class BatchGetPartitionResult { /** * A list of the partition values in the request for which partions were not returned .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setUnprocessedKeys ( java . util . Collection ) } or { @ link # withUnprocessedKe... | if ( this . unprocessedKeys == null ) { setUnprocessedKeys ( new java . util . ArrayList < PartitionValueList > ( unprocessedKeys . length ) ) ; } for ( PartitionValueList ele : unprocessedKeys ) { this . unprocessedKeys . add ( ele ) ; } return this ; |
public class AdSenseSettings { /** * Gets the fontFamily value for this AdSenseSettings .
* @ return fontFamily * Specifies the font family of the { @ link AdUnit } . This attribute
* is optional
* and defaults to the ad unit ' s parent or ancestor ' s
* setting if one has been
* set . If no ancestor of the a... | return fontFamily ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.