auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void reverseGeocode(final Point point) { try { MapboxGeocoding client = MapboxGeocoding.builder() .accessToken(getString(R.string.access_token)) .query(Point.fromLngLat(point.longitude(), point.latitude())) .geocodingTypes(GeocodingCriteria.TYPE_ADDRESS) .build(); client.enqueueCall(new Callback<GeocodingResponse>() { @Override public void onResponse(Call<GeocodingResponse> call, Response<GeocodingResponse> response) { List<CarmenFeature> results = response.body().features(); if (results.size() > 0) { CarmenFeature feature = results.get(0); mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { <START> Toast.makeText(LocationPickerActivity.this, <END> String.format(getString(R.string.location_picker_place_name_result), feature.placeName()), Toast.LENGTH_SHORT).show(); } }); } else { Toast.makeText(LocationPickerActivity.this, getString(R.string.location_picker_dropped_marker_snippet_no_results), Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<GeocodingResponse> call, Throwable throwable) { Timber.e("Geocoding Failure: %s", throwable.getMessage()); } }); } catch (ServicesException servicesException) { Timber.e("Error geocoding: %s", servicesException.toString()); servicesException.printStackTrace(); } }</code><technical_language>check style.getLayer(DROPPED_MARKER_LAYER_ID) != null showing toast message</technical_language>

Target:
private void reverseGeocode(final Point point) { try { MapboxGeocoding client = MapboxGeocoding.builder() .accessToken(getString(R.string.access_token)) .query(Point.fromLngLat(point.longitude(), point.latitude())) .geocodingTypes(GeocodingCriteria.TYPE_ADDRESS) .build(); client.enqueueCall(new Callback<GeocodingResponse>() { @Override public void onResponse(Call<GeocodingResponse> call, Response<GeocodingResponse> response) { List<CarmenFeature> results = response.body().features(); if (results.size() > 0) { CarmenFeature feature = results.get(0); mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { if (style.getLayer(DROPPED_MARKER_LAYER_ID) != null) { Toast.makeText(LocationPickerActivity.this, String.format(getString(R.string.location_picker_place_name_result), feature.placeName()), Toast.LENGTH_SHORT).show(); } } }); } else { Toast.makeText(LocationPickerActivity.this, getString(R.string.location_picker_dropped_marker_snippet_no_results), Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(Call<GeocodingResponse> call, Throwable throwable) { Timber.e("Geocoding Failure: %s", throwable.getMessage()); } }); } catch (ServicesException servicesException) { Timber.e("Error geocoding: %s", servicesException.toString()); servicesException.printStackTrace(); } }
Source:
<code>public void setUp() throws InterruptedException, ExecutionException { function = new RestoreRedundancyFunction(); when(mockContext.getCache()).thenReturn(mockCache); <START> request = new RestoreRedundancyRequest(); <END> request.setReassignPrimaries(true); when(mockContext.getArguments()).thenReturn(new Object[] {request, false}); when(mockCache.getResourceManager().createRestoreRedundancyOperation()) .thenReturn(mockOperation); CompletableFuture<RestoreRedundancyResults> future = CompletableFuture.completedFuture(mockResults); when(mockOperation.start()).thenReturn(future); when(mockResults.getRegionOperationMessage()).thenReturn(message); resultSender = mock(ResultSender.class); when(mockContext.getResultSender()).thenReturn(resultSender); argumentCaptor = ArgumentCaptor.forClass(SerializableRestoreRedundancyResultsImpl.class); }</code><technical_language>this RestoreRedundancyRequest object replaced a mock, avoid testing behaviour of RestoreRedundancyFunction class in this unit test</technical_language>

Target:
public void setUp() throws InterruptedException, ExecutionException { function = new RestoreRedundancyFunction(); when(mockContext.getCache()).thenReturn(mockCache); request = new RestoreRedundancyRequest(); when(mockContext.getArguments()).thenReturn(new Object[] {request, false}); when(mockCache.getResourceManager().createRestoreRedundancyOperation()) .thenReturn(mockOperation); CompletableFuture<RestoreRedundancyResults> future = CompletableFuture.completedFuture(mockResults); when(mockOperation.start()).thenReturn(future); when(mockResults.getRegionOperationMessage()).thenReturn(message); resultSender = mock(ResultSender.class); when(mockContext.getResultSender()).thenReturn((ResultSender) resultSender); argumentCaptor = ArgumentCaptor.forClass(SerializableRestoreRedundancyResultsImpl.class); }
Source:
<code><START> public Item[] getDrops() { <END> List<Item> drops = new ArrayList<>(); if (this.lastDamageCause instanceof EntityDamageByEntityEvent) { int leather = Drops.rand(1, 4); int rawbeef = Drops.rand(1, 3); for (int i=0; i < leather; i++) { drops.add(Item.get(Item.LEATHER, 0, 1)); } for (int i=0; i < rawbeef; i++) { drops.add(Item.get(Item.RAW_BEEF, 0, 1)); } } return drops.toArray(new Item[drops.size()]); }</code><technical_language><LINK_0></technical_language>

Target:
public Item[] getDrops() { List<Item> drops = new ArrayList<>(); if (this.lastDamageCause instanceof EntityDamageByEntityEvent) { int leather = Drops.rand(0, 3); int rawbeef = Drops.rand(1, 4); for (int i=0; i < leather; i++) { drops.add(Item.get(Item.LEATHER, 0, 1)); } for (int i=0; i < rawbeef; i++) { drops.add(Item.get(Item.RAW_BEEF, 0, 1)); } } return drops.toArray(new Item[drops.size()]); }
Source:
<code>public WorkspaceConfigImpl devFileToWorkspaceConfig(Devfile devFile) throws DevfileFormatException { validateCurrentVersion(devFile); WorkspaceConfigImpl config = new WorkspaceConfigImpl(); config.setName(devFile.getName()); List<ProjectConfigImpl> projects = new ArrayList<>(); devFile.getProjects().forEach(project -> projects.add(devProjectToProjectConfig(project))); config.setProjects(projects); Map<String, String> attributes = new HashMap<>(); StringJoiner pluginsStringJoiner = new StringJoiner(","); StringJoiner toolIdToNameMappingStringJoiner = new StringJoiner(","); for (Tool tool : devFile.getTools()) { <START> if (tool.getType().equals("cheEditor")) { <END> attributes.put(EDITOR_WORKSPACE_ATTRIBUTE_NAME, tool.getId()); } else if (tool.getType().equals("chePlugin")) { pluginsStringJoiner.add(tool.getId()); } toolIdToNameMappingStringJoiner.add(tool.getId() + "=" + tool.getName()); } if (pluginsStringJoiner.length() > 0) { attributes.put(PLUGINS_WORKSPACE_ATTRIBUTE_NAME, pluginsStringJoiner.toString()); } if (toolIdToNameMappingStringJoiner.length() > 0) { attributes.put(ALIASES_WORKSPACE_ATTRIBUTE_NAME, toolIdToNameMappingStringJoiner.toString()); } config.setAttributes(attributes); List<CommandImpl> commands = new ArrayList<>(); devFile .getCommands() .forEach(command -> commands.addAll(devCommandToCommandImpls(devFile, command))); config.setCommands(commands); return config; }</code><technical_language>exception thrown if a tool unknown type, for now, equals cheEditor chePlugin</technical_language>

Target:
public WorkspaceConfigImpl devFileToWorkspaceConfig(Devfile devFile) throws DevfileFormatException { validateCurrentVersion(devFile); WorkspaceConfigImpl config = new WorkspaceConfigImpl(); config.setName(devFile.getName()); List<ProjectConfigImpl> projects = new ArrayList<>(); devFile.getProjects().forEach(project -> projects.add(devProjectToProjectConfig(project))); config.setProjects(projects); Map<String, String> attributes = new HashMap<>(); StringJoiner pluginsStringJoiner = new StringJoiner(","); StringJoiner toolIdToNameMappingStringJoiner = new StringJoiner(","); for (Tool tool : devFile.getTools()) { switch (tool.getType()) { case "cheEditor": attributes.put(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, tool.getId()); break; case "chePlugin": pluginsStringJoiner.add(tool.getId()); break; default: throw new DevfileFormatException( format("Unsupported tool %s type provided: %s", tool.getName(), tool.getType())); } toolIdToNameMappingStringJoiner.add(tool.getId() + "=" + tool.getName()); } if (pluginsStringJoiner.length() > 0) { attributes.put(WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, pluginsStringJoiner.toString()); } if (toolIdToNameMappingStringJoiner.length() > 0) { attributes.put(ALIASES_WORKSPACE_ATTRIBUTE_NAME, toolIdToNameMappingStringJoiner.toString()); } config.setAttributes(attributes); List<CommandImpl> commands = new ArrayList<>(); devFile .getCommands() .forEach(command -> commands.addAll(devCommandToCommandImpls(devFile, command))); config.setCommands(commands); return config; }
Source:
<code>protected SimpleCollector(Builder b) { if (b.name.isEmpty()) throw new IllegalStateException("Name hasn't been set."); String name = b.name; if (!b.subsystem.isEmpty()) { name = b.subsystem + '_' + name; } if (!b.namespace.isEmpty()) { name = b.namespace + '_' + name; } fullname = name; checkMetricName(fullname); if (b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set."); help = b.help; <START> labelNames = b.labelNames.length == 0 ? Collections.<String>emptyList() : <END> (b.labelNames.length == 1 ? Collections.singletonList(b.labelNames[0]) : Arrays.asList(b.labelNames)); for (String n: b.labelNames) { checkMetricLabelName(n); } if (!b.dontInitializeNoLabelsChild) { initializeNoLabelsChild(); } }</code><technical_language>This is called creation of a metric, a hot path complicate things</technical_language>

Target:
protected SimpleCollector(Builder b) { if (b.name.isEmpty()) throw new IllegalStateException("Name hasn't been set."); String name = b.name; if (!b.subsystem.isEmpty()) { name = b.subsystem + '_' + name; } if (!b.namespace.isEmpty()) { name = b.namespace + '_' + name; } fullname = name; checkMetricName(fullname); if (b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set."); help = b.help; labelNames = new LabelNames(b.labelNames.length); for (String label : b.labelNames) { labelNames.add(label); } for (String n: b.labelNames) { checkMetricLabelName(n); } if (!b.dontInitializeNoLabelsChild) { initializeNoLabelsChild(); } }
Source:
<code>private void updateWatchdogModels() { <START> updateWatchdogModels(getOSType().getSelectedItem()); <END> }</code><technical_language>changes relevant this patch</technical_language>

Target:
private void updateWatchdogModels() { updateWatchdogModels((Integer) getOSType().getSelectedItem()); }
Source:
<code>public void convertModelToXML() throws Exception { BpmnModel bpmnModel = readXMLFile(); assertNotNull(bpmnModel); <START> BpmnModel parsedModel = exportAndReadXMLFile(bpmnModel); <END> validateModel(parsedModel); deployProcess(parsedModel); }</code><technical_language>assert parsedModel</technical_language>

Target:
public void convertModelToXML() throws Exception { BpmnModel bpmnModel = readXMLFile(); assertNotNull(bpmnModel); BpmnModel parsedModel = exportAndReadXMLFile(bpmnModel); assertNotNull(parsedModel); validateModel(parsedModel); }
Source:
<code>private static void populateAnalysisModules() { fModules = new ArrayList<>(); IPath pathToFiles = XmlUtils.getXmlFilesPath(); File fFolder = pathToFiles.toFile(); if (!(fFolder.isDirectory() && fFolder.exists())) { return; } for (File xmlFile : fFolder.listFiles()) { if (!XmlUtils.xmlValidate(xmlFile)) { continue; } try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory <START> .newInstance(); <END> DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); doc.getDocumentElement().normalize(); NodeList stateproviderNodes = doc .getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); for (int i = 0; i < stateproviderNodes.getLength(); i++) { Element node = (Element) stateproviderNodes.item(i); IAnalysisModuleHelper helper = new TmfAnalysisModuleHelperXml(xmlFile, node, XmlAnalysisModuleType.STATE_SYSTEM); fModules.add(helper); } } catch (ParserConfigurationException e) { Activator.logError("Error opening XML file", e); } catch (SAXException e) { Activator.logError("Error opening XML file", e); } catch (IOException e) { Activator.logError("Error opening XML file", e); } } }</code><technical_language>do wrap this need update/fix formatter settings for this plugin</technical_language>

Target:
private static void populateAnalysisModules() { fModules = new ArrayList<>(); IPath pathToFiles = XmlUtils.getXmlFilesPath(); File fFolder = pathToFiles.toFile(); if (!(fFolder.isDirectory() && fFolder.exists())) { return; } for (File xmlFile : fFolder.listFiles()) { if (!XmlUtils.xmlValidate(xmlFile).isOK()) { continue; } try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); doc.getDocumentElement().normalize(); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); for (int i = 0; i < stateproviderNodes.getLength(); i++) { Element node = (Element) stateproviderNodes.item(i); IAnalysisModuleHelper helper = new TmfAnalysisModuleHelperXml(xmlFile, node, XmlAnalysisModuleType.STATE_SYSTEM); fModules.add(helper); } } catch (ParserConfigurationException | SAXException | IOException e) { Activator.logError("Error opening XML file", e); } } }
Source:
<code><START> private Artifact getSawTeam() { <END> return ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.TeamDefinition, "SAW Requirements", AtsUtilCore.getAtsBranch()); }</code><technical_language>demo token org.eclipse.osee.ats.client.demo.DemoArtifactToken.SAW_Requirements</technical_language>

Target:
private Long getSawTeam() { return org.eclipse.osee.ats.client.demo.DemoArtifactToken.SAW_Requirements.getUuid(); }
Source:
<code>private CreateCloneOfTemplateParameters buildCreateCloneOfTemplateParameters(DiskImage disk) { DiskImageBase diskInfo = getParameters().getDiskInfoDestinationMap().get(disk.getId()); CreateCloneOfTemplateParameters params = new CreateCloneOfTemplateParameters(disk.getImageId(), getParameters().getVmStaticData().getId(), diskInfo); params.setStorageDomainId(diskInfoSourceMap.get(disk.getId())); params.setDestStorageDomainId(retrieveDestinationDomainForDisk(disk.getId())); params.setDiskAlias(diskInfoDestinationMap.get(disk.getId()).getDiskAlias()); params.setVmSnapshotId(getVmSnapshotId()); params.setParentCommand(VdcActionType.AddVmFromTemplate); params.setParentParameters(getParameters()); params.setEntityInfo(getParameters().getEntityInfo()); params.setQuotaId(diskInfoDestinationMap.get(disk.getId()).getQuotaId() != null ? diskInfoDestinationMap.get(disk.getId()).getQuotaId() : null); params.setDiskProfileId(diskInfoDestinationMap.get(disk.getId()).getDiskProfileId() != null ? <START> diskInfoDestinationMap.get(disk.getId()).getDiskProfileId() : null); <END> return params; }</code><technical_language>writing params.setDiskProfileId(diskInfoDestinationMap.get(disk.getId()).getDiskProfileId()) missing change for quota line other patch</technical_language>

Target:
private CreateCloneOfTemplateParameters buildCreateCloneOfTemplateParameters(DiskImage disk) { DiskImageBase diskInfo = getParameters().getDiskInfoDestinationMap().get(disk.getId()); CreateCloneOfTemplateParameters params = new CreateCloneOfTemplateParameters(disk.getImageId(), getParameters().getVmStaticData().getId(), diskInfo); params.setStorageDomainId(diskInfoSourceMap.get(disk.getId())); params.setDestStorageDomainId(retrieveDestinationDomainForDisk(disk.getId())); params.setDiskAlias(diskInfoDestinationMap.get(disk.getId()).getDiskAlias()); params.setVmSnapshotId(getVmSnapshotId()); params.setParentCommand(VdcActionType.AddVmFromTemplate); params.setParentParameters(getParameters()); params.setEntityInfo(getParameters().getEntityInfo()); params.setQuotaId(diskInfoDestinationMap.get(disk.getId()).getQuotaId() != null ? diskInfoDestinationMap.get(disk.getId()).getQuotaId() : null); params.setDiskProfileId(diskInfoDestinationMap.get(disk.getId()).getDiskProfileId()); return params; }
Source:
<code>void shouldUpdateChargeToCaptured_IfEpdqStatusIs9AndChargeIsHistoric() { final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); charge = getCharge(true); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); <START> final boolean result = notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES); assertTrue(result); <END> verify(mockChargeNotificationProcessor).processCaptureNotificationForExpungedCharge(gatewayAccountEntity, payId, charge, CAPTURED); }</code><technical_language>inlined</technical_language>

Target:
void shouldUpdateChargeToCaptured_IfEpdqStatusIs9AndChargeIsHistoric() { final String payload = notificationPayloadForTransaction(payId, EPDQ_PAYMENT_REQUESTED); charge = getCharge(true); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); assertTrue(notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES)); verify(mockChargeNotificationProcessor).processCaptureNotificationForExpungedCharge(gatewayAccountEntity, payId, charge, CAPTURED); }
Source:
<code>public void inject(GlobalConfiguration globalConfiguration, EmbeddedCacheManager cacheManager) { <START> this.globalConfiguration = globalConfiguration; <END> this.cacheManager = cacheManager; this.localConfigurationManager = globalConfiguration.globalState().localConfigurationManager(); }</code><technical_language>want create a factory for it? injected :)</technical_language>

Target:
public void inject(GlobalConfiguration globalConfiguration, EmbeddedCacheManager cacheManager) { this.cacheManager = cacheManager; this.localConfigurationManager = globalConfiguration.globalState().localConfigurationManager(); }
Source:
<code>public void clear() { <START> if (loader instanceof CacheStore) <END> try { ((CacheStore) loader).clear(); } catch (CacheLoaderException e) { throw newCacheLoaderException(e); } }</code><technical_language>IMO, if if (...) { ... }, code easy read. I meant { } missing :) edit: for ifs</technical_language>

Target:
public void clear() { if (loader instanceof CacheStore) { try { ((CacheStore) loader).clear(); } catch (CacheLoaderException e) { throw newCacheLoaderException(e); } } }
Source:
<code>public ProcessingResult processAnnotations(Iterable<String> fileArgs, List<ProcessingContext> inputs) { final List<ProcessingContext> generatedInputs = Lists.newArrayList(); PathClassLoader loader = new PathClassLoader(options.fileUtil().getClassPathEntries()); loader.addPaths(options.getProcessorPathEntries()); Iterator<Processor> serviceIterator = ServiceLoader.load(Processor.class, loader).iterator(); String explicitProcessorList = options.getProcessors(); <START> if (serviceIterator.hasNext() || explicitProcessorList != null) { <END> List<File> inputFiles = new ArrayList<>(); for (ProcessingContext input : inputs) { inputFiles.add(new File(input.getFile().getAbsolutePath())); } try { JavacEnvironment env = createEnvironment(inputFiles, null, true, explicitProcessorList); env.task().parse(); env.task().enter(); processDiagnostics(env.diagnostics()); File sourceOutputDirectory = env.fileManager().getLocation(StandardLocation.SOURCE_OUTPUT).iterator().next(); collectGeneratedInputs(sourceOutputDirectory, "", generatedInputs); return new JavacProcessingResult(generatedInputs, sourceOutputDirectory); } catch (IOException e) { ErrorUtil.fatalError(e, "javac file manager error"); } } return new JavacProcessingResult(generatedInputs, null); }</code><technical_language>Revert. annotation processing jars define a ServiceLoader entry in manifest files, is this issue caught sooner. This test needs remain, support for case is handled in getJavacOptions()</technical_language>

Target:
public ProcessingResult processAnnotations(Iterable<String> fileArgs, List<ProcessingContext> inputs) { final List<ProcessingContext> generatedInputs = Lists.newArrayList(); PathClassLoader loader = new PathClassLoader(options.fileUtil().getClassPathEntries()); loader.addPaths(options.getProcessorPathEntries()); Iterator<Processor> serviceIterator = ServiceLoader.load(Processor.class, loader).iterator(); if (serviceIterator.hasNext() || options.getProcessors() != null) { List<File> inputFiles = new ArrayList<>(); for (ProcessingContext input : inputs) { inputFiles.add(new File(input.getFile().getAbsolutePath())); } try { JavacEnvironment env = createEnvironment(inputFiles, null, true); env.task().parse(); env.task().enter(); processDiagnostics(env.diagnostics()); File sourceOutputDirectory = env.fileManager().getLocation(StandardLocation.SOURCE_OUTPUT).iterator().next(); collectGeneratedInputs(sourceOutputDirectory, "", generatedInputs); return new JavacProcessingResult(generatedInputs, sourceOutputDirectory); } catch (IOException e) { ErrorUtil.fatalError(e, "javac file manager error"); } } return new JavacProcessingResult(generatedInputs, null); }
Source:
<code>public void addItem(File item) { try { copyFile(item, new File(mDataDir, item.getName())); notifyListeners(); } catch (IOException e) { <START> } <END> }</code><technical_language>Silent failing :(</technical_language>

Target:
public boolean addItem(File item) { try { copyFile(item, new File(mDataDir, item.getName())); notifyListeners(); return true; } catch (IOException e) { return false; } }
Source:
<code>private Object callMethod(Map message, Object id) throws JsonRpcException { if (!message.containsKey(METHOD)) { throw new JsonRpcException(id, invalid("required key `method` missing")); } if (!(message.get(METHOD) instanceof String)) { <START> throw new JsonRpcException(id, invalid("key `method` not string", message.get(METHOD))); <END> } String method = (String) message.get(METHOD); if (!methods.containsKey(method)) { throw new JsonRpcException( id, error(METHOD_NOT_FOUND, String.format("method `%s` not found", method))); } Object params = message.get("params"); if (params != null && !(params instanceof List || params instanceof Map)) { throw new JsonRpcException( id, invalidParams("parameters must be a structured value", params)); } try { return methods.get(method).apply(params); } catch (RuntimeException e) { throw new JsonRpcException(id, error(INTERNAL_ERROR, "Internal Error")); } }</code><technical_language>magic value/const</technical_language>

Target:
private Object callMethod(Map message, Object id) throws JsonRpcException { if (!message.containsKey(METHOD)) { throw new JsonRpcException(id, invalid(String.format("required key `%s` missing", METHOD))); } if (!(message.get(METHOD) instanceof String)) { throw new JsonRpcException( id, invalid(String.format("key `%s` not string", METHOD), message.get(METHOD))); } String method = (String) message.get(METHOD); if (!methods.containsKey(method)) { throw new JsonRpcException( id, error(METHOD_NOT_FOUND, String.format("method `%s` not found", method))); } Object params = message.get("params"); if (params != null && !(params instanceof List || params instanceof Map)) { throw new JsonRpcException( id, invalidParams("parameters must be a structured value", params)); } try { return methods.get(method).apply(params); } catch (RuntimeException e) { throw new JsonRpcException(id, error(INTERNAL_ERROR, "Internal Error")); } }
Source:
<code><START> Option<T> peekOption() { <END> return isEmpty() ? Option.none() : Option.some(peek()); }</code><technical_language>needs 2 b public</technical_language>

Target:
public Option<T> peekOption() { return isEmpty() ? Option.none() : Option.some(peek()); }
Source:
<code>public void testDeprecatedKeys_throwsExceptionWhenDeprecatedKeyIsUsed() throws IllegalArgumentException { GoogleHadoopFileSystemConfigurationProperty<String> GCS_PROXY_ADDRESS = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_ADDRESS_KEY, "proxy-address", "fs.gs.proxy.deprecated.address"); GoogleHadoopFileSystemConfigurationProperty<Integer> GCS_PROXY_USERNAME = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_USERNAME_KEY, 1234, "fs.gs.proxy.deprecated.user"); GoogleHadoopFileSystemConfigurationProperty<String> GCS_PROXY_PASSWORD = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_PASSWORD_KEY, "proxy-pass", "fs.gs.proxy.deprecated.pass"); Configuration config = new Configuration(); config.set(GCS_PROXY_ADDRESS.getKey(), GCS_PROXY_ADDRESS.getDefault()); <START> config.setInt(GCS_PROXY_USERNAME.getKey(), GCS_PROXY_USERNAME.getDefault()); <END> config.set("fs.gs.proxy.deprecated.pass", GCS_PROXY_PASSWORD.getDefault()); String userpass = GCS_PROXY_PASSWORD.getPassword(config); assertThat(userpass).isEqualTo("proxy-pass"); GoogleCloudStorageFileSystemOptions.Builder optionsBuilder = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config); assertThrows(IllegalArgumentException.class, () -> optionsBuilder.build()); }</code><technical_language>setInt</technical_language>

Target:
public void testDeprecatedKeys_throwsExceptionWhenDeprecatedKeyIsUsed() throws IllegalArgumentException { GoogleHadoopFileSystemConfigurationProperty<String> gcsProxyAddress = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_ADDRESS_KEY, "proxy-address", "fs.gs.proxy.deprecated.address"); GoogleHadoopFileSystemConfigurationProperty<Integer> gcsProxyUsername = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_USERNAME_KEY, 1234, "fs.gs.proxy.deprecated.user"); GoogleHadoopFileSystemConfigurationProperty<String> gcsProxyPassword = new GoogleHadoopFileSystemConfigurationProperty<>( EntriesCredentialConfiguration.PROXY_PASSWORD_KEY, "proxy-pass", "fs.gs.proxy.deprecated.pass"); Configuration config = new Configuration(); config.set(gcsProxyAddress.getKey(), gcsProxyAddress.getDefault()); config.setInt(gcsProxyUsername.getKey(), gcsProxyUsername.getDefault()); config.set("fs.gs.proxy.deprecated.pass", gcsProxyPassword.getDefault()); String userPass = gcsProxyPassword.getPassword(config); assertThat(userPass).isEqualTo("proxy-pass"); GoogleCloudStorageFileSystemOptions.Builder optionsBuilder = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config); assertThrows(IllegalArgumentException.class, optionsBuilder::build); }
Source:
<code>private <I extends Identified> I visitIdentified(I identified) { if (msg.hasId()) { identified.setId(Id.valueOf(msg.getId())); } if (msg.hasUri()) { identified.setCanonicalUri(msg.getUri()); } if (msg.hasLastUpdated()) { <START> identified.setLastUpdated(new DateTimeSerializer().deserialize(msg.getLastUpdated())); <END> } Builder<Alias> aliases = ImmutableSet.builder(); for (CommonProtos.Alias alias : msg.getAliasesList()) { aliases.add(new Alias(alias.getNamespace(), alias.getValue())); } identified.setAliases(aliases.build()); ImmutableSet.Builder<EquivalenceRef> equivRefs = ImmutableSet.builder(); for (Reference equivRef : msg.getEquivsList()) { equivRefs.add(new EquivalenceRef(Id.valueOf(equivRef.getId()), Sources.fromPossibleKey(equivRef.getSource()).get() )); } identified.setEquivalentTo(equivRefs.build()); return identified; }</code><technical_language>DateTimeSerializer a class member</technical_language>

Target:
private <I extends Identified> I visitIdentified(I identified) { if (msg.hasId()) { identified.setId(Id.valueOf(msg.getId())); } if (msg.hasUri()) { identified.setCanonicalUri(msg.getUri()); } if (msg.hasLastUpdated()) { identified.setLastUpdated(dateTimeSerializer.deserialize(msg.getLastUpdated())); } Builder<Alias> aliases = ImmutableSet.builder(); for (CommonProtos.Alias alias : msg.getAliasesList()) { aliases.add(new Alias(alias.getNamespace(), alias.getValue())); } identified.setAliases(aliases.build()); ImmutableSet.Builder<EquivalenceRef> equivRefs = ImmutableSet.builder(); for (Reference equivRef : msg.getEquivsList()) { equivRefs.add(new EquivalenceRef(Id.valueOf(equivRef.getId()), Sources.fromPossibleKey(equivRef.getSource()).get() )); } identified.setEquivalentTo(equivRefs.build()); return identified; }
Source:
<code>protected boolean isInterfaceSupportedForPlugUnPlug(Disk disk) { List<String> diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces(getVm().getOs(), getVm().getVdsGroupCompatibilityVersion()); if (CollectionUtils.isEmpty(diskHotpluggableInterfaces)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED); } Collection<DiskInterface> diskInterfaces = new HashSet<DiskInterface>(); for (String diskHotpluggableInterface : diskHotpluggableInterfaces) { diskInterfaces.add(DiskInterface.valueOf(diskHotpluggableInterface)); } if (!diskInterfaces.contains(disk.getDiskInterface())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED); <START> } <END> return true; }</code><technical_language>easier replace this for if blocks diskHotpluggableInterfaces.contains(disk.getInterface().toString()) faster</technical_language>

Target:
protected boolean isInterfaceSupportedForPlugUnPlug(Disk disk) { Set<String> diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces(getVm().getOs(), getVm().getVdsGroupCompatibilityVersion()); if (CollectionUtils.isEmpty(diskHotpluggableInterfaces) || !diskHotpluggableInterfaces.contains(disk.getDiskInterface().toString())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED); } return true; }
Source:
<code>private void updateVolumeDescription() { Guid storagePoolId = getParameters().getStoragePoolId(); Guid storageDomainId = getParameters().getStorageDomainId(); Guid imageGroupId = getParameters().getImageGroupId(); <START> DiskImage baseDiskImage = imagesHandler.getVolumeInfoFromVdsm( storagePoolId, storageDomainId, imageGroupId, getParameters().getBaseImage().getImageId()); DiskImage topDiskImage = imagesHandler.getVolumeInfoFromVdsm( storagePoolId, storageDomainId, imageGroupId, getParameters().getTopImage().getImageId()); <END> if (!Objects.equals(topDiskImage.getDescription(), baseDiskImage.getDescription())) { try { SetVolumeDescriptionVDSCommandParameters vdsCommandParameters = new SetVolumeDescriptionVDSCommandParameters( storagePoolId, storageDomainId, imageGroupId, baseDiskImage.getImageId(), topDiskImage.getDescription()); runVdsCommand(VDSCommandType.SetVolumeDescription, vdsCommandParameters); } catch (Exception e) { log.error("Exception while setting volume description for disk. ERROR: '{}'", e); StorageDomain storageDomain = storageDomainDao.getForStoragePool(storageDomainId, storagePoolId); StoragePool storagePool = storagePoolDao.get(storagePoolId); addCustomValue("DataCenterName", storagePool.getName()); addCustomValue("StorageDomainName", storageDomain.getName()); addCustomValue("DiskName", getParameters().getBaseImage().getDiskAlias()); auditLogDirector.log(this, AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED); } } }</code><technical_language>this info DB?</technical_language>

Target:
private void updateVolumeDescription() { Guid storagePoolId = getParameters().getStoragePoolId(); Guid storageDomainId = getParameters().getStorageDomainId(); Guid imageGroupId = getParameters().getImageGroupId(); try { imagesHandler.updateMergeVolumeDescription(storagePoolId, storageDomainId, imageGroupId, getParameters().getBaseImage().getImageId(), getParameters().getTopImage().getImageId()); } catch (Exception e) { log.error("Exception while setting volume description for disk. ERROR: '{}'", e); StorageDomain storageDomain = storageDomainDao.getForStoragePool(storageDomainId, storagePoolId); StoragePool storagePool = storagePoolDao.get(storagePoolId); addCustomValue("DataCenterName", storagePool.getName()); addCustomValue("StorageDomainName", storageDomain.getName()); addCustomValue("DiskName", getParameters().getBaseImage().getDiskAlias()); auditLogDirector.log(this, AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED); } }
Source:
<code>default void sendWrongEpochMessage(CorfuMsg msg, ChannelHandlerContext ctx) { sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.WRONG_EPOCH, getServerEpoch())); <START> log.warn("Incoming message with wrong epoch, got {}, expected {}, message was: {}", <END> msg.getEpoch(), getServerEpoch(), msg); }</code><technical_language>This log line in methods trace level in master, warning level</technical_language>

Target:
default void sendWrongEpochMessage(CorfuMsg msg, ChannelHandlerContext ctx) { sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.WRONG_EPOCH, getServerEpoch())); log.trace("Incoming message with wrong epoch, got {}, expected {}, message was: {}", msg.getEpoch(), getServerEpoch(), msg); }
Source:
<code>private RecipeManager loadRecipesAndTags() { ResourcePackList<ResourcePackInfo> resourcePacks = new ResourcePackList<>(ResourcePackInfo::new); ResourcePackLoader.loadResourcePacks(resourcePacks, RecipeAdvancementProvider::buildPackFinder); SimpleReloadableResourceManager resourceManager = new SimpleReloadableResourceManager( ResourcePackType.SERVER_DATA, Thread.currentThread()); resourceManager.addReloadListener(new NetworkTagManager()); RecipeManager recipeManager = new RecipeManager(); resourceManager.addReloadListener(recipeManager); resourcePacks.addPackFinder(new ServerPackFinder()); resourcePacks.reloadPacksFromFinders(); List<ResourcePackInfo> list = Lists.newArrayList(resourcePacks.getEnabledPacks()); for (ResourcePackInfo resourcepackinfo : resourcePacks.getAllPacks()) { resourcepackinfo.getPriority().func_198993_a(list, resourcepackinfo, (p_200247_0_) -> { return p_200247_0_; }, false); } resourcePacks.setEnabledPacks(list); List<IResourcePack> list1 = Lists.newArrayList(); resourcePacks.getEnabledPacks().forEach((p_200244_1_) -> { list1.add(p_200244_1_.getResourcePack()); }); CompletableFuture<Unit> completablefuture = resourceManager.reloadResourcesAndThen(Util.getServerExecutor(), Util.getServerExecutor(), list1, CompletableFuture.completedFuture(Unit.INSTANCE)); BooleanSupplier isDone = completablefuture::isDone; while (!isDone.getAsBoolean()) { Thread.yield(); LockSupport.parkNanos("waiting for tasks", 100000L); } <START> return recipeManager; <END> }</code><technical_language>is this required recipe advancements? 0.o extremely hacky</technical_language>

Target:
private RecipeManager loadRecipesAndTags() { ResourcePackList<ResourcePackInfo> resourcePacks = new ResourcePackList<>(ResourcePackInfo::new); ResourcePackLoader.loadResourcePacks(resourcePacks, RecipeAdvancementProvider::buildPackFinder); SimpleReloadableResourceManager resourceManager = new SimpleReloadableResourceManager( ResourcePackType.SERVER_DATA, Thread.currentThread()); resourceManager.addReloadListener(new NetworkTagManager()); RecipeManager recipeManager = new RecipeManager(); resourceManager.addReloadListener(recipeManager); resourcePacks.addPackFinder(new ServerPackFinder()); resourcePacks.reloadPacksFromFinders(); List<ResourcePackInfo> list = Lists.newArrayList(resourcePacks.getEnabledPacks()); for (ResourcePackInfo resourcepackinfo : resourcePacks.getAllPacks()) { resourcepackinfo.getPriority().func_198993_a(list, resourcepackinfo, (p_200247_0_) -> { return p_200247_0_; }, false); } resourcePacks.setEnabledPacks(list); List<IResourcePack> list1 = Lists.newArrayList(); resourcePacks.getEnabledPacks().forEach((p_200244_1_) -> { list1.add(p_200244_1_.getResourcePack()); }); CompletableFuture<Unit> completablefuture = resourceManager.reloadResourcesAndThen(Util.getServerExecutor(), Util.getServerExecutor(), list1, CompletableFuture.completedFuture(Unit.INSTANCE)); completablefuture.join(); return recipeManager; }
Source:
<code>public void addServerAndUpdateSegment( QueryableDruidServer server, DataSegment segment ) { synchronized (this) { this.segment.set(segment); Set<QueryableDruidServer> priorityServers; if (server.getServer().getType() == ServerType.REALTIME) { priorityServers = realtimeServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>()); <START> } else { <END> priorityServers = historicalServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>()); } priorityServers.add(server); } }</code><technical_language>more types of servers, future-proof, I add a check server is HISTORICAL</technical_language>

Target:
public void addServerAndUpdateSegment( QueryableDruidServer server, DataSegment segment ) { synchronized (this) { this.segment.set(segment); Set<QueryableDruidServer> priorityServers; if (server.getServer().getType() == ServerType.HISTORICAL) { priorityServers = historicalServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>() ); } else { priorityServers = realtimeServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>() ); } priorityServers.add(server); } }
Source:
<code>public String getCatalog() throws SQLException <START> { <END> HPCCJDBCUtils.traceoutln(TraceLevel.VERBOSE, "HPCCConnection: getCatalog()"); return "HPCC Catalog"; }</code><technical_language>Java allow "throws" if doesn't</technical_language>

Target:
public String getCatalog() throws SQLException { HPCCJDBCUtils.traceoutln(Level.FINEST, "HPCCConnection: getCatalog()"); return "HPCC Catalog"; }
Source:
<code>protected File dir() { if (this.project instanceof Job) { <START> Job jib = (Job) this.project; <END> Run run = jib.getLastSuccessfulBuild(); if (run != null) { File javadocDir = getBuildArchiveDir(run); if (javadocDir.exists()) { return javadocDir; } } } return getProjectArchiveDir(this.project); }</code><technical_language>Typo</technical_language>

Target:
protected File dir() { if (this.project instanceof Job) { final Job job = (Job) this.project; Run run = getArchiveBuild(job); if (run != null) { File javadocDir = getBuildArchiveDir(run); if (javadocDir.exists()) { return javadocDir; } } } return getProjectArchiveDir(this.project); }
Source:
<code>private void doRecoverTransaction(Uid recoverUid) { int theStatus = _transactionStatusConnectionMgr.getTransactionStatus(_transactionType, recoverUid); try { RecoveringLRA lra = new RecoveringLRA(lraService, recoverUid, theStatus); String Status = ActionStatus.stringForm(theStatus); boolean inFlight = lraService.hasTransaction(lra.getId()); if (!inFlight && lra.getLRAStatus() == null) { lraService.addTransaction(lra); inFlight = true; } if (inFlight && !lraService.getTransaction(lra.getId()).isInFlight()) { inFlight = false; } if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debug("transaction type is " + _transactionType + " uid is " + recoverUid.toString() + "\n ActionStatus is " + Status + " in flight is " + inFlight); } if (!inFlight && lra.isRecovering()) { lra.replayPhase2(); <START> if (!lra.isRecovering()) { <END> if (lraService != null) { lraService.finished(lra, false); } } } } catch (Exception ex) { if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("failed to recover Transaction %s: %s", recoverUid, ex.getMessage()); } } }</code><technical_language>check for isFinished similar? This is a bit hard understand, possibility leak a race condition lra.replayPhase2() some strange changing state Active some currently unknown state</technical_language>

Target:
private void doRecoverTransaction(Uid recoverUid) { int theStatus = _transactionStatusConnectionMgr.getTransactionStatus(_transactionType, recoverUid); try { RecoveringLRA lra = new RecoveringLRA(lraService, recoverUid, theStatus); String Status = ActionStatus.stringForm(theStatus); boolean inFlight = lraService.hasTransaction(lra.getId()); if (!inFlight && lra.getLRAStatus() == null) { lraService.addTransaction(lra); inFlight = true; } if (inFlight && !lraService.getTransaction(lra.getId()).isInFlight()) { inFlight = false; } if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debug("transaction type is " + _transactionType + " uid is " + recoverUid.toString() + "\n ActionStatus is " + Status + " in flight is " + inFlight); } if (!inFlight && lra.isRecovering()) { lra.replayPhase2(); if (!lra.isRecovering() && lraService != null) { lraService.finished(lra, false); } } } catch (Exception ex) { if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("failed to recover Transaction %s: %s", recoverUid, ex.getMessage()); } } }
Source:
<code>protected CurrentTraceContext(Builder<?> builder) { <START> this.scopeDecorators = (List<ScopeDecorator>) builder.scopeDecorators.clone(); <END> }</code><technical_language>I personally clone() for copying other array. new ArrayList<ScopeDecorator>(builder.scopeDecorators)</technical_language>

Target:
protected CurrentTraceContext(Builder<?> builder) { this.scopeDecorators = new ArrayList<>(builder.scopeDecorators); }
Source:
<code>private XmlRpcStruct generateNetworks() { XmlRpcStruct networks = new XmlRpcStruct(); <START> String ifaceNameWithoutVlan; <END> Boolean bonded; Map<String, String> opts; VdsNetworkInterface iface; for (Network network : getParameters().getNetworks()) { opts = new HashMap<String, String>(); iface = findNetworkInterface(network.getName(), getParameters().getInterfaces(), getParameters().getBonds()); ifaceNameWithoutVlan = NetworkUtils.StripVlan(iface.getName()); bonded = isVlan(network) ? findInterfaceByName(ifaceNameWithoutVlan).getBonded() : iface.getBonded(); String type = (bonded != null && bonded) ? "bonding" : "nic"; opts.put(type, ifaceNameWithoutVlan); if (isVlan(network)) { opts.put("vlan", network.getVlanId().toString()); } addBootProtocol(opts, iface); if (network.getMtu() != 0) { opts.put("mtu", String.valueOf(network.getMtu())); } opts.put("bridged", Boolean.toString(network.isVmNetwork())); if (network.isVmNetwork()) { opts.put(VdsProperties.STP, network.getStp() ? "yes" : "no"); } networks.add(network.getName(), opts); } for (String net : getParameters().getRemovedNetworks()) { networks.add(net, REMOVE_OBJ); } return networks; }</code><technical_language>I try out-smart compiler/JRE optimizations.. is assurance this method save performance, hinders optimizations compiler and/or JRE this code. Instead do is create problematic code read & maintain declare variables out of scope, open for potential bugs</technical_language>

Target:
private XmlRpcStruct generateNetworks() { XmlRpcStruct networks = new XmlRpcStruct(); for (Network network : getParameters().getNetworks()) { Map<String, String> opts = new HashMap<String, String>(); VdsNetworkInterface iface = findNetworkInterface(network.getName(), getParameters().getInterfaces(), getParameters().getBonds()); String ifaceNameWithoutVlan = NetworkUtils.StripVlan(iface.getName()); Boolean bonded = isVlan(network) ? findInterfaceByName(ifaceNameWithoutVlan).getBonded() : iface.getBonded(); String type = (bonded != null && bonded) ? "bonding" : "nic"; opts.put(type, ifaceNameWithoutVlan); if (isVlan(network)) { opts.put("vlan", network.getVlanId().toString()); } addBootProtocol(opts, iface); if (network.getMtu() != 0) { opts.put("mtu", String.valueOf(network.getMtu())); } opts.put("bridged", Boolean.toString(network.isVmNetwork())); if (network.isVmNetwork()) { opts.put(VdsProperties.STP, network.getStp() ? "yes" : "no"); } networks.add(network.getName(), opts); } for (String net : getParameters().getRemovedNetworks()) { networks.add(net, REMOVE_OBJ); } return networks; }
Source:
<code>public List<ConnectorPartitionHandle> listPartitionHandles(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle; int bucketCount = handle.getBucketCount(); <START> ImmutableList.Builder<ConnectorPartitionHandle> resultBuilder = ImmutableList.builder(); <END> for (int i = 0; i < bucketCount; i++) { resultBuilder.add(new HivePartitionHandle(i)); } return resultBuilder.build(); }</code><technical_language>IntStream.range(0, bucketCount).mapToObj(index -> new HivePartitionHandle(index)).collect(toImmutableList())</technical_language>

Target:
public List<ConnectorPartitionHandle> listPartitionHandles(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle; int bucketCount = handle.getBucketCount(); return IntStream.range(0, bucketCount).mapToObj(HivePartitionHandle::new).collect(toImmutableList()); }
Source:
<code>public PublishPlanetJob(String thingUID) { <START> checkNotNull(thingUID, "Thing UID cannot be null"); <END> this.thingUID = thingUID; }</code><technical_language>Please remove</technical_language>

Target:
public PublishPlanetJob(String thingUID) { checkArgument(thingUID != null, "Thing UID cannot be null"); this.thingUID = thingUID; }
Source:
<code>public OpenShiftLocalSubjectAccessReviewOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural) { this(new OperationContext().withOkhttpClient(client).withConfig(config), apiGroupName, apiGroupVersion, plural); <START> this.subjectAccessApiGroupName = apiGroupName; this.subjectAccessApiGroupVersion = apiGroupVersion; this.plural = plural; <END> }</code><technical_language>This is redundant, previous statement takes care of this. I declare fields final</technical_language>

Target:
public OpenShiftLocalSubjectAccessReviewOperationsImpl(OkHttpClient client, Config config, String apiGroupName, String apiGroupVersion, String plural) { this(new OperationContext().withOkhttpClient(client).withConfig(config), apiGroupName, apiGroupVersion, plural); }
Source:
<code>ViewDistance(String displayName, int index, Vector3i chunkDistance) { <START> this.displayName = String.format(displayName + " (%1$dx%2$dx%3$d)", chunkDistance.getX(), chunkDistance.getY(), chunkDistance.getZ()); <END> this.index = index; this.chunkDistance = chunkDistance; }</code><technical_language>1. Instead of assigning a displayName in constructor, please return this formatted string in toString() method. This is want original displayName for purposes internal log output. 2. String.format(), displayName part of format string for consistency - i.e. java String.format("%s (%1$dx%2$dx%3$d)", displayName /* , ... */);</technical_language>

Target:
ViewDistance(String displayName, int index, Vector3i chunkDistance) { this.displayName = displayName; this.index = index; this.chunkDistance = chunkDistance; }
Source:
<code>public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { {"255.255.255.255", 4294967295L }, {"1.255.4.255", 33490175 }, {"0.128.0.7", 8388615 }, {"1.2.3.4", 16909060 }, {"127.63.31.7", 2134843143 }, <START> {"0.0.0.1", 1 }, }); <END> }</code><technical_language>tests readable - I idea sense (other one). Consider: * values easy translate, 1.1.1.1. * hexadecimal notation expected result (e.g for 255.255.255.255, 0xffffffff)</technical_language>

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { "255.255.255.255", 4294967295L }, { "1.1.1.1", 16843009 }, { "1.255.4.255", 33490175 }, { "0.128.0.7", 8388615 }, { "1.2.3.4", 16909060 }, { "127.63.31.7", 2134843143 }, { "0.0.0.1", 1 }, }); }
Source:
<code>public Reply<?> create(Request request) { NewAccessPointDTO dto = request.read(NewAccessPointDTO.class).as(Json.class); NewAccessPoint ap = adapt(dto); Optional<Object> id = repository.create(ap); if (!id.isPresent()) { return Reply.with("AP creation failed due to non-existing operator").notFound(); <START> } <END> return Reply.saying().ok(); }</code><technical_language>I this logic removed REST. In method create repository throw exception if if try assign AP undefined operator</technical_language>

Target:
public Reply<?> create(Request request) { NewAccessPointDTO dto = request.read(NewAccessPointDTO.class).as(Json.class); NewAccessPoint ap = adapt(dto); repository.create(ap); return Reply.with("Successfully created AP").ok(); }