auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Image apply(VirtualGuest from) { checkNotNull(from, "from"); ImageBuilder builder = new ImageBuilder().ids(from.getId() + "") .name(from.getHostname()) .status(Image.Status.AVAILABLE); if(from.getOperatingSystem() == null) { return builder.operatingSystem( OperatingSystem.builder().description("UNRECOGNIZED").build()) .build(); } SoftwareLicense softwareLicense = from.getOperatingSystem().getSoftwareLicense(); String referenceCode = softwareLicense.getSoftwareDescription().getReferenceCode(); OsFamily osFamily = osFamily().apply(referenceCode); if (osFamily == OsFamily.UNRECOGNIZED) { logger.debug("Cannot determine os family for item: %s", from); } Integer bits = OperatingSystems.bits().apply(referenceCode); if (bits == null) { logger.debug("Cannot determine os bits for item: %s", from); } String osVersion = OperatingSystems.version().apply(softwareLicense.getSoftwareDescription().getVersion()); if (osVersion == null) { logger.debug("Cannot determine os version for item: %s", from); } OperatingSystem os = OperatingSystem.builder() .description(softwareLicense.getSoftwareDescription().getLongDescription()) .family(osFamily) .version(osVersion) .is64Bit(Objects.equal(bits, 64)) .build(); return builder.operatingSystem(os).build(); }

Target:
public Image apply(VirtualGuest from) { checkNotNull(from, "from"); if (from.getOperatingSystem() == null) { return new ImageBuilder().ids(from.getId() + "") .name(from.getHostname()) .status(Image.Status.UNRECOGNIZED) .operatingSystem(OperatingSystem.builder() .family(OsFamily.UNRECOGNIZED) .version(UNRECOGNIZED) .description(UNRECOGNIZED) .build()) .build(); } else { return operatingSystemToImage.apply(from.getOperatingSystem()); } }
Source:
protected TimeEvent createEvent(Object tuple) { int idx = 0; if (!isLeft) { idx = 1; } if (timeFields != null) { return new TimeEventImpl(getKeyValue(keys[idx], tuple), (Long)getTime(timeFields[idx], tuple), tuple); } else { return new TimeEventImpl(getKeyValue(keys[idx], tuple), Calendar.getInstance().getTimeInMillis(), tuple); } }

Target:
protected TimeEvent createEvent(Object tuple) { String key = leftStore.getKeys(); String timeField = leftStore.getTimeFields(); if (!isLeft) { key = rightStore.getKeys(); timeField = rightStore.getTimeFields(); } if (timeField != null) { return new TimeEventImpl(getKeyValue(key, tuple), (Long)getTime(timeField, tuple), tuple); } else { return new TimeEventImpl(getKeyValue(key, tuple), Calendar.getInstance().getTimeInMillis(), tuple); } }
Source:
public IId<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { return m_idExternalFormatter.get().fromExternalForm(p.readValueAs(String.class)); }

Target:
public IId<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { return m_idExternalFormatter.get().fromExternalForm(p.readValueAs(String.class)); }
Source:
private String effectiveRegistryName(DockerImageName dockerImageName) { if (isNullOrEmpty(dockerImageName.getRegistry())) { return DEFAULT_REGISTRY_NAME; } else { return dockerImageName.getRegistry(); } }

Target:
private String effectiveRegistryName(DockerImageName dockerImageName) { return StringUtils.defaultIfEmpty(dockerImageName.getRegistry(), DEFAULT_REGISTRY_NAME); }
Source:
public String removeBraces(OMAttribute atr){ String trimmed = atr.getAttributeValue().trim(); String path = trimmed.substring(1, trimmed.length()-1); return path; }}

Target:
public String removeBraces(OMAttribute atr) { String trimmed = atr.getAttributeValue().trim(); String path = trimmed.substring(1, trimmed.length() - 1); return path; }
Source:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { int endIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ']') + 1; if (endIndex > 0) { ByteBuf frame = Unpooled.buffer(); while (buf.readerIndex() < endIndex) { byte b = buf.readByte(); if (b == '}') { byte c = buf.readByte(); switch (c) { case 0x01: frame.writeByte('}'); break; case 0x02: frame.writeByte('['); break; case 0x03: frame.writeByte(']'); break; case 0x04: frame.writeByte(','); break; case 0x05: frame.writeByte('*'); break; default: throw new IllegalArgumentException(String.format( "unexpected byte at %d: 0x%02x", buf.readerIndex() - 1, c)); } } else { frame.writeByte(b); } } return frame; } return null; }

Target:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { int endIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ']') + 1; if (endIndex > 0) { ByteBuf frame = Unpooled.buffer(); while (buf.readerIndex() < endIndex) { byte b1 = buf.readByte(); if (b1 == '}') { byte b2 = buf.readByte(); switch (b2) { case 0x01: frame.writeByte('}'); break; case 0x02: frame.writeByte('['); break; case 0x03: frame.writeByte(']'); break; case 0x04: frame.writeByte(','); break; case 0x05: frame.writeByte('*'); break; default: throw new IllegalArgumentException(String.format( "unexpected byte at %d: 0x%02x", buf.readerIndex() - 1, b2)); } } else { frame.writeByte(b1); } } return frame; } return null; }
Source:
public void process() { PerformanceMonitor.startActivity("rendering/chunksAlphaReject"); chunkMaterial.activateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT); chunkMaterial.setFloat("time", worldProvider.getTime().getDays(), true); chunkMaterial.setInt("textureAtlas", 0, true); chunkMaterial.setInt("textureEffects", 1, true); chunkMaterial.setInt("textureLava", 2, true); if (isNormalMapping) { chunkMaterial.setInt("textureAtlasNormal", 3, true); if (isParallaxMapping) { chunkMaterial.setInt("textureAtlasHeight", 4, true); chunkMaterial.setFloat4("parallaxProperties", parallaxBias, parallaxScale, 0.0f, 0.0f, true); } } chunkMaterial.setFloat("clip", 0.0f, true); final Vector3f cameraPosition = activeCamera.getPosition(); int numberOfRenderedTriangles = 0; int numberOfChunksThatAreNotReadyYet = 0; while (renderQueues.chunksAlphaReject.size() > 0) { RenderableChunk chunk = renderQueues.chunksAlphaReject.poll(); if (chunk.hasMesh()) { final ChunkMesh chunkMesh = chunk.getMesh(); final Vector3f chunkPosition = chunk.getPosition().toVector3f(); chunkMesh.updateMaterial(chunkMaterial, chunkPosition, chunk.isAnimated()); numberOfRenderedTriangles += chunkMesh.render(ALPHA_REJECT, chunkPosition, cameraPosition); } else { numberOfChunksThatAreNotReadyYet++; } } worldRenderer.increaseTrianglesCount(numberOfRenderedTriangles); worldRenderer.increaseNotReadyChunkCount(numberOfChunksThatAreNotReadyYet); chunkMaterial.deactivateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT); PerformanceMonitor.endActivity(); }

Target:
public void process() { PerformanceMonitor.startActivity("rendering/chunksAlphaReject"); chunkMaterial.activateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT); chunkMaterial.setFloat("time", worldProvider.getTime().getDays(), true); chunkMaterial.setInt("textureAtlas", 0, true); chunkMaterial.setInt("textureEffects", 1, true); chunkMaterial.setInt("textureLava", 2, true); if (normalMappingIsEnabled) { chunkMaterial.setInt("textureAtlasNormal", 3, true); if (parallaxMappingIsEnabled) { chunkMaterial.setInt("textureAtlasHeight", 4, true); chunkMaterial.setFloat4("parallaxProperties", parallaxBias, parallaxScale, 0.0f, 0.0f, true); } } chunkMaterial.setFloat("clip", 0.0f, true); final Vector3f cameraPosition = activeCamera.getPosition(); int numberOfRenderedTriangles = 0; int numberOfChunksThatAreNotReadyYet = 0; while (renderQueues.chunksAlphaReject.size() > 0) { RenderableChunk chunk = renderQueues.chunksAlphaReject.poll(); if (chunk.hasMesh()) { final ChunkMesh chunkMesh = chunk.getMesh(); final Vector3f chunkPosition = chunk.getPosition().toVector3f(); chunkMesh.updateMaterial(chunkMaterial, chunkPosition, chunk.isAnimated()); numberOfRenderedTriangles += chunkMesh.render(ALPHA_REJECT, chunkPosition, cameraPosition); } else { numberOfChunksThatAreNotReadyYet++; } } worldRenderer.increaseTrianglesCount(numberOfRenderedTriangles); worldRenderer.increaseNotReadyChunkCount(numberOfChunksThatAreNotReadyYet); chunkMaterial.deactivateFeature(ShaderProgramFeature.FEATURE_ALPHA_REJECT); PerformanceMonitor.endActivity(); }
Source:
public void testUnRecommendPost() { JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID); JsonJavaObject json = previewPage.getJson(); System.out.println("aaaaaaaaaaaa "+json.getString("status")); Assert.assertTrue(json.getString("status").equals("204.0")); }

Target:
public void testUnRecommendPost() { JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID); JsonJavaObject json = previewPage.getJson(); Assert.assertTrue(json.getString("status").equals("204.0")); }
Source:
public PackingPlan pack() { int adjustments = this.numAdjustments; Map<Integer, List<InstanceId>> containerInstances = getResourceCompliantRRAllocation(); while (containerInstances == null) { if (this.numAdjustments > adjustments) { adjustments++; containerInstances = getResourceCompliantRRAllocation(); } else { return null; } } Map<String, Long> ramMap = TopologyUtils.getComponentRamMapConfig(topology); List<TopologyAPI.Config.KeyValue> topologyConfig = topology.getTopologyConfig().getKvsList(); this.paddingPercentage = TopologyUtils.getConfigWithDefault( topologyConfig, com.twitter.heron.api.Config.TOPOLOGY_CONTAINER_PADDING_PERCENTAGE, DEFAULT_CONTAINER_PADDING_PERCENTAGE); Set<PackingPlan.ContainerPlan> containerPlans = PackingUtils.buildContainerPlans( containerInstances, ramMap, this.defaultInstanceResources, paddingPercentage); return new PackingPlan(topology.getId(), containerPlans); }

Target:
public PackingPlan pack() { int adjustments = this.numAdjustments; Map<Integer, List<InstanceId>> containerInstances = getResourceCompliantRRAllocation(); while (containerInstances == null) { if (this.numAdjustments > adjustments) { adjustments++; containerInstances = getResourceCompliantRRAllocation(); } else { return null; } } Map<String, Long> ramMap = TopologyUtils.getComponentRamMapConfig(topology); Set<PackingPlan.ContainerPlan> containerPlans = PackingUtils.buildContainerPlans( containerInstances, ramMap, this.defaultInstanceResources, paddingPercentage); return new PackingPlan(topology.getId(), containerPlans); }
Source:
public QueryIterator(QueryBuilder query, int scrollSize, int maxSize, JestClient client, Parser<E> parser, String... indices) throws IOException { this.scrollSize = scrollSize; this.client = client; this.parser = parser; this.gson = new Gson(); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder() .query(query); Search.Builder searchBuilder = new Search.Builder(searchSourceBuilder.toString()) .addIndex(Seq.of(indices).toList()); if(maxSize == -1) maxSize = 10000; if (scrollSize > 0) { searchBuilder.setParameter(Parameters.SCROLL, new TimeValue(60000)); searchBuilder.setParameter(Parameters.SIZE, Math.min(maxSize, scrollSize)); } else { searchBuilder.setParameter(Parameters.SIZE, maxSize); } Search search = searchBuilder.build(); this.scrollResponse = client.execute(search); this.hits = this.scrollResponse.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits").iterator(); }

Target:
public QueryIterator(QueryBuilder query, int scrollSize, int maxSize, JestClient client, Parser<E> parser, String... indices) throws IOException { this.scrollSize = scrollSize; this.client = client; this.parser = parser; this.gson = new Gson(); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder() .query(query); Search.Builder searchBuilder = new Search.Builder(searchSourceBuilder.toString()) .addIndex(Lists.newArrayList(indices)); if(maxSize == -1) maxSize = 10000; if (scrollSize > 0) { searchBuilder.setParameter(Parameters.SCROLL, new TimeValue(60000)); searchBuilder.setParameter(Parameters.SIZE, Math.min(maxSize, scrollSize)); } else { searchBuilder.setParameter(Parameters.SIZE, maxSize); } Search search = searchBuilder.build(); this.scrollResponse = client.execute(search); this.hits = this.scrollResponse.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits").iterator(); }
Source:
private void shouldConvertConsistentlyWithThriftStructConverter(Class scroogeClass) { try { Class<? extends TBase<?, ?>> thriftClass = (Class<? extends TBase<?, ?>>)Class.forName(scroogeClass.getName().replaceFirst("parquet.scrooge.test", "parquet.thrift.test")); ThriftType.StructType structFromThriftSchemaConverter = new ThriftSchemaConverter().toStructType(thriftClass); ThriftType.StructType structFromScroogeSchemaConverter = new ScroogeStructConverter().convert(scroogeClass); assertEquals(structFromThriftSchemaConverter, structFromScroogeSchemaConverter); assertEquals(toParquetSchema(structFromThriftSchemaConverter), toParquetSchema(structFromScroogeSchemaConverter)); } catch (ClassNotFoundException e) { fail("ClassNotFoundException: " + e.getMessage()); } }

Target:
private void shouldConvertConsistentlyWithThriftStructConverter(Class scroogeClass) throws ClassNotFoundException { Class<? extends TBase<?, ?>> thriftClass = (Class<? extends TBase<?, ?>>)Class.forName(scroogeClass.getName().replaceFirst("parquet.scrooge.test", "parquet.thrift.test")); ThriftType.StructType structFromThriftSchemaConverter = new ThriftSchemaConverter().toStructType(thriftClass); ThriftType.StructType structFromScroogeSchemaConverter = new ScroogeStructConverter().convert(scroogeClass); assertEquals(toParquetSchema(structFromThriftSchemaConverter), toParquetSchema(structFromScroogeSchemaConverter)); }
Source:
private void peekEventsFromIncompleteTransactions(List<AsyncEvent<?, ?>> batch, long lastKey) { if (!mustGroupTransactionEvents()) { return; } Set<TransactionId> incompleteTransactionIdsInBatch = getIncompleteTransactionsInBatch(batch); if (incompleteTransactionIdsInBatch.size() == 0) { return; } boolean areAllEventsForTransactionsInBatch = true; for (TransactionId transactionId : incompleteTransactionIdsInBatch) { boolean areAllEventsForTransactionInBatch = false; int retries = 0; long lastKeyForTransaction = lastKey; while (!areAllEventsForTransactionInBatch && retries++ < GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES) { EventsAndLastKey eventsAndKey = peekEventsWithTransactionId(transactionId, lastKeyForTransaction); for (Object object : eventsAndKey.events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); areAllEventsForTransactionInBatch = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), event.isLastEventInTransaction(), batch.size()); } } lastKeyForTransaction = eventsAndKey.lastKey; } if (!areAllEventsForTransactionInBatch) { areAllEventsForTransactionsInBatch = false; logger.warn("Not able to retrieve all events for transaction after tries", transactionId, retries); } } if (!areAllEventsForTransactionsInBatch) { stats.incBatchesWithIncompleteTransactions(); } }

Target:
private void peekEventsFromIncompleteTransactions(List<AsyncEvent<?, ?>> batch, long lastKey) { if (!mustGroupTransactionEvents()) { return; } Set<TransactionId> incompleteTransactionIdsInBatch = getIncompleteTransactionsInBatch(batch); if (incompleteTransactionIdsInBatch.size() == 0) { return; } boolean batchHasIncompleteTransactions = true; for (TransactionId transactionId : incompleteTransactionIdsInBatch) { boolean areAllEventsForTransactionInBatch = false; int retries = 0; long lastKeyForTransaction = lastKey; while (!areAllEventsForTransactionInBatch && retries++ < GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES) { EventsAndLastKey eventsAndKey = peekEventsWithTransactionId(transactionId, lastKeyForTransaction); for (Object object : eventsAndKey.events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); areAllEventsForTransactionInBatch = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), event.isLastEventInTransaction(), batch.size()); } } lastKeyForTransaction = eventsAndKey.lastKey; } if (!areAllEventsForTransactionInBatch) { batchHasIncompleteTransactions = true; logger.warn("Not able to retrieve all events for transaction after tries", transactionId, retries); } } if (batchHasIncompleteTransactions) { stats.incBatchesWithIncompleteTransactions(); } }
Source:
public static List<URL> getFilesInPath(URL fileURL) throws MalformedURLException { List<URL> urls = new ArrayList<>(); File file = new File(fileURL.getPath()); if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File innerFile : files) { if (innerFile.isFile()) { if (!innerFile.toString().endsWith("crc")) { urls.add(innerFile.toURI().toURL()); } } else { urls.addAll(getFilesInPath(file.toURI().toURL())); } } } if (!fileURL.toString().endsWith("/")) { fileURL = new URL(fileURL.toString() + "/"); } } urls.add(fileURL); return urls; }

Target:
public static List<URL> getFilesInPath(URL fileURL) throws MalformedURLException { List<URL> urls = new ArrayList<>(); File file = new File(fileURL.getPath()); if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File innerFile : files) { if (innerFile.isFile()) { urls.add(innerFile.toURI().toURL()); } else { urls.addAll(getFilesInPath(file.toURI().toURL())); } } } if (!fileURL.toString().endsWith("/")) { fileURL = new URL(fileURL.toString() + "/"); } } urls.add(fileURL); return urls; }
Source:
public void onProjectIndexingFinishedEvent(@Observes IndexingFinishedEvent event) { newProjectIndexed = true; if (newProjectPath != null && newProjectPath.equals(event.getPath())) { projectService.call((WorkspaceProject project) -> { endProjectCreation(); getSuccessCallback().execute(project); }).resolveProject(event.getPath()); } }

Target:
public void onProjectIndexingFinishedEvent(@Observes IndexingFinishedEvent event) { projectsIndexed.add(event.getPath()); if (newProjectPath != null && newProjectPath.equals(event.getPath())) { projectService.call((WorkspaceProject project) -> { endProjectCreation(); getSuccessCallback().execute(project); }, (o, throwable) -> { logger.info("Project path " + event.getPath().toURI() + " not found."); return false; }).resolveProject(event.getPath()); } }
Source:
public void processLeftData(final MistDataEvent input) { inputTimestampCheck(input.getTimestamp()); final Iterator<Window<T>> itr = windowQueue.iterator(); while (itr.hasNext()) { final Window<T> window = itr.next(); window.putData(input); } }

Target:
public void processLeftData(final MistDataEvent input) { createWindow(input.getTimestamp()); emitElapsedWindow(input.getTimestamp()); final Iterator<Window<T>> itr = windowQueue.iterator(); while (itr.hasNext()) { final Window<T> window = itr.next(); window.putData(input); } }
Source:
public RuleModel unmarshal( final String str, final List<String> globals, final PackageDataModelOracle dmo ) { return unmarshal( str, globals, dmo, null ); }

Target:
public RuleModel unmarshal(final String str, final List<String> globals, final PackageDataModelOracle dmo) { return unmarshal(str, globals, dmo, Collections.emptyList()); }
Source:
private static void usage() { log.debug("usage: [-namespace namespace] [-dump] [-extentSize dstJournalSize] propertyFile"); System.exit(1); }

Target:
private static void usage() { System.err.println("Usage: [-namespace namespace] [-dump] [-verify] [-extentSize dstJournalSize] propertyFile"); System.exit(1); }
Source:
public static String format(Throwable t) { StringWriter sw = new StringWriter(); log.error(t); return t + "\n" + sw.toString(); }

Target:
public static String format(Throwable t) { return t + "\n" + ExceptionUtils.getStackTrace(t); }
Source:
public void updateDynamicData(VdsDynamic dynamicData) { vdsDynamicDao.update(dynamicData); cachedVds.setDynamicData(dynamicData); cachedDynamicDataHash = dynamicData.dbFieldsHash(); }

Target:
public void updateDynamicData(VdsDynamic dynamicData) { vdsDynamicDao.updateIfNeeded(dynamicData); cachedVds.setDynamicData(dynamicData); }
Source:
private void addAllCustomLayoutChildDescriptors(Collection<Object> newChildDescriptors) { Map<String, GenericLayoutProviderSupplier> layoutProviderRegistry = DiagramUIPlugin.getPlugin().getLayoutProviderRegistry(); Set<Entry<String, GenericLayoutProviderSupplier>> layoutProviders = layoutProviderRegistry.entrySet(); for (Entry<String, GenericLayoutProviderSupplier> layoutProviderEntry : layoutProviders) { GenericLayout newGenericLayout = DescriptionFactory.eINSTANCE.createGenericLayout(); newGenericLayout.setID(layoutProviderEntry.getKey()); newGenericLayout.setLabel(layoutProviderEntry.getValue().getLabel()); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.DIAGRAM_DESCRIPTION__LAYOUT, newGenericLayout)); } }

Target:
private void addAllCustomLayoutChildDescriptors(Collection<Object> newChildDescriptors) { Map<String, GenericLayoutProviderSupplier> layoutProviderRegistry = DiagramUIPlugin.getPlugin().getLayoutProviderRegistry(); layoutProviderRegistry.forEach((key, value) -> { CustomLayoutConfiguration customConfiguration = DescriptionFactory.eINSTANCE.createCustomLayoutConfiguration(); customConfiguration.setId(key); customConfiguration.setLabel(value.getLabel()); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.DIAGRAM_DESCRIPTION__LAYOUT, customConfiguration)); }); }
Source:
public String open() { checkOperationMode(); prepareOpen(); if (this.clientFiles!=null){ handleFileDrop( clientFiles ); } runEventLoop( shell ); return returnCode == SWT.OK ? getFileName() : null; }

Target:
public String open() { checkOperationMode(); prepareOpen(); beforeOpen(); runEventLoop( shell ); return returnCode == SWT.OK ? getFileName() : null; }
Source:
public void testCombineMany() { int n = RxRingBuffer.SIZE * 3; Observable<Integer> source = Observable.just(1); List<Observable<Integer>> sources = new ArrayList<Observable<Integer>>(); for (int i = 0; i < n; i++) { sources.add(source); } TestSubscriber<Integer> ts = TestSubscriber.create(); Observable.combineLatest(sources, new FuncN<Integer>() { @Override public Integer call(Object... args) { int sum = 0; for (Object o : args) { sum += (Integer)o; } return sum; } }).subscribe(ts); ts.assertNoErrors(); ts.assertValue(n); ts.assertCompleted(); }

Target:
public void testCombineMany() { int n = RxRingBuffer.SIZE * 3; List<Observable<Integer>> sources = new ArrayList<Observable<Integer>>(); StringBuilder expected = new StringBuilder(n * 2); for (int i = 0; i < n; i++) { sources.add(Observable.just(i)); expected.append(i); } TestSubscriber<String> ts = TestSubscriber.create(); Observable.combineLatest(sources, new FuncN<String>() { @Override public String call(Object... args) { StringBuilder b = new StringBuilder(); for (Object o : args) { b.append(o); } return b.toString(); } }).subscribe(ts); ts.assertNoErrors(); ts.assertValue(expected.toString()); ts.assertCompleted(); }
Source:
private IAction findContributedAction(String actionID) { List<IConfigurationElement> actions= new ArrayList<>(); IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(PlatformUI.PLUGIN_ID, "editorActions"); for (int i= 0; i < elements.length; i++) { IConfigurationElement element= elements[i]; if (TAG_CONTRIBUTION_TYPE.equals(element.getName())) { if (getSite() != null && !getSite().getId().equals(element.getAttribute("targetID"))) continue; IConfigurationElement[] children= element.getChildren("action"); for (int j= 0; j < children.length; j++) { IConfigurationElement child= children[j]; if (actionID.equals(child.getAttribute("actionID"))) actions.add(child); } } } int actionSize= actions.size(); if (actionSize > 0) { IConfigurationElement element; if (actionSize > 1) { IConfigurationElement[] actionArray= actions.toArray(new IConfigurationElement[actionSize]); ConfigurationElementSorter sorter= new ConfigurationElementSorter() { @Override public IConfigurationElement getConfigurationElement(Object object) { return (IConfigurationElement)object; } }; sorter.sort(actionArray); element= actionArray[0]; } else element= actions.get(0); try { return new ContributedAction(getSite(), element); } catch (CommandNotMappedException e) { } } return null; }

Target:
private IAction findContributedAction(String actionID) { List<IConfigurationElement> actions= new ArrayList<>(); IConfigurationElement[] elements= Platform.getExtensionRegistry().getConfigurationElementsFor(PlatformUI.PLUGIN_ID, "editorActions"); for (int i= 0; i < elements.length; i++) { IConfigurationElement element= elements[i]; if (TAG_CONTRIBUTION_TYPE.equals(element.getName())) { IWorkbenchPartSite site = getSite(); if (site != null && !site.getId().equals(element.getAttribute("targetID"))) continue; IConfigurationElement[] children= element.getChildren("action"); for (int j= 0; j < children.length; j++) { IConfigurationElement child= children[j]; if (actionID.equals(child.getAttribute("actionID"))) actions.add(child); } } } int actionSize= actions.size(); if (actionSize > 0) { IConfigurationElement element; if (actionSize > 1) { IConfigurationElement[] actionArray= actions.toArray(new IConfigurationElement[actionSize]); ConfigurationElementSorter sorter= new ConfigurationElementSorter() { @Override public IConfigurationElement getConfigurationElement(Object object) { return (IConfigurationElement)object; } }; sorter.sort(actionArray); element= actionArray[0]; } else element= actions.get(0); try { return new ContributedAction(getSite(), element); } catch (CommandNotMappedException e) { } } return null; }
Source:
public int getItemViewType(int position) { if (position == 0) { return RowType.RESPONSE; } if (progressVisible && position == getItemCount() - 1) { return RowType.PROGRESS; } return RowType.COMMENT; }

Target:
public int getItemViewType(int position) { if (progressVisible && position == getItemCount() - 1) { return RowType.PROGRESS; } if (position == 0) { return RowType.RESPONSE; } return RowType.COMMENT; }
Source:
private AbstractTextEditor getActiveTextEditor() { IWorkbench workbench = PlatformUI.getWorkbench(); IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor(); AbstractTextEditor textEditor = null; if (editor instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor)editor; } else if ((editor instanceof AbstractMultiEditor) && ((AbstractMultiEditor)editor).getActiveEditor() instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor) ((AbstractMultiEditor)editor).getActiveEditor(); } else if ((editor instanceof MultiPageEditorPart) && ((MultiPageEditorPart)editor).getSelectedPage() instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor) ((MultiPageEditorPart)editor).getSelectedPage(); } return textEditor; }

Target:
private AbstractTextEditor getActiveTextEditor() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow(); if (activeWorkbenchWindow == null) { return null; } IPartService partService = activeWorkbenchWindow.getPartService(); if (partService == null) { return null; } IWorkbenchPart part = partService.getActivePart(); AbstractTextEditor textEditor = null; if (part instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor)part; } else if ((part instanceof AbstractMultiEditor) && ((AbstractMultiEditor)part).getActiveEditor() instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor) ((AbstractMultiEditor)part).getActiveEditor(); } else if ((part instanceof MultiPageEditorPart) && ((MultiPageEditorPart)part).getSelectedPage() instanceof AbstractTextEditor) { textEditor = (AbstractTextEditor) ((MultiPageEditorPart)part).getSelectedPage(); } return textEditor; }
Source:
public static ColumnValueSelector makeColumnValueSelectorWithLongDefault( final ColumnSelectorFactory metricFactory, final ExprMacroTable macroTable, final String fieldName, final String fieldExpression, final long nullValue ) { if (fieldName != null && fieldExpression == null) { return metricFactory.makeColumnValueSelector(fieldName); } if (fieldName == null && fieldExpression != null) { final Expr expr = Parser.parse(fieldExpression, macroTable); final ColumnValueSelector<ExprEval> baseSelector = ExpressionSelectors.makeExprEvalSelector(metricFactory, expr); class ExpressionLongColumnSelector implements LongColumnSelector { @Override public long getLong() { final ExprEval exprEval = baseSelector.getObject(); return exprEval.isNumericNull() ? nullValue : exprEval.asLong(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("baseSelector", baseSelector); } @Override public boolean isNull() { final ExprEval exprEval = baseSelector.getObject(); return exprEval == null || exprEval.isNumericNull(); } } return new ExpressionLongColumnSelector(); } throw new IllegalArgumentException("Must have a valid, non-null fieldName or expression"); }

Target:
public static BaseLongColumnValueSelector makeColumnValueSelectorWithLongDefault( final ColumnSelectorFactory metricFactory, final ExprMacroTable macroTable, final String fieldName, final String fieldExpression, final long nullValue ) { if (fieldName != null && fieldExpression == null) { return metricFactory.makeColumnValueSelector(fieldName); } if (fieldName == null && fieldExpression != null) { final Expr expr = Parser.parse(fieldExpression, macroTable); final ColumnValueSelector<ExprEval> baseSelector = ExpressionSelectors.makeExprEvalSelector(metricFactory, expr); class ExpressionLongColumnSelector implements LongColumnSelector { @Override public long getLong() { final ExprEval exprEval = baseSelector.getObject(); return exprEval.isNumericNull() ? nullValue : exprEval.asLong(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("baseSelector", baseSelector); } @Override public boolean isNull() { final ExprEval exprEval = baseSelector.getObject(); return exprEval == null || exprEval.isNumericNull(); } } return new ExpressionLongColumnSelector(); } throw new IllegalArgumentException("Must have a valid, non-null fieldName or expression"); }
Source:
public void set_project_without_branch() { IssueChangeNotification result = notification.setProject("MyService", "My Service", null, ""); assertThat(result.getFieldValue("projectKey")).isEqualTo("MyService"); assertThat(result.getFieldValue("projectName")).isEqualTo("My Service"); assertThat(result.getFieldValue("branch")).isNull(); }

Target:
public void set_project_without_branch() { IssueChangeNotification result = notification.setProject("MyService", "My Service", null, "uuid1"); assertThat(result.getFieldValue("projectKey")).isEqualTo("MyService"); assertThat(result.getFieldValue("projectUuid")).isEqualTo("uuid1"); assertThat(result.getFieldValue("projectName")).isEqualTo("My Service"); assertThat(result.getFieldValue("branch")).isNull(); }
Source:
public void testFactoryFailedToCreateDriver() { final Configuration config = new Configuration(); final String driverFactoryClassName = TestingFailedExternalResourceDriverFactory.class.getName(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingFailedExternalResourceDriverFactory())); final PluginManager testingPluginManagerPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); config.setString(ExternalResourceOptions.keyWithResourceNameAndSuffix(RESOURCE_NAME_1, ExternalResourceOptions.EXTERNAL_RESOURCE_DRIVER_FACTORY_SUFFIX), driverFactoryClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManagerPluginManager); assertThat(externalResourceDrivers.size(), is(0)); }

Target:
public void testFactoryFailedToCreateDriver() { final Configuration config = new Configuration(); final String driverFactoryClassName = TestingFailedExternalResourceDriverFactory.class.getName(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingFailedExternalResourceDriverFactory())); final PluginManager testingPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); config.setString(ExternalResourceOptions.getExternalResourceDriverFactoryConfigOptionForResource(RESOURCE_NAME_1), driverFactoryClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager); assertThat(externalResourceDrivers.entrySet(), is(empty())); }
Source:
protected void stopProcessing(IgniteCheckedException stopErr) { try { busyLock.block(); ctx.event().removeDiscoveryEventListener(discoLsnr); ctx.io().removeMessageListener(commLsnr); U.cancel(depWorker); U.join(depWorker, log); depWorker.tasksQueue.clear(); pendingEvts.clear(); tasks.values().forEach(t -> t.completeError(stopErr)); tasks.clear(); } catch (Exception e) { log.error("Error occurred during stopping deployment worker.", e); } }

Target:
void stopProcessing(IgniteCheckedException stopErr) { busyLock.block(); ctx.event().removeDiscoveryEventListener(discoLsnr); ctx.io().removeMessageListener(commLsnr); U.cancel(depWorker); U.join(depWorker, log); depWorker.tasksQueue.clear(); pendingEvts.clear(); tasks.values().forEach(t -> t.completeError(stopErr)); tasks.clear(); }
Source:
private LogMessage convertBean(final LogEntryBean bean) { final LogMessage message = new LogMessage(); message.setMessage(bean.getMessage()); message.setLevel(bean.getLogLevel()); message.setTimestamp(bean.getLogTimestamp()); return message; }

Target:
private LogMessage convertBean(final LogEntryBean bean) { Assert.requireNonNull(bean, "bean"); final LogMessage message = new LogMessage(); message.setMessage(bean.getMessage()); message.setLevel(bean.getLogLevel()); message.setTimestamp(bean.getLogTimestamp()); return message; }
Source:
public void testInsertTemplateToUnregisteredEntity() { dao = dbFacade.getUnregisteredOVFDataDao(); final String ovfExtraData = "<ovf> Some extra OVF data </ovf>"; dao.insertOVFDataForEntities(FixturesTool.VM_TEMPLATE_RHEL5, "Stam", "TEMPLATE", 1, "3.4", FixturesTool.STORAGE_DOAMIN_NFS2_1, ovfExtraData); OvfEntityData ovfEntityData = dao.getByEntityIdAndStorageDomain(FixturesTool.VM_TEMPLATE_RHEL5, FixturesTool.STORAGE_DOAMIN_NFS2_1); assertNotNull(ovfEntityData); assertTrue("The entity type should be template", ovfEntityData.getEntityType().equals("TEMPLATE")); assertTrue("The entity OVF extra data should be updated", ovfEntityData.getOvfExtraData() .equals(ovfExtraData)); }

Target:
public void testInsertTemplateToUnregisteredEntity() { final String ovfExtraData = "<ovf> Some extra OVF data </ovf>"; OvfEntityData ovfEntityData = new OvfEntityData(FixturesTool.VM_TEMPLATE_RHEL5, "AnyVM", VmEntityType.TEMPLATE, ArchitectureType.x86_64, Version.v3_4, FixturesTool.STORAGE_DOAMIN_NFS2_1, null, ovfExtraData); dao.insertOVFDataForEntities(ovfEntityData); OvfEntityData fetchedOvfEntityData = dao.getByEntityIdAndStorageDomain(FixturesTool.VM_TEMPLATE_RHEL5, FixturesTool.STORAGE_DOAMIN_NFS2_1); assertNotNull(fetchedOvfEntityData); assertTrue("The entity type should be template", fetchedOvfEntityData.getEntityType().isTemplateType()); assertTrue("The entity OVF extra data should be updated", fetchedOvfEntityData.getOvfExtraData() .equals(ovfExtraData)); }
Source:
public <T, Q> SearchQueryResultContext<Q> queryAsProjections( SessionContextImplementor sessionContext, ObjectLoader<R, O> objectLoader, Function<List<?>, T> hitTransformer, Function<SearchQuery<T>, Q> searchQueryWrapperFactory, SearchProjection<?>... projections) { HitAggregator<ProjectionHitCollector, List<T>> hitAggregator = new MultipleProjectionHitAggregator<>( documentReferenceTransformer, objectLoader, hitTransformer, projections.length ); SearchQueryBuilder<T, C> builder = searchTargetContext.getSearchQueryBuilderFactory() .asProjections( sessionContext, hitAggregator, projections ); return new SearchQueryResultContextImpl<>( searchTargetContext, builder, searchQueryWrapperFactory ); }

Target:
public <T, Q> SearchQueryResultContext<Q> queryAsProjections( SessionContextImplementor sessionContext, ObjectLoader<R, O> objectLoader, Function<List<?>, T> hitTransformer, Function<SearchQuery<T>, Q> searchQueryWrapperFactory, SearchProjection<?>... projections) { HitAggregator<ProjectionHitCollector, List<T>> hitAggregator = new MultipleProjectionsHitAggregator<>( documentReferenceTransformer, objectLoader, hitTransformer, projections.length ); SearchQueryBuilder<T, C> builder = searchTargetContext.getSearchQueryBuilderFactory() .asProjections( sessionContext, hitAggregator, projections ); return new SearchQueryResultContextImpl<>( searchTargetContext, builder, searchQueryWrapperFactory ); }
Source:
public void untrackedFileIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate() .setIncludeUntracked(true).call(); assertNotNull(stashed); validateStashedCommitWithAdditionalParent(stashed); assertEquals( "Expected commits for workingDir,stashedIndex and untrackedFiles.", 3, stashed.getParentCount()); assertFalse("untracked file should be deleted.", untrackedFile.exists()); }

Target:
public void untrackedFileIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate() .setIncludeUntracked(true).call(); validateStashedCommit(stashed, 3); assertEquals( "Expected commits for workingDir,stashedIndex and untrackedFiles.", 3, stashed.getParentCount()); assertFalse("untracked file should be deleted.", untrackedFile.exists()); }
Source:
public int compare(Integer index1, Integer index2) { if (dataArr[index2] > dataArr[index1]) { return -1; } else if (dataArr[index2] < dataArr[index1]) { return 1; } else { return 0; } }

Target:
public int compare(Integer index1, Integer index2) { return Double.compare(dataArr[index1], dataArr[index2]); }
Source:
public ResponseEntity formLogin(Authentication authentication) { if (authentication == null || !authentication.isAuthenticated()) { throw new InsufficientAuthenticationException("unauthorized"); } if (!(authentication instanceof UsernamePasswordAuthenticationToken)) { return toResponseEntityError("Unsupported authentication class " + authentication.getClass().getName()); } String token; try { Object principal = authentication.getPrincipal(); String subject; if (principal instanceof UserDetails) { subject = ((UserDetails) principal).getUsername(); } else { subject = principal.toString(); } Integer timeout = configurationManagementService.getConfiguration().getSessionConfiguration().getTimeoutSeconds(); token = securityTokenProvider.getToken(subject, Collections.emptyMap(), timeout); } catch (JoseException e) { logger.error("Unable to create JWT token.", e); return toResponseEntityError("Unable to create JWT token.", HttpStatus.BAD_REQUEST); } return ResponseEntity.ok().body(new LoginOutput(token, authentication.getAuthorities())); }

Target:
public ResponseEntity formLogin(Authentication authentication) { if (authentication == null || !authentication.isAuthenticated()) { throw new InsufficientAuthenticationException("unauthorized"); } if (!(authentication instanceof UsernamePasswordAuthenticationToken)) { return toResponseEntityError("Unsupported authentication class " + authentication.getClass().getName()); } String token; try { Object principal = authentication.getPrincipal(); String subject; if (principal instanceof UserDetails) { subject = ((UserDetails) principal).getUsername(); } else { subject = principal.toString(); } Integer timeout = configurationManager.getSessionTimeoutSeconds(); token = securityTokenProvider.getToken(subject, Collections.emptyMap(), timeout); } catch (JoseException e) { logger.error("Unable to create JWT token.", e); return toResponseEntityError("Unable to create JWT token.", HttpStatus.BAD_REQUEST); } return ResponseEntity.ok().body(new LoginOutput(token, authentication.getAuthorities())); }
Source:
private synchronized Object getLock( final List<String> key ) { Object lock = syncMap.putIfAbsent( key, new Object() ); if ( lock == null ) { lock = syncMap.get( key ); } return lock; }

Target:
private synchronized ReentrantReadWriteLock getLock( final List<String> key ) { ReentrantReadWriteLock lock = new ReentrantReadWriteLock( true ); ReentrantReadWriteLock existing = syncMap.putIfAbsent(key, lock); return existing != null ? existing : lock; }
Source:
public synchronized void onRecordsReceived(@NotNull final ConsumerRecords<?, ?> records, @NotNull final Map<MetricName, ? extends Metric> metrics) { final Instant receivedTime = Instant.now(); for (final TopicPartition topicPartition : records.partitions()) { final KafkaPositionKey key = _ownedKeys.get(topicPartition); if (key == null) { return; } final KafkaPositionValue value = (KafkaPositionValue) _positions.get(key); if (value == null) { return; } long consumerOffset = Long.MIN_VALUE; Instant lastRecordPolledTimestamp = null; for (final ConsumerRecord<?, ?> record : records.records(topicPartition)) { long recordOffset = record.offset(); if (consumerOffset <= recordOffset) { consumerOffset = recordOffset + 1; lastRecordPolledTimestamp = Instant.ofEpochMilli(record.timestamp()); } } value.setLastNonEmptyPollTime(receivedTime); value.setConsumerOffset(consumerOffset); value.setLastRecordPolledTimestamp(lastRecordPolledTimestamp); Long consumerLag = getLagMetric(metrics, topicPartition); if (consumerLag != null) { final long brokerOffset = consumerOffset + consumerLag; value.setLastBrokerQueriedTime(receivedTime); value.setBrokerOffset(brokerOffset); } if (!_needingInit.isEmpty()) { _needingInit.remove(topicPartition); } } }

Target:
public synchronized void onRecordsReceived(@NotNull final ConsumerRecords<?, ?> records, @NotNull final Map<MetricName, ? extends Metric> metrics) { final Instant receivedTime = Instant.now(); for (final TopicPartition topicPartition : records.partitions()) { final KafkaPositionKey key = _ownedKeys.computeIfAbsent(topicPartition, s -> new KafkaPositionKey(topicPartition.topic(), topicPartition.partition(), BrooklinInstanceInfo.getInstanceName(), _datastreamTaskPrefix, _datastreamTaskName, _connectorTaskStartTime)); final KafkaPositionValue value = (KafkaPositionValue) _positions.computeIfAbsent(key, s -> new KafkaPositionValue()); records.records(topicPartition).stream() .max(Comparator.comparingLong(ConsumerRecord::offset)) .ifPresent(record -> { value.setLastNonEmptyPollTime(receivedTime); value.setConsumerOffset(record.offset() + 1); value.setLastRecordReceivedTimestamp(Instant.ofEpochMilli(record.timestamp())); }); getLagMetric(metrics, topicPartition).ifPresent(consumerLag -> Optional.ofNullable(value.getConsumerOffset()).ifPresent(consumerOffset -> { final long brokerOffset = consumerOffset + consumerLag; value.setLastBrokerQueriedTime(receivedTime); value.setBrokerOffset(brokerOffset); })); _needingInit.remove(topicPartition); } }
Source:
boolean isEmptySpace(World world, BlockPos pos, TileEntity tile) { BlockState state = world.getBlockState(pos); VoxelShape shape = state.getCollisionShape(world, pos); if (shape != cachedDownShape) { cachedOpenBelow = VoxelShapes.compare(REQ_SPACE, shape, IBooleanFunction.AND); cachedDownShape = shape; } return cachedOpenBelow; }

Target:
boolean isEmptySpace(World world, BlockPos pos, TileEntity tile) { if(tile instanceof IConveyorTile) return true; BlockState state = world.getBlockState(pos); VoxelShape shape = state.getCollisionShape(world, pos); if (shape != cachedDownShape) { cachedOpenBelow = !VoxelShapes.compare(REQUIRED_SPACE, shape, IBooleanFunction.AND); cachedDownShape = shape; } return cachedOpenBelow; }
Source:
public List<RevCommit> getBaseCommits(final int aIdx, final int bIdx) throws IncorrectObjectTypeException, IOException { if (sourceCommits[aIdx] == null) throw new IncorrectObjectTypeException(sourceObjects[aIdx], Constants.TYPE_COMMIT); if (sourceCommits[bIdx] == null) throw new IncorrectObjectTypeException(sourceObjects[bIdx], Constants.TYPE_COMMIT); walk.reset(); walk.setRevFilter(RevFilter.MERGE_BASE); walk.markStart(sourceCommits[aIdx]); walk.markStart(sourceCommits[bIdx]); List<RevCommit> bases = new ArrayList<RevCommit>(); int commitIdx = 0; for (RevCommit base : walk) { if (commitIdx < MAX_BASES) { bases.add(base); commitIdx++; } else { throw new IOException(MessageFormat.format( JGitText.get().mergeRecursiveTooManyMergeBasesFor, "TOO_MANY_BASES", sourceCommits[aIdx].name(), sourceCommits[bIdx].name(), Integer.valueOf(commitIdx), base.name())); } } return bases; }

Target:
public List<RevCommit> getBaseCommits(final int aIdx, final int bIdx) throws IncorrectObjectTypeException, IOException { if (sourceCommits[aIdx] == null) throw new IncorrectObjectTypeException(sourceObjects[aIdx], Constants.TYPE_COMMIT); if (sourceCommits[bIdx] == null) throw new IncorrectObjectTypeException(sourceObjects[bIdx], Constants.TYPE_COMMIT); walk.reset(); walk.setRevFilter(RevFilter.MERGE_BASE); walk.markStart(sourceCommits[aIdx]); walk.markStart(sourceCommits[bIdx]); List<RevCommit> bases = new ArrayList<RevCommit>(); int commitIdx = 0; for (RevCommit base : walk) { if (commitIdx < MAX_BASES) { bases.add(base); commitIdx++; } else { throw new IOException(MessageFormat.format( JGitText.get().mergeRecursiveTooManyMergeBasesFor, Integer.valueOf(MAX_BASES), sourceCommits[aIdx].name(), sourceCommits[bIdx].name(), Integer.valueOf(commitIdx), base.name())); } } return bases; }
Source:
private void toggleHtmlMode() { mEditorFragmentListener.onTrackableEvent(TrackableEvent.HTML_BUTTON_TAPPED); mEditorFragmentListener.onHtmlModeToggledInToolbar(); mHtmlModeEnabled = !mHtmlModeEnabled; mWPAndroidGlueCode.toggleEditorMode(); }

Target:
private void toggleHtmlMode() { mHtmlModeEnabled = !mHtmlModeEnabled; mEditorFragmentListener.onTrackableEvent(TrackableEvent.HTML_BUTTON_TAPPED); mEditorFragmentListener.onHtmlModeToggledInToolbar(); mWPAndroidGlueCode.toggleEditorMode(); }
Source:
private List<SchemaTableName> listTables(ConnectorSession session, SchemaTablePrefix prefix) { if (prefix.getTableName() == null) { return listTables(session, prefix.getSchemaName()); } return ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); }

Target:
private List<SchemaTableName> listTables(ConnectorSession session, SchemaTablePrefix prefix) { if (prefix.getSchemaName() == null || prefix.getTableName() == null) { return listTables(session, prefix.getSchemaName()); } return ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); }
Source:
public void testSetAndGetExtendedResourcesWithoutYarnSupport() { assumeTrue(HadoopUtils.isMaxHadoopVersion(3, 0)); final Resource resource = Resource.newInstance(100, 1); ResourceInformationReflector.INSTANCE.setResourceInformation(resource, RESOURCE_NAME, RESOURCE_VALUE); final Map<String, Long> externalResourcesResult = ResourceInformationReflector.INSTANCE.getExternalResources(resource); assertTrue(externalResourcesResult.isEmpty()); }

Target:
public void testSetAndGetExtendedResourcesWithoutYarnSupport() { assumeTrue(HadoopUtils.isMaxHadoopVersion(2, 10)); final Resource resource = Resource.newInstance(100, 1); ResourceInformationReflector.INSTANCE.setResourceInformation(resource, RESOURCE_NAME, RESOURCE_VALUE); final Map<String, Long> externalResourcesResult = ResourceInformationReflector.INSTANCE.getExternalResources(resource); assertTrue(externalResourcesResult.isEmpty()); }