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 InetAddress getSelectedIp ( ) { Object item = getSelectedItem ( ) ; if ( item instanceof InetAddr ) { return ( ( InetAddr ) item ) . getIp ( ) ; } else if ( item instanceof String ) { InetAddress ip ;
UnknownHostException
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 final void collectGarbage ( long sleep ) {
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 void main ( String [ ] args ) throws Exception { MainArgs mainArgs = new MainArgs ( ) ; JCommander commander = new JCommander ( ) ;
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 < T extends EventListener > T initializeListener ( ListenerConfig listenerConfig ) { T listener = null ; if ( listenerConfig . getImplementation ( ) != null ) { listener = ( T ) listenerConfig . getImplementation ( ) ; } else if ( listenerConfig . getClassName ( ) != 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 setFloat32 ( final Object self , final int byteOffset , final double value , final boolean littleEndian ) {
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 static void unGunzipFile ( String compressedFile , String decompressedFile ) { byte [ ] buffer = new byte [ 1024 ] ;
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 InteractiveTestJob getTestJob ( final String name ) { for ( int i = 0 ; i < 1000 ; i ++ ) { if ( testJobs . containsKey ( name ) ) { return testJobs . get ( name ) ; } synchronized ( testJobs ) {
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. void initStreams ( Socket s , int socketBufferSize , MessageStats messageStats ) {
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 void engineUpdate ( ByteBuffer byteBuffer ) { ensureInitialized ( ) ; int len = byteBuffer . remaining ( ) ; if ( len <= 0 ) { return ; } switch ( type ) { case T_UPDATE : if ( byteBuffer instanceof DirectBuffer == false ) { super . engineUpdate ( byteBuffer ) ; return ; } long addr = ( ( DirectBuffer ) byteBuffer ) . address ( ) ; int ofs = byteBuffer . position ( ) ;
PKCS11Exception
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 read ( ByteBuffer binary ) throws ClassNotFoundException { ByteBuffer received = binary ; ByteBuffer exchanged = null ;
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 storeKeys ( Iterator < K > iterator ) { long startedNanos = System . nanoTime ( ) ; FileOutputStream fos = 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 JFileChooser setOpeningDir ( JFileChooser load , boolean trainDocs ) { if ( trainDocs ) { if ( trainDocsDirectory == null ) {
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 visitDeclared ( DeclaredType type , Void p ) { TypeElement element = ( TypeElement ) type . asElement ( ) ; String name = element . getQualifiedName ( ) . toString ( ) ; ElementKind kind = element . getEnclosingElement ( ) . getKind ( ) ; if ( kind . isClass ( ) || kind . isInterface ( ) || kind == ElementKind . PACKAGE ) {
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 visitVersion ( VersionTree node , Void p ) {
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 ( ) { try { TimeUnit . MILLISECONDS . sleep ( 1000 - System . currentTimeMillis ( ) % 1000 ) ; } catch ( InterruptedException e ) { if ( ! ringThreadToStop ) { logger . error ( e . getMessage ( ) , e ) ; } } while ( ! ringThreadToStop ) { try { List < Integer > ringItemData = new ArrayList < > ( ) ; int nowSecond = Calendar . getInstance ( ) . get ( Calendar . SECOND ) ; for ( int i = 0 ; i < 2 ; i ++ ) { List < Integer > tmpData = ringData . remove ( ( nowSecond + 60 - i ) % 60 ) ; if ( tmpData != null ) { ringItemData . addAll ( tmpData ) ; } } logger . debug ( " >>>>>>>>>>> xxl-job, time-ring beat : " + nowSecond + " = " + Arrays . asList ( ringItemData ) ) ; if ( ringItemData != null && ringItemData . size ( ) > 0 ) { for ( int jobId : ringItemData ) { JobTriggerPoolHelper . trigger ( jobId , TriggerTypeEnum . CRON , - 1 , null , null ) ; } ringItemData . clear ( ) ; } } catch ( Exception e ) { if ( ! ringThreadToStop ) { logger . error ( " >>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread error:{} " , e ) ; } }
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 init ( ) {
HibernateException
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 ( ) {
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 flush ( ) { ByteBuffer buf ;
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. public List < RestsDefinition > collectXmlRestsFromDirectory ( CamelContext camelContext , String directory ) { List < RestsDefinition > answer = new ArrayList < > ( ) ; String [ ] parts = directory . split ( " , " ) ; for ( String part : parts ) { log . info ( " Loading additional Camel XML rests from: {} " , part ) ;
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. public void playVoice ( int position , MESSAGE message ) { mController . setLastPlayPosition ( position , mIsSender ) ; try { mMediaPlayer . reset ( ) ; mFIS = new FileInputStream ( message . getMediaFilePath ( ) ) ; mMediaPlayer . setDataSource ( mFIS . getFD ( ) ) ; mMediaPlayer . setAudioStreamType ( AudioManager . STREAM_VOICE_CALL ) ; mMediaPlayer . prepare ( ) ; mMediaPlayer . setOnPreparedListener ( new MediaPlayer . OnPreparedListener ( ) { @ Override public void onPrepared ( MediaPlayer mp ) { mVoiceAnimation . start ( ) ; mp . start ( ) ; } } ) ; mMediaPlayer . setOnCompletionListener ( new MediaPlayer . OnCompletionListener ( ) { @ Override public void onCompletion ( MediaPlayer mp ) { mVoiceAnimation . stop ( ) ; mp . reset ( ) ; mSetData = false ; if ( mIsSender ) { mVoiceIv . setImageResource ( mSendDrawable ) ; } else { mVoiceIv . setImageResource ( mReceiveDrawable ) ; } } } ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } 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 int doFinal ( byte [ ] in , int inOff , int inLen , byte [ ] out , int outOff ) throws ShortBufferException , AEADBadTagException , KeyException { byte [ ] ctPlusTag ; int ctPlusTagLen ; if ( cipherBuf . size ( ) == 0 && inOff == 0 ) { doUpdate ( null , inOff , inLen , out , outOff ) ; ctPlusTag = in ; ctPlusTagLen = inLen ; } else { doUpdate ( in , inOff , inLen , out , outOff ) ; ctPlusTag = cipherBuf . toByteArray ( ) ; ctPlusTagLen = ctPlusTag . length ; } cipherBuf . reset ( ) ; if ( ctPlusTagLen < TAG_LENGTH ) { throw new AEADBadTagException ( " Input too short - need tag " ) ; } int ctLen = ctPlusTagLen - TAG_LENGTH ;
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. private void generateMetricsBuilderClass ( AnalysisResult metricsStmt ) throws OALCompileException { String className = metricsBuilderClassName ( metricsStmt , false ) ; CtClass metricsBuilderClass = classPool . makeClass ( metricsBuilderClassName ( metricsStmt , true ) ) ; try { metricsBuilderClass . addInterface ( classPool . get ( STORAGE_BUILDER_INTERFACE ) ) ; } catch ( NotFoundException e ) { logger . error ( " Can't find StorageBuilder interface for " + className + " . " , e ) ; throw new OALCompileException ( e . getMessage ( ) , e ) ; } ClassFile metricsClassClassFile = metricsBuilderClass . getClassFile ( ) ; ConstPool constPool = metricsClassClassFile . getConstPool ( ) ; try { CtConstructor defaultConstructor = CtNewConstructor . make ( " public " + className + " () {} " , metricsBuilderClass ) ; metricsBuilderClass . addConstructor ( defaultConstructor ) ; } catch ( CannotCompileException e ) { logger . error ( " Can't add empty constructor in " + className + " . " , e ) ; throw new OALCompileException ( e . getMessage ( ) , e ) ; } for ( String method : METRICS_BUILDER_CLASS_METHODS ) { StringWriter methodEntity = new StringWriter ( ) ;
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 test_ConstructorLjava_lang_StringLjava_security_IdentityScope ( ) { String nameNull = null ; String [ ] str = { " test " , " " , " !@#$%^&*() " , " identity name " } ; IdentityScope is ; IdentityScope iss = new IdentityScopeSubclass ( " test scope " ) ; for ( int i = 0 ; i < str . length ; i ++ ) {
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 int transactionState ( String groupId ) {
FastStorageException
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 Class < ? > createClass ( JarEntry entry , Manifest manifest , String packageName , String origName ) { byte [ ] clBuf ;
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. synchronized Class < ? > getProxyClass ( Member member ) { Class < ? > ret = proxyMap . get ( member ) ; if ( ret == null ) { String name = getStableProxyName ( member ) + PROXY_NAME_SEPARATOR + proxyNr . incrementAndGet ( ) ; Class < ? > iface = getAccessorInterface ( member ) ; byte [ ] proxyBC = generateProxyClass ( name , new Class < ? > [ ] { iface , ReflectionProxy . class } ) ;
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 Sequence < Integer > run ( QueryPlus < Integer > queryPlus , ResponseContext responseContext ) { synchronized ( this ) {
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 Void doInBackground ( Context ... params ) {
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. protected void addColumnNames ( SqlValidatorNamespace ns , List < SqlMoniker > colNames ) { final RelDataType rowType ;
Error
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 waitForRestartSolverDecision ( ) { if ( ! daemon ) { return ! problemFactChangeQueue . isEmpty ( ) && ! terminatedEarly ; } else { while ( problemFactChangeQueue . isEmpty ( ) && ! terminatedEarly ) {
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 boolean equalsXML ( File f1 , File f2 ) {
ParserConfigurationException
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 readFieldValues ( EmulatedFieldsForLoading emulatedFields ) throws OptionalDataException , InvalidClassException , IOException { EmulatedFields . ObjectSlot [ ] slots = emulatedFields . emulatedFields ( ) . slots ( ) ; for ( ObjectSlot element : slots ) { element . defaulted = false ; Class < ? > type = element . field . getType ( ) ; if ( type == int . class ) { element . fieldValue = input . readInt ( ) ; } else if ( type == byte . class ) { element . fieldValue = input . readByte ( ) ; } else if ( type == char . class ) { element . fieldValue = input . readChar ( ) ; } else if ( type == short . class ) { element . fieldValue = input . readShort ( ) ; } else if ( type == boolean . class ) { element . fieldValue = input . readBoolean ( ) ; } else if ( type == long . class ) { element . fieldValue = input . readLong ( ) ; } else if ( type == float . class ) { element . fieldValue = input . readFloat ( ) ; } else if ( type == double . class ) { element . fieldValue = input . readDouble ( ) ; } else {
ClassNotFoundException
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 onDataAvailable ( ) {
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 ( ) { initUI ( ) ;
PropertyVetoException
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 test_setIntLjava_lang_ObjectII ( ) { int [ ] x = { 0 } ; boolean thrown = false ; try { Array . setInt ( x , 0 , ( int ) 1 ) ; } catch ( Exception e ) { fail ( " Exception during get test : " + e . getMessage ( ) ) ; } assertEquals ( " Get returned incorrect value " , 1 , Array . getInt ( x , 0 ) ) ; try { Array . setInt ( new Object ( ) , 0 , ( int ) 9 ) ; } catch ( IllegalArgumentException e ) { thrown = true ; } if ( ! thrown ) { fail ( " Passing non-array failed to throw exception " ) ; } thrown = false ; try { Array . setInt ( x , 4 , ( int ) 9 ) ; } catch ( ArrayIndexOutOfBoundsException e ) { thrown = true ; } if ( ! thrown ) { fail ( " Invalid index failed to throw exception " ) ; } thrown = false ;
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 List < ServiceInstance > getServiceInstances ( long startTimestamp , long endTimestamp , String serviceId ) throws IOException { StringBuilder sql = new StringBuilder ( ) ; List < Object > condition = new ArrayList < > ( 5 ) ; sql . append ( " select * from " ) . append ( ServiceInstanceInventory . INDEX_NAME ) . append ( " where " ) ; setTimeRangeCondition ( sql , condition , startTimestamp , endTimestamp ) ; sql . append ( " and " ) . append ( ServiceInstanceInventory . SERVICE_ID ) . append ( " =? " ) ; condition . add ( serviceId ) ; List < ServiceInstance > serviceInstances = new ArrayList < > ( ) ; try ( Connection connection = h2Client . getConnection ( ) ) { try ( ResultSet resultSet = h2Client . executeQuery ( connection , sql . toString ( ) , condition . toArray ( new Object [ 0 ] ) ) ) { while ( resultSet . next ( ) ) { ServiceInstance serviceInstance = new ServiceInstance ( ) ; serviceInstance . setId ( resultSet . getString ( ServiceInstanceInventory . SEQUENCE ) ) ; serviceInstance . setName ( resultSet . getString ( ServiceInstanceInventory . NAME ) ) ; serviceInstance . setInstanceUUID ( resultSet . getString ( ServiceInstanceInventory . INSTANCE_UUID ) ) ; String propertiesString = resultSet . getString ( ServiceInstanceInventory . PROPERTIES ) ; if ( ! Strings . isNullOrEmpty ( propertiesString ) ) { JsonObject properties = GSON . fromJson ( propertiesString , JsonObject . class ) ; for ( Map . Entry < String , JsonElement > property : properties . entrySet ( ) ) { String key = property . getKey ( ) ; String value = property . getValue ( ) . getAsString ( ) ; if ( key . equals ( LANGUAGE ) ) { serviceInstance . setLanguage ( LanguageTrans . INSTANCE . value ( value ) ) ; } else if ( key . equals ( OS_NAME ) ) { serviceInstance . getAttributes ( ) . add ( new Attribute ( OS_NAME , value ) ) ; } else if ( key . equals ( HOST_NAME ) ) { serviceInstance . getAttributes ( ) . add ( new Attribute ( HOST_NAME , value ) ) ; } else if ( key . equals ( PROCESS_NO ) ) { serviceInstance . getAttributes ( ) . add ( new Attribute ( PROCESS_NO , value ) ) ; } else if ( key . equals ( IPV4S ) ) { List < String > ipv4s = ServiceInstanceInventory . PropertyUtil . ipv4sDeserialize ( properties . get ( IPV4S ) . getAsString ( ) ) ; for ( String ipv4 : ipv4s ) { serviceInstance . getAttributes ( ) . add ( new Attribute ( ServiceInstanceInventory . PropertyUtil . IPV4S , ipv4 ) ) ; } } else { serviceInstance . getAttributes ( ) . add ( new Attribute ( key , value ) ) ; } } } serviceInstances . add ( serviceInstance ) ; } }
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 printCaches ( ) throws IOException { HeapClusterAnalyzer hca = new HeapClusterAnalyzer ( heap ) ; hca . addEntryPoint ( " (**.CacheImpl).dataContainer.entries " ) ; hca . blackList ( " (**.DefaultDataContainer$*) " ) ; hca . blackList ( " (java.lang.reflect.**) " ) ; hca . blackList ( " (**.TransactionImple) " ) ; hca . blackList ( " (**.BoundedConcurrentHashMap$HashEntry).* " ) ; hca . blackList ( " (**.BoundedConcurrentHashMap$LRU) " ) ; hca . prepare ( ) ; Map < String , Integer > histo = new TreeMap < String , Integer > ( ) ; JavaClass jc = heap . getJavaClassByName ( " org.infinispan.CacheImpl " ) ; for ( Instance i : jc . getInstances ( ) ) {
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. synchronized public boolean uploadBlob ( BlobId blobId , long blobSize , CloudBlobMetadata cloudBlobMetadata , InputStream blobInputStream ) { int bufferSz = ( blobSize == - 1 ) ? 1024 : ( int ) blobSize ; byte [ ] buffer = new byte [ bufferSz ] ; ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ;
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 stopHttpAdaptor ( ) { if ( ! this . agentConfig . isHttpEnabled ( ) ) return ; try { this . httpAdaptor . stop ( ) ; } catch ( Exception e ) { logger . warn ( e . getMessage ( ) , e ) ; }
MalformedObjectNameException
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 newStringConstructor ( String type , String param ) throws Exception { Constructor < ? > c = Utils . getClass ( type ) . getConstructor ( String . class ) ;
InvocationTargetException
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 shortDebugString ( final FieldDescriptor field , final Object 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 Builder mergeFrom ( com . google . protobuf . CodedInputStream input , com . google . protobuf . ExtensionRegistryLite extensionRegistry ) throws java . io . IOException { alluxio . grpc . GetServiceVersionPResponse 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. public boolean getActiveGpx ( List < ASelectedGpxFile > files ) {
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 setRecentsVisibility ( boolean visible ) {
RemoteException
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. @ BeforeClass public static void setup ( ) throws Exception {
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 boolean renameImpl ( RepositoryModel oldRepository , RepositoryModel newRepository ) { Jedis jedis = pool . getResource ( ) ; if ( jedis == null ) { return false ; } boolean success = false ;
JedisException
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 ProfilingPoint loadProfilingPoint ( Lookup . Provider project , Properties properties , int index ) { String name = properties . getProperty ( index + " _ " + ProfilingPoint . PROPERTY_NAME , null ) ; String enabledStr = properties . getProperty ( index + " _ " + ProfilingPoint . PROPERTY_ENABLED , null ) ; CodeProfilingPoint . Location startLocation = CodeProfilingPoint . Location . load ( project , index , START_LOCATION_PREFIX , properties ) ; CodeProfilingPoint . Location endLocation = CodeProfilingPoint . Location . load ( project , index , END_LOCATION_PREFIX , properties ) ; if ( ( name == null ) || ( enabledStr == null ) || ( startLocation == null ) ) { return null ; } StopwatchProfilingPoint profilingPoint = 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 initialize ( int keySize , SecureRandom random ) { token . ensureValid ( ) ;
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. @ Override public InputStream open ( ) throws IOException { if ( isIllegalSymlink ( ) ) { throw new FileNotFoundException ( f . getPath ( ) ) ; }
InvalidPathException
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 testGetFunctionMissingTenant ( ) throws IOException {
RestException
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 ParserResult importDatabase ( BufferedReader reader ) throws IOException { Objects . requireNonNull ( reader ) ;
JAXBException
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 Status read ( String table , String key , Set < String > fields , Map < String , ByteIterator > result ) { if ( ! tableName . equals ( table ) ) { currentTable = null ;
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 testInvokersWithCatch ( MethodType type ) throws Throwable {
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. public void testCallback ( ) throws InterruptedException { RequestBody req = new RequestBody ( 1 , " hello world callback " ) ; final List < String > rets = new ArrayList < String > ( 1 ) ; for ( int i = 0 ; i < invokeTimes ; i ++ ) { final CountDownLatch latch = new CountDownLatch ( 1 ) ; try { if ( i % 2 == 0 ) { client . invokeWithCallback ( addr , req , new InvokeCallBackImpl ( rets , latch ) , 1000 ) ; } else { InvokeContext invokeContext = new InvokeContext ( ) ; invokeContext . putIfAbsent ( InvokeContext . BOLT_CRC_SWITCH , false ) ; client . invokeWithCallback ( addr , req , invokeContext , new InvokeCallBackImpl ( rets , latch ) , 1000 ) ; } } catch ( RemotingException e ) { latch . countDown ( ) ; String errMsg = " RemotingException caught in callback! " ; logger . error ( errMsg , e ) ; Assert . fail ( errMsg ) ; }
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 boolean execute ( ContainerLoader container ) { this . container = container ; this . report = new Report ( ) ; this . container . setTimeRepresentation ( generalConfig . getTimeRepresentation ( ) ) ; this . container . setTimeZone ( generalConfig . getTimeZone ( ) ) ; try ( SheetParser parser = createParser ( ) ) { switch ( getMode ( ) ) { case NODES_TABLE : importer = new ImportNodesProcess ( generalConfig , parser , container , progressTicket ) ; break ; case EDGES_TABLE : importer = new ImportEdgesProcess ( generalConfig , parser , container , progressTicket ) ; break ; case ADJACENCY_LIST : importer = new ImportAdjacencyListProcess ( generalConfig , container , progressTicket , parser ) ; break ; case MATRIX : importer = new ImportMatrixProcess ( generalConfig , container , progressTicket , parser ) ; break ; default : throw new IllegalArgumentException ( " Unknown mode " + getMode ( ) ) ; } importer . execute ( ) ;
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 Iterator createTestSet ( ImageWriter w ) { List l = new LinkedList ( ) ; Test . iw = w ; BMPImageWriteParam param = ( BMPImageWriteParam ) iw . getDefaultWriteParam ( ) ; param . setCompressionMode ( ImageWriteParam . MODE_EXPLICIT ) ; param . setCompressionType ( " BI_RGB " ) ; if ( param . canWriteCompressed ( ) ) { String [ ] cTypes = param . getCompressionTypes ( ) ; String [ ] cDescr = param . getCompressionQualityDescriptions ( ) ; float [ ] cValues = param . getCompressionQualityValues ( ) ; if ( cDescr == null ) { System . out . println ( " There are no compression quality description! " ) ; } else { for ( int i = 0 ; i < cDescr . length ; i ++ ) { System . out . println ( " Quality[ " + i + " ]=\ " " + cDescr [ i ] + " \ " " ) ; } } if ( cValues == null ) { System . out . println ( " There are no compression quality values! " ) ; } else { for ( int i = 0 ; i < cValues . length ; i ++ ) { System . out . println ( " Value[ " + i + " ]=\ " " + cValues [ i ] + " \ " " ) ; } } for ( int i = 0 ; i < cTypes . length ; i ++ ) { String compressionType = cTypes [ i ] ; BufferedImage img = null ; int type = BufferedImage . TYPE_INT_BGR ;
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 SSLContext getCACertSSLContext ( ) {
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 Builder mergeFrom ( com . google . protobuf . CodedInputStream input , com . google . protobuf . ExtensionRegistryLite extensionRegistry ) throws java . io . IOException { msec . monitor . Monitor . ReqSetAlarmAttr 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 addAdditionalConfigurations ( WebAppContext webAppContext ) { List < String > configurations = new ArrayList < > ( ) ; configurations . add ( AnnotationConfiguration . class . getName ( ) ) ;
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 ( ) {
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 endElement ( String namespaceURI , String localName , String name ) throws org . xml . sax . SAXException { if ( isInEntityRef ( ) ) return ; if ( m_doIndent ) { flushCharactersBuffer ( false ) ; } m_prefixMap . popNamespaces ( m_elemContext . m_currentElemDepth , null ) ;
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 Builder mergeFrom ( com . google . protobuf . CodedInputStream input , com . google . protobuf . ExtensionRegistryLite extensionRegistry ) throws java . io . IOException { alluxio . grpc . GetSyncPathListPResponse 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. SaveReturn printHtml ( final File f ) { Future < Object > waiter = mainFrame . getBackgroundExecutor ( ) . submit ( ( ) -> { HTMLBugReporter reporter = new HTMLBugReporter ( mainFrame . getProject ( ) , " default.xsl " ) ; reporter . setIsRelaxed ( true ) ; reporter . setOutputStream ( UTF8 . printStream ( new FileOutputStream ( f ) ) ) ; for ( BugInstance bug : mainFrame . getBugCollection ( ) . getCollection ( ) ) { try { if ( mainFrame . getViewFilter ( ) . show ( bug ) ) { reporter . reportBug ( bug ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } } reporter . finish ( ) ; return null ; } ) ;
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 onResult ( int result ) {
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. public void testConcurrentBind ( ) throws Exception { final AtomicInteger bindExCnt = new AtomicInteger ( ) ; final AtomicInteger sockExCnt = new AtomicInteger ( ) ; final AtomicInteger okCnt = new AtomicInteger ( ) ; final CyclicBarrier finishBarrier = new CyclicBarrier ( THREADS_CNT , new Runnable ( ) { private int i ; @ Override public void run ( ) { if ( ++ i % 250 == 0 ) X . println ( " Finished iteration [threadName= " + Thread . currentThread ( ) . getName ( ) + " , iter= " + i + ']' ) ; } } ) ; final InetAddress addr = InetAddress . getByName ( " 127.0.0.1 " ) ; GridTestUtils . runMultiThreaded ( new Callable < Object > ( ) { @ Nullable @ Override public Object call ( ) throws Exception { ServerSocket srvSock = null ; for ( int i = 0 ; i < ITER_CNT ; i ++ ) {
BindException
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 mapsEqual ( ) { Map < ? , ? > nullMap = null ; Verify . assertMapsEqual ( nullMap , nullMap ) ; Verify . assertMapsEqual ( " assertMapsEqual(nullMap, nullMap) " , nullMap , nullMap ) ; Verify . assertMapsEqual ( this . map , this . map ) ; Verify . assertMapsEqual ( " assertMapsEqual(map, map) " , this . map , this . map ) ; try { Verify . assertMapsEqual ( " assertMapsEqual(nullMap, map) " , nullMap , this . map ) ; Assert . fail ( " AssertionError expected " ) ; } catch ( AssertionError e ) { Verify . assertContains ( CollectionsEqualTest . class . getName ( ) , e . getStackTrace ( ) [ 0 ] . toString ( ) ) ; } try { Verify . assertMapsEqual ( nullMap , this . map ) ; Assert . fail ( " AssertionError expected " ) ; } catch ( AssertionError e ) { Verify . assertContains ( CollectionsEqualTest . class . getName ( ) , e . getStackTrace ( ) [ 0 ] . toString ( ) ) ; }
AssertionError
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 serializableSingletons ( String description , Supplier < Object > o ) {
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 Integer getKindValue ( String kind ) {
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. protected void produceBinaryMessages ( List < ProducerRecord < byte [ ] , byte [ ] > > records ) { Properties props = new Properties ( ) ; props . put ( ProducerConfig . KEY_SERIALIZER_CLASS_CONFIG , ByteArraySerializer . class ) ; props . put ( ProducerConfig . VALUE_SERIALIZER_CLASS_CONFIG , ByteArraySerializer . class ) ; props . setProperty ( ProducerConfig . BOOTSTRAP_SERVERS_CONFIG , brokerList ) ; props . setProperty ( ProducerConfig . ACKS_CONFIG , " all " ) ; Producer < byte [ ] , byte [ ] > producer = new KafkaProducer < byte [ ] , byte [ ] > ( props ) ; for ( ProducerRecord < byte [ ] , byte [ ] > rec : records ) {
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 test8 ( ) throws Exception { DataSource ds = ( DataSource ) context . getBean ( " zebraDS " ) ; Connection conn = 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 PropertyContainer tryToGetGraphProperties ( ) {
UnsupportedOperationException
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 testGetStatisticsOneFileNoCachedVersion ( ) {
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 BooleanProperty torNetworkNodeShutDown ( ) { final BooleanProperty done = new SimpleBooleanProperty ( ) ; if ( executorService != null ) { executorService . submit ( ( ) -> { Utilities . setThreadName ( " torNetworkNodeShutDown " ) ; long ts = System . currentTimeMillis ( ) ; log . debug ( " Shutdown torNetworkNode " ) ;
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 debugeeExitCode ( DebugeeExitCode request ) throws IOException { logger . trace ( TRACE_LEVEL_ACTIONS , " DebugeeExitCode: handle request: " + request ) ; if ( process == null ) { String reply = " No debuggee process to get exit code for " ; logger . complain ( reply ) ; sendReply ( new RequestFailed ( reply ) ) ; return ; } int exitStatus = 0 ;
IllegalThreadStateException
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 test ( String name , byte [ ] keyBytes , byte [ ] input , byte [ ] output ) throws Exception { Key key ; Cipher in , out ; CipherInputStream cIn ; CipherOutputStream cOut ; ByteArrayInputStream bIn ; ByteArrayOutputStream bOut ; key = new SecretKeySpec ( keyBytes , name ) ; in = Cipher . getInstance ( name + " /ECB/NoPadding " , " BC " ) ; out = Cipher . getInstance ( name + " /ECB/NoPadding " , " BC " ) ; try { out . init ( Cipher . ENCRYPT_MODE , key ) ; } catch ( Exception e ) { fail ( " DSTU7624 failed initialisation - " + e . toString ( ) , e ) ; } try { in . init ( Cipher . DECRYPT_MODE , key ) ; } catch ( Exception e ) { fail ( " DSTU7624 failed initialisation - " + e . toString ( ) , e ) ; } bOut = new ByteArrayOutputStream ( ) ; cOut = new CipherOutputStream ( bOut , out ) ;
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 [ ] ) throws InterruptedException { mainThread = Thread . currentThread ( ) ;
TestPassedException
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 openUrl ( String url , String method , Bundle params ) throws MalformedURLException , IOException { String strBoundary = " 3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f " ; String endLine = " \r\n " ; OutputStream os ; if ( method . equals ( " GET " ) ) { url = url + " ? " + encodeUrl ( params ) ; } Utility . logd ( " Facebook-Util " , method + " URL: " + url ) ; HttpURLConnection conn = ( HttpURLConnection ) new URL ( url ) . openConnection ( ) ; conn . setRequestProperty ( " User-Agent " , System . getProperties ( ) . getProperty ( " http.agent " ) + " FacebookAndroidSDK " ) ; if ( ! method . equals ( " GET " ) ) { Bundle dataparams = new Bundle ( ) ; for ( String key : params . keySet ( ) ) { Object parameter = params . get ( key ) ; if ( parameter instanceof byte [ ] ) { dataparams . putByteArray ( key , ( byte [ ] ) parameter ) ; } } if ( ! params . containsKey ( " method " ) ) { params . putString ( " method " , method ) ; } if ( params . containsKey ( " access_token " ) ) { String decoded_token = URLDecoder . decode ( params . getString ( " access_token " ) ) ; params . putString ( " access_token " , decoded_token ) ; } conn . setRequestMethod ( " POST " ) ; conn . setRequestProperty ( " Content-Type " , " multipart/form-data;boundary= " + strBoundary ) ; conn . setDoOutput ( true ) ; conn . setDoInput ( true ) ; conn . setRequestProperty ( " Connection " , " Keep-Alive " ) ; conn . connect ( ) ; os = new BufferedOutputStream ( conn . getOutputStream ( ) ) ; try { os . write ( ( " -- " + strBoundary + endLine ) . getBytes ( ) ) ; os . write ( ( encodePostBody ( params , strBoundary ) ) . getBytes ( ) ) ; os . write ( ( endLine + " -- " + strBoundary + endLine ) . getBytes ( ) ) ; if ( ! dataparams . isEmpty ( ) ) { for ( String key : dataparams . keySet ( ) ) { os . write ( ( " Content-Disposition: form-data; filename=\ " " + key + " \ " " + endLine ) . getBytes ( ) ) ; os . write ( ( " Content-Type: content/unknown " + endLine + endLine ) . getBytes ( ) ) ; os . write ( dataparams . getByteArray ( key ) ) ; os . write ( ( endLine + " -- " + strBoundary + endLine ) . getBytes ( ) ) ; } } os . flush ( ) ; } finally { os . close ( ) ; } } String response = " " ;
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. public void mountException ( ) throws Exception { AlluxioURI alluxioPath = new AlluxioURI ( " /t " ) ; AlluxioURI ufsPath = new AlluxioURI ( " /u " ) ; MountPOptions mountOptions = MountPOptions . getDefaultInstance ( ) ; doThrow ( EXCEPTION ) . when ( mFileSystemMasterClient ) . mount ( alluxioPath , ufsPath , FileSystemOptions . mountDefaults ( mConf ) . toBuilder ( ) . mergeFrom ( mountOptions ) . build ( ) ) ;
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 FloatBuffer readFloatBuffer ( String name , FloatBuffer defVal ) throws IOException {
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 ( ) {
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. public void onCompleted ( Uri uri , int statusCode , String statusText ) {
Error
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 run2 ( ) throws CacheException { final CacheClientNotifier ccnInstance = CacheClientNotifier . getInstance ( ) ;
CqException
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 < Field > fields ( ) { List < Field > fields = ( fieldsRef == null ) ? null : fieldsRef . get ( ) ; if ( fields == null ) { if ( vm . canGet1_5LanguageFeatures ( ) ) { JDWP . ReferenceType . FieldsWithGeneric . FieldInfo [ ] jdwpFields ;
JDWPException
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 ) throws Exception { String previous = null ; MBeanServer mbs = MBeanServerFactory . newMBeanServer ( ) ; ObjectName on1 = new ObjectName ( " a:type=Blibby,name=\ " 1\ " " ) ; ObjectName on2 = new ObjectName ( " a:type=Blibby,name=\ " 2\ " " ) ; System . out . println ( " \n**** TEST #1 ****\n " ) ; System . out . println ( " Registering Blibby #1 with name: " + on1 ) ; mbs . registerMBean ( new Blibby ( mbs , null ) , on1 ) ; try { System . out . println ( " Registering Blibby #2 with same name: " + on1 ) ; mbs . registerMBean ( new Blibby ( mbs , on1 ) , on1 ) ; } catch ( InstanceAlreadyExistsException x ) { System . out . println ( " Received expected exception: " + x ) ; } if ( mbs . isRegistered ( on1 ) ) { try { mbs . unregisterMBean ( on1 ) ; if ( failure == null ) fail ( on1 + " should have been unregistered " ) ; } catch ( InstanceNotFoundException x ) { System . out . println ( on1 + " was unregistered by mbean thread. " ) ; } } else { System . out . println ( on1 + " was correctly unregistered. " ) ; } if ( failure == previous ) System . out . println ( " \n**** TEST #1 PASSED ****\n " ) ; previous = failure ; System . out . println ( " \n**** TEST #2 ****\n " ) ; System . out . println ( " Registering Blibby #1 with name: " + on1 ) ; mbs . registerMBean ( new Blibby ( mbs , null ) , on1 ) ; System . out . println ( " Registering Blibby #2 with other name: " + on2 ) ; mbs . registerMBean ( new Blibby ( mbs , on1 ) , on2 ) ; if ( mbs . isRegistered ( on1 ) ) {
InstanceNotFoundException
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 int run ( String argv [ ] , PrintStream out ) { exitStatus = Consts . TEST_PASSED ; redefineclasses016 thisTest = new redefineclasses016 ( ) ; ArgumentHandler argHandler = new ArgumentHandler ( argv ) ; log = new Log ( out , argHandler ) ; testDir = argv [ 0 ] ; debugee = Debugee . prepareDebugee ( argHandler , log , debugeeName ) ;
TestBug
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 create ( Object obj , Runnable act ) {
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 byte [ ] encode ( ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try ( ObjectOutputStream oos = new ObjectOutputStream ( baos ) ) { oos . writeObject ( this ) ;
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 [ ] ) throws InterruptedException { mainThread = Thread . currentThread ( ) ;
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 int select ( long timeout ) throws IOException {
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. void test ( ) throws Throwable { JavaSource source = new JavaSource ( " 1 " ) ; tool . clear ( ) ; List < JavaFileObject > inputs = of ( source ) ;
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. public void run ( ) {
SocketException
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 checkProxyAsyncQueue ( final VM vm , final DistributedMember senderMember , final boolean shouldExist ) { SerializableRunnable checkProxyAsyncQueue = new SerializableRunnable ( " Check Proxy Async Queue " ) { @ Override public void run ( ) { SystemManagementService service = ( SystemManagementService ) ManagementService . getManagementService ( cache ) ; final ObjectName queueMBeanName = service . getAsyncEventQueueMBeanName ( senderMember , " pn " ) ; AsyncEventQueueMXBean bean = null ; if ( shouldExist ) {
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 createFolder ( String parentPath , String newDirName ) throws Exception {
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 WebSocketContainer getContainer ( ) { synchronized ( lock ) { WebSocketContainer webSocketContainer = null ; Object contextHandler = getContextHandler ( ) ; if ( useServerContainer && contextHandler != null ) { try { Method methodGetServletContext = contextHandler . getClass ( ) . getMethod ( " getServletContext " ) ; Object objServletContext = methodGetServletContext . invoke ( contextHandler ) ; if ( objServletContext != null ) { Method methodGetAttribute = objServletContext . getClass ( ) . getMethod ( " getAttribute " , String . class ) ; Object objServerContainer = methodGetAttribute . invoke ( objServletContext , " javax.websocket.server.ServerContainer " ) ; if ( objServerContainer != null && objServerContainer instanceof WebSocketContainer ) { webSocketContainer = ( WebSocketContainer ) objServerContainer ; } } } catch ( Throwable ignore ) { LOG . ignore ( ignore ) ; } } if ( useSingleton && INSTANCE != null ) { return INSTANCE ; } if ( webSocketContainer == null ) { SimpleContainerScope containerScope = new SimpleContainerScope ( WebSocketPolicy . newClientPolicy ( ) ) ; ClientContainer clientContainer = new ClientContainer ( containerScope ) ; if ( contextHandler != null && contextHandler instanceof ContainerLifeCycle ) { ( ( ContainerLifeCycle ) contextHandler ) . addManaged ( clientContainer ) ; } else { ShutdownThread . register ( clientContainer ) ; } if ( ! clientContainer . isStarted ( ) ) {
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 void runCommand ( String ... argv ) { final String cmd = Joiner . on ( " " ) . join ( argv ) ; log . info ( " Executing {} " , cmd ) ; ProcessBuilder pb = new ProcessBuilder ( argv ) ; pb . redirectErrorStream ( true ) ; Process startup ; try { startup = pb . start ( ) ; } catch ( IOException e ) { throw new RuntimeException ( " Unable to start process in " + System . getProperty ( " user.dir " ) + " : " + e . getMessage ( ) , e ) ; } StreamLogger sl = new StreamLogger ( startup . getInputStream ( ) ) ; sl . setDaemon ( true ) ; sl . start ( ) ; waitForProcessAndCheckStatus ( cmd , startup ) ;
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 commit ( ) throws SQLException { if ( db == null ) { throw new SQLException ( " stale connection " ) ; } if ( ! intrans ) { return ; }
SQLite.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 synchronized String printWorkingDirectory ( ) throws RemoteException {
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 EntityParser < GenericRecord > newParser ( Schema datasetSchema , Context config ) { EntityParser < GenericRecord > parser ; String parserType = config . getString ( CONFIG_ENTITY_PARSER , DEFAULT_ENTITY_PARSER ) ; if ( parserType . equals ( AVRO_ENTITY_PARSER ) ) { parser = new AvroParser . Builder ( ) . build ( datasetSchema , config ) ; } else { Class < ? extends EntityParser . Builder > builderClass ; Class c ; try { c = Class . forName ( parserType ) ; } catch ( ClassNotFoundException ex ) { throw new IllegalArgumentException ( " EntityParser.Builder class " + parserType + " not found. Must set " + CONFIG_ENTITY_PARSER + " to a class that implements EntityParser.Builder or to a builtin " + " parser: " + Arrays . toString ( AVAILABLE_PARSERS ) , ex ) ; } if ( c != null && EntityParser . Builder . class . isAssignableFrom ( c ) ) { builderClass = c ; } else { throw new IllegalArgumentException ( " Class " + parserType + " does not " + " implement EntityParser.Builder. Must set " + CONFIG_ENTITY_PARSER + " to a class that extends " + " EntityParser.Builder or to a builtin parser: " + Arrays . toString ( AVAILABLE_PARSERS ) ) ; } EntityParser . Builder < GenericRecord > builder ;
InstantiationException
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 startCustomTab ( @ NonNull Activity context , @ NonNull Uri url ) { String packageNameToUse = CustomTabsHelper . getPackageNameToUse ( context ) ; if ( packageNameToUse != null ) { CustomTabsIntent customTabsIntent = new CustomTabsIntent . Builder ( ) . setToolbarColor ( ViewHelper . getPrimaryColor ( context ) ) . setShowTitle ( true ) . build ( ) ; customTabsIntent . intent . setPackage ( packageNameToUse ) ;
ActivityNotFoundException
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 testGetSyncFail ( ) { ParseException exception = new ParseException ( ParseException . CONNECTION_FAILED , " error " ) ; ParseConfigController controller = mockParseConfigControllerWithException ( exception ) ; ParseCorePlugins . getInstance ( ) . registerConfigController ( controller ) ;
ParseException