auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public VisitDomainWrapper createRetrospectiveVisit(Patient patient, Location location, Date startDatetime, Date stopDatetime) throws ExistingVisitDuringTimePeriodException { Date actualStopDate = stopDatetime; if (stopDatetime == null){ stopDatetime = new Date(); } if (startDatetime.after(new Date())) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.startDateCannotBeInFuture"); } if (stopDatetime.after(new Date())) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.stopDateCannotBeInFuture"); } if (startDatetime.after(stopDatetime)) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.endDateBeforeStartDateMessage"); } if (hasVisitDuring(patient, location, startDatetime, stopDatetime)) { throw new ExistingVisitDuringTimePeriodException("emrapi.retrospectiveVisit.patientAlreadyHasVisit"); } Visit visit = buildVisit(patient, location, startDatetime); visit.setStopDatetime(actualStopDate); return wrap(visitService.saveVisit(visit)); }

Target:
public VisitDomainWrapper createRetrospectiveVisit(Patient patient, Location location, Date startDatetime, Date stopDatetime) throws ExistingVisitDuringTimePeriodException { if (startDatetime.after(new Date())) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.startDateCannotBeInFuture"); } if (stopDatetime != null && stopDatetime.after(new Date())) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.stopDateCannotBeInFuture"); } if (stopDatetime != null && startDatetime.after(stopDatetime)) { throw new IllegalArgumentException("emrapi.retrospectiveVisit.endDateBeforeStartDateMessage"); } if (hasVisitDuring(patient, location, startDatetime, stopDatetime)) { throw new ExistingVisitDuringTimePeriodException("emrapi.retrospectiveVisit.patientAlreadyHasVisit"); } Visit visit = buildVisit(patient, location, startDatetime); visit.setStopDatetime(stopDatetime); return wrap(visitService.saveVisit(visit)); }
Source:
@Override public void end() { checkThread(); if (ended) return; ended = true; sources.get(0).cancel(); assert downstream != null; downstream.end(); }

Target:
@Override public void end() { checkThread(); if (ended) return; ended = true; assert downstream != null; downstream.end(); }
Source:
protected String defaultErrorMessage(Description description, Representation representation) { if (actualAndExpectedHaveSameStringRepresentation()) { return defaultDetailedErrorMessage(description, representation); } return comparisonStrategy.isStandard() ? messageFormatter.format(description, representation, EXPECTED_BUT_WAS_MESSAGE, actual, expected) : messageFormatter.format(description, representation, EXPECTED_BUT_WAS_MESSAGE_USING_COMPARATOR, actual, expected, comparisonStrategy); }

Target:
private String defaultErrorMessage(Description description, Representation representation) { if (actualAndExpectedHaveSameStringRepresentation()) { return defaultDetailedErrorMessage(description, representation); } return comparisonStrategy.isStandard() ? messageFormatter.format(description, representation, EXPECTED_BUT_WAS_MESSAGE, actual, expected) : messageFormatter.format(description, representation, EXPECTED_BUT_WAS_MESSAGE_USING_COMPARATOR, actual, expected, comparisonStrategy); }
Source:
public synchronized void clientAddProperty(PlatformConnectedClient platformClient, String key, String value) { LOGGER.trace("[0] client property added ({}, key:{}, value:{})", platformClient, key, value); stripe.getServerByName(currentActive.getServerName()) .ifPresent(server -> { ClientIdentifier clientIdentifier = toClientIdentifier(platformClient); cluster.getClient(clientIdentifier) .ifPresent(client -> { client.addProperty(key, value); firingService.fireNotification(new ContextualNotification(client.getContext(), Notification.CLIENT_PROPERTY_ADDED.name())); }); }); }

Target:
public synchronized void clientAddProperty(PlatformConnectedClient platformClient, String key, String value) { LOGGER.trace("[0] client property added ({}, key:{}, value:{})", platformClient, key, value); stripe.getServerByName(currentActive.getServerName()) .ifPresent(server -> { ClientIdentifier clientIdentifier = toClientIdentifier(platformClient); cluster.getClient(clientIdentifier) .ifPresent(client -> { client.addProperty(key, value); firingService.fireNotification(new ContextualNotification(client.getContext(), Notification.CLIENT_PROPERTY_ADDED.name(), Collections.singletonMap(key, value))); }); }); }
Source:
public boolean disablePearlDamage(boolean allow) { pearlDamage = allow; return allow; }

Target:
public void disablePearlDamage(boolean allow) { pearlDamage = allow; }
Source:
private CatalogItem<?,?> addItemDto(CatalogItemDtoAbstract<?, ?> itemDto, boolean forceUpdate) { CatalogItem<?, ?> existingDto = checkItemIsDuplicateOrDisallowed(itemDto, true, forceUpdate); if (existingDto!=null) { log.trace("Using existing duplicate for catalog item {}", itemDto.getId()); return existingDto; } if (manualAdditionsCatalog==null) loadManualAdditionsCatalog(); manualAdditionsCatalog.addEntry(itemDto); getCatalog().addEntry(itemDto); if (log.isTraceEnabled()) { log.trace("Scheduling item for persistence addition: {}", itemDto.getId()); } if (itemDto.getCatalogItemType() == CatalogItemType.LOCATION) { @SuppressWarnings("unchecked") CatalogItem<Location,LocationSpec<?>> locationItem = (CatalogItem<Location, LocationSpec<?>>) itemDto; ((BasicLocationRegistry)mgmt.getLocationRegistry()).updateDefinedLocation(locationItem); } mgmt.getRebindManager().getChangeListener().onManaged(itemDto); return itemDto; }

Target:
private CatalogItem<?,?> addItemDto(CatalogItemDtoAbstract<?, ?> itemDto, boolean forceUpdate) { CatalogItem<?, ?> existingDto = checkItemAllowedAndIfSoReturnAnyDuplicate(itemDto, true, forceUpdate); if (existingDto!=null) { log.trace("Using existing duplicate for catalog item {}", itemDto.getId()); return existingDto; } if (manualAdditionsCatalog==null) loadManualAdditionsCatalog(); manualAdditionsCatalog.addEntry(itemDto); getCatalog().addEntry(itemDto); if (log.isTraceEnabled()) { log.trace("Scheduling item for persistence addition: {}", itemDto.getId()); } if (itemDto.getCatalogItemType() == CatalogItemType.LOCATION) { @SuppressWarnings("unchecked") CatalogItem<Location,LocationSpec<?>> locationItem = (CatalogItem<Location, LocationSpec<?>>) itemDto; ((BasicLocationRegistry)mgmt.getLocationRegistry()).updateDefinedLocation(locationItem); } mgmt.getRebindManager().getChangeListener().onManaged(itemDto); return itemDto; }
Source:
private void handleGenerationException(Throwable e) { Throwable cause = e.getCause(); if (cause instanceof IllegalArgumentException) { String msg = cause.getMessage(); if (msg.startsWith("New Version")) { notificationService.addImmediateErrorNotification(cause, "mapGenerator.tooNewVersion"); log.error("Map generation failed", cause); } else if (msg.startsWith("Old Version")) { notificationService.addImmediateErrorNotification(cause, "mapGenerator.tooOldVersion"); log.error("Map generation failed", cause); } else { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } } else { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } }

Target:
private void handleGenerationException(Throwable e) { Throwable cause = e.getCause(); if (cause instanceof InvalidParameterException) { notificationService.addImmediateErrorNotification(e, "mapGenerator.invalidName"); log.warn("Map generation failed", e); } else if (cause instanceof UnsupportedVersionException) { notificationService.addImmediateErrorNotification(cause, "mapGenerator.tooNewVersion"); log.warn("Map generation failed", e); } else if (cause instanceof OutdatedVersionException) { notificationService.addImmediateErrorNotification(cause, "mapGenerator.tooOldVersion"); log.warn("Map generation failed", e); } else { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.warn("Map generation failed", e); } }
Source:
public void process(final LGraph graph, final IElkProgressMonitor progressMonitor) { int layerIndex = 0; for (Layer layer : graph) { for (LNode node : layer.getNodes()) { final int previousLayerIndex = layerIndex - 1; Collections.sort(node.getPorts(), (p1, p2) -> { if (p1.getOutgoingEdges().isEmpty() && p2.getOutgoingEdges().isEmpty()) { Layer previousLayer = graph.getLayers().get(previousLayerIndex); LNode p1Node = p1.getIncomingEdges().get(0).getSource().getNode(); LNode p2Node = p2.getIncomingEdges().get(0).getSource().getNode(); for (LNode previousNode : previousLayer) { if (previousNode.equals(p1Node)) { return 1; } if (previousNode.equals(p2Node)) { return -1; } } } if (p1.getIncomingEdges().isEmpty() && p2.getIncomingEdges().isEmpty()) { return Integer.compare( p1.getOutgoingEdges().get(0).getProperty(InternalProperties.MODEL_ORDER), p2.getOutgoingEdges().get(0).getProperty(InternalProperties.MODEL_ORDER)); } if (p1.getOutgoingEdges().isEmpty() && p2.getIncomingEdges().isEmpty()) { return 1; } else { return -1; } }); } Collections.sort(layer.getNodes(), (n1, n2) -> { if (!n1.hasProperty(InternalProperties.MODEL_ORDER) || !n2.hasProperty(InternalProperties.MODEL_ORDER)) { return Integer.compare( getModelOrderFromConnectedEdges(n1), getModelOrderFromConnectedEdges(n2)); } return Integer.compare( n1.getProperty(InternalProperties.MODEL_ORDER), n2.getProperty(InternalProperties.MODEL_ORDER)); }); layerIndex++; } }

Target:
public void process(final LGraph graph, final IElkProgressMonitor progressMonitor) { int layerIndex = 0; for (Layer layer : graph) { final int previousLayerIndex = layerIndex == 0 ? 0 : layerIndex - 1; Layer previousLayer = graph.getLayers().get(previousLayerIndex); for (LNode node : layer.getNodes()) { if (node.getProperty(LayeredOptions.PORT_CONSTRAINTS) != PortConstraints.FIXED_ORDER || node.getProperty(LayeredOptions.PORT_CONSTRAINTS) != PortConstraints.FIXED_POS) { Map<LNode, Integer> targetNodeModelOrder = new HashMap<>(); node.getPorts().stream().filter(p -> !p.getOutgoingEdges().isEmpty()).forEach(p -> { LNode targetNode = getTargetNode(p); p.setProperty(InternalProperties.LONG_EDGE_TARGET_NODE, targetNode); if (targetNode != null) { int previousOrder = Integer.MAX_VALUE; if (targetNodeModelOrder.containsKey(targetNode)) { previousOrder = targetNodeModelOrder.get(targetNode); } targetNodeModelOrder.put(targetNode, Math.min(p.getOutgoingEdges().get(0).getProperty(InternalProperties.MODEL_ORDER), previousOrder)); } }); Collections.sort(node.getPorts(), new ModelOrderPortComparator(previousLayer, targetNodeModelOrder)); } } Collections.sort(layer.getNodes(), new ModelOrderNodeComparator(previousLayer, graph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER))); layerIndex++; } }
Source:
protected int processStatusCode(StatusLine statusLine) throws CustomResponseException { int statusCode = statusLine.getStatusCode(); if (statusCode >= 400 && statusCode < 452) { throw new CustomResponseException("Client error: " + statusLine.toString()); } else if (statusCode >= 500 && statusCode < 512) { throw new CustomResponseException("Server error: " + statusLine.toString()); } return statusCode; }

Target:
protected int processStatusCode(StatusLine statusLine) throws CustomResponseException { int statusCode = statusLine.getStatusCode(); if (statusCode >= 400 && statusCode <= 499) { throw new CustomResponseException("Client error: " + statusLine.toString()); } else if (statusCode >= 500 && statusCode <= 599) { throw new CustomResponseException("Server error: " + statusLine.toString()); } return statusCode; }
Source:
private void refresh(NodeStatus status) { Objects.requireNonNull(status); LOG.fine("Refreshing: " + status.getUri()); if (!status.getRegistrationSecret().equals(registrationSecret)) { LOG.severe(String.format("Node at %s failed to send correct registration secret.", status.getUri())); return; } Lock writeLock = lock.writeLock(); writeLock.lock(); try { Optional<Host> existing = hosts.stream() .filter(host -> host.getId().equals(status.getNodeId())) .findFirst(); if (existing.isPresent()) { LOG.fine("Modifying existing state"); existing.get().update(status); } else { LOG.info("Creating a new remote node for " + status.getUri()); Node node = new RemoteNode( tracer, clientFactory, status.getNodeId(), status.getUri(), status.getStereotypes().keySet()); add(node, status); } } finally { writeLock.unlock(); } }

Target:
private void refresh(NodeStatus status) { Objects.requireNonNull(status); LOG.fine("Refreshing: " + status.getUri()); if (! Objects.equals(status.getRegistrationSecret(), registrationSecret)) { LOG.severe(String.format("Node at %s failed to send correct registration secret. Node NOT registered.", status.getUri())); bus.fire(new NodeRejectedEvent(status.getUri())); return; } Lock writeLock = lock.writeLock(); writeLock.lock(); try { Optional<Host> existing = hosts.stream() .filter(host -> host.getId().equals(status.getNodeId())) .findFirst(); if (existing.isPresent()) { LOG.fine("Modifying existing state"); existing.get().update(status); } else { LOG.info("Creating a new remote node for " + status.getUri()); Node node = new RemoteNode( tracer, clientFactory, status.getNodeId(), status.getUri(), status.getStereotypes().keySet()); add(node, status); } } finally { writeLock.unlock(); } }
Source:
public PartitionFilter(@JsonProperty("hiveTableName") HiveTableName hiveTableName, @JsonProperty("parts") List<String> parts) { this.hiveTableName = hiveTableName; this.parts = ImmutableList.copyOf(parts); }

Target:
public PartitionFilter(@JsonProperty("hiveTableName") HiveTableName hiveTableName, @JsonProperty("parts") List<String> parts) { this.hiveTableName = requireNonNull(hiveTableName, "hiveTableName is null"); this.parts = ImmutableList.copyOf(requireNonNull(parts, "parts is null")); }
Source:
public List<ProjectDetail> call() { List<ProjectDetail> result = new ArrayList<ProjectDetail>(); for (Project.NameKey projectName : projectCache.all()) { try { result.add(projectDetailFactory.create(projectName).call()); } catch (NoSuchProjectException e) { continue; } } Collections.sort(result, new Comparator<ProjectDetail>() { public int compare(final ProjectDetail a, final ProjectDetail b) { return a.project.getName().compareTo(b.project.getName()); } }); return result; }

Target:
public List<ProjectDetail> call() { List<ProjectDetail> result = new ArrayList<ProjectDetail>(); for (Project.NameKey projectName : projectCache.all()) { try { result.add(projectDetailFactory.create(projectName).call()); } catch (NoSuchProjectException e) { } } Collections.sort(result, new Comparator<ProjectDetail>() { public int compare(final ProjectDetail a, final ProjectDetail b) { return a.project.getName().compareTo(b.project.getName()); } }); return result; }
Source:
public VdcUserConditionFieldAutoCompleter() { super(); mVerbs.add("NAME"); mVerbs.add("LASTNAME"); mVerbs.add("USRNAME"); mVerbs.add("DEPARTMENT"); mVerbs.add("GROUP"); mVerbs.add("TITLE"); mVerbs.add("ACTIVE"); mVerbs.add("ROLE"); mVerbs.add("TAG"); mVerbs.add("POOL"); mVerbs.add("TYPE"); buildCompletions(); getTypeDictionary().put("NAME", String.class); getTypeDictionary().put("LASTNAME", String.class); getTypeDictionary().put("USRNAME", String.class); getTypeDictionary().put("DEPARTMENT", String.class); getTypeDictionary().put("TITLE", String.class); getTypeDictionary().put("GROUP", String.class); getTypeDictionary().put("ACTIVE", Boolean.class); getTypeDictionary().put("ROLE", String.class); getTypeDictionary().put("TAG", String.class); getTypeDictionary().put("POOL", String.class); getTypeDictionary().put("TYPE", UserOrGroup.class); columnNameDict.put("NAME", "name"); columnNameDict.put("LASTNAME", "surname"); columnNameDict.put("USRNAME", "username"); columnNameDict.put("DEPARTMENT", "department"); columnNameDict.put("TITLE", "role"); columnNameDict.put("GROUP", "groups"); columnNameDict.put("ACTIVE", "active"); columnNameDict.put("ROLE", "mla_role"); columnNameDict.put("TAG", SyntaxChecker.TAG_COLUMN_NAME_IN_CRITERIA); columnNameDict.put("POOL", "vm_pool_name"); columnNameDict.put("TYPE", "user_group"); buildBasicValidationTable(); }

Target:
public VdcUserConditionFieldAutoCompleter() { super(); mVerbs.add("NAME"); mVerbs.add("LASTNAME"); mVerbs.add("USRNAME"); mVerbs.add("DEPARTMENT"); mVerbs.add("GROUP"); mVerbs.add("TITLE"); mVerbs.add("ACTIVE"); mVerbs.add("ROLE"); mVerbs.add("TAG"); mVerbs.add("POOL"); mVerbs.add("TYPE"); buildCompletions(); getTypeDictionary().put("NAME", String.class); getTypeDictionary().put("LASTNAME", String.class); getTypeDictionary().put("USRNAME", String.class); getTypeDictionary().put("DEPARTMENT", String.class); getTypeDictionary().put("TITLE", String.class); getTypeDictionary().put("GROUP", String.class); getTypeDictionary().put("ACTIVE", Boolean.class); getTypeDictionary().put("ROLE", String.class); getTypeDictionary().put("TAG", String.class); getTypeDictionary().put("POOL", String.class); getTypeDictionary().put("TYPE", UserOrGroup.class); columnNameDict.put("NAME", "name"); columnNameDict.put("LASTNAME", "surname"); columnNameDict.put("USRNAME", "username"); columnNameDict.put("DEPARTMENT", "department"); columnNameDict.put("TITLE", "role"); columnNameDict.put("GROUP", "groups"); columnNameDict.put("ACTIVE", "active"); columnNameDict.put("ROLE", "mla_role"); columnNameDict.put("TAG", "tag_name"); columnNameDict.put("POOL", "vm_pool_name"); columnNameDict.put("TYPE", "user_group"); buildBasicValidationTable(); }
Source:
private static String hashClasspathEntry(URL entry) throws IOException { InputStream is = entry.openStream(); try { DigestInputStream input = null; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); input = new DigestInputStream(new BufferedInputStream(is), digest); byte[] buffer = new byte[1024]; while (input.read(buffer) != -1) { } return Util.toHexString(digest.digest()); } catch (NoSuchAlgorithmException x) { throw new AssertionError(x); } finally { if (input != null) { input.close();; } } } finally { is.close(); } }

Target:
private static String hashClasspathEntry(URL entry) throws IOException { InputStream is = entry.openStream(); try { DigestInputStream input = null; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); input = new DigestInputStream(new BufferedInputStream(is), digest); byte[] buffer = new byte[1024]; while (input.read(buffer) != -1) { } return Util.toHexString(digest.digest()); } catch (NoSuchAlgorithmException x) { throw new AssertionError(x); } finally { if (input != null) { input.close(); } } } finally { is.close(); } }
Source:
public void testExtractValue() { SqlTester mySqlTester = tester(SqlLibrary.MYSQL); mySqlTester.checkNull("ExtractValue(NULL, ' mySqlTester.checkNull("ExtractValue('', NULL)"); mySqlTester.checkFails("ExtractValue('<a><b/></a>', '#/a/b')", "Illegal behavior '.*", true); mySqlTester.checkFails("ExtractValue('<a><b/></a></a>', '/b')", "Illegal behavior '.*", true); mySqlTester.checkString("ExtractValue('<a>c</a>', ' "c", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/a')", "ccc", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/a/b')", "ddd", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/b')", "", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b><b>eee</b></a>', ' "ddd eee", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a><b/></a>', 'count(/a/b)')", "1", "VARCHAR(2000)"); }

Target:
@Test public void testExtractValue() { SqlTester mySqlTester = tester(SqlLibrary.MYSQL); mySqlTester.checkNull("ExtractValue(NULL, ' mySqlTester.checkNull("ExtractValue('', NULL)"); mySqlTester.checkFails("ExtractValue('<a><b/></a>', '#/a/b')", "Illegal behavior '.*", true); mySqlTester.checkFails("ExtractValue('<a><b/></a></a>', '/b')", "Illegal behavior '.*", true); mySqlTester.checkString("ExtractValue('<a>c</a>', ' "c", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/a')", "ccc", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/a/b')", "ddd", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b></a>', '/b')", "", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a>ccc<b>ddd</b><b>eee</b></a>', ' "ddd eee", "VARCHAR(2000)"); mySqlTester.checkString("ExtractValue('<a><b/></a>', 'count(/a/b)')", "1", "VARCHAR(2000)"); }
Source:
public void start() { logger.fine("BundleManager.start"); installServices(); try { COMPONENT_COLLECTION_CACHE_FILE_URI=ResourceRegistry.getInstance().getResource("componentCollections/defaultComponentCollection.abd",RES_TYPE.WEB_DOCUMENT_ROOT); LOADER_COMPONENTLIST_CACHE_FILE_URI=ResourceRegistry.getInstance().getResource(LOADER_COMPONENTLIST_LOCATION,RES_TYPE.PROFILE); if(ResourceRegistry.getInstance().isOSGIMode()) { String md5Sum=generateMD5Sum(); if(bundleChangeDetected(md5Sum)||cacheFileMissing()) { generateCacheFiles(); } storeMD5Sum(md5Sum); } initComponentTypeIDToJarNameMap(); logger.fine("BundleManager initialization finished"); } catch (IOException | ParseException | URISyntaxException | NoSuchAlgorithmException e1) { AstericsErrorHandling.instance.reportError(null, "Could not create cache for Asterics components:\n" + e1.getMessage()); } }

Target:
public void start() { logger.fine("BundleManager.start"); AREProperties.instance.getProperty(ARE_GENERATE_CACHES_FROM_INSTALLABLE_BUNDLES_PROP_KEY, "false", "Enable/Disable if bundles should be tested for being installable on this platform via OSGI"); installServices(); try { COMPONENT_COLLECTION_CACHE_FILE_URI = ResourceRegistry.getInstance().getResource(DEFAULT_COMPONENT_COLLECTION_ABD, RES_TYPE.WEB_DOCUMENT_ROOT); LOADER_COMPONENTLIST_CACHE_FILE_URI = ResourceRegistry.getInstance().getResource(LOADER_COMPONENTLIST_LOCATION, RES_TYPE.TMP); if (ResourceRegistry.getInstance().isOSGIMode()) { String mdSum = generateMDSum(); if (cacheFileMissing() || bundleChangeDetected(mdSum)) { generateCacheFiles(); } storeMDSum(mdSum); } initComponentTypeIDToJarNameMap(); logger.fine("BundleManager initialization finished"); } catch (IOException | ParseException | URISyntaxException | NoSuchAlgorithmException e1) { AstericsErrorHandling.instance.reportError(null, "Could not create cache for Asterics components:\n" + e1.getMessage()); } }
Source:
private Map<StatsReportType, StatsSnapshot> generateRandomSnapshot() { Map<String, StatsSnapshot> accountMap = new HashMap<>(); Map<String, StatsSnapshot> account_container_Map = new HashMap<>(); long totalSize = 0; for (int i = 0; i < random.nextInt(MAX_ACCOUNT_COUNT - MIN_ACCOUNT_COUNT + 1) + MIN_ACCOUNT_COUNT; i++) { String accountIdStr = "Account[".concat(String.valueOf(i)).concat("]"); Map<String, StatsSnapshot> containerMap = new HashMap<>(); long subTotalSize = 0; for (int j = 0; j < random.nextInt(MAX_CONTAINER_COUNT - MIN_CONTAINER_COUNT + 1) + MIN_CONTAINER_COUNT; j++) { String containerIdStr = "Container[".concat(String.valueOf(j)).concat("]"); long validSize = random.nextInt(2501) + 500; subTotalSize += validSize; containerMap.put(containerIdStr, new StatsSnapshot(validSize, null)); account_container_Map.put(accountIdStr + "_" + containerIdStr, new StatsSnapshot(validSize, null)); } totalSize += subTotalSize; accountMap.put(accountIdStr, new StatsSnapshot(subTotalSize, containerMap)); } Map<StatsReportType, StatsSnapshot> allSnapshots = new HashMap<>(); allSnapshots.put(StatsReportType.PARTITION_CLASS_REPORT, new StatsSnapshot(totalSize, account_container_Map)); allSnapshots.put(StatsReportType.ACCOUNT_REPORT, new StatsSnapshot(totalSize, accountMap)); return allSnapshots; }

Target:
private Map<StatsReportType, StatsSnapshot> generateRandomSnapshot() { Map<String, StatsSnapshot> accountMap = new HashMap<>(); Map<String, StatsSnapshot> accountContainerPairMap = new HashMap<>(); long totalSize = 0; for (int i = 0; i < random.nextInt(MAX_ACCOUNT_COUNT - MIN_ACCOUNT_COUNT + 1) + MIN_ACCOUNT_COUNT; i++) { String accountIdStr = "Account[".concat(String.valueOf(i)).concat("]"); Map<String, StatsSnapshot> containerMap = new HashMap<>(); long subTotalSize = 0; for (int j = 0; j < random.nextInt(MAX_CONTAINER_COUNT - MIN_CONTAINER_COUNT + 1) + MIN_CONTAINER_COUNT; j++) { String containerIdStr = "Container[".concat(String.valueOf(j)).concat("]"); long validSize = random.nextInt(2501) + 500; subTotalSize += validSize; containerMap.put(containerIdStr, new StatsSnapshot(validSize, null)); accountContainerPairMap.put(accountIdStr + Utils.ACCOUNT_CONTAINER_SEPARATOR + containerIdStr, new StatsSnapshot(validSize, null)); } totalSize += subTotalSize; accountMap.put(accountIdStr, new StatsSnapshot(subTotalSize, containerMap)); } Map<StatsReportType, StatsSnapshot> allSnapshots = new HashMap<>(); allSnapshots.put(StatsReportType.PARTITION_CLASS_REPORT, new StatsSnapshot(totalSize, accountContainerPairMap)); allSnapshots.put(StatsReportType.ACCOUNT_REPORT, new StatsSnapshot(totalSize, accountMap)); return allSnapshots; }
Source:
public boolean onTouchEvent(@NonNull final TextView widget, @NonNull final Spannable buffer, @NonNull final MotionEvent event) { final int action = event.getAction(); if (action == MotionEvent.ACTION_UP) { final int x = (int) event.getX() - widget.getTotalPaddingLeft() + widget.getScrollX(); final int y = (int) event.getY() - widget.getTotalPaddingTop() + widget.getScrollY(); final Layout layout = widget.getLayout(); final int line = layout.getLineForVertical(y); final int off = layout.getOffsetForHorizontal(line, x); final URLSpan[] links = buffer.getSpans(off, off, URLSpan.class); if (links.length != 0) { String url = decodeURL(links[0].getURL()); handler.onUrlClick(url, null); return true; } } return super.onTouchEvent(widget, buffer, event); }

Target:
public boolean onTouchEvent(@NonNull final TextView widget, @NonNull final Spannable buffer, @NonNull final MotionEvent event) { final int action = event.getAction(); if (action == MotionEvent.ACTION_UP) { final int x = (int) event.getX() - widget.getTotalPaddingLeft() + widget.getScrollX(); final int y = (int) event.getY() - widget.getTotalPaddingTop() + widget.getScrollY(); final Layout layout = widget.getLayout(); final int line = layout.getLineForVertical(y); final int off = layout.getOffsetForHorizontal(line, x); final URLSpan[] links = buffer.getSpans(off, off, URLSpan.class); if (links.length != 0) { String url = decodeURL(links[0].getURL()); handler.onUrlClick(url, UriUtil.getTitleFromUrl(url)); return true; } } return super.onTouchEvent(widget, buffer, event); }
Source:
protected void configure() { Multibinder<ServicePlugin> plugins = Multibinder.newSetBinder(binder(), ServicePlugin.class); plugins.addBinding().toInstance(Plugins.of(new HttpBackend(port))); install(new ServletModule() { @Override protected void configureServlets() { bind(TestServlet.class).in(Singleton.class); serve("/test").with(TestServlet.class); } }); install(new SitebricksModule() { @Override protected void configureSitebricks() { at("/testservice").serve(ExampleService.class); at("/r/controllers").serve(ApControllerService.class); at("/r/aps").serve(AccessPointService.class); at("/r/operators").serve(OperatorService.class); at("/r/rgs").serve(RoamingGroupService.class); } }); }

Target:
protected void configure() { Multibinder<ServicePlugin> plugins = Multibinder.newSetBinder(binder(), ServicePlugin.class); plugins.addBinding().toInstance(Plugins.of(new HttpBackend(port))); install(new ServletModule() { @Override protected void configureServlets() { bind(TestServlet.class).in(Singleton.class); serve("/test").with(TestServlet.class); } }); install(new SitebricksModule() { @Override protected void configureSitebricks() { at("/testservice").serve(ExampleService.class); at("/r/controllers").serve(ApControllerService.class); at("/r/aps").serve(AccessPointService.class); at("/r/operators").serve(OperatorService.class); at("/r/roaming-groups").serve(RoamingGroupService.class); } }); }
Source:
public void resetCookie(String name, String path) { throw new IllegalStateException("Not supported yet"); }

Target:
public void resetCookie(String name, String path) { throw new UnsupportedOperationException("Not supported yet"); }
Source:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { final double rowCount = mq.getRowCount(this.input).doubleValue(); double toSort = this.fetch == null ? rowCount : RexLiteral.intValue(this.fetch); if (this.offset != null) { toSort += RexLiteral.intValue(this.offset); } toSort = Math.min(rowCount, toSort); final double lookup = Math.max(1., Math.log(toSort)); final double bytesPerRow = this.getRowType().getFieldCount() * 4.; final double cpu = (rowCount * lookup) * bytesPerRow; RelOptCost cost = planner.getCostFactory().makeCost(rowCount, cpu, 0); return cost; }

Target:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { final double rowCount = mq.getRowCount(this.input).doubleValue(); double toSort = getValue(this.fetch, rowCount); if (this.offset != null) { toSort += getValue(this.offset, rowCount); } toSort = Math.min(rowCount, toSort); final double lookup = Math.max(1., Math.log(toSort)); final double bytesPerRow = this.getRowType().getFieldCount() * 4.; final double cpu = (rowCount * lookup) * bytesPerRow; RelOptCost cost = planner.getCostFactory().makeCost(rowCount, cpu, 0); return cost; }
Source:
public ValidationTopology(String defaultPropertyFile, String providedPropertyFile, String defaultValidationPropertiesFile, String providedValidationPropertiesFile) { topologyProperties = new Properties(); PropertyFileLoader.loadPropertyFile(defaultPropertyFile, providedPropertyFile, topologyProperties); loadValidationProperties(defaultValidationPropertiesFile, providedValidationPropertiesFile); brokerHosts = new ZkHosts(topologyProperties.getProperty(TopologyPropertyKeys.INPUT_ZOOKEEPER_ADDRESS)); }

Target:
public ValidationTopology(String defaultPropertyFile, String providedPropertyFile, String defaultValidationPropertiesFile, String providedValidationPropertiesFile) { PropertyFileLoader.loadPropertyFile(defaultPropertyFile, providedPropertyFile, topologyProperties); PropertyFileLoader.loadPropertyFile(defaultValidationPropertiesFile, providedValidationPropertiesFile, validationProperties); brokerHosts = new ZkHosts(topologyProperties.getProperty(TopologyPropertyKeys.INPUT_ZOOKEEPER_ADDRESS)); }
Source:
private List<Feature> getRepositoryFeatures(String repositoryName) { List<Feature> repoFeatures = new ArrayList<Feature>(); for (Repository repository : featuresService.listRepositories()) { if (repository.getName().equalsIgnoreCase(repositoryName)) { try { repoFeatures = Arrays.asList(repository.getFeatures()); } catch (Exception ex) { logger.warn("getRepositoryFeatures Exception: " + ex.getMessage(), ex); } break; } } return repoFeatures; }

Target:
private List<Feature> getRepositoryFeatures(String repositoryName) { List<Feature> repoFeatures = new ArrayList<Feature>(); for (Repository repository : featuresService.listRepositories()) { if (repository.getName().equalsIgnoreCase(repositoryName)) { try { repoFeatures = Arrays.asList(repository.getFeatures()); } catch (Exception ex) { logger.warn("Could not get Repository Features", ex); } break; } } return repoFeatures; }
Source:
private static String getEffectiveLogDirectory(String file) { String logDir; logDir = System.getenv("GO_AGENT_LOG_DIR") == null ? System.getenv("LOG_DIR") : System.getenv("GO_AGENT_LOG_DIR"); if (logDir == null) { logDir = "logs"; } return logDir + "/" + file; }

Target:
private static String getEffectiveLogDirectory(String file) { return getLogDir() + "/" + file; }
Source:
public void connectOtherProfile(BluetoothDevice device, int firstProfileStatus){ if ((mHandler.hasMessages(MESSAGE_CONNECT_OTHER_PROFILES) == false) && (isQuietModeEnabled()== false)){ ParcelUuid[] featureUuids = device.getUuids(); if ((!(BluetoothUuid.containsAnyUuid(featureUuids, A2DP_SOURCE_SINK_UUIDS))) || (!(BluetoothUuid.isUuidPresent(featureUuids, BluetoothUuid.Handsfree)))) { Log.v(TAG,"Initiate SDP for Missing UUID's support in remote"); device.fetchUuidsWithSdp(); } Message m = mHandler.obtainMessage(MESSAGE_CONNECT_OTHER_PROFILES); m.obj = device; m.arg1 = (int)firstProfileStatus; if (isConnectTimeoutDelayApplicable(device)) { mHandler.sendMessageDelayed(m,CONNECT_OTHER_PROFILES_TIMEOUT_DELAYED); } else { mHandler.sendMessageDelayed(m,CONNECT_OTHER_PROFILES_TIMEOUT); } } }

Target:
public void connectOtherProfile(BluetoothDevice device, int firstProfileStatus){ if ((mHandler.hasMessages(MESSAGE_CONNECT_OTHER_PROFILES) == false) && (isQuietModeEnabled()== false)){ ParcelUuid[] featureUuids = device.getUuids(); if ((!(BluetoothUuid.containsAnyUuid(featureUuids, A2DP_SOURCE_SINK_UUIDS))) || (!(BluetoothUuid.isUuidPresent(featureUuids, BluetoothUuid.Handsfree)))) { Log.v(TAG,"Initiate SDP for Missing UUID's support in remote"); device.fetchUuidsWithSdp(); } Message m = mHandler.obtainMessage(MESSAGE_CONNECT_OTHER_PROFILES); m.obj = device; m.arg1 = (int)firstProfileStatus; mHandler.sendMessageDelayed(m,CONNECT_OTHER_PROFILES_TIMEOUT); } }
Source:
public static void closeSecondaryShells(SWTWorkbenchBot bot) { SWTBotShell[] shells = bot.shells(); SWTBotShell mainShell = getMainShell(shells); if (mainShell == null) { return; } Arrays.stream(shells) .filter(shell -> shell != mainShell) .filter(SWTBotShell::isVisible) .forEach((shell) -> { log.debug(MessageFormat.format("Closing ligering shell with title {0}", shell.getText())); shell.close(); }); }

Target:
public static void closeSecondaryShells(SWTWorkbenchBot bot) { SWTBotShell[] shells = bot.shells(); SWTBotShell mainShell = getMainShell(shells); if (mainShell == null) { return; } Arrays.stream(shells) .filter(shell -> shell != mainShell) .filter(SWTBotShell::isVisible) .peek(shell -> log.debug(MessageFormat.format("Closing ligering shell with title {0}", shell.getText()))) .forEach(SWTBotShell::close); }
Source:
private Object execute(ElasticsearchParameterAccessor parameterAccessor) { ResultProcessor processor = queryMethod.getResultProcessor().withDynamicProjection(parameterAccessor); Query query = createQuery( new ConvertingParameterAccessor(elasticsearchOperations.getElasticsearchConverter(), parameterAccessor)); Class<?> typeToRead = processor.getReturnedType().getTypeToRead(); String indexName = queryMethod.getEntityInformation().getIndexName(); String indexTypeName = queryMethod.getEntityInformation().getIndexTypeName(); ReactiveElasticsearchQueryExecution execution = getExecution(parameterAccessor, new ResultProcessingConverter(processor, elasticsearchOperations, instantiators)); return execution.execute(query, processor.getReturnedType().getDomainType(), indexName, indexTypeName, typeToRead); }

Target:
private Object execute(ElasticsearchParameterAccessor parameterAccessor) { ResultProcessor processor = queryMethod.getResultProcessor().withDynamicProjection(parameterAccessor); Query query = createQuery( new ConvertingParameterAccessor(elasticsearchOperations.getElasticsearchConverter(), parameterAccessor)); Class<?> typeToRead = processor.getReturnedType().getTypeToRead(); String indexName = queryMethod.getEntityInformation().getIndexName(); String indexTypeName = queryMethod.getEntityInformation().getIndexTypeName(); ReactiveElasticsearchQueryExecution execution = getExecution(parameterAccessor, new ResultProcessingConverter(processor, elasticsearchOperations)); return execution.execute(query, processor.getReturnedType().getDomainType(), indexName, indexTypeName, typeToRead); }
Source:
public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; try (RevWalk walk = new RevWalk(repo)) { Ref ref = repo.findRef(notesRef); if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }

Target:
public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; try (RevWalk walk = new RevWalk(repo)) { Ref ref = repo.exactRef(notesRef); if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
Source:
protected GenericDatabaseDialect newSinkDialectFor(Set<String> tableTypes) { if (tableTypes != null) { connProps.put(JdbcSinkConfig.TABLE_TYPES_CONFIG, StringUtils.join(tableTypes, ",")); } else { connProps.remove(JdbcSinkConfig.TABLE_TYPES_CONFIG); } sinkConfig = new JdbcSinkConfig(connProps); dialect = createDialect(sinkConfig); assertTrue(dialect.tableTypes.containsAll(tableTypes)); return dialect; }

Target:
protected GenericDatabaseDialect newSinkDialectFor(Set<String> tableTypes) { assertNotNull(tableTypes); assertFalse(tableTypes.isEmpty()); connProps.put(JdbcSinkConfig.TABLE_TYPES_CONFIG, StringUtils.join(tableTypes, ",")); sinkConfig = new JdbcSinkConfig(connProps); dialect = createDialect(sinkConfig); assertTrue(dialect.tableTypes.containsAll(tableTypes)); return dialect; }
Source:
public void handleReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleReplaceKeysResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(GET_FIRMWARE_VERSION_RESPONSE_NOT_OK, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), result, exception, null, deviceMessageMetadata.getMessagePriority()), deviceMessageMetadata .getMessageType()); }

Target:
public void handleReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleReplaceKeysResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Replace Keys Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), result, exception, null, deviceMessageMetadata.getMessagePriority()), deviceMessageMetadata .getMessageType()); }
Source:
public void insertLatestOrNewModifications(Material material, MaterialInstance materialInstance, File folder, Modifications list) { List<Modification> newChanges = list.isEmpty() ? materialChecker.findLatestModification(folder, material, subprocessExecutionContext) : materialService.modificationsSince(material, folder, list.latestRevision(material), subprocessExecutionContext); if (newChanges.isEmpty()) { LOGGER.debug( String.format("[Material Update] Did not find any new modifications for material '%s' with flyweight '%s' using working directory '%s'", material, material.getFingerprint(), folder.getAbsolutePath())); } else { LOGGER.info("[Material Update] Found '{}' modifications for material '{}' with flyweight '{}' using working directory '{}'", newChanges.size(), material, material.getFingerprint(), folder.getAbsolutePath()); materialRepository.saveModifications(materialInstance, newChanges); } }

Target:
public void insertLatestOrNewModifications(Material material, MaterialInstance materialInstance, File folder, Modifications list) { List<Modification> newChanges = list.isEmpty() ? materialChecker.findLatestModification(folder, material, subprocessExecutionContext) : materialService.modificationsSince(material, folder, list.latestRevision(material), subprocessExecutionContext); if (newChanges.isEmpty()) { LOGGER.debug("[Material Update] Did not find any new modifications for material '{}' with flyweight '{}' using working directory '{}'", material, material.getFingerprint(), folder.getAbsolutePath()); } else { LOGGER.info("[Material Update] Found '{}' modifications for material '{}' with flyweight '{}' using working directory '{}'", newChanges.size(), material, material.getFingerprint(), folder.getAbsolutePath()); materialRepository.saveModifications(materialInstance, newChanges); } }
Source:
private T copyBufferAndGet(ByteBuffer valueBuffer, int startOffset, int endOffset) { ByteBuffer copyValueBuffer = valueBuffer.asReadOnlyBuffer(); final int size = endOffset > startOffset ? endOffset - startOffset : copyValueBuffer.get(startOffset - Integer.BYTES); copyValueBuffer.position(startOffset); return strategy.fromByteBuffer(copyValueBuffer, size); }

Target:
private T copyBufferAndGet(ByteBuffer valueBuffer, int startOffset, int endOffset) { ByteBuffer copyValueBuffer = valueBuffer.asReadOnlyBuffer(); int size = endOffset - startOffset; if (size == 0 && (NullHandling.replaceWithDefault() || copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { return null; } copyValueBuffer.position(startOffset); return strategy.fromByteBuffer(copyValueBuffer, size); }
Source:
public AccountsBrowser(RelationshipBrowser relationshipBrowser) { this.relationshipBrowser = relationshipBrowser; initComponents(); outline = outlineView.getOutline(); outlineView.setPropertyColumns( "device", Bundle.AccountNode_device(), "type", Bundle.AccountNode_accountType(), "count", Bundle.AccountNode_messageCount() ); outline.setRootVisible(false); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AccountNode_accountName()); outline.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); outline.setColumnSorted(3, false, 1); accountsTableEM.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) { final Node[] selectedNodes = accountsTableEM.getSelectedNodes(); final Set<AccountDeviceInstance> accountDeviceInstances = new HashSet<>(); CommunicationsFilter filter = null; for (final Node node : selectedNodes) { accountDeviceInstances.add(((AccountDeviceInstanceNode) node).getAccountDeviceInstance()); filter = ((AccountDeviceInstanceNode)node).getFilter(); } relationshipBrowser.setSelectionInfo(new SelectionInfo(accountDeviceInstances, new HashSet<>(), filter)); } }); proxyLookup = new ProxyLookup(relationshipBrowser.getLookup(), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); }

Target:
public AccountsBrowser(RelationshipBrowser relationshipBrowser) { initComponents(); outline = outlineView.getOutline(); outlineView.setPropertyColumns( "device", Bundle.AccountNode_device(), "type", Bundle.AccountNode_accountType(), "count", Bundle.AccountNode_messageCount() ); outline.setRootVisible(false); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AccountNode_accountName()); outline.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); outline.setColumnSorted(3, false, 1); accountsTableEM.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) { final Node[] selectedNodes = accountsTableEM.getSelectedNodes(); final Set<AccountDeviceInstance> accountDeviceInstances = new HashSet<>(); CommunicationsFilter filter = null; for (final Node node : selectedNodes) { accountDeviceInstances.add(((AccountDeviceInstanceNode) node).getAccountDeviceInstance()); filter = ((AccountDeviceInstanceNode)node).getFilter(); } relationshipBrowser.setSelectionInfo(new SelectionInfo(accountDeviceInstances, new HashSet<>(), filter)); } }); proxyLookup = new ProxyLookup(relationshipBrowser.getLookup(), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); }
Source:
public static QueryId createQuery(DistributedQueryRunner queryRunner, Session session, String sql) { try { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQueryId(); queryManager.createQuery(queryId, new TestingSessionContext(session), sql) .get(); return queryId; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } catch (ExecutionException e) { Throwables.throwIfUnchecked(e.getCause()); throw new RuntimeException(e.getCause()); } }

Target:
public static QueryId createQuery(DistributedQueryRunner queryRunner, Session session, String sql) { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQueryId(); getFutureValue(queryManager.createQuery(queryId, new TestingSessionContext(session), sql)); return queryId; }
Source:
public CounterAspect(String fieldName, String label, Class<? extends ITmfEventAspect<?>>... groups) { super(fieldName, label); fGroups = groups; }

Target:
public CounterAspect(String fieldName, String label, Class<? extends ITmfEventAspect<?>>... groups) { super(fieldName, label); fGroups = Arrays.copyOf(groups, groups.length); }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); Matcher matcher; matcher = reSessionId.matcher(response); if (matcher.find()) { mSessionId = matcher.group(1); } else { throw new BankException(res.getText(R.string.unable_to_find).toString() + " session id."); } matcher = rePersonnr.matcher(response); if (matcher.find()) { mPersonnr = matcher.group(1); } else { throw new BankException(res.getText(R.string.unable_to_find).toString() + " personnummer."); } try { response = urlopen.open(String.format("<LINK_0>", mSessionId, mPersonnr)); matcher = reAccounts.matcher(response); while (matcher.find()) { String name = Html.fromHtml(matcher.group(2)).toString().trim(); Account account = new Account(name, Helpers.parseBalance(matcher.group(5)), matcher.group(1).trim()); if (name.contains("lån") || name.contains("Lån")) { account.setType(Account.LOANS); } else { balance = balance.add(Helpers.parseBalance(matcher.group(5))); } accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } } finally { super.updateComplete(); } }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); Matcher matcher; matcher = reSessionId.matcher(response); if (matcher.find()) { mSessionId = matcher.group(1); } else { throw new BankException(res.getText(R.string.unable_to_find).toString() + " session id."); } matcher = rePersonnr.matcher(response); if (matcher.find()) { mPersonnr = matcher.group(1); } else { throw new BankException(res.getText(R.string.unable_to_find).toString() + " personnummer."); } response = urlopen.open(String.format("<LINK_0>", mSessionId, mPersonnr)); matcher = reAccounts.matcher(response); while (matcher.find()) { String name = Html.fromHtml(matcher.group(2)).toString().trim(); Account account = new Account(name, Helpers.parseBalance(matcher.group(5)), matcher.group(1).trim()); if (name.contains("lån") || name.contains("Lån")) { account.setType(Account.LOANS); } else { balance = balance.add(Helpers.parseBalance(matcher.group(5))); } accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
public Object getResponse() { return true; }

Target:
public Object getResponse() { return response; }