auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void join(GlowSession session, PlayerReader reader) { String type = world.getWorldType().getName().toLowerCase(); int gameMode = getGameMode().getValue(); if (server.isHardcore()) { gameMode |= 0x8; } session.send(new JoinGameMessage(SELF_ID, gameMode, world.getEnvironment().getId(), world.getDifficulty().getValue(), session.getServer().getMaxPlayers(), type, world.getGameRuleMap().getBoolean("reducedDebugInfo"))); setGameModeDefaults(); try { session.send(PluginMessage.fromString("MC|Brand", server.getName())); } catch (NullPointerException e) { session.send(PluginMessage.fromString("MC|Brand", "Glowstone")); } sendSupportedChannels(); joinTime = System.currentTimeMillis(); reader.readData(this); reader.close(); getServer().setPlayerOnline(this, true); saveData(); streamBlocks(); setCompassTarget(world.getSpawnLocation()); sendTime(); sendWeather(); sendRainDensity(); sendSkyDarkness(); sendAbilities(); scoreboard = server.getScoreboardManager().getMainScoreboard(); scoreboard.subscribe(this); invMonitor = new InventoryMonitor(getOpenInventory()); updateInventory(); session.send(new PositionRotationMessage(location)); if (!server.getResourcePackURL().isEmpty()) { setResourcePack(server.getResourcePackURL(), server.getResourcePackHash()); } }

Target:
public void join(GlowSession session, PlayerReader reader) { String type = world.getWorldType().getName().toLowerCase(); int gameMode = getGameMode().getValue(); if (server.isHardcore()) { gameMode |= 0x8; } session.send(new JoinGameMessage(SELF_ID, gameMode, world.getEnvironment().getId(), world.getDifficulty().getValue(), session.getServer().getMaxPlayers(), type, world.getGameRuleMap().getBoolean("reducedDebugInfo"))); setGameModeDefaults(); session.send(PluginMessage.fromString("MC|Brand", server.getName())); sendSupportedChannels(); joinTime = System.currentTimeMillis(); reader.readData(this); reader.close(); getServer().setPlayerOnline(this, true); saveData(); streamBlocks(); setCompassTarget(world.getSpawnLocation()); sendTime(); sendWeather(); sendRainDensity(); sendSkyDarkness(); sendAbilities(); scoreboard = server.getScoreboardManager().getMainScoreboard(); scoreboard.subscribe(this); invMonitor = new InventoryMonitor(getOpenInventory()); updateInventory(); session.send(new PositionRotationMessage(location)); if (!server.getResourcePackURL().isEmpty()) { setResourcePack(server.getResourcePackURL(), server.getResourcePackHash()); } }
Source:
public String getText(Object element) { String label = UNKNOWN_LABEL_TEXT; if (element instanceof IStorage) { label = ((IStorage) element).getName(); } else { label = super.getText(element); } return label; }

Target:
public String getText(Object element) { String label = null; if (element instanceof IStorage) { label = ((IStorage) element).getName(); } else { label = super.getText(element); } return label; }
Source:
public PatientPreferencesType deserialize(String sPtPref) throws AdapterPIPException { PatientPreferencesType oPtPref = null; ByteArrayInputStream baIsStrm = null; try { JAXBUnmarshallingUtil util = new JAXBUnmarshallingUtil(); JAXBContextHandler oHandler = new JAXBContextHandler(); JAXBContext oJaxbContext = oHandler.getJAXBContext("gov.hhs.fha.nhinc.common.nhinccommonadapter"); Unmarshaller oUnmarshaller = oJaxbContext.createUnmarshaller(); baIsStrm = new ByteArrayInputStream(sPtPref.getBytes()); JAXBElement oJAXBElementConsent = (JAXBElement) oUnmarshaller.unmarshal(util.getSafeStreamReaderFromInputStream(baIsStrm)); if (oJAXBElementConsent.getValue() instanceof PatientPreferencesType) { oPtPref = (PatientPreferencesType) oJAXBElementConsent.getValue(); } } catch (JAXBException e) { String sErrorMessage = "Failed to deserialize the patient preferences string: " + sPtPref + " Error: " + e.getMessage(); LOG.error(sErrorMessage, e); throw new AdapterPIPException(sErrorMessage, e); } catch (XMLStreamException e) { String sErrorMessage = "Failed to deserialize the patient preferences string: " + sPtPref + " Error: " + e.getMessage(); LOG.error(sErrorMessage, e); throw new AdapterPIPException(sErrorMessage, e); } return oPtPref; }

Target:
public PatientPreferencesType deserialize(String sPtPref) throws AdapterPIPException { PatientPreferencesType oPtPref = null; ByteArrayInputStream baIsStrm = null; try { JAXBUnmarshallingUtil util = new JAXBUnmarshallingUtil(); JAXBContextHandler oHandler = new JAXBContextHandler(); JAXBContext oJaxbContext = oHandler.getJAXBContext("gov.hhs.fha.nhinc.common.nhinccommonadapter"); Unmarshaller oUnmarshaller = oJaxbContext.createUnmarshaller(); baIsStrm = new ByteArrayInputStream(sPtPref.getBytes()); JAXBElement oJAXBElementConsent = (JAXBElement) oUnmarshaller.unmarshal(util.getSafeStreamReaderFromInputStream(baIsStrm)); if (oJAXBElementConsent.getValue() instanceof PatientPreferencesType) { oPtPref = (PatientPreferencesType) oJAXBElementConsent.getValue(); } } catch (JAXBException e) { String sErrorMessage = "Failed to deserialize the patient preferences string: " + sPtPref + " Error: " + e.getMessage(); LOG.error(sErrorMessage, e); throw new AdapterPIPException(sErrorMessage, e); } catch (XMLStreamException e) { String sErrorMessage = "Failed to deserialize the patient preferences string: " + sPtPref + " Error: " + e.getMessage(); LOG.error(sErrorMessage, e); throw new AdapterPIPException(sErrorMessage, e); } finally { StreamUtils.closeStreamSilently(baIsStrm); } return oPtPref; }
Source:
public void write(DataOutput out) throws IOException { Class<? extends InputSplit> clazz = (Class<? extends InputSplit>) realSplit.getClass(); Text.writeString(out, clazz.getName()); SerializationFactory factory = new SerializationFactory(conf); Serializer serializer = factory.getSerializer(clazz); serializer.open((DataOutputStream) out); serializer.serialize(realSplit); serializer.close(); }

Target:
public void write(DataOutput out) throws IOException { SplitUtil.serializeInputSplit(conf, (DataOutputStream) out, realSplit); }
Source:
public void sendStartSpanSingleMessage() { final Tracer tracer1 = mock(Tracer.class); List<Tracer> tracers = new ArrayList<>(Arrays.asList(tracer1)); TracerProvider tracerProvider = new TracerProvider(tracers); final Flux<EventData> testData = Flux.just( new EventData(TEST_CONTENTS.getBytes(UTF_8)), new EventData(TEST_CONTENTS.getBytes(UTF_8))); when(sendLink.send(anyList())).thenReturn(Mono.empty()); final SendOptions options = new SendOptions().partitionKey("Some partition key"); final EventHubProducerOptions producerOptions = new EventHubProducerOptions() .retry(new RetryOptions().tryTimeout(Duration.ofSeconds(30))) .partitionId("my-partition-id"); final EventHubAsyncProducer producer = new EventHubAsyncProducer(Mono.just(sendLink), producerOptions, tracerProvider); when(tracer1.start(eq("Azure.eventhubs.send"), any(), eq(ProcessKind.SEND))).thenAnswer( invocation -> { Context passed = invocation.getArgument(1, Context.class); return passed.addData(OPENTELEMETRY_SPAN_KEY, "value"); } ); when(tracer1.start(eq("Azure.eventhubs.message"), any(), eq(ProcessKind.RECEIVE))).thenAnswer( invocation -> { Context passed = invocation.getArgument(1, Context.class); return passed.addData(OPENTELEMETRY_SPAN_KEY, "value").addData(DIAGNOSTIC_ID_KEY, "value2"); } ); producer.send(testData).block(Duration.ofSeconds(10)); verify(tracer1, times(2)).start(eq("Azure.eventhubs.send"), any(), eq(ProcessKind.SEND)); verify(tracer1, times(2)).start(eq("Azure.eventhubs.message"), any(), eq(ProcessKind.RECEIVE)); verify(tracer1, times(3)).end(eq("success"), isNull(), any()); }

Target:
public void sendStartSpanSingleMessage() { final Tracer tracer1 = mock(Tracer.class); final List<Tracer> tracers = Collections.singletonList(tracer1); TracerProvider tracerProvider = new TracerProvider(tracers); final Flux<EventData> testData = Flux.just( new EventData(TEST_CONTENTS.getBytes(UTF_8)), new EventData(TEST_CONTENTS.getBytes(UTF_8))); when(sendLink.send(anyList())).thenReturn(Mono.empty()); final EventHubProducerOptions producerOptions = new EventHubProducerOptions() .retry(new RetryOptions().tryTimeout(Duration.ofSeconds(30))) .partitionId("my-partition-id"); final EventHubAsyncProducer producer = new EventHubAsyncProducer(Mono.just(sendLink), producerOptions, tracerProvider); when(tracer1.start(eq("Azure.eventhubs.send"), any(), eq(ProcessKind.SEND))).thenAnswer( invocation -> { Context passed = invocation.getArgument(1, Context.class); return passed.addData(OPENTELEMETRY_SPAN_KEY, "value"); } ); when(tracer1.start(eq("Azure.eventhubs.message"), any(), eq(ProcessKind.RECEIVE))).thenAnswer( invocation -> { Context passed = invocation.getArgument(1, Context.class); return passed.addData(OPENTELEMETRY_SPAN_KEY, "value").addData(DIAGNOSTIC_ID_KEY, "value2"); } ); StepVerifier.create(producer.send(testData)).verifyComplete(); verify(tracer1, times(2)).start(eq("Azure.eventhubs.send"), any(), eq(ProcessKind.SEND)); verify(tracer1, times(2)).start(eq("Azure.eventhubs.message"), any(), eq(ProcessKind.RECEIVE)); verify(tracer1, times(3)).end(eq("success"), isNull(), any()); }
Source:
public static ByteString compress(String data) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteBuffer dataLength = ByteBuffer.allocate(4); dataLength.order(ByteOrder.LITTLE_ENDIAN); dataLength.putInt(data.length()); outputStream.write(dataLength.array()); DeflaterOutputStream inflaterStream = new DeflaterOutputStream(outputStream); inflaterStream.write(data.getBytes(Charset.defaultCharset())); inflaterStream.close(); return new ByteString(outputStream.toByteArray()); } catch (IOException e) { return null; } }

Target:
public static ByteString compress(String data) { try { if (data == null) { return null; } if (StringUtils.isEmpty(data)) { return new ByteString(new byte[0]); } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteBuffer dataLength = ByteBuffer.allocate(4); dataLength.order(ByteOrder.LITTLE_ENDIAN); dataLength.putInt(data.length()); outputStream.write(dataLength.array()); DeflaterOutputStream inflaterStream = new DeflaterOutputStream(outputStream); inflaterStream.write(data.getBytes(Charset.defaultCharset())); inflaterStream.close(); return new ByteString(outputStream.toByteArray()); } catch (IOException e) { return null; } }
Source:
public ReplicationMetrics(String name, MetricRegistry registry, List<ReplicaThread> replicaThreads) { interColoReplicationBytesCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + ".interColoReplicationBytesCount")); intraColoReplicationBytesCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + ".intraColoReplicationBytesCount")); interColoBlobsReplicatedCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + ".interColoReplicationBlobsCount")); intraColoBlobsReplicatedCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + ".intraColoReplicationBlobsCount")); replicationErrors = registry.counter(MetricRegistry.name(ReplicaThread.class, name + ".replicationErrors")); interColoReplicationLatency = registry.timer(MetricRegistry.name(ReplicaThread.class, name + ".interColoReplicationLatency")); intraColoReplicationLatency = registry.timer(MetricRegistry.name(ReplicaThread.class, name + ".intraColoReplicationLatency")); this.replicaThreads = replicaThreads; numberOfReplicaThreads = new Gauge<Integer>() { @Override public Integer getValue() { return getLiveThreads(); } }; registry.register(MetricRegistry.name(ReplicaThread.class, ".numberOfReplicaThreads"), numberOfReplicaThreads); }

Target:
public ReplicationMetrics(String name, MetricRegistry registry, List<ReplicaThread> replicaThreads) { interColoReplicationBytesCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + "interColoReplicationBytesCount")); intraColoReplicationBytesCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + "intraColoReplicationBytesCount")); interColoBlobsReplicatedCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + "interColoReplicationBlobsCount")); intraColoBlobsReplicatedCount = registry.counter(MetricRegistry.name(ReplicaThread.class, name + "intraColoReplicationBlobsCount")); replicationErrors = registry.counter(MetricRegistry.name(ReplicaThread.class, name + "replicationErrors")); interColoReplicationLatency = registry.timer(MetricRegistry.name(ReplicaThread.class, name + "interColoReplicationLatency")); intraColoReplicationLatency = registry.timer(MetricRegistry.name(ReplicaThread.class, name + "intraColoReplicationLatency")); this.replicaThreads = replicaThreads; numberOfReplicaThreads = new Gauge<Integer>() { @Override public Integer getValue() { return getLiveThreads(); } }; registry.register(MetricRegistry.name(ReplicaThread.class, "numberOfReplicaThreads"), numberOfReplicaThreads); }
Source:
public void sendObject(Object data) throws IOException, EncodeException { }

Target:
public void sendObject(Object data) throws IOException, EncodeException { throw new UnsupportedOperationException("Method is not supported"); }
Source:
public void verifyEditModeContent(String targetText) { Assertion.assertStringContains(targetText, getArticleText()); PageObjectLogging.log("verifyEditModeContent", "verifying the article shows " + targetText, true); }

Target:
public void verifyEditModeContent(String targetText) { Assertion.assertStringContains(targetText, articleText.getText()); PageObjectLogging.log( "verifyEditModeContent", "The article shows " + targetText, true ); }
Source:
public InputStream getRestoreStream() { if (reference == null) { return getInMemoryStream(); } else { return getStreamFromReference(); } }

Target:
public InputStream getRestoreStream() { if (reference != null) { return getStreamFromReference(); } else { return getInMemoryStream(); } }
Source:
public static String getCurrentFileName() { if (status == Status.PARSING) return (currentFile != null) ? currentFile.getName() : null; return (status == Status.NONE) ? null : ""; }

Target:
public static String getCurrentFileName() { if (status == Status.PARSING) return (currentFile != null) ? currentFile.getName() : null; else return (status == Status.NONE) ? null : ""; }
Source:
public boolean process(AudioEvent audioEvent) { if (stopped) { return true; } if (audioEvent.getTimeStamp() > secondsToSkip) { audioEvent.setBytesProcessed(0); if (!hasFinished) { callback.onFinished(); hasFinished = true; } return false; } else { return false; } }

Target:
public boolean process(AudioEvent audioEvent) { if (stopped) { return true; } if (audioEvent.getTimeStamp() > secondsToSkip) { callback.onFinished(); stopped = true; if(waitForNotify) { blockThread(); } } return false; }
Source:
protected IStatus testBuildWorkspaceBeforeExport(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, 50); if (fInfo.useWorkspaceCompiledClasses) { getWorkspaceExportHelper().buildBeforeExport(fInfo.items, subMonitor.newChild(45)); Set<?> errors = getWorkspaceExportHelper().checkForErrors(fInfo.items); if (!errors.isEmpty()) { subMonitor.worked(5); return new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.FeatureExportOperation_workspaceBuildErrorsFoundDuringExport, errors.toString())); } monitor.worked(5); } return Status.OK_STATUS; }

Target:
protected IStatus testBuildWorkspaceBeforeExport(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, 50); if (fInfo.useWorkspaceCompiledClasses) { getWorkspaceExportHelper().buildBeforeExport(fInfo.items, subMonitor.newChild(45)); Set<?> errors = getWorkspaceExportHelper().checkForErrors(fInfo.items); subMonitor.worked(5); if (!errors.isEmpty()) { return new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.FeatureExportOperation_workspaceBuildErrorsFoundDuringExport, errors.toString())); } } return Status.OK_STATUS; }
Source:
public int getSelectedIndex() { return ((ScrollableToolbarMenuBar)menuBar_).getSelectedIndex(); }

Target:
public int getSelectedIndex() { return getMenuBar().getSelectedIndex(); }
Source:
private Properties addMappingsForRemoteQuery(Properties indexingProperties, ComponentRegistry cr, ClassLoader cl) { Class<?> fbClass; try { fbClass = Class.forName("org.infinispan.query.remote.indexing.ProtobufValueWrapperFieldBridge", true, cl); } catch (ClassNotFoundException e) { return indexingProperties; } try { SearchMapping mapping = (SearchMapping) indexingProperties.get(Environment.MODEL_MAPPING); if (mapping == null) { mapping = new SearchMapping(); Properties amendedProperties = new Properties(); amendedProperties.putAll(indexingProperties); amendedProperties.put(Environment.MODEL_MAPPING, mapping); indexingProperties = amendedProperties; } Cache cache = cr.getComponent(Cache.class); FieldBridge fb = (FieldBridge) fbClass.getConstructor(Cache.class).newInstance(cache); mapping.entity(Class.forName("org.infinispan.query.remote.indexing.ProtobufValueWrapper", true, cl)) .indexed().classBridgeInstance(fb).norms(Norms.NO).analyze(Analyze.YES).store(Store.YES); } catch (Exception e) { throw new CacheException("Failed to configure indexing for remote query", e); } return indexingProperties; }

Target:
private Properties addMappingsForRemoteQuery(Properties indexingProperties, ComponentRegistry cr, ClassLoader cl) { Class<?> fbClass; try { fbClass = Util.loadClassStrict("org.infinispan.query.remote.indexing.ProtobufValueWrapperFieldBridge", cl); } catch (ClassNotFoundException e) { return indexingProperties; } try { SearchMapping mapping = (SearchMapping) indexingProperties.get(Environment.MODEL_MAPPING); if (mapping == null) { mapping = new SearchMapping(); Properties amendedProperties = new Properties(); amendedProperties.putAll(indexingProperties); amendedProperties.put(Environment.MODEL_MAPPING, mapping); indexingProperties = amendedProperties; } Cache cache = cr.getComponent(Cache.class); FieldBridge fb = (FieldBridge) fbClass.getConstructor(Cache.class).newInstance(cache); mapping.entity(Util.loadClassStrict("org.infinispan.query.remote.indexing.ProtobufValueWrapper", cl)) .indexed().classBridgeInstance(fb).norms(Norms.NO).analyze(Analyze.YES).store(Store.YES); } catch (Exception e) { throw new CacheException("Failed to configure indexing for remote query", e); } return indexingProperties; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); TmfTraceElement trace = (TmfTraceElement) ((StructuredSelection) selection).getFirstElement(); Shell shell = HandlerUtil.getActiveShellChecked(event); CopyTraceDialog dialog = new CopyTraceDialog(shell, trace); dialog.open(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); if (!(selection instanceof IStructuredSelection)) { return null; } TmfTraceElement trace = (TmfTraceElement) ((IStructuredSelection) selection).getFirstElement(); Shell shell = HandlerUtil.getActiveShellChecked(event); CopyTraceDialog dialog = new CopyTraceDialog(shell, trace); dialog.open(); return null; }
Source:
public void onError(YouTubePlayer.ErrorReason errorReason) { if (attempts <= 3) { releaseYoutubePlayer(); initializeYoutubePlayer(); attempts++; } else { Toast.makeText(getActivity(), errorReason.toString(), Toast.LENGTH_LONG).show(); } }

Target:
public void onError(YouTubePlayer.ErrorReason errorReason) { if (attempts <= 3) { releaseYoutubePlayer(); initializeHandler.postDelayed(CourseUnitYoutubePlayerFragment.this::initializeYoutubePlayer, 500); attempts++; } else { redirectToYoutubeDialog(); } }
Source:
private void renegotiateOnEventLoop(final Promise<Channel> newHandshakePromise) { final Promise<Channel> oldHandshakePromise = handshakePromise; if (!oldHandshakePromise.isDone()) { oldHandshakePromise.addListener(new FutureListener<Channel>() { @Override public void operationComplete(Future<Channel> future) throws Exception { if (future.isSuccess()) { newHandshakePromise.setSuccess(future.getNow()); } else { newHandshakePromise.setFailure(future.cause()); } } }); } else { handshakePromise = newHandshakePromise; handshake(); applyHandshakeTimeout(); } }

Target:
private void renegotiateOnEventLoop(final Promise<Channel> newHandshakePromise) { final Promise<Channel> oldHandshakePromise = handshakePromise; if (!oldHandshakePromise.isDone()) { oldHandshakePromise.addListener(new PromiseNotifier<Channel, Future<Channel>>(newHandshakePromise)); } else { handshakePromise = newHandshakePromise; handshake(); applyHandshakeTimeout(); } }
Source:
public String execute(final JobExecutionContext context) { final JobArguments args = context.getJobArguments(); final String productUuid = args.getAsString(JobStatus.TARGET_ID); final Boolean lazy = args.getAsBoolean(LAZY_REGEN); final StringBuilder result = new StringBuilder(); final Product product = this.productCurator.get(productUuid); if (product != null) { final Refresher refresher = poolManager.getRefresher(this.subAdapter, this.ownerAdapter, lazy); refresher.add(product); refresher.run(); result.append("Pools refreshed for product: ") .append(productUuid) .append("\n"); } else { result.append("Unable to refresh pools for product \"") .append(productUuid) .append("\": Could not find a product with the specified UUID"); } return result.toString(); }

Target:
public String execute(final JobExecutionContext context) { final JobArguments args = context.getJobArguments(); final String productUuid = args.getAsString(PRODUCT_KEY); final Boolean lazy = args.getAsBoolean(LAZY_KEY); final StringBuilder result = new StringBuilder(); final Product product = this.productCurator.get(productUuid); if (product != null) { final Refresher refresher = poolManager.getRefresher(this.subAdapter, this.ownerAdapter, lazy); refresher.add(product); refresher.run(); result.append("Pools refreshed for product: ") .append(productUuid) .append("\n"); } else { result.append("Unable to refresh pools for product \"") .append(productUuid) .append("\": Could not find a product with the specified UUID"); } return result.toString(); }
Source:
private List<OncoTreeNode> setupOncotreeRepositoryMockResponseHistoryChange() { List<OncoTreeNode> tmpOncoTreeRepositoryMockResponseHistoryChange = new ArrayList<>(); for (OncoTreeNode oncotreeNode : oncoTreeRepositoryMockResponse) { OncoTreeNode newOncotreeNode = new OncoTreeNode(oncotreeNode); if ("SEZS".equals(newOncotreeNode.getCode())) { newOncotreeNode.setCode("SS"); } if ("URMM".equals(newOncotreeNode.getCode())) { newOncotreeNode.setRescinds("ONC000503"); } tmpOncoTreeRepositoryMockResponseHistoryChange.add(newOncotreeNode); } OncoTreeNode newOncotreeNode = new OncoTreeNode(); newOncotreeNode.setURI("<LINK_0>"); newOncotreeNode.setCode("CLLSLL"); newOncotreeNode.setName("DLBCL Associated with Chronic Inflammation"); newOncotreeNode.setMainType("Mature B-Cell Neoplasms"); newOncotreeNode.setColor("LimeGreen"); newOncotreeNode.setParentCode("BCL"); newOncotreeNode.setPrecursors("ONC000413 ONC000820"); tmpOncoTreeRepositoryMockResponseHistoryChange.add(newOncotreeNode); return tmpOncoTreeRepositoryMockResponseHistoryChange; }

Target:
private List<OncoTreeNode> setupOncotreeRepositoryMockResponseHistoryChange() { List<OncoTreeNode> tmpOncoTreeRepositoryMockResponseHistoryChange = new ArrayList<>(); for (OncoTreeNode oncotreeNode : oncoTreeRepositoryMockResponse) { OncoTreeNode newOncotreeNode = new OncoTreeNode(oncotreeNode); if ("SEZS".equals(newOncotreeNode.getCode())) { newOncotreeNode.setCode("SS"); } if ("URMM".equals(newOncotreeNode.getCode())) { newOncotreeNode.setRevocations("ONC000503"); } tmpOncoTreeRepositoryMockResponseHistoryChange.add(newOncotreeNode); } OncoTreeNode newOncotreeNode = new OncoTreeNode(); newOncotreeNode.setURI("<LINK_0>"); newOncotreeNode.setCode("CLLSLL"); newOncotreeNode.setName("DLBCL Associated with Chronic Inflammation"); newOncotreeNode.setMainType("Mature B-Cell Neoplasms"); newOncotreeNode.setColor("LimeGreen"); newOncotreeNode.setParentCode("BCL"); newOncotreeNode.setPrecursors("ONC000413 ONC000820"); tmpOncoTreeRepositoryMockResponseHistoryChange.add(newOncotreeNode); return tmpOncoTreeRepositoryMockResponseHistoryChange; }
Source:
protected boolean hasSourceMimeType(ConverterDescriptor converterDescriptor, String mimeType) { if (!Framework.getService(ConfigurationService.class).getBoolean(ENFORCE_SOURCE_MIME_TYPE_CHECK, true)) { return true; } return translationHelper.hasCompatibleMimeType(converterDescriptor.getSourceMimeTypes(), mimeType); }

Target:
protected boolean hasSourceMimeType(ConverterDescriptor converterDescriptor, String mimeType) { if (!Framework.getService(ConfigurationService.class).isBooleanTrue(ENFORCE_SOURCE_MIME_TYPE_CHECK)) { return true; } return translationHelper.hasCompatibleMimeType(converterDescriptor.getSourceMimeTypes(), mimeType); }
Source:
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; if (channel instanceof DatagramChannel) { return decodeUDP(channel, remoteAddress, buf); } else { return decodeTCP(channel, remoteAddress, buf); } }

Target:
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; if (channel instanceof DatagramChannel) { return decodeUdp(channel, remoteAddress, buf); } else { return decodeTcp(channel, remoteAddress, buf); } }
Source:
private static Image getSWTImage(int imageID) { Display display = Display.getCurrent(); if (display == null) display = Display.getDefault(); if (display.isDisposed()) return null; return Display.getCurrent().getSystemImage(imageID); }

Target:
private static Image getSWTImage(int imageID) { Display display = PlatformUI.getWorkbench().getDisplay(); if (display == null || display.isDisposed()) return null; return display.getSystemImage(imageID); }
Source:
protected Stanza(Stanza p) { id = p.getStanzaId(); to = p.getTo(); from = p.getFrom(); error = p.error; for (ExtensionElement pe : p.getExtensions()) { addExtension(pe); } if (isCustomAttributesEnabled()) { customAttributes.clear(); customAttributes.putAll(p.getCustomAttributes()); } }

Target:
protected Stanza(Stanza p) { id = p.getStanzaId(); to = p.getTo(); from = p.getFrom(); error = p.error; for (ExtensionElement pe : p.getExtensions()) { addExtension(pe); } if (p.customAttributes != null) { customAttributes = new LinkedHashMap<>(p.customAttributes); } }
Source:
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { List<Element> elements = new LinkedList<Element>(); for (Element element : roundEnv.getElementsAnnotatedWith(AutoValue.class)) { AutoValueExtension.Context context = new LimitedContext(processingEnv, (TypeElement) element); if (extension.applicable(context)) { elements.add(element); } } if (!elements.isEmpty()) { Set<? extends Element> adaptorFactories = roundEnv.getElementsAnnotatedWith(MoshiAdapterFactory.class); if (adaptorFactories.isEmpty()) { error(elements.get(0), "Missing MoshiAdapterFactory class. In order to generate the class, you need to create an abstract class with the @MoshiAdapterFactory annotation that implements JsonAdapter.Factory."); } else { for (Element element : adaptorFactories) { if (!element.getModifiers().contains(ABSTRACT)) { error(element, "Must be abstract!"); } TypeElement type = (TypeElement) element; List<? extends TypeMirror> interfaces = type.getInterfaces(); if (interfaces.isEmpty() || !containsJsonAdapterFactoryMirror(interfaces)) { error(element, "Must implement JsonAdapter.Factory!"); } String adapterName = classNameOf(type); String packageName = packageNameOf(type); TypeSpec jsonAdapterFactory = createJsonAdapterFactory(elements, packageName, adapterName); JavaFile file = JavaFile.builder(packageName, jsonAdapterFactory).build(); try { file.writeTo(processingEnv.getFiler()); } catch (IOException e) { processingEnv.getMessager().printMessage(ERROR, "Failed to write TypeAdapterFactory: " + e.getLocalizedMessage()); } } } } return false; }

Target:
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { List<Element> elements = new LinkedList<Element>(); for (Element element : roundEnv.getElementsAnnotatedWith(AutoValue.class)) { AutoValueExtension.Context context = new LimitedContext(processingEnv, (TypeElement) element); if (extension.applicable(context)) { elements.add(element); } } if (!elements.isEmpty()) { Set<? extends Element> adaptorFactories = roundEnv.getElementsAnnotatedWith(MoshiAdapterFactory.class); for (Element element : adaptorFactories) { if (!element.getModifiers().contains(ABSTRACT)) { error(element, "Must be abstract!"); } TypeElement type = (TypeElement) element; if (!implementsJsonAdapterFactory(type)) { error(element, "Must implement JsonAdapter.Factory!"); } String adapterName = classNameOf(type); String packageName = packageNameOf(type); TypeSpec jsonAdapterFactory = createJsonAdapterFactory(elements, packageName, adapterName); JavaFile file = JavaFile.builder(packageName, jsonAdapterFactory).build(); try { file.writeTo(processingEnv.getFiler()); } catch (IOException e) { processingEnv.getMessager().printMessage(ERROR, "Failed to write TypeAdapterFactory: " + e.getLocalizedMessage()); } } } return false; }
Source:
public OpaqueTokenSpec introspectionClientCredentials(String clientId, String clientSecret) { Assert.hasText(clientId, "clientId cannot be empty"); Assert.notNull(clientSecret, "clientSecret cannot be null"); this.webClient = WebClient.builder() .defaultHeader(HttpHeaders.AUTHORIZATION, basicHeaderValue(clientId, clientSecret)) .build(); return this; }

Target:
public OpaqueTokenSpec introspectionClientCredentials(String clientId, String clientSecret) { Assert.hasText(clientId, "clientId cannot be empty"); Assert.notNull(clientSecret, "clientSecret cannot be null"); this.clientId = clientId; this.clientSecret = clientSecret; this.introspectionClient = () -> new NimbusReactiveOAuth2TokenIntrospectionClient( this.introspectionUri, this.clientId, this.clientSecret); return this; }
Source:
protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); if (bugUrl.length() > 0 && authenticationRequired) { RepositoryLocation location = getClient().getLocation(); if (location.getBooleanPropery(IBugzillaRestConstants.REPOSITORY_USE_API_KEY)) { bugUrl += MessageFormat.format("{1}Bugzilla_api_key={0}", new Object[] { location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY), bugUrl.endsWith("?") ? "" : "&" }); } else { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } } return baseUrl() + bugUrl; }

Target:
protected String createHttpRequestURL() { String urlSuffix = getUrlSuffix(); if (urlSuffix.length() > 0 && authenticationRequired) { if (!urlSuffix.endsWith("?")) { urlSuffix += "&"; } RepositoryLocation location = getClient().getLocation(); if (location.getBooleanPropery(IBugzillaRestConstants.REPOSITORY_USE_API_KEY)) { urlSuffix += MessageFormat.format("Bugzilla_api_key={0}", location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY)); } else { UserCredentials credentials = getCredentials(); urlSuffix += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", credentials.getUserName(), credentials.getPassword()); } } return baseUrl() + urlSuffix; }
Source:
public void deleteBucket(int bucketIdx) throws IOException { Map<Long, Long> offsetMap = bucketPositions[bucketIdx]; if (offsetMap != null) { for (Long window : offsetMap.keySet()) { Collection<Integer> indices = windowToBuckets.get(window); synchronized (indices) { boolean elementRemoved = indices.remove(bucketIdx); if (indices.isEmpty() && elementRemoved) { deleteFile(window+""); windowToBuckets.removeAll(window); windowToTimestamp.remove(window); } } } } bucketPositions[bucketIdx] = null; }

Target:
public void deleteBucket(int bucketIdx) throws IOException { Map<Long, Long> offsetMap = bucketPositions[bucketIdx]; if (offsetMap != null) { for (Long window : offsetMap.keySet()) { Collection<Integer> indices = windowToBuckets.get(window); synchronized (indices) { boolean elementRemoved = indices.remove(bucketIdx); if (indices.isEmpty() && elementRemoved) { deleteFile(window.toString()); windowToBuckets.removeAll(window); windowToTimestamp.remove(window); } } } } bucketPositions[bucketIdx] = null; }
Source:
public void testConvertToDataModelTypeWithFiles() { variant.addSourceEntry(variantSourceEntry); BasicDBObject mongoFile = new BasicDBObject(DBObjectToVariantSourceEntryConverter.FILEID_FIELD, variantSourceEntry.getFileId()) .append(DBObjectToVariantSourceEntryConverter.STUDYID_FIELD, variantSourceEntry.getStudyId()); mongoFile.append(DBObjectToVariantSourceEntryConverter.ATTRIBUTES_FIELD, new BasicDBObject("QUAL", "0.01").append("AN", "2")); mongoFile.append(DBObjectToVariantSourceEntryConverter.FORMAT_FIELD, variantSourceEntry.getFormat()); BasicDBObject genotypeCodes = new BasicDBObject(); genotypeCodes.append("def", "0/0"); genotypeCodes.append("0/1", Arrays.asList(1)); mongoFile.append(DBObjectToVariantSourceEntryConverter.SAMPLES_FIELD, genotypeCodes); BasicDBList files = new BasicDBList(); files.add(mongoFile); mongoVariant.append("files", files); List<String> sampleNames = Lists.newArrayList("NA001", "NA002"); MongoDBObjectToVariantEntityConverter mongoDBObjectToVariantConverter = new MongoDBObjectToVariantEntityConverter(); Variant converted = mongoDBObjectToVariantConverter.convert(mongoVariant); assertEquals(variant, converted); }

Target:
public void testConvertToDataModelTypeWithFiles() { variant.addSourceEntry(variantSourceEntry); BasicDBObject mongoFile = new BasicDBObject(DBObjectToVariantSourceEntryConverter.FILEID_FIELD, variantSourceEntry.getFileId()) .append(DBObjectToVariantSourceEntryConverter.STUDYID_FIELD, variantSourceEntry.getStudyId()); mongoFile.append(DBObjectToVariantSourceEntryConverter.ATTRIBUTES_FIELD, new BasicDBObject("QUAL", "0.01").append("AN", "2")); mongoFile.append(DBObjectToVariantSourceEntryConverter.FORMAT_FIELD, variantSourceEntry.getFormat()); BasicDBObject genotypeCodes = new BasicDBObject(); genotypeCodes.append("def", "0/0"); genotypeCodes.append("0/1", Arrays.asList(1)); mongoFile.append(DBObjectToVariantSourceEntryConverter.SAMPLES_FIELD, genotypeCodes); BasicDBList files = new BasicDBList(); files.add(mongoFile); mongoVariant.append("files", files); MongoDBObjectToVariantEntityConverter mongoDBObjectToVariantConverter = new MongoDBObjectToVariantEntityConverter(); Variant converted = mongoDBObjectToVariantConverter.convert(mongoVariant); assertEquals(variant, converted); }
Source:
public void userAuthDevIdPermission() throws DeviceAccessAuthorizationException, UserStoreException, PermissionManagementException { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID, true); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(NON_ADMIN_ALLOWED_USER); Assert.assertTrue(deviceAccessAuthorizationService.isUserAuthorized(deviceIds.get(0), new String[]{NON_ADMIN_PERMISSION}), "Non admin user with permissions attempt to access failed"); PrivilegedCarbonContext.endTenantFlow(); }

Target:
public void userAuthDevIdPermission() throws DeviceAccessAuthorizationException, UserStoreException, PermissionManagementException { PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(NON_ADMIN_ALLOWED_USER); Assert.assertTrue(deviceAccessAuthorizationService.isUserAuthorized(deviceIds.get(0), new String[]{NON_ADMIN_PERMISSION}), "Non admin user with permissions attempt to access failed"); }
Source:
public static EventApplierMethod forEventMessage(Class<? extends Aggregate> cls, Message eventMessage) { final EventApplierMethod method = MethodRegistry.getInstance() .get(cls, eventMessage.getClass(), factory()); if (method == null) { throw missingEventApplier(cls, eventMessage.getClass()); } return method; }

Target:
public static EventApplierMethod forEventMessage(Class<? extends Aggregate> cls, Message eventMessage) { checkNotNull(cls); checkNotNull(eventMessage); final EventApplierMethod method = MethodRegistry.getInstance() .get(cls, eventMessage.getClass(), factory()); if (method == null) { throw missingEventApplier(cls, eventMessage.getClass()); } return method; }
Source:
public void sendUserListMessage(UserList userlist){ UserListMessage ulm = new UserListMessage(userlist); broadcastMessageToFans(ulm); Log.i("Messaging Service", "User List Message Sent"); }

Target:
public void sendUserListMessage(UserList userlist){ UserListMessage ulm = new UserListMessage(userlist); broadcastMessageToFans(ulm); }
Source:
private <T, O extends AbstractOptions<O>> Call getMetadataCall(MetadataOperationContext<T, O> context, Supplier<List<Call>> nextCalls) { return new Call("metadata", context.deadline(), new LeastLoadedNodeProvider()) { @Override MetadataRequest.Builder createRequest(int timeoutMs) { return new MetadataRequest.Builder(new MetadataRequestData() .setTopics(convertToMetadataRequestTopic(context.topics())) .setAllowAutoTopicCreation(false)); } @Override void handleResponse(AbstractResponse abstractResponse) { MetadataResponse response = (MetadataResponse) abstractResponse; if (MetadataOperationContext.shouldRefreshMetadata(response)) { rescheduleMetadataTask(context, nextCalls); return; } context.setResponse(Optional.of(response)); for (Call call : nextCalls.get()) { runnable.call(call, time.milliseconds()); } } @Override void handleFailure(Throwable throwable) { for (KafkaFutureImpl<T> future : context.futures().values()) { future.completeExceptionally(throwable); } } }; }

Target:
private <T, O extends AbstractOptions<O>> Call getMetadataCall(MetadataOperationContext<T, O> context, Supplier<List<Call>> nextCalls) { return new Call("metadata", context.deadline(), new LeastLoadedNodeProvider()) { @Override MetadataRequest.Builder createRequest(int timeoutMs) { return new MetadataRequest.Builder(new MetadataRequestData() .setTopics(convertToMetadataRequestTopic(context.topics())) .setAllowAutoTopicCreation(false)); } @Override void handleResponse(AbstractResponse abstractResponse) { MetadataResponse response = (MetadataResponse) abstractResponse; MetadataOperationContext.handleMetadataErrors(response); context.setResponse(Optional.of(response)); for (Call call : nextCalls.get()) { runnable.call(call, time.milliseconds()); } } @Override void handleFailure(Throwable throwable) { for (KafkaFutureImpl<T> future : context.futures().values()) { future.completeExceptionally(throwable); } } }; }
Source:
public void testCollectWithDeadTserver() throws IOException, InterruptedException { Instance i = new MockInstance(); File walDir = new File(System.getProperty("java.io.tmpdir") + File.separator + GCWAL_DEAD_DIR); File walFileDir = new File(walDir + File.separator + GCWAL_DEAD_TSERVER + "+" + GCWAL_DEAD_TSERVER_PORT); File walFile = new File(walFileDir + File.separator + GCWAL_DEAD_TSERVER_COLLECT_FILE); if (!walFileDir.exists()) { walFileDir.mkdirs(); new FileOutputStream(walFile).close(); } try { VolumeManager vm = VolumeManagerImpl.getLocal(walDir.toString()); GarbageCollectWriteAheadLogs gcwal2 = new GCWALDeadTserverCollectMock(i, vm, false); GCStatus status = new GCStatus(new GcCycleStats(), new GcCycleStats(), new GcCycleStats(), new GcCycleStats()); gcwal2.collect(status); assertTrue("File should not be deleted", walFile.exists()); assertEquals("Should have one candidate", 1, status.lastLog.getCandidates()); assertEquals("Should not have deleted that file", 0, status.lastLog.getDeleted()); sleep(2000); gcwal2.collect(status); assertFalse("File should be gone", walFile.exists()); assertEquals("Should have one candidate", 1, status.lastLog.getCandidates()); assertEquals("Should have deleted that file", 1, status.lastLog.getDeleted()); } finally { if (walDir.exists()) { FileUtils.deleteDirectory(walDir); } } }

Target:
public void testCollectWithDeadTserver() throws IOException, InterruptedException { Instance i = new MockInstance(); File walDir = new File(System.getProperty("user.dir") + File.separator + "target" + File.separator + GCWAL_DEAD_DIR); File walFileDir = new File(walDir + File.separator + GCWAL_DEAD_TSERVER + "+" + GCWAL_DEAD_TSERVER_PORT); File walFile = new File(walFileDir + File.separator + GCWAL_DEAD_TSERVER_COLLECT_FILE); if (!walFileDir.exists()) { walFileDir.mkdirs(); new FileOutputStream(walFile).close(); } try { VolumeManager vm = VolumeManagerImpl.getLocal(walDir.toString()); GarbageCollectWriteAheadLogs gcwal2 = new GCWALDeadTserverCollectMock(i, vm, false); GCStatus status = new GCStatus(new GcCycleStats(), new GcCycleStats(), new GcCycleStats(), new GcCycleStats()); gcwal2.collect(status); assertTrue("File should not be deleted", walFile.exists()); assertEquals("Should have one candidate", 1, status.lastLog.getCandidates()); assertEquals("Should not have deleted that file", 0, status.lastLog.getDeleted()); sleep(2000); gcwal2.collect(status); assertFalse("File should be gone", walFile.exists()); assertEquals("Should have one candidate", 1, status.lastLog.getCandidates()); assertEquals("Should have deleted that file", 1, status.lastLog.getDeleted()); } finally { if (walDir.exists()) { FileUtils.deleteDirectory(walDir); } } }
Source:
public void listDirectory(OCFile directory ) { FileDataStorageManager storageManager = mContainerActivity.getStorageManager(); if (storageManager != null) { if (directory == null) { if (mFile != null) { directory = mFile; } else { directory = storageManager.getFileByPath("/"); if (directory == null) { return; } } } if (!directory.isFolder()) { Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString()); directory = storageManager.getFileById(directory.getParentId()); } if(!directory.isAvailableOffline() && isShowingOnlyAvailableOffline()){ directory = storageManager.getFileByPath("/"); } mFileListAdapter.swapDirectory(directory, storageManager ); if (mFile == null || !mFile.equals(directory)) { mCurrentListView.setSelection(0); } mFile = directory; updateLayout(); } }

Target:
public void listDirectory(OCFile directory) { FileDataStorageManager storageManager = mContainerActivity.getStorageManager(); if (storageManager != null) { if (directory == null) { if (mFile != null) { directory = mFile; } else { directory = storageManager.getFileByPath(OCFile.ROOT_PATH); if (directory == null) { return; } } } if (!directory.isFolder()) { Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString()); directory = storageManager.getFileById(directory.getParentId()); } if(!directory.isAvailableOffline() && isShowingOnlyAvailableOffline()){ directory = storageManager.getFileByPath(OCFile.ROOT_PATH); } mFileListAdapter.swapDirectory(directory, storageManager); if (mFile == null || !mFile.equals(directory)) { mCurrentListView.setSelection(0); } mFile = directory; updateLayout(); } }
Source:
public static boolean isServerSideMaskingEnabled(PhoenixConnection phoenixConnection) { String isServerSideMaskingSet = phoenixConnection.getClientInfo( QueryServices.PHOENIX_TTL_SERVER_SIDE_MASKING_ENABLED); boolean isServerSideMaskingEnabled = phoenixConnection.getQueryServices() .getConfiguration().getBoolean( QueryServices.PHOENIX_TTL_SERVER_SIDE_MASKING_ENABLED, QueryServicesOptions.DEFAULT_SERVER_SIDE_MASKING_ENABLED) || ((isServerSideMaskingSet != null) && (Boolean.parseBoolean(isServerSideMaskingSet))); return isServerSideMaskingEnabled; }

Target:
public static boolean isServerSideMaskingEnabled(PhoenixConnection phoenixConnection) { String isServerSideMaskingSet = phoenixConnection.getClientInfo( QueryServices.PHOENIX_TTL_SERVER_SIDE_MASKING_ENABLED); return (phoenixConnection.getQueryServices() .getConfiguration().getBoolean( QueryServices.PHOENIX_TTL_SERVER_SIDE_MASKING_ENABLED, QueryServicesOptions.DEFAULT_SERVER_SIDE_MASKING_ENABLED) || ((isServerSideMaskingSet != null) && (Boolean.parseBoolean(isServerSideMaskingSet)))); }
Source:
private void createTreeViewer(FormToolkit toolkit, Composite activityComposite) { TreeViewer viewer = new TreeViewer(toolkit.createTree(activityComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION)); GridDataFactory.fillDefaults().hint(SWT.DEFAULT, SWT.DEFAULT).grab(true, true).applyTo(viewer.getControl()); viewer.setContentProvider(new ActivityRecordContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ActivityRecordLabelProvider(), null, null)); IActivityStream stream = new ActivityManager().getStream(new TaskActivityScope(getModel().getTask())); viewer.setInput(stream); }

Target:
private void createTreeViewer(FormToolkit toolkit, Composite activityComposite) { TreeViewer viewer = new TreeViewer(toolkit.createTree(activityComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION)); GridDataFactory.fillDefaults().hint(500, 100).grab(true, true).applyTo(viewer.getControl()); viewer.setContentProvider(new ActivityRecordContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ActivityRecordLabelProvider(), null, null)); IActivityStream stream = new ActivityManager().getStream(new TaskActivityScope(getModel().getTask())); viewer.setInput(stream); }
Source:
public void switchBoard() { if (prefs.getLastOpenBoard().isPresent() && prefs.getAllBoards().size() > 1) { List<String> boardNames = new ArrayList<>(prefs.getAllBoards().keySet()); int index = boardNames.indexOf(prefs.getLastOpenBoard().get()); if (index == boardNames.size() - 1) { index = 0; } else { index++; } onBoardOpen(boardNames.get(index), prefs.getBoardPanels(boardNames.get(index))); } }

Target:
public void switchBoard() { Optional<String> name = prefs.switchBoard(); if (name.isPresent()) { onBoardOpen(name.get(), prefs.getBoardPanels(name.get())); } }
Source:
public ContentValuesAssert contains(ContentValuesEntry... entries) { isNotEmptyOrNull(entries); Set<ContentValuesEntry> notFound = new LinkedHashSet<ContentValuesEntry>(); for (ContentValuesEntry entry : entries) { if (!containsEntry(actual, entry)) { notFound.add(entry); } } if (notFound.isEmpty()) { return this; } throw Failures.instance().failure(new WritableAssertionInfo(), shouldContain(actual, entries, notFound)); }

Target:
public ContentValuesAssert contains(ContentValuesEntry... entries) { isNotEmptyOrNull(entries); Set<ContentValuesEntry> notFound = new LinkedHashSet<ContentValuesEntry>(); for (ContentValuesEntry entry : entries) { if (!containsEntry(actual, entry)) { notFound.add(entry); } } if (!notFound.isEmpty()) { throw Failures.instance().failure(new WritableAssertionInfo(), shouldContain(actual, entries, notFound)); } return this; }
Source:
private ArrayList<LunModel> getLuns(boolean selectedLuns, boolean includedLuns) { ArrayList<LunModel> luns = new ArrayList<>(); if (getItems() != null) { if (getIsGrouppedByTarget()) { List<SanTargetModel> items = (List<SanTargetModel>) getItems(); for (SanTargetModel item : items) { aggregateAddedLuns(item.getLuns(), selectedLuns, includedLuns, luns); } } else { List<LunModel> items = (List<LunModel>) getItems(); aggregateAddedLuns(items, selectedLuns, includedLuns, luns ); } } return luns; }

Target:
private ArrayList<LunModel> getLuns(boolean selectedLuns, boolean includedLuns) { Set<LunModel> luns = new HashSet<>(); if (getItems() != null) { if (getIsGrouppedByTarget()) { List<SanTargetModel> items = (List<SanTargetModel>) getItems(); for (SanTargetModel item : items) { luns.addAll(aggregateAddedLuns(item.getLuns(), selectedLuns, includedLuns)); } } else { List<LunModel> items = (List<LunModel>) getItems(); luns.addAll(aggregateAddedLuns(items, selectedLuns, includedLuns)); } } return new ArrayList<>(luns); }