auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static ImmutableList<Arguments> getOptionalArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> optionalArgsBuilder = ImmutableList.builder(); LOG.debug("Getting optional args..."); <START> if (ds3Request.getOptionalQueryParams() == null) { <END> return optionalArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getOptionalQueryParams()) { final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); optionalArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return optionalArgsBuilder.build(); }</code><technical_language>This Guard class</technical_language>

Target:
private static ImmutableList<Arguments> getOptionalArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> optionalArgsBuilder = ImmutableList.builder(); LOG.debug("Getting optional args..."); if (ConverterUtil.isEmpty(ds3Request.getOptionalQueryParams())) { return optionalArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getOptionalQueryParams()) { final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); optionalArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return optionalArgsBuilder.build(); }
Source:
<code><START> public static void initTrace(Optional<Boolean> isObservable, String traceId) { <END> boolean observable = isObservable.or(sampler.sample()); currentTrace.set(new Trace(observable, traceId)); }</code><technical_language>do minimal constraint checking traceId non-null non-empty</technical_language>

Target:
public static void initTrace(Optional<Boolean> isObservable, String traceId) { validateId(traceId, "traceId must be non-empty: %s"); boolean observable = isObservable.or(sampler.sample()); currentTrace.set(new Trace(observable, traceId)); }
Source:
<code>private void setupArtifactInfo(Artifact artifact, XWidgetRendererItem xWidgetLayoutData, XWidget xWidget) { if (artifact == null) { return; } if (xWidget instanceof IAttributeWidget) { <START> try { <END> String storeName = xWidgetLayoutData.getStoreName(); if (!Strings.isValid(storeName)) { return; } AttributeTypeToken attributeType = AttributeTypeManager.getType(storeName); ((IAttributeWidget) xWidget).setAttributeType(artifact, attributeType); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } else if (xWidget instanceof IArtifactWidget) { try { ((IArtifactWidget) xWidget).setArtifact(artifact); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }</code><technical_language>If a widget extends IAttributeWidget, a storeName. remove IAttributeWidget offending widget implement getStoreName</technical_language>

Target:
private void setupArtifactInfo(Artifact artifact, XWidgetRendererItem xWidgetLayoutData, XWidget xWidget) { if (artifact == null) { return; } if (xWidget instanceof IAttributeWidget) { try { AttributeTypeToken attributeType = AttributeTypeManager.getType(xWidgetLayoutData.getStoreName()); ((IAttributeWidget) xWidget).setAttributeType(artifact, attributeType); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } else if (xWidget instanceof IArtifactWidget) { try { ((IArtifactWidget) xWidget).setArtifact(artifact); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }
Source:
<code><START> public GatewayResponse capture(CaptureGatewayRequest request) { <END> return epdqCaptureHandler.capture(request); }</code><technical_language>Adding a generic type <BaseCaptureResponse> remove potential compile warnings</technical_language>

Target:
public GatewayResponse<BaseCaptureResponse> capture(CaptureGatewayRequest request) { return epdqCaptureHandler.capture(request); }
Source:
<code><START> protected static void alignRead(BitBuffer input, IDeclaration declaration) { <END> int align = (int) declaration.getAlignment(); int pos = input.position(); int mask = align - 1; if( (pos & mask) == 0 ) { return ; } pos = (pos + mask) & ~mask; input.position(pos); }</code><technical_language>remove this method added in 2.2, release contained it</technical_language>

Target:
protected static void alignRead(BitBuffer input, IDeclaration declaration) { int mask = (int) declaration.getAlignment() - 1; int pos = (input.position() + mask) & ~mask; input.position(pos); }
Source:
<code>private void setUpMapIfNeeded() { mMap.getOverlayManager().clear(); mMap.setBuiltInZoomControls(true); mMap.setMultiTouchControls(true); mMap.setMinZoomLevel(3); mMap.setMaxZoomLevel(19); mMap.getTileProvider().createTileCache(); <START> if (null == mCompassOverlay) { <END> mCompassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), mMap); } ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(getActivity()); mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10); mScaleBarOverlay.setCentred(true); if (null == mCellTowerGridMarkerClusterer) { mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(getActivity()); BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange); mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap()); } if (null == mMyLocationOverlay) { GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(getActivity().getBaseContext()); gpsMyLocationProvider.setLocationUpdateMinDistance(100); gpsMyLocationProvider.setLocationUpdateMinTime(10000); mMyLocationOverlay = new MyLocationNewOverlay(getActivity().getBaseContext(), gpsMyLocationProvider, mMap); mMyLocationOverlay.setDrawAccuracyEnabled(true); } mMap.getOverlays().add(mCellTowerGridMarkerClusterer); mMap.getOverlays().add(mMyLocationOverlay); mMap.getOverlays().add(mCompassOverlay); mMap.getOverlays().add(mScaleBarOverlay); }</code><technical_language>null other values right of logical operators code consistent</technical_language>

Target:
private void setUpMapIfNeeded() { mMap.getOverlayManager().clear(); mMap.setBuiltInZoomControls(true); mMap.setMultiTouchControls(true); mMap.setMinZoomLevel(3); mMap.setMaxZoomLevel(19); mMap.getTileProvider().createTileCache(); if (mCompassOverlay == null) { mCompassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), mMap); } ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(getActivity()); mScaleBarOverlay.setScaleBarOffset(getResources().getDisplayMetrics().widthPixels / 2, 10); mScaleBarOverlay.setCentred(true); if (mCellTowerGridMarkerClusterer == null) { mCellTowerGridMarkerClusterer = new CellTowerGridMarkerClusterer(getActivity()); BitmapDrawable mapPinDrawable = (BitmapDrawable) getResources().getDrawable(R.drawable.ic_map_pin_orange); mCellTowerGridMarkerClusterer.setIcon(mapPinDrawable == null ? null : mapPinDrawable.getBitmap()); } if (mMyLocationOverlay == null) { GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(getActivity().getBaseContext()); gpsMyLocationProvider.setLocationUpdateMinDistance(100); gpsMyLocationProvider.setLocationUpdateMinTime(10000); mMyLocationOverlay = new MyLocationNewOverlay(getActivity().getBaseContext(), gpsMyLocationProvider, mMap); mMyLocationOverlay.setDrawAccuracyEnabled(true); } mMap.getOverlays().add(mCellTowerGridMarkerClusterer); mMap.getOverlays().add(mMyLocationOverlay); mMap.getOverlays().add(mCompassOverlay); mMap.getOverlays().add(mScaleBarOverlay); }
Source:
<code>@Override protected void updateEnabledState(boolean enabled) { if (enabled != isEnabled()) { setEnabled(enabled); updateEnabledState(getWindow().getComponents(), enabled); for (final TargetDetailEditor ed : _w.detailEditor.allEditorsJava()) { <START> if (_w.detailEditor.curDetailEdiorJava().forall(cur -> cur != ed)) { <END> updateEnabledState(new Component[]{ed}, enabled); } } } final TargetEnvironment env = getDataObject().getTargetEnvironment(); _w.tag.setEnabled(enabled && env.getBase() != _curPos); final SPInstObsComp inst = getContextInstrumentDataObject(); _w.newMenu.setEnabled(enabled && inst != null); }</code><technical_language>curDetailedEdior: refactor fix this horrible spelling error some point. (Should Edi__t__or, Edior.) Also, is a reason do like: final Component[] comps = _w.detailEditor.allEditorsJava().filterNot(_ != _w.detailEditor.curDetailEditorJava()).toArray(); updateEnabledState(comps, enabled); instead of for loop, I missing something</technical_language>

Target:
@Override protected void updateEnabledState(boolean enabled) { if (enabled != isEnabled()) { setEnabled(enabled); updateEnabledState(getWindow().getComponents(), enabled); for (final TargetDetailEditor ed : _w.detailEditor.allEditorsJava()) { if (_w.detailEditor.curDetailEditorJava().forall(cur -> cur != ed)) { updateEnabledState(new Component[]{ed}, enabled); } } } final TargetEnvironment env = getDataObject().getTargetEnvironment(); _w.tag.setEnabled(enabled && env.getBase() != _curPos); final SPInstObsComp inst = getContextInstrumentDataObject(); _w.newMenu.setEnabled(enabled && inst != null); }
Source:
<code>public void unblockAllServicesOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, FacilityNotExistsException, DestinationNotExistsException { Destination destination = getDestinationById(sess, destinationId); <START> List<Facility> destinationFacilities = perunBl.getFacilitiesManager().getFacilitiesByDestination(sess, destination.getDestination()); <END> boolean isFacilityAdminAtLeastOnce = false; for (Facility facility : destinationFacilities) { if (AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facility)) { isFacilityAdminAtLeastOnce = true; } } if (!isFacilityAdminAtLeastOnce && !AuthzResolver.isAuthorized(sess, Role.PERUNADMIN)) { throw new PrivilegeException(sess, "unblockAllServicesOnDestination"); } getServicesManagerBl().unblockAllServicesOnDestination(sess, destinationId); }</code><technical_language>Bl layer get facilities destination</technical_language>

Target:
public void unblockAllServicesOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, FacilityNotExistsException, DestinationNotExistsException { Destination destination = getServicesManagerBl().getDestinationById(sess, destinationId); List<Facility> destinationFacilities = perunBl.getFacilitiesManagerBl().getFacilitiesByDestination(sess, destination.getDestination()); boolean isFacilityAdminAtLeastOnce = false; for (Facility facility : destinationFacilities) { if (AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN, facility)) { isFacilityAdminAtLeastOnce = true; } } if (!isFacilityAdminAtLeastOnce && !AuthzResolver.isAuthorized(sess, Role.PERUNADMIN)) { throw new PrivilegeException(sess, "unblockAllServicesOnDestination"); } getServicesManagerBl().unblockAllServicesOnDestination(sess, destinationId); }
Source:
<code>public void setEmail(String email) { databaseHelper = new DatabaseHelper(this, email); this.you = Person.getOrUpdate(this, email, null, null); <START> setupEmoji(); <END> }</code><technical_language>this unrelated setEmail call. move this a more logical place</technical_language>

Target:
public void setEmail(String email) { databaseHelper = new DatabaseHelper(this, email); this.you = Person.getOrUpdate(this, email, null, null); }
Source:
<code>public String toString() { if (allowed == null) { return format( "The method `%s.%s` throws `%s`. But throwing is not allowed" + " for this kind of methods.", method.getDeclaringClass().getCanonicalName(), method.getName(), enumerateThrown() ); } return format( <START> "The method `%s.%s` throws %s. But only `%s` is allowed for" <END> + " this kind of methods.", method.getDeclaringClass().getCanonicalName(), method.getName(), enumerateThrown(), allowed.getName() ); }</code><technical_language>Perhaps, exception is back-ticked: ... throws %s</technical_language>

Target:
public String toString() { if (allowed == null) { return format( "The method `%s.%s` throws `%s`. But throwing is not allowed" + " for this kind of methods.", method.getDeclaringClass().getCanonicalName(), method.getName(), enumerateThrown() ); } return format( "The method `%s.%s` throws `%s`. But only `%s` is allowed for" + " this kind of methods.", method.getDeclaringClass().getCanonicalName(), method.getName(), enumerateThrown(), allowed.getName() ); }
Source:
<code>public void syncVisitsData(@NonNull final Patient patient, @Nullable final DefaultResponseCallbackListener callbackListener) { RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Results<Visit>> call = restApi.findVisitsByPatientUUID(patient.getUuid(), "custom:(uuid,location:ref,visitType:ref,startDatetime,stopDatetime,encounters:full)"); call.enqueue(new Callback<Results<Visit>>() { @Override public void onResponse(Call<Results<Visit>> call, Response<Results<Visit>> response) { if (response.isSuccessful()) { List<Visit> visits = response.body().getResults(); VisitDAO visitDAO = new VisitDAO(); for (Visit visit : visits) { visitDAO.getVisitsIDByUUID(visit.getUuid()) <START> .observeOn(AndroidSchedulers.mainThread()) <END> .subscribe(visitId -> { if (visitId > 0) { visitDAO.updateVisit(visit, visitId, patient.getId()); } else { visitDAO.saveVisit(visit, patient.getId()); } }); } if (callbackListener != null) { callbackListener.onResponse(); } } else { ToastUtil.error(response.message()); if (callbackListener != null) { callbackListener.onErrorResponse(response.message()); } } } @Override public void onFailure(Call<Results<Visit>> call, Throwable t) { ToastUtil.error(t.getMessage()); if (callbackListener != null) { callbackListener.onErrorResponse(t.getMessage()); } } }); }</code><technical_language>sense return Observable set mainThread() default? call observeOn overwrite previous setting</technical_language>

Target:
public void syncVisitsData(@NonNull final Patient patient, @Nullable final DefaultResponseCallbackListener callbackListener) { RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Results<Visit>> call = restApi.findVisitsByPatientUUID(patient.getUuid(), "custom:(uuid,location:ref,visitType:ref,startDatetime,stopDatetime,encounters:full)"); call.enqueue(new Callback<Results<Visit>>() { @Override public void onResponse(Call<Results<Visit>> call, Response<Results<Visit>> response) { if (response.isSuccessful()) { List<Visit> visits = response.body().getResults(); VisitDAO visitDAO = new VisitDAO(); for (Visit visit : visits) { visitDAO.saveOrUpdate(visit, patient.getId()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(); } if (callbackListener != null) { callbackListener.onResponse(); } } else { ToastUtil.error(response.message()); if (callbackListener != null) { callbackListener.onErrorResponse(response.message()); } } } @Override public void onFailure(Call<Results<Visit>> call, Throwable t) { ToastUtil.error(t.getMessage()); if (callbackListener != null) { callbackListener.onErrorResponse(t.getMessage()); } } }); }
Source:
<code>public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { if (context == null) { logger.debug("Encountered null metric context likely due to exception in preInvocation"); return; } <START> if (result != null && ListenableFuture.class.isAssignableFrom(context.getMethod().getReturnType())) { Futures.addCallback((ListenableFuture<?>) result, new FutureCallback<Object>() { <END> @Override public void onSuccess(@NullableDecl Object result) { update(context); } @Override public void onFailure(Throwable t) { TaggedMetricsInvocationEventHandler.this.onFailure(context, t); } }, MoreExecutors.directExecutor()); } else { update(context); } }</code><technical_language>casting result Object ListenableFuture<?>; do this a check? (It check is checking context's return type, I if is guaranteed type of result)</technical_language>

Target:
public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { if (context == null) { logger.debug("Encountered null metric context likely due to exception in preInvocation"); return; } if (result != null && ListenableFuture.class.isAssignableFrom(context.getMethod().getReturnType()) && ListenableFuture.class.isAssignableFrom(result.getClass())) { Futures.addCallback((ListenableFuture<?>) result, new FutureCallback<Object>() { @Override public void onSuccess(@NullableDecl Object result) { update(context); } @Override public void onFailure(Throwable t) { TaggedMetricsInvocationEventHandler.this.onFailure(context, t); } }, MoreExecutors.directExecutor()); } else { update(context); } }
Source:
<code>public void testWorkflowMissingFilesToCopy() { File cwlFile = new File(ResourceHelpers.resourceFilePath("directory/1st-workflow.cwl")); File cwlJSON = new File(ResourceHelpers.resourceFilePath("directory/1st-workflow-job.json")); <START> exit.expectSystemExitWithStatus(3); <END> this.baseWorkflowTest(cwlFile, cwlJSON, true, "workflow"); systemErrRule.getLog().contains("Missing required secondary file"); }</code><technical_language>is 3 (use a constant)</technical_language>

Target:
public void testWorkflowMissingFilesToCopy() { File cwlFile = new File(ResourceHelpers.resourceFilePath("directory/1st-workflow.cwl")); File cwlJSON = new File(ResourceHelpers.resourceFilePath("directory/1st-workflow-job.json")); exit.expectSystemExitWithStatus(Client.IO_ERROR); this.baseWorkflowTest(cwlFile, cwlJSON, true, "workflow"); systemErrRule.getLog().contains("Missing required secondary file"); }
Source:
<code>public CommandCallback getCallback() { <START> return getParameters().isUseCinderCommandCallback() ? new ConcurrentChildCommandsExecutionCallback() : null; <END> }</code><technical_language>getParameters().isUseCinderCommandCallback() && <remove stateless snapshot create stateless snapshot></technical_language>

Target:
public CommandCallback getCallback() { return (getParameters().isUseCinderCommandCallback() && getFlow().isStateless()) ? new ConcurrentChildCommandsExecutionCallback() : null; }
Source:
<code><START> public ItemReader<Transaction> itemReader(Resource inputData) throws UnexpectedInputException, ParseException { <END> FlatFileItemReader<Transaction> reader = new FlatFileItemReader<>(); DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer(); String[] tokens = { "username", "userid", "transactiondate", "amount" }; tokenizer.setNames(tokens); reader.setResource(inputData); DefaultLineMapper<Transaction> lineMapper = new DefaultLineMapper<>(); lineMapper.setLineTokenizer(tokenizer); lineMapper.setFieldSetMapper(new RecordFieldSetMapper()); reader.setLinesToSkip(1); reader.setLineMapper(lineMapper); return reader; }</code><technical_language>this trimmed a single exception throws? Exception</technical_language>

Target:
public ItemReader<Transaction> itemReader(Resource inputData) throws ParseException { DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer(); tokenizer.setNames(tokens); DefaultLineMapper<Transaction> lineMapper = new DefaultLineMapper<>(); lineMapper.setLineTokenizer(tokenizer); lineMapper.setFieldSetMapper(new RecordFieldSetMapper()); FlatFileItemReader<Transaction> reader = new FlatFileItemReader<>(); reader.setResource(inputData); reader.setLinesToSkip(1); reader.setLineMapper(lineMapper); return reader; }
Source:
<code>public boolean isTransferable(Class<?> entityClass) { NonTransferable nonTransferable = getAnnotation(entityClass, NonTransferable.class); <START> return (nonTransferable == null || nonTransferable.enabled() == false); <END> }</code><technical_language>== false strange. suggestion return (nonTransferable == null || ! nonTransferable.enabled());</technical_language>

Target:
public boolean isTransferable(Class<?> entityClass) { NonTransferable nonTransferable = getAnnotation(entityClass, NonTransferable.class); return (nonTransferable == null || !nonTransferable.enabled()); }
Source:
<code><START> public AlluxioCachingClientFileSystem(ExtendedFileSystem fileSystem, <END> AlluxioConfiguration alluxioConfiguration) { this.fileSystem = fileSystem; this.alluxioConfiguration = alluxioConfiguration; }</code><technical_language>param line leave line empty</technical_language>

Target:
public AlluxioCachingClientFileSystem( ExtendedFileSystem fileSystem, AlluxioConfiguration alluxioConfiguration) { this.fileSystem = requireNonNull(fileSystem, "fileSystem is null"); this.alluxioConfiguration = requireNonNull(alluxioConfiguration, "alluxioConfiguration is null"); }
Source:
<code>private static Configuration createAbfsConfiguration(UnderFileSystemConfiguration conf) { Configuration abfsConf = HdfsUnderFileSystem.createConfiguration(conf); for (Map.Entry<String, String> entry : conf.toMap().entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (PropertyKey.Template.UNDERFS_AZURE_ACCOUNT_KEY.matches(key)) { abfsConf.set(key, value); final String authTypeKey = key.replace(".key", ".auth.type"); abfsConf.set(authTypeKey, "SharedKey"); } } <START> LOG.info(abfsConf.toString()); <END> return abfsConf; }</code><technical_language>avoid putting credentials in log</technical_language>

Target:
private static Configuration createAbfsConfiguration(UnderFileSystemConfiguration conf) { Configuration abfsConf = HdfsUnderFileSystem.createConfiguration(conf); for (Map.Entry<String, String> entry : conf.toMap().entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (PropertyKey.Template.UNDERFS_ABFS_ACCOUNT_KEY.matches(key)) { abfsConf.set(key, value); final String authTypeKey = key.replace(".key", ".auth.type"); abfsConf.set(authTypeKey, "SharedKey"); } } return abfsConf; }
Source:
<code>public SeekablePathStream(final Path path) throws IOException { this.path = path; this.sbc = Files.newByteChannel(path); <START> ALL_INSTANCES.add(this); <END> }</code><technical_language>this constructor delegate new Function.identity()</technical_language>

Target:
public SeekablePathStream(final Path path) throws IOException { this(path, null); }
Source:
<code>private Optional<Alert> findMatchingAlert(List<Alert> alerts, String journalKey) { for (Alert alert : alerts) { String source = alert.getSource(); String frequency = alert.getFrequency(); String name = alert.getName(); if (ALERT_SOURCE.equalsIgnoreCase(source) && ALERT_FREQUENCY.equalsIgnoreCase(frequency) && ALERT_NAME.equalsIgnoreCase(name)) { AlertQuery query = getAlertQuery(alert); List<String> filterJournals = query.getFilterJournals(); <START> if (filterJournals.size() == 1 && journalKey.equalsIgnoreCase(filterJournals.get(0))) { <END> return Optional.of(alert); } } } return Optional.empty(); }</code><technical_language>I ask this support lists more journal. awkward allow anyway: if journal belong alert objects, alert object modify. creating a formal requirement valid Alert objects of this type journal in list. This is fine me, good requirement explicit possible</technical_language>

Target:
private Optional<Alert> findMatchingAlert(List<Alert> alerts, String journalKey) { for (Alert alert : alerts) { String source = alert.getSource(); String frequency = alert.getFrequency(); String name = alert.getName(); if (ALERT_SOURCE.equalsIgnoreCase(source) && ALERT_FREQUENCY.equalsIgnoreCase(frequency) && ALERT_NAME.equalsIgnoreCase(name)) { AlertQuery query = getAlertQuery(alert); List<String> filterJournals = query.getFilterJournals(); if (filterJournals.size() == 1 && journalKey.equals(filterJournals.get(0))) { return Optional.of(alert); } } } return Optional.empty(); }
Source:
<code>public void testTransformNullSourceResponse() throws CatalogTransformerException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); assertThat("Transformer cannot be null", transformer, notNullValue()); SourceResponse response = null; <START> transformer.transform(response, new HashMap<>()); <END> }</code><technical_language>Collections.emptyMap()</technical_language>

Target:
public void testTransformNullSourceResponse() throws CatalogTransformerException, MimeTypeParseException { RtfQueryResponseAndMetacardTransformer transformer = createTransformer(); SourceResponse response = null; transformer.transform(response, Collections.emptyMap()); }
Source:
<code>private void readFromSource(InputStream in) { BufferedReader br = null; InputStreamReader inReader = null; try { inReader = new InputStreamReader(in); br = new BufferedReader(inReader); String strLine; <START> while ((strLine = br.readLine()) != null && !strLine.equals("STOP")) { <END> if (unique) { if (!str.contains(strLine)) { str.add(strLine); } } else { str.add(strLine); } } } catch (Exception e) { } finally { Utils.close(br); Utils.close(inReader); } }</code><technical_language>Ctrl + D</technical_language>

Target:
private void readFromSource(InputStream in) { BufferedReader br = null; InputStreamReader inReader = null; try { inReader = new InputStreamReader(in); br = new BufferedReader(inReader); String strLine; while ((strLine = br.readLine()) != null) { inputStrings.add(strLine); } } catch (Exception e) { } finally { if (!in.equals(System.in)) { Utils.close(br); Utils.close(inReader); } } }
Source:
<code>static MethodHandler<?> create(Retrofit retrofit, Method method) { CallAdapter<Object> callAdapter = (CallAdapter<Object>) createCallAdapter(method, retrofit); Type responseType = callAdapter.responseType(); Converter<ResponseBody, Object> responseConverter = (Converter<ResponseBody, Object>) createResponseConverter(method, retrofit, responseType); RequestFactory requestFactory = RequestFactoryParser.parse(method, responseType, retrofit); <START> String infoForException = collectInfoForException(method); <END> return new MethodHandler<>(retrofit, requestFactory, callAdapter, responseConverter, infoForException); }</code><technical_language>Yikes. Is this lazily computed needed? I realize caching cost is paid once, in exceptional case I mind paying cost of computation time</technical_language>

Target:
static MethodHandler<?> create(Retrofit retrofit, Method method) { CallAdapter<Object> callAdapter = (CallAdapter<Object>) createCallAdapter(method, retrofit); Type responseType = callAdapter.responseType(); Converter<ResponseBody, Object> responseConverter = (Converter<ResponseBody, Object>) createResponseConverter(method, retrofit, responseType); RequestFactory requestFactory = RequestFactoryParser.parse(method, responseType, retrofit); return new MethodHandler<>(retrofit, requestFactory, callAdapter, responseConverter); }
Source:
<code>private boolean isDefaultGiven(String swaggerContent) throws APIManagementException { OpenAPI openAPI = getOpenAPI(swaggerContent); boolean isDefaultGiven = true; try { SecurityScheme checkDefault = openAPI.getComponents().getSecuritySchemes().get(OPENAPI_SECURITY_SCHEMA_KEY); if (checkDefault == null) { isDefaultGiven = false; } return isDefaultGiven; <START> } catch (NullPointerException e) { isDefaultGiven = false; return isDefaultGiven; } <END> }</code><technical_language>catch NPEs. need pre-checks for null executing a code NPE</technical_language>

Target:
private boolean isDefaultGiven(String swaggerContent) throws APIManagementException { OpenAPI openAPI = getOpenAPI(swaggerContent); Components components = openAPI.getComponents(); if (components == null) { return false; } Map<String, SecurityScheme> securitySchemes = components.getSecuritySchemes(); if (securitySchemes == null) { return false; } SecurityScheme checkDefault = openAPI.getComponents().getSecuritySchemes().get(OPENAPI_SECURITY_SCHEMA_KEY); if (checkDefault == null) { return false; } return true; }
Source:
<code>public boolean isAdjacent(final V v1, final V v2) { final Map<V, I> adjs = adjacent.get(v1); <START> for (final Map.Entry<V, I> edge : adjs.entrySet()) { <END> if (edge.getKey().equals(v2)) { return true; } } return false; }</code><technical_language>do for loop. adjs.get(v2)</technical_language>

Target:
public boolean isAdjacent(final V v1, final V v2) { final Map<V, I> adjs = adjacent.get(v1); return adjs.containsKey(v2); }
Source:
<code>public TicketRegistry ticketRegistry(@Qualifier("ehcache3TicketCacheManager") final javax.cache.CacheManager ehcacheManager, @Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val crypto = ehcacheProperties.getCrypto(); val definitions = ticketCatalog.findAll(); definitions.forEach(t -> { val cacheName = t.getProperties().getStorageName(); if (ehcacheManager.getCache(cacheName, String.class, Ticket.class) == null) { val ehcacheConfiguration = buildCacheConfiguration(t); ehcacheManager.createCache(cacheName, Eh107Configuration.fromEhcacheCacheConfiguration(ehcacheConfiguration)); } }); <START> return new EhCache3TicketRegistry(ticketCatalog, ehcacheManager, CoreTicketUtils.newTicketRegistryCipherExecutor(crypto, "ehcache")); <END> }</code><technical_language>this ehcache3 in end for cipher</technical_language>

Target:
public TicketRegistry ticketRegistry(@Qualifier("ehcache3TicketCacheManager") final javax.cache.CacheManager ehcacheManager, @Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) { val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache3(); val crypto = ehcacheProperties.getCrypto(); val definitions = ticketCatalog.findAll(); definitions.forEach(t -> { val cacheName = t.getProperties().getStorageName(); if (ehcacheManager.getCache(cacheName, String.class, Ticket.class) == null) { val ehcacheConfiguration = buildCacheConfiguration(t); ehcacheManager.createCache(cacheName, Eh107Configuration.fromEhcacheCacheConfiguration(ehcacheConfiguration)); } }); return new EhCache3TicketRegistry(ticketCatalog, ehcacheManager, CoreTicketUtils.newTicketRegistryCipherExecutor(crypto, "ehcache3")); }
Source:
<code>public TrieNode putNode(String path, TrieNode t) { <START> LOG.info("Entrie.put(" + path + ")"); <END> if (path.startsWith("/")) path = path.substring(1); if (path.length() == 0) { return t; } String[] elements = path.split("/"); TrieNode existing = children.getOrDefault(elements[0], TrieNodeImpl.empty()); TrieNode newChild = existing.putNode(path.substring(elements[0].length()), t); HashMap<String, TrieNode> newChildren = new HashMap<>(children); newChildren.put(elements[0], newChild); return new TrieNodeImpl(newChildren, value, pathMappings); }</code><technical_language>nit: debug</technical_language>

Target:
public TrieNode putNode(String path, TrieNode t) { LOG.info("Entrie.put(" + path + ")"); path = TrieNode.canonicalise(path); if (path.length() == 0) { return t; } String[] elements = path.split("/"); TrieNode existing = children.getOrDefault(elements[0], TrieNodeImpl.empty()); TrieNode newChild = existing.putNode(path.substring(elements[0].length()), t); HashMap<String, TrieNode> newChildren = new HashMap<>(children); newChildren.put(elements[0], newChild); return new TrieNodeImpl(newChildren, value); }
Source:
<code>protected void registerAppFeature(JSONArray args, final CallbackContext callbackContext) throws JSONException { Log.i("SDKInfoPlugin.registerAppFeature", "registerAppFeature called"); JSONObject arg0 = args.getJSONObject(0); if(arg0 != null){ String appFeatureCode = arg0.getString("feature"); <START> if(appFeatureCode != null && !appFeatureCode.isEmpty()){ <END> SalesforceSDKManager.getInstance().registerUsedAppFeature(appFeatureCode); } } callbackContext.success(); }</code><technical_language>replace this if condition !TextUtils.isEmpty(appFeatureCode)</technical_language>

Target:
protected void registerAppFeature(JSONArray args, final CallbackContext callbackContext) throws JSONException { Log.i("SDKInfoPlugin.registerAppFeature", "registerAppFeature called"); JSONObject arg0 = args.getJSONObject(0); if(arg0 != null){ String appFeatureCode = arg0.getString("feature"); if(!TextUtils.isEmpty(appFeatureCode)){ SalesforceSDKManager.getInstance().registerUsedAppFeature(appFeatureCode); } } callbackContext.success(); }
Source:
<code>public RemoteServerConfigurationImpl(List<RemoteServerData> serverData, TaskRunner taskRunner) { remoteServerDataList = new ArrayList<>(serverData); for (RemoteServerData remoteServerData : serverData) { actualStateMap.put(remoteServerData.getServerName(), RemoteServerState.UNKNOWN); } if (taskRunner == null || !(taskRunner instanceof ScheduledTaskRunner)) { <START> logger.error("Task runner isn't ScheduledTaskRunner. Remote server status task won't be scheduled."); <END> } else { scheduledTaskRunner = (ScheduledTaskRunner) taskRunner; } }</code><technical_language>this throw instead of logging? scheduledTaskRunner final drop check in scheduledTask()</technical_language>

Target:
public RemoteServerConfigurationImpl(List<RemoteServerData> serverData, TaskRunner taskRunner) { remoteServerDataList = new ArrayList<>(serverData); for (RemoteServerData remoteServerData : serverData) { actualStateMap.put(remoteServerData.getServerName(), RemoteServerState.UNKNOWN); } if (taskRunner == null || !(taskRunner instanceof ScheduledTaskRunner)) { logger.info("Task runner isn't ScheduledTaskRunner. Remote server status task won't be scheduled."); } else { scheduledTaskRunner = (ScheduledTaskRunner) taskRunner; } }
Source:
<code>static OperationStepHandler checkNoOtherSibling(final String childType) { return new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { <START> PathAddress currentAddress = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)); <END> PathAddress parentAddress = currentAddress.subAddress(0, currentAddress.size() - 1); Resource parent = context.readResourceFromRoot(parentAddress); Set<String> children = parent.getChildrenNames(childType); if (children.size() > 1) { throw MessagingLogger.ROOT_LOGGER.onlyOneChildIsAllowed(childType, children); } } }; }</code><technical_language>a blocker, context.getCurrentAddress() for this kind of thing</technical_language>

Target:
static OperationStepHandler checkNoOtherSibling(final String childType) { return new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { PathAddress parentAddress = context.getCurrentAddress().getParent(); Resource parent = context.readResourceFromRoot(parentAddress, false); Set<String> children = parent.getChildrenNames(childType); if (children.size() > 1) { throw MessagingLogger.ROOT_LOGGER.onlyOneChildIsAllowed(childType, children); } } }; }
Source:
<code>private static Map<Class<?>, Converter> createConvertersMap(List<Converter> converters) { <START> Map<Class<?>, Converter> res = new HashMap<>(); <END> for (Converter converter : converters) { Class<?> valueClass = converter.getValueClass(); if (valueClass != null) { Converter prevConverter = res.put(valueClass, converter); if (prevConverter != null) { throw new HazelcastException("Duplicate converter for class [class=" + valueClass + ", converter1=" + prevConverter.getValueClass().getName() + ", converter2=" + valueClass.getName() + ']'); } Class<?> primitiveValueClass = getPrimitiveClass(valueClass); if (primitiveValueClass != null) { res.put(primitiveValueClass, converter); } } } return res; }</code><technical_language>Initialize res size of converters</technical_language>

Target:
private static Map<Class<?>, Converter> createConvertersMap(List<Converter> converters) { Map<Class<?>, Converter> res = new HashMap<>(converters.size()); for (Converter converter : converters) { Class<?> valueClass = converter.getValueClass(); if (valueClass != null) { Converter prevConverter = res.put(valueClass, converter); if (prevConverter != null) { throw new HazelcastException("Duplicate converter for class [class=" + valueClass + ", converter1=" + prevConverter.getValueClass().getName() + ", converter2=" + valueClass.getName() + ']'); } Class<?> primitiveValueClass = getPrimitiveClass(valueClass); if (primitiveValueClass != null) { res.put(primitiveValueClass, converter); } } } return res; }
Source:
<code>private Set<Column> findOriginatingColumnsOfSource(Object source) { final Set<Column> cachedOriginatingColumns = originatingColumnsOfSourceCache.get(source); if (cachedOriginatingColumns != null) { return cachedOriginatingColumns; } <START> Set<Column> originatingColumns = new HashSet<>(); <END> if (source != null) { if (source instanceof InputColumnSinkJob) { InputColumn<?>[] input = ((InputColumnSinkJob) source).getInput(); if (input != null) { for (InputColumn<?> inputColumn : input) { originatingColumns.addAll(findOriginatingColumnsOfInputColumn(inputColumn)); } } } if (source instanceof HasComponentRequirement) { final HasComponentRequirement hasComponentRequirement = (HasComponentRequirement) source; final ComponentRequirement componentRequirement = hasComponentRequirement.getComponentRequirement(); final Collection<FilterOutcome> requirements = getProcessingDependencies(componentRequirement); for (FilterOutcome outcome : requirements) { originatingColumns.addAll(findOriginatingColumnsOfOutcome(outcome)); } } } originatingColumnsOfSourceCache.put(source, originatingColumns); return originatingColumns; }</code><technical_language>final</technical_language>

Target:
private Set<Column> findOriginatingColumnsOfSource(Object source) { final Set<Column> cachedOriginatingColumns = originatingColumnsOfSourceCache.get(source); if (cachedOriginatingColumns != null) { return cachedOriginatingColumns; } final Set<Column> originatingColumns = new HashSet<>(); if (source != null) { if (source instanceof InputColumnSinkJob) { InputColumn<?>[] input = ((InputColumnSinkJob) source).getInput(); if (input != null) { for (InputColumn<?> inputColumn : input) { originatingColumns.addAll(findOriginatingColumnsOfInputColumn(inputColumn)); } } } if (source instanceof HasComponentRequirement) { final HasComponentRequirement hasComponentRequirement = (HasComponentRequirement) source; final ComponentRequirement componentRequirement = hasComponentRequirement.getComponentRequirement(); final Collection<FilterOutcome> requirements = getProcessingDependencies(componentRequirement); for (FilterOutcome outcome : requirements) { originatingColumns.addAll(findOriginatingColumnsOfOutcome(outcome)); } } } originatingColumnsOfSourceCache.put(source, originatingColumns); return originatingColumns; }
Source:
<code>public void registerOperations(ManagementResourceRegistration interfaces) { super.registerOperations(interfaces); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_INSTANCE, true); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_DEFINITION, <START> org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_INSTANCE, true); <END> }</code><technical_language>InterfaceDefinition -- registered domain root, /host=*</technical_language>

Target:
public void registerOperations(ManagementResourceRegistration interfaces) { super.registerOperations(interfaces); if( resolvable ) { interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadResourceHandler.RESOLVE_INSTANCE, true); interfaces.registerOperationHandler(org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_DEFINITION, org.jboss.as.controller.operations.global.ReadAttributeHandler.RESOLVE_INSTANCE, true); } }
Source:
<code>public static SynchronizeTimeRequest fromParameterMap(final Map<String, String> parameters) { final SynchronizeTimeRequest request = new SynchronizeTimeRequest(); request.setDeviceIdentification(parameters.get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION)); request.setSynchronizeTimeRequestData(SynchronizeTimeRequestDataFactory.fromParameterMap(parameters)); <START> ; <END> return request; }</code><technical_language>remove line</technical_language>

Target:
public static SynchronizeTimeRequest fromParameterMap(final Map<String, String> parameters) { final SynchronizeTimeRequest request = new SynchronizeTimeRequest(); request.setDeviceIdentification(parameters.get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION)); request.setSynchronizeTimeRequestData(SynchronizeTimeRequestDataFactory.fromParameterMap(parameters)); return request; }
Source:
<code>protected VDSParametersBase getRevertVDSParameters() { boolean wipeAfterDelete = ImagesHandler.shouldWipeAfterDelete( DbFacade.getInstance().getDiskImageDao().get(getEnclosingCommand(). getParameters().getDestinationImageId()).isWipeAfterDelete(), DbFacade.getInstance().getStorageDomainDao().get(getEnclosingCommand(). <START> getParameters().getStorageDomainId()).getStorageType()); <END> return new DeleteImageGroupVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getTargetStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), wipeAfterDelete, getEnclosingCommand().getParameters().getForceDelete()); }</code><technical_language>DAO calls here, is a shame. DAO call, get DiskImage object, pass isWipeAfterDelete() getStorageType() ImagesHandler</technical_language>

Target:
protected VDSParametersBase getRevertVDSParameters() { DiskImage diskImage = DbFacade.getInstance().getDiskImageDao().get( getEnclosingCommand().getParameters().getDestinationImageId()); boolean wipeAfterDelete = ImagesHandler.shouldWipeAfterDelete( diskImage.isWipeAfterDelete(), diskImage.getStorageTypes().get(0)); return new DeleteImageGroupVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getTargetStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), wipeAfterDelete, getEnclosingCommand().getParameters().getForceDelete()); }
Source:
<code>public ValueHolder<V> replace(final K key, final V value) throws CacheAccessException { checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); <START> final long now = timeSource.getTimeMillis(); <END> map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue.isExpired(now)) { return null; } else { returnValue.set(mappedValue); return newValueHolder(key, value, now); } } }); return returnValue.get(); }</code><technical_language>Here, now... in a conditional compute, best</technical_language>

Target:
public ValueHolder<V> replace(final K key, final V value) throws CacheAccessException { checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { final long now = timeSource.getTimeMillis(); if (mappedValue.isExpired(now)) { return null; } else { returnValue.set(mappedValue); return newValueHolder(key, value, now); } } }); return returnValue.get(); }
Source:
<code>public static IFile getWorkspaceFile(URI uri) { IWorkspaceRoot root = ResourcesPlugin .getWorkspace() .getRoot(); URI relativize = root.getLocationURI().relativize(uri); <START> IPath path = new Path(relativize.getPath()); <END> try { return root.getFile(path); } catch (Exception e) { return null; } }</code><technical_language>sense call getWorkspaceFile(IPath path) here</technical_language>

Target:
public static IFile getWorkspaceFile(URI uri) { return getWorkspaceFile(new Path(uri.getPath())); }
Source:
<code>public void testValidateDataComments() { this.lotGeneratorInputDto.setGid(GID); this.lotGeneratorInputDto.setLocationId(LOCATION_ID); this.lotGeneratorInputDto.setGenerateStock(false); this.lotGeneratorInputDto.setScaleId(SCALE_ID); this.lotGeneratorInputDto.setStockId(STOCK_ID); this.lotGeneratorInputDto.setComments( <START> "CommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsCommentsComments"); <END> this.lotInputValidator.validate(this.lotGeneratorInputDto); }</code><technical_language>@vmaletta RandomStringUtils.randomAlphanumeric</technical_language>

Target:
public void testValidateDataComments() { this.lotGeneratorInputDto.setGid(GID); this.lotGeneratorInputDto.setLocationId(LOCATION_ID); this.lotGeneratorInputDto.setGenerateStock(false); this.lotGeneratorInputDto.setScaleId(SCALE_ID); this.lotGeneratorInputDto.setStockId(STOCK_ID); this.lotGeneratorInputDto.setComments(RandomStringUtils.randomAlphabetic(256)); this.lotInputValidator.validate(this.lotGeneratorInputDto); }
Source:
<code>protected boolean validateVdsGroup() { if (getVdsGroup() == null) { VDSGroup cluster = getVdsGroupDAO().getByName("Default"); if (cluster != null) { setVdsGroup(cluster); return true; } else { List<VDSGroup> clusters = getVdsGroupDAO().getAll(); if (clusters.size() > 0) { setVdsGroup(clusters.get(0)); <START> return true; <END> } log.error("AddVdsCommand: No default or valid cluster was found, host registration failed."); return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } } return true; }</code><technical_language>this logic in RegisterVds I depend if default cluster is valid mentioned in vdc_option table</technical_language>

Target:
protected boolean validateVdsGroup() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } return true; }
Source:
<code>public IntegerList(int capacity) { if (capacity < 0) { throw new IllegalArgumentException(); } if (capacity > MAX_ARRAY_SIZE) <START> throw new IllegalArgumentException(); <END> if (capacity == 0) { _data = EMPTY_DATA; } else { _data = new int[capacity]; } }</code><technical_language>bulb: Considering ArrayList omits this check, I safe for well</technical_language>

Target:
public IntegerList(int capacity) { if (capacity < 0) { throw new IllegalArgumentException(); } if (capacity == 0) { _data = EMPTY_DATA; } else { _data = new int[capacity]; } }
Source:
<code>public static void start(Stage stage) { <START> State.resetAll(); <END> primaryStage = stage; root = new Group(); root.setDepthTest(DepthTest.ENABLE); root.setAutoSizeChildren(true); scene = new Scene(root, WIDTH, HEIGHT, true); scene.setFill(Color.AQUA); primaryStage.setScene(scene); world = new Group(); overlay = new Group(); worldScene = new SubScene(world, WIDTH, HEIGHT, true, SceneAntialiasing.BALANCED); overlayScene = new SubScene(overlay, WIDTH, HEIGHT); overlayScene.setFill(Color.TRANSPARENT); root.getChildren().add(worldScene); root.getChildren().add(overlayScene); setupCamera(); keyBindings(primaryStage); primaryStage.setResizable(false); primaryStage.show(); startTickers(); }</code><technical_language>Hey @thervh70 , I left this line this starting point of Application. I this line moved SplashScreen, deathMenu restart button call reset() (saving player's total amount of coins, resetAll() resets coins)</technical_language>

Target:
public static void start(Stage stage) { State.reset(); primaryStage = stage; root = new Group(); root.setDepthTest(DepthTest.ENABLE); root.setAutoSizeChildren(true); scene = new Scene(root, WIDTH, HEIGHT, true); scene.setFill(Color.AQUA); primaryStage.setScene(scene); world = new Group(); overlay = new Group(); worldScene = new SubScene(world, WIDTH, HEIGHT, true, SceneAntialiasing.BALANCED); overlayScene = new SubScene(overlay, WIDTH, HEIGHT); overlayScene.setFill(Color.TRANSPARENT); root.getChildren().add(worldScene); root.getChildren().add(overlayScene); setupCamera(); keyBindings(primaryStage); primaryStage.setResizable(false); primaryStage.show(); startTickers(); }