auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCloseConnectionWrapperFor() throws NamingException, SQLException { expectedException.expect(SQLException.class); expectedException.expectMessage("IJ031041: Connection handle has been closed and is unusable"); DataSourceBean bean = (DataSourceBean)ctx.lookup("java:module/" + DataSourceBean.class.getSimpleName()); DataSource ds = bean.getDataSource(); Connection c = ds.getConnection(); c.close(); try { c.isWrapperFor(ResultSet.class); }catch (NullPointerException e){ Assert.fail("Wrong exception is raised. The exception should be Connection is not associated with a managed connection: ... See JBJCA-1389."); } }

Target:
public void testCloseConnectionWrapperFor() throws NamingException, SQLException { expectedException.expect(SQLException.class); expectedException.expectMessage("IJ031041"); DataSourceBean bean = (DataSourceBean)ctx.lookup("java:module/" + DataSourceBean.class.getSimpleName()); DataSource ds = bean.getDataSource(); Connection c = ds.getConnection(); c.close(); try { c.isWrapperFor(ResultSet.class); } catch (NullPointerException e) { Assert.fail("Wrong exception is raised. The exception should be Connection is not associated with a managed connection: ... See JBJCA-1389."); } }
Source:
public void __renderPage() { mDeckListAdapter.buildDeckList(mDueTree, getCol()); try { int eta = mDeckListAdapter.getEta(); int due = mDeckListAdapter.getDue(); Resources res = getResources(); if (getCol().cardCount() != -1) { String time = "-"; if (eta != -1) { time = Utils.timeQuantity(AnkiDroidApp.getInstance(), eta*60); } if (getSupportActionBar() != null) { getSupportActionBar().setSubtitle(res.getQuantityString(R.plurals.deckpicker_title, due, due, time)); } } } catch (RuntimeException e) { Timber.e(e, "RuntimeException setting time remaining"); } long current = getCol().getDecks().current().optLong("id"); if (mFocusedDeck != current) { scrollDecklistToDeck(current); mFocusedDeck = current; } }

Target:
public void __renderPage() { if (mDueTree == null) { updateDeckList(); return; } mDeckListAdapter.buildDeckList(mDueTree, getCol()); try { int eta = mDeckListAdapter.getEta(); int due = mDeckListAdapter.getDue(); Resources res = getResources(); if (getCol().cardCount() != -1) { String time = "-"; if (eta != -1) { time = Utils.timeQuantity(AnkiDroidApp.getInstance(), eta*60); } if (getSupportActionBar() != null) { getSupportActionBar().setSubtitle(res.getQuantityString(R.plurals.deckpicker_title, due, due, time)); } } } catch (RuntimeException e) { Timber.e(e, "RuntimeException setting time remaining"); } long current = getCol().getDecks().current().optLong("id"); if (mFocusedDeck != current) { scrollDecklistToDeck(current); mFocusedDeck = current; } }
Source:
public ManagementAgent(@NonNull SingletonResource<CorfuRuntime> runtimeSingletonResource, @NonNull ServerContext serverContext, @NonNull ClusterStateContext clusterContext, @NonNull FailureDetector failureDetector, Layout managementLayout) { this.runtimeSingletonResource = runtimeSingletonResource; this.serverContext = serverContext; this.localMonitoringService = new LocalMonitoringService(serverContext, runtimeSingletonResource); if (managementLayout == null) { recovered = true; } serverContext.installSingleNodeLayoutIfAbsent(); serverContext.saveManagementLayout(serverContext.getCurrentLayout()); serverContext.saveManagementLayout(managementLayout); if (!recovered) { log.info("Attempting to recover. Layout before shutdown: {}", managementLayout); } this.remoteMonitoringService = new RemoteMonitoringService( serverContext, runtimeSingletonResource, clusterContext, failureDetector, localMonitoringService ); this.autoCommitService = new AutoCommitService(serverContext, runtimeSingletonResource); this.initializationTaskThread = new Thread(this::initializationTask, "initializationTaskThread"); this.initializationTaskThread.setUncaughtExceptionHandler( (thread, throwable) -> { log.error("Error in initialization task: {}", throwable); shutdown(); }); this.initializationTaskThread.start(); }

Target:
ManagementAgent(@NonNull SingletonResource<CorfuRuntime> runtimeSingletonResource, @NonNull ServerContext serverContext, @NonNull ClusterStateContext clusterContext, @NonNull FailureDetector failureDetector, Layout managementLayout) { this.runtimeSingletonResource = runtimeSingletonResource; this.serverContext = serverContext; this.localMonitoringService = new LocalMonitoringService(serverContext, runtimeSingletonResource); if (managementLayout == null) { recovered = true; } serverContext.installSingleNodeLayoutIfAbsent(); serverContext.saveManagementLayout(serverContext.getCurrentLayout()); serverContext.saveManagementLayout(managementLayout); if (!recovered) { log.info("Attempting to recover. Layout before shutdown: {}", managementLayout); } this.remoteMonitoringService = new RemoteMonitoringService( serverContext, runtimeSingletonResource, clusterContext, failureDetector, localMonitoringService ); this.autoCommitService = new AutoCommitService(serverContext, runtimeSingletonResource); this.initializationTaskThread = new Thread(this::initializationTask, "initializationTaskThread"); this.initializationTaskThread.setUncaughtExceptionHandler( (thread, throwable) -> { log.error("Error in initialization task: {}", throwable); shutdown(); }); this.initializationTaskThread.start(); }
Source:
public boolean nextBoolean() throws IOException { requirePeek(); boolean value; try { value = parser.getBooleanValue(); } catch (JsonParseException e) { value = Boolean.parseBoolean(parser.getValueAsString()); } clearPeek(); return value; }

Target:
public boolean nextBoolean() throws IOException { requirePeek(); boolean value = parser.getBooleanValue(); clearPeek(); return value; }
Source:
private <T> void sendResultToOrigin(final LongKeyOperation<T> operation) { try (final TraceScope traceScope = Trace.startSpan("SEND_REMOTE_RESULT")) { final String dataType = operation.getDataType(); final Codec codec = serializer.getCodec(dataType); final Optional<String> origEvalId = operation.getOrigEvalId(); final Map<Long, T> outputData = operation.getOutputData(); final List<UnitIdPair> dataKVPairList; if (operation.getOperationType() == DataOpType.GET || operation.getOperationType() == DataOpType.REMOVE) { dataKVPairList = new LinkedList<>(); for (final Map.Entry<Long, T> dataKVPair : outputData.entrySet()) { final ByteBuffer encodedData = ByteBuffer.wrap(codec.encode(dataKVPair.getValue())); dataKVPairList.add(new UnitIdPair(encodedData, dataKVPair.getKey())); } } else { dataKVPairList = Collections.EMPTY_LIST; } msgSender.get().sendRemoteOpResultMsg(origEvalId.get(), dataKVPairList, operation.getFailedRanges(), operation.getOperationId(), TraceInfo.fromSpan(traceScope.getSpan())); } }

Target:
private <T> void sendResultToOrigin(final LongKeyOperation<T> operation) { try (final TraceScope traceScope = Trace.startSpan("SEND_REMOTE_RESULT")) { final String dataType = operation.getDataType(); final Codec codec = serializer.getCodec(dataType); final Optional<String> origEvalId = operation.getOrigEvalId(); final Map<Long, T> outputData = operation.getOutputData(); final List<UnitIdPair> dataKVPairList; if (operation.getOperationType() == DataOpType.GET || operation.getOperationType() == DataOpType.REMOVE) { dataKVPairList = new ArrayList<>(outputData.size()); for (final Map.Entry<Long, T> dataKVPair : outputData.entrySet()) { final ByteBuffer encodedData = ByteBuffer.wrap(codec.encode(dataKVPair.getValue())); dataKVPairList.add(new UnitIdPair(encodedData, dataKVPair.getKey())); } } else { dataKVPairList = Collections.EMPTY_LIST; } msgSender.get().sendRemoteOpResultMsg(origEvalId.get(), dataKVPairList, operation.getFailedRanges(), operation.getOperationId(), TraceInfo.fromSpan(traceScope.getSpan())); } }
Source:
public void onResponseReceived(Request req, Response res) { int status = res.getStatusCode(); if (status == Response.SC_NO_CONTENT) { cb.onSuccess(null); if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } } else if (200 <= status && status < 300) { T data; if (isTextBody(res)) { data = NativeString.wrap(res.getText()).cast(); res.getText(); } else if (isJsonBody(res)) { try { data = RestApi.<T>cast(parseJson(res)); } catch (JSONException e) { if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(SC_BAD_RESPONSE, "Invalid JSON: " + e.getMessage())); return; } } else { if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(SC_BAD_RESPONSE, "Expected " + JSON_TYPE + " or " + TEXT_TYPE + "; received Content-Type: " + res.getHeader("Content-Type"))); return; } cb.onSuccess(data); if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } } else { String msg; if (isTextBody(res)) { msg = res.getText().trim(); } else if (isJsonBody(res)) { JSONValue v; try { v = parseJson(res); } catch (JSONException e) { v = null; } if (v != null && v.isString() != null) { msg = v.isString().stringValue(); } else { msg = trimJsonMagic(res.getText()).trim(); } } else { msg = res.getStatusText(); } if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(status, msg)); } }

Target:
public void onResponseReceived(Request req, Response res) { int status = res.getStatusCode(); if (status == Response.SC_NO_CONTENT) { cb.onSuccess(null); if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } } else if (200 <= status && status < 300) { T data; if (isTextBody(res)) { data = NativeString.wrap(res.getText()).cast(); } else if (isJsonBody(res)) { try { data = RestApi.<T>cast(parseJson(res)); } catch (JSONException e) { if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(SC_BAD_RESPONSE, "Invalid JSON: " + e.getMessage())); return; } } else { if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(SC_BAD_RESPONSE, "Expected " + JSON_TYPE + " or " + TEXT_TYPE + "; received Content-Type: " + res.getHeader("Content-Type"))); return; } cb.onSuccess(data); if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } } else { String msg; if (isTextBody(res)) { msg = res.getText().trim(); } else if (isJsonBody(res)) { JSONValue v; try { v = parseJson(res); } catch (JSONException e) { v = null; } if (v != null && v.isString() != null) { msg = v.isString().stringValue(); } else { msg = trimJsonMagic(res.getText()).trim(); } } else { msg = res.getStatusText(); } if (!background) { RpcStatus.INSTANCE.onRpcComplete(); } cb.onFailure(new StatusCodeException(status, msg)); } }
Source:
public void testDBConnectionTimeMetrics() { metrics.setDBConnectionTime(14); assertEquals(14, testUtil.getGaugeValue("dbConnectionTime")); }

Target:
public void testDBConnectionTimeMetrics() { this.metrics.setDBConnectionTime(14); assertEquals(14, this.testUtil.getGaugeValue("dbConnectionTime")); }
Source:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { super.write(ctx, msg, promise); final NettyChannel channel = NettyChannel.getOrAddChannel(ctx.channel(), url, handler); final boolean isMsg = msg instanceof Request; promise.addListener(future -> { if (future.isSuccess()) { try { handler.sent(channel, msg); } finally { NettyChannel.removeChannelIfDisconnected(ctx.channel()); } return; } Throwable t = future.cause(); if (t != null && isMsg) { Request request = (Request) msg; Response response = new Response(request.getId(), request.getVersion()); response.setStatus(Response.BAD_REQUEST); response.setErrorMessage(StringUtils.toString(t)); handler.received(channel, response); } }); }

Target:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { super.write(ctx, msg, promise); final NettyChannel channel = NettyChannel.getOrAddChannel(ctx.channel(), url, handler); final boolean isRequest = msg instanceof Request; promise.addListener(future -> { try { if (future.isSuccess()) { handler.sent(channel, msg); return; } Throwable t = future.cause(); if (t != null && isRequest) { Request request = (Request) msg; Response response = buildErrorResponse(request, t); handler.received(channel, response); } } finally { NettyChannel.removeChannelIfDisconnected(ctx.channel()); } }); }
Source:
public void onMinecartPass(EntityMinecart cart) { if (powered && cart.canBeRidden() && cart.riddenByEntity == null && cart.getEntityData().getInteger("MountPrevention") <= 0) { int a = area; double x = getPos().getX(); double y = getPos().getY(); double z = getPos().getZ(); AxisAlignedBB box = AxisAlignedBB.fromBounds(x, y, z, x + 1, y + 1, z + 1); box = box.expand(a, a, a); List<EntityLivingBase> entities = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, box); if (entities.size() > 0) { EntityLivingBase entity = entities.get(MiscTools.RANDOM.nextInt(entities.size())); if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; if (player.isSneaking()) { return; } ItemStack current = player.getCurrentEquippedItem(); if (current != null && current.getItem() instanceof IToolCrowbar) { return; } } else if (excludedEntities.contains(entity.getClass())) { return; } else if (entity instanceof EntitySlime) { EntitySlime slime = (EntitySlime) entity; if (slime.getSlimeSize() >= 100) return; } if (entity.ridingEntity == null) { EffectManager.instance.teleportEffect(entity, cart.posX, cart.posY, cart.posZ); entity.mountEntity(cart); } } } }

Target:
public void onMinecartPass(EntityMinecart cart) { if (powered && cart.canBeRidden() && cart.riddenByEntity == null && cart.getEntityData().getInteger("MountPrevention") <= 0) { int a = area; AxisAlignedBB box = AABBFactory.make().createBoxForTileAt(getPos()).build(); box = box.expand(a, a, a); List<EntityLivingBase> entities = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, box); if (entities.size() > 0) { EntityLivingBase entity = entities.get(MiscTools.RANDOM.nextInt(entities.size())); if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; if (player.isSneaking()) { return; } ItemStack current = player.getCurrentEquippedItem(); if (current != null && current.getItem() instanceof IToolCrowbar) { return; } } else if (excludedEntities.contains(entity.getClass())) { return; } else if (entity instanceof EntitySlime) { EntitySlime slime = (EntitySlime) entity; if (slime.getSlimeSize() >= 100) return; } if (entity.ridingEntity == null) { EffectManager.instance.teleportEffect(entity, cart.posX, cart.posY, cart.posZ); entity.mountEntity(cart); } } } }
Source:
public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException { long cnt; final ByteBuffer src; try { src = pooledBuffer.getResource(); final int pos = src.position(); final int rem = src.remaining(); if (rem > count) try { src.limit(pos + (int) count); int res = target.write(src); if(res == 0) { throughBuffer.clear(); Buffers.copy(throughBuffer, src); throughBuffer.flip(); } return res; } finally { src.limit(pos + rem); } else { cnt = target.write(src); if (cnt == rem) { current = next; pooledBuffer.free(); } else { if (cnt == 0) { throughBuffer.clear(); Buffers.copy(throughBuffer, src); throughBuffer.flip(); } return cnt; } } } catch (IllegalStateException ignored) { current = next; cnt = 0L; } final long res = next.transferTo(count - cnt, throughBuffer, target); return res > 0L ? cnt + res : cnt > 0L ? cnt : res; }

Target:
public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException { long cnt; final ByteBuffer src; try { src = pooledBuffer.getResource(); final int pos = src.position(); final int rem = src.remaining(); if (rem > count) try { src.limit(pos + (int) count); int res = target.write(src); if(res == 0) { throughBuffer.clear(); Buffers.copy(throughBuffer, src); throughBuffer.flip(); } else { throughBuffer.clear(); throughBuffer.flip(); } return res; } finally { src.limit(pos + rem); } else { cnt = target.write(src); if (cnt == rem) { current = next; pooledBuffer.free(); } else { if (cnt == 0) { throughBuffer.clear(); Buffers.copy(throughBuffer, src); throughBuffer.flip(); } else { throughBuffer.clear(); throughBuffer.flip(); } return cnt; } } } catch (IllegalStateException ignored) { current = next; cnt = 0L; } final long res = next.transferTo(count - cnt, throughBuffer, target); return res > 0L ? cnt + res : cnt > 0L ? cnt : res; }
Source:
public VmDevice addSoundDevice(VmBase vmBase, Supplier<Cluster> clusterSupplier) { ChipsetType chipset = EmulatedMachineUtils.getEffectiveChipset(vmBase, clusterSupplier); if (vmBase instanceof VmTemplate) { return addSoundDevice(vmBase.getId(), vmBase.getOsId(), CompatibilityVersionUtils.getEffective((VmBase) null, clusterSupplier), chipset); } return addSoundDevice(vmBase.getId(), vmBase.getOsId(), clusterUtils.getCompatibilityVersion(vmBase), chipset); }

Target:
public VmDevice addSoundDevice(VmBase vmBase, Supplier<Cluster> clusterSupplier) { ChipsetType chipset = EmulatedMachineUtils.getEffectiveChipset(vmBase, clusterSupplier); Version compatibilityVersion = vmBase instanceof VmTemplate ? CompatibilityVersionUtils.getEffective((VmBase) null, clusterSupplier) : clusterUtils.getCompatibilityVersion(vmBase); return addSoundDevice(vmBase.getId(), vmBase.getOsId(), compatibilityVersion, chipset); }
Source:
public static ConsoleProfileFinished fromJson(JsonInput input) { String id = input.nextString(); Location location = null; Profile profile = null; String title = null; while (input.hasNext()) { switch (input.nextName()) { case "location": location = Location.fronJson(input); break; case "profile": profile = Profile.fromJson(input); break; case "title": title = input.nextString(); break; default: input.skipValue(); break; } } return new ConsoleProfileFinished(id, location, profile, title); }

Target:
private static ConsoleProfileFinished fromJson(JsonInput input) { String id = input.nextString(); Location location = null; Profile profile = null; String title = null; while (input.hasNext()) { switch (input.nextName()) { case "location": location = Location.fromJson(input); break; case "profile": profile = Profile.fromJson(input); break; case "title": title = input.nextString(); break; default: input.skipValue(); break; } } return new ConsoleProfileFinished(id, location, profile, title); }
Source:
public Result<Void> deleteStorage(final String id) { try { transactionTemplate.execute(action -> { storageDbRepository.deleteStorage(id); return null; }); } catch (final NoStorageException e) { return Result.notFound("No storage with ID " + id); } catch (final StorageIsUsedException e) { return Result.forbidden("Storage " + id + " is in use"); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, e.getMessage())); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, "Transaction error occurred when deleting storage")); } return Result.ok(); }

Target:
public Result<Void> deleteStorage(final String id) { try { storageDbRepository.deleteStorage(id); } catch (final NoStorageException e) { return Result.notFound("No storage with ID " + id); } catch (final StorageIsUsedException e) { return Result.forbidden("Storage " + id + " is in use"); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, e.getMessage())); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, "Transaction error occurred when deleting storage")); } return Result.ok(); }
Source:
protected File mergeQueryableIndex( final List<QueryableIndex> indexes, final AggregatorFactory[] aggs, final File file, ProgressIndicator progressIndicator ) throws IOException { if (config.isBuildV9Directly()) { return HadoopDruidIndexerConfig.INDEX_MERGER_V9.mergeQueryableIndex( indexes, config.getSchema().getDataSchema().isRollup(), aggs, file, config.getIndexSpec(), progressIndicator ); } else { return HadoopDruidIndexerConfig.INDEX_MERGER.mergeQueryableIndex( indexes, config.getSchema().getDataSchema().isRollup(), aggs, file, config.getIndexSpec(), progressIndicator ); } }

Target:
protected File mergeQueryableIndex( final List<QueryableIndex> indexes, final AggregatorFactory[] aggs, final File file, ProgressIndicator progressIndicator ) throws IOException { boolean rollup = config.getSchema().getDataSchema().getGranularitySpec().isRollup(); if (config.isBuildV9Directly()) { return HadoopDruidIndexerConfig.INDEX_MERGER_V9.mergeQueryableIndex( indexes, rollup, aggs, file, config.getIndexSpec(), progressIndicator ); } else { return HadoopDruidIndexerConfig.INDEX_MERGER.mergeQueryableIndex( indexes, rollup, aggs, file, config.getIndexSpec(), progressIndicator ); } }
Source:
public CreateNewWikiPage selectCategory(int categoryId) { if (wikiCategoryList.isEmpty()) { throw new WebDriverException("No categories to choose from"); } if (wikiCategoryList.size() < categoryId + 1) { throw new WebDriverException("Cannot find a categpory with this index"); } scrollTo(wikiCategoryDropdown); wait.forElementClickable(wikiCategoryDropdown); WebElement selectedCategory; try { selectedCategory = wikiCategoryList.get(categoryId); } catch (ArrayIndexOutOfBoundsException e) { Log.log("selectCategory", "There is no category with index " + categoryId, false); throw new WebDriverException("There is no category with index " + categoryId, e); } hover(wikiCategoryDropdown); wait.forElementClickable(selectedCategory); selectedCategory.click(); Log.log("selectCategory", "selected " + selectedCategory.getText() + " category", true, driver); return this; }

Target:
public CreateNewWikiPage selectCategory(int categoryId) { if (wikiCategoryList.isEmpty()) { throw new WebDriverException("No categories to choose from"); } if (wikiCategoryList.size() < categoryId + 1) { throw new WebDriverException("Cannot find a category with this index"); } scrollTo(wikiCategoryDropdown); wait.forElementClickable(wikiCategoryDropdown); WebElement selectedCategory; try { selectedCategory = wikiCategoryList.get(categoryId); } catch (ArrayIndexOutOfBoundsException e) { Log.log("selectCategory", "There is no category with index " + categoryId, false); throw new WebDriverException("There is no category with index " + categoryId, e); } hover(wikiCategoryDropdown); wait.forElementClickable(selectedCategory); selectedCategory.click(); Log.log("selectCategory", "selected " + selectedCategory.getText() + " category", true, driver); return this; }
Source:
public void createFHIRCondition_shouldReturnCreatedFHIRCondition() { Condition condition = new Condition(); String uuid = "75f5b373-5065-11de-80cb-001e378eb67f"; IdType id = new IdType(); id.setValue(uuid); condition.setId(id); Patient patientRef = Context.getPatientService().getPatient(2); Reference patient = FHIRUtils.buildPatientOrPersonResourceReference(patientRef); condition.setSubject(patient); condition.setClinicalStatus(Condition.ConditionClinicalStatus.ACTIVE); condition.setCode(new CodeableConcept().addCoding( new Coding().setCode("999").setDisplay("NO").setSystem(FHIRConstants.OPENMRS_URI)).setText("NO")); Condition resCondition = getService().createFHIRCondition(condition); assertNotNull(resCondition); assertEquals(resCondition.getId(), id.getValue()); assertEquals(resCondition.getSubject().getReference(), patient.getReference()); assertEquals(resCondition.getCode().getCoding().get(0).getDisplay(), "NO"); }

Target:
public void createFHIRCondition_shouldReturnCreatedFHIRCondition() { Condition condition = new Condition(); IdType id = new IdType(); id.setValue(CONDITION_UUID); condition.setId(id); Patient patientRef = Context.getPatientService().getPatient(2); Reference patient = FHIRUtils.buildPatientOrPersonResourceReference(patientRef); condition.setSubject(patient); condition.setClinicalStatus(Condition.ConditionClinicalStatus.ACTIVE); condition.setCode(new CodeableConcept().addCoding( new Coding().setCode("999").setDisplay("NO").setSystem(FHIRConstants.OPENMRS_URI)).setText("NO")); Condition resCondition = getService().createFHIRCondition(condition); assertNotNull(resCondition); assertEquals(resCondition.getId(), id.getValue()); assertEquals(resCondition.getSubject().getReference(), patient.getReference()); assertEquals(resCondition.getCode().getCoding().get(0).getDisplay(), "NO"); }
Source:
public ByteBuffer getAndRelease() { return buffer; }

Target:
public ByteBuffer getAndRelease() { try { return buffer; } finally { buffer = null; } }
Source:
public V get(final K key) throws CacheLoaderException { final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { loaded = cacheLoader.load(k); } } catch (RuntimeException e) { throw new CacheLoaderException(e); } return loaded; } }); try { final Store.ValueHolder<V> valueHolder = store.computeIfAbsent(key, mappingFunction); return valueHolder == null ? null : valueHolder.value(); } catch (CacheAccessException e) { try { store.remove(key); resilienceStrategy.recoveredFrom(key, e); } catch (CacheAccessException e1) { resilienceStrategy.possiblyInconsistent(key, e1, e); } return mappingFunction.apply(key); } }

Target:
public V get(final K key) throws CacheLoaderException { checkNonNull(key); final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { loaded = cacheLoader.load(k); } } catch (RuntimeException e) { throw new CacheLoaderException(e); } return loaded; } }); try { final Store.ValueHolder<V> valueHolder = store.computeIfAbsent(key, mappingFunction); return valueHolder == null ? null : valueHolder.value(); } catch (CacheAccessException e) { try { store.remove(key); resilienceStrategy.recoveredFrom(key, e); } catch (CacheAccessException e1) { resilienceStrategy.possiblyInconsistent(key, e1, e); } return mappingFunction.apply(key); } }
Source:
public void addContents(@NonNull Container container, FileListCap fileListCap) { synchronized (fileListCap) { File[] files = Preconditions.checkNotNull(fileListCap.getFolder().listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(".txt"); } })); for (File f : Util.fixNull(Arrays.asList(files))) { container.add(new FileContent(fileListCap.getFolder().getName() + "/" + f.getName(), f, MAX_FILE_SIZE)); } } }

Target:
public void addContents(@NonNull Container container, FileListCap fileListCap) { synchronized (fileListCap) { final Collection<File> files = FileUtils.listFiles( fileListCap.getFolder(), new String[] {"txt"}, false); for (File f : files) { container.add(new FileContent(fileListCap.getFolder().getName() + "/" + f.getName(), f, MAX_FILE_SIZE)); } } }
Source:
public static String getPluginVersion() { final String pluginVersion = ComponentAccessor.getPluginAccessor() .getPlugin("org.everit.jira.timetracker.plugin") .getPluginInformation().getVersion(); return pluginVersion; }

Target:
public static String getPluginVersion() { String pluginVersion = ComponentAccessor.getPluginAccessor() .getPlugin("org.everit.jira.timetracker.plugin") .getPluginInformation().getVersion(); return pluginVersion; }
Source:
public Operation resume(RunContext run) throws WorldEditException { while (!blocks.isEmpty()) { BlockVector3 current = blocks.iterator().next(); if (!blocks.contains(current)) { continue; } final Deque<BlockVector3> walked = new LinkedList<>(); while (true) { walked.addFirst(current); assert (blockTypes.containsKey(current)); final BlockStateHolder blockStateHolder = blockTypes.get(current); if (BlockCategories.DOORS.contains(blockStateHolder.getBlockType())) { Property<Object> halfProperty = blockStateHolder.getBlockType().getProperty("half"); if (blockStateHolder.getState(halfProperty).equals("lower")) { BlockVector3 upperBlock = current.add(0, 1, 0); if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { walked.addFirst(upperBlock); } } } else if (BlockCategories.RAILS.contains(blockStateHolder.getBlockType())) { BlockVector3 lowerBlock = current.add(0, -1, 0); if (blocks.contains(lowerBlock) && !walked.contains(lowerBlock)) { walked.addFirst(lowerBlock); } } if (!blockStateHolder.getBlockType().getMaterial().isFragileWhenPushed()) { break; } if (walked.contains(current)) { break; } } for (BlockVector3 pt : walked) { extent.setBlock(pt, blockTypes.get(pt)); blocks.remove(pt); } } if (blocks.isEmpty()) { for (LocatedBlockList stage : stages) { stage.clear(); } return null; } return this; }

Target:
public Operation resume(RunContext run) throws WorldEditException { while (!blocks.isEmpty()) { BlockVector3 current = blocks.iterator().next(); final Deque<BlockVector3> walked = new LinkedList<>(); while (true) { walked.addFirst(current); assert (blockTypes.containsKey(current)); final BlockStateHolder blockStateHolder = blockTypes.get(current); if (BlockCategories.DOORS.contains(blockStateHolder.getBlockType())) { Property<Object> halfProperty = blockStateHolder.getBlockType().getProperty("half"); if (blockStateHolder.getState(halfProperty).equals("lower")) { BlockVector3 upperBlock = current.add(0, 1, 0); if (blocks.contains(upperBlock) && !walked.contains(upperBlock)) { walked.addFirst(upperBlock); } } } else if (BlockCategories.RAILS.contains(blockStateHolder.getBlockType())) { BlockVector3 lowerBlock = current.add(0, -1, 0); if (blocks.contains(lowerBlock) && !walked.contains(lowerBlock)) { walked.addFirst(lowerBlock); } } if (!blockStateHolder.getBlockType().getMaterial().isFragileWhenPushed()) { break; } if (walked.contains(current)) { break; } } for (BlockVector3 pt : walked) { extent.setBlock(pt, blockTypes.get(pt)); blocks.remove(pt); } } for (LocatedBlockList stage : stages.values()) { stage.clear(); } return null; }
Source:
public SimpleTextFormatter get(int i) { return partitions[i]; }

Target:
public SimpleTextFormatter get(int i) { return this.partitions[i]; }
Source:
protected boolean executeAnalysis(final IProgressMonitor monitor) { final ITmfStateProvider htInput = createStateProvider(); if (htInput == null) { return false; } try { StateSystemBackend backend = getBackend(); switch (backend) { case FULL: case PARTIAL: String directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); final File htFile = new File(directory + getSsFileName()); if (backend.equals(StateSystemBackend.FULL)) { fStateSystem = TmfStateSystemFactory.newFullHistory(htFile, htInput, true); } else { fStateSystem = TmfStateSystemFactory.newPartialHistory(htFile, htInput, true); } break; case INMEM: fStateSystem = TmfStateSystemFactory.newInMemHistory(htInput, true); break; case NULL: fStateSystem = TmfStateSystemFactory.newNullHistory(htInput); break; default: break; } } catch (TmfTraceException e) { return false; } return true; }

Target:
protected boolean executeAnalysis(final IProgressMonitor monitor) { final ITmfStateProvider htInput = createStateProvider(); try { StateSystemBackendType backend = getBackendType(); String directory; switch (backend) { case FULL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); final File htFile = new File(directory + getSsFileName()); fStateSystem = TmfStateSystemFactory.newFullHistory(htFile, htInput, true); break; case PARTIAL: directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); final File htPartialFile = new File(directory + getSsFileName()); fStateSystem = TmfStateSystemFactory.newPartialHistory(htPartialFile, htInput, true); break; case INMEM: fStateSystem = TmfStateSystemFactory.newInMemHistory(htInput, true); break; case NULL: fStateSystem = TmfStateSystemFactory.newNullHistory(htInput); break; default: break; } } catch (TmfTraceException e) { return false; } return true; }
Source:
private void handleGetAuthorizationCodeResponse(Intent intent) { AuthorizationResponse authorizationResponse = AuthorizationResponse.fromIntent(intent); AuthorizationException authorizationException = AuthorizationException.fromIntent(intent); if (authorizationResponse != null && authorizationResponse.authorizationCode != null) { exchangeAuthorizationCodeForTokens(authorizationResponse); } else if (authorizationException != null) { updateOAuthStatusIconAndText(authorizationException); showAuthStatus(); Timber.d("OAuth request to get authorization code failed: %s", authorizationException.error); } }

Target:
private void handleGetAuthorizationCodeResponse(Intent intent) { AuthorizationResponse authorizationResponse = AuthorizationResponse.fromIntent(intent); AuthorizationException authorizationException = AuthorizationException.fromIntent(intent); if (authorizationResponse != null && authorizationResponse.authorizationCode != null) { exchangeAuthorizationCodeForTokens(authorizationResponse); } else if (authorizationException != null) { updateOAuthStatusIconAndText(authorizationException); showAuthStatus(); Timber.e(authorizationException, "OAuth request to get authorization code failed"); } }
Source:
public void setSocketAddresses(List<InetSocketAddress> addresses) { List<PhysicalAddress> list = new ArrayList<>(); for (InetSocketAddress address : addresses) { IpAddress ipAddress = new IpAddress(address.getAddress(), address.getPort()); list.add(ipAddress); } this.setInitialHosts(list); }

Target:
public void setSocketAddresses(List<InetSocketAddress> addresses) { List<PhysicalAddress> list = new ArrayList<>(addresses.size()); for (InetSocketAddress address : addresses) { IpAddress ipAddress = new IpAddress(address.getAddress(), address.getPort()); list.add(ipAddress); } this.setInitialHosts(list); }
Source:
static MethodMatcher levelTestMatcher(String typeDefinition, String level) { return MethodMatcher.create() .typeDefinition(typeDefinition) .name(String.format("is%c%sEnabled", level.charAt(0), level.toLowerCase(Locale.ROOT).substring(2))) .withoutParameter(); }

Target:
private static MethodMatcher levelTestMatcher(String typeDefinition, String level) { return MethodMatcher.create() .typeDefinition(typeDefinition) .name(String.format("is%c%sEnabled", level.charAt(0), level.toLowerCase(Locale.ROOT).substring(1))) .withoutParameter(); }
Source:
public void test() { connect(); sleep(600); Assert.assertEquals("false", getZKLog()); }

Target:
public void test() { connect(); waitResponse(); Assert.assertEquals("false", getZKLog()); }
Source:
private List<org.atlasapi.media.entity.simple.TopicRef> topicRefToSimple(final Content content, List<TopicRef> contentTopics, final Set<Annotation> annotations, final Application application) { final Map<Long, Topic> topics = Maps.uniqueIndex(res(Iterables.transform(contentTopics, TOPICREF_TO_TOPIC_ID), annotations), TOPIC_TO_TO_TOPIC_ID); return Lists.transform(contentTopics, topicRef -> { org.atlasapi.media.entity.simple.TopicRef tr = new org.atlasapi.media.entity.simple.TopicRef(); tr.setSupervised(topicRef.isSupervised()); tr.setWeighting(topicRef.getWeighting()); tr.setRelationship(topicRef.getRelationship().toString()); tr.setOffset(topicRef.getOffset()); tr.setTopic(topicSimplifier.simplify(topics.get(topicRef.getTopic()), annotations, application)); if (annotations.contains(Annotation.PUBLISHER)) { tr.setPublisher(toPublisherDetails(topicRef.getPublisher())); } return tr; }); }

Target:
private List<org.atlasapi.media.entity.simple.TopicRef> topicRefToSimple( final Content content, List<TopicRef> contentTopics, final Set<Annotation> annotations, final Application application ) { final Map<Long, Topic> topics = Maps.uniqueIndex(res(contentTopics.stream() .map(TopicRef::getTopic) .collect(Collectors.toList()), annotations), Identified::getId); return Lists.transform(contentTopics, topicRef -> { org.atlasapi.media.entity.simple.TopicRef simpleTopicRef = new org.atlasapi.media.entity.simple.TopicRef(); simpleTopicRef.setSupervised(topicRef.isSupervised()); simpleTopicRef.setWeighting(topicRef.getWeighting()); simpleTopicRef.setRelationship(topicRef.getRelationship().toString()); simpleTopicRef.setOffset(topicRef.getOffset()); simpleTopicRef.setTopic(topicSimplifier.simplify(topics.get(topicRef.getTopic()), annotations, application)); if (annotations.contains(Annotation.PUBLISHER)) { simpleTopicRef.setPublisher(toPublisherDetails(topicRef.getPublisher())); } return simpleTopicRef; }); }
Source:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NoWhitespaceBeforeCheck.class); final String[] expected = { "30:15: " + getCheckMessage(MSG_KEY, "++"), "30:22: " + getCheckMessage(MSG_KEY, "--"), "176:19: " + getCheckMessage(MSG_KEY, ";"), "178:24: " + getCheckMessage(MSG_KEY, ";"), "185:19: " + getCheckMessage(MSG_KEY, ";"), "187:28: " + getCheckMessage(MSG_KEY, ";"), "195:27: " + getCheckMessage(MSG_KEY, ";"), "211:16: " + getCheckMessage(MSG_KEY, ";"), "266:1: " + getCheckMessage(MSG_KEY, ";"), "270:16: " + getCheckMessage(MSG_KEY, ";"), "284:1: " + getCheckMessage(MSG_KEY, ";"), }; verify(checkConfig, getPath("InputNoWhitespaceBeforeDefault.java"), expected); }

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NoWhitespaceBeforeCheck.class); final String[] expected = { "30:15: " + getCheckMessage(MSG_KEY, "++"), "30:22: " + getCheckMessage(MSG_KEY, "--"), "176:19: " + getCheckMessage(MSG_KEY, ";"), "178:24: " + getCheckMessage(MSG_KEY, ";"), "185:19: " + getCheckMessage(MSG_KEY, ";"), "187:28: " + getCheckMessage(MSG_KEY, ";"), "195:27: " + getCheckMessage(MSG_KEY, ";"), "211:16: " + getCheckMessage(MSG_KEY, ";"), "266:1: " + getCheckMessage(MSG_KEY, ";"), "270:16: " + getCheckMessage(MSG_KEY, ";"), "284:1: " + getCheckMessage(MSG_KEY, ";"), "287:62: " + getCheckMessage(MSG_KEY, "..."), "291:16: " + getCheckMessage(MSG_KEY, ":"), }; verify(checkConfig, getPath("InputNoWhitespaceBeforeDefault.java"), expected); }
Source:
public void localhostOnlyFlagResultsInConnectableFitnesseOnLocalHost() throws Exception { String[] args = {"-p", "1999", "-lh"}; new FitNesseMain().launchFitNesse(new Arguments(args)); URL url = new URL("http://localhost:1999"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); con.disconnect(); assertEquals(200, responseCode); }

Target:
public void localhostOnlyFlagResultsInConnectableFitnesseOnLocalHost() throws Exception { String[] args = {"-p", "1999", "-lh"}; new FitNesseMain().launchFitNesse(new Arguments(args)); URL url = new URL("http://localhost:1999/?shutdown"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); con.disconnect(); assertEquals(200, responseCode); }
Source:
public AccountCreationPolicy setVerificationEmailStatus(EmailStatus accountVerificationEmailStatus) { Assert.notNull(accountVerificationEmailStatus, "verificationEmailStatus cannot be null."); setProperty(ACCOUNT_VERIFICATION_EMAIL_STATUS, accountVerificationEmailStatus.name()); return this; }

Target:
public AccountCreationPolicy setVerificationEmailStatus(EmailStatus accountVerificationEmailStatus) { Assert.notNull(accountVerificationEmailStatus, "accountVerificationEmailStatus cannot be null."); setProperty(ACCOUNT_VERIFICATION_EMAIL_STATUS, accountVerificationEmailStatus.name()); return this; }
Source:
protected int getDeviceZoom() { long screen = OS.gdk_screen_get_default(); final String schemaId = "com.ubuntu.user-interface"; byte[] schema_id = Converter.wcsToMbcs (null, schemaId, true); long schemaSource = OS.g_settings_schema_source_get_default (); if (OS.g_settings_schema_source_lookup(schemaSource, schema_id, false) != 0) { displaySettings = OS.g_settings_new (schema_id); if (!isConnected) { gsettingsCallback = new Callback (this, "gsettingsProc", 3); gsettingsProc = gsettingsCallback.getAddress (); if (gsettingsProc == 0) { SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } int retVal = OS.g_signal_connect (displaySettings, OS.changed, gsettingsProc, CHANGE_SCALEFACTOR); if (retVal > 0) { isConnected = true; } } scaleFactor = (int)OS.gdk_screen_get_resolution (screen); return DPIUtil.mapDPIToZoom(scaleFactor); } else { int monitor = OS.gdk_screen_get_monitor_at_point(screen, 0, 0); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry(screen, monitor, dest); int widthMM = OS.gdk_screen_get_monitor_width_mm(screen, monitor); return (DPIUtil.mapDPIToZoom(Compatibility.round (254 * dest.width, widthMM * 10))); } }

Target:
protected int getDeviceZoom() { long screen = OS.gdk_screen_get_default(); int scaleFactor = (int) OS.gdk_screen_get_resolution (screen); if (OS.GTK_VERSION > OS.VERSION(3, 9, 0)) { Rectangle rect = getBounds(); int monitor_num = OS.gdk_screen_get_monitor_at_point(screen, rect.x, rect.y); int scale = (int) OS.gdk_screen_get_monitor_scale_factor(screen, monitor_num); scaleFactor = Math.max(scaleFactor, scale * 96); } return DPIUtil.mapDPIToZoom(scaleFactor); }
Source:
public final Object createDirectory(final String dir, final SBlock fail) { try { Files.createDirectories(Paths.get(dir), new FileAttribute<?>[0]); } catch (IOException e) { fail.getMethod().invoke(new Object[] {fail, e.toString()}); } return Nil.nilObject; }

Target:
public final Object createDirectory(final String dir, final SBlock fail) { try { Files.createDirectories(Paths.get(dir), new FileAttribute<?>[0]); } catch (IOException e) { dispatchHandler.executeDispatch(new Object[] {fail, e.toString()}); } return Nil.nilObject; }
Source:
public void should_CatchSubProcessBoundaryErrorEvent_When_ErrorEndEvenThrown(){ securityUtil.logInAs("user"); ProcessInstance processInstance = processRuntime.start( ProcessPayloadBuilder .start() .withProcessDefinitionKey(ERROR_BOUNDARY_EVENT_SUBPROCESS) .build()); assertNotNull(processInstance); Page<ProcessInstance> processInstancePage = processRuntime.processInstances(Pageable.of(0, 50), ProcessPayloadBuilder .processInstances().withProcessDefinitionKey(ERROR_BOUNDARY_EVENT_SUBPROCESS) .build()); assertThat(processInstancePage).isNotNull(); assertThat(processInstancePage.getContent()).hasSize(0); assertThat(listener.getErrorReceivedEvents()) .isNotEmpty() .extracting(BPMNErrorReceivedEvent::getEventType, BPMNErrorReceivedEvent::getProcessDefinitionId, BPMNErrorReceivedEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getElementId(), event -> event.getEntity().getActivityName(), event -> event.getEntity().getActivityType(), event -> event.getEntity().getErrorId(), event -> event.getEntity().getErrorCode() ) .contains(Tuple.tuple(BPMNErrorReceivedEvent.ErrorEvents.ERROR_RECEIVED, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "catchError", null, null, "errorId", "123" )); }

Target:
public void should_CatchSubProcessBoundaryErrorEvent_When_ErrorEndEvenThrown(){ securityUtil.logInAs("user"); ProcessInstance processInstance = processRuntime.start( ProcessPayloadBuilder .start() .withProcessDefinitionKey(ERROR_BOUNDARY_EVENT_SUBPROCESS) .build()); assertNotNull(processInstance); checkProcessAndTask(processInstance.getId(), "Task"); assertThat(listener.getErrorReceivedEvents()) .isNotEmpty() .extracting(BPMNErrorReceivedEvent::getEventType, BPMNErrorReceivedEvent::getProcessDefinitionId, BPMNErrorReceivedEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getElementId(), event -> event.getEntity().getActivityName(), event -> event.getEntity().getActivityType(), event -> event.getEntity().getErrorId(), event -> event.getEntity().getErrorCode() ) .contains(Tuple.tuple(BPMNErrorReceivedEvent.ErrorEvents.ERROR_RECEIVED, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "catchError", null, null, "errorId", "123" )); }
Source:
private String determinePlayerListText() { Iterable<EntityRef> allClients = entityManager.getEntitiesWith(ClientComponent.class); StringBuilder sb = new StringBuilder(); boolean first = true; for (EntityRef clientEntity : allClients) { if (!first) { sb.append("\n"); } ClientComponent clientComp = clientEntity.getComponent(ClientComponent.class); sb.append(PlayerUtil.getColoredPlayerName(clientComp.clientInfo) + " "+ FontColor.getColored(clientComp.ping, Color.GREEN)); first = false; } return sb.toString(); }

Target:
private String determinePlayerListText() { Iterable<EntityRef> allClients = entityManager.getEntitiesWith(ClientComponent.class); StringBuilder sb = new StringBuilder(); boolean first = true; for (EntityRef clientEntity : allClients) { if (!first) { sb.append("\n"); } ClientComponent clientComp = clientEntity.getComponent(ClientComponent.class); sb.append(PlayerUtil.getColoredPlayerName(clientComp.clientInfo)); first = false; } return sb.toString(); }
Source:
public CommitCommand setAuthor(String name, String email) { this.author = new PersonIdent(name, email); return this; }

Target:
public CommitCommand setAuthor(String name, String email) { return setAuthor(new PersonIdent(name, email)); }
Source:
public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); final int osId = 0; Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<Integer, Map<Version, List<DisplayType>>>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); }

Target:
public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); final int osId = 0; Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); }
Source:
private List<VdsNetworkInterface> getLabeledNics(Network network) { List<NetworkCluster> clusters = getNetworkClusterDao().getAllForNetwork(network.getId()); List<VdsNetworkInterface> labeledNics = new ArrayList<>(); for (NetworkCluster networkCluster : clusters) { labeledNics.addAll(getDbFacade().getInterfaceDao() .getAllInterfacesByLabelForCluster(networkCluster.getClusterId(), network.getLabel())); } return labeledNics; }

Target:
private List<VdsNetworkInterface> getLabeledNics(Network network) { List<NetworkCluster> clusters = networkClusterDao.getAllForNetwork(network.getId()); List<VdsNetworkInterface> labeledNics = new ArrayList<>(); for (NetworkCluster networkCluster : clusters) { labeledNics.addAll(interfaceDao.getAllInterfacesByLabelForCluster(networkCluster.getClusterId(), network.getLabel())); } return labeledNics; }
Source:
public void dispose() { getSelectionService().removeSelectionListener(this.selectionListener); final IWorkbenchWindow[] windows = PlatformUI.getWorkbench() .getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { window.addPageListener(this.wListener); for (IWorkbenchPage page : window.getPages()) { page.removePartListener(this.wListener); } } super.dispose(); }

Target:
public void dispose() { getSelectionService().removeSelectionListener(this.selectionListener); final IWorkbenchWindow[] windows = PlatformUI.getWorkbench() .getWorkbenchWindows(); for (IWorkbenchWindow window : windows) { window.removePageListener(this.wListener); for (IWorkbenchPage page : window.getPages()) { page.removePartListener(this.wListener); } } super.dispose(); }