input
stringlengths 345
21.4k
| output
stringlengths 0
65
|
|---|---|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public int executeUpdate ( ) throws SQLException { checkClosed ( ) ; closeCurrentResultSet ( ) ; Connection conn = this . groupConnection . getRealConnection ( sql , true ) ;
|
SQLException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void run ( ) {
|
Throwable
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void readData ( Node stepnode , List < ? extends SharedObjectInterface > databases ) throws KettleXMLException {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public String toThriftJSONString ( ) throws IOException { org . apache . hadoop . hive . ql . plan . api . Query q = getQueryPlan ( ) ; TMemoryBuffer tmb = new TMemoryBuffer ( q . toString ( ) . length ( ) * 5 ) ; TJSONProtocol oprot = new TJSONProtocol ( tmb ) ;
|
TException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public synchronized boolean processRow ( StepMetaInterface smi , StepDataInterface sdi ) throws KettleException { meta = ( RowGeneratorMeta ) smi ; data = ( RowGeneratorData ) sdi ; Object [ ] r = null ; boolean retval = true ; if ( first ) { first = false ; getRow ( ) ; } else { if ( meta . isNeverEnding ( ) && data . delay > 0 ) {
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void logRulesViolation ( JobIdentifier jobIdentifier , RulesViolationException e ) {
|
IllegalArtifactLocationException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected synchronized Status doProcess ( ) throws EventDeliveryException { boolean error = true ;
|
ChannelException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private int runThis ( String argv [ ] , PrintStream out ) { argsHandler = new ArgumentHandler ( argv ) ; logHandler = new Log ( out , argsHandler ) ; Binder binder = new Binder ( argsHandler , logHandler ) ; waitTime = argsHandler . getWaitTime ( ) * 60000 ; try { log2 ( " launching a debuggee : " ) ; log2 ( " " + debuggeeName ) ; if ( argsHandler . verbose ( ) ) { debuggee = binder . bindToDebugee ( debuggeeName + " -vbs " ) ; } else { debuggee = binder . bindToDebugee ( debuggeeName ) ; } if ( debuggee == null ) { log3 ( " ERROR: no debuggee launched " ) ; return FAILED ; } log2 ( " debuggee launched " ) ; } catch ( Exception e ) { log3 ( " ERROR: Exception : " + e ) ; log2 ( " test cancelled " ) ; return FAILED ; } debuggee . redirectOutput ( logHandler ) ; vm = debuggee . VM ( ) ; eventQueue = vm . eventQueue ( ) ; if ( eventQueue == null ) { log3 ( " ERROR: eventQueue == null : TEST ABORTED " ) ; vm . exit ( PASS_BASE ) ; return FAILED ; } log2 ( " invocation of the method runTest() " ) ; switch ( runTest ( ) ) { case 0 : log2 ( " test phase has finished normally " ) ; log2 ( " waiting for the debuggee to finish ... " ) ; debuggee . waitFor ( ) ; log2 ( " ......getting the debuggee's exit status " ) ; int status = debuggee . getStatus ( ) ; if ( status != PASS_BASE ) { log3 ( " ERROR: debuggee returned UNEXPECTED exit status: " + status + " != PASS_BASE " ) ; testExitCode = FAILED ; } else { log2 ( " ......debuggee returned expected exit status: " + status + " == PASS_BASE " ) ; } break ; default : log3 ( " ERROR: runTest() returned unexpected value " ) ; case 1 : log3 ( " test phase has not finished normally: debuggee is still alive " ) ; log2 ( " ......forcing: vm.exit(); " ) ; testExitCode = FAILED ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void setCurrentIndicator ( int position ) { for ( int i = 0 ; i < mIndicatorViews . size ( ) ; i ++ ) { mIndicatorViews . get ( i ) . setImageDrawable ( i == position ? mSelectDrawable : mUnSelectDrawable ) ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testNumberOverflowInt ( ) throws IOException { try ( TokenBuffer buf = new TokenBuffer ( null , false ) ) { long big = 1L + Integer . MAX_VALUE ; buf . writeNumber ( big ) ; try ( JsonParser p = buf . asParser ( ObjectReadContext . empty ( ) ) ) { assertToken ( JsonToken . VALUE_NUMBER_INT , p . nextToken ( ) ) ; assertEquals ( NumberType . LONG , p . getNumberType ( ) ) ; try { p . getIntValue ( ) ; fail ( " Expected failure for `int` overflow " ) ; } catch ( InputCoercionException e ) { verifyException ( e , " Numeric value ( " + big + " ) out of range of `int` " ) ; } } } try ( TokenBuffer buf = new TokenBuffer ( null , false ) ) { long big = 1L + Integer . MAX_VALUE ; buf . writeNumber ( String . valueOf ( big ) ) ; try ( JsonParser p = buf . asParser ( ObjectReadContext . empty ( ) ) ) { assertToken ( JsonToken . VALUE_NUMBER_FLOAT , p . nextToken ( ) ) ;
|
InputCoercionException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected static Document createDocument ( String namespaceURI , String qualifiedName , DocumentType docType ) throws SQLException {
|
DOMException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static DataTypeSerializer < ? > create ( DataType type ) { Class < ? > clz = implementations . get ( type . getName ( ) ) ; if ( clz == null ) throw new RuntimeException ( " No DataTypeSerializer for type " + type ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. @ Test public void setNullThrows ( ) { try { rxPreferences . getBoolean ( " foo1 " ) . set ( null ) ; fail ( " Disallow setting null. " ) ; } catch ( NullPointerException e ) { assertThat ( e ) . hasMessage ( " value == null " ) ; } try { rxPreferences . getEnum ( " foo2 " , ROCK , Roshambo . class ) . set ( null ) ; fail ( " Disallow setting null. " ) ; } catch ( NullPointerException e ) { assertThat ( e ) . hasMessage ( " value == null " ) ; } try { rxPreferences . getFloat ( " foo3 " ) . set ( null ) ; fail ( " Disallow setting null. " ) ; } catch ( NullPointerException e ) { assertThat ( e ) . hasMessage ( " value == null " ) ; } try { rxPreferences . getInteger ( " foo4 " ) . set ( null ) ; fail ( " Disallow setting null. " ) ; } catch ( NullPointerException e ) { assertThat ( e ) . hasMessage ( " value == null " ) ; }
|
NullPointerException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public Return freezeBalance2 ( byte [ ] addRess , long freezeBalance , long freezeDuration , String priKey ) { byte [ ] address = addRess ; long frozenBalance = freezeBalance ; long frozenDuration = freezeDuration ; ECKey temKey = null ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static String getIconTextForUrl ( String url , boolean includePrivateRegistries ) { String domain = UrlUtilities . getDomainAndRegistry ( url , includePrivateRegistries ) ; if ( ! TextUtils . isEmpty ( domain ) ) return domain ; if ( url . startsWith ( UrlConstants . CHROME_SCHEME ) || url . startsWith ( UrlConstants . CHROME_NATIVE_SCHEME ) ) { return " chrome " ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void stop ( ) { logger . info ( " Netcat UDP Source stopping... " ) ; logger . info ( " Metrics:{} " , counterGroup ) ; if ( nettyChannel != null ) { nettyChannel . close ( ) ;
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testSimpleConsumerEvents ( ) throws Exception { final String topicName = " persistent://prop/use/ns-abc/shared-topic1 " ; final String subName = " sub1 " ; final int numMsgs = 100 ; Consumer < byte [ ] > consumer1 = pulsarClient . newConsumer ( ) . topic ( topicName ) . subscriptionName ( subName ) . subscriptionType ( SubscriptionType . Shared ) . subscribe ( ) ; PulsarClient newPulsarClient = newPulsarClient ( lookupUrl . toString ( ) , 0 ) ; Consumer < byte [ ] > consumer2 = newPulsarClient . newConsumer ( ) . topic ( topicName ) . subscriptionName ( subName ) . subscriptionType ( SubscriptionType . Shared ) . subscribe ( ) ; PersistentTopic topicRef = ( PersistentTopic ) pulsar . getBrokerService ( ) . getTopicReference ( topicName ) . get ( ) ; PersistentSubscription subRef = topicRef . getSubscription ( subName ) ; assertNotNull ( topicRef ) ; assertNotNull ( subRef ) ; assertTrue ( subRef . getDispatcher ( ) . isConsumerConnected ( ) ) ; assertEquals ( subRef . getDispatcher ( ) . getType ( ) , SubType . Shared ) ; List < CompletableFuture < MessageId > > futures = Lists . newArrayListWithCapacity ( numMsgs * 2 ) ; Producer < byte [ ] > producer = pulsarClient . newProducer ( ) . topic ( topicName ) . enableBatching ( false ) . messageRoutingMode ( MessageRoutingMode . SinglePartition ) . create ( ) ; for ( int i = 0 ; i < numMsgs * 2 ; i ++ ) { String message = " my-message- " + i ; futures . add ( producer . sendAsync ( message . getBytes ( ) ) ) ; } FutureUtil . waitForAll ( futures ) . get ( ) ; rolloverPerIntervalStats ( ) ; assertEquals ( subRef . getNumberOfEntriesInBacklog ( ) , numMsgs * 2 ) ; Thread . sleep ( ASYNC_EVENT_COMPLETION_WAIT ) ; Message < byte [ ] > msg ; Consumer < byte [ ] > c = consumer1 ; while ( true ) { try { msg = c . receive ( 1 , TimeUnit . SECONDS ) ; c . acknowledge ( msg ) ; } catch ( PulsarClientException e ) { if ( c . equals ( consumer1 ) ) { consumer1 . close ( ) ; c = consumer2 ; } else { break ; } } } rolloverPerIntervalStats ( ) ; Thread . sleep ( ASYNC_EVENT_COMPLETION_WAIT ) ; assertEquals ( subRef . getNumberOfEntriesInBacklog ( ) , 0 ) ; try { consumer1 . unsubscribe ( ) ; fail ( " should fail " ) ; } catch ( PulsarClientException e ) { } consumer1 . close ( ) ; producer . send ( " message " . getBytes ( ) ) ; msg = consumer2 . receive ( ) ;
|
PulsarClientException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static void reset ( Object webStat ) { if ( webStat . getClass ( ) == SpringStat . class ) { ( ( SpringStat ) webStat ) . reset ( ) ; return ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public long open ( DataSpec dataSpec ) throws HttpDataSourceException { this . dataSpec = dataSpec ; this . bytesRead = 0 ; this . bytesSkipped = 0 ; transferInitializing ( dataSpec ) ; try { connection = makeConnection ( dataSpec ) ; } catch ( IOException e ) { throw new HttpDataSourceException ( " Unable to connect to " + dataSpec . uri . toString ( ) , e , dataSpec , HttpDataSourceException . TYPE_OPEN ) ; } String responseMessage ; try { responseCode = connection . getResponseCode ( ) ; responseMessage = connection . getResponseMessage ( ) ; } catch ( IOException e ) { closeConnectionQuietly ( ) ; throw new HttpDataSourceException ( " Unable to connect to " + dataSpec . uri . toString ( ) , e , dataSpec , HttpDataSourceException . TYPE_OPEN ) ; } if ( responseCode < 200 || responseCode > 299 ) { Map < String , List < String > > headers = connection . getHeaderFields ( ) ; closeConnectionQuietly ( ) ; InvalidResponseCodeException exception = new InvalidResponseCodeException ( responseCode , responseMessage , headers , dataSpec ) ; if ( responseCode == 416 ) { exception . initCause ( new DataSourceException ( DataSourceException . POSITION_OUT_OF_RANGE ) ) ; } throw exception ; } String contentType = connection . getContentType ( ) ; if ( contentTypePredicate != null && ! contentTypePredicate . evaluate ( contentType ) ) { closeConnectionQuietly ( ) ; throw new InvalidContentTypeException ( contentType , dataSpec ) ; } bytesToSkip = responseCode == 200 && dataSpec . position != 0 ? dataSpec . position : 0 ; if ( ! dataSpec . isFlagSet ( DataSpec . FLAG_ALLOW_GZIP ) ) { if ( dataSpec . length != C . LENGTH_UNSET ) { bytesToRead = dataSpec . length ; } else { long contentLength = getContentLength ( connection ) ; bytesToRead = contentLength != C . LENGTH_UNSET ? ( contentLength - bytesToSkip ) : C . LENGTH_UNSET ; } } else { bytesToRead = dataSpec . length ; }
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testRequestCacheOnTimeoutThrowsException ( ) throws Exception { TestCircuitBreaker circuitBreaker = new TestCircuitBreaker ( ) ; RequestCacheTimeoutWithoutFallback r1 = new RequestCacheTimeoutWithoutFallback ( circuitBreaker ) ;
|
HystrixRuntimeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static void fillLangs ( final String localeString , String currentSkinDirName , final Map < String , Object > dataModel ) throws ServiceException { Stopwatchs . start ( " Fill Skin Langs " ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public Future < Map < String , DLSN > > getLastCommitPositions ( ) { final Promise < Map < String , DLSN > > result = new Promise < Map < String , DLSN > > ( ) ;
|
ZooKeeperClient.ZooKeeperConnectionException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. static List < LrcEntry > parseLrc ( File lrcFile ) { if ( lrcFile == null || ! lrcFile . exists ( ) ) { return null ; } List < LrcEntry > entryList = new ArrayList < > ( ) ;
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static Memory date_parse ( Environment env , TraceInfo traceInfo , Memory date ) {
|
DateTimeParserException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public < T > T lookupComponent ( Class < T > clazz ) {
|
ComponentLookupException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void run ( ) {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void run ( ) throws Exception {
|
ZkNoNodeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testDuplicateDeploy ( ) { DeploymentUnit basicKieJar = archive . deployBasicKieJar ( ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public SoulResult detailDashboardUser ( @ PathVariable ( " id " ) final String id ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void run ( ) { if ( ! SoterCoreUtil . isNullOrNil ( mChallenge ) ) { if ( SoterCore . getSoterCoreType ( ) == SoterCore . IS_TREBLE ) { executeWhenAuthenticatedWithSession ( mSignatureToAuth , session ) ; } else {
|
SignatureException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static byte [ ] readGZipFile ( String zipFileName ) { if ( fileIsExist ( zipFileName ) ) { Log . i ( TAG , " zipFileName: " + zipFileName ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void onError ( Exception e ) { byte msgType = org . apache . thrift . protocol . TMessageType . REPLY ; org . apache . thrift . TBase msg ; repl_tbl_writeid_state_result result = new repl_tbl_writeid_state_result ( ) ; { msgType = org . apache . thrift . protocol . TMessageType . EXCEPTION ; msg = ( org . apache . thrift . TBase ) new org . apache . thrift . TApplicationException ( org . apache . thrift . TApplicationException . INTERNAL_ERROR , e . getMessage ( ) ) ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public boolean uninstall ( ) { if ( status != Status . INSTALLED ) { throw new IllegalStateException ( " Can only uninstall installed components, but status is " + status . toString ( ) ) ; } assert installedFilesNames != null ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private int checkHeapCapacity ( int expectedObjects ) { int allocated = 0 ;
|
OutOfMemoryError
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public String toString ( ) { JSONObject json = new JSONObject ( ) ; putValue ( json , KEY_SUCCESS , success ) ; putValue ( json , KEY_CODE , code ) ; putValue ( json , KEY_ERROR_MESSAGE , errorMessage ) ; putValue ( json , KEY_DATA , CCUtil . convertToJson ( data ) ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. static public DataObject selectBundle ( Project prj , FileObject file ) {
|
UserCancelException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void finishHim ( ) { NodesResponse finalResponse ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public NamingEnumeration < SearchResult > search ( Name name , Attributes matchingAttributes , String [ ] attributesToReturn ) throws NamingException { PartialCompositeDirContext ctx = this ; Hashtable < ? , ? > env = p_getEnvironment ( ) ; Continuation cont = new Continuation ( name , env ) ; NamingEnumeration < SearchResult > answer ; Name nm = name ;
|
CannotProceedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testAdd ( ) throws Exception { DoubleHistogram histogram = new DoubleHistogram ( trackableValueRangeSize , numberOfSignificantValueDigits ) ; DoubleHistogram other = new DoubleHistogram ( trackableValueRangeSize , numberOfSignificantValueDigits ) ; histogram . recordValue ( testValueLevel ) ; histogram . recordValue ( testValueLevel * 1000 ) ; other . recordValue ( testValueLevel ) ; other . recordValue ( testValueLevel * 1000 ) ; histogram . add ( other ) ; assertEquals ( 2L , histogram . getCountAtValue ( testValueLevel ) ) ; assertEquals ( 2L , histogram . getCountAtValue ( testValueLevel * 1000 ) ) ; assertEquals ( 4L , histogram . getTotalCount ( ) ) ; DoubleHistogram biggerOther = new DoubleHistogram ( trackableValueRangeSize * 2 , numberOfSignificantValueDigits ) ; biggerOther . recordValue ( testValueLevel ) ; biggerOther . recordValue ( testValueLevel * 1000 ) ; biggerOther . add ( histogram ) ; assertEquals ( 3L , biggerOther . getCountAtValue ( testValueLevel ) ) ; assertEquals ( 3L , biggerOther . getCountAtValue ( testValueLevel * 1000 ) ) ; assertEquals ( 6L , biggerOther . getTotalCount ( ) ) ;
|
ArrayIndexOutOfBoundsException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. @ Override public void awaitFirstPage ( ) throws IgniteCheckedException {
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected ExecuteResult doWork ( ExecutableContext context ) throws ExecuteException { KylinConfig kylinConfig = context . getConfig ( ) ; CubeManager cubeManager = CubeManager . getInstance ( kylinConfig ) ; CubeInstance cube = cubeManager . getCube ( LookupExecutableUtil . getCubeName ( this . getParams ( ) ) ) ; List < String > segmentIDs = LookupExecutableUtil . getSegments ( this . getParams ( ) ) ; String lookupTableName = LookupExecutableUtil . getLookupTableName ( this . getParams ( ) ) ; String extLookupSnapshotStr = this . getParam ( BatchConstants . ARG_EXT_LOOKUP_SNAPSHOTS_INFO ) ; if ( extLookupSnapshotStr == null || extLookupSnapshotStr . isEmpty ( ) ) { return new ExecuteResult ( ) ; } Map < String , String > extLookupSnapshotMap = LookupMaterializeContext . parseLookupSnapshots ( extLookupSnapshotStr ) ; String snapshotResPath = extLookupSnapshotMap . get ( lookupTableName ) ; if ( snapshotResPath == null ) { logger . info ( " no snapshot path exist in the context, so no need to update snapshot path " ) ; return new ExecuteResult ( ) ; } CubeDesc cubeDesc = cube . getDescriptor ( ) ;
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. static SpeciesData getSpeciesDataFromConcreteBMHClass ( Class < ? extends BoundMethodHandle > cbmh ) {
|
ReflectiveOperationException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static KeyProvider getInstance ( String keyProviderType , Context context ) { Preconditions . checkNotNull ( keyProviderType , " key provider type must not be null " ) ; KeyProviderType type ;
|
IllegalArgumentException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private static boolean test ( String proto , MBeanServer mbs ) throws Exception { System . out . println ( " Test immediate client close for protocol " + proto ) ; JMXServiceURL u = new JMXServiceURL ( proto , null , 0 ) ; JMXConnectorServer s ;
|
MalformedURLException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testSetException ( ) throws Exception { SettableFuture < Object > future = SettableFuture . create ( ) ; Exception e = new Exception ( " foobarbaz " ) ; assertTrue ( future . setException ( e ) ) ; assertFalse ( future . set ( 23 ) ) ; assertFalse ( future . setException ( new Exception ( " quux " ) ) ) ; assertFalse ( future . setFuture ( SettableFuture . create ( ) ) ) ; assertTrue ( future . isDone ( ) ) ; assertFalse ( future . isCancelled ( ) ) ;
|
ExecutionException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public ClassVisitor create ( final String name ) { final ClassWriter cw = new ClassWriter ( ClassWriter . COMPUTE_MAXS ) ; final LambadaNameSafeClassAdapter rca = new LambadaNameSafeClassAdapter ( cw ) ; return new ClassVisitor ( Opcodes . ASM5 , rca ) { @ Override public void visitEnd ( ) { super . visitEnd ( ) ; String className = rca . getClassName ( ) ; byte [ ] data ; try { data = cw . toByteArray ( ) ; } catch ( Exception ex ) { System . err . println ( String . format ( " ASM fail to generate .class file: %s " , className ) ) ; exceptionHandler . handleFileException ( ex ) ; return ; }
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void onTerminalState ( JobStatus status ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private String mapProperties ( CatalogInfo resource ) { String id = null ; for ( CatalogStoreMapping . CatalogStoreMappingElement mappingElement : mapping . elements ( ) ) { Object value ;
|
IllegalArgumentException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public T parse ( String value ) { if ( value == null || value . isEmpty ( ) || value . equalsIgnoreCase ( " NULL " ) ) { return null ; } if ( ! Strings . isQuoted ( value ) ) { throw new IllegalArgumentException ( " JSON strings must be enclosed by single quotes " ) ; } String json = Strings . unquote ( value ) ;
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static void main ( String [ ] args ) { ArgumentParser parser = argParser ( ) ; if ( args . length == 0 ) { parser . printHelp ( ) ; Exit . exit ( 0 ) ; }
|
ArgumentParserException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public int read ( byte [ ] buffer , int byteOffset , int byteCount ) { int read ;
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void checkChaining ( ExecutorService exec ) throws Exception { final CX1 < IgniteInternalFuture < Object > , Object > passThrough = new CX1 < IgniteInternalFuture < Object > , Object > ( ) { @ Override public Object applyx ( IgniteInternalFuture < Object > f ) throws IgniteCheckedException { return f . get ( ) ; } } ; GridFutureAdapter < Object > fut = new GridFutureAdapter < > ( ) ; IgniteInternalFuture < Object > chain = exec != null ? fut . chain ( passThrough , exec ) : fut . chain ( passThrough ) ; assertFalse ( fut . isDone ( ) ) ; assertFalse ( chain . isDone ( ) ) ;
|
IgniteFutureTimeoutCheckedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void execute ( String mode ) throws Exception { AlgorithmParameterSpec aps = null ; String transformation = ALGO + " / " + mode + " / " + PADDING ; Cipher ci = Cipher . getInstance ( transformation , " SunJCE " ) ; KeyGenerator kg = KeyGenerator . getInstance ( ALGO , " SunJCE " ) ; kg . init ( KEYSIZE * 8 ) ; SecretKey key = kg . generateKey ( ) ;
|
InvalidAlgorithmParameterException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void setupOutput ( ContextImpl contextImpl ) throws Exception { SinkSpec sinkSpec = this . instanceConfig . getFunctionDetails ( ) . getSink ( ) ; Object object ; if ( sinkSpec . getClassName ( ) . isEmpty ( ) ) { if ( StringUtils . isEmpty ( sinkSpec . getTopic ( ) ) ) { object = PulsarSinkDisable . INSTANCE ; } else { PulsarSinkConfig pulsarSinkConfig = new PulsarSinkConfig ( ) ; pulsarSinkConfig . setProcessingGuarantees ( FunctionConfig . ProcessingGuarantees . valueOf ( this . instanceConfig . getFunctionDetails ( ) . getProcessingGuarantees ( ) . name ( ) ) ) ; pulsarSinkConfig . setTopic ( sinkSpec . getTopic ( ) ) ; if ( ! StringUtils . isEmpty ( sinkSpec . getSchemaType ( ) ) ) { pulsarSinkConfig . setSchemaType ( sinkSpec . getSchemaType ( ) ) ; } else if ( ! StringUtils . isEmpty ( sinkSpec . getSerDeClassName ( ) ) ) { pulsarSinkConfig . setSerdeClassName ( sinkSpec . getSerDeClassName ( ) ) ; } pulsarSinkConfig . setTypeClassName ( sinkSpec . getTypeClassName ( ) ) ; object = new PulsarSink ( this . client , pulsarSinkConfig , this . properties , this . stats , this . functionClassLoader ) ; } } else { object = Reflections . createInstance ( sinkSpec . getClassName ( ) , this . functionClassLoader ) ; } if ( object instanceof Sink ) { this . sink = ( Sink ) object ; } else { throw new RuntimeException ( " Sink does not implement correct interface " ) ; } if ( ! ( this . sink instanceof PulsarSink ) ) { Thread . currentThread ( ) . setContextClassLoader ( this . functionClassLoader ) ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public List < PreparedStatement > createInsertValuesPreparedStmt ( Connection dbConn , String tblColumns , List < String > rows , List < List < String > > paramsList ) throws SQLException { if ( rows == null || rows . size ( ) == 0 ) { return Collections . emptyList ( ) ; } assert ( ( paramsList == null ) || ( rows . size ( ) == paramsList . size ( ) ) ) ; List < Integer > rowsCountInStmts = new ArrayList < > ( ) ; List < String > insertStmts = createInsertValuesStmt ( tblColumns , rows , rowsCountInStmts ) ; assert ( insertStmts . size ( ) == rowsCountInStmts . size ( ) ) ; List < PreparedStatement > preparedStmts = new ArrayList < > ( ) ; int paramsListFromIdx = 0 ;
|
SQLException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void processClusterChange ( HelixConstants . ChangeType changeType ) { Preconditions . checkState ( changeType == HelixConstants . ChangeType . LIVE_INSTANCE , " Illegal change type: " + changeType ) ; if ( _connectionPool == null ) { return ; } List < LiveInstance > liveInstances = _helixDataAccessor . getChildValues ( _liveInstancesKey ) ; for ( LiveInstance instance : liveInstances ) { String instanceId = instance . getInstanceName ( ) ; String sessionId = instance . getSessionId ( ) ; if ( ! instanceId . startsWith ( CommonConstants . Helix . PREFIX_OF_SERVER_INSTANCE ) ) { LOGGER . debug ( " Skipping non-server instance {} " , instanceId ) ; continue ; } String namePortStr = instanceId . split ( CommonConstants . Helix . PREFIX_OF_SERVER_INSTANCE ) [ 1 ] ; String hostName = namePortStr . split ( " _ " ) [ 0 ] ; int port ; try { port = Integer . parseInt ( namePortStr . split ( " _ " ) [ 1 ] ) ; } catch ( Exception e ) { port = CommonConstants . Helix . DEFAULT_SERVER_NETTY_PORT ; LOGGER . warn ( " Port for server instance {} does not appear to be numeric, defaulting to {}. " , instanceId , port , e ) ; } if ( _liveInstanceToSessionIdMap . containsKey ( instanceId ) ) { if ( ! sessionId . equals ( _liveInstanceToSessionIdMap . get ( instanceId ) ) ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void run ( ) { Cache cache = getCache ( ) ; final CountDownLatch recoveryDone = new CountDownLatch ( 1 ) ; ResourceObserver observer = new InternalResourceManager . ResourceObserverAdapter ( ) { @ Override public void recoveryFinished ( Region region ) { if ( region . getName ( ) . contains ( " region2 " ) ) { recoveryDone . countDown ( ) ; } } } ; InternalResourceManager . setResourceObserver ( observer ) ; DiskStore ds2 = cache . findDiskStore ( " disk2 " ) ; if ( ds2 == null ) { ds2 = cache . createDiskStoreFactory ( ) . setDiskDirs ( getDiskDirs ( ) ) . create ( " disk2 " ) ; } AttributesFactory af = new AttributesFactory ( ) ; PartitionAttributesFactory paf = new PartitionAttributesFactory ( ) ; paf . setRedundantCopies ( 1 ) ; paf . setRecoveryDelay ( 0 ) ; paf . setColocatedWith ( getPartitionedRegionName ( ) ) ; af . setDataPolicy ( DataPolicy . PERSISTENT_PARTITION ) ; af . setDiskStoreName ( " disk2 " ) ; af . setPartitionAttributes ( paf . create ( ) ) ; cache . createRegion ( " region2 " , af . create ( ) ) ;
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static Bitmap decodeFile ( File file , int width , int height ) {
|
FileNotFoundException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. static void inject ( Method mtd , Object target , Object rsrc ) throws IgniteCheckedException { if ( mtd . getParameterTypes ( ) . length != 1 || ( rsrc != null && ! mtd . getParameterTypes ( ) [ 0 ] . isAssignableFrom ( rsrc . getClass ( ) ) ) ) { throw new IgniteCheckedException ( " Setter does not have single parameter of required type [type= " + rsrc . getClass ( ) . getName ( ) + " , setter= " + mtd + ']' ) ; }
|
IllegalAccessException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public AcidWriteMessage getAcidWriteMessage ( String messageBody ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static List < ExpandableItemData > getChildrenByPath ( String path , int treeDepth ) { treeDepth ++ ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected void done ( ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void setSelectorDrawable ( TypedArray typedArray , TypedArray selectorTa , StateListDrawable stateListDrawable , int attr , @ AttrRes int functionId ) throws Exception { int color = 0 ; Drawable resDrawable = null ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static Object readObjectFrom ( String path ) { ObjectInputStream ois = null ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void rollback ( ) throws CanalClientException { int times = 0 ; while ( times < retryTimes ) {
|
Throwable
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected void awaitLatch ( CountDownLatch countDownLatch , InternalCompletableFuture future ) throws ExecutionException {
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void unregisterCacheListener ( CacheListener cacheListener , String url ) { checkAllNotNull ( cacheListener , url ) ; synchronized ( clientsLock ) {
|
ProxyCacheException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public JSONObject confForDid ( long did ) { JSONObject deck = get ( did , false ) ; assert deck != null ; if ( deck . has ( " conf " ) ) {
|
JSONException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private boolean available ( int port ) { final Socket s = new Socket ( ) ; try { s . bind ( new InetSocketAddress ( InetAddress . getLoopbackAddress ( ) , port ) ) ; } catch ( IOException e ) { return false ; } finally {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static final JSONArray newJSONArray ( ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static boolean parseFloatAttribute ( String attribute , String value , TypedValue outValue , boolean requireUnit ) { value = value . trim ( ) ; int len = value . length ( ) ; if ( len <= 0 ) { return false ; } char [ ] buf = value . toCharArray ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( buf [ i ] > 255 ) { return false ; } } if ( buf [ 0 ] < '0' && buf [ 0 ] > '9' && buf [ 0 ] != '.' && buf [ 0 ] != '-' ) { return false ; } Matcher m = sFloatPattern . matcher ( value ) ; if ( m . matches ( ) ) { String f_str = m . group ( 1 ) ; String end = m . group ( 2 ) ; float f ;
|
NumberFormatException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public DiscoveryResult createResult ( ServiceInfo info ) { DiscoveryResult result = null ; ThingUID uid = getThingUID ( info ) ; if ( uid != null ) { InetAddress [ ] addrs = info . getInetAddresses ( ) ; Map < String , Object > properties = new HashMap < > ( 2 ) ; String label = null ; if ( BST_10_THING_TYPE_UID . equals ( uid . getThingTypeUID ( ) ) ) {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void resize ( int minCapacityAdd ) throws IOException {
|
NegativeArraySizeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public Builder mergeFrom ( com . google . protobuf . CodedInputStream input , com . google . protobuf . ExtensionRegistryLite extensionRegistry ) throws java . io . IOException { com . github . neuralnetworks . builder . designio . protobuf . ProtoBufWrapper . HDF5OutputParameter parsedMessage = null ;
|
com.google
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void abortTxn ( ) throws InterruptedException { LOG . info ( " Aborting Txn id {} on End Point {} " , txnBatch . getCurrentTxnId ( ) , endPoint ) ;
|
InterruptedException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. boolean equals ( Object a , Object b ) {
|
RuntimeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void testRandom ( ) throws SQLException { Random random = new Random ( 1 ) ; for ( int i = 0 ; i < 100 ; i ++ ) { StringBuilder buff = new StringBuilder ( " {oj } " ) ; String s = " {}\'\ " -/*$ $- " ; for ( int j = random . nextInt ( 30 ) ; j > 0 ; j -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } String sql = buff . toString ( ) ; try { conn . nativeSQL ( sql ) ; } catch ( SQLException e ) { assertKnownException ( sql , e ) ; } } String smallest = null ; for ( int i = 0 ; i < 1000 ; i ++ ) { StringBuilder buff = new StringBuilder ( " {oj } " ) ; for ( int j = random . nextInt ( 10 ) ; j > 0 ; j -- ) { String s ; switch ( random . nextInt ( 7 ) ) { case 0 : buff . append ( " $$ " ) ; s = " {}\'\ " -/* a\n " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " $$ " ) ; break ; case 1 : buff . append ( " ' " ) ; s = " {}\ " -/*$ a\n " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " ' " ) ; break ; case 2 : buff . append ( " \ " " ) ; s = " {}'-/*$ a\n " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " \ " " ) ; break ; case 3 : buff . append ( " /* " ) ; s = " {}'\ " -/$ a\n " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " */ " ) ; break ; case 4 : buff . append ( " -- " ) ; s = " {}'\ " -/$ a " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " \n " ) ; break ; case 5 : buff . append ( " // " ) ; s = " {}'\ " -/$ a " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } buff . append ( " \n " ) ; break ; case 6 : s = " a\n " ; for ( int k = random . nextInt ( 5 ) ; k > 0 ; k -- ) { buff . append ( s . charAt ( random . nextInt ( s . length ( ) ) ) ) ; } break ; default : } } String sql = buff . toString ( ) ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public URL getURL ( ) {
|
MalformedURLException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void testIndexData ( boolean forceGuaranteedRollup ) throws Exception { try ( final Closeable ignored1 = unloader ( INDEX_DATASOURCE + config . getExtraDatasourceNameSuffix ( ) ) ; final Closeable ignored2 = unloader ( INDEX_INGEST_SEGMENT_DATASOURCE + config . getExtraDatasourceNameSuffix ( ) ) ) { final PartitionsSpec partitionsSpec = forceGuaranteedRollup ? new HashedPartitionsSpec ( null , 2 , null ) : new DynamicPartitionsSpec ( null , null ) ; final Function < String , String > rollupTransform = spec -> {
|
JsonProcessingException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public Node getChild ( String displayName , Class clazz ) { if ( ! Node . class . isAssignableFrom ( clazz ) ) { throw new IllegalArgumentException ( clazz + " is not instance of org.netbeans.jellytools.nodes.Node " ) ; } if ( ! this . containsChild ( displayName ) ) return null ; Node node = null ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public Expression compileExpression ( int opPos ) throws TransformerException {
|
StackOverflowError
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void createDirectory ( Path tempDir ) {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public static boolean isPubspecDeclaringFlutter ( @ NotNull final VirtualFile pubspec ) {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public boolean fetchLine ( Record record ) throws Exception { Result result = super . getNextHbaseRow ( ) ; if ( null == result ) { return false ; } super . lastResult = result ;
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public long readLong ( long pos ) throws IOException { final int bi = ( int ) ( pos > > chunkSizePower ) ;
|
IndexOutOfBoundsException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void surfaceChanged ( final SurfaceHolder holder , final int format , final int width , final int height ) { if ( mPreviewRunning ) { try { mCameraWrapper . stopPreview ( ) ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } } try { mCameraWrapper . configureForPreview ( width , height ) ; CLog . d ( CLog . PREVIEW , " Configured camera for preview in surface of " + width + " by " + height ) ; } catch ( final RuntimeException e ) { e . printStackTrace ( ) ; CLog . d ( CLog . PREVIEW , " Failed to show preview - invalid parameters set to camera preview " ) ; mInterface . onCapturePreviewFailed ( ) ; return ; }
|
RuntimeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected AlgorithmParameters engineGetParameters ( ) { AlgorithmParameters params = null ; if ( salt == null ) { salt = new byte [ DEFAULT_SALT_LENGTH ] ; SunJCE . getRandom ( ) . nextBytes ( salt ) ; iCount = DEFAULT_COUNT ; } if ( ivSpec == null ) { byte [ ] ivBytes = new byte [ blkSize ] ; SunJCE . getRandom ( ) . nextBytes ( ivBytes ) ; ivSpec = new IvParameterSpec ( ivBytes ) ; } PBEParameterSpec pbeSpec = new PBEParameterSpec ( salt , iCount , ivSpec ) ;
|
NoSuchAlgorithmException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. protected byte [ ] engineDoFinal ( byte [ ] input , int inputOffset , int inputLen ) throws IllegalBlockSizeException , BadPaddingException { if ( input != null ) { bOut . write ( input , inputOffset , inputLen ) ; } if ( cipher instanceof RSABlindedEngine ) { if ( bOut . size ( ) > cipher . getInputBlockSize ( ) + 1 ) { throw new ArrayIndexOutOfBoundsException ( " too much data for RSA block " ) ; } } else { if ( bOut . size ( ) > cipher . getInputBlockSize ( ) ) { throw new ArrayIndexOutOfBoundsException ( " too much data for RSA block " ) ; } }
|
InvalidCipherTextException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private synchronized Map < String , DocumentMapper > internalMerge ( Map < String , CompressedXContent > mappings , MergeReason reason , boolean updateAllTypes ) { List < DocumentMapper > documentMappers = new ArrayList < > ( ) ; for ( Map . Entry < String , CompressedXContent > entry : mappings . entrySet ( ) ) { String type = entry . getKey ( ) ; if ( type . equals ( DEFAULT_MAPPING ) ) { continue ; }
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private @ Nullable State parseTahomaState ( @ Nullable String acceptedState , @ Nullable SomfyTahomaState state ) { if ( state == null ) { return UnDefType . NULL ; } int type = state . getType ( ) ;
|
NumberFormatException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void provisionMemoryLimit ( Container container , CheContainer cheContainer ) throws InfrastructureException { String memoryLimit = cheContainer . getMemoryLimit ( ) ; if ( isNullOrEmpty ( memoryLimit ) ) { return ; }
|
IllegalArgumentException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void addCreateAuth ( ) {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private Iterable < Path > getPathEntries ( String searchPath , Path emptyPathDefault ) { ListBuffer < Path > entries = new ListBuffer < > ( ) ; for ( String s : searchPath . split ( Pattern . quote ( File . pathSeparator ) , - 1 ) ) { if ( s . isEmpty ( ) ) { if ( emptyPathDefault != null ) { entries . add ( emptyPathDefault ) ; } } else {
|
IllegalArgumentException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public String getResolvedEntity ( String publicId , String systemId ) { String resolved = null ; if ( catalog == null ) { catalogManager . debug . message ( 1 , " Catalog resolution attempted with null catalog; ignored " ) ; return null ; } if ( systemId != null ) { try { resolved = catalog . resolveSystem ( systemId ) ; } catch ( MalformedURLException me ) { catalogManager . debug . message ( 1 , " Malformed URL exception trying to resolve " , publicId ) ; resolved = null ; } catch ( IOException ie ) { catalogManager . debug . message ( 1 , " I/O exception trying to resolve " , publicId ) ; resolved = null ; } } if ( resolved == null ) { if ( publicId != null ) {
|
MalformedURLException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public int getSqlType ( String typeName ) throws SQLException { boolean isCoreType = preloadedSqlTypes . contains ( typeName ) ; if ( isCoreType ) { return typeInfo . getSQLType ( typeName ) ; } if ( typeName . endsWith ( " [] " ) ) { return Types . ARRAY ; } else {
|
Exception
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. public void trapFieldWrite ( String name , Object value ) { Class < ? > jc = getClassMetaobject ( ) . getJavaClass ( ) ;
|
NoSuchFieldException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void setHelpCode ( ) {
|
IOException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private static byte [ ] read ( InputStream in , byte [ ] target ) throws IOException { int copied = 0 ; int remaining = target . length ; while ( remaining > 0 ) {
|
RuntimeException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private static PythonVersion initSrcsVersionAttr ( RuleContext ruleContext ) { String attrValue = ruleContext . attributes ( ) . get ( " srcs_version " , Type . STRING ) ;
|
IllegalArgumentException
|
You are a coding assistant that will help the user to resolve the following instruction: #Description: Generate a try-catch block that catches the exception of the type specified in the input. #Input: The type of the exception to be caught. #Output: The try-catch block that catches the exception of the type specified in the input. private void runRebase ( final File repository , final RebaseOperationType op , final String source , final String upstream , final String onto ) { GitProgressSupport supp = new GitProgressSupport ( ) { @ Override protected void perform ( ) {
|
GitException
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.