auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { boolean isTracing = frame.header.flags.contains(Frame.Header.Flag.TRACING); boolean isCustomPayload = frame.header.flags.contains(Frame.Header.Flag.CUSTOM_PAYLOAD); UUID tracingId = isTracing ? CBUtil.readUUID(frame.body) : null; Map<String, ByteBuffer> customPayload = isCustomPayload ? CBUtil.readBytesMap(frame.body) : null; if (customPayload != null && logger.isTraceEnabled()) { logger.trace("Received payload: ({} bytes total)", printPayload(customPayload), CBUtil.sizeOfBytesMap(customPayload)); } boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING); List<String> warnings = hasWarnings ? CBUtil.readStringList(frame.body) : Collections.<String>emptyList(); try { CodecRegistry codecRegistry = ctx.channel().attr(CODEC_REGISTRY_ATTRIBUTE_KEY).get(); if (codecRegistry == null) codecRegistry = CodecRegistry.DEFAULT_INSTANCE; Response response = Response.Type.fromOpcode(frame.header.opcode).decoder.decode(frame.body, frame.header.version, codecRegistry); response .setTracingId(tracingId) .setWarnings(warnings) .setCustomPayload(customPayload) .setStreamId(frame.header.streamId); out.add(response); } finally { frame.body.release(); } }

Target:
protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { boolean isTracing = frame.header.flags.contains(Frame.Header.Flag.TRACING); boolean isCustomPayload = frame.header.flags.contains(Frame.Header.Flag.CUSTOM_PAYLOAD); UUID tracingId = isTracing ? CBUtil.readUUID(frame.body) : null; Map<String, ByteBuffer> customPayload = isCustomPayload ? CBUtil.readBytesMap(frame.body) : null; if (customPayload != null && logger.isTraceEnabled()) { logger.trace("Received payload: ({} bytes total)", printPayload(customPayload), CBUtil.sizeOfBytesMap(customPayload)); } boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING); List<String> warnings = hasWarnings ? CBUtil.readStringList(frame.body) : Collections.<String>emptyList(); try { CodecRegistry codecRegistry = ctx.channel().attr(CODEC_REGISTRY_ATTRIBUTE_KEY).get(); assert codecRegistry != null; Response response = Response.Type.fromOpcode(frame.header.opcode).decoder.decode(frame.body, frame.header.version, codecRegistry); response .setTracingId(tracingId) .setWarnings(warnings) .setCustomPayload(customPayload) .setStreamId(frame.header.streamId); out.add(response); } finally { frame.body.release(); } }
Source:
public static String locationToString(Location location) { return location.getLatitude() + " " + location.getLongitude() + " " + location.getAltitude() + " " + location.getAccuracy(); }

Target:
public static String locationToString(Location location) { return String.format("%s %s %s %s", location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getAccuracy()); }
Source:
public CharSequence toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this); if (height != null && width != null) { xml.attribute(attribute_height, Integer.toString(height)); xml.attribute(attribute_width, Integer.toString(width)); } xml.rightAngleBracket(); xml.append(getMediaXML()); return xml.closeElement(getElementName()); }

Target:
public CharSequence toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this); if (height != null && width != null) { xml.attribute(ATTRIBUTE_HEIGHT, height); xml.attribute(ATTRIBUTE_WIDTH, width); } xml.rightAngleBracket(); xml.append(getMediaXML()); return xml.closeElement(getElementName()); }
Source:
public void index(ObjectStream<Event> eventStream) throws IOException{ int cutoff=parameters.getIntParam(CUTOFF_PARAM, CUTOFF_DEFAULT); boolean sort=parameters.getBooleanParam(SORT_PARAM, SORT_DEFAULT); Map<String, Integer> predicateIndex = new HashMap<>(); LinkedList<Event> events; List<ComparableEvent> eventsToCompare; System.out.println("Indexing events using cutoff of " + cutoff + "\n"); System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream, predicateIndex, cutoff); System.out.println("done. " + events.size() + " events"); System.out.print("\tIndexing... "); eventsToCompare = index(events, predicateIndex); events = null; predicateIndex = null; System.out.println("done."); System.out.print("Sorting and merging events... "); sortAndMerge(eventsToCompare, sort); System.out.println("Done indexing."); }

Target:
public void index(ObjectStream<Event> eventStream) throws IOException { int cutoff = parameters.getIntParam(CUTOFF_PARAM, CUTOFF_DEFAULT); boolean sort = parameters.getBooleanParam(SORT_PARAM, SORT_DEFAULT); Map<String, Integer> predicateIndex = new HashMap<>(); List<Event> events; List<ComparableEvent> eventsToCompare; System.out.println("Indexing events using cutoff of " + cutoff + "\n"); System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream, predicateIndex, cutoff); System.out.println("done. " + events.size() + " events"); System.out.print("\tIndexing... "); eventsToCompare = index(events, predicateIndex); events = null; predicateIndex = null; System.out.println("done."); System.out.print("Sorting and merging events... "); sortAndMerge(eventsToCompare, sort); System.out.println("Done indexing."); }
Source:
public void testPrivateMethod() throws Exception { class Foo { @ServiceActivator private String service(String payload) { return payload.toUpperCase(); } } MessagingMethodInvokerHelper helper = new MessagingMethodInvokerHelper(new Foo(), ServiceActivator.class, false); assertEquals("FOO", helper.process(new GenericMessage<>("foo"))); }

Target:
public void testPrivateMethod() throws Exception { class Foo { @ServiceActivator private String service(String payload) { return payload.toUpperCase(); } } MessagingMethodInvokerHelper helper = new MessagingMethodInvokerHelper(new Foo(), ServiceActivator.class, false); assertEquals("FOO", helper.process(new GenericMessage<>("foo"))); assertEquals("BAR", helper.process(new GenericMessage<>("bar"))); }
Source:
public Set<ModelElementId> getAllInvolvedModelElements(AbstractChangePackage changePackage) { final Set<ModelElementId> result = new LinkedHashSet<ModelElementId>(); final ESCloseableIterable<AbstractOperation> operations = changePackage.operations(); for (final AbstractOperation op : operations.iterable()) { result.addAll(op.getAllInvolvedModelElements()); } return result; }

Target:
public Set<ModelElementId> getAllInvolvedModelElements(AbstractChangePackage changePackage) { final Set<ModelElementId> result = new LinkedHashSet<ModelElementId>(); final ESCloseableIterable<AbstractOperation> operations = changePackage.operations(); try { for (final AbstractOperation op : operations.iterable()) { result.addAll(op.getAllInvolvedModelElements()); } } finally { operations.close(); } return result; }
Source:
private String determineHeliosHost(final Info dockerInfo) throws HeliosDeploymentException { if (dockerHostAddressIsLocalhost() && !isDockerForMac(dockerInfo)) { log.info("checking that docker can be reached from within a container"); return checkDockerAndGetGateway(); } return dockerHost.address(); }

Target:
private String determineHeliosHost(final Info dockerInfo) throws HeliosDeploymentException { final String probeContainerGateway = checkDockerAndGetGateway(); if (dockerHostAddressIsLocalhost() && !isDockerForMac(dockerInfo)) { log.info("checking that docker can be reached from within a container"); return probeContainerGateway; } return dockerHost.address(); }
Source:
void shouldWriteMultiplePolygonsPerName() throws Exception { final Map<String, List<Polygon>> polygonListsByName = Map.of( "Belarus", List.of(polygon(new Point(1011, 1021), new Point(1012, 1022), new Point(1013, 1023))), "54 Sea Zone", List.of( polygon(new Point(2011, 2021), new Point(2012, 2022), new Point(2013, 2023)), polygon(new Point(2111, 2121), new Point(2112, 2122), new Point(2113, 2123))), "Philippines", List.of( polygon(new Point(3011, 3021), new Point(3012, 3022), new Point(3013, 3023)), polygon(new Point(3111, 3121), new Point(3112, 3122)), polygon(new Point(3211, 3221)))); final String content = writeToString(os -> PointFileReaderWriter.writeOneToManyPolygons(os, polygonListsByName)); assertThat(content, containsString("Belarus < (1011,1021) (1012,1022) (1013,1023) > ")); assertThat( content, containsString( "54 Sea Zone < (2011,2021) (2012,2022) (2013,2023) > " + " < (2111,2121) (2112,2122) (2113,2123) > ")); assertThat( content, containsString( "Philippines < (3011,3021) (3012,3022) (3013,3023) > " + " < (3111,3121) (3112,3122) > < (3211,3221) > ")); }

Target:
void shouldWriteMultiplePolygonsPerName() throws Exception { final Map<String, List<Polygon>> polygonListsByName = ImmutableMap.of( "Belarus", List.of(polygon(new Point(1011, 1021), new Point(1012, 1022), new Point(1013, 1023))), "54 Sea Zone", List.of( polygon(new Point(2011, 2021), new Point(2012, 2022), new Point(2013, 2023)), polygon(new Point(2111, 2121), new Point(2112, 2122), new Point(2113, 2123))), "Philippines", List.of( polygon(new Point(3011, 3021), new Point(3012, 3022), new Point(3013, 3023)), polygon(new Point(3111, 3121), new Point(3112, 3122)), polygon(new Point(3211, 3221)))); final String content = writeToString(os -> PointFileReaderWriter.writeOneToManyPolygons(os, polygonListsByName)); assertThat( content, is( "" + "Belarus < (1011,1021) (1012,1022) (1013,1023) > \r\n" + "54 Sea Zone < (2011,2021) (2012,2022) (2013,2023) > " + " < (2111,2121) (2112,2122) (2113,2123) > \r\n" + "Philippines < (3011,3021) (3012,3022) (3013,3023) > " + " < (3111,3121) (3112,3122) > < (3211,3221) > ")); }
Source:
public void deleteUnauthorizedEPersonNoAdminRights() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) .build(); String token = getAuthToken(eperson.getEmail(), password); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient(token) .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }

Target:
public void deleteUnauthorizedEPersonNoAdminRights() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) .build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient(token) .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }
Source:
public void saveConfig(DiskQuotaConfig config) throws IOException, ConfigurationException { if (!resourceProvider.hasOutput()) { log.error("Unable to save DiskQuota to resource :" + resourceProvider.getLocation()); return; } XStream xStream = getConfiguredXStream(new GeoWebCacheXStream()); log.debug("Saving disk quota config to " + resourceProvider.getLocation()); OutputStream configOut = resourceProvider.out(); try { xStream.toXML(config, new OutputStreamWriter(configOut, "UTF-8")); } catch (RuntimeException e) { log.error("Error saving DiskQuota config to file :" + resourceProvider.getLocation()); } finally { configOut.close(); } }

Target:
public void saveConfig(DiskQuotaConfig config) throws IOException, ConfigurationException { if (!resourceProvider.hasOutput()) { log.error("Unable to save DiskQuota to resource :" + resourceProvider.getLocation()); return; } XStream xStream = getConfiguredXStream(new GeoWebCacheXStream()); log.debug("Saving disk quota config to " + resourceProvider.getLocation()); try (OutputStream configOut = resourceProvider.out()) { xStream.toXML(config, new OutputStreamWriter(configOut, "UTF-8")); } catch (RuntimeException e) { log.error("Error saving DiskQuota config to file :" + resourceProvider.getLocation()); } }
Source:
public void evacuateServer() throws Exception { respondWith(JSON_SERVER_EVACUATE); ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); assertNotNull(password.getPassword()); }

Target:
public void evacuateServer() throws Exception { respondWith(JSON_SERVER_EVACUATE); ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); assertEquals(password.getPassword(), "MySecretPass"); }
Source:
private void updateLogPanel(Integer days) { logPanel.clearLogPanel(); Date trackDay = null; for (int i = gui.getCampaign().inMemoryLogHistory.size()-1; i >= 0; i--) { long diff = gui.getCampaign().getDate().getTime() - gui.getCampaign().inMemoryLogHistory.get(i).getDate().getTime(); if (TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS) < days) { if (!gui.getCampaign().inMemoryLogHistory.get(i).getDate().equals(trackDay)) { logPanel.appendLog(Collections.singletonList("<hr>")); logPanel.appendLog(Collections.singletonList("<b>"+dateFormat.format(gui.getCampaign().inMemoryLogHistory.get(i).getDate())+"</b>")); logPanel.appendLog(Collections.singletonList("<br><br>")); trackDay = gui.getCampaign().inMemoryLogHistory.get(i).getDate(); } logPanel.appendLog(Collections.singletonList(gui.getCampaign().inMemoryLogHistory.get(i).getDesc()+"<br>")); } } }

Target:
private void updateLogPanel(Integer days) { logPanel.clearLogPanel(); Date trackDay = null; long currentTime = gui.getCampaign().getDate().getTime(); for (LogEntry log : gui.getCampaign().inMemoryLogHistory) { long diff = currentTime - log.getDate().getTime(); if (TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS) < days) { if (!log.getDate().equals(trackDay)) { logPanel.appendLog(Collections.singletonList("<hr>")); logPanel.appendLog(Collections.singletonList("<b>"+dateFormat.format(log.getDate())+"</b>")); logPanel.appendLog(Collections.singletonList("<br><br>")); trackDay = log.getDate(); } logPanel.appendLog(Collections.singletonList(log.getDesc()+"<br>")); } } }
Source:
public static SnomedIdentifier of(String componentId) { checkArgument(!Strings.isNullOrEmpty(componentId), "ComponentId must be defined"); checkArgument(componentId.length() >= 6 && componentId.length() <= 18, "ComponentID's length should be between 6-18 character length"); final int checkDigit = Character.getNumericValue(componentId.charAt(componentId.length() - 1)); final int componentIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 2)); final int partitionIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 3)); final String namespace = partitionIdentifier == 0 ? null : componentId.substring(componentId.length() - 10, componentId.length() - 3); final long itemId = partitionIdentifier == 0 ? Long.parseLong(componentId.substring(0, componentId.length() - 3)) : Long .parseLong(componentId.substring(0, componentId.length() - 10)); return new SnomedIdentifierImpl(itemId, namespace, partitionIdentifier, componentIdentifier, checkDigit); }

Target:
public static SnomedIdentifier of(String componentId) { validate(componentId); final int checkDigit = Character.getNumericValue(componentId.charAt(componentId.length() - 1)); final int componentIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 2)); final int partitionIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 3)); final String namespace = partitionIdentifier == 0 ? null : componentId.substring(componentId.length() - 10, componentId.length() - 3); final long itemId = partitionIdentifier == 0 ? Long.parseLong(componentId.substring(0, componentId.length() - 3)) : Long .parseLong(componentId.substring(0, componentId.length() - 10)); return new SnomedIdentifierImpl(itemId, namespace, partitionIdentifier, componentIdentifier, checkDigit); }
Source:
public boolean onPrepareOptionsMenu(Menu menu) { invalidateOptionsMenu(); if (measurement.hasLogFile(this)) menu.findItem(R.id.viewLog).setVisible(false); if (measurement.report_id == null || measurement.report_id.isEmpty()) menu.findItem(R.id.copyExplorerUrl).setVisible(false); return super.onPrepareOptionsMenu(menu); }

Target:
public boolean onPrepareOptionsMenu(Menu menu) { invalidateOptionsMenu(); if (!measurement.hasLogFile(this)) menu.findItem(R.id.viewLog).setVisible(false); if (measurement.report_id == null || measurement.report_id.isEmpty()) menu.findItem(R.id.copyExplorerUrl).setVisible(false); return super.onPrepareOptionsMenu(menu); }
Source:
private void preparePOIDialog(int dialogId, Dialog dlg, Bundle args, int title) { Amenity a = (Amenity) args.getSerializable(KEY_AMENITY); Node n = (Node) args.getSerializable(KEY_AMENITY_NODE); dlg.setTitle(title); EditText nameText = ((EditText)dlg.findViewById(R.id.Name)); nameText.setText(a.getName()); EditText openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours)); openingHours.setText(a.getOpeningHours()); EditText streetnameText = ((EditText)dlg.findViewById(R.id.Phone)); streetnameText.setText(a.getPhone()); EditText housenumberText = ((EditText)dlg.findViewById(R.id.housenumber)); housenumberText.setText(a.getSite()); final TableLayout layout = ((TableLayout)dlg.findViewById(R.id.advancedModeTable)); layout.setVisibility(View.GONE); updateType(a); attachListeners(dialogId, dlg, a, n); }

Target:
private void preparePOIDialog(int dialogId, Dialog dlg, Bundle args, int title) { Amenity a = (Amenity) args.getSerializable(KEY_AMENITY); Node n = (Node) args.getSerializable(KEY_AMENITY_NODE); dlg.setTitle(title); EditText nameText = ((EditText)dlg.findViewById(R.id.Name)); nameText.setText(a.getName()); EditText openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours)); openingHours.setText(a.getOpeningHours()); EditText streetnameText = ((EditText)dlg.findViewById(R.id.Streetname)); streetnameText.setText(a.getStreetname()); EditText housenumberText = ((EditText)dlg.findViewById(R.id.Housenumber)); housenumberText.setText(a.getHousenumber()); final TableLayout layout = ((TableLayout)dlg.findViewById(R.id.advancedModeTable)); layout.setVisibility(View.GONE); updateType(a); attachListeners(dialogId, dlg, a, n); }
Source:
void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError( String.format("Attempted to complete action with no result!\n%s", this)); } if (callback != null) { callback.onSuccess(); } }

Target:
@Override void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError("Attempted to complete action with no result!\n" + this); } if (callback != null) { callback.onSuccess(); } }
Source:
private static long timeout(Properties props) { int result = 0; String timeout = PGProperty.LOGIN_TIMEOUT.get(props); if (timeout != null) { try { result = Integer.parseInt(timeout); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Couldn't parse loginTimeout value: {0}", timeout); } } if (result == 0) { result = DriverManager.getLoginTimeout(); } return result * 1000L; }

Target:
private static long timeout(Properties props) throws PSQLException { String timeoutVal = props.getProperty(PGProperty.LOGIN_TIMEOUT.getName()); boolean isPresent = (timeoutVal != null) && !timeoutVal.equals(PGProperty.LOGIN_TIMEOUT.getDefaultValue()); long result; if (isPresent) { result = (long) PGProperty.LOGIN_TIMEOUT.getFloat(props) * 1000L; } else { result = DriverManager.getLoginTimeout() * 1000L; } return result; }
Source:
public void start(ComponentContext context) { super.start(context); Collection<MongoDBConnectionConfig> confs = getDescriptors(XP_CONNECTION); confs.forEach(c -> { log.debug("Initializing MongoClient with id={}", c.getId()); clients.put(c.getId(), MongoDBConnectionHelper.newMongoClient(c.server)); }); }

Target:
public void start(ComponentContext context) { super.start(context); Collection<MongoDBConnectionConfig> confs = getDescriptors(XP_CONNECTION); confs.forEach(c -> { log.debug("Initializing MongoClient with id={}", c::getId); clients.put(c.getId(), MongoDBConnectionHelper.newMongoClient(c.server)); }); }
Source:
private List<EntityType> getEntityTypes() { Fetch fetch = new Fetch(); fetch.field(ID); fetch.field(IS_ABSTRACT); fetch.field(INDEXING_DEPTH); Fetch extendsFetch = new Fetch(); extendsFetch.field(ID); fetch.field(EXTENDS, extendsFetch); Fetch attributesFetch = new Fetch(); Fetch refEntityFetch = new Fetch(); refEntityFetch.field(ID); attributesFetch.field(AttributeMetadata.REF_ENTITY_TYPE, refEntityFetch); fetch.field(ATTRIBUTES, attributesFetch); QueryImpl<EntityType> query = new QueryImpl<>(); query.setPageSize(ENTITY_FETCH_PAGE_SIZE); query.setFetch(fetch); List<EntityType> result = newArrayList(); for (int pageNum = 0; result.size() == pageNum * ENTITY_FETCH_PAGE_SIZE; pageNum++) { query.offset(pageNum * ENTITY_FETCH_PAGE_SIZE); dataService.findAll(ENTITY_TYPE_META_DATA, query, EntityType.class).forEach(result::add); } return result; }

Target:
private List<EntityType> getEntityTypes() { QueryImpl<EntityType> query = new QueryImpl<>(); query.setPageSize(ENTITY_FETCH_PAGE_SIZE); query.setFetch(ENTITY_TYPE_FETCH); List<EntityType> result = newArrayList(); for (int pageNum = 0; result.size() == pageNum * ENTITY_FETCH_PAGE_SIZE; pageNum++) { query.offset(pageNum * ENTITY_FETCH_PAGE_SIZE); dataService.findAll(ENTITY_TYPE_META_DATA, query, EntityType.class).forEach(result::add); } return result; }
Source:
private void generateEclipseRepositoryPom(Model parent, File basedir) throws MojoExecutionException { if (groupId == null) { throw new MojoExecutionException( "groupId parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } if (version == null) { throw new MojoExecutionException( "version parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } Model model = readPomTemplate("repository-pom.xml"); setParent(basedir, model, parent); model.setGroupId(groupId); model.setArtifactId(basedir.getName()); model.setVersion(version); writePom(basedir, model); updateSites.put(basedir, parent); }

Target:
private void generateEclipseRepositoryPom(Model parent, File basedir) throws MojoExecutionException { if (groupId == null) { throw new MojoExecutionException( "groupId parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } if (version == null) { throw new MojoExecutionException( "version parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } Model model = readPomTemplate("repository-pom.xml"); setParent(basedir, model, parent); model.setGroupId(groupId); model.setArtifactId(basedir.getName()); model.setVersion(version); writePom(basedir, model); }
Source:
private void onGenerateMap() { try { String generatorVersion = mapGeneratorService.queryMaxSupportedVersion(); String majorVersion = generatorVersion.split("\\.")[0]; if (majorVersion.equals("1")) { GenerateMapController generateMapController = uiService.loadFxml("theme/play/generate_map.fxml"); Pane root = generateMapController.getRoot(); generateMapController.setCreateGameController(this); JFXDialog dialog = uiService.showInDialog(gamesRoot, root, i18n.get("game.generate.dialog")); generateMapController.setOnCloseButtonClickedListener(dialog::close); root.requestFocus(); } else { mapGeneratorService.generateMap().thenAccept(mapName -> { Platform.runLater(() -> { initMapSelection(); mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { mapListView.getSelectionModel().select(mapBean); mapListView.scrollTo(mapBean); setSelectedMap(mapBean); }); }); }); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); logger.error("Map generation failed", e); } }

Target:
private void onGenerateMap() { try { mapGeneratorService.setGeneratorVersion(mapGeneratorService.queryMaxSupportedVersion()); if (mapGeneratorService.getGeneratorVersion().compareTo(new ComparableVersion("1")) < 0) { mapGeneratorService.generateMap().thenAccept(mapName -> { Platform.runLater(() -> { initMapSelection(); mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny() .ifPresent(mapBean -> { mapListView.getSelectionModel().select(mapBean); mapListView.scrollTo(mapBean); setSelectedMap(mapBean); }); }); }); } else { GenerateMapController generateMapController = uiService.loadFxml("theme/play/generate_map.fxml"); Pane root = generateMapController.getRoot(); generateMapController.setCreateGameController(this); JFXDialog dialog = uiService.showInDialog(gamesRoot, root, i18n.get("game.generate.dialog")); generateMapController.setOnCloseButtonClickedListener(dialog::close); root.requestFocus(); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } }
Source:
public static boolean isTransientError(int code) { return code == 406 || code == 408 || code == 500 || code == 502 || code == 503 || code == 504; }

Target:
public static boolean isTransientError(int code) { return code == 408 || code == 500 || code == 502 || code == 503 || code == 504; }
Source:
public int compareTo(@NonNull AppIconHandle o) { return 0; }

Target:
public int compareTo(@NonNull AppIconHandle o) { return userHandle.equals(o.userHandle) ? componentName.compareTo(o.componentName) : (userHandle.hashCode() - o.userHandle.hashCode()); }
Source:
public String fromBytes(byte[] bytes) { Map<String, Object> values = messageSerde.fromBytes(bytes); CoordinatorStreamMessage message = new CoordinatorStreamMessage(new Object[]{}, values); if (type.equalsIgnoreCase(SetContainerHostMapping.TYPE)) { SetContainerHostMapping hostMapping = new SetContainerHostMapping(message); return hostMapping.getHostLocality(); } else if (type.equalsIgnoreCase(SetTaskContainerMapping.TYPE)) { SetTaskContainerMapping setTaskContainerMapping = new SetTaskContainerMapping(message); return setTaskContainerMapping.getTaskAssignment(); } else if (type.equalsIgnoreCase(SetChangelogMapping.TYPE)) { SetChangelogMapping changelogMapping = new SetChangelogMapping(message); return String.valueOf(changelogMapping.getPartition()); } else if (type.equalsIgnoreCase(SetConfig.TYPE)) { SetConfig setConfig = new SetConfig(message); return setConfig.getConfigValue(); } else if (type.equalsIgnoreCase(SetTaskModeMapping.TYPE)) { SetTaskModeMapping setTaskModeMapping = new SetTaskModeMapping(message); return String.valueOf(setTaskModeMapping.getTaskMode()); } else if (type.equalsIgnoreCase(SetTaskPartitionMapping.TYPE)) { SetTaskPartitionMapping setTaskPartitionMapping = new SetTaskPartitionMapping(message); return setTaskPartitionMapping.getTaskName(); } else { throw new SamzaException(String.format("Unknown coordinator stream message type: %s", type)); } }

Target:
public String fromBytes(byte[] bytes) { Map<String, Object> values = messageSerde.fromBytes(bytes); CoordinatorStreamMessage message = new CoordinatorStreamMessage(new Object[]{}, values); if (type.equalsIgnoreCase(SetContainerHostMapping.TYPE)) { SetContainerHostMapping hostMapping = new SetContainerHostMapping(message); return hostMapping.getHostLocality(); } else if (type.equalsIgnoreCase(SetTaskContainerMapping.TYPE)) { SetTaskContainerMapping setTaskContainerMapping = new SetTaskContainerMapping(message); return setTaskContainerMapping.getTaskAssignment(); } else if (type.equalsIgnoreCase(SetChangelogMapping.TYPE)) { SetChangelogMapping changelogMapping = new SetChangelogMapping(message); return String.valueOf(changelogMapping.getPartition()); } else if (type.equalsIgnoreCase(SetConfig.TYPE)) { SetConfig setConfig = new SetConfig(message); return setConfig.getConfigValue(); } else if (type.equalsIgnoreCase(SetTaskModeMapping.TYPE)) { SetTaskModeMapping setTaskModeMapping = new SetTaskModeMapping(message); return String.valueOf(setTaskModeMapping.getTaskMode()); } else if (type.equalsIgnoreCase(SetTaskPartitionMapping.TYPE)) { SetTaskPartitionMapping setTaskPartitionMapping = new SetTaskPartitionMapping(message); return setTaskPartitionMapping.getTaskNames(); } else { throw new SamzaException(String.format("Unknown coordinator stream message type: %s", type)); } }
Source:
protected List<SortInfo> getSortInfo(MultivaluedMap<String, String> queryParams) { String sortBy = queryParams.getFirst(SORT_BY); String sortOrder = queryParams.getFirst(SORT_ORDER); List<SortInfo> sortInfoList = null; if (!StringUtils.isBlank(sortBy)) { sortInfoList = new ArrayList<>(); String[] sorts = sortBy.split(","); String[] orders = null; if (!StringUtils.isBlank(sortOrder)) { orders = sortOrder.split(","); } for (int i = 0; i < sorts.length; i++) { String sort = sorts[i]; boolean sortAscending = (orders != null && orders.length > i && "asc".equals(orders[i].toLowerCase())); sortInfoList.add(new SortInfo(sort, sortAscending)); } } return sortInfoList; }

Target:
protected List<SortInfo> getSortInfo(MultivaluedMap<String, String> queryParams) { String sortBy = queryParams.getFirst(SORT_BY); String sortOrder = queryParams.getFirst(SORT_ORDER); return getSortInfo(sortBy, sortOrder); }
Source:
void flushOnLaunch(final ErrorReportApiClient errorReportApiClient) { final List<File> crashReports = findLaunchCrashReports(); if (crashReports.isEmpty() && config.getLaunchCrashThresholdMs() == 0) { flushAsync(errorReportApiClient); } else { flushOnLaunchCompleted = false; Async.run(new Runnable() { @Override public void run() { Logger.info("Attempting to send launch crash reports"); for (File crashReport : crashReports) { flushErrorReport(crashReport, errorReportApiClient); } Logger.info("Delivered all launch crash reports"); flushOnLaunchCompleted = true; } }); long waitMs = 0; while (!flushOnLaunchCompleted && waitMs < LAUNCH_CRASH_TIMEOUT_MS) { try { Thread.sleep(LAUNCH_CRASH_POLL_MS); waitMs += LAUNCH_CRASH_POLL_MS; } catch (InterruptedException e) { Logger.warn("Interrupted while waiting for launch crash report request"); } } Logger.info("Continuing with Bugsnag initialisation"); } }

Target:
void flushOnLaunch(final ErrorReportApiClient errorReportApiClient) { final List<File> crashReports = findLaunchCrashReports(); if (crashReports.isEmpty() || config.getLaunchCrashThresholdMs() == 0) { flushAsync(errorReportApiClient); } else { flushOnLaunchCompleted = false; Async.run(new Runnable() { @Override public void run() { Logger.info("Attempting to send launch crash reports"); for (File crashReport : crashReports) { flushErrorReport(crashReport, errorReportApiClient); } Logger.info("Delivered all launch crash reports"); flushOnLaunchCompleted = true; } }); long waitMs = 0; while (!flushOnLaunchCompleted && waitMs < LAUNCH_CRASH_TIMEOUT_MS) { try { Thread.sleep(LAUNCH_CRASH_POLL_MS); waitMs += LAUNCH_CRASH_POLL_MS; } catch (InterruptedException e) { Logger.warn("Interrupted while waiting for launch crash report request"); } } Logger.info("Continuing with Bugsnag initialisation"); } }
Source:
private void updateLangButtonTextSize() { if (app.getAppOrSystemLanguageCode().startsWith(AppLanguageLookUpTable.CHINESE_LANGUAGE_CODE_PREFIX)) { langButton.setTextSize(LANG_BUTTON_TEXT_SIZE_SMALLER); if (app.getAppOrSystemLanguageCode().equals(AppLanguageLookUpTable.CLASSICAL_CHINESE_LANGUAGE_CODE)) { langButton.setText(CLASSICAL_CHINESE_CODE_ABBREVIATED); } return; } langButton.setTextSize(LANG_BUTTON_TEXT_SIZE_LARGER); }

Target:
private void updateLangButtonTextSize() { String langCode = app.getAppOrSystemLanguageCode(); if (langCode.length() > NON_CHINESE_LANGUAGE_CODE_LENGTH) { langButton.setTextSize(LANG_BUTTON_TEXT_SIZE_SMALLER); if (langCode.length() > CHINESE_VARIANT_BUTTON_TEXT_LENGTH) { langButton.setText(langCode.substring(0, CHINESE_VARIANT_BUTTON_TEXT_LENGTH)); } return; } langButton.setTextSize(LANG_BUTTON_TEXT_SIZE_LARGER); }
Source:
private void init() { inflate(getContext(), R.layout.view_disk_usage, this); ButterKnife.bind(this); setOrientation(VERTICAL); ViewCompat.setBackgroundTintList(otherDot, new ColorStateList(new int[][]{new int[]{}}, new int[]{ContextCompat.getColor(getContext(), ResourceUtil.getThemedAttributeId(getContext(), R.attr.window_inverse_color))})); ViewCompat.setBackgroundTintList(usedDot, new ColorStateList(new int[][]{new int[]{}}, new int[]{ContextCompat.getColor(getContext(), ResourceUtil.getThemedAttributeId(getContext(), R.attr.colorAccent))})); ViewCompat.setBackgroundTintList(freeDot, new ColorStateList(new int[][]{new int[]{}}, new int[]{ContextCompat.getColor(getContext(), ResourceUtil.getThemedAttributeId(getContext(), R.attr.window_background_color))})); update(0); }

Target:
private void init() { inflate(getContext(), R.layout.view_disk_usage, this); ButterKnife.bind(this); setOrientation(VERTICAL); usageAppText.setText(R.string.app_name); setDotTint(otherDot, R.attr.window_inverse_color); setDotTint(usedDot, R.attr.colorAccent); setDotTint(freeDot, R.attr.window_background_color); update(0); }
Source:
public void walkToBank() { System.out.println("walking"); final Locatable nearestBank = ctx.bank.nearest(); ctx.movement.step(nearestBank); }

Target:
public void walkToBank() { System.out.println("walking"); final Locatable nearestBank = ctx.bank.nearest(); ctx.movement.step(nearestBank); Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return !ctx.players.local().inMotion(); } }); }
Source:
private boolean sendJsonString(WebSocket websocketOfRecipient, String jsonString) { if (!serverStarted) { return false; } if (websocketOfRecipient == null || jsonString == null) { return false; } if (websocketOfRecipient.isOpen()) { websocketOfRecipient.send(jsonString); return true; } else { return false; } }

Target:
private boolean sendJsonString(WebSocket websocketOfRecipient, String jsonString) { if (!serverStarted) { return false; } if (websocketOfRecipient == null || jsonString == null) { return false; } if (websocketOfRecipient.isOpen()) { websocketOfRecipient.send(jsonString); return true; } return false; }
Source:
public void testMoveWithStorageDomainName() throws Exception { setUpEntityQueryExpectations(VdcQueryType.GetAllStorageDomains, VdcQueryParametersBase.class, new String[] {}, new Object[] {}, Collections.singletonList(getStorageDomain(2))); StorageDomain storageDomain = new StorageDomain(); storageDomain.setName(NAMES[2]); doTestMove(storageDomain); }

Target:
public void testMoveWithStorageDomainName() throws Exception { setUpGetEntityExpectations("Storage: name=" + NAMES[2], SearchType.StorageDomain, getStorageDomain(2)); StorageDomain storageDomain = new StorageDomain(); storageDomain.setName(NAMES[2]); doTestMove(storageDomain); }
Source:
boolean isPushingSection( OSMWay way ) { return way.hasTag("highway", pushingSections) || way.hasTag("railway", "platform") || way.hasTag("bicycle", "dismount"); }

Target:
boolean isPushingSection( OSMWay way ) { return way.hasTag("highway", pushingSectionsHighways) || way.hasTag("railway", "platform") || way.hasTag("bicycle", "dismount"); }
Source:
public void testRootLevelAttributeSimpleNameOperatorNoScope() { simpleAttributeOperatorHelper(OperatorContext.MEMORY_MB, StreamingApplication.DT_PREFIX, true, (Integer)4096, true, false); }

Target:
public void testRootLevelAttributeSimpleNameOperatorNoScope() { simpleAttributeOperatorHelper(OperatorContext.MEMORY_MB, StreamingApplication.DT_PREFIX, true, 4096, true, false); }
Source:
public boolean matchesSafely(InventoryFullViewModel actual) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return Objects.equals(actual.getId(), expected.getId()) && Objects.equals(actual.getComponentCode(), expected.getComponentCode()) && Objects.equals(actual.getComponentType(), expected.getComponentType()) && Objects.equals(actual.getInventoryStatus(), expected.getInventoryStatus()) && (Objects.equals(actual.getCreatedOn(), expected.getCreatedOn()) || Objects.equals(sdf.format(actual.getCreatedOn()), sdf.format(expected.getCreatedOn()))) && Objects.equals(actual.getDonationIdentificationNumber(), expected.getDonationIdentificationNumber()) && Objects.equals(actual.getExpiryStatus(), expected.getExpiryStatus()) && (Objects.equals(actual.getExpiresOn(), expected.getExpiresOn()) || Objects.equals(sdf.format(actual.getExpiresOn()), sdf.format(expected.getExpiresOn())) && Objects.equals(actual.getLocation(), expected.getLocation()) && Objects.equals(actual.getBloodGroup(), expected.getBloodGroup()) && Objects.equals(actual.getOrderform(), expected.getOrderform())); }

Target:
public boolean matchesSafely(InventoryFullViewModel actual) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return Objects.equals(actual.getId(), expected.getId()) && Objects.equals(actual.getComponentCode(), expected.getComponentCode()) && Objects.equals(actual.getComponentType(), expected.getComponentType()) && Objects.equals(actual.getInventoryStatus(), expected.getInventoryStatus()) && (Objects.equals(actual.getCreatedOn(), expected.getCreatedOn()) || Objects.equals(sdf.format(actual.getCreatedOn()), sdf.format(expected.getCreatedOn()))) && Objects.equals(actual.getDonationIdentificationNumber(), expected.getDonationIdentificationNumber()) && Objects.equals(actual.getExpiryStatus(), expected.getExpiryStatus()) && (Objects.equals(actual.getExpiresOn(), expected.getExpiresOn()) || Objects.equals(sdf.format(actual.getExpiresOn()), sdf.format(expected.getExpiresOn()))) && Objects.equals(actual.getLocation(), expected.getLocation()) && Objects.equals(actual.getBloodGroup(), expected.getBloodGroup()) && Objects.equals(actual.getOrderForms(), expected.getOrderForms()) && Objects.equals(actual.getComponentStatus(), expected.getComponentStatus()); }
Source:
public void testUpdate() { ToolBarManager manager = new ToolBarManager(); ObservableControlContribution item = new ObservableControlContribution("i want to be updated!"); manager.add(item); manager.createControl(createComposite()); assertFalse("Update was called already", item.updateCalled); assertTrue("computeWidth was not called", item.computeWidthCalled); item.computeWidthCalled = false; manager.update(false); assertFalse("Update was called but force was false!", item.updateCalled); assertFalse("computeWidthwas called but force was false!", item.computeWidthCalled); manager.update(true); assertTrue("Update was not called", item.updateCalled); assertTrue("computeWidth was not called", item.computeWidthCalled); }

Target:
public void testUpdate() { ToolBarManager manager = new ToolBarManager(); ObservableControlContribution item = new ObservableControlContribution("i want to be updated!"); manager.add(item); manager.createControl(createComposite()); assertFalse("Update was called already", item.updateCalled); assertTrue("computeWidth was not called", item.computeWidthCalled); item.computeWidthCalled = false; manager.update(false); assertFalse("Item update should only be called when manager update is forced", item.updateCalled); assertFalse("computeWidth should only be called when manager update is forced", item.computeWidthCalled); manager.update(true); assertTrue("Update was not called", item.updateCalled); assertTrue("computeWidth was not called", item.computeWidthCalled); }
Source:
public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(!isFinished(), "Operator is already finished"); index.addPage(page); if (!localUserMemoryContext.trySetBytes((index.getEstimatedSize().toBytes()))) { index.compact(); } localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes()); operatorContext.recordGeneratedOutput(page.getSizeInBytes(), page.getPositionCount()); }

Target:
public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(!isFinished(), "Operator is already finished"); index.addPage(page); if (!localUserMemoryContext.trySetBytes((index.getEstimatedSize().toBytes()))) { index.compact(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes()); } operatorContext.recordGeneratedOutput(page.getSizeInBytes(), page.getPositionCount()); }
Source:
private static Intent getLaunchCameraIntent(Context context, String applicationId, LaunchCameraCallback callback) throws IOException { File externalStoragePublicDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); String mediaCapturePath = externalStoragePublicDirectory + File.separator + "Camera" + File.separator + "wp-" + System .currentTimeMillis() + ".jpg"; File directory = new File(mediaCapturePath).getParentFile(); if (directory == null | (!directory.exists() && !directory.mkdirs())) { try { throw new IOException("Path to file could not be created: " + mediaCapturePath); } catch (IOException e) { AppLog.e(T.MEDIA, e); throw e; } } Uri fileUri; try { fileUri = FileProvider.getUriForFile(context, applicationId + ".provider", new File(mediaCapturePath)); } catch (IllegalArgumentException e) { AppLog.e(T.MEDIA, "Cannot access the file planned to store the new media", e); throw new IOException("Cannot access the file planned to store the new media"); } Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, fileUri); if (callback != null) { callback.onMediaCapturePathReady(mediaCapturePath); } return intent; }

Target:
private static Intent getLaunchCameraIntent(Context context, String applicationId, LaunchCameraCallback callback) throws IOException { File externalStoragePublicDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); String mediaCapturePath = externalStoragePublicDirectory + File.separator + "Camera" + File.separator + "wp-" + System .currentTimeMillis() + ".jpg"; File directory = new File(mediaCapturePath).getParentFile(); if (directory == null || (!directory.exists() && !directory.mkdirs())) { try { throw new IOException("Path to file could not be created: " + mediaCapturePath); } catch (IOException e) { AppLog.e(T.MEDIA, e); throw e; } } Uri fileUri; try { fileUri = FileProvider.getUriForFile(context, applicationId + ".provider", new File(mediaCapturePath)); } catch (IllegalArgumentException e) { AppLog.e(T.MEDIA, "Cannot access the file planned to store the new media", e); throw new IOException("Cannot access the file planned to store the new media"); } Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, fileUri); if (callback != null) { callback.onMediaCapturePathReady(mediaCapturePath); } return intent; }
Source:
private OutputFormatFactory<BaseRow> createOutputFormatFactory() { FileSystemFormatFactory formatFactory = createFormatFactory(formatProperties); FileSystemFormatFactory.WriterContext context = new FileSystemFormatFactory.WriterContext() { @Override public TableSchema getSchema() { return schema; } @Override public Map<String, String> getFormatProperties() { return formatProperties; } @Override public List<String> getPartitionKeys() { return partitionKeys; } }; Optional<Encoder<BaseRow>> encoder = formatFactory.createEncoder(context); Optional<BulkWriter.Factory<BaseRow>> bulk = formatFactory.createBulkWriterFactory(context); if (!encoder.isPresent() && !bulk.isPresent()) { throw new TableException( formatFactory + " format should implement at least one Encoder or BulkWriter"); } return encoder .<OutputFormatFactory<BaseRow>>map(en -> path -> createEncoderOutputFormat(en, path)) .orElseGet(() -> { BulkWriter.Factory<BaseRow> bulkWriter = bulk.get(); return path -> createBulkWriterOutputFormat(bulkWriter, path); }); }

Target:
private OutputFormatFactory<BaseRow> createOutputFormatFactory() { FileSystemFormatFactory formatFactory = createFormatFactory(formatProperties); FileSystemFormatFactory.WriterContext context = new FileSystemFormatFactory.WriterContext() { @Override public TableSchema getSchema() { return schema; } @Override public Map<String, String> getFormatProperties() { return formatProperties; } @Override public List<String> getPartitionKeys() { return partitionKeys; } }; Optional<Encoder<BaseRow>> encoder = formatFactory.createEncoder(context); Optional<BulkWriter.Factory<BaseRow>> bulk = formatFactory.createBulkWriterFactory(context); if (!encoder.isPresent() && !bulk.isPresent()) { throw new TableException( formatFactory + " format should implement at least one Encoder or BulkWriter"); } return encoder .<OutputFormatFactory<BaseRow>>map(en -> path -> createEncoderOutputFormat(en, path)) .orElseGet(() -> { BulkWriter.Factory<BaseRow> bulkWriterFactory = bulk.get(); return path -> createBulkWriterOutputFormat(bulkWriterFactory, path); }); }
Source:
public void openCore() throws StandardException{ try { submittedTime = new SimpleDateFormat(timeStampFormat).format(new Date()); uuid = EngineDriver.driver().getOperationManager().registerOperation(this, Thread.currentThread()); DataSetProcessor dsp = EngineDriver.driver().processorFactory().chooseProcessor(activation, this); activation.getLanguageConnectionContext().getStatementContext().registerExpirable(this, Thread.currentThread()); engineName = (dsp.getType() == DataSetProcessor.Type.SPARK) ? "SPARK" : "CONTROL"; if (dsp.getType() == DataSetProcessor.Type.SPARK && !isOlapServer() && !SpliceClient.isClient) { remoteQueryClient = EngineDriver.driver().processorFactory().getRemoteQueryClient(this); remoteQueryClient.submit(); execRowIterator = remoteQueryClient.getIterator(); } else { openCore(dsp); } } catch (Exception e) { EngineDriver.driver().getOperationManager().unregisterOperation(uuid); checkInterruptedException(e); throw e; } }

Target:
public void openCore() throws StandardException{ try { DataSetProcessor dsp = EngineDriver.driver().processorFactory().chooseProcessor(activation, this); uuid = EngineDriver.driver().getOperationManager().registerOperation(this, Thread.currentThread(), new Date(), dsp.getType()); activation.getLanguageConnectionContext().getStatementContext().registerExpirable(this, Thread.currentThread()); if (dsp.getType() == DataSetProcessor.Type.SPARK && !isOlapServer() && !SpliceClient.isClient) { remoteQueryClient = EngineDriver.driver().processorFactory().getRemoteQueryClient(this); remoteQueryClient.submit(); execRowIterator = remoteQueryClient.getIterator(); } else { openCore(dsp); } } catch (Exception e) { EngineDriver.driver().getOperationManager().unregisterOperation(uuid); checkInterruptedException(e); throw e; } }
Source:
public void removeEndpoint(Object webSocketEndpoint) throws WebSocketEndpointAnnotationException { EndpointDispatcher dispatcher = new EndpointDispatcher(); webSocketEndpointMap.remove(dispatcher.getUri(webSocketEndpoint)); updatePatternPathRouter(); LOGGER.info("Removed endpoint : " + dispatcher.getUri(webSocketEndpoint)); }

Target:
public void removeEndpoint(Object webSocketEndpoint) throws WebSocketEndpointAnnotationException { EndpointDispatcher dispatcher = new EndpointDispatcher(); webSocketEndpointMap.remove(dispatcher.getUri(webSocketEndpoint)); updatePatternPathRouter(); log.info("Removed endpoint : " + dispatcher.getUri(webSocketEndpoint)); }
Source:
private void addDeactivationAnchor() { Span closeIconSpan = new Span(); closeIconSpan.addStyleName("pficon"); closeIconSpan.addStyleName("pficon-close"); deactivationAnchor.add(closeIconSpan); add(deactivationAnchor); }

Target:
private void addDeactivationAnchor() { Span closeIconSpan = new Span(); closeIconSpan.addStyleName(PatternflyConstants.PFICON); closeIconSpan.addStyleName(PatternflyConstants.PFICON_CLOSE); deactivationAnchor.add(closeIconSpan); add(deactivationAnchor); }
Source:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject instanceof ISelection) { if (adapterType == IIterable.class) { @SuppressWarnings("unchecked") T iterable = (T) iterable((ISelection) adaptableObject); return iterable; } else if (adapterType == ICountable.class) { @SuppressWarnings("unchecked") T countable = (T) countable((ISelection) adaptableObject); return countable; } } return null; }

Target:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject instanceof ISelection) { if (adapterType == IIterable.class) { return adapterType.cast(iterable((ISelection) adaptableObject)); } else if (adapterType == ICountable.class) { return adapterType.cast(countable((ISelection) adaptableObject)); } } return null; }