auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public TmfModelResponse<List<ColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<ColumnDataModel> model = new ArrayList<>(); long startTimeColumnId = fAtomicLong.getAndIncrement(); model.add(new ColumnDataModel(startTimeColumnId, -1, "Start Time", "", false)); fComparatorMap.put(startTimeColumnId, SegmentComparators.INTERVAL_START_COMPARATOR); long endTimeColumnId = fAtomicLong.getAndIncrement(); model.add(new ColumnDataModel(endTimeColumnId, -1, "End Time", "", false)); fComparatorMap.put(endTimeColumnId, SegmentComparators.INTERVAL_END_COMPARATOR); long durationColumnId = fAtomicLong.getAndIncrement(); model.add(new ColumnDataModel(durationColumnId, -1, "Duration", "", false)); fComparatorMap.put(durationColumnId, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); for (ISegmentAspect segmentAspect : fSegmentStoreProvider.getSegmentAspects()) { Long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new ColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText(), false)); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }

Target:
public TmfModelResponse<List<SegmentStoreTableColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<SegmentStoreTableColumnDataModel> model = new ArrayList<>(); long startTimeColumnId = fAtomicLong.getAndIncrement(); model.add(new SegmentStoreTableColumnDataModel(startTimeColumnId, -1, NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnName_StartTime), NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnTooltip_StartTime))); fComparatorMap.put(startTimeColumnId, SegmentComparators.INTERVAL_START_COMPARATOR); long endTimeColumnId = fAtomicLong.getAndIncrement(); model.add(new SegmentStoreTableColumnDataModel(endTimeColumnId, -1, NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnName_EndTime), NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnTooltip_EndTime))); fComparatorMap.put(endTimeColumnId, SegmentComparators.INTERVAL_END_COMPARATOR); long durationColumnId = fAtomicLong.getAndIncrement(); model.add(new SegmentStoreTableColumnDataModel(durationColumnId, -1, NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnName_Duration), NonNullUtils.nullToEmptyString(Messages.SegmentStoreTableColumnTooltip_Duration))); fComparatorMap.put(durationColumnId, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); for (ISegmentAspect segmentAspect : fSegmentStoreProvider.getSegmentAspects()) { long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText())); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
public Response reindex(String vocabularyId, String url) { String[] schemes = { "http", "https", "ftp", "file" }; UrlValidator urlValidator = new UrlValidator(schemes); if (!urlValidator.isValid(url)) { return Response.status(Response.Status.BAD_REQUEST).build(); } if (!this.userIsAdmin()) { return Response.status(Response.Status.FORBIDDEN).build(); } Vocabulary vocabulary = this.vm.getVocabulary(vocabularyId); if (vocabulary == null) { return Response.status(Response.Status.NOT_FOUND).build(); } Response result; try { int reindexStatus = vocabulary.reindex(url); if (reindexStatus == 0) { result = Response.ok().build(); } else if (reindexStatus == 1) { result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } else { result = Response.status(Response.Status.BAD_REQUEST).build(); } } catch (UnsupportedOperationException e) { result = Response.status(Response.Status.SERVICE_UNAVAILABLE).build(); } return result; }

Target:
public Response reindex(String vocabularyId, String url) { String[] schemes = { "http", "https", "ftp", "file" }; UrlValidator urlValidator = new UrlValidator(schemes); if (!urlValidator.isValid(url) || !exists(url)) { return Response.status(Response.Status.BAD_REQUEST).build(); } if (!this.userIsAdmin()) { return Response.status(Response.Status.FORBIDDEN).build(); } Vocabulary vocabulary = this.vm.getVocabulary(vocabularyId); if (vocabulary == null) { return Response.status(Response.Status.NOT_FOUND).build(); } Response result; try { int reindexStatus = vocabulary.reindex(url); if (reindexStatus == 0) { result = Response.ok().build(); } else if (reindexStatus == 1) { result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } else { result = Response.status(Response.Status.BAD_REQUEST).build(); } } catch (UnsupportedOperationException e) { result = Response.status(Response.Status.SERVICE_UNAVAILABLE).build(); } return result; }
Source:
public XBeeIMEIAddress(String address) { if (address == null) throw new NullPointerException(ERROR_IMEI_NULL); Pattern p = Pattern.compile(IMEI_PATTERN); Matcher m = p.matcher(address); if (!m.matches()) throw new IllegalArgumentException(ERROR_IMEI_INVALID); byte[] byteAddress = HexUtils.hexStringToByteArray(address); generateByteAddress(byteAddress); }

Target:
public XBeeIMEIAddress(String address) { if (address == null) throw new NullPointerException(ERROR_IMEI_NULL); if (!Pattern.matches(IMEI_PATTERN, address)) throw new IllegalArgumentException(ERROR_IMEI_INVALID); byte[] byteAddress = HexUtils.hexStringToByteArray(address); generateByteAddress(byteAddress); }
Source:
private void MakeResultText(ResultSet res, TableDesc desc) throws SQLException { ResultSetMetaData rsmd = res.getMetaData(); resultRows = desc.getStats() == null ? 0 : desc.getStats().getNumRows(); if (resultRows <= 0) { resultRows = 1000; } LOG.info("Tajo Query Result: " + desc.getUri() + "\n"); int numOfColumns = rsmd.getColumnCount(); for(int i = 0; i < numOfColumns; i++) { columnNames.add(rsmd.getColumnName(i + 1)); } queryResult = new ArrayList<>(); if(sizeLimit < resultRows) { numOfRows = (long)((float)(resultRows) * ((float)sizeLimit / (float) resultRows)); } else { numOfRows = resultRows; } int currentResultSize = 0; int rowCount = 0; while (res.next()) { if(rowCount > numOfRows || currentResultSize > sizeLimit) { break; } List<Object> row = new ArrayList<>(); for(int i = 0; i < numOfColumns; i++) { String columnValue = String.valueOf(res.getObject(i + 1)); try { currentResultSize += columnValue.getBytes(Bytes.UTF8_ENCODING).length; } catch (Exception e) { } row.add(columnValue); } queryResult.add(row); rowCount++; } }

Target:
private void MakeResultText(ResultSet res, TableDesc desc) throws SQLException { ResultSetMetaData rsmd = res.getMetaData(); resultRows = desc.getStats() == null ? 0 : desc.getStats().getNumRows(); if (resultRows <= 0) { resultRows = 1000; } LOG.info("Tajo Query Result: " + desc.getUri() + "\n"); int numOfColumns = rsmd.getColumnCount(); for(int i = 0; i < numOfColumns; i++) { columnNames.add(rsmd.getColumnName(i + 1)); } queryResult = new ArrayList<>(); int currentResultSize = 0; int rowCount = 0; while (res.next()) { if(rowCount > rowLimit || currentResultSize > sizeLimit) { break; } List<Object> row = new ArrayList<>(); for(int i = 0; i < numOfColumns; i++) { String columnValue = String.valueOf(res.getObject(i + 1)); try { currentResultSize += columnValue.getBytes(Bytes.UTF8_ENCODING).length; } catch (Exception e) { } row.add(columnValue); } queryResult.add(row); rowCount++; } }
Source:
public Matrix4 rotate(double x, double y, double z, double angle) { if (angle == 0) return this; return rotate(mQuat.fromAngleAxis(x, y, z, angle)); }

Target:
public Matrix4 rotate(double x, double y, double z, double angle) { return angle == 0 ? this :rotate(mQuat.fromAngleAxis(x, y, z, angle)); }
Source:
public void testBug1530ParseError() throws Exception { String c = IOUtils.toString(this.getClass().getResourceAsStream("Bug1530.java"), StandardCharsets.UTF_8); parseJava18(c); }

Target:
public void testBug1530ParseError() { String c = readAsString("Bug1530.java"); parseJava18(c); }
Source:
private boolean isSchemaAStructSchema(final Schema schema){ return schema.type().equals(Schema.Type.STRUCT); }

Target:
private boolean isSchemaAStructSchema(final Schema schema) { return schema != null && schema.type().equals(Schema.Type.STRUCT); }
Source:
public static <T> CopyOnWriteList<T> createCopyOnWriteList(final Class<T> type) { return new CopyOnWriteList<T>() { private ExtensionList<T> storage() { return Jenkins.getInstance().getExtensionList(type); } @Override synchronized public void add(T t) { storage().add(t); } @Override synchronized public boolean remove(T t) { return storage().remove(t); } @Override public Iterator<T> iterator() { return storage().iterator(); } @Override public void replaceBy(CopyOnWriteList<? extends T> that) { throw new UnsupportedOperationException(); } @Override public void replaceBy(Collection<? extends T> that) { throw new UnsupportedOperationException(); } @Override public void replaceBy(T... that) { throw new UnsupportedOperationException(); } @Override public void clear() { throw new UnsupportedOperationException(); } @Override public <T> T[] toArray(T[] array) { return storage().toArray(array); } @Override public List<T> getView() { return storage(); } @Override public void addAllTo(Collection<? super T> dst) { dst.addAll(storage()); } @Override public boolean isEmpty() { return storage().isEmpty(); } }; }

Target:
public static <T> CopyOnWriteList<T> createCopyOnWriteList(final Class<T> type) { return new CopyOnWriteList<T>() { private ExtensionList<T> storage() { return Jenkins.getInstance().getExtensionList(type); } @Override public synchronized void add(T t) { storage().add(t); } @Override public synchronized boolean remove(T t) { return storage().remove(t); } @Override public Iterator<T> iterator() { return storage().iterator(); } @Override public void replaceBy(CopyOnWriteList<? extends T> that) { throw new UnsupportedOperationException(); } @Override public void replaceBy(Collection<? extends T> that) { throw new UnsupportedOperationException(); } @Override public void replaceBy(T... that) { throw new UnsupportedOperationException(); } @Override public void clear() { throw new UnsupportedOperationException(); } @Override public <T> T[] toArray(T[] array) { return storage().toArray(array); } @Override public List<T> getView() { return storage(); } @Override public void addAllTo(Collection<? super T> dst) { dst.addAll(storage()); } @Override public boolean isEmpty() { return storage().isEmpty(); } }; }
Source:
public void testComputeIfAbsentExpired() throws Exception { TestTimeSource timeSource = new TestTimeSource(); OnHeapStore<String, String> store = newStore(timeSource, Expirations.timeToLiveExpiration(new Duration(1, TimeUnit.MILLISECONDS))); store.put("key", "value"); StoreEventListener<String, String> listener = addListener(store); timeSource.advanceTime(1); ValueHolder<String> newValue = store.computeIfAbsent("key", new Function<String, String>() { @Override public String apply(String mappedKey) { assertThat(mappedKey, equalTo("key")); return "value2"; } }); assertThat(newValue.value(), equalTo("value2")); assertThat(store.get("key").value(), equalTo("value2")); verify(listener).onExpiration(argThat(new ArgumentMatcher<String>() { @Override public boolean matches(Object argument) { return "key".equals(argument); } }), argThat(new ArgumentMatcher<Store.ValueHolder<String>>() { @Override public boolean matches(Object argument) { return ((Store.ValueHolder<String>)argument).value().equals("value"); } }) ); }

Target:
public void testComputeIfAbsentExpired() throws Exception { TestTimeSource timeSource = new TestTimeSource(); OnHeapStore<String, String> store = newStore(timeSource, Expirations.timeToLiveExpiration(new Duration(1, TimeUnit.MILLISECONDS))); store.put("key", "value"); StoreEventListener<String, String> listener = addListener(store); timeSource.advanceTime(1); ValueHolder<String> newValue = store.computeIfAbsent("key", new Function<String, String>() { @Override public String apply(String mappedKey) { assertThat(mappedKey, equalTo("key")); return "value2"; } }); assertThat(newValue.value(), equalTo("value2")); assertThat(store.get("key").value(), equalTo("value2")); final String value = "value"; verify(listener).onExpiration(eq("key"), valueHolderValueEq(value)); }
Source:
public void testLookupOuterJoinWithEmptyLookupSource(boolean parallelBuild, boolean probeHashEnabled, boolean buildHashEnabled) throws Exception { TaskContext taskContext = createTaskContext(); List<Type> buildTypes = ImmutableList.of(VARCHAR); RowPagesBuilder buildPages = rowPagesBuilder(buildHashEnabled, Ints.asList(0), buildTypes); LookupSourceFactoryManager lookupSourceFactoryManager = buildHash(parallelBuild, taskContext, Ints.asList(0), buildPages, Optional.empty()); List<Type> probeTypes = ImmutableList.of(VARCHAR); RowPagesBuilder probePages = rowPagesBuilder(probeHashEnabled, Ints.asList(0), probeTypes); OperatorFactory joinOperatorFactory = (new LookupJoinOperators()).lookupOuterJoin( 0, new PlanNodeId("test"), lookupSourceFactoryManager, probePages.getTypes(), Ints.asList(0), getHashChannelAsInt(probePages), Optional.empty(), OptionalInt.of(1), PARTITIONING_SPILLER_FACTORY); Operator operator = joinOperatorFactory.createOperator(taskContext.addPipelineContext(0, true, true).addDriverContext()); List<Page> pages = probePages.row("test").build(); operator.addInput(pages.get(0)); Page outputPage = operator.getOutput(); assertNull(outputPage); assertFalse(operator.needsInput()); assertTrue(operator.isFinished()); }

Target:
public void testLookupOuterJoinWithEmptyLookupSource(boolean parallelBuild, boolean probeHashEnabled, boolean buildHashEnabled) { TaskContext taskContext = createTaskContext(); List<Type> buildTypes = ImmutableList.of(VARCHAR); RowPagesBuilder buildPages = rowPagesBuilder(buildHashEnabled, Ints.asList(0), buildTypes); LookupSourceFactoryManager lookupSourceFactoryManager = buildHash(parallelBuild, taskContext, Ints.asList(0), buildPages, Optional.empty()); List<Type> probeTypes = ImmutableList.of(VARCHAR); RowPagesBuilder probePages = rowPagesBuilder(probeHashEnabled, Ints.asList(0), probeTypes); OperatorFactory joinOperatorFactory = new LookupJoinOperators().lookupOuterJoin( 0, new PlanNodeId("test"), lookupSourceFactoryManager, probePages.getTypes(), Ints.asList(0), getHashChannelAsInt(probePages), Optional.empty(), OptionalInt.of(1), PARTITIONING_SPILLER_FACTORY); Operator operator = joinOperatorFactory.createOperator(taskContext.addPipelineContext(0, true, true).addDriverContext()); List<Page> pages = probePages.row("test").build(); operator.addInput(pages.get(0)); Page outputPage = operator.getOutput(); assertNull(outputPage); assertFalse(operator.needsInput()); }
Source:
public void testTaskManagerUnregistration() throws Exception { final TaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder() .setRequestSlotFunction(tuple6 -> new CompletableFuture<>()) .createTestingTaskExecutorGateway(); final TaskExecutorConnection taskManagerConnection = createTaskExecutorConnection(taskExecutorGateway); final ResourceID resourceId = taskManagerConnection.getResourceID(); final SlotID slotId1 = new SlotID(resourceId, 0); final SlotID slotId2 = new SlotID(resourceId, 1); final SlotReport slotReport = new SlotReport(Arrays.asList(createAllocatedSlotStatus(slotId1), createFreeSlotStatus(slotId2))); final ResourceRequirements resourceRequirements = createResourceRequirementsForSingleSlot(); final DefaultSlotTracker slotTracker = new DefaultSlotTracker(); try (DeclarativeSlotManager slotManager = createDeclarativeSlotManagerBuilder() .setSlotTracker(slotTracker) .buildAndStartWithDirectExec()) { slotManager.registerTaskManager(taskManagerConnection, slotReport); assertEquals("The number registered slots does not equal the expected number.", 2, slotManager.getNumberRegisteredSlots()); DeclarativeTaskManagerSlot slot1 = slotTracker.getSlot(slotId1); DeclarativeTaskManagerSlot slot2 = slotTracker.getSlot(slotId2); assertSame(SlotState.ALLOCATED, slot1.getState()); assertSame(SlotState.FREE, slot2.getState()); slotManager.processResourceRequirements(resourceRequirements); assertSame(SlotState.PENDING, slot2.getState()); slotManager.unregisterTaskManager(taskManagerConnection.getInstanceID(), TEST_EXCEPTION); assertEquals(0, slotManager.getNumberRegisteredSlots()); } }

Target:
public void testTaskManagerUnregistration() throws Exception { final TaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder() .setRequestSlotFunction(tuple6 -> new CompletableFuture<>()) .createTestingTaskExecutorGateway(); final TaskExecutorConnection taskManagerConnection = createTaskExecutorConnection(taskExecutorGateway); final ResourceID resourceId = taskManagerConnection.getResourceID(); final SlotID slotId1 = new SlotID(resourceId, 0); final SlotID slotId2 = new SlotID(resourceId, 1); final SlotReport slotReport = new SlotReport(Arrays.asList(createAllocatedSlotStatus(slotId1), createFreeSlotStatus(slotId2))); final ResourceRequirements resourceRequirements = createResourceRequirementsForSingleSlot(); final DefaultSlotTracker slotTracker = new DefaultSlotTracker(); try (DeclarativeSlotManager slotManager = createDeclarativeSlotManagerBuilder() .setSlotTracker(slotTracker) .buildAndStartWithDirectExec()) { slotManager.registerTaskManager(taskManagerConnection, slotReport); assertEquals("The number registered slots does not equal the expected number.", 2, slotManager.getNumberRegisteredSlots()); slotManager.processResourceRequirements(resourceRequirements); slotManager.unregisterTaskManager(taskManagerConnection.getInstanceID(), TEST_EXCEPTION); assertEquals(0, slotManager.getNumberRegisteredSlots()); } }
Source:
private void startDebugging(IServer server, IDeploymentConfig dc, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { int remotePort = debugContext.getDebugPort(); if( remotePort == -1 ) { debugContext.setDebugPort(8787); } IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { if (debuggingContext.getPod() == null) { throw toCoreException("Unable to connect to remote pod"); } int localPort = mapPortForwarding(debuggingContext, monitor); if(isJavaProject(server)) { ILaunch debuggerLaunch = attachRemoteDebugger(server, localPort, monitor); if( debuggerLaunch != null ) { overrideHotcodeReplace(server, debuggerLaunch); } } else if (isNodeJsProject(server)) { DebugTrackerContributionEvaluation.startDebugSession(server, localPort); } } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; debugContext.setDebugListener(listener); OpenShiftDebugUtils.get().enableDebugMode(dc, debugContext, monitor); }

Target:
private void startDebugging(IServer server, IDeploymentConfig dc, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { int remotePort = debugContext.getDebugPort(); if( remotePort == -1 ) { debugContext.setDebugPort(8787); } IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { if (debuggingContext.getPod() == null) { throw toCoreException("Unable to connect to remote pod"); } int localPort = mapPortForwarding(debuggingContext, monitor); if(isJavaProject(server)) { ILaunch debuggerLaunch = attachRemoteDebugger(server, localPort, monitor); if( debuggerLaunch != null ) { overrideHotcodeReplace(server, debuggerLaunch); } } else { DebugTrackerContributionEvaluation.startDebugSession(server, localPort); } } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; debugContext.setDebugListener(listener); OpenShiftDebugUtils.get().enableDebugMode(dc, debugContext, monitor); }
Source:
public static EC2HardwareBuilder c5d_4xlarge() { return new EC2HardwareBuilder(InstanceType.C5D_4XLARGE).c5() .ram(32768) .processors(ImmutableList.of(new Processor(16.0, 3.0))) .volumes(ImmutableList.<Volume>of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(400.0f).device("/dev/sdb").bootDevice(false).durable(false).build())) .is64Bit(true); }

Target:
public static EC2HardwareBuilder c5d_4xlarge() { return new EC2HardwareBuilder(InstanceType.C5D_4XLARGE).c5() .ram(32768) .processors(ImmutableList.of(new Processor(16.0, 3.0))) .volumes(ImmutableList.<Volume>of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(450.0f).device("/dev/sdb").bootDevice(false).durable(false).build())) .is64Bit(true); }
Source:
public PrimitiveType(Repetition repetition, PrimitiveTypeName primitive, String name, LogicalTypeAnnotation logicalTypeAnnotation) { this(repetition, primitive, 0, name, logicalTypeAnnotation, null, null); }

Target:
PrimitiveType(Repetition repetition, PrimitiveTypeName primitive, String name, LogicalTypeAnnotation logicalTypeAnnotation) { this(repetition, primitive, 0, name, logicalTypeAnnotation, null, null); }
Source:
public void shutdown() throws Exception { logger.info("Admin blob storage service shutdown"); }

Target:
public void shutdown() { logger.info("AdminBlobStorageService shutdown complete"); }
Source:
public void testServiceFoundWithValidResponseAndGzip() throws Exception { when(mockRequest.headers(HttpHeaders.ACCEPT_ENCODING)).thenReturn(GZIP); when(mockRequest.params(QUERY_PARAM)).thenReturn(RETURN_ID); String res = (String) cqlTransformHandler.handle(mockRequest, mockResponse); assertThat(res, is(SERVICE_SUCCESS)); }

Target:
public void testServiceFoundWithValidResponseAndGzip() throws Exception { when(mockRequest.headers(HttpHeaders.ACCEPT_ENCODING)).thenReturn(GZIP); when(mockRequest.params(QUERY_PARAM)).thenReturn(RETURN_ID); String res = Boon.toJson(cqlTransformHandler.handle(mockRequest, mockResponse)); assertThat(res, is(SERVICE_SUCCESS)); assertThat(mockResponse.status(), is(HttpStatus.OK_200)); assertThat( mockResponse.getHeaders().get(HttpHeaders.CONTENT_DISPOSITION), matchesPattern(ATTACHMENT_REGEX)); assertThat(mockResponse.getHeaders().get(HttpHeaders.CONTENT_ENCODING), is(GZIP)); assertThat(mockResponse.type(), is(MIME_TYPE)); }
Source:
public String getRemoteCapabilities() { if (getCurrentWebDriver() instanceof RemoteWebDriver && ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities() != null) { logging.info(getCurrentWebDriver().toString()); return ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities().toString(); } else { return "No remote session id or capabilities available"; } }

Target:
public String getRemoteCapabilities() { if (getCurrentWebDriver() instanceof RemoteWebDriver && ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities() != null) { logging.info(String.format("Capabilities supported by current browser:\n%s", getCurrentWebDriver().toString())); return ((RemoteWebDriver) getCurrentWebDriver()).getCapabilities().toString(); } else { return "No remote session id or capabilities available"; } }
Source:
TransportHttp(final Repository local, final URIish uri) throws NotSupportedException { super(local, uri); try { String uriString = uri.toString(); if (!uriString.endsWith("/")) uriString += "/"; baseUrl = new URL(uriString); objectsUrl = new URL(baseUrl, "objects/"); } catch (MalformedURLException e) { throw new NotSupportedException(MessageFormat.format(JGitText.get().invalidURL, uri), e); } http = local.getConfig().get(HTTP_KEY); sslVerify = local.getConfig().getBoolean("http", "sslVerify", true); proxySelector = ProxySelector.getDefault(); }

Target:
TransportHttp(final Repository local, final URIish uri) throws NotSupportedException { super(local, uri); try { String uriString = uri.toString(); if (!uriString.endsWith("/")) uriString += "/"; baseUrl = new URL(uriString); objectsUrl = new URL(baseUrl, "objects/"); } catch (MalformedURLException e) { throw new NotSupportedException(MessageFormat.format(JGitText.get().invalidURL, uri), e); } http = local.getConfig().get(HTTP_KEY); proxySelector = ProxySelector.getDefault(); }
Source:
private static boolean canResolveAllParameterTypes(Collection<String> usedDeclarations, boolean skipFirstParamAsThis, Optional<Class<?>> patternClass, RuleContext ruleContext) { if (!skipFirstParamAsThis && (!patternClass.isPresent() || patternClass.get().equals(Object.class))) { return false; } if (usedDeclarations.isEmpty()) { return true; } return usedDeclarations.stream().map(decl -> getDelarationType(ruleContext, decl)).noneMatch(type -> type instanceof UnknownType); }

Target:
private static boolean canResolveAllParameterTypes(Collection<String> usedDeclarations, boolean skipFirstParamAsThis, Optional<Class<?>> patternClass, RuleContext ruleContext) { if (!skipFirstParamAsThis && !patternClass.isPresent()) { return false; } if (usedDeclarations.isEmpty()) { return true; } return usedDeclarations.stream().map(decl -> getDelarationType(ruleContext, decl)).noneMatch(type -> type instanceof UnknownType); }
Source:
public void setTheme(String theme){ if(theme.equals("Dark.css")){ previewView.getEngine().setUserStyleSheetLocation(getClass().getResource("Dark_preview.css").toString()); } }

Target:
public void setTheme(String theme) { if (theme.equals(ThemeLoader.DARK_CSS)) { previewView.getEngine().setUserStyleSheetLocation(JabRefFrame.class.getResource(ThemeLoader.DARK_CSS).toString()); } }
Source:
protected void closeTailer() { if (tailer != null && !tailer.closed()) { try { tailer.close(); } catch (Exception e) { log.debug(metadata.name() + ": Exception while closing tailer", e); } } }

Target:
protected void closeTailer() { if (tailer != null && !tailer.closed()) { tailer.close(); } }
Source:
protected static Object getContentFromCxf(Message message, DataFormat dataFormat, String encoding) { Set<Class<?>> contentFormats = message.getContentFormats(); Object answer = null; if (contentFormats != null) { if (LOG.isTraceEnabled()) { for (Class<?> contentFormat : contentFormats) { LOG.trace("Content format={} value={}", contentFormat, message.getContent(contentFormat)); } } if (dataFormat == DataFormat.POJO) { List<?> pojoMessageList = message.getContent(List.class); if (pojoMessageList != null && pojoMessageList.size() != 0) { answer = pojoMessageList; } if (answer == null) { answer = message.getContent(Object.class); if (answer != null) { answer = new MessageContentsList(answer); } } } else if (dataFormat == DataFormat.PAYLOAD) { List<SoapHeader> headers = CastUtils.cast((List<?>)message.get(Header.HEADER_LIST)); Map<String, String> nsMap = new HashMap<String, String>(); answer = new CxfPayload<SoapHeader>(headers, getPayloadBodyElements(message, nsMap), nsMap); } else if (dataFormat.dealias() == DataFormat.RAW) { answer = message.getContent(InputStream.class); if (answer == null) { answer = message.getContent(Reader.class); if (answer != null) { if (encoding == null) { encoding = "UTF-8"; } LOG.trace("file encoding is = {}", encoding); answer = new ReaderInputStream((Reader)answer, Charset.forName(encoding)); } } } else if (dataFormat.dealias() == DataFormat.CXF_MESSAGE && message.getContent(List.class) != null) { answer = message.getContent(List.class).get(0); } LOG.trace("Extracted body from CXF message = {}", answer); } return answer; }

Target:
protected static Object getContentFromCxf(Message message, DataFormat dataFormat, String encoding) { Set<Class<?>> contentFormats = message.getContentFormats(); Object answer = null; if (contentFormats != null) { if (LOG.isTraceEnabled()) { for (Class<?> contentFormat : contentFormats) { LOG.trace("Content format={} value={}", contentFormat, message.getContent(contentFormat)); } } if (dataFormat == DataFormat.POJO) { List<?> pojoMessageList = message.getContent(List.class); if (pojoMessageList != null && !pojoMessageList.isEmpty()) { answer = pojoMessageList; } if (answer == null) { answer = message.getContent(Object.class); if (answer != null) { answer = new MessageContentsList(answer); } } } else if (dataFormat == DataFormat.PAYLOAD) { List<SoapHeader> headers = CastUtils.cast((List<?>)message.get(Header.HEADER_LIST)); Map<String, String> nsMap = new HashMap<String, String>(); answer = new CxfPayload<SoapHeader>(headers, getPayloadBodyElements(message, nsMap), nsMap); } else if (dataFormat.dealias() == DataFormat.RAW) { answer = message.getContent(InputStream.class); if (answer == null) { answer = message.getContent(Reader.class); if (answer != null) { if (encoding == null) { encoding = "UTF-8"; } LOG.trace("file encoding is = {}", encoding); answer = new ReaderInputStream((Reader)answer, Charset.forName(encoding)); } } } else if (dataFormat.dealias() == DataFormat.CXF_MESSAGE && message.getContent(List.class) != null) { answer = message.getContent(List.class).get(0); } LOG.trace("Extracted body from CXF message = {}", answer); } return answer; }
Source:
public DefaultArgumentsAccessor(Object[] arguments) { Preconditions.notNull(arguments, "DefaultArgumentsAccessor initialized with null arguments"); this.arguments = arguments; }

Target:
public DefaultArgumentsAccessor(Object[] arguments) { Preconditions.notNull(arguments, "Arguments array must not be null"); this.arguments = arguments; }
Source:
public final void setChildren(IEditorPart[] children) { innerEditors = children; activeEditorIndex = 0; for (IEditorPart element : children) { element.addPropertyListener( (source, propId) -> handlePropertyChange(propId)); } innerEditorsCreated(); }

Target:
public final void setChildren(IEditorPart[] children) { innerEditors = children; activeEditorIndex = 0; for (IEditorPart child : children) { child.addPropertyListener( (source, propId) -> handlePropertyChange(propId)); } innerEditorsCreated(); }
Source:
public void initColumnsWithTaskVarColumnsTest() { final ExtendedPagedTable<TaskSummary> currentListGrid = spy(new ExtendedPagedTable<>(new GridGlobalPreferences())); doAnswer(new Answer() { @Override public Void answer(InvocationOnMock invocationOnMock) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[0]; assertEquals(columns.size(), 19); return null; } }).when(currentListGrid).addColumns(anyList()); ArrayList<GridColumnPreference> columnPreferences = new ArrayList<GridColumnPreference>(); columnPreferences.add(new GridColumnPreference("var1", 0, "40")); columnPreferences.add(new GridColumnPreference("var2", 1, "40")); columnPreferences.add(new GridColumnPreference("var3", 1, "40")); when(currentListGrid.getGridPreferencesStore()).thenReturn(gridPreferencesStore); when(gridPreferencesStore.getColumnPreferences()).thenReturn(columnPreferences); getView().initColumns(currentListGrid); verify(currentListGrid).addColumns(anyList()); }

Target:
public void initColumnsWithTaskVarColumnsTest() { final ExtendedPagedTable<TaskSummary> currentListGrid = spy(new ExtendedPagedTable<>(new GridGlobalPreferences())); doAnswer(new Answer() { @Override public Void answer(InvocationOnMock invocationOnMock) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[0]; assertEquals(19, columns.size()); return null; } }).when(currentListGrid).addColumns(anyList()); ArrayList<GridColumnPreference> columnPreferences = new ArrayList<GridColumnPreference>(); columnPreferences.add(new GridColumnPreference("var1", 0, "40")); columnPreferences.add(new GridColumnPreference("var2", 1, "40")); columnPreferences.add(new GridColumnPreference("var3", 1, "40")); when(currentListGrid.getGridPreferencesStore()).thenReturn(gridPreferencesStore); when(gridPreferencesStore.getColumnPreferences()).thenReturn(columnPreferences); getView().initColumns(currentListGrid); verify(currentListGrid).addColumns(anyList()); }
Source:
public void testCompareToCornerCases4() { assertEquals("compareTo", 1, ts0.compareTo(null)); }

Target:
public void testCompareToCornerCases4() { assertTrue("compareTo", ts0.compareTo(null) > 0); }
Source:
static boolean put( ImmutableTable.Builder<Granularity, RollupType, TimeValue> ttlMapBuilder, Configuration config, Granularity gran, RollupType rollupType, TtlConfig configKey) { int value; try { value = config.getIntegerProperty(configKey); if (value < 0) return false; } catch (NumberFormatException e) { log.info("No valid TTL config set for granularity: {}, rollup type: {}", gran.name(), rollupType.name()); return false; } ttlMapBuilder.put(gran, rollupType, new TimeValue(value, TimeUnit.DAYS)); return true; }

Target:
private boolean put( ImmutableTable.Builder<Granularity, RollupType, TimeValue> ttlMapBuilder, Configuration config, Granularity gran, RollupType rollupType, TtlConfig configKey) { int value; try { value = config.getIntegerProperty(configKey); if (value < 0) return false; } catch (NumberFormatException ex) { log.info(String.format("No valid TTL config set for granularity: %s, rollup type: %s", gran.name(), rollupType.name()), ex); return false; } ttlMapBuilder.put(gran, rollupType, new TimeValue(value, TimeUnit.DAYS)); return true; }
Source:
public void read(StatementRestrictions restrictions, QueryOptions options, ResultBuilder result) { UUID hostId = StorageService.instance.getLocalHostUUID(); for (Map<String, String> c : CompactionManager.instance.getCompactions()) { result.row(hostId, UUID.fromString(c.get("compactionId"))) .column("task_type", c.get("taskType")) .column("keyspace_name", c.get("keyspace")) .column("table_name", c.get("columnFamily")) .column("bytes_compacted", c.get("completed")) .column("bytes_total", c.get("total")) .endRow(); } }

Target:
public void read(StatementRestrictions restrictions, QueryOptions options, ResultBuilder result) { UUID hostId = StorageService.instance.getLocalHostUUID(); for (Map<String, String> c : CompactionManager.instance.getCompactions()) { result.row(hostId, UUID.fromString(c.get(CompactionInfo.COMPACTION_ID))) .column(TASK_TYPE, c.get(CompactionInfo.TASK_TYPE)) .column(KEYSPACE_NAME, c.get(CompactionInfo.KEYSPACE)) .column(TABLE_NAME, c.get(CompactionInfo.COLUMNFAMILY)) .column(BYTES_COMPACTED, c.get(CompactionInfo.COMPLETED)) .column(BYTES_TOTAL, c.get(CompactionInfo.TOTAL)) .endRow(); } }
Source:
public EventExecutor executor() { return executor; }

Target:
public final EventExecutor executor() { return executor; }
Source:
public void closeFade() { if (fadeJob != null) { fadeJob.cancelAndWait(false); } fadeJob = AnimationUtil.fadeOut(getShell(), new IFadeListener() { public void faded(Shell shell, int alpha) { if (!shell.isDisposed()) { if (alpha == 0) { shell.close(); } else if (isMouseOver(shell)) { if (fadeJob != null) { fadeJob.cancelAndWait(false); } fadeJob = AnimationUtil.fastFadeIn(shell, new IFadeListener() { public void faded(Shell shell, int alpha) { if (shell.isDisposed()) { return; } if (alpha == 255) { scheduleAutoClose(); } } }); } } } }); }

Target:
public void closeFade() { if (fadeJob != null) { fadeJob.cancelAndWait(false); } fadeJob = AnimationUtil.fadeOut(getShell(), new IFadeListener() { @Override public void faded(Shell shell, int alpha) { if (!shell.isDisposed()) { if (alpha == 0) { shell.close(); } else if (isMouseOver(shell)) { if (fadeJob != null) { fadeJob.cancelAndWait(false); } fadeJob = AnimationUtil.fastFadeIn(shell, new IFadeListener() { @Override public void faded(Shell shell, int alpha) { if (shell.isDisposed()) { return; } if (alpha == 255) { scheduleAutoClose(); } } }); } } } }); }
Source:
protected boolean canDoAction() { boolean result = true; UserProfile dbProfile = userProfileDao.getByUserId(getUserId()); UserProfile givenProfile = getParameters().getUserProfile(); if (dbProfile == null || dbProfile.getId().equals(givenProfile.getId()) == false) { log.warn("Profile ID mismatch: expected in profile received {}", dbProfile.getId().toString(), givenProfile.getId().toString()); setActionMessageParameters(); result = false; } return result; }

Target:
protected boolean canDoAction() { UserProfile dbProfile = userProfileDao.getByUserId(getUserId()); UserProfile givenProfile = getParameters().getUserProfile(); if (dbProfile == null || !dbProfile.getId().equals(givenProfile.getId())) { log.warn("Profile ID mismatch: expected in profile received {}", dbProfile.getId().toString(), givenProfile.getId().toString()); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_NOT_EXIST); } return true; }
Source:
protected void appendNulls() { if (decodedBlock.mayHaveNull()) { ensureNullsValueBufferSize(); int bufferedNullsCount = nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount; if (bufferedPositionCount > bufferedNullsCount) { int falsesToWrite = bufferedPositionCount - bufferedNullsCount; encodeFalseValuesAsBits(falsesToWrite); verify(nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount == bufferedPositionCount); } encodeNullsAsBits(decodedBlock); verify(nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount == bufferedPositionCount + batchSize); } else { if (containsNull()) { verify(nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount == bufferedPositionCount); ensureNullsValueBufferSize(); encodeFalseValuesAsBits(batchSize); verify(nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount == bufferedPositionCount + batchSize); } } }

Target:
protected void appendNulls() { if (decodedBlock.mayHaveNull()) { ensureNullsValueBufferCapacity(); int bufferedNullsCount = nullsBufferIndex * BITS_IN_BYTE + remainingNullsCount; if (bufferedPositionCount > bufferedNullsCount) { encodeNonNullsAsBits(bufferedPositionCount - bufferedNullsCount); } encodeNullsAsBits(decodedBlock); } else if (containsNull()) { ensureNullsValueBufferCapacity(); encodeNonNullsAsBits(batchSize); } }
Source:
public void filter(ContainerRequestContext requestContext) throws IOException { String operation = requestContext.getMethod() + " /" + requestContext.getUriInfo().getPath(); String traceId = requestContext.getHeaderString(TraceHttpHeaders.TRACE_ID); String spanId = requestContext.getHeaderString(TraceHttpHeaders.SPAN_ID); if (Strings.isNullOrEmpty(traceId)) { Tracer.initTrace(Optional.<Boolean>absent(), Tracers.randomId()); Tracer.startSpan(operation); } else { Tracer.initTrace(hasSampledHeader(requestContext), traceId); if (spanId == null) { Tracer.startSpan(operation); } else { Tracer.startSpan(operation, spanId); } } MDC.put(MDC_KEY, Tracer.getTraceId()); }

Target:
public void filter(ContainerRequestContext requestContext) throws IOException { String operation = requestContext.getMethod() + " /" + requestContext.getUriInfo().getPath(); String traceId = requestContext.getHeaderString(TraceHttpHeaders.TRACE_ID); String spanId = requestContext.getHeaderString(TraceHttpHeaders.SPAN_ID); if (Strings.isNullOrEmpty(traceId)) { Tracer.initTrace(Optional.<Boolean>absent(), Tracers.randomId()); Tracer.startSpan(operation); } else { Tracer.initTrace(hasSampledHeader(requestContext), traceId); if (spanId == null) { Tracer.startSpan(operation); } else { Tracer.startSpan(operation, spanId); } } MDC.put(MDC_KEY, Tracer.getTraceId()); requestContext.setProperty("com.palantir.remoting1.traceId", Tracer.getTraceId()); }
Source:
public void testGetProcessInstanceImageViaUIClientTest() throws Exception { long processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_2_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_3_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } }

Target:
public void testGetProcessInstanceImageViaUIClientTest() throws Exception { long processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); assertImageContent(result); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_2_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); assertImageContent(result); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } processInstanceId = processClient.startProcess(CONTAINER_ID, HIRING_3_PROCESS_ID); assertTrue(processInstanceId > 0); try { String result = uiServicesClient.getProcessInstanceImage(CONTAINER_ID, processInstanceId); assertImageContent(result); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } }
Source:
public void checkGoToSymbolFeature() { editor.goToCursorPositionVisible(14, 7); List<String > expectedListSymbols = Arrays.asList( "greeter", "Greeter", "greet", "constructor", "\"Greeter\"", "print", "printVar", "greeting"); menu.runCommand(ASSISTANT, GO_TO_SYMBOL); assistantFindPanel.waitAllNodes(expectedListSymbols); assistantFindPanel.clickOnActionNodeWithTextEqualsTo("greet"); editor.waitCursorPosition(19, 5); }

Target:
public void checkGoToSymbolFeature() { editor.goToCursorPositionVisible(14, 7); List<String> expectedGoToSymbolAlternatives = Arrays.asList( "greeter", "Greeter", "greet", "constructor", "\"Greeter\"", "print", "printVar", "greeting"); menu.runCommand(ASSISTANT, GO_TO_SYMBOL); assistantFindPanel.waitAllNodes(expectedGoToSymbolAlternatives); assistantFindPanel.clickOnActionNodeWithTextContains("greet"); editor.waitCursorPosition(19, 5); }
Source:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public static <T, E extends Exception> ListenableFuture<T> maybeLogAsync( CallableCheckedException<ListenableFuture<T>, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additionalLoggerWithAccessToResult) throws E { if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additionalLoggerWithAccessToResult, slowLogPredicate); ListenableFuture<T> future = action.call(); Futures.addCallback(future, new FutureCallback<T>() { @Override public void onSuccess(@NullableDecl T result) { monitor.registerResult(result); monitor.log(); } @Override public void onFailure(Throwable t) { monitor.registerException(new Exception(t)); monitor.log(); } }, Executors.newSingleThreadExecutor()); return future; } else { return action.call(); } }

Target:
public static <T, E extends Exception> ListenableFuture<T> maybeLogAsync( CallableCheckedException<ListenableFuture<T>, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additionalLoggerWithAccessToResult) throws E { ListenableFuture<T> future = action.call(); if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additionalLoggerWithAccessToResult, slowLogPredicate); Futures.addCallback(future, new FutureCallback<T>() { @Override public void onSuccess(@NullableDecl T result) { monitor.registerResult(result); monitor.log(); } @Override public void onFailure(Throwable t) { monitor.registerException(new Exception(t)); monitor.log(); } }, MoreExecutors.directExecutor()); } return future; }
Source:
private void initButtons() { cancelDownloadButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_cancelDownload"))); cancelDownloadButton.managedProperty().bind(cancelDownloadButton.visibleProperty()); cancelDownloadButton.setVisible(false); if (!selectedPackage.isInstalled()) { startAndDownloadButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_download"))); } else { startAndDownloadButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_start"))); } startAndDownloadButton.managedProperty().bind(startAndDownloadButton.visibleProperty()); startAndDownloadButton.setGraphic(downloadImage); deleteButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_delete"))); settingsButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_settings"))); exitButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_exit"))); }

Target:
private void initButtons() { cancelDownloadButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_cancelDownload"))); cancelDownloadButton.managedProperty().bind(cancelDownloadButton.visibleProperty()); cancelDownloadButton.setVisible(false); playButtonTooltip = new SimpleObjectProperty<>(new Tooltip(BundleUtils.getLabel("launcher_download"))); startAndDownloadButton.tooltipProperty().bind(playButtonTooltip); startAndDownloadButton.managedProperty().bind(startAndDownloadButton.visibleProperty()); startAndDownloadButton.setGraphic(downloadImage); deleteButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_delete"))); settingsButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_settings"))); exitButton.setTooltip(new Tooltip(BundleUtils.getLabel("launcher_exit"))); }
Source:
public Iterable<String> getNames() { return Iterables.concat(Iterables.transform(dataSources, new Function<DataSource, Iterable<String>>() { @Override public Iterable<String> apply(DataSource input) { return input.getNames(); } })); }

Target:
public List<String> getNames() { return Lists.transform( dataSources, new Function<TableDataSource, String>() { @Override public String apply(TableDataSource input) { return Iterables.getOnlyElement(input.getNames()); } } ); }
Source:
public void configure(final GsonBuilder gsonBuilder) { gsonBuilder.registerTypeAdapter( Payload.class, new PayloadAdapter() ); gsonBuilder.registerTypeAdapter(Contentlet.class, new ContentletDeserializer() ); gsonBuilder.registerTypeAdapter(HTMLPageAsset.class, new ContentletDeserializer() ); }

Target:
public void configure(final GsonBuilder gsonBuilder) { gsonBuilder.registerTypeAdapter( Payload.class, new PayloadAdapter() ); gsonBuilder.registerTypeAdapter(Contentlet.class, new ContentletDeserializer() ); gsonBuilder.registerTypeAdapter(HTMLPageAsset.class, new ContentletDeserializer() ); gsonBuilder.registerTypeAdapter(Host.class, new ContentletDeserializer() ); }