signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Dbi { /** * Iterate the database from the first / last item and forwards / backwards . * @ param txn transaction handle ( not null ; not committed ) * @ param type direction of iterator ( not null ) * @ return iterator ( never null ) * @ deprecated use iterate method with a { @ link KeyRange } instead */ @ Deprecated public CursorIterator < T > iterate ( final Txn < T > txn , final IteratorType type ) { } }
if ( SHOULD_CHECK ) { requireNonNull ( type ) ; } final KeyRange < T > range = type == FORWARD ? all ( ) : allBackward ( ) ; return iterate ( txn , range ) ;
public class CommandLine { /** * Sets a new { @ code IHelpFactory } to customize the usage help message . * @ param helpFactory the new help factory . Must be non - { @ code null } . * < p > The specified setting will be registered with this { @ code CommandLine } and the full hierarchy of its * subcommands and nested sub - subcommands < em > at the moment this method is called < / em > . Subcommands added * later will have the default setting . To ensure a setting is applied to all * subcommands , call the setter last , after adding subcommands . < / p > * @ return this { @ code CommandLine } object , to allow method chaining * @ since 3.9 */ public CommandLine setHelpFactory ( IHelpFactory helpFactory ) { } }
getCommandSpec ( ) . usageMessage ( ) . helpFactory ( helpFactory ) ; for ( CommandLine command : getCommandSpec ( ) . subcommands ( ) . values ( ) ) { command . setHelpFactory ( helpFactory ) ; } return this ;
public class UrlMatchFilter { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . util . ObjectFilter # filterObject ( java . lang . Object ) */ public int filterObject ( CaptureSearchResult r ) { } }
String resultUrl = r . getUrlKey ( ) ; return url . equals ( resultUrl ) ? FILTER_INCLUDE : FILTER_ABORT ;
public class GitOperations { /** * Pull repository from current branch and remote branch with same name as current * @ param git * instance . * @ param remote * to be used . * @ param remoteBranch * to use . */ public PullResult pullFromRepository ( Git git , String remote , String remoteBranch ) { } }
try { return git . pull ( ) . setRemote ( remote ) . setRemoteBranchName ( remoteBranch ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; }
public class SequenceLabelerME { /** * Decode Sequences from an array of Strings . * @ param preds * the sequences in an string array . * @ return the decoded sequences */ public String [ ] decodeSequences ( final String [ ] preds ) { } }
final List < String > decodedSequences = new ArrayList < > ( ) ; for ( String pred : preds ) { pred = startPattern . matcher ( pred ) . replaceAll ( "B-$1" ) ; pred = contPattern . matcher ( pred ) . replaceAll ( "I-$1" ) ; pred = lastPattern . matcher ( pred ) . replaceAll ( "I-$1" ) ; pred = unitPattern . matcher ( pred ) . replaceAll ( "B-$1" ) ; pred = otherPattern . matcher ( pred ) . replaceAll ( "O" ) ; decodedSequences . add ( pred ) ; } return decodedSequences . toArray ( new String [ decodedSequences . size ( ) ] ) ;
public class CPDefinitionSpecificationOptionValuePersistenceImpl { /** * Returns the cp definition specification option value where CPDefinitionId = & # 63 ; and CPDefinitionSpecificationOptionValueId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param CPDefinitionId the cp definition ID * @ param CPDefinitionSpecificationOptionValueId the cp definition specification option value ID * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching cp definition specification option value , or < code > null < / code > if a matching cp definition specification option value could not be found */ @ Override public CPDefinitionSpecificationOptionValue fetchByC_CSOVI ( long CPDefinitionId , long CPDefinitionSpecificationOptionValueId , boolean retrieveFromCache ) { } }
Object [ ] finderArgs = new Object [ ] { CPDefinitionId , CPDefinitionSpecificationOptionValueId } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_CSOVI , finderArgs , this ) ; } if ( result instanceof CPDefinitionSpecificationOptionValue ) { CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue = ( CPDefinitionSpecificationOptionValue ) result ; if ( ( CPDefinitionId != cpDefinitionSpecificationOptionValue . getCPDefinitionId ( ) ) || ( CPDefinitionSpecificationOptionValueId != cpDefinitionSpecificationOptionValue . getCPDefinitionSpecificationOptionValueId ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_SELECT_CPDEFINITIONSPECIFICATIONOPTIONVALUE_WHERE ) ; query . append ( _FINDER_COLUMN_C_CSOVI_CPDEFINITIONID_2 ) ; query . append ( _FINDER_COLUMN_C_CSOVI_CPDEFINITIONSPECIFICATIONOPTIONVALUEID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( CPDefinitionId ) ; qPos . add ( CPDefinitionSpecificationOptionValueId ) ; List < CPDefinitionSpecificationOptionValue > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_CSOVI , finderArgs , list ) ; } else { CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue = list . get ( 0 ) ; result = cpDefinitionSpecificationOptionValue ; cacheResult ( cpDefinitionSpecificationOptionValue ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_CSOVI , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CPDefinitionSpecificationOptionValue ) result ; }
public class ByteBufferUtil { /** * changes bb position */ public static void writeShortLength ( ByteBuffer bb , int length ) { } }
bb . put ( ( byte ) ( ( length >> 8 ) & 0xFF ) ) ; bb . put ( ( byte ) ( length & 0xFF ) ) ;
public class CPDefinitionOptionValueRelPersistenceImpl { /** * Returns the first cp definition option value rel in the ordered set where CPDefinitionOptionRelId = & # 63 ; . * @ param CPDefinitionOptionRelId the cp definition option rel ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition option value rel , or < code > null < / code > if a matching cp definition option value rel could not be found */ @ Override public CPDefinitionOptionValueRel fetchByCPDefinitionOptionRelId_First ( long CPDefinitionOptionRelId , OrderByComparator < CPDefinitionOptionValueRel > orderByComparator ) { } }
List < CPDefinitionOptionValueRel > list = findByCPDefinitionOptionRelId ( CPDefinitionOptionRelId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class PreferenceActivity { /** * Handles the intent extra , which specifies , whether the progress should be shown , when the * activity is used as a wizard , or not . * @ param extras * The extras of the intent , which has been used to start the activity , as an instance * of the class { @ link Bundle } . The bundle may not be null */ private void handleShowProgressIntent ( @ NonNull final Bundle extras ) { } }
if ( extras . containsKey ( EXTRA_SHOW_PROGRESS ) ) { showProgress ( extras . getBoolean ( EXTRA_SHOW_PROGRESS ) ) ; }
public class ConcurrentHashSet { /** * { @ inheritDoc } */ @ Override public boolean add ( final E elem ) { } }
return ( this . delegate . put ( elem , Nothing . NOTHING ) == null ) ;
public class ExpressionBuilder { /** * Appends a less than test to the condition . * @ param trigger the trigger field . * @ param compare the value to use in the compare . * @ return this ExpressionBuilder . */ public ExpressionBuilder lessThan ( final SubordinateTrigger trigger , final Object compare ) { } }
BooleanExpression exp = new CompareExpression ( CompareType . LESS_THAN , trigger , compare ) ; appendExpression ( exp ) ; return this ;
public class WSubMenu { /** * Returns the accesskey character as a String . If the character is not a letter or digit then < code > null < / code > is * returned . * @ return The accesskey character as a String ( may be < code > null < / code > ) . */ public String getAccessKeyAsString ( ) { } }
char accessKey = getAccessKey ( ) ; if ( Character . isLetterOrDigit ( accessKey ) ) { return String . valueOf ( accessKey ) ; } return null ;
public class DirectoryScanner { /** * Ensure that the in | exclude & quot ; patterns & quot ; * have been properly divided up . * @ since Ant 1.6.3 */ private synchronized void ensureNonPatternSetsReady ( ) { } }
if ( ! areNonPatternSetsReady ) { includePatterns = fillNonPatternSet ( includeNonPatterns , includes ) ; excludePatterns = fillNonPatternSet ( excludeNonPatterns , excludes ) ; areNonPatternSetsReady = true ; }
public class AbstractBaseCommand { /** * { @ inheritDoc } */ @ Override public final Wave run ( final Wave wave ) { } }
// If given wave is null // Build a default Wave to avoid NullPointerException when // command was directly called by its run ( ) method final Wave commandWave = wave == null ? WBuilder . callCommand ( this . getClass ( ) ) : wave ; // Wrap the command into a custom runnable that will be run final CommandRunnable commandRunnable = new CommandRunnable ( this . getClass ( ) . getSimpleName ( ) , this , commandWave ) ; final WaveData < Boolean > syncData = wave != null ? wave . getData ( JRebirthWaves . FORCE_SYNC_COMMAND ) : null ; // Add the runnable to the runner queue run it as soon as possible // But force synchronous execution if the wave contains the flag if ( syncData == null && isSyncRun ( ) || syncData != null && syncData . value ( ) ) { // Force sync run ( blocking call ) JRebirth . runSync ( getRunInto ( ) , commandRunnable , 5000 ) ; } else { // Normal run JRebirth . run ( getRunInto ( ) , commandRunnable ) ; } return commandWave ;
public class CurrencyAmount { /** * Converts a big decimal into a canonical string representation . A < code > null < / code > argument will return < code > null < / code > . * @ param amount * Amount to convert . * @ return Amount as string . */ public static String amountToStr ( final BigDecimal amount ) { } }
if ( amount == null ) { return null ; } final BigInteger unscaled = amount . unscaledValue ( ) ; if ( unscaled . equals ( BigInteger . ZERO ) ) { return "0." + repeat ( amount . scale ( ) , '0' ) ; } final String unscaledStr = unscaled . toString ( ) ; if ( amount . scale ( ) == 0 ) { return unscaledStr ; } final int p = unscaledStr . length ( ) - amount . scale ( ) ; if ( p == 0 ) { return "0." + unscaledStr ; } return unscaledStr . substring ( 0 , p ) + "." + unscaledStr . substring ( p ) ;
public class QueryLexer { /** * $ ANTLR start " APPROXIMATELY " */ public final void mAPPROXIMATELY ( ) throws RecognitionException { } }
try { int _type = APPROXIMATELY ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / riemann / Query . g : 8:15 : ( ' = ~ ' ) // src / riemann / Query . g : 8:17 : ' = ~ ' { match ( "=~" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class CommerceShippingFixedOptionRelPersistenceImpl { /** * Returns all the commerce shipping fixed option rels where commerceShippingFixedOptionId = & # 63 ; . * @ param commerceShippingFixedOptionId the commerce shipping fixed option ID * @ return the matching commerce shipping fixed option rels */ @ Override public List < CommerceShippingFixedOptionRel > findByCommerceShippingFixedOptionId ( long commerceShippingFixedOptionId ) { } }
return findByCommerceShippingFixedOptionId ( commerceShippingFixedOptionId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class WrapperProxyState { /** * Reconnects to an actual wrapper . This method must only be called if { @ link # ivWrapper } is null . This method either reconnects this state * object , returns a new state object , or throws an EJBException to indicate * that the state could not be reconnected . Note that a returned state * object might be disconnected by another thread before the caller has an * opportunity to obtain the wrapper . * @ return a possibly disconnected state * @ throws EJBException if the state cannot be updated */ final WrapperProxyState reconnect ( ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "reconnect: " + this ) ; HomeOfHomes homeOfHomes = EJSContainer . homeOfHomes ; J2EEName j2eeName ; if ( ivUnversionedJ2EEName == null ) { j2eeName = ivJ2EEName ; } else { j2eeName = homeOfHomes . getVersionedJ2EEName ( ivUnversionedJ2EEName ) ; } EJSHome home = ( EJSHome ) homeOfHomes . getHome ( j2eeName ) ; if ( home == null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "reconnect: stopped" ) ; throw new EJBException ( "The referenced " + j2eeName . getComponent ( ) + " bean in the " + j2eeName . getModule ( ) + " module in the " + j2eeName . getApplication ( ) + " application has been stopped and must be started again to be used." ) ; } WrapperProxyState state ; try { state = reconnect ( home ) ; } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , getClass ( ) . getName ( ) + ".update" , "225" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "reconnect" , ex ) ; throw new EJBException ( ex ) ; } // Note that if this state was previously disconnected but the // application was not actually stopped ( e . g . , because the wrapper was // evicted from the wrapper cache ) , then the call to update above might // have simply reconnected and returned this same state object . if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "reconnect" ) ; return state ;
public class NeuralNetwork { /** * Predict the target value of a given instance . Note that this method is NOT * multi - thread safe . * @ param x the instance . * @ param y the array to store network output on output . For softmax * activation function , these are estimated posteriori probabilities . * @ return the predicted class label . */ @ Override public int predict ( double [ ] x , double [ ] y ) { } }
setInput ( x ) ; propagate ( ) ; getOutput ( y ) ; if ( outputLayer . units == 1 ) { if ( outputLayer . output [ 0 ] > 0.5 ) { return 0 ; } else { return 1 ; } } double max = Double . NEGATIVE_INFINITY ; int label = - 1 ; for ( int i = 0 ; i < outputLayer . units ; i ++ ) { if ( outputLayer . output [ i ] > max ) { max = outputLayer . output [ i ] ; label = i ; } } return label ;
public class AbstractService { /** * { @ inheritDoc } * @ throws IllegalStateException * if the current service state does not permit * this action */ @ Override public synchronized void stop ( ) { } }
if ( state == STATE . STOPPED || state == STATE . INITED || state == STATE . NOTINITED ) { // already stopped , or else it was never // started ( eg another service failing canceled startup ) return ; } ensureCurrentState ( STATE . STARTED ) ; changeState ( STATE . STOPPED ) ; LOG . info ( "Service:" + getName ( ) + " is stopped." ) ;
public class Type { /** * Add a root Classification to this type . * @ param _ classification classifixation that classifies this type */ protected void addClassifiedByType ( final Classification _classification ) { } }
this . checked4classifiedBy = true ; this . classifiedByTypes . add ( _classification . getId ( ) ) ; setDirty ( ) ;
public class BeanDescImpl { protected void setupPropertyDescs ( ) { } }
final Method [ ] methods = beanClass . getMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { final Method method = methods [ i ] ; if ( LdiMethodUtil . isBridgeMethod ( method ) || LdiMethodUtil . isSyntheticMethod ( method ) ) { continue ; } final String methodName = method . getName ( ) ; if ( methodName . startsWith ( "get" ) ) { if ( method . getParameterTypes ( ) . length != 0 || methodName . equals ( "getClass" ) || method . getReturnType ( ) == void . class ) { continue ; } final String propertyName = decapitalizePropertyName ( methodName . substring ( 3 ) ) ; setupReadMethod ( method , propertyName ) ; } else if ( methodName . startsWith ( "is" ) ) { if ( method . getParameterTypes ( ) . length != 0 || ! method . getReturnType ( ) . equals ( Boolean . TYPE ) && ! method . getReturnType ( ) . equals ( Boolean . class ) ) { continue ; } final String propertyName = decapitalizePropertyName ( methodName . substring ( 2 ) ) ; setupReadMethod ( method , propertyName ) ; } else if ( methodName . startsWith ( "set" ) ) { if ( method . getParameterTypes ( ) . length != 1 || methodName . equals ( "setClass" ) || method . getReturnType ( ) != void . class ) { continue ; } final String propertyName = decapitalizePropertyName ( methodName . substring ( 3 ) ) ; setupWriteMethod ( method , propertyName ) ; } } for ( Iterator < ? > i = invalidPropertyNames . iterator ( ) ; i . hasNext ( ) ; ) { propertyDescCache . remove ( i . next ( ) ) ; } invalidPropertyNames . clear ( ) ;
public class NtFileNodeRepresentationFactory { /** * ( non - Javadoc ) * @ see * org . exoplatform . services . jcr . ext . resource . NodeRepresentationFactory # createNodeRepresentation ( * javax . jcr . Node , java . lang . String ) */ public NodeRepresentation createNodeRepresentation ( Node node , String mediaTypeHint ) { } }
try { NodeRepresentation content = nodeRepresentationService . getNodeRepresentation ( node . getNode ( "jcr:content" ) , mediaTypeHint ) ; // return nodeRepresentationService . getNodeRepresentation ( node . getNode ( " jcr : content " ) , // mediaTypeHint ) ; return new NtFileNodeRepresentation ( node , content ) ; } catch ( RepositoryException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } return null ;
public class ListenParamExtension { /** * Resolve generic specified directly in listener parameter ( e . g . { @ code QueryListener < Model > } ) . It would be * useful if , for some reason , correct type could not be resolved from listener instance ( in most cases it * would be possible ) . * @ param generics repository method generics context * @ param listenerType type of specified listener * @ param position listener parameter position * @ return resolved generic or Object */ private Class < ? > resolveListenerGeneric ( final MethodGenericsContext generics , final Class listenerType , final int position ) { } }
// TO BE IMPROVED here must be correct resolution of RequiresRecordConversion generic , but it requires // some improvements in generics - resolver // In most cases even this simplified implementation will work if ( RequiresRecordConversion . class . isAssignableFrom ( listenerType ) && listenerType . getTypeParameters ( ) . length > 0 ) { try { // questionable assumption that the first generic is a target type , but will work in most cases return generics . resolveGenericOf ( generics . currentMethod ( ) . getGenericParameterTypes ( ) [ position ] ) ; } catch ( Exception ex ) { // never happen throw new IllegalStateException ( "Parameter generic resolution failed" , ex ) ; } } return Object . class ;
public class AmazonECSWaiters { /** * Builds a TasksStopped 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 default polling strategy or custom polling strategy . */ public Waiter < DescribeTasksRequest > tasksStopped ( ) { } }
return new WaiterBuilder < DescribeTasksRequest , DescribeTasksResult > ( ) . withSdkFunction ( new DescribeTasksFunction ( client ) ) . withAcceptors ( new TasksStopped . IsSTOPPEDMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 100 ) , new FixedDelayStrategy ( 6 ) ) ) . withExecutorService ( executorService ) . build ( ) ;
public class Module { /** * Adds an artifact to the module . * INFO : If the module is promoted , all added artifacts will be promoted . * @ param artifact Artifact */ public void addArtifact ( final Artifact artifact ) { } }
if ( ! artifacts . contains ( artifact ) ) { if ( promoted ) { artifact . setPromoted ( promoted ) ; } artifacts . add ( artifact ) ; }
public class PropertiesAdapter { /** * Converts this { @ link PropertiesAdapter } into a { @ link Map } . * @ return a { @ link Map } containing the properties and values of this { @ link PropertiesAdapter } . * @ see java . util . Map * @ see # iterator ( ) * @ see # get ( String ) */ public Map < String , String > toMap ( ) { } }
Map < String , String > map = new HashMap < > ( size ( ) ) ; for ( String propertyName : this ) { map . put ( propertyName , get ( propertyName ) ) ; } return map ;
public class CommerceAddressRestrictionPersistenceImpl { /** * Returns a range of all the commerce address restrictions where commerceCountryId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceAddressRestrictionModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param commerceCountryId the commerce country ID * @ param start the lower bound of the range of commerce address restrictions * @ param end the upper bound of the range of commerce address restrictions ( not inclusive ) * @ return the range of matching commerce address restrictions */ @ Override public List < CommerceAddressRestriction > findByCommerceCountryId ( long commerceCountryId , int start , int end ) { } }
return findByCommerceCountryId ( commerceCountryId , start , end , null ) ;
public class DropinMonitor { /** * Not thread safe : only call from threadsafe method * @ param newMonitoredFolder * @ return */ private File updateMonitoredDirectory ( String newMonitoredFolder ) { } }
File oldDir = monitoredDirectory . get ( ) ; File newDir = new File ( newMonitoredFolder ) ; // If it is relative , resolve against server dir if ( ! ! ! newDir . isAbsolute ( ) ) { newMonitoredFolder = locationService . resolveString ( WsLocationConstants . SYMBOL_SERVER_CONFIG_DIR + newMonitoredFolder ) ; newDir = new File ( newMonitoredFolder ) ; } if ( ! ! ! newDir . equals ( oldDir ) ) { if ( monitoredDirectory . compareAndSet ( oldDir , newDir ) ) { for ( ServiceReg < FileMonitor > mon : _monitors . values ( ) ) { mon . unregister ( ) ; } _monitors . clear ( ) ; if ( ! ! ! newDir . exists ( ) ) { createdMonitoredDir . set ( newDir . mkdirs ( ) ) ; } } else { oldDir = null ; } } else { oldDir = null ; } return oldDir ;
public class SqlServerParser { /** * 获取查询列 * @ param plainSelect * @ return */ protected List < SelectItem > getSelectItems ( PlainSelect plainSelect ) { } }
// 设置selectItems List < SelectItem > selectItems = new ArrayList < SelectItem > ( ) ; for ( SelectItem selectItem : plainSelect . getSelectItems ( ) ) { // 别名需要特殊处理 if ( selectItem instanceof SelectExpressionItem ) { SelectExpressionItem selectExpressionItem = ( SelectExpressionItem ) selectItem ; if ( selectExpressionItem . getAlias ( ) != null ) { // 直接使用别名 Column column = new Column ( selectExpressionItem . getAlias ( ) . getName ( ) ) ; SelectExpressionItem expressionItem = new SelectExpressionItem ( column ) ; selectItems . add ( expressionItem ) ; } else if ( selectExpressionItem . getExpression ( ) instanceof Column ) { Column column = ( Column ) selectExpressionItem . getExpression ( ) ; SelectExpressionItem item = null ; if ( column . getTable ( ) != null ) { Column newColumn = new Column ( column . getColumnName ( ) ) ; item = new SelectExpressionItem ( newColumn ) ; selectItems . add ( item ) ; } else { selectItems . add ( selectItem ) ; } } else { selectItems . add ( selectItem ) ; } } else if ( selectItem instanceof AllTableColumns ) { selectItems . add ( new AllColumns ( ) ) ; } else { selectItems . add ( selectItem ) ; } } // SELECT * , 1 AS alias FROM TEST // 应该为 // SELECT * FROM ( SELECT * , 1 AS alias FROM TEST ) // 不应该为 // SELECT * , alias FROM ( SELECT * , 1 AS alias FROM TEST ) for ( SelectItem selectItem : selectItems ) { if ( selectItem instanceof AllColumns ) { return Collections . singletonList ( selectItem ) ; } } return selectItems ;
public class SecurityContextImpl { /** * Read the security context * @ param fields * @ throws IOException if there are I / O errors while reading from the underlying InputStream */ private void readState ( GetField fields ) throws IOException { } }
// get caller principal callerPrincipal = ( WSPrincipal ) fields . get ( CALLER_PRINCIPAL , null ) ; // get boolean marking if subjects are equal subjectsAreEqual = fields . get ( SUBJECTS_ARE_EQUAL , false ) ; // only deserialize invocation principal if it ' s different from the caller if ( ! subjectsAreEqual ) { // get invocation principal invocationPrincipal = ( WSPrincipal ) fields . get ( INVOCATION_PRINCIPAL , null ) ; } else { invocationPrincipal = callerPrincipal ; } jaasLoginContextEntry = ( String ) fields . get ( JAAS_LOGIN_CONTEXT , null ) ; callerSubjectCacheKey = ( String ) fields . get ( CALLER_SUBJECT_CACHE_KEY , null ) ; invocationSubjectCacheKey = ( String ) fields . get ( INVOCATION_SUBJECT_CACHE_KEY , null ) ;
public class PropertyDoesNotExistCriterion { /** * Render the SQL fragment that corresponds to this criterion . * @ param criteria The local criteria * @ param criteriaQuery The overal criteria query * @ return The generated SQL fragment * @ throws org . hibernate . HibernateException Problem during rendering . */ public String toSqlString ( Criteria criteria , CriteriaQuery criteriaQuery ) throws HibernateException { } }
String [ ] columns ; try { columns = criteriaQuery . getColumnsUsingProjection ( criteria , propertyName ) ; } catch ( QueryException e ) { columns = new String [ 0 ] ; } // if there are columns that map the given property . . the property exists , so we don ' t need to add anything to the sql return columns . length > 0 ? "FALSE" : "TRUE" ;
public class LeapSeconds { /** * / * [ deutsch ] * < p > Vergleicht zwei Schaltsekundenereignisse nach ihrem Datum in * aufsteigender Reihenfolge . < / p > * @ param o1 first leap second event * @ param o2 second leap second event * @ return { @ code - 1 } , { @ code 0 } or { @ code 1 } if first event is before , * equal to or later than second event * @ since 2.3 */ @ Override public int compare ( LeapSecondEvent o1 , LeapSecondEvent o2 ) { } }
GregorianDate d1 = o1 . getDate ( ) ; GregorianDate d2 = o2 . getDate ( ) ; int y1 = d1 . getYear ( ) ; int y2 = d2 . getYear ( ) ; if ( y1 < y2 ) { return - 1 ; } else if ( y1 > y2 ) { return 1 ; } int m1 = d1 . getMonth ( ) ; int m2 = d2 . getMonth ( ) ; if ( m1 < m2 ) { return - 1 ; } else if ( m1 > m2 ) { return 1 ; } int dom1 = d1 . getDayOfMonth ( ) ; int dom2 = d2 . getDayOfMonth ( ) ; return ( dom1 < dom2 ? - 1 : ( dom1 == dom2 ? 0 : 1 ) ) ;
public class PluginManager { /** * Calls the specified function with the specified arguments . This is used for v2 response overrides * @ param className name of class * @ param methodName name of method * @ param pluginArgs plugin arguments * @ param args arguments to supply to function * @ throws Exception exception */ public void callFunction ( String className , String methodName , PluginArguments pluginArgs , Object ... args ) throws Exception { } }
Class < ? > cls = getClass ( className ) ; ArrayList < Object > newArgs = new ArrayList < > ( ) ; newArgs . add ( pluginArgs ) ; com . groupon . odo . proxylib . models . Method m = preparePluginMethod ( newArgs , className , methodName , args ) ; m . getMethod ( ) . invoke ( cls , newArgs . toArray ( new Object [ 0 ] ) ) ;
public class CodecCollector { /** * Intersected doc list . * @ param facetDocList * the facet doc list * @ param docSet * the doc set * @ return the integer [ ] */ private static Integer [ ] intersectedDocList ( int [ ] facetDocList , Integer [ ] docSet ) { } }
if ( facetDocList != null && docSet != null ) { Integer [ ] c = new Integer [ Math . min ( facetDocList . length , docSet . length ) ] ; int ai = 0 ; int bi = 0 ; int ci = 0 ; while ( ai < facetDocList . length && bi < docSet . length ) { if ( facetDocList [ ai ] < docSet [ bi ] ) { ai ++ ; } else if ( facetDocList [ ai ] > docSet [ bi ] ) { bi ++ ; } else { if ( ci == 0 || facetDocList [ ai ] != c [ ci - 1 ] ) { c [ ci ++ ] = facetDocList [ ai ] ; } ai ++ ; bi ++ ; } } return Arrays . copyOfRange ( c , 0 , ci ) ; } return new Integer [ ] { } ;
public class TransformerIdentityImpl { /** * Receive notification of the beginning of the document . * < p > By default , do nothing . Application writers may override this * method in a subclass to take specific actions at the beginning * of a document ( such as allocating the root node of a tree or * creating an output file ) . < / p > * @ throws org . xml . sax . SAXException Any SAX exception , possibly * wrapping another exception . * @ see org . xml . sax . ContentHandler # startDocument * @ throws SAXException */ public void startDocument ( ) throws SAXException { } }
try { if ( null == m_resultContentHandler ) createResultContentHandler ( m_result ) ; } catch ( TransformerException te ) { throw new SAXException ( te . getMessage ( ) , te ) ; } // Reset for multiple transforms with this transformer . m_flushedStartDoc = false ; m_foundFirstElement = false ;
public class URI { /** * Set the query . * When a query string is not misunderstood the reserved special characters * ( " & amp ; " , " = " , " + " , " , " , and " $ " ) within a query component , it is * recommended to use in encoding the whole query with this method . * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from < code > URI < / code > . So refer to the same - named APIs * implemented in each specific protocol instance . * @ param query the query string . * @ throws URIException incomplete trailing escape pattern or unsupported * character encoding * @ see # encode */ public void setQuery ( String query ) throws URIException { } }
if ( query == null || query . length ( ) == 0 ) { _query = ( query == null ) ? null : query . toCharArray ( ) ; setURI ( ) ; return ; } setRawQuery ( encode ( query , allowed_query , getProtocolCharset ( ) ) ) ;
public class KafkaConfiguration { /** * Get all configuration values in a Properties object * @ return the properties */ public Properties asProperties ( ) { } }
final Properties props = new Properties ( ) ; other . forEach ( props :: setProperty ) ; props . setProperty ( "bootstrap.servers" , bootstrapServers ) ; return props ;
public class BaseDaoImpl { /** * 查看一条数据 ( 对象 ) */ @ Override public T getById ( Long id ) { } }
String getById = "find" + clazz . getSimpleName ( ) + "ById" ; // findSysUserById return method System . out . println ( clazz . getSimpleName ( ) + "按ID查" ) ; return sqlSessionTemplate . selectOne ( getById , id ) ;
public class MlBaseState { /** * マージを実行するかの判定を行う 。 < br > * 前回のマージ時刻から 「 状態マージ間隔 」 以上の時間が経過していた場合 、 マージ実行と判定する 。 * @ return 状態マージを実行する場合true 、 行わない場合false */ protected boolean isExecuteMerge ( ) { } }
long elapsedTimeMs = getCurrentTime ( ) - this . previousMergeTime ; if ( elapsedTimeMs >= TimeUnit . SECONDS . toMillis ( this . mergeInterval ) ) { return true ; } return false ;
public class TemplateParserContext { /** * Return the fully qualified name for a given class . Only works if the class has been imported . * @ param className The name of the class to get the fully qualified name of * @ return The fully qualified name , or the className if it ' s unknown */ public String getFullyQualifiedNameForClassName ( String className ) { } }
if ( ! classNameToFullyQualifiedName . containsKey ( className ) ) { return className ; } return classNameToFullyQualifiedName . get ( className ) ;
public class AmazonDynamoDBClient { /** * Returns information about the table , including the current status of the table , when it was created , the primary * key schema , and any indexes on the table . * < note > * If you issue a < code > DescribeTable < / code > request immediately after a < code > CreateTable < / code > request , DynamoDB * might return a < code > ResourceNotFoundException < / code > . This is because < code > DescribeTable < / code > uses an * eventually consistent query , and the metadata for your table might not be available at that moment . Wait for a * few seconds , and then try the < code > DescribeTable < / code > request again . * < / note > * @ param describeTableRequest * Represents the input of a < code > DescribeTable < / code > operation . * @ return Result of the DescribeTable operation returned by the service . * @ throws ResourceNotFoundException * The operation tried to access a nonexistent table or index . The resource might not be specified * correctly , or its status might not be < code > ACTIVE < / code > . * @ throws InternalServerErrorException * An error occurred on the server side . * @ sample AmazonDynamoDB . DescribeTable * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dynamodb - 2012-08-10 / DescribeTable " target = " _ top " > AWS API * Documentation < / a > */ @ Override public DescribeTableResult describeTable ( DescribeTableRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeTable ( request ) ;
public class StringUtil { /** * Trim optional white - space characters from the specified value , * according to < a href = " https : / / tools . ietf . org / html / rfc7230 # section - 7 " > RFC - 7230 < / a > . * @ param value the value to trim * @ return { @ link CharSequence } the trimmed value if necessary , or the value unchanged */ public static CharSequence trimOws ( CharSequence value ) { } }
final int length = value . length ( ) ; if ( length == 0 ) { return value ; } int start = indexOfFirstNonOwsChar ( value , length ) ; int end = indexOfLastNonOwsChar ( value , start , length ) ; return start == 0 && end == length - 1 ? value : value . subSequence ( start , end + 1 ) ;
public class XExtensionManager { /** * Retrieves an extension by its prefix . If no extension by that prefix * can be found , this method returns < code > null < / code > . * @ param prefix The prefix of the requested extension . * @ return The requested extension ( may be < code > null < / code > , if it * cannot be found ) . */ public XExtension getByPrefix ( String prefix ) { } }
for ( XExtension ext : extensionList ) { if ( ext . getPrefix ( ) . equals ( prefix ) ) { return ext ; } } return null ;
public class AuthFilterJAAS { /** * Performs the authentication . Once a Subject is obtained , it is stored in * the users session . Subsequent requests check for the existence of this * object before performing the authentication again . * @ param req * the servlet request . * @ return a user principal that was extracted from the login context . */ private Subject authenticate ( HttpServletRequest req ) { } }
String authorization = req . getHeader ( "authorization" ) ; if ( authorization == null || authorization . trim ( ) . isEmpty ( ) ) { return null ; } // subject from session instead of re - authenticating // can ' t change username / password for this session . Subject subject = ( Subject ) req . getSession ( ) . getAttribute ( authorization ) ; if ( subject != null ) { return subject ; } String auth = null ; try { byte [ ] data = Base64 . decode ( authorization . substring ( 6 ) ) ; auth = new String ( data ) ; } catch ( IOException e ) { logger . error ( e . toString ( ) ) ; return null ; } String username = auth . substring ( 0 , auth . indexOf ( ':' ) ) ; String password = auth . substring ( auth . indexOf ( ':' ) + 1 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "auth username: " + username ) ; } LoginContext loginContext = null ; try { CallbackHandler handler = new UsernamePasswordCallbackHandler ( username , password ) ; loginContext = new LoginContext ( jaasConfigName , handler ) ; loginContext . login ( ) ; } catch ( LoginException le ) { logger . error ( le . toString ( ) ) ; return null ; } // successfully logged in subject = loginContext . getSubject ( ) ; // object accessable by a fixed key for usage req . getSession ( ) . setAttribute ( SESSION_SUBJECT_KEY , subject ) ; // object accessable only by base64 encoded username : password that was // initially used - prevents some dodgy stuff req . getSession ( ) . setAttribute ( authorization , subject ) ; return subject ;
public class Money { /** * ( non - Javadoc ) * @ see javax . money . MonetaryAmount # add ( javax . money . MonetaryAmount ) */ @ Override public Money add ( MonetaryAmount amount ) { } }
MoneyUtils . checkAmountParameter ( amount , this . currency ) ; if ( amount . isZero ( ) ) { return this ; } return new Money ( this . number . add ( amount . getNumber ( ) . numberValue ( BigDecimal . class ) ) , getCurrency ( ) ) ;
public class CommerceAvailabilityEstimatePersistenceImpl { /** * Returns the commerce availability estimate where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching commerce availability estimate , or < code > null < / code > if a matching commerce availability estimate could not be found */ @ Override public CommerceAvailabilityEstimate fetchByUUID_G ( String uuid , long groupId ) { } }
return fetchByUUID_G ( uuid , groupId , true ) ;
public class CassandraDataHandlerBase { /** * Prepare column . * @ param tr * the tr * @ param m * the m * @ param value * the value * @ param name * the name * @ param timestamp * the timestamp * @ param ttl * TODO */ private void prepareColumn ( ThriftRow tr , EntityMetadata m , Object value , byte [ ] name , long timestamp , int ttl ) { } }
if ( value != null ) { if ( m . isCounterColumnType ( ) ) { CounterColumn counterColumn = prepareCounterColumn ( ( String ) value , name ) ; tr . addCounterColumn ( counterColumn ) ; } else { Column column = prepareColumn ( ( byte [ ] ) value , name , timestamp , ttl ) ; tr . addColumn ( column ) ; } }
public class InstallUtils { /** * Java 2 security APIs for Zipfile ( ) */ public static ZipFile createZipFile ( final File f ) throws ZipException , IOException { } }
try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < ZipFile > ( ) { @ Override public ZipFile run ( ) throws IOException { return new ZipFile ( f ) ; } } ) ; } catch ( PrivilegedActionException e ) { if ( e . getCause ( ) instanceof ZipException ) throw ( ZipException ) e . getCause ( ) ; throw ( IOException ) e . getCause ( ) ; }
public class DirectedGraph { /** * Returns true if both < tt > a < / tt > and < tt > b < / tt > are nodes in the graph * @ param a the first value to check for * @ param b the second value to check for * @ return true if both < tt > a < / tt > and < tt > b < / tt > are in the graph , false otherwise */ private boolean containsBoth ( N a , N b ) { } }
return nodes . containsKey ( a ) && nodes . containsKey ( b ) ;
public class BigWigManager { /** * Get the iterator for the given region . * @ param region Region target * @ return Big Wig file iterator */ public BigWigIterator iterator ( Region region ) { } }
return bbFileReader . getBigWigIterator ( region . getChromosome ( ) , region . getStart ( ) , region . getChromosome ( ) , region . getEnd ( ) , false ) ;
public class JMXetricXmlConfigurationService { /** * A < sample > node from the XML source is parsed to make an MBeanSampler . * @ param sample * @ return * @ throws Exception */ private MBeanSampler makeMBeanSampler ( Node sample ) throws Exception { } }
String delayString = selectParameterFromNode ( sample , "delay" , "60" ) ; int delay = Integer . parseInt ( delayString ) ; String initialDelayString = selectParameterFromNode ( sample , "initialdelay" , "0" ) ; int initialDelay = Integer . parseInt ( initialDelayString ) ; String sampleDMax = selectParameterFromNode ( sample , "dmax" , "0" ) ; MBeanSampler mBeanSampler = new MBeanSampler ( initialDelay , delay , processName ) ; NodeList mBeans = getXmlNodeSet ( "mbean" , sample ) ; for ( int j = 0 ; j < mBeans . getLength ( ) ; j ++ ) { Node mBean = mBeans . item ( j ) ; String mBeanName = selectParameterFromNode ( mBean , "name" , null ) ; List < MBeanAttribute > attributes = getAttributesForMBean ( mBean , sampleDMax ) ; for ( MBeanAttribute mBeanAttribute : attributes ) { addMBeanAttributeToSampler ( mBeanSampler , mBeanName , mBeanAttribute ) ; } } return mBeanSampler ;
public class PaneProjectLight { /** * refresh tree and expand to file that usually newly created */ @ Override public void refreshGuiAndShowFile ( File file ) { } }
if ( rootNode . getChildCount ( ) > 0 ) { rootNode . removeAllChildren ( ) ; treeModel . reload ( ) ; } if ( guiMain . getAsmProjectUml ( ) . getProjectUml ( ) != null ) { addTreeNodes ( file ) ; guiMain . getMenuMain ( ) . setVisibleProjectMenu ( true ) ; } else { guiMain . getMenuMain ( ) . setVisibleProjectMenu ( false ) ; }
public class AsynchronousRequest { /** * For more info on WvW matches API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / wvw / matches " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for custom interactions * @ param ids list of wvw match id ( s ) * @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) } * @ throws NullPointerException if given { @ link Callback } is empty * @ throws GuildWars2Exception empty ID list * @ see WvWMatchOverview WvW match overview info */ public void getWvWMatchOverview ( String [ ] ids , Callback < List < WvWMatchOverview > > callback ) throws GuildWars2Exception , NullPointerException { } }
isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getWvWMatchOverviewUsingID ( processIds ( ids ) ) . enqueue ( callback ) ;
public class PNCounterProxy { /** * Chooses and returns a CRDT replica address . Replicas with addresses * contained in the { @ code excludedAddresses } list are excluded . * The method may return { @ code null } if there are no viable addresses . * If the local address is a possible replica , it returns the local address , * otherwise it chooses a replica randomly . * @ param excludedAddresses the addresses to exclude when choosing a replica address * @ return a CRDT replica address or { @ code null } if there are no viable addresses */ private Address chooseTargetReplica ( List < Address > excludedAddresses ) { } }
final List < Address > replicaAddresses = getReplicaAddresses ( excludedAddresses ) ; if ( replicaAddresses . isEmpty ( ) ) { return null ; } final Address localAddress = getNodeEngine ( ) . getLocalMember ( ) . getAddress ( ) ; if ( replicaAddresses . contains ( localAddress ) ) { return localAddress ; } final int randomReplicaIndex = ThreadLocalRandomProvider . get ( ) . nextInt ( replicaAddresses . size ( ) ) ; return replicaAddresses . get ( randomReplicaIndex ) ;
public class ModbusResponseFactory { /** * This method creates a # ModbusResponse instance from # functionCode * @ param functionCode a number representing a modbus function * @ return an instance of a specific ModbusRequest * @ see ModbusRequest * @ see ModbusMessageFactory * @ see ModbusResponseFactory */ @ Override public ModbusMessage createMessage ( int functionCode ) { } }
ModbusResponse msg ; switch ( ModbusFunctionCode . get ( functionCode ) ) { case READ_COILS : msg = new ReadCoilsResponse ( ) ; break ; case READ_DISCRETE_INPUTS : msg = new ReadDiscreteInputsResponse ( ) ; break ; case READ_HOLDING_REGISTERS : msg = new ReadHoldingRegistersResponse ( ) ; break ; case READ_INPUT_REGISTERS : msg = new ReadInputRegistersResponse ( ) ; break ; case WRITE_SINGLE_COIL : msg = new WriteSingleCoilResponse ( ) ; break ; case WRITE_SINGLE_REGISTER : msg = new WriteSingleRegisterResponse ( ) ; break ; case WRITE_MULTIPLE_COILS : msg = new WriteMultipleCoilsResponse ( ) ; break ; case WRITE_MULTIPLE_REGISTERS : msg = new WriteMultipleRegistersResponse ( ) ; break ; case MASK_WRITE_REGISTER : msg = new MaskWriteRegisterResponse ( ) ; break ; case READ_WRITE_MULTIPLE_REGISTERS : msg = new ReadWriteMultipleRegistersResponse ( ) ; break ; case READ_FIFO_QUEUE : msg = new ReadFifoQueueResponse ( ) ; break ; case READ_FILE_RECORD : msg = new ReadFileRecordResponse ( ) ; break ; case WRITE_FILE_RECORD : msg = new WriteFileRecordResponse ( ) ; break ; case READ_EXCEPTION_STATUS : msg = new ReadExceptionStatusResponse ( ) ; break ; case REPORT_SLAVE_ID : msg = new ReportSlaveIdResponse ( ) ; break ; case GET_COMM_EVENT_COUNTER : msg = new GetCommEventCounterResponse ( ) ; break ; case GET_COMM_EVENT_LOG : msg = new GetCommEventLogResponse ( ) ; break ; case DIAGNOSTICS : msg = new DiagnosticsResponse ( ) ; break ; case ENCAPSULATED_INTERFACE_TRANSPORT : msg = new EncapsulatedInterfaceTransportResponse ( ) ; break ; default : msg = new IllegalFunctionResponse ( functionCode ) ; } if ( ModbusFunctionCode . isException ( functionCode ) ) { msg . setException ( ) ; } return msg ;
public class DataInParser { /** * { @ inheritDoc } */ @ Override protected void checkIntegrity ( ) throws InternetSCSIException { } }
String exceptionMessage ; do { if ( statusFlag && ! protocolDataUnit . getBasicHeaderSegment ( ) . isFinalFlag ( ) ) { exceptionMessage = "FinalFlag must also be set, if the StatusFlag is set." ; break ; } if ( ! statusFlag && ( bidirectionalReadResidualOverflow || bidirectionalReadResidualUnderflow ) && ( residualOverflow || residualUnderflow ) ) { exceptionMessage = "The StatusFlag must be set, if any flags are set." ; break ; } if ( acknowledgeFlag && ( targetTransferTag == 0 && logicalUnitNumber == 0 ) ) { exceptionMessage = "If the AcknowledgeFlag is set, the TargetTaskTag" + " and the LogicalUnitNumber must be unequal 0." ; break ; } if ( ! acknowledgeFlag && ( targetTransferTag != 0 && logicalUnitNumber != 0 ) ) { exceptionMessage = "The TargetTransferTag and LogicalUnitNumber must" + " be reserved, because the AcknowledgeFlag is not set." ; break ; } // message is checked correctly return ; } while ( false ) ; throw new InternetSCSIException ( exceptionMessage ) ;
public class FilterUtils { /** * Call passed begin event if possible . * @ param event the event to send * @ param elementDescriptor the descriptor of the event to send * @ param filter the filter * @ param parameters the parameters of the event * @ return true if the event has been sent , false otherwise * @ throws FilterException when the passed filter exposes the event but failed anyway */ public static boolean sendEvent ( Method event , FilterElementDescriptor elementDescriptor , Object filter , FilterEventParameters parameters ) throws FilterException { } }
FilterElementParameterDescriptor < ? > [ ] parameterDescriptors = elementDescriptor . getParameters ( ) ; Object [ ] arguments = new Object [ parameterDescriptors . length ] ; for ( FilterElementParameterDescriptor < ? > parameterDescriptor : parameterDescriptors ) { Object value ; if ( parameterDescriptor . getName ( ) != null && parameters . containsKey ( parameterDescriptor . getName ( ) ) ) { value = parameters . get ( parameterDescriptor . getName ( ) ) ; } else if ( parameters . containsKey ( String . valueOf ( parameterDescriptor . getIndex ( ) ) ) ) { value = parameters . get ( String . valueOf ( parameterDescriptor . getIndex ( ) ) ) ; } else { value = parameterDescriptor . getDefaultValue ( ) ; } arguments [ parameterDescriptor . getIndex ( ) ] = value ; } try { event . invoke ( filter , arguments ) ; } catch ( Exception e ) { throw new FilterException ( String . format ( "Failed to send event [%s] with parameters [%s] to filter [%s]" , event , parameters , filter ) , e ) ; } return true ;
public class Matrix3f { /** * Set this matrix to a model transformation for a right - handed coordinate system , * that aligns the local < code > - z < / code > axis with < code > center - eye < / code > . * In order to apply the rotation transformation to a previous existing transformation , * use { @ link # rotateTowards ( float , float , float , float , float , float ) rotateTowards } . * This method is equivalent to calling : < code > setLookAlong ( - dirX , - dirY , - dirZ , upX , upY , upZ ) . invert ( ) < / code > * @ see # rotateTowards ( Vector3fc , Vector3fc ) * @ see # rotationTowards ( float , float , float , float , float , float ) * @ param dirX * the x - coordinate of the direction to rotate towards * @ param dirY * the y - coordinate of the direction to rotate towards * @ param dirZ * the z - coordinate of the direction to rotate towards * @ param upX * the x - coordinate of the up vector * @ param upY * the y - coordinate of the up vector * @ param upZ * the z - coordinate of the up vector * @ return this */ public Matrix3f rotationTowards ( float dirX , float dirY , float dirZ , float upX , float upY , float upZ ) { } }
// Normalize direction float invDirLength = 1.0f / ( float ) Math . sqrt ( dirX * dirX + dirY * dirY + dirZ * dirZ ) ; float ndirX = dirX * invDirLength ; float ndirY = dirY * invDirLength ; float ndirZ = dirZ * invDirLength ; // left = up x direction float leftX , leftY , leftZ ; leftX = upY * ndirZ - upZ * ndirY ; leftY = upZ * ndirX - upX * ndirZ ; leftZ = upX * ndirY - upY * ndirX ; // normalize left float invLeftLength = 1.0f / ( float ) Math . sqrt ( leftX * leftX + leftY * leftY + leftZ * leftZ ) ; leftX *= invLeftLength ; leftY *= invLeftLength ; leftZ *= invLeftLength ; // up = direction x left float upnX = ndirY * leftZ - ndirZ * leftY ; float upnY = ndirZ * leftX - ndirX * leftZ ; float upnZ = ndirX * leftY - ndirY * leftX ; this . m00 = leftX ; this . m01 = leftY ; this . m02 = leftZ ; this . m10 = upnX ; this . m11 = upnY ; this . m12 = upnZ ; this . m20 = ndirX ; this . m21 = ndirY ; this . m22 = ndirZ ; return this ;
public class Setting { /** * 持久化当前设置 , 会覆盖掉之前的设置 < br > * 持久化不会保留之前的分组 * @ param absolutePath 设置文件的绝对路径 */ public void store ( String absolutePath ) { } }
if ( null == this . settingLoader ) { settingLoader = new SettingLoader ( this . groupedMap , this . charset , this . isUseVariable ) ; } settingLoader . store ( absolutePath ) ;
public class JKTableRecord { public void addEmptyValues ( final Vector < JKTableColumn > tableColumns ) { } }
for ( final JKTableColumn col : tableColumns ) { final JKTableColumnValue value = new JKTableColumnValue ( col ) ; this . columnsValues . add ( value ) ; }
public class Tile { /** * Defines if the average indicator should be drawn * @ param VISIBLE */ public void setAverageVisible ( final boolean VISIBLE ) { } }
if ( null == averageVisible ) { _averageVisible = VISIBLE ; fireTileEvent ( VISIBILITY_EVENT ) ; } else { averageVisible . set ( VISIBLE ) ; }
public class SerializerIntrinsics { /** * Return the Count of Number of Bits Set to 1 ( SSE4.2 ) . */ public final void popcnt ( Register dst , Register src ) { } }
assert ( ! dst . isRegType ( REG_GPB ) ) ; assert ( src . type ( ) == dst . type ( ) ) ; emitX86 ( INST_POPCNT , dst , src ) ;
public class FileEventStore { /** * Gets the file to use for a new event in the given collection with the given timestamp . If * there are multiple events with identical timestamps , this method will use a counter to * create a unique file name for each . * @ param collectionDir The cache directory for the event collection . * @ param timestamp The timestamp of the event . * @ return The file to use for the new event . */ private File getFileForEvent ( File collectionDir , Calendar timestamp ) throws IOException { } }
int counter = 0 ; File eventFile = getNextFileForEvent ( collectionDir , timestamp , counter ) ; while ( eventFile . exists ( ) ) { eventFile = getNextFileForEvent ( collectionDir , timestamp , counter ) ; counter ++ ; } return eventFile ;
public class FilterFileSystem { /** * Opens an FSDataInputStream at the indicated Path . * @ param f the file name to open * @ param bufferSize the size of the buffer to be used . */ public FSDataInputStream open ( Path f , int bufferSize ) throws IOException { } }
return fs . open ( f , bufferSize ) ;
public class DraggableView { /** * Override method to dispatch touch event to the dragged view . * @ param ev captured . * @ return true if the touch event is realized over the drag or second view . */ @ Override public boolean onTouchEvent ( MotionEvent ev ) { } }
int actionMasked = MotionEventCompat . getActionMasked ( ev ) ; if ( ( actionMasked & MotionEventCompat . ACTION_MASK ) == MotionEvent . ACTION_DOWN ) { activePointerId = MotionEventCompat . getPointerId ( ev , actionMasked ) ; } if ( activePointerId == INVALID_POINTER ) { return false ; } viewDragHelper . processTouchEvent ( ev ) ; if ( isClosed ( ) ) { return false ; } boolean isDragViewHit = isViewHit ( dragView , ( int ) ev . getX ( ) , ( int ) ev . getY ( ) ) ; boolean isSecondViewHit = isViewHit ( secondView , ( int ) ev . getX ( ) , ( int ) ev . getY ( ) ) ; analyzeTouchToMaximizeIfNeeded ( ev , isDragViewHit ) ; if ( isMaximized ( ) ) { dragView . dispatchTouchEvent ( ev ) ; } else { dragView . dispatchTouchEvent ( cloneMotionEventWithAction ( ev , MotionEvent . ACTION_CANCEL ) ) ; } return isDragViewHit || isSecondViewHit ;
public class OutRawH3Impl { /** * write graph reference */ @ Override public void writeRef ( int ref ) { } }
require ( 1 ) ; _buffer [ _offset ++ ] = ( byte ) ConstH3 . REF ; writeUnsigned ( ref ) ;
public class CatalogUtil { /** * Return all the of the primary key columns for a particular table * If the table does not have a primary key , then the returned list will be empty * @ param catalogTable * @ return An ordered list of the primary key columns */ public static Collection < Column > getPrimaryKeyColumns ( Table catalogTable ) { } }
Collection < Column > columns = new ArrayList < > ( ) ; Index catalog_idx = null ; try { catalog_idx = CatalogUtil . getPrimaryKeyIndex ( catalogTable ) ; } catch ( Exception ex ) { // IGNORE return ( columns ) ; } assert ( catalog_idx != null ) ; for ( ColumnRef catalog_col_ref : getSortedCatalogItems ( catalog_idx . getColumns ( ) , "index" ) ) { columns . add ( catalog_col_ref . getColumn ( ) ) ; } return ( columns ) ;
public class SecurePropertiesUtils { /** * Utility which will take an existing Properties file on disk and replace * any - unencrypted values with encrypted . < br > * Note : Encryption fields passed as parameters < b > WILL NOT < / b > be placed * into the resulting SecureProperties file . * @ param clearProperties * Un - encrypted properties file to be secured * @ param keyPath * Path to the keystore file . * @ param keyPass * Password to be used to open and secure the Keystore password . * @ param keyEntry * Entry name of the key to use from the keystore . * @ return * @ throws FileNotFoundException * Properties file not found on disk . * @ throws IOException * Error reading / writing From the clear properties or to the * secure properties * @ throws KeyStoreException * Error accessing or using the keystore . */ public static SecureProperties encryptPropertiesFile ( File clearProperties , String keyPath , String keyPass , String keyEntry ) throws FileNotFoundException , IOException , KeyStoreException { } }
return encryptPropertiesFile ( clearProperties , keyPath , keyPass , keyEntry , false ) ;
public class CmsCmisTypeManager { /** * Gets the property provider for a given key . < p > * @ param key the property nme * @ return the property provider for the given name , or null if there isn ' t any */ public I_CmsPropertyProvider getPropertyProvider ( String key ) { } }
if ( key . startsWith ( PROPERTY_PREFIX_DYNAMIC ) ) { key = key . substring ( PROPERTY_PREFIX_DYNAMIC . length ( ) ) ; } for ( I_CmsPropertyProvider provider : m_propertyProviders ) { if ( provider . getName ( ) . equals ( key ) ) { return provider ; } } return null ;
public class DescribeTagsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeTagsRequest describeTagsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeTagsRequest . getMaxItems ( ) , MAXITEMS_BINDING ) ; protocolMarshaller . marshall ( describeTagsRequest . getMarker ( ) , MARKER_BINDING ) ; protocolMarshaller . marshall ( describeTagsRequest . getFileSystemId ( ) , FILESYSTEMID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StreamExecutor { /** * Send one message to target task */ protected void sendMessageToInstance ( int taskId , HeronTuples . HeronTupleSet message ) { } }
taskIdToInstanceExecutor . get ( taskId ) . getStreamInQueue ( ) . offer ( message ) ;
public class ModbusSlaveFactory { /** * Returns the running slave that utilises the give listener * @ param listener Listener used for this slave * @ return Null or ModbusSlave */ public static synchronized ModbusSlave getSlave ( AbstractModbusListener listener ) { } }
for ( ModbusSlave slave : slaves . values ( ) ) { if ( slave . getListener ( ) . equals ( listener ) ) { return slave ; } } return null ;
public class AJP13InputStream { public int read ( byte [ ] b , int off , int len ) throws IOException { } }
if ( _closed ) return - 1 ; if ( _packet . unconsumedData ( ) == 0 ) { fillPacket ( ) ; if ( _packet . unconsumedData ( ) == 0 ) { _closed = true ; return - 1 ; } } return _packet . getBytes ( b , off , len ) ;
public class TLSCertificateBuilder { /** * Creates a TLS client certificate key pair * @ return a TLSCertificateKeyPair */ public TLSCertificateKeyPair clientCert ( ) { } }
try { return createCert ( CertType . CLIENT , null ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class MisoUtil { /** * Return a screen - coordinates polygon framing the two specified * tile - coordinate points . */ public static Polygon getMultiTilePolygon ( MisoSceneMetrics metrics , Point sp1 , Point sp2 ) { } }
int x = Math . min ( sp1 . x , sp2 . x ) , y = Math . min ( sp1 . y , sp2 . y ) ; int width = Math . abs ( sp1 . x - sp2 . x ) + 1 , height = Math . abs ( sp1 . y - sp2 . y ) + 1 ; return getFootprintPolygon ( metrics , x , y , width , height ) ;
public class TemporalSemanticSpaceUtils { /** * Writes the data contained in the { @ link TemporalSemanticSpace } to the * provided file and format . See < a href = " # format " > here < / a > for file format * specifications . */ public static void printTemporalSemanticSpace ( TemporalSemanticSpace sspace , File output , TSSpaceFormat format ) throws IOException { } }
switch ( format ) { case TEXT : printText ( sspace , output ) ; break ; case SPARSE_TEXT : printSparseText ( sspace , output ) ; break ; case BINARY : printBinary ( sspace , output ) ; break ; case SPARSE_BINARY : printSparseBinary ( sspace , output ) ; break ; default : throw new IllegalArgumentException ( "Unknown format type: " + format ) ; }
public class JRemoteMenuScreen { /** * Build the list of fields that make up the screen . * This method creates a new Menus record and links it to the remote MenusSession . * @ return the field . */ public FieldList buildFieldList ( ) { } }
FieldList record = ( FieldList ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( Constants . ROOT_PACKAGE + "thin.main.db.Menus" ) ; if ( record != null ) record . init ( this ) ; else return null ; record . setOpenMode ( Constants . OPEN_READ_ONLY ) ; // This will improve performance by enabling the cache for readnext . BaseApplet applet = BaseApplet . getSharedInstance ( ) ; m_remoteSession = applet . makeRemoteSession ( null , ".main.remote.MenusSession" ) ; applet . linkRemoteSessionTable ( m_remoteSession , record , true ) ; if ( m_strInitParam != null ) { try { m_remoteSession . doRemoteAction ( m_strInitParam , null ) ; } catch ( Exception ex ) { // Ignore error } } return record ;
public class RestBuilder { /** * Executes the API request in a synchronous fashion , using the given timeout . * @ param timeout the custom timeout to use for the request . * @ param timeUnit the { @ link TimeUnit } for the timeout . * @ return the result of the API call , as a { @ link RestApiResponse } . * @ throws RuntimeException wrapping a { @ link TimeoutException } in case the request took too long . */ public RestApiResponse execute ( long timeout , TimeUnit timeUnit ) { } }
return Blocking . blockForSingle ( delegate . execute ( ) , timeout , timeUnit ) ;
public class ZanataInterface { /** * Get a specific Source Document from Zanata . * @ param id The ID of the Document in Zanata . * @ return The Zanata Source Document that matches the id passed , or null if it doesn ' t exist . */ public Resource getZanataResource ( final String id ) throws NotModifiedException { } }
ClientResponse < Resource > response = null ; try { final ISourceDocResource client = proxyFactory . getSourceDocResource ( details . getProject ( ) , details . getVersion ( ) ) ; response = client . getResource ( id , null ) ; final Status status = Response . Status . fromStatusCode ( response . getStatus ( ) ) ; if ( status == Response . Status . OK ) { final Resource entity = response . getEntity ( ) ; return entity ; } else if ( status == Status . NOT_MODIFIED ) { throw new NotModifiedException ( ) ; } } catch ( final Exception ex ) { if ( ex instanceof NotModifiedException ) { throw ( NotModifiedException ) ex ; } else { log . error ( "Failed to retrieve the Zanata Source Document" , ex ) ; } } finally { /* * If you are using RESTEasy client framework , and returning a Response from your service method , you will * explicitly need to release the connection . */ if ( response != null ) response . releaseConnection ( ) ; /* Perform a small wait to ensure zanata isn ' t overloaded */ performZanataRESTCallWaiting ( ) ; } return null ;
public class GoogleCalendarService { /** * Performs an immediate update operation on google server by sending the * information stored by the given google entry . * @ param entry The entry to be updated in a backend google calendar . * @ return The same instance received . * @ throws IOException For unexpected errors */ public GoogleEntry updateEntry ( GoogleEntry entry ) throws IOException { } }
GoogleCalendar calendar = ( GoogleCalendar ) entry . getCalendar ( ) ; Event event = converter . convert ( entry , Event . class ) ; dao . events ( ) . update ( calendar . getId ( ) , event . getId ( ) , event ) . execute ( ) ; return entry ;
public class DirectoryConnection { /** * When connect has exception and the session still not out of time . * Reopen the session to server . * It doesn ' t clean the sessionId , sessionPassword , authdata and serverId . the ConnectionThread can * reopen the session use them . * When send ping failed or ClientSocket detects fail , reopen the session again . * Send packet failed donot reopen the session . */ private void reopenSession ( ) { } }
if ( ! closing && getStatus ( ) . isConnected ( ) ) { closing = true ; if ( getStatus ( ) . isAlive ( ) ) { setStatus ( ConnectionStatus . NOT_CONNECTED ) ; } closing = false ; }
public class EntityMessageDeserializer { /** * - - - - - helper methods - - - - - */ private static Map < Type , JsonDeserializer > getDeserializerMap ( ) { } }
return Collections . < Type , JsonDeserializer > singletonMap ( NotificationInterface . ENTITY_NOTIFICATION_CLASS , new EntityNotificationDeserializer ( ) ) ;
public class AbstractCurve { /** * Return a vector of values corresponding to a given vector of times . * @ param times A given vector of times . * @ return A vector of values corresponding to the given vector of times . */ public RandomVariable [ ] getValues ( double [ ] times ) { } }
RandomVariable [ ] values = new RandomVariable [ times . length ] ; for ( int i = 0 ; i < times . length ; i ++ ) { values [ i ] = getValue ( null , times [ i ] ) ; } return values ;
public class HadoopFileReader { /** * Closes the reader . Note that you are on your own to close related inputStreams . */ public void close ( ) throws IOException { } }
for ( Decompressor currentDecompressor : this . openDecompressors ) { if ( currentDecompressor != null ) { CodecPool . returnDecompressor ( currentDecompressor ) ; } } // never close the filesystem . Causes issues with Spark
public class DataSiftAccount { /** * Update an existing identity with values * @ param id target to update * @ param label new label ( may be null otherwise ) * @ param active new activity ( may be null otherwise ) * @ param master new master ( may be null otherwise ) * @ return The new updated Identity */ public FutureData < Identity > update ( String id , String label , Boolean active , Boolean master ) { } }
String activeStr = null ; if ( active != null ) { activeStr = active ? "active" : "disabled" ; } FutureData < Identity > future = new FutureData < > ( ) ; URI uri = newParams ( ) . forURL ( config . newAPIEndpointURI ( IDENTITY + "/" + id ) ) ; try { Request request = config . http ( ) . putJSON ( uri , new PageReader ( newRequestCallback ( future , new Identity ( ) , config ) ) ) . setData ( new NewIdentity ( label , activeStr , master ) ) ; performRequest ( future , request ) ; } catch ( JsonProcessingException e ) { e . printStackTrace ( ) ; } return future ;
public class GrokClassifierMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GrokClassifier grokClassifier , ProtocolMarshaller protocolMarshaller ) { } }
if ( grokClassifier == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( grokClassifier . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getClassification ( ) , CLASSIFICATION_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getCreationTime ( ) , CREATIONTIME_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getLastUpdated ( ) , LASTUPDATED_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getVersion ( ) , VERSION_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getGrokPattern ( ) , GROKPATTERN_BINDING ) ; protocolMarshaller . marshall ( grokClassifier . getCustomPatterns ( ) , CUSTOMPATTERNS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SpScheduler { /** * Poll the replay sequencer and process the messages until it returns null */ private void deliverReadyTxns ( ) { } }
// First , pull all the sequenced messages , if any . VoltMessage m = m_replaySequencer . poll ( ) ; while ( m != null ) { deliver ( m ) ; m = m_replaySequencer . poll ( ) ; } // Then , try to pull all the drainable messages , if any . m = m_replaySequencer . drain ( ) ; while ( m != null ) { if ( m instanceof Iv2InitiateTaskMessage ) { // Send IGNORED response for all SPs Iv2InitiateTaskMessage task = ( Iv2InitiateTaskMessage ) m ; final InitiateResponseMessage response = new InitiateResponseMessage ( task ) ; response . setResults ( new ClientResponseImpl ( ClientResponse . UNEXPECTED_FAILURE , new VoltTable [ 0 ] , ClientResponseImpl . IGNORED_TRANSACTION ) ) ; m_mailbox . send ( response . getInitiatorHSId ( ) , response ) ; } m = m_replaySequencer . drain ( ) ; }
public class Record { /** * Record * @ param values * Record */ public void setValues ( java . util . Collection < Value > values ) { } }
if ( values == null ) { this . values = null ; return ; } this . values = new java . util . ArrayList < Value > ( values ) ;
public class CustomHeadersInterceptor { /** * Add a single header key - value pair . If one with the name already exists , * it gets replaced . * @ param name the name of the header . * @ param value the value of the header . * @ return the interceptor instance itself . */ public CustomHeadersInterceptor replaceHeader ( String name , String value ) { } }
this . headers . put ( name , new ArrayList < String > ( ) ) ; this . headers . get ( name ) . add ( value ) ; return this ;
public class Logger { /** * Log . */ public void error ( String message ) { } }
if ( getLevel ( ) > Level . ERROR . ordinal ( ) ) return ; logMessage ( Level . ERROR , message , null ) ;
public class TmdbDiscover { /** * Discover movies by different types of data like average rating , number of votes , genres and certifications . * @ param discover A discover object containing the search criteria required * @ return * @ throws MovieDbException */ public ResultList < TVBasic > getDiscoverTV ( Discover discover ) throws MovieDbException { } }
URL url = new ApiUrl ( apiKey , MethodBase . DISCOVER ) . subMethod ( MethodSub . TV ) . buildUrl ( discover . getParams ( ) ) ; String webpage = httpTools . getRequest ( url ) ; WrapperGenericList < TVBasic > wrapper = processWrapper ( getTypeReference ( TVBasic . class ) , url , webpage ) ; return wrapper . getResultsList ( ) ;
public class ApiImplementor { /** * Override if implementing one or more ' other ' operations - these are operations that _ dont _ return structured data * @ param msg the HTTP message containing the API request * @ param name the name of the requested other endpoint * @ param params the API request parameters * @ return the HTTP message with the API response * @ throws ApiException if an error occurred while handling the API other endpoint */ public HttpMessage handleApiOther ( HttpMessage msg , String name , JSONObject params ) throws ApiException { } }
throw new ApiException ( ApiException . Type . BAD_OTHER , name ) ;
public class JsonArray { /** * Allows you to lookup objects from an array by e . g . their id . * @ param fieldName field to match on * @ param value value of the field * @ return the first object where field = = value , or null */ public Optional < JsonObject > findFirstWithFieldValue ( @ Nonnull String fieldName , String value ) { } }
JsonElement result = findFirstMatching ( e -> { if ( ! e . isObject ( ) ) { return false ; } JsonObject object = e . asObject ( ) ; String fieldValue = object . getString ( fieldName ) ; if ( fieldValue != null ) { return fieldValue . equals ( value ) ; } else { return false ; } } ) . orElse ( null ) ; if ( result != null ) { return Optional . of ( result . asObject ( ) ) ; } else { return Optional . empty ( ) ; }
public class LineItemSummary { /** * Sets the discountType value for this LineItemSummary . * @ param discountType * The type of discount being applied to a { @ code LineItem } , either * percentage * based or absolute . This attribute is optional and * defaults to * { @ link LineItemDiscountType # PERCENTAGE } . */ public void setDiscountType ( com . google . api . ads . admanager . axis . v201808 . LineItemDiscountType discountType ) { } }
this . discountType = discountType ;
public class EventBus { /** * Returns the subscriber which is registered with specified < code > eventType < / code > ( or its sub types ) and < code > eventId < / code > . * @ param eventType * @ param eventId * @ return */ public List < Object > getSubscribers ( final Class < ? > eventType , final String eventId ) { } }
final List < Object > eventSubs = new ArrayList < > ( ) ; synchronized ( registeredSubMap ) { for ( Map . Entry < Object , List < SubIdentifier > > entry : registeredSubMap . entrySet ( ) ) { for ( SubIdentifier sub : entry . getValue ( ) ) { if ( sub . isMyEvent ( eventType , eventId ) ) { eventSubs . add ( entry . getKey ( ) ) ; break ; } } } } return eventSubs ;
public class RestUtils { /** * Returns a Response with the entity object inside it and 200 status code . * If there was and error the status code is different than 200. * @ param is the entity input stream * @ param type the type to convert the entity into , for example a Map . If null , this returns the InputStream . * @ return response with 200 or error status */ public static Response getEntity ( InputStream is , Class < ? > type ) { } }
Object entity ; try { if ( is != null && is . available ( ) > 0 ) { if ( is . available ( ) > Config . MAX_ENTITY_SIZE_BYTES ) { return getStatusResponse ( Response . Status . BAD_REQUEST , "Request is too large - the maximum is " + ( Config . MAX_ENTITY_SIZE_BYTES / 1024 ) + " KB." ) ; } if ( type == null ) { entity = is ; } else { entity = ParaObjectUtils . getJsonReader ( type ) . readValue ( is ) ; } } else { return getStatusResponse ( Response . Status . BAD_REQUEST , "Missing request body." ) ; } } catch ( JsonMappingException e ) { return getStatusResponse ( Response . Status . BAD_REQUEST , e . getMessage ( ) ) ; } catch ( JsonParseException e ) { return getStatusResponse ( Response . Status . BAD_REQUEST , e . getMessage ( ) ) ; } catch ( IOException e ) { logger . error ( null , e ) ; return getStatusResponse ( Response . Status . INTERNAL_SERVER_ERROR , e . toString ( ) ) ; } return Response . ok ( entity ) . build ( ) ;
public class VirtualMachineScaleSetVMsInner { /** * Gets a list of all virtual machines in a VM scale sets . * @ param resourceGroupName The name of the resource group . * @ param virtualMachineScaleSetName The name of the VM scale set . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; VirtualMachineScaleSetVMInner & gt ; object */ public Observable < Page < VirtualMachineScaleSetVMInner > > listAsync ( final String resourceGroupName , final String virtualMachineScaleSetName ) { } }
return listWithServiceResponseAsync ( resourceGroupName , virtualMachineScaleSetName ) . map ( new Func1 < ServiceResponse < Page < VirtualMachineScaleSetVMInner > > , Page < VirtualMachineScaleSetVMInner > > ( ) { @ Override public Page < VirtualMachineScaleSetVMInner > call ( ServiceResponse < Page < VirtualMachineScaleSetVMInner > > response ) { return response . body ( ) ; } } ) ;
public class Activator { /** * Called when the OSGi framework stops our bundle */ public void stop ( BundleContext bc ) throws Exception { } }
if ( webContainerRef != null ) { WebContainer webContainer = ( WebContainer ) bc . getService ( webContainerRef ) ; webContainer . unregisterServlet ( helloWorldServlet ) ; webContainer . unregisterFilter ( helloWorldFilter ) ; webContainer . unregisterFilter ( "HelloWorld" ) ; webContainer . unregisterServlet ( worldServlet ) ; webContainer . unregisterEventListener ( helloWorldListener ) ; webContainer . unregisterEventListener ( sessionListener ) ; webContainer . unregister ( "/images" ) ; webContainer . unregister ( "/html" ) ; webContainer . unregisterServlet ( errorServlet ) ; webContainer . unregisterServlet ( errorMakerServlet ) ; webContainer . unregisterErrorPage ( "java.lang.Exception" , httpContext ) ; webContainer . unregisterErrorPage ( "404" , httpContext ) ; webContainer . unregisterWelcomeFiles ( new String [ ] { "index.html" } , httpContext ) ; webContainer = null ; bc . ungetService ( webContainerRef ) ; webContainerRef = null ; }
public class InternalSARLParser { /** * InternalSARL . g : 7479:1 : entryRuleContinueExpression returns [ EObject current = null ] : iv _ ruleContinueExpression = ruleContinueExpression EOF ; */ public final EObject entryRuleContinueExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleContinueExpression = null ; try { // InternalSARL . g : 7479:59 : ( iv _ ruleContinueExpression = ruleContinueExpression EOF ) // InternalSARL . g : 7480:2 : iv _ ruleContinueExpression = ruleContinueExpression EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getContinueExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_ruleContinueExpression = ruleContinueExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = iv_ruleContinueExpression ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return current ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;