auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static String getStatsAssetsByChunkName(VaadinService service) throws IOException { DeploymentConfiguration config = service.getDeploymentConfiguration(); if (!config.isProductionMode() && config.enableDevServer()) { return streamToString(getStatsFromWebpack()); } InputStream resourceAsStream; if (config.isStatsExternal()) { resourceAsStream = getStatsFromExternalUrl( config.getExternalStatsUrl(), service.getContext()); } else { resourceAsStream = getStatsFromClassPath(service); } if (resourceAsStream == null) { return null; } try (Scanner scan = new Scanner(resourceAsStream, StandardCharsets.UTF_8.name())) { StringBuilder assets = new StringBuilder(); assets.append("{"); scanToAssetChunkStart(scan, assets); while (scan.hasNextLine()) { String line = scan.nextLine().trim(); if ("}".equals(line) || "},".equals(line)) { return assets.append("}").toString(); } else if (line.endsWith("}") || line.endsWith("},")) { return assets .append(line.substring(0, line.indexOf('}')).trim()) .append("}").toString(); } else if (line.contains("{")) { break; } assets.append(line); } getLogger() .error("Could not parse assetsByChunkName from stats.json"); } return null; }

Target:
public static String getStatsAssetsByChunkName(VaadinService service) throws IOException { DeploymentConfiguration config = service.getDeploymentConfiguration(); if (!config.isProductionMode() && config.enableDevServer()) { return streamToString(getResourceFromWebpack("/assetsByChunkName", "getting assets by chunk name.")); } InputStream resourceAsStream; if (config.isStatsExternal()) { resourceAsStream = getStatsFromExternalUrl( config.getExternalStatsUrl(), service.getContext()); } else { resourceAsStream = getStatsFromClassPath(service); } if (resourceAsStream == null) { return null; } try (Scanner scan = new Scanner(resourceAsStream, StandardCharsets.UTF_8.name())) { StringBuilder assets = new StringBuilder(); assets.append("{"); scanToAssetChunkStart(scan, assets); while (scan.hasNextLine()) { String line = scan.nextLine().trim(); if ("}".equals(line) || "},".equals(line)) { return assets.append("}").toString(); } else if (line.endsWith("}") || line.endsWith("},")) { return assets .append(line.substring(0, line.indexOf('}')).trim()) .append("}").toString(); } else if (line.contains("{")) { break; } assets.append(line); } getLogger() .error("Could not parse assetsByChunkName from stats.json"); } return null; }
Source:
public ListVersionView history(@PathParam("primaryKey") String key, @PathParam("primaryKeyValue") String value) throws Exception { String registerPrimaryKey = requestContext.getRegisterPrimaryKey(); if (key.equals(registerPrimaryKey)) { return new ListVersionView(requestContext, publicBodiesConfiguration, queryDAO.findAllByKeyValue(key, value).stream().map(r -> new Version(r.getSerialNumber(), r.getContent().getHash())).collect(Collectors.toList())); } throw new NotFoundException(); }

Target:
public ListVersionView history(@PathParam("primaryKey") String key, @PathParam("primaryKeyValue") String value) throws Exception { String registerPrimaryKey = requestContext.getRegisterPrimaryKey(); if (key.equals(registerPrimaryKey)) { return viewFactory.listVersionView(queryDAO.findAllByKeyValue(key, value).stream().map(r -> new Version(r.getSerialNumber(), r.getContent().getHash())).collect(Collectors.toList())); } throw new NotFoundException(); }
Source:
static void processAnnotatedType(@Observes ProcessAnnotatedType<?> pat) { pat.veto(); }

Target:
static void processAnnotatedType(@Observes ProcessAnnotatedType<?> pat) { }
Source:
protected void assertOriginalEqualsToUnmarshalled(ClusterDataSetListResponseBody expected, ClusterDataSetListResponseBody actual) { final List<ClusterDataSetEntry> expectedDataSets = expected.getDataSets(); final List<ClusterDataSetEntry> actualDataSets = actual.getDataSets(); assertEquals(expectedDataSets.size(), actualDataSets.size()); assertThat(actualDataSets, hasSize(expectedDataSets.size())); for (int i = 0; i < expectedDataSets.size(); i++) { ClusterDataSetEntry expectedDataSet = expectedDataSets.get(i); ClusterDataSetEntry actualDataSet = actualDataSets.get(i); assertThat(actualDataSet.getDataSetId(), is(expectedDataSet.getDataSetId())); assertThat(actualDataSet.isComplete(), is(expectedDataSet.isComplete())); } }

Target:
protected void assertOriginalEqualsToUnmarshalled(ClusterDataSetListResponseBody expected, ClusterDataSetListResponseBody actual) { final List<ClusterDataSetEntry> expectedDataSets = expected.getDataSets(); final List<ClusterDataSetEntry> actualDataSets = actual.getDataSets(); assertThat(actualDataSets, hasSize(expectedDataSets.size())); for (int i = 0; i < expectedDataSets.size(); i++) { ClusterDataSetEntry expectedDataSet = expectedDataSets.get(i); ClusterDataSetEntry actualDataSet = actualDataSets.get(i); assertThat(actualDataSet.getDataSetId(), is(expectedDataSet.getDataSetId())); assertThat(actualDataSet.isComplete(), is(expectedDataSet.isComplete())); } }
Source:
public String executeAndGetResult() throws ProcessExecutionException { try { Map<String, String> env = processBuilder.environment(); if (env==null) System.out.println("[executeAndGetResult] environment null"); else { for (String key : environmentVariables.stringPropertyNames()) env.put(key, environmentVariables.getProperty(key)); } final Process process = processBuilder.start(); final String result = readString(process.getInputStream()); final String error = readString(process.getInputStream()); final int exitValue = process.waitFor(); if(exitValue == 0){ return result; } else { throw new ProcessExecutionException(result+" "+error); } } catch (IOException e) { throw new ProcessExecutionException(e); } catch (InterruptedException e) { throw new ProcessExecutionException(e); } }

Target:
public String executeAndGetResult() throws ProcessExecutionException { try { Map<String, String> env = processBuilder.environment(); if (env!=null) { for (String key : environmentVariables.stringPropertyNames()) env.put(key, environmentVariables.getProperty(key)); } final Process process = processBuilder.start(); final String result = readString(process.getInputStream()); final String error = readString(process.getInputStream()); final int exitValue = process.waitFor(); if(exitValue == 0){ return result; } else { throw new ProcessExecutionException(result+" "+error); } } catch (IOException e) { throw new ProcessExecutionException(e); } catch (InterruptedException e) { throw new ProcessExecutionException(e); } }
Source:
public void bindTo(MeterRegistry registry) { Gauge.builder("k8s_client_invocation_total", countedClientFactory::getClientInvocationsCount) .register(registry); }

Target:
public void bindTo(MeterRegistry registry) { Gauge.builder("k8s.client.invocation.total", countedClientFactory::getClientInvocationsCount) .register(registry); }
Source:
public void getTypeFromIdShouldReturnProperEnumValue() throws JAXBException { FormMappingModel formMappingModel = new FormMappingModel(); formMappingModel.addFormMapping(new FormMappingDefinition("lala", null, null)); StringWriter result = new StringWriter(); JAXBContext jaxbContext = JAXBContext.newInstance(FormMappingModel.class); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.marshal(formMappingModel, result); String result2 = result.toString(); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Object formMappingResult = unmarshaller.unmarshal(new StringReader(result2)); assertThat(formMappingModel).isEqualTo(formMappingResult); }

Target:
public void getTypeFromIdShouldReturnProperEnumValue() { assertThat(FormMappingType.getTypeFromId(1)).isEqualTo(FormMappingType.PROCESS_START); assertThat(FormMappingType.getTypeFromId(2)).isEqualTo(FormMappingType.PROCESS_OVERVIEW); assertThat(FormMappingType.getTypeFromId(3)).isEqualTo(FormMappingType.TASK); }
Source:
public void updateMediaDirection(MediaType type, String direction) { switch (direction) { case "sendrecv": case "sendonly": case "recvonly": case "inactive": { for (ChannelShim channelShim : channelShims) { if (Objects.equals(channelShim.getMediaType(), type)) { channelShim.setDirection(direction); } } break; } default: throw new IllegalArgumentException("Media direction unknown: " + direction); } }

Target:
public void updateMediaDirection(MediaType type, String direction) { switch (direction) { case "sendrecv": case "sendonly": case "recvonly": case "inactive": { for (ChannelShim channelShim : channelShims) { if (channelShim.getMediaType() == type) { channelShim.setDirection(direction); } } break; } default: throw new IllegalArgumentException("Media direction unknown: " + direction); } }
Source:
public void updateSubs(ArrayList<String> subs) { if (subs.isEmpty() && !NetworkUtil.isConnected(this)) { d = new MaterialDialog.Builder(MainActivity.this) .title("No offline content found") .positiveText("Enter online mode") .onPositive(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { Reddit.appRestart.edit().remove("forceoffline").apply(); ((Reddit) getApplication()).forceRestart(MainActivity.this); } }).show(); } else { drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); try { Field mDragger = drawerLayout.getClass().getSuperclass().getDeclaredField( "mLeftDragger"); mDragger.setAccessible(true); ViewDragHelper draggerObj = (ViewDragHelper) mDragger .get(drawerLayout); Field mEdgeSize = draggerObj.getClass().getDeclaredField( "mEdgeSize"); mEdgeSize.setAccessible(true); int edge = mEdgeSize.getInt(draggerObj); mEdgeSize.setInt(draggerObj, edge * DRAWER_EDGE_FACTOR); } catch (Exception e) { LogUtil.v("exception while changing side drawer edge" + e); } if (loader != null) { header.setVisibility(View.VISIBLE); setDataSet(subs); doDrawer(); try { setDataSet(subs); } catch (Exception ignored) { } loader.finish(); loader = null; } else { setDataSet(subs); doDrawer(); } } }

Target:
public void updateSubs(ArrayList<String> subs) { if (subs.isEmpty() && !NetworkUtil.isConnected(this)) { d = new MaterialDialog.Builder(MainActivity.this) .title("No offline content found") .positiveText("Enter online mode") .onPositive(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { Reddit.appRestart.edit().remove("forceoffline").apply(); ((Reddit) getApplication()).forceRestart(MainActivity.this); } }).show(); } else { drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); try { Field mDragger = drawerLayout.getClass().getSuperclass().getDeclaredField( "mLeftDragger"); mDragger.setAccessible(true); ViewDragHelper draggerObj = (ViewDragHelper) mDragger .get(drawerLayout); Field mEdgeSize = draggerObj.getClass().getDeclaredField( "mEdgeSize"); mEdgeSize.setAccessible(true); int edge = mEdgeSize.getInt(draggerObj); mEdgeSize.setInt(draggerObj, edge * DRAWER_EDGE_FACTOR); } catch (Exception e) { LogUtil.e(e + ": Exception thrown while changing navdrawer edge size"); } if (loader != null) { header.setVisibility(View.VISIBLE); setDataSet(subs); doDrawer(); try { setDataSet(subs); } catch (Exception ignored) { } loader.finish(); loader = null; } else { setDataSet(subs); doDrawer(); } } }
Source:
public void testTimeout() throws SystemException, RemoteException { log.info("Method stateful #testTimeout called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); try { TxTestUtil.waitForTimeout(tm); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new RemoteException("Interupted during waiting for transaction timeout", ie); } }

Target:
public void testTimeout() throws SystemException, RemoteException { log.trace("Method stateful #testTimeout called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); try { TxTestUtil.waitForTimeout(tm); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new RemoteException("Interupted during waiting for transaction timeout", ie); } }
Source:
public WritableByteChannel create(final StorageResourceId resourceId, CreateObjectOptions options) throws IOException { logger.atFine().log("create(%s)", resourceId); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); Optional<Long> overwriteGeneration = resourceId.hasGenerationId() ? Optional.of(resourceId.getGenerationId()) : Optional.of(getWriteGeneration(resourceId, options.overwriteExisting())); ObjectWriteConditions writeConditions = new ObjectWriteConditions(overwriteGeneration, Optional.<Long>absent()); Map<String, String> rewrittenMetadata = encodeMetadata(options.getMetadata()); GoogleCloudStorageWriteChannel channel = new GoogleCloudStorageWriteChannel( backgroundTasksThreadPool, gcs, clientRequestHelper, resourceId.getBucketName(), resourceId.getObjectName(), options.getContentType(), options.getContentEncoding(), null, storageOptions.getWriteChannelOptions(), writeConditions, rewrittenMetadata) { @Override public Storage.Objects.Insert createRequest(InputStreamContent inputStream) throws IOException { Storage.Objects.Insert insertObject = super.createRequest(inputStream); return configureRequest(insertObject, resourceId.getBucketName()); } }; channel.initialize(); return channel; }

Target:
public WritableByteChannel create(final StorageResourceId resourceId, CreateObjectOptions options) throws IOException { logger.atFine().log("create(%s)", resourceId); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); Optional<Long> overwriteGeneration = resourceId.hasGenerationId() ? Optional.of(resourceId.getGenerationId()) : Optional.of(getWriteGeneration(resourceId, options.overwriteExisting())); ObjectWriteConditions writeConditions = new ObjectWriteConditions(overwriteGeneration, Optional.<Long>absent()); Map<String, String> rewrittenMetadata = encodeMetadata(options.getMetadata()); GoogleCloudStorageWriteChannel channel = new GoogleCloudStorageWriteChannel( backgroundTasksThreadPool, gcs, clientRequestHelper, resourceId.getBucketName(), resourceId.getObjectName(), options.getContentType(), options.getContentEncoding(), null, storageOptions.getWriteChannelOptions(), writeConditions, rewrittenMetadata) { @Override public Storage.Objects.Insert createRequest(InputStreamContent inputStream) throws IOException { return configureRequest(super.createRequest(inputStream), resourceId.getBucketName()); } }; channel.initialize(); return channel; }
Source:
private void startBeans(boolean autoStartupOnly) { Map<String, Lifecycle> lifecycleBeans = getLifecycleBeans(); Map<Integer, LifecycleGroup> phases = new HashMap<>(); lifecycleBeans.forEach((beanName, bean) -> { if (!autoStartupOnly || (bean instanceof SmartLifecycle && ((SmartLifecycle) bean).isAutoStartup())) { int phase = getPhase(bean); LifecycleGroup group = phases.computeIfAbsent(phase, p -> new LifecycleGroup(phase, this.timeoutPerShutdownPhase, lifecycleBeans, autoStartupOnly)); group.add(beanName, bean); } }); if (!phases.isEmpty()) { List<Integer> keys = new ArrayList<>(phases.keySet()); Collections.sort(keys); for (Integer key : keys) { phases.get(key).start(); } } }

Target:
private void startBeans(boolean autoStartupOnly) { Map<String, Lifecycle> lifecycleBeans = getLifecycleBeans(); Map<Integer, LifecycleGroup> phases = new TreeMap<>(); lifecycleBeans.forEach((beanName, bean) -> { if (!autoStartupOnly || (bean instanceof SmartLifecycle && ((SmartLifecycle) bean).isAutoStartup())) { int phase = getPhase(bean); phases.computeIfAbsent( phase, p -> new LifecycleGroup(phase, this.timeoutPerShutdownPhase, lifecycleBeans, autoStartupOnly) ).add(beanName, bean); } }); if (!phases.isEmpty()) { phases.forEach((key, value) -> value.start()); } }
Source:
private CertificationResultSvapEntity getCertificationResultSvapEntityById(Long certificationResultSvapId) { Query query = entityManager.createQuery( "SELECT s " + "FROM CertificationResultSvapEntity s " + "LEFT OUTER JOIN FETCH s.svap " + "WHERE s.deleted <> true " + "AND s.id = :certificationResultSvapId ", CertificationResultSvapEntity.class); query.setParameter("certificationResultSvapId", certificationResultSvapId); List<CertificationResultSvapEntity> result = query.getResultList(); if (result.size() > 0) { return result.get(0); } else { return null; } }

Target:
private CertificationResultSvapEntity getCertificationResultSvapEntityById(Long certificationResultSvapId) { Query query = entityManager.createQuery( "SELECT s " + "FROM CertificationResultSvapEntity s " + "JOIN FETCH s.svap " + "WHERE s.deleted <> true " + "AND s.id = :certificationResultSvapId ", CertificationResultSvapEntity.class); query.setParameter("certificationResultSvapId", certificationResultSvapId); List<CertificationResultSvapEntity> result = query.getResultList(); if (result.size() > 0) { return result.get(0); } else { return null; } }
Source:
public CapableIndexReference index( int label, int... properties ) { ktx.assertOpen(); if ( label == KeyReadOperations.NO_SUCH_LABEL || Arrays.contains( properties, KeyReadOperations.NO_SUCH_PROPERTY_KEY ) ) { return CapableIndexReference.NO_INDEX; } LabelSchemaDescriptor descriptor = SchemaDescriptorFactory.forLabel( label, properties ); SchemaIndexDescriptor indexDescriptor = storeReadLayer.indexGetForSchema( descriptor ); if ( ktx.hasTxStateWithChanges() ) { ReadableDiffSets<SchemaIndexDescriptor> diffSets = ktx.txState().indexDiffSetsByLabel( label ); if ( indexDescriptor != null ) { if ( diffSets.isRemoved( indexDescriptor ) ) { return CapableIndexReference.NO_INDEX; } else { return indexGetCapability( indexDescriptor ); } } else { Iterator<SchemaIndexDescriptor> fromTxState = filter( SchemaDescriptor.equalTo( descriptor ), diffSets.apply( emptyResourceIterator() ) ); if ( fromTxState.hasNext() ) { return fromDescriptor( fromTxState.next() ); } else { return CapableIndexReference.NO_INDEX; } } } return indexDescriptor != null ? indexGetCapability( indexDescriptor ) : CapableIndexReference.NO_INDEX; }

Target:
public CapableIndexReference index( int label, int... properties ) { ktx.assertOpen(); LabelSchemaDescriptor descriptor; try { descriptor = SchemaDescriptorFactory.forLabel( label, properties ); } catch ( IllegalArgumentException ignore ) { return CapableIndexReference.NO_INDEX; } SchemaIndexDescriptor indexDescriptor = storeReadLayer.indexGetForSchema( descriptor ); if ( ktx.hasTxStateWithChanges() ) { ReadableDiffSets<SchemaIndexDescriptor> diffSets = ktx.txState().indexDiffSetsByLabel( label ); if ( indexDescriptor != null ) { if ( diffSets.isRemoved( indexDescriptor ) ) { return CapableIndexReference.NO_INDEX; } else { return indexGetCapability( indexDescriptor ); } } else { Iterator<SchemaIndexDescriptor> fromTxState = filter( SchemaDescriptor.equalTo( descriptor ), diffSets.apply( emptyResourceIterator() ) ); if ( fromTxState.hasNext() ) { return DefaultCapableIndexReference.fromDescriptor( fromTxState.next() ); } else { return CapableIndexReference.NO_INDEX; } } } return indexDescriptor != null ? indexGetCapability( indexDescriptor ) : CapableIndexReference.NO_INDEX; }
Source:
public Entry getEntryFromTuple(YailList tuple) { try { String xValue = tuple.getString(0); String yValue = tuple.getString(1); try { float x = Float.parseFloat(xValue); float y = Float.parseFloat(yValue); return new Entry(x, y); } catch (NumberFormatException e) { } } catch (Exception e) { } return null; }

Target:
public Entry getEntryFromTuple(YailList tuple) { try { String xValue = tuple.getString(0); String yValue = tuple.getString(1); try { float x = Float.parseFloat(xValue); float y = Float.parseFloat(yValue); return new Entry(x, y); } catch (NumberFormatException e) { this.view.getForm().dispatchErrorOccurredEvent(this.view.chartComponent, "GetEntryFromTuple", ErrorMessages.ERROR_INVALID_CHART_ENTRY_VALUES, xValue, yValue); } } catch (NullPointerException e) { this.view.getForm().dispatchErrorOccurredEvent(this.view.chartComponent, "GetEntryFromTuple", ErrorMessages.ERROR_NULL_CHART_ENTRY_VALUES); } catch (IndexOutOfBoundsException e) { this.view.getForm().dispatchErrorOccurredEvent(this.view.chartComponent, "GetEntryFromTuple", ErrorMessages.ERROR_INSUFFICIENT_CHART_ENTRY_VALUES, getTupleSize(), tuple.size()); } return null; }
Source:
private void compareTracedItems(Resource changedResource) { TracePersistenceAdapter persistenceAdapter = ExtensionPointHelper.getTracePersistenceAdapter().get(); ResourceSetImpl newResourceSet = new ResourceSetImpl(); EObject traceModel = persistenceAdapter.getTraceModel(newResourceSet); if (!(traceModel == null)) { IPath path = new Path(EcoreUtil.getURI(traceModel).toPlatformString(false)); IFile traceContainer = ResourcesPlugin.getWorkspace().getRoot().getFile(path); TraceMetaModelAdapter traceMetamodelAdapter = ExtensionPointHelper.getTraceMetamodelAdapter().get(); List<Connection> connections = traceMetamodelAdapter .getAllTraceLinks(persistenceAdapter.getTraceModel(new ResourceSetImpl())); if (!connections.isEmpty()) { for (Connection c : connections) { List<EObject> tempList = new ArrayList<>(); tempList.add(c.getOrigin()); tempList.addAll(c.getTargets()); for (EObject tracedItem : tempList) { Resource oldResource = tracedItem.eResource(); if (oldResource == null) oldResource = newResourceSet.getResource(EcoreUtil.getURI(tracedItem).trimFragment(), true); if (oldResource != null) { if (CapraNotificationHelper.getFileUri(oldResource) .equals(CapraNotificationHelper.getFileUri(changedResource))) { IComparisonScope scope = new DefaultComparisonScope(changedResource, oldResource, null); Comparison comparison = EMFCompare.builder().build().compare(scope); for (Match match : comparison.getMatches()) resolveMatch(tracedItem, match, null, traceContainer); } } } } } } }

Target:
private void compareTracedItems(Resource changedResource) { TracePersistenceAdapter persistenceAdapter = ExtensionPointHelper.getTracePersistenceAdapter().get(); ResourceSetImpl newResourceSet = new ResourceSetImpl(); EObject traceModel = persistenceAdapter.getTraceModel(newResourceSet); if (traceModel != null) { IPath path = new Path(EcoreUtil.getURI(traceModel).toPlatformString(false)); IFile traceContainer = ResourcesPlugin.getWorkspace().getRoot().getFile(path); TraceMetaModelAdapter traceMetamodelAdapter = ExtensionPointHelper.getTraceMetamodelAdapter().get(); List<Connection> connections = traceMetamodelAdapter .getAllTraceLinks(persistenceAdapter.getTraceModel(new ResourceSetImpl())); if (!connections.isEmpty()) { for (Connection c : connections) { List<EObject> tempList = new ArrayList<>(); tempList.add(c.getOrigin()); tempList.addAll(c.getTargets()); for (EObject tracedItem : tempList) { Resource oldResource = tracedItem.eResource(); if (oldResource == null) oldResource = newResourceSet.getResource(EcoreUtil.getURI(tracedItem).trimFragment(), true); if (oldResource != null) { if (CapraNotificationHelper.getFileUri(oldResource) .equals(CapraNotificationHelper.getFileUri(changedResource))) { IComparisonScope scope = new DefaultComparisonScope(changedResource, oldResource, null); Comparison comparison = EMFCompare.builder().build().compare(scope); for (Match match : comparison.getMatches()) resolveMatch(tracedItem, match, null, traceContainer); } } } } } } }
Source:
public void subscribe(Collection<String> topics, ConsumerRebalanceListener listener) { acquireAndEnsureOpen(); try { maybeThrowInvalidGroupIdException(); if (topics == null) throw new IllegalArgumentException("Topic collection to subscribe to cannot be null"); if (topics.isEmpty()) { this.unsubscribe(); } else { for (String topic : topics) { if (topic == null || topic.trim().isEmpty()) throw new IllegalArgumentException("Topic collection to subscribe to cannot contain null or empty topic"); } throwIfNoAssignorsConfigured(); fetcher.clearBufferedDataForUnassignedTopics(topics); log.info("Subscribed to topic(s): {}", Utils.join(topics, ", ")); System.out.println("start subscription to new"); if (this.subscriptions.subscribe(new HashSet<>(topics), listener)) metadata.requestUpdateForNewTopics(); } } finally { release(); } }

Target:
public void subscribe(Collection<String> topics, ConsumerRebalanceListener listener) { acquireAndEnsureOpen(); try { maybeThrowInvalidGroupIdException(); if (topics == null) throw new IllegalArgumentException("Topic collection to subscribe to cannot be null"); if (topics.isEmpty()) { this.unsubscribe(); } else { for (String topic : topics) { if (topic == null || topic.trim().isEmpty()) throw new IllegalArgumentException("Topic collection to subscribe to cannot contain null or empty topic"); } throwIfNoAssignorsConfigured(); fetcher.clearBufferedDataForUnassignedTopics(topics); log.info("Subscribed to topic(s): {}", Utils.join(topics, ", ")); if (this.subscriptions.subscribe(new HashSet<>(topics), listener)) metadata.requestUpdateForNewTopics(); } } finally { release(); } }
Source:
protected void begin() { DataContainer dataContainer = scene.getDataContainer(); List<UserVariable> variableList = dataContainer.getProjectVariables(); Map<Sprite, List<UserVariable>> spriteVariableMap = dataContainer.getSpriteVariableMap(); setVariablesVisible(variableList); if (sprite != null) { List<UserVariable> spriteVariableList = spriteVariableMap.get(sprite); setVariablesVisible(spriteVariableList); } if (userBrick != null) { List<UserVariable> userBrickVariableList = dataContainer.getOrCreateVariableListForUserBrick(userBrick); setVariablesVisible(userBrickVariableList); } }

Target:
protected void begin() { DataContainer dataContainer = ProjectManager.getInstance().getSceneToPlay().getDataContainer(); List<UserVariable> variableList = dataContainer.getProjectVariables(); Map<Sprite, List<UserVariable>> spriteVariableMap = dataContainer.getSpriteVariableMap(); setVariablesVisible(variableList); if (sprite != null) { List<UserVariable> spriteVariableList = spriteVariableMap.get(sprite); setVariablesVisible(spriteVariableList); } if (userBrick != null) { List<UserVariable> userBrickVariableList = dataContainer.getOrCreateVariableListForUserBrick(userBrick); setVariablesVisible(userBrickVariableList); } }
Source:
public static File getCredentialsDir() { String dir = System.getenv(CREDENTIALS_DIR_PROP); if (dir == null) { dir = System.getProperty(CREDENTIALS_DIR_PROP); if (dir == null) { if (new File(DEFAULT_CREDENTIALS_DIR).exists() && new File(DEFAULT_CREDENTIALS_DIR).isDirectory()) { return new File(DEFAULT_CREDENTIALS_DIR); } else { throw new IllegalStateException( String.format("environment variable %s not set and default '/meta/credentials' not exists or not a directory.", CREDENTIALS_DIR_PROP)); } } } return new File(dir); }

Target:
public static File getCredentialsDir() { String dir = System.getenv(CREDENTIALS_DIR_PROP); if (dir == null) { dir = System.getProperty(CREDENTIALS_DIR_PROP); if (dir == null) { if (new File(DEFAULT_CREDENTIALS_DIR).exists() && new File(DEFAULT_CREDENTIALS_DIR).isDirectory()) { return new File(DEFAULT_CREDENTIALS_DIR); } else { throw new IllegalStateException( String.format("environment variable %s not set and default '%s' does not exist or is not a directory.", CREDENTIALS_DIR_PROP, DEFAULT_CREDENTIALS_DIR)); } } } return new File(dir); }
Source:
public void testApplicationCreationWithValidMandatoryValues(String applicationName, String tier, String description) throws Exception { HttpResponse addApplicationResponse = apiStore .addApplication(URLEncoder.encode(applicationName, UTF_8), URLEncoder.encode(tier, UTF_8), "", URLEncoder.encode(description, UTF_8)); applicationsList.add(applicationName); assertEquals(addApplicationResponse.getResponseCode(), Response.Status.OK.getStatusCode(), ERROR_APPLICATION_CREATION_RESPONSE_CODE + applicationName); JSONObject addApplicationJsonObject = new JSONObject(addApplicationResponse.getData()); assertFalse(addApplicationJsonObject.getBoolean(ERROR), ERROR_APPLICATION_CREATION_WITH_VALID_INPUT + applicationName); assertEquals(addApplicationJsonObject.get(STATUS), STATUS_APPROVED, ERROR_APPLICATION_CREATION_WITH_VALID_INPUT + applicationName); validateApplicationWithValidMandatoryValues(applicationName, tier, description); destroy(); }

Target:
public void testApplicationCreationWithValidMandatoryValues(String applicationName, String tier, String description) throws Exception { HttpResponse addApplicationResponse = apiStore .addApplication(URLEncoder.encode(applicationName, UTF_8), URLEncoder.encode(tier, UTF_8), "", URLEncoder.encode(description, UTF_8)); applicationsList.add(applicationName); assertEquals(addApplicationResponse.getResponseCode(), Response.Status.OK.getStatusCode(), ERROR_APPLICATION_CREATION_RESPONSE_CODE + applicationName); JSONObject addApplicationJsonObject = new JSONObject(addApplicationResponse.getData()); assertFalse(addApplicationJsonObject.getBoolean(ERROR), ERROR_APPLICATION_CREATION_WITH_VALID_INPUT + applicationName); assertEquals(addApplicationJsonObject.get(STATUS), STATUS_APPROVED, ERROR_APPLICATION_CREATION_WITH_VALID_INPUT + applicationName); validateApplicationWithValidMandatoryValues(applicationName, tier, description); }
Source:
public void acceptsIso8601Dates () { Param<LocalDate> localDate = Param.localDate("start", "export_start_date", "Export start date"); assertThat(localDate.map("2018-01-20").isEqual(LocalDate.of(2018, 01,20)), is(true)); }

Target:
public void acceptsIso8601Dates () { Param<LocalDate> localDate = Param.localDate("start", "export_start_date", "Export start date"); assertThat(localDate.map("2018-01-20"), is(LocalDate.of(2018, 1,20))); }
Source:
public void resetRecords() { if (loader.getStatus() == Status.RUNNING) { loader.cancel(false); loader = loader.spawn(); } else if (loader.getStatus() == Status.FINISHED) { loader = loader.spawn(); } SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); if (filter == null) { filter = FormRecordFilter.SubmittedAndPending; } records.clear(); String currentAppId = CommCareApplication.instance().getCurrentApp().getAppRecord().getApplicationId(); for (String status : filter.getStatus()) { records.addAll(storage.getRecordsForValues( new String[]{FormRecord.META_STATUS, FormRecord.META_APP_ID}, new Object[]{status, currentAppId})); } Collections.sort(records, (left, right) -> { if (!filter.equals(FormRecordFilter.Pending)) { long leftModTime = left.lastModified().getTime(); long rightModTime = right.lastModified().getTime(); if (leftModTime > rightModTime) { return -1; } else if (leftModTime == rightModTime) { return 0; } else { return 1; } } else { int leftSubmissionOrderNum = left.getSubmissionOrderingNumber(); int rightSubmissionOrderNum = right.getSubmissionOrderingNumber(); if (leftSubmissionOrderNum < rightSubmissionOrderNum) { return -1; } else if (leftSubmissionOrderNum == rightSubmissionOrderNum) { return 0; } else { return 1; } } }); searchCache.clear(); current.clear(); notifyDataSetChanged(); loader.init(searchCache, names); loader.executeParallel(records.toArray(new FormRecord[records.size()])); }

Target:
public void resetRecords() { if (loader.getStatus() == Status.RUNNING) { loader.cancel(false); loader = loader.spawn(); } else if (loader.getStatus() == Status.FINISHED) { loader = loader.spawn(); } SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); if (filter == null) { filter = FormRecordFilter.SubmittedAndPending; } records.clear(); String currentAppId = CommCareApplication.instance().getCurrentApp().getAppRecord().getApplicationId(); Vector recordsVector = new Vector(); for (String status : filter.getStatus()) { recordsVector.addAll(storage.getRecordsForValues( new String[]{FormRecord.META_STATUS, FormRecord.META_APP_ID}, new Object[]{status, currentAppId})); } if (filter.equals(FormRecordFilter.Pending)) { StorageUtils.sortRecordsBySubmissionOrderingNumber(recordsVector); } else { StorageUtils.sortRecordsByLastModifiedTimeDescending(recordsVector); } records.addAll(recordsVector); searchCache.clear(); current.clear(); notifyDataSetChanged(); loader.init(searchCache, names); loader.executeParallel(records.toArray(new FormRecord[records.size()])); }
Source:
public void getAllTickersByCurrencyShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final TickerService tickerService = adapter.create(TickerService.class); final String currency = "foobar"; tickerService.getAllTickersByCurrency(currency, new RetrofitPromise<List<Ticker>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/ticker/%s", MOCK_URL, currency)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }

Target:
public void getAllTickersByCurrencyShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final TickerService tickerService = adapter.create(TickerService.class); tickerService.getAllTickersByCurrency("foobar", new RetrofitPromise<List<Ticker>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/ticker/%s", MOCK_URL, "foobar")); }
Source:
protected void onResume() { super.onResume(); mIALocationManager.lockIndoors(false); mIALocationManager.requestLocationUpdates(IALocationRequest.create(), mListener); mIALocationManager.registerRegionListener(mRegionListener); }

Target:
protected void onResume() { super.onResume(); mIALocationManager.lockIndoors(false); IALocationRequest locReq = IALocationRequest.create(); locReq.setPriority(IALocationRequest.PRIORITY_HIGH_ACCURACY); mIALocationManager.requestLocationUpdates(locReq, mListener); mIALocationManager.registerRegionListener(mRegionListener); }
Source:
private void setClientTimeout(WorkItem workItem, Client client) { HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy policy = (HTTPClientPolicy) conduit.getClient(); long connectionTimeout = defaultJbpmCxfClientConnectionTimeout; String connectionTimeoutStr = (String) workItem.getParameter("ConnectionTimeout"); if (connectionTimeoutStr != null && !connectionTimeoutStr.trim().isEmpty()) { connectionTimeout = Long.valueOf(connectionTimeoutStr); } long receiveTimeout = defaultJbpmCxfClientReceiveTimeout; String receiveTimeoutStr = (String) workItem.getParameter("ReceiveTimeout"); if (receiveTimeoutStr != null && !receiveTimeoutStr.trim().isEmpty()) { receiveTimeout = Long.valueOf(receiveTimeoutStr); } logger.info("connectionTimeout = {}, receiveTimeout = {}", connectionTimeout, receiveTimeout); policy.setConnectionTimeout(connectionTimeout); policy.setReceiveTimeout(receiveTimeout); }

Target:
private void setClientTimeout(WorkItem workItem, Client client) { HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy policy = conduit.getClient(); long connectionTimeout = defaultJbpmCxfClientConnectionTimeout; String connectionTimeoutStr = (String) workItem.getParameter("ConnectionTimeout"); if (connectionTimeoutStr != null && !connectionTimeoutStr.trim().isEmpty()) { connectionTimeout = Long.valueOf(connectionTimeoutStr); } long receiveTimeout = defaultJbpmCxfClientReceiveTimeout; String receiveTimeoutStr = (String) workItem.getParameter("ReceiveTimeout"); if (receiveTimeoutStr != null && !receiveTimeoutStr.trim().isEmpty()) { receiveTimeout = Long.valueOf(receiveTimeoutStr); } logger.debug("connectionTimeout = {}, receiveTimeout = {}", connectionTimeout, receiveTimeout); policy.setConnectionTimeout(connectionTimeout); policy.setReceiveTimeout(receiveTimeout); }
Source:
private DateTime getTimeBoundary(StorageAdapter adapter, TimeBoundaryQuery legacyQuery, boolean descending) { final Sequence<Result<DateTime>> resultSequence = QueryRunnerHelper.makeCursorBasedQuery( adapter, legacyQuery.getQuerySegmentSpec().getIntervals(), Filters.toFilter(legacyQuery.getDimensionsFilter()), VirtualColumns.EMPTY, descending, new AllGranularity(), this.skipToFirstMatching ); final List<Result<DateTime>> resultList = Sequences.toList( Sequences.limit(resultSequence, 1), Lists.<Result<DateTime>>newArrayList() ); if (resultList.size() > 0) { return resultList.get(0).getValue(); } return null; }

Target:
private DateTime getTimeBoundary(StorageAdapter adapter, TimeBoundaryQuery legacyQuery, boolean descending) { final Sequence<Result<DateTime>> resultSequence = QueryRunnerHelper.makeCursorBasedQuery( adapter, legacyQuery.getQuerySegmentSpec().getIntervals(), Filters.toFilter(legacyQuery.getDimensionsFilter()), VirtualColumns.EMPTY, descending, Granularities.ALL, this.skipToFirstMatching ); final List<Result<DateTime>> resultList = Sequences.toList( Sequences.limit(resultSequence, 1), Lists.<Result<DateTime>>newArrayList() ); if (resultList.size() > 0) { return resultList.get(0).getValue(); } return null; }
Source:
public void failedCreation() throws Exception { final NewAccessPoint ap = new NewAccessPoint("operatorId", "ip", new MacAddress("aa:bb"), "sn", "model"); final NewAccessPointDTO dto = new NewAccessPointDTO("operatorId", "ip", "aa:bb", "sn", "model"); context.checking(new Expectations() {{ oneOf(repository).create(with(matching(ap))); will(throwException(new NotFoundException("missing operator"))); }}); Request request = makeRequestThatContains(dto); service.create(request); }

Target:
public void failedCreation() throws Exception { VenueDTO venueDTO = new VenueDTO("group", "type", Lists.newArrayList(new VenueNameDTO("info", "en"))); Venue venue = new Venue(new VenueGroup(venueDTO.group), new VenueType(venueDTO.type), Lists.newArrayList(new VenueName("info", new Language("en")))); final NewAccessPoint ap = new NewAccessPoint("operatorId", "ip", new MacAddress("aa:bb"), "sn", "model", venue); final NewAccessPointDTO dto = new NewAccessPointDTO("operatorId", "ip", "aa:bb", "sn", "model", venueDTO); context.checking(new Expectations() {{ oneOf(repository).create(with(matching(ap))); will(throwException(new NotFoundException("missing operator"))); }}); Request request = makeRequestThatContains(dto); service.create(request); }
Source:
private static LoadBalancingPolicy loadBalancingPolicy(CassandraKeyValueServiceConfig config, Set<InetSocketAddress> servers) { LoadBalancingPolicy policy = LatencyAwarePolicy.builder(new RoundRobinPolicy()).build(); if (!config.autoRefreshNodes()) { policy = new WhiteListPolicy(policy, servers); } return new TokenAwarePolicy(policy, TokenAwarePolicy.ReplicaOrdering.RANDOM); }

Target:
private static LoadBalancingPolicy loadBalancingPolicy(CassandraKeyValueServiceConfig config, Set<InetSocketAddress> servers) { LoadBalancingPolicy policy = LatencyAwarePolicy.builder(new RoundRobinPolicy()).build(); if (!config.autoRefreshNodes()) { policy = new WhiteListPolicy(policy, servers); } return new TokenAwarePolicy(policy); }
Source:
private void handleQueue(MemberStateImpl memberState, Config config, Map<String, LocalQueueStats> queues) { Set<String> mapsWithStats = createHashSet(queues.size()); for (String name : queues.keySet()) { if (config.findQueueConfig(name).isStatisticsEnabled()) { mapsWithStats.add(name); } } memberState.setQueuesWithStats(mapsWithStats); }

Target:
private void handleQueue(MemberStateImpl memberState, Config config, Map<String, LocalQueueStats> queues) { Set<String> queuesWithStats = createHashSet(queues.size()); for (String name : queues.keySet()) { if (config.findQueueConfig(name).isStatisticsEnabled()) { queuesWithStats.add(name); } } memberState.setQueuesWithStats(queuesWithStats); }
Source:
private MetacardMapper lookupMetacardAttributeToFeaturePropertyMapper(QName featureType) { MetacardMapper metacardAttributeToFeaturePropertyMapper = null; if (this.metacardToFeatureMappers != null) { for (MetacardMapper mapper : this.metacardToFeatureMappers) { if (mapper != null && StringUtils.equals(mapper.getFeatureType(), featureType.toString())) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( "Found for feature type {}.", MetacardMapper.class.getSimpleName(), featureType.toString()); } metacardAttributeToFeaturePropertyMapper = mapper; break; } } if (metacardAttributeToFeaturePropertyMapper == null && LOGGER.isDebugEnabled()) { LOGGER.debug( "Unable to find a for feature type {}.", MetacardMapper.class.getSimpleName(), featureType.toString()); } } return metacardAttributeToFeaturePropertyMapper; }

Target:
private MetacardMapper lookupMetacardAttributeToFeaturePropertyMapper(QName featureType) { MetacardMapper metacardAttributeToFeaturePropertyMapper = null; if (this.metacardToFeatureMappers != null) { for (MetacardMapper mapper : this.metacardToFeatureMappers) { if (mapper != null && StringUtils.equals(mapper.getFeatureType(), featureType.toString())) { LOGGER.debug("Found MetacardMapper for feature type {}.", featureType); metacardAttributeToFeaturePropertyMapper = mapper; break; } } if (metacardAttributeToFeaturePropertyMapper == null) { LOGGER.debug("Unable to find a MetacardMapper for feature type {}.", featureType); } } return metacardAttributeToFeaturePropertyMapper; }
Source:
public static StandardEvaluationContext createStandardEvaluationContext(BeanFactory beanFactory) { ConversionService conversionService = null; if (beanFactory != null) { IntegrationContextUtils.getConversionService(beanFactory); } return createStandardEvaluationContext(beanFactory, conversionService); }

Target:
public static StandardEvaluationContext createStandardEvaluationContext(BeanFactory beanFactory) { if (beanFactory == null) { logger.warn("Creating EvaluationContext with no beanFactory", new RuntimeException("No beanfactory")); } return doCreateContext(beanFactory); }
Source:
public GridTimer getTimer() { if (gettimer() == null) { settimer(new GridTimer(getListName()) { @Override public void execute() { logger.fine(SearchableListModel.this.getClass().getName() + ": Executing search"); syncSearch(); gettimer().stop(); gettimer().setRefreshRate(gettimer().getRefreshRate()); gettimer().start(); } }); } return gettimer(); }

Target:
public GridTimer getTimer() { if (timer == null && getEventBus() != null) { setTimer(new GridTimer(getListName(), getEventBus()) { @Override public void execute() { doGridTimerExecute(); } }); addTimerChangeListener(); } return timer; }
Source:
public synchronized void aggregate() { final ArrayOfDoublesSketch update = selector.getObject(); if (update == null) { return; } union.update(update); }

Target:
public void aggregate() { final ArrayOfDoublesSketch update = selector.getObject(); if (update == null) { return; } synchronized (this) { union.update(update); } }
Source:
protected int doWork() { final MetricsFile<MetricBase, Comparable<?>> laneMetricsFile = this.getMetricsFile(); final MetricsFile<MetricBase, Comparable<?>> phasingMetricsFile = this.getMetricsFile(); if (INCLUDE_SKIPS_AND_MOLECULAR_BARCODES) { final List<ReadDescriptor> descriptors = READ_STRUCTURE.descriptors.stream().map(descriptor -> { if (descriptor.type == ReadType.Skip || descriptor.type == ReadType.MolecularIndex) { return new ReadDescriptor(descriptor.length, ReadType.Template); } else { return descriptor; } }).collect(Collectors.toList()); READ_STRUCTURE = new ReadStructure(descriptors); } IlluminaLaneMetricsCollector.collectLaneMetrics(RUN_DIRECTORY, OUTPUT_DIRECTORY, OUTPUT_PREFIX, laneMetricsFile, phasingMetricsFile, READ_STRUCTURE); return 0; }

Target:
protected int doWork() { final MetricsFile<MetricBase, Comparable<?>> laneMetricsFile = this.getMetricsFile(); final MetricsFile<MetricBase, Comparable<?>> phasingMetricsFile = this.getMetricsFile(); if (READ_STRUCTURE == null) { final File runInfo = new File(RUN_DIRECTORY + "/" + "RunInfo.xml"); IOUtil.assertFileIsReadable(runInfo); try { final Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(runInfo); final NodeList reads = document.getElementsByTagName("Read"); final List<ReadDescriptor> descriptors = new ArrayList<>(reads.getLength()); for (int i = 0; i < reads.getLength(); i++) { final Node read = reads.item(i); final NamedNodeMap attributes = read.getAttributes(); final int readNumber = Integer.parseInt(attributes.getNamedItem("Number").getNodeValue()); final int numCycles = Integer.parseInt(attributes.getNamedItem("NumCycles").getNodeValue()); final boolean isIndexedRead = attributes.getNamedItem("IsIndexedRead").getNodeValue().toUpperCase().equals("Y"); if (readNumber != i + 1) throw new PicardException("Read number in RunInfo.xml was out of order: " + (i+1) + " != " + readNumber); descriptors.add(new ReadDescriptor(numCycles, isIndexedRead ? ReadType.Barcode: ReadType.Template)); } READ_STRUCTURE = new ReadStructure(descriptors); } catch (final Exception e) { throw new PicardException(e.getMessage()); } } IlluminaLaneMetricsCollector.collectLaneMetrics(RUN_DIRECTORY, OUTPUT_DIRECTORY, OUTPUT_PREFIX, laneMetricsFile, phasingMetricsFile, READ_STRUCTURE); return 0; }
Source:
private BlockReader seek(byte blockType, byte[] key, BlockReader idx, long startPos, long endPos) throws IOException { if (idx != null) { BlockReader block = idx; do { long position = block.seekKey(key) <= 0 ? block.readPositionFromIndex() : ((blocksIn(startPos, endPos) - 1) * blockSize); block = readBlock(position, endPos); } while (block.type() == INDEX_BLOCK_TYPE); block.seekKey(key); return block; } return binarySearch(blockType, key, startPos, endPos); }

Target:
private BlockReader seek(byte blockType, byte[] key, BlockReader idx, long startPos, long endPos) throws IOException { if (idx != null) { BlockReader block = idx; do { if (block.seekKey(key) > 0) { return null; } long pos = block.readPositionFromIndex(); block = readBlock(pos, endPos); } while (block.type() == INDEX_BLOCK_TYPE); block.seekKey(key); return block; } return binarySearch(blockType, key, startPos, endPos); }
Source:
V call(Callable<V,T> callable) throws IOException, T, InterruptedException { if (isClosingOrClosed()) { throw new IOException("Remote call on " + name + " failed. The channel is closing down or has closed down"); } UserRequest<V,T> request=null; try { request = new UserRequest<V, T>(this, callable); UserResponse<V,T> r = request.call(this); return r.retrieve(this, UserRequest.getClassLoader(callable)); } catch (ClassNotFoundException e) { IOException x = new IOException("Remote call on "+name+" failed"); x.initCause(e); throw x; } catch (Error e) { IOException x = new IOException("Remote call on "+name+" failed"); x.initCause(e); throw x; } finally { if(request!=null) request.releaseExports(); } }

Target:
V call(Callable<V,T> callable) throws IOException, T, InterruptedException { if (isClosingOrClosed()) { throw new ChannelClosedException("Remote call on " + name + " failed. " + "The channel is closing down or has closed down", getCloseRequestCause()); } UserRequest<V,T> request=null; try { request = new UserRequest<V, T>(this, callable); UserResponse<V,T> r = request.call(this); return r.retrieve(this, UserRequest.getClassLoader(callable)); } catch (ClassNotFoundException e) { IOException x = new IOException("Remote call on "+name+" failed"); x.initCause(e); throw x; } catch (Error e) { IOException x = new IOException("Remote call on "+name+" failed"); x.initCause(e); throw x; } finally { if(request!=null) request.releaseExports(); } }