auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void should_fail_if_actual_is_null() { final Throwable throwable = null; final Throwable expected = new Throwable(); AssertionError actual = expectAssertionError( () -> throwables.assertHasRootCause(someInfo(), throwable, expected) ); assertThat(actual) .hasMessage(actualIsNull()); }

Target:
public void should_fail_if_actual_is_null() { final Throwable throwable = null; final Throwable expected = new Throwable(); AssertionError actual = expectAssertionError(() -> throwables.assertHasRootCause(INFO, throwable, expected)); assertThat(actual).hasMessage(actualIsNull()); }
Source:
public void testCloseSuccessfulChunkedInput() throws Exception { int chunks = 10; TestChunkedInput input = new TestChunkedInput(chunks); EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler()); ch.writeAndFlush(input).sync(); for (int i = 0; i < chunks; i++) { ByteBuf buf = ch.readOutbound(); assertEquals(i, buf.readInt()); buf.release(); } assertTrue(input.closed); }

Target:
public void testCloseSuccessfulChunkedInput() { int chunks = 10; TestChunkedInput input = new TestChunkedInput(chunks); EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler()); assertTrue(ch.writeOutbound(input)); for (int i = 0; i < chunks; i++) { ByteBuf buf = ch.readOutbound(); assertEquals(i, buf.readInt()); buf.release(); } assertTrue(input.isClosed()); assertFalse(ch.finish()); }
Source:
public static ProcessResult executeCommands(final List<String> commands, final Duration timeOut) { Preconditions.checkArgument(commands != null && timeOut != null); int retVal = -2; String stdOutput = null; String stdError = null; try { final Process process = new ProcessBuilder().command(commands).start(); if (timeOut.getStandardSeconds() > 0) { final Future<Integer> processFuture = processExecutor.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return process.waitFor(); } }); try { retVal = processFuture.get(timeOut.getStandardSeconds(), TimeUnit.SECONDS); } catch (ExecutionException | TimeoutException e) { retVal = -1; stdError = "Operation timed out, aborted"; if (LOG.isTraceEnabled()) { LOG.trace("Failed to complete the requested command within timeout: " + e.getMessage()); } } finally { if (Strings.isNullOrEmpty(stdError)) { stdOutput = readStream(process.getInputStream()); stdError = readStream(process.getErrorStream()); } } } else { retVal = process.waitFor(); stdOutput = readStream(process.getInputStream()); stdError = readStream(process.getErrorStream()); } process.destroy(); if (LOG.isTraceEnabled()) { LOG.trace("Process standard output: " + stdOutput); LOG.trace("Process standard error output: " + stdError); } } catch (IOException | InterruptedException e) { stdError = e.getMessage(); LOG.error("Exception caught error running commands: " + e.getMessage()); } return new ProcessResult(stdOutput, stdError, retVal); }

Target:
public ProcessResult executeCommands(final List<String> commands, final Duration timeOut) { Preconditions.checkArgument(commands != null && timeOut != null && timeOut.getStandardSeconds() > 0L && (timeOut.compareTo(DEFAULT_MAX_TIMEOUT) <= 0) && executor != null); int retVal = -2; String stdOutput = null; String stdError = null; try { final Process process = new ProcessBuilder().command(commands).start(); final Future<Integer> processFuture = executor.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return process.waitFor(); } }); try { retVal = processFuture.get(timeOut.getStandardSeconds(), TimeUnit.SECONDS); } catch (ExecutionException e) { retVal = -2; stdError = e.getMessage(); if (LOG.isTraceEnabled()) { LOG.trace("Failed to complete the requested command due to execution error: " + e.getMessage()); } } catch (TimeoutException e) { retVal = -1; stdError = "Operation timed out, aborted"; if (LOG.isTraceEnabled()) { LOG.trace("Failed to complete the requested command within timeout: " + e.getMessage()); } } finally { if (Strings.isNullOrEmpty(stdError)) { stdOutput = CharStreams.toString(new InputStreamReader(process.getInputStream())); stdError = CharStreams.toString(new InputStreamReader(process.getErrorStream())); } process.destroy(); } if (LOG.isTraceEnabled()) { LOG.trace("Process standard output: " + stdOutput); LOG.trace("Process standard error output: " + stdError); } } catch (IOException | InterruptedException e) { stdError = e.getMessage(); LOG.error("Exception caught error running commands: " + e.getMessage()); } return new ProcessResult(stdOutput, stdError, retVal); }
Source:
public void setWidth(int desiredWidth, int desiredScale, boolean errorOnTrunc) throws StandardException { int sourceWidth; if ( (_clobValue == null ) && (getString() == null) ) { return; } sourceWidth = getLength(); if (sourceWidth < desiredWidth) { if (!(this instanceof SQLVarchar)) { StringBuffer strbuf; strbuf = new StringBuffer(getString()); for ( ; sourceWidth < desiredWidth-1; sourceWidth++) { strbuf.append(' '); } setValue(new String(strbuf)); } } else if (sourceWidth > desiredWidth && desiredWidth > 0) { try { hasNonBlankChars(getString(), desiredWidth, sourceWidth); } catch (StandardException se) { if (errorOnTrunc) { throw se; } String source = getString(); int transferSize = getUTF8Length(source, 0, desiredWidth); int dataSize = transferSize + getUTF8Length(source, desiredWidth, source.length()); DataTruncation warning = new DataTruncation( -1, false, true, dataSize, transferSize); warning.initCause(se); StatementContext statementContext = (StatementContext) ContextService.getContext(ContextId.LANG_STATEMENT); Activation activation = statementContext.getActivation(); if (activation != null) { activation.getResultSet().addWarning(warning); } } setValue(getString().substring(0, desiredWidth)); } }

Target:
public void setWidth(int desiredWidth, int desiredScale, boolean errorOnTrunc) throws StandardException { int sourceWidth; if ( (_clobValue == null ) && (getString() == null) ) { return; } sourceWidth = getLength(); if (sourceWidth < desiredWidth) { if (!(this instanceof SQLVarchar)) { StringBuilder strBuilder; strBuilder = new StringBuilder(getString()); for ( ; sourceWidth < desiredWidth-1; sourceWidth++) { strBuilder.append(' '); } setValue(new String(strBuilder)); } } else if (sourceWidth > desiredWidth && desiredWidth > 0) { try { hasNonBlankChars(getString(), desiredWidth, sourceWidth); } catch (StandardException se) { if (errorOnTrunc) { throw se; } String source = getString(); int transferSize = getUTF8Length(source, 0, desiredWidth); int dataSize = transferSize + getUTF8Length(source, desiredWidth, source.length()); DataTruncation warning = new DataTruncation( -1, false, true, dataSize, transferSize); warning.initCause(se); StatementContext statementContext = (StatementContext) ContextService.getContext(ContextId.LANG_STATEMENT); Activation activation = statementContext.getActivation(); if (activation != null) { activation.getResultSet().addWarning(warning); } } setValue(getString().substring(0, desiredWidth)); } }
Source:
protected void addVmStatic() { logImportEvents(); getVm().getStaticData().setId(getVmId()); getVm().getStaticData().setCreationDate(new Date()); getVm().getStaticData().setClusterId(getParameters().getClusterId()); getVm().setStoragePoolId(getDcId()); getVm().getStaticData().setMinAllocatedMem(computeMinAllocatedMem()); getVm().getStaticData().setQuotaId(getParameters().getQuotaId()); if (!VmHandler.validateDedicatedVdsExistOnSameCluster(getVm().getStaticData(), null)) { getVm().setDedicatedVmForVdsList(Collections.<Guid>emptyList()); } if (getVm().getOriginalTemplateGuid() != null && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getOriginalTemplateGuid())) { VmTemplate originalTemplate = getVmTemplateDao().get(getVm().getOriginalTemplateGuid()); if (originalTemplate != null) { getVm().getStaticData().setOriginalTemplateName(originalTemplate.getName()); } } if (getParameters().getCopyCollapse()) { getVm().setVmtGuid(VmTemplateHandler.BLANK_VM_TEMPLATE_ID); } getVmStaticDao().save(getVm().getStaticData()); getCompensationContext().snapshotNewEntity(getVm().getStaticData()); }

Target:
protected void addVmStatic() { logImportEvents(); getVm().getStaticData().setId(getVmId()); getVm().getStaticData().setCreationDate(new Date()); getVm().getStaticData().setClusterId(getParameters().getClusterId()); getVm().getStaticData().setMinAllocatedMem(computeMinAllocatedMem()); getVm().getStaticData().setQuotaId(getParameters().getQuotaId()); if (!VmHandler.validateDedicatedVdsExistOnSameCluster(getVm().getStaticData(), null)) { getVm().setDedicatedVmForVdsList(Collections.<Guid>emptyList()); } if (getVm().getOriginalTemplateGuid() != null && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getOriginalTemplateGuid())) { VmTemplate originalTemplate = getVmTemplateDao().get(getVm().getOriginalTemplateGuid()); if (originalTemplate != null) { getVm().getStaticData().setOriginalTemplateName(originalTemplate.getName()); } } if (getParameters().getCopyCollapse()) { getVm().setVmtGuid(VmTemplateHandler.BLANK_VM_TEMPLATE_ID); } getVmStaticDao().save(getVm().getStaticData()); getCompensationContext().snapshotNewEntity(getVm().getStaticData()); }
Source:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put("osgi.http.whiteboard.servlet.pattern", "/VAADIN/static/push/*"); servletRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new PushResourceServlet(pushBundle), properties)); }

Target:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/VAADIN/static/push/*"); servletPushRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new ResourceServlet(pushBundle, "/META-INF/resources/VAADIN/static/push"), properties)); }
Source:
public String toString() { return String.format("CertificateSerialDTO []"); }

Target:
public String toString() { Date expiration = this.getExpiration(); String date = expiration != null ? String.format("%1$tF %1$tT%1$tz", expiration) : null; return String.format( "CertificateSerialDTO [id: %s, serial: %s, expiration: %s, collected: %s, revoked: %s]", this.getId(), this.getSerial(), date, this.isCollected(), this.isRevoked()); }
Source:
public boolean verifyServicesCombination(Set<Service> services) { final Sets.SetView<Service> missingServices = Sets.difference(REQUIRED_SERVICES, services); final Sets.SetView<Service> unsupportedServices = Sets.intersection(UNSUPPORTED_SERVICES, services); final Sets.SetView<Service> wantedServices = Sets.intersection(NUAGE_ONLY_SERVICES, new HashSet<>()); if (!missingServices.isEmpty()) { throw new UnsupportedServiceException("Provider " + Provider.NuageVsp + " requires services: " + missingServices); } if (!unsupportedServices.isEmpty()) { s_logger.debug("Unable to support services combination. The services " + unsupportedServices + " are not supported by Nuage VSP."); return false; } if (!wantedServices.isEmpty()) { throw new UnsupportedServiceException("Provider " + Provider.NuageVsp + " does not support services to be implemented by another provider: " + wantedServices); } return true; }

Target:
public boolean verifyServicesCombination(Set<Service> services) { Preconditions.checkNotNull(services); final Sets.SetView<Service> missingServices = Sets.difference(REQUIRED_SERVICES, services); final Sets.SetView<Service> unsupportedServices = Sets.intersection(UNSUPPORTED_SERVICES, services); final Sets.SetView<Service> wantedServices = Sets.intersection(NUAGE_ONLY_SERVICES, new HashSet<>()); if (!missingServices.isEmpty()) { throw new UnsupportedServiceException("Provider " + Provider.NuageVsp + " requires services: " + missingServices); } if (!unsupportedServices.isEmpty()) { s_logger.debug("Unable to support services combination. The services " + unsupportedServices + " are not supported by Nuage VSP."); return false; } if (!wantedServices.isEmpty()) { throw new UnsupportedServiceException("Provider " + Provider.NuageVsp + " does not support services to be implemented by another provider: " + wantedServices); } return true; }
Source:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTreeNode statTree = TmfStatisticsTreeManager.getStatTreeRoot(getTreeID()); final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } synchronized (statsData) { if (isGlobal) { statTree.resetGlobalValue(); } else { statTree.resetTimeRangeValue(); } for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Thread statsThread = new Thread("Statistics update") { @Override public void run() { statsMod.waitForInitialization(); ITmfStatistics stats = statsMod.getStatistics(); if (stats == null) { throw new IllegalStateException(); } long start = timeRange.getStartTime().normalize(0, TIME_SCALE).getValue(); long end = timeRange.getEndTime().normalize(0, TIME_SCALE).getValue(); ITmfStateSystem ss = statsMod.getStateSystem(TmfStatisticsEventTypesModule.ID); if (ss == null) { throw new IllegalStateException(); } while(!ss.waitUntilBuilt(500)) { Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(isGlobal, map); } Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(isGlobal, map); } }; statsThread.start(); return; } } }

Target:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTreeNode statTree = TmfStatisticsTreeManager.getStatTreeRoot(getTreeID()); final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } synchronized (statsData) { if (isGlobal) { statTree.resetGlobalValue(); } else { statTree.resetTimeRangeValue(); } for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Thread statsThread = new Thread("Statistics update") { @Override public void run() { statsMod.waitForInitialization(); ITmfStatistics stats = statsMod.getStatistics(); if (stats == null) { throw new IllegalStateException(); } long start = timeRange.getStartTime().normalize(0, TIME_SCALE).getValue(); long end = timeRange.getEndTime().normalize(0, TIME_SCALE).getValue(); ITmfStateSystem ss = statsMod.getStateSystem(TmfStatisticsEventTypesModule.ID); if (ss == null) { throw new IllegalStateException(); } while(!ss.waitUntilBuilt(LIVE_UPDATE_DELAY)) { Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(isGlobal, map); } Map<String, Long> map = stats.getEventTypesInRange(start, end); updateStats(isGlobal, map); } }; statsThread.start(); return; } } }
Source:
static String usingOffsetPrefix(SecorConfig config) { return config.getString("secor.offsets.prefix", "offset="); }

Target:
static String usingOffsetPrefix(SecorConfig config) { return config.getString("secor.offsets.prefix"); }
Source:
protected void setSeries(String seriesName, double[] seriesValues) { if (seriesName == null) { throw new IllegalArgumentException("seriesName cannot be null"); } if (seriesValues == null) { throw new IllegalArgumentException("Series values cannot be null"); } String seriesType = getSeriesType(seriesName); fModelBuilder.addYSeries( new YSeries( seriesType, getSeriesColor(seriesName), getWidth(seriesName), getSeriesStyle(seriesType), seriesName, seriesValues)); }

Target:
protected void setSeries(String seriesName, double[] seriesValues) { Objects.requireNonNull(seriesName); Objects.requireNonNull(seriesValues); String seriesType = getSeriesType(seriesName); fModelBuilder.addYSeries( new YSeries( seriesType, getSeriesColor(seriesName), getWidth(seriesName), getSeriesStyle(seriesType), seriesName, seriesValues)); }
Source:
public void unregisterPercentLength(AndroidViewComponent component, PercentStorageRecord.Dim dim) { for (Integer key : dimChanges.keySet()) { dimChanges.remove(generateHashCode(component, dim)); } }

Target:
public void unregisterPercentLength(AndroidViewComponent component, PercentStorageRecord.Dim dim) { dimChanges.remove(generateHashCode(component, dim)); }
Source:
private static ComputerLauncher getDelegate(ComputerLauncher launcher) { try { Method getDelegate = launcher.getClass().getMethod("getDelegate"); return ComputerLauncher.class.isAssignableFrom(getDelegate.getReturnType()) ? (ComputerLauncher) getDelegate .invoke(launcher) : null; } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { return null; } }

Target:
private static ComputerLauncher getDelegate(ComputerLauncher launcher) { try { Method getDelegate = launcher.getClass().getMethod("getDelegate"); if (ComputerLauncher.class.isAssignableFrom(getDelegate.getReturnType())) { return (ComputerLauncher) getDelegate.invoke(launcher); } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { } try { Method getLauncher = launcher.getClass().getMethod("getLauncher"); if (ComputerLauncher.class.isAssignableFrom(getLauncher.getReturnType())) { return (ComputerLauncher) getLauncher.invoke(launcher); } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { } return null; }
Source:
protected String resolveSystemProperty(String key) { try { String value = System.getProperty(key); if (value == null) { value = System.getenv(key); } return value; } catch (Throwable ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Could not access system property '" + key + "': " + ex); } return null; } }

Target:
protected String resolveSystemProperty(String key) { try { String value = GeoWebCacheExtensions.getProperty(key); if (value == null) { value = System.getenv(key); } return value; } catch (Throwable ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Could not access system property '" + key + "': " + ex); } return null; } }
Source:
public void testConfigurationWithFile() throws Exception { URL url = getClass().getClassLoader().getResource("hazelcast-default.yaml"); assertNotNull(url); String decodedURL = URLDecoder.decode(url.getFile(), "UTF-8"); System.setProperty("hazelcast.config", decodedURL); Config config = new YamlConfigBuilder().build(); URL file = new URL("file:"); URL encodedURL = new URL(file, decodedURL); assertEquals(encodedURL, config.getConfigurationUrl()); }

Target:
public void testConfigurationWithFile() throws Exception { URL url = getClass().getClassLoader().getResource("hazelcast-default.yaml"); String decodedURL = URLDecoder.decode(url.getFile(), "UTF-8"); System.setProperty("hazelcast.config", decodedURL); Config config = new YamlConfigBuilder().build(); URL file = new URL("file:"); URL encodedURL = new URL(file, decodedURL); assertEquals(encodedURL, config.getConfigurationUrl()); }
Source:
public void onBrowserEvent(Context context, Element parent, T value, NativeEvent event, ValueUpdater<T> valueUpdater) { super.onBrowserEvent(context, parent, value, event, valueUpdater); int eventX = event.getClientX(); int eventY = event.getClientY(); if ("click".equals(event.getType())) { EventTarget eventTarget = event.getEventTarget(); if (parent.getFirstChildElement().isOrHasChild(Element.as(eventTarget))) { menuPanelPopup.asPopupPanel().showAndFitToScreen(eventX, eventY); } } else if("mouseover".equals(event.getType())) { if (isVisible(value)) { parent.getStyle().setBorderColor("#96B7D6"); } } else { parent.getStyle().setBorderColor("transparent"); } }

Target:
public void onBrowserEvent(Context context, Element parent, T value, NativeEvent event, ValueUpdater<T> valueUpdater) { super.onBrowserEvent(context, parent, value, event, valueUpdater); int eventX = event.getClientX(); int eventY = event.getClientY(); if ("click".equals(event.getType())) { EventTarget eventTarget = event.getEventTarget(); if (parent.getFirstChildElement().isOrHasChild(Element.as(eventTarget))) { menuPanelPopup.asPopupPanel().showAndFitToScreen(eventX, eventY); } } else if("mouseover".equals(event.getType())) { if (isVisible(value)) { parent.getFirstChildElement().getStyle().setBorderColor("#96B7D6"); } } else { parent.getFirstChildElement().getStyle().setBorderColor("transparent"); } }
Source:
private List<Field> sortByFieldName(List<Field> fields) { return fields.stream().sorted((o1, o2) -> o1.getName().compareTo(o2.getName())).collect(Collectors.toList()); }

Target:
private List<Field> sortByFieldName(List<Field> fields) { Collections.sort(fields, Comparator.comparing(Field::getName)); return fields; }
Source:
public static boolean isIdentitySample(Sample sample) { if (!isDetailedSample(sample)) return false; return sample instanceof Identity || ((DetailedSample) sample).getSampleClass().getSampleCategory().equals(Identity.CATEGORY_NAME); }

Target:
public static boolean isIdentitySample(Sample sample) { if (!isDetailedSample(sample)) return false; return sample instanceof Identity || safeCategoryCheck(sample, Identity.CATEGORY_NAME); }
Source:
public boolean isSegmentLoadedByServer(String serverKey, DataSegment segment) { DruidServerHolder holder = servers.get(serverKey); if (holder != null) { return holder.druidServer.getSegment(segment.getIdentifier()) != null; } else { return false; } }

Target:
public boolean isSegmentLoadedByServer(String serverKey, DataSegment segment) { DruidServerHolder holder = servers.get(serverKey); return holder != null && holder.druidServer.getSegment(segment.getIdentifier()) != null; }
Source:
public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { if (patchsetCreatedHook != null && patchsetCreatedHook.exists()) { final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add(change.getId().toString()); args.add(change.getProject().get()); args.add(change.getDest().getShortName()); args.add(patchSet.getRevision().get()); args.add(Integer.toString(patchSet.getPatchSetId())); runHook(getRepo(change), args); } }

Target:
public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add("--change"); args.add(change.getKey().get()); args.add("--project"); args.add(change.getProject().get()); args.add("--branch"); args.add(change.getDest().getShortName()); args.add("--sha1"); args.add(patchSet.getRevision().get()); args.add("--patchset"); args.add(Integer.toString(patchSet.getPatchSetId())); runHook(getRepo(change), args); }
Source:
public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation != null) { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; } else { stopLocationUpdatesWithPlayServices(); if (!isLocationManagerConnected()) { initializeLocationManager(context); } } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { mLocation = mLocationManager.getLastKnownLocation(mLocationProvider); return mLocation; } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }

Target:
public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation == null) { if (!isLocationManagerConnected()) { initializeLocationManager(context); } } else { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { mLocation = mLocationManager.getLastKnownLocation(mLocationProvider); return mLocation; } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }
Source:
private CFG(BlockTree tree, Symbol.MethodSymbol symbol) { methodSymbol = symbol; exitBlock = createBlock(); currentBlock = createBlock(exitBlock); for (StatementTree statementTree : Lists.reverse(tree.body())) { build(statementTree); } for (Block b : gotos) { assert b.successors.isEmpty(); Tree s = b.terminator; assert s != null; String label; if (s instanceof BreakStatementTree) { label = ((BreakStatementTree) s).label().name(); } else { label = ((ContinueStatementTree) s).label().name(); } Block target = labels.get(label); if (target == null) { throw new IllegalStateException("Undeclared label: " + label); } b.successors.add(target); } for (Block b : blocks) { for (Block successor : b.successors) { successor.predecessors.add(b); } } }

Target:
private CFG(BlockTree tree, Symbol.MethodSymbol symbol) { methodSymbol = symbol; exitBlock = createBlock(); currentBlock = createBlock(exitBlock); for (StatementTree statementTree : Lists.reverse(tree.body())) { build(statementTree); } for (Block b : gotos) { assert b.successors.isEmpty(); Tree s = b.terminator; assert s != null; String label; if (s.is(Tree.Kind.BREAK_STATEMENT)) { label = ((BreakStatementTree) s).label().name(); } else { label = ((ContinueStatementTree) s).label().name(); } Block target = labels.get(label); if (target == null) { throw new IllegalStateException("Undeclared label: " + label); } b.successors.add(target); } for (Block b : blocks) { for (Block successor : b.successors) { successor.predecessors.add(b); } } }
Source:
private synchronized CHANNEL getIdleChannel( AdvertisedSocketAddress catchUpAddress ) { CHANNEL channel = null; LinkedList<CHANNEL> channels = idleChannels.get( catchUpAddress ); if ( channels != null ) { channel = channels.poll(); if ( channel != null && !channel.isActive() ) { dispose( channel ); channel = null; } if ( channels.isEmpty() ) { idleChannels.remove( catchUpAddress ); } } return channel; }

Target:
private synchronized CHANNEL getIdleChannel( AdvertisedSocketAddress catchUpAddress ) { CHANNEL channel = null; LinkedList<CHANNEL> channels = idleChannels.get( catchUpAddress ); if ( channels != null ) { while ( (channel = channels.poll()) != null ) { if ( channel.isActive() ) { break; } } if ( channels.isEmpty() ) { idleChannels.remove( catchUpAddress ); } } return channel; }
Source:
private static int score(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { if (!matchesPartially(mbusChannelElements, channelElementValues)) { return -1; } int score = 0; if (mbusChannelElements.hasMbusIdentificationNumber() && channelElementValues.hasIdentificationNumber()) { score += 5; } if (mbusChannelElements.hasMbusManufacturerIdentification() && channelElementValues.hasManufacturerIdentification()) { score += 1; } if (mbusChannelElements.hasMbusVersion() && channelElementValues.hasVersion()) { score += 1; } if (mbusChannelElements.hasMbusDeviceTypeIdentification() && channelElementValues.hasDeviceTypeIdentification()) { score += 1; } return score; }

Target:
private static int score(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { if (!matchesPartially(mbusChannelElements, channelElementValues)) { return -1; } int score = 0; score += scoreForMbusIdentificationNumber(mbusChannelElements, channelElementValues, 5); score += scoreForMbusManufacturerIdentification(mbusChannelElements, channelElementValues, 1); score += scoreForMbusVersion(mbusChannelElements, channelElementValues, 1); score += scoreForMbusDeviceTypeIdentification(mbusChannelElements, channelElementValues, 1); return score; }
Source:
public Image stereotypeIconToDisplay() { Image icon = null; boolean displayIcon = NotationUtils.getBooleanValue(hostView, StereotypeDisplayUtils.DISPLAY_ICON, false); if (displayIcon) { Iterator<Stereotype> iter = getUMLElement().getAppliedStereotypes().iterator(); while (iter.hasNext() && null == icon) { Stereotype appliedStereotype = iter.next(); icon = Activator.getIconElement(getUMLElement(), appliedStereotype, false); } } return icon; }

Target:
public Image stereotypeIconToDisplay() { Image icon = null; boolean displayIcon = NotationUtils.getBooleanValue(hostView, StereotypeDisplayUtils.DISPLAY_ICON, false); if (displayIcon) { Stereotype appliedStereotype; Iterator<Stereotype> stereotypeIterator = getUMLElement().getAppliedStereotypes().iterator(); while (stereotypeIterator.hasNext() && null == icon) { appliedStereotype = stereotypeIterator.next(); icon = Activator.getIconElement(getUMLElement(), appliedStereotype, false); } } return icon; }
Source:
private void logCommandInfo() { final char EQUAL = '='; final char SEP = ','; StringBuilder info = new StringBuilder(); String sep = ""; for (String o : createInfo.keySet()) { info.append(sep); info.append(o); info.append(EQUAL); info.append(createInfo.get(o)); sep = (Character.valueOf(SEP)).toString(); } log.infoFormat("{0} {1}", getClass().getName(), info.toString()); }

Target:
private void logCommandInfo() { final char EQUAL = '='; final String SEP = ","; StringBuilder info = new StringBuilder(); String sep = ""; for (String o : createInfo.keySet()) { info.append(sep); info.append(o); info.append(EQUAL); info.append(createInfo.get(o)); sep = SEP; } log.infoFormat("{0} {1}", getClass().getName(), info.toString()); }
Source:
protected void reportResult(final String locationName, final RemotePolledService polledService, final PollStatus pollResult) { final OnmsMonitoringLocation location = this.monitoringLocationDao.get(locationName); final OnmsLocationSpecificStatus oldLocationSpecificStatus = this.locationSpecificStatusDao.getMostRecentStatusChange(location, polledService.getMonSvc()); if (oldLocationSpecificStatus == null || oldLocationSpecificStatus.getPollResult().getStatusCode() != pollResult.getStatusCode()) { final OnmsLocationSpecificStatus status = new OnmsLocationSpecificStatus(); status.setLocation(location); status.setMonitoredService(polledService.getMonSvc()); status.setPollResult(pollResult); this.locationSpecificStatusDao.saveStatusChange(status); try { sendRegainedOrLostServiceEvent(locationName, polledService.getMonSvc(), pollResult); } catch (final Exception e) { LOG.error("Unable to save result for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } } try { if (pollResult.getResponseTime() != null) { saveResponseTimeData(locationName, polledService.getMonSvc(), pollResult.getResponseTime(), polledService.getPkg()); } } catch (final Exception e) { LOG.error("Unable to save response time data for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } }

Target:
protected void reportResult(final String locationName, final RemotePolledService polledService, final PollStatus pollResult) { sessionUtils.withTransaction(() -> { final OnmsMonitoringLocation location = this.monitoringLocationDao.get(locationName); final OnmsLocationSpecificStatus oldLocationSpecificStatus = this.locationSpecificStatusDao.getMostRecentStatusChange(location, polledService.getMonSvc()); if (oldLocationSpecificStatus == null || oldLocationSpecificStatus.getPollResult().getStatusCode() != pollResult.getStatusCode() || (pollResult.getReason() != null && !pollResult.getReason().equals(oldLocationSpecificStatus.getPollResult().getReason()))) { final OnmsLocationSpecificStatus status = new OnmsLocationSpecificStatus(); status.setLocation(location); status.setMonitoredService(polledService.getMonSvc()); status.setPollResult(pollResult); this.locationSpecificStatusDao.saveStatusChange(status); try { sendRegainedOrLostServiceEvent(locationName, polledService.getMonSvc(), pollResult); } catch (final Exception e) { LOG.error("Unable to save result for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } } try { if (pollResult.getResponseTime() != null) { saveResponseTimeData(locationName, polledService.getMonSvc(), pollResult.getResponseTime(), polledService.getPkg()); } } catch (final Exception e) { LOG.error("Unable to save response time data for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } return null; }); }
Source:
public List<ActionImpl> getActions() { return actions; }

Target:
public List<Action> getActions() { return actions; }
Source:
public void assertCompleteness(@Nonnull final Set<String> sexGenotypes, @Nonnull final Set<String> contigs) { for (final String sexGenotype : sexGenotypes) { for (final String contig : contigs) { checkKey(sexGenotype, contig); } } }

Target:
private void assertCompleteness(@Nonnull final Set<String> sexGenotypes, @Nonnull final Set<String> contigs) { for (final String sexGenotype : sexGenotypes) { for (final String contig : contigs) { checkKey(sexGenotype, contig); } } }
Source:
public void readAdditionalItemData(NBTTagCompound nbt) { spells = ((List<Spell>) NBTExtras.NBTToList(nbt.getTagList("spells", Constants.NBT.TAG_STRING), (NBTTagString tag) -> Spell.get(tag.getString()))); super.readAdditionalItemData(nbt); }

Target:
public void readAdditionalItemData(NBTTagCompound nbt) { spells = ((List<Spell>) NBTHelper.getList(nbt.getTagList("spells", Constants.NBT.TAG_STRING), tag -> Spell.get(((NBTTagString) tag).getString()))); super.readAdditionalItemData(nbt); }
Source:
public void testQuantileAtValueDouble() { QuantileDigest qdigest = new QuantileDigest(1); addAll(qdigest, doubleToSortableLong(0), doubleToSortableLong(1), doubleToSortableLong(2), doubleToSortableLong(3), doubleToSortableLong(4), doubleToSortableLong(5), doubleToSortableLong(6), doubleToSortableLong(7), doubleToSortableLong(8), doubleToSortableLong(9)); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 5.6)", toHexString(qdigest)), DOUBLE, 0.6); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), -1.23)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 12.3)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), nan())", toHexString(qdigest)), DOUBLE, null); }

Target:
public void testQuantileAtValueDouble() { QuantileDigest qdigest = new QuantileDigest(1); ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).stream() .mapToLong(FloatingPointBitsConverterUtil::doubleToSortableLong) .forEach(qdigest::add); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 5.6)", toHexString(qdigest)), DOUBLE, 0.6); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), -1.23)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 12.3)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), nan())", toHexString(qdigest)), DOUBLE, null); }
Source:
protected void evalOpInternal(final Context context, final Supplier<GremlinExecutor> gremlinExecutorSupplier, final BindingSupplier bindingsSupplier) throws OpProcessorException { ResponseHandlerContext rhc = new ResponseHandlerContext(context); try { evalOpInternal(rhc, gremlinExecutorSupplier, bindingsSupplier); } catch (Exception ex) { logger.warn("Unable to process script evaluation request: " + ex, ex); rhc.writeAndFlush(ResponseMessage.build(context.getRequestMessage()) .code(ResponseStatusCode.SERVER_ERROR) .statusAttributeException(ex) .statusMessage(ex.getMessage()).create()); } }

Target:
protected void evalOpInternal(final Context context, final Supplier<GremlinExecutor> gremlinExecutorSupplier, final BindingSupplier bindingsSupplier) throws OpProcessorException { final ResponseHandlerContext rhc = new ResponseHandlerContext(context); try { evalOpInternal(rhc, gremlinExecutorSupplier, bindingsSupplier); } catch (Exception ex) { logger.warn("Unable to process script evaluation request: " + ex, ex); rhc.writeAndFlush(ResponseMessage.build(context.getRequestMessage()) .code(ResponseStatusCode.SERVER_ERROR) .statusAttributeException(ex) .statusMessage(ex.getMessage()).create()); } }
Source:
public void runAtDriver(RuntimeContainer container) { Connection connection = null; try { connection = SnowflakeRuntimeHelper.connect(container, rowProperties.getConnectionProperties()); if (rowProperties.usePreparedStatement.getValue()) { try (PreparedStatement pstmt = connection.prepareStatement(rowProperties.query.getValue())) { SnowflakePreparedStatementUtils.fillPreparedStatement(pstmt, rowProperties.preparedStatementTable); pstmt.execute(); } } else { try (Statement statement = connection.createStatement()) { statement.executeQuery(rowProperties.query.getValue()); } } } catch (SQLException e) { if (dieOnError) { throw new ComponentException(e); } LOGGER.error(I18N_MESSAGES.getMessage("error.queryExecution"), e); } catch (IOException ioe) { if (dieOnError) { throw new ComponentException(ioe); } LOGGER.error(I18N_MESSAGES.getMessage("error.acquiringConnection"), ioe); } finally { if (connection != null) { try { SnowflakeRuntimeHelper.closeConnection(container, connection, rowProperties.getConnectionProperties()); } catch (SQLException e) { if (dieOnError) { throw new ComponentException(e); } LOGGER.error(I18N_MESSAGES.getMessage("error.closeConnection"), e); } } } }

Target:
public void runAtDriver(RuntimeContainer container) { Connection connection = null; try { connection = createConnection(container); if (rowProperties.usePreparedStatement()) { try (PreparedStatement pstmt = connection.prepareStatement(rowProperties.getQuery())) { SnowflakePreparedStatementUtils.fillPreparedStatement(pstmt, rowProperties.preparedStatementTable); pstmt.execute(); } } else { try (Statement statement = connection.createStatement()) { statement.executeQuery(rowProperties.getQuery()); } } } catch (SQLException e) { throwComponentException(e, "error.queryExecution"); } catch (IOException ioe) { throwComponentException(ioe, "error.acquiringConnection"); } finally { if (connection != null) { try { closeConnection(container, connection); } catch (SQLException e) { throw new ComponentException(e); } } } }
Source:
protected boolean setAndValidateDiskProfiles() { if (getParameters().getDiskImage() != null && DiskStorageType.IMAGE == getParameters().getDiskImage().getDiskStorageType()) { Map<DiskImage, Guid> map = new HashMap<>(); map.put(getParameters().getDiskImage(), getStorageDomainId()); return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }

Target:
protected boolean setAndValidateDiskProfiles() { return validate(DiskProfileHelper.setAndValidateDiskProfiles(Collections.singletonMap(getParameters().getDiskImage(), getStorageDomainId()))); }
Source:
public int getNumPersistentStores() { return (int) getStoreNames().stream() .map(storeName -> getStorageFactoryClassName(storeName)) .filter(factoryName -> factoryName.isPresent()) .filter(factoryName -> factoryName.get().equals(PERSISTENT_STORE_FACTORY)) .count(); }

Target:
public int getNumPersistentStores() { return (int) getStoreNames().stream() .map(storeName -> getStorageFactoryClassName(storeName)) .filter(factoryName -> factoryName.isPresent()) .filter(factoryName -> !factoryName.get().equals(INMEMORY_KV_STORAGE_ENGINE_FACTORY)) .count(); }
Source:
public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final long maxAccelerationMS2; final long cosTheta; final long motionMask; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { final byte rawMaxByte = littleEndianDataInputStream.readByte(); maxAccelerationMS2 = UnsignedBytes.toInt(rawMaxByte) << 7; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask(1000 * maxAccelerationMS2, motionMask, cosTheta); }

Target:
public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final double maxAccelerationMS2; final long cosTheta; final long motionMask; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { final byte rawMaxByte = littleEndianDataInputStream.readByte(); maxAccelerationMS2 = (UnsignedBytes.toInt(rawMaxByte) << 7) * COUNTS_IN_G; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask((long) (1000 * maxAccelerationMS2), motionMask, cosTheta); }
Source:
public void testDestroy() throws Exception { final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); final DebugFilter filter = new DebugFilter(); checker.addFilter(filter); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); checker.addBeforeExecutionFileFilter(fileFilter); checker.destroy(); getAcceptFileStartedMethod().invoke(checker, "Some File Name"); getFireAuditStartedMethod().invoke(checker); getFireAuditFinished().invoke(checker); checker.fireFileStarted("Some File Name"); checker.fireFileFinished("Some File Name"); final SortedSet<LocalizedMessage> messages = new TreeSet<>(); messages.add(new LocalizedMessage(0, 0, "a Bundle", "message.key", new Object[] {"arg"}, null, getClass(), null)); checker.fireErrors("Some File Name", messages); assertFalse("Checker.destroy() doesn't remove listeners.", auditAdapter.wasCalled()); assertFalse("Checker.destroy() doesn't remove filters.", filter.wasCalled()); assertFalse("Checker.destroy() doesn't remove file filters.", fileFilter.wasCalled()); }

Target:
public void testDestroy() throws Exception { final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); final DebugFilter filter = new DebugFilter(); checker.addFilter(filter); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); checker.addBeforeExecutionFileFilter(fileFilter); checker.destroy(); checker.process(Collections.singletonList(new File("Some File Name"))); final SortedSet<LocalizedMessage> messages = new TreeSet<>(); messages.add(new LocalizedMessage(0, 0, "a Bundle", "message.key", new Object[] {"arg"}, null, getClass(), null)); checker.fireErrors("Some File Name", messages); assertFalse("Checker.destroy() doesn't remove listeners.", auditAdapter.wasCalled()); assertFalse("Checker.destroy() doesn't remove filters.", filter.wasCalled()); assertFalse("Checker.destroy() doesn't remove file filters.", fileFilter.wasCalled()); }
Source:
public EventBookingDTO updateBookingStatus(final String eventId, final Long userId, final BookingStatus bookingStatus, final Map additionalEventInformation) throws SegueDatabaseException { dao.updateStatus(eventId, userId, null, bookingStatus, additionalEventInformation); return this.getBookingByEventIdAndUserId(eventId, userId); }

Target:
public EventBookingDTO updateBookingStatus(final String eventId, final Long userId, final BookingStatus bookingStatus, final Map additionalEventInformation) throws SegueDatabaseException { return updateBookingStatus(eventId, userId, null, bookingStatus, additionalEventInformation); }
Source:
private void updatePing(EntityRef entity) { if(startMap.containsKey(entity) && endMap.containsKey(entity)) { ClientComponent clientComp = entity.getComponent(ClientComponent.class); long pingTime = Duration.between(startMap.get(entity), endMap.get(entity)).toMillis(); clientComp.ping = String.valueOf(pingTime) + "ms"; } }

Target:
private void updatePing(EntityRef entity) { if (startMap.containsKey(entity) && endMap.containsKey(entity)) { long pingTime = Duration.between(startMap.get(entity), endMap.get(entity)).toMillis(); pingMap.put(entity, pingTime); } }
Source:
protected void runOCBinary(MultiStatus multiStatus) { ConsoleUtils.registerConsoleListener(new ConsoleListener(this)); final MessageConsole console = showConsole(); final MessageConsoleStream os = console.newMessageStream(); os.setEncoding("UTF-8"); BufferedOutputStream stream = new BufferedOutputStream(os); try { final InputStream logs = new BufferedInputStream(capability.getLogs(true, key.container, OpenShiftBinaryOption.SKIP_TLS_VERIFY)); byte data = new byte [1024]; int read = 0; while(running && !os.isClosed() && (read = logs.read(data)) != -1){ os.write(data, 0, read); } } catch (OpenShiftException e) { OpenShiftUIActivator.getDefault().getLogger().logError(e); try { if(stream != null) stream.write(e.getMessage().getBytes()); } catch (IOException e1) { OpenShiftUIActivator.getDefault().getLogger().logError(e1); } } catch (IOException e) { if(!DOCUMENT_IS_CLOSED.equals(e.getMessage())) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception reading pod log inputstream", e); } } finally { try { if(stream != null) stream.close(); } catch (IOException e) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception while closing pod log inputstream", e); } } }

Target:
protected void runOCBinary(MultiStatus multiStatus) { ConsoleUtils.registerConsoleListener(new ConsoleListener(this)); final MessageConsole console = showConsole(); final MessageConsoleStream os = console.newMessageStream(); os.setEncoding("UTF-8"); try { final InputStream logs = new BufferedInputStream(capability.getLogs(true, key.container, OpenShiftBinaryOption.SKIP_TLS_VERIFY)); byte data = new byte [8192]; int read = 0; while(running && (read = logs.read(data)) != -1 && !os.isClosed()){ os.write(data, 0, read); } } catch (OpenShiftException e) { OpenShiftUIActivator.getDefault().getLogger().logError(e); try { if(os != null) os.write(e.getMessage().getBytes()); } catch (IOException e1) { OpenShiftUIActivator.getDefault().getLogger().logError(e1); } } catch (IOException e) { if(!DOCUMENT_IS_CLOSED.equals(e.getMessage())) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception reading pod log inputstream", e); } } finally { try { if(os != null) os.close(); } catch (IOException e) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception while closing pod log inputstream", e); } } }
Source:
private void addButtonAlignment(Button button, ButtonAlignment alignment) { switch (alignment) { case LEFT: button.addStyleName(resources.windowCss().buttonAlignLeft()); break; case RIGHT: button.addStyleName(resources.windowCss().buttonAlignRight()); break; } }

Target:
private void addButtonAlignment(Button button, ButtonAlignment alignment) { switch (alignment) { case LEFT: button.addStyleName(resources.windowCss().buttonAlignLeft()); break; case RIGHT: default: button.addStyleName(resources.windowCss().buttonAlignRight()); } }