auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<String> reImportMavenProjects(ReImportMavenProjectsCommandParameters parameters) { final List<String> projectsToReImport = parameters.getProjectsToUpdate(); if (projectsToReImport.isEmpty()) { return emptyList(); } ListIterator<String> iterator = projectsToReImport.listIterator(); while (iterator.hasNext()) { iterator.set(prefixURI(iterator.next())); } CompletableFuture<Object> requestResult = executeCommand(REIMPORT_MAVEN_PROJECTS_COMMAND, singletonList(parameters)); final List<String> result; Type targetClassType = new TypeToken<ArrayList<String>>() {}.getType(); try { result = gson.fromJson( gson.toJson( <START> requestResult.get(REIMPORT_MAVEN_PROJECTS_REQUEST_TIMEOUT, TimeUnit.SECONDS)), <END> targetClassType); } catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) { throw new JsonRpcException(-27000, e.getMessage()); } iterator = result.listIterator(); while (iterator.hasNext()) { iterator.set(removePrefixUri(iterator.next())); } return result; }</code><technical_language>Again, this wait roughly 16 hours</technical_language>

Target:
public List<String> reImportMavenProjects(ReImportMavenProjectsCommandParameters parameters) { final List<String> projectsToReImport = parameters.getProjectsToUpdate(); if (projectsToReImport.isEmpty()) { return emptyList(); } ListIterator<String> iterator = projectsToReImport.listIterator(); while (iterator.hasNext()) { iterator.set(prefixURI(iterator.next())); } CompletableFuture<Object> requestResult = executeCommand(REIMPORT_MAVEN_PROJECTS_COMMAND, singletonList(parameters)); final List<String> result; Type targetClassType = new TypeToken<ArrayList<String>>() {}.getType(); try { result = gson.fromJson( gson.toJson( requestResult.get( REIMPORT_MAVEN_PROJECTS_REQUEST_TIMEOUT, TimeUnit.MILLISECONDS)), targetClassType); } catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) { throw new JsonRpcException(-27000, e.getMessage()); } iterator = result.listIterator(); while (iterator.hasNext()) { iterator.set(removePrefixUri(iterator.next())); } return result; }
Source:
<code>public AutomationPanel(AutomationPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, FormCache formCache) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.formCache = formCache; this.appPreferences = appPreferences; <START> this.pullSource = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadPullSource); <END> this.pullSource.ifPresent(source -> { forms.load(source.getFormList()); view.refresh(); }); view.onPullSource(pullSource -> { this.pullSource = Optional.of(pullSource); Source.clearAllPreferences(tabPreferences); pullSource.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(pullSource.getFormList()); view.refresh(); }); view.onPushSource(pushSource -> { Source.clearAllPreferences(tabPreferences); pushSource.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(pushSource.getFormList()); view.refresh(); }); this.pushSource = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadPushSource); this.pushSource.ifPresent(source -> { forms.load(source.getFormList()); view.refresh(); }); view.onGenerate(config -> generateScript(isWindows() ? "automation.bat" : "automation.sh", config)); }</code><technical_language>This tab need read pull source saved preferences yet. This block removed</technical_language>

Target:
public AutomationPanel(AutomationPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, FormCache formCache) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.formCache = formCache; this.appPreferences = appPreferences; view.onPullSource(pullSource -> this.pullSource = Optional.of(pullSource)); view.onPushSource(pushSource -> this.pushSource = Optional.of(pushSource)); view.onGenerate(config -> generateScript(isWindows() ? "automation.bat" : "automation.sh", config)); }
Source:
<code>public void visitNode(Tree tree) { if(!hasSemantic()) { return; } TypeCastTree typeCastTree = (TypeCastTree) tree; Type cast = typeCastTree.type().symbolType(); Type target = targetType(typeCastTree); <START> if(target != null && (isRedundantNumericalCast(cast, typeCastTree.expression().symbolType()) || isSubtype(typeCastTree.expression().symbolType(), target))) { <END> reportIssue(typeCastTree.type(), "Remove this unnecessary cast to \"" + cast + "\"."); } }</code><technical_language>typeCastTree.expression().symbolType() set a variable in order avoid calling twice</technical_language>

Target:
public void visitNode(Tree tree) { if(!hasSemantic()) { return; } TypeCastTree typeCastTree = (TypeCastTree) tree; Type cast = typeCastTree.type().symbolType(); Type target = targetType(typeCastTree); Type expressionType = typeCastTree.expression().symbolType(); if(target != null && (isRedundantNumericalCast(cast, expressionType) || isSubtype(expressionType, target))) { reportIssue(typeCastTree.type(), "Remove this unnecessary cast to \"" + cast + "\"."); } }
Source:
<code><START> char[] getExplorerTheme() { return getData(Display.ENABLE_DARK_SCROLLBARS) != null ? DARKMODE_EXPLORER : EXPLORER; } <END></code><technical_language>code change a good fit ? ------------------------------------------------------- static char[] getExplorerTheme() { return Display.getCurrent().getData(Display.ENABLE_DARK_SCROLLBARS) != null ? DARKMODE_EXPLORER : EXPLORER; }</technical_language>

Target:
char[] getExplorerTheme() { Boolean data = (Boolean) getData(Display.ENABLE_DARK_SCROLLBARS); return data != null && data.booleanValue () ? DARKMODE_EXPLORER : EXPLORER; }
Source:
<code><START> public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { <END> lock.readLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; } synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } } finally { lock.readLock().unlock(); } }</code><technical_language>call: removeQuotaFromCache(storagePoolId, Arrays.toList(quotaId)); .. btw read lock in other method write lock</technical_language>

Target:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { removeQuotaFromCache(storagePoolId, Arrays.asList(quotaId)); }
Source:
<code>public static ArrayList<String> splitString(String data, String delimiter) { if (data == null) { throw new IllegalArgumentException("Passed in string is null "); } <START> return data.isEmpty() ? new ArrayList<>() : new ArrayList<>(Arrays.asList(data.split(delimiter))); <END> }</code><technical_language>Thanks for making this change. I need check if data.startsWith(delimiter), is, leading delimiter removed. This affect prefixesToRemove this method applied in places avoid case ,ambry,media. (Trailing delimiter affect anything)</technical_language>

Target:
public static ArrayList<String> splitString(String data, String delimiter) { if (data == null) { throw new IllegalArgumentException("Passed in string is null "); } return Arrays.stream(data.split(delimiter)) .filter(s -> !s.isEmpty()) .collect(Collectors.toCollection(ArrayList::new)); }
Source:
<code>protected <T> ObjectAssert<T> assertThat(T actual) { return new ObjectAssert<T>(actual) { @Override public ObjectAssert<T> isEqualTo(Object expected) { if (actual instanceof Tuple2) { final Tuple2<?, ?> t1 = (Tuple2<?, ?>) actual; final Tuple2<?, ?> t2 = (Tuple2<?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); return this; } else if (actual instanceof Tuple3) { final Tuple3<?, ?, ?> t1 = (Tuple3<?, ?, ?>) actual; final Tuple3<?, ?, ?> t2 = (Tuple3<?, ?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); <START> assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); <END> return this; } else { return super.isEqualTo(expected); } } }; }</code><technical_language>deliberately ignoring 3rd parameter</technical_language>

Target:
protected <T> ObjectAssert<T> assertThat(T actual) { return new ObjectAssert<T>(actual) { @Override public ObjectAssert<T> isEqualTo(Object expected) { if (actual instanceof Tuple2) { final Tuple2<?, ?> t1 = (Tuple2<?, ?>) actual; final Tuple2<?, ?> t2 = (Tuple2<?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); return this; } else if (actual instanceof Tuple3) { final Tuple3<?, ?, ?> t1 = (Tuple3<?, ?, ?>) actual; final Tuple3<?, ?, ?> t2 = (Tuple3<?, ?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); assertThat((Iterable<?>) t1._3).isEqualTo(t2._3); return this; } else { return super.isEqualTo(expected); } } }; }
Source:
<code>public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { <START> WarehouseInstance.Tuple tuple = primary.run("use " + primaryDbName) <END> .run("create external table t1 (id int)") .run("insert into table t1 values (1)") .run("insert into table t1 values (2)") .dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); WarehouseInstance.Tuple incTuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, incTuple.dumpLocation) .status(replicatedDbName) .verifyResult(incTuple.lastReplicationId); primary.run("create database " + extraPrimaryDb + " WITH DBPROPERTIES ( '" + SOURCE_OF_REPLICATION + "' = '1,2,3')"); WarehouseInstance.Tuple inc2Tuple = primary.run("use " + extraPrimaryDb) .run("create table tbl (fld int)") .run("use " + primaryDbName) .dump(primaryDbName, incTuple.lastReplicationId); replica.load(replicatedDbName, inc2Tuple.dumpLocation) .status(replicatedDbName) .verifyResult(inc2Tuple.lastReplicationId); }</code><technical_language>reproduce this scenario acid enabled. If ACID enabled, open/commit txn event part of incremental dump. So, impossible get empty incremental dump. Please try this scenario ACID disabled</technical_language>

Target:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { List<String> loadWithClause = externalTableBasePathWithClause(); List<String> dumpWithClause = Collections.singletonList( "'" + HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES.varname + "'='true'" ); WarehouseInstance.Tuple tuple = primary.run("use " + primaryDbName) .run("create external table t1 (id int)") .run("insert into table t1 values (1)") .run("insert into table t1 values (2)") .dump(primaryDbName, null, dumpWithClause); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); WarehouseInstance.Tuple incTuple = primary.dump(primaryDbName, tuple.lastReplicationId, dumpWithClause); replica.load(replicatedDbName, incTuple.dumpLocation, loadWithClause) .status(replicatedDbName) .verifyResult(incTuple.lastReplicationId); primary.run("create database " + extraPrimaryDb + " WITH DBPROPERTIES ( '" + SOURCE_OF_REPLICATION + "' = '1,2,3')"); WarehouseInstance.Tuple inc2Tuple = primary.run("use " + extraPrimaryDb) .run("create table tbl (fld int)") .run("use " + primaryDbName) .dump(primaryDbName, incTuple.lastReplicationId, dumpWithClause); Assert.assertEquals(primary.getCurrentNotificationEventId().getEventId(), Long.valueOf(inc2Tuple.lastReplicationId).longValue()); replica.load(replicatedDbName, inc2Tuple.dumpLocation, loadWithClause) .status(replicatedDbName) .verifyResult(inc2Tuple.lastReplicationId); }
Source:
<code>public void onPageLoadComplete() { showToCButton(); refreshView.setEnabled(true); editHandler.setPage(model.getPage()); initPageScrollFunnel(); checkAndShowSelectTextOnboarding(); updateNavDrawerSelection(); if <START> (getActivity() <END> != null && getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadComplete(); } }</code><technical_language>this getPageLoadCallbacks() != null</technical_language>

Target:
public void onPageLoadComplete() { showToCButton(); refreshView.setEnabled(true); editHandler.setPage(model.getPage()); initPageScrollFunnel(); checkAndShowSelectTextOnboarding(); updateNavDrawerSelection(); if (getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadComplete(); } }
Source:
<code><START> private static long convertNanosToMillis(long nanos) { <END> long millis = NANOSECONDS.toMillis(nanos); if (millis == 0 && nanos > 0) { millis = 1; } return millis; }</code><technical_language>TimeUtil#timeInMsOrOneIfResultIsZero</technical_language>

Target:
private static long convertNanosToMillis(long nanos) { return timeInMsOrOneIfResultIsZero(nanos, NANOSECONDS); }
Source:
<code>private void buildStreamsJoinThatShouldThrow(final StreamJoined<String, Integer, Integer> streamJoined, final JoinWindows joinWindows, final String expectedExceptionMessagePrefix) { final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, Integer> left = builder.stream("left", Consumed.with(Serdes.String(), Serdes.Integer())); final KStream<String, Integer> right = builder.stream("right", Consumed.with(Serdes.String(), Serdes.Integer())); try { left.join( right, (value1, value2) -> value1 + value2, joinWindows, streamJoined); fail("Should throw SteamsException"); <START> } catch (final StreamsException se) { <END> assertTrue(se.getMessage().startsWith(expectedExceptionMessagePrefix)); } }</code><technical_language>final StreamsException e = assertThrows(...) instead if try-fail-catch</technical_language>

Target:
private void buildStreamsJoinThatShouldThrow(final StreamJoined<String, Integer, Integer> streamJoined, final JoinWindows joinWindows, final String expectedExceptionMessagePrefix) { final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, Integer> left = builder.stream("left", Consumed.with(Serdes.String(), Serdes.Integer())); final KStream<String, Integer> right = builder.stream("right", Consumed.with(Serdes.String(), Serdes.Integer())); final StreamsException streamsException = assertThrows(StreamsException.class, () -> left.join( right, (value1, value2) -> value1 + value2, joinWindows, streamJoined)); assertTrue(streamsException.getMessage().startsWith(expectedExceptionMessagePrefix)); }
Source:
<code>private void connect() throws Exception { SSLContext sc = SSLContext.getInstance("TLS"); sc.init(new KeyManager[]{}, new TrustManager[]{new ProxyClient.MyTrustManager()}, new SecureRandom()); SSLSocketFactory sf = sc.getSocketFactory(); this.socket = (SSLSocket) sf.createSocket( Server.getInstance().getMyProxyHost(), Server.getInstance().getMyProxyPort()); <START> this.socket.setEnabledProtocols(new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"}); <END> this.socket.startHandshake(); this.socketIn = new BufferedInputStream(this.socket.getInputStream()); this.socketOut = new BufferedOutputStream(this.socket.getOutputStream()); }</code><technical_language>v1.2</technical_language>

Target:
private void connect() throws Exception { SSLContext sc = SSLContext.getInstance("TLS"); sc.init(new KeyManager[]{}, new TrustManager[]{new ProxyClient.MyTrustManager()}, new SecureRandom()); SSLSocketFactory sf = sc.getSocketFactory(); this.socket = (SSLSocket) sf.createSocket( Server.getInstance().getMyProxyHost(), Server.getInstance().getMyProxyPort()); this.socket.setEnabledProtocols(new String[]{"TLSv1.2"}); this.socket.startHandshake(); this.socketIn = new BufferedInputStream(this.socket.getInputStream()); this.socketOut = new BufferedOutputStream(this.socket.getOutputStream()); }
Source:
<code>public void test() { AjaxLazyLoadPanel<Component> panel = new AjaxLazyLoadPanel<Component>("panel") { private static final long serialVersionUID = 1L; @Override <START> protected Component getLazyLoadComponent(String markupId) <END> { return new Label(markupId, "lazy panel test").setRenderBodyOnly(true); } }; tester.startComponentInPage(panel); tester.assertLabel( "panel:content", "<img alt=\"Loading...\" src=\"./resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif\"/>"); AjaxLazyLoadPanelTester.executeAjaxLazyLoadPanel(tester); tester.debugComponentTrees(); tester.assertLabel("panel:content", "lazy panel test"); String doc = tester.getLastResponseAsString(); assertNotNull(doc); }</code><technical_language>I guess markupId remain final ..</technical_language>

Target:
public void test() { AjaxLazyLoadPanel<Component> panel = new AjaxLazyLoadPanel<Component>("panel") { private static final long serialVersionUID = 1L; @Override public Component getLazyLoadComponent(final String markupId) { return new Label(markupId, "lazy panel test").setRenderBodyOnly(true); } }; tester.startComponentInPage(panel); tester.assertLabel( "panel:content", "<img alt=\"Loading...\" src=\"./resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif\"/>"); AjaxLazyLoadPanelTester.executeAjaxLazyLoadPanel(tester); tester.debugComponentTrees(); tester.assertLabel("panel:content", "lazy panel test"); String doc = tester.getLastResponseAsString(); assertNotNull(doc); }
Source:
<code>public static IBiomeBlockReplacerProvider provider() { return new IBiomeBlockReplacerProvider() { private final ResourceLocation OCEAN_LEVEL = CubicChunks.location("water_level"); @Override public IBiomeBlockReplacer create(ICubicWorld world, CubicBiome biome, BiomeBlockReplacerConfig conf) { return new SwampWaterWithLilypadReplacer(Biome.GRASS_COLOR_NOISE, MathHelper.floor(conf.getDouble(OCEAN_LEVEL))); } @Override public Set<ConfigOptionInfo> getPossibleConfigOptions() { <START> return new HashSet<>(); <END> } }; }</code><technical_language>Collections.emptySet() (or ImmutableSet.of())</technical_language>

Target:
public static IBiomeBlockReplacerProvider provider() { return IBiomeBlockReplacerProvider.of((world, biome, conf) -> new SwampWaterWithLilypadReplacer(Biome.GRASS_COLOR_NOISE, MathHelper.floor(conf.getDouble(OCEAN_LEVEL))) ); }
Source:
<code>private String removeTag(String target, String tagStart, String tagEnd) { String taglessResult = ""; int tagStartPosition = -1; int tagEndPosition = -1; <START> for (int i = 0; i < target.length(); i++) <END> { char c = target.charAt(i); if (-1 == tagStartPosition && c == tagStart.charAt(0)) { if (target.substring(i, i + tagStart.length()).equals(tagStart)) { tagStartPosition = i; i = i + tagStart.length() - 1; } } if (-1 != tagStartPosition && c == tagEnd.charAt(0)) { if (target.substring(i, i + tagEnd.length()).equals(tagEnd)) tagEndPosition = i + tagEnd.length() - 1; } } if (-1 == tagStartPosition) return target; taglessResult = target.substring(0, tagStartPosition); taglessResult += target.substring(tagEndPosition + 1, target.length()); return taglessResult; }</code><technical_language>This section complicated. String.indexOf(String)</technical_language>

Target:
private String removeTag(String target, String tagStart, String tagEnd) { int tagStartPosition = tagStartPosition = target.indexOf(tagStart); int tagEndPosition = tagEndPosition = target.indexOf(tagEnd, tagStartPosition + tagStart.length()); if (-1 == tagStartPosition || -1 == tagEndPosition) return target; String taglessResult = target.substring(0, tagStartPosition); taglessResult += target.substring(tagEndPosition + 1, target.length()); return taglessResult; }
Source:
<code>@Test public void testCreateRootSchemaWithNoMetadataSchema() { SchemaPlus rootSchema = Frameworks.createRootSchema(false); <START> assertTrue(rootSchema.getSubSchemaNames().size() == 0); <END> }</code><technical_language>please modern junit: java assertThat(rootSchema.getSubSchemaNames().size(), equalTo(0));</technical_language>

Target:
@Test public void testCreateRootSchemaWithNoMetadataSchema() { SchemaPlus rootSchema = Frameworks.createRootSchema(false); assertThat(rootSchema.getSubSchemaNames().size(), equalTo(0)); }
Source:
<code><START> public boolean updateConfiguration(OMElement configuration) <END> throws XMLStreamException, ServletException, RemoteException { return configServiceAdminStub.updateConfiguration(configuration); }</code><technical_language>custom exception here</technical_language>

Target:
public boolean updateConfiguration(OMElement configuration) throws RemoteException { return configServiceAdminStub.updateConfiguration(configuration); }
Source:
<code>public void testCompareToWithDifferentModuleId() { final LocalizedMessage message1 = new LocalizedMessage(0, "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, "module1", LocalizedMessage.class, null); final LocalizedMessage message2 = new LocalizedMessage(0, "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, null, LocalizedMessage.class, null); <START> final LocalizedMessage message3 = new LocalizedMessage(0, <END> "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, "module2", LocalizedMessage.class, null); assertTrue("Invalid comparing result", message1.compareTo(message2) > 0); assertTrue("Invalid comparing result", message2.compareTo(message1) < 0); assertTrue("Invalid comparing result", message1.compareTo(message3) < 0); }</code><technical_language>hard follow is difference 3. Rename message3 message2 rename current message2 messageNull</technical_language>

Target:
public void testCompareToWithDifferentModuleId() { final LocalizedMessage message1 = createSampleLocalizedMessageWithId("module1"); final LocalizedMessage message2 = createSampleLocalizedMessageWithId("module2"); final LocalizedMessage messageNull = createSampleLocalizedMessageWithId(null); assertTrue("Invalid comparing result", message1.compareTo(messageNull) > 0); assertTrue("Invalid comparing result", messageNull.compareTo(message1) < 0); assertTrue("Invalid comparing result", message1.compareTo(message2) < 0); }
Source:
<code>public void testCall() { Handle handle = db.getSharedHandle(); handle.execute(findSqlOnClasspath("create_stored_proc_add")); OutParameters result = handle <START> .createCall("{:sum = add(:a, :b)}") END> .bind("a", 13) .bind("b", 9) .registerOutParameter("sum", Types.INTEGER) .invoke(); int sum = result.getInt("sum"); assertThat(sum).isEqualTo(22); }</code><technical_language>this working</technical_language>

Target:
public void testCall() { Handle handle = db.getSharedHandle(); handle.execute(findSqlOnClasspath("create_stored_proc_add")); OutParameters result = handle .createCall("{:sum = call add(:a, :b)}") .bind("a", 13) .bind("b", 9) .registerOutParameter("sum", Types.INTEGER) .invoke(); int sum = result.getInt("sum"); assertThat(sum).isEqualTo(22); }
Source:
<code>private void updateUI() { username.setText(AccountUtil.getUserName()); <START> contributionsText.setText(getResources().getQuantityString(R.plurals.edit_action_contribution_count, Prefs.getTotalUserDescriptionsEdited())); <END> requireActivity().invalidateOptionsMenu(); }</code><technical_language>Needs update contributionsText.setText() R.plurals.edit_action_contribution_count contains a %d</technical_language>

Target:
private void updateUI() { username.setText(AccountUtil.getUserName()); contributionsText.setText(getResources().getQuantityString(R.plurals.edit_action_contribution_count, Prefs.getTotalUserDescriptionsEdited(), Prefs.getTotalUserDescriptionsEdited())); requireActivity().invalidateOptionsMenu(); }
Source:
<code>public Guid getVmtGuid() { <START> return vmtGuid; <END> }</code><technical_language>a nice change, unrelated this patch in a separate one</technical_language>

Target:
public Guid getVmtGuid() { return this.vmtGuid; }
Source:
<code>protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.info("Setting the Realm Service"); <START> } <END> IWAServiceDataHolder.setRealmService(realmService); }</code><technical_language>check isDebugEnabled for log.info</technical_language>

Target:
protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting the Realm Service"); } IWAServiceDataHolder.setRealmService(realmService); }
Source:
<code>private VersionedIdentifier extractLibraryIdentifier(cqlParser parser) { RuleContext context = parser.getContext(); while (!(context instanceof cqlParser.LibraryContext)) { context = context.parent; if (context == null) { break; } <START> } <END> if (context instanceof cqlParser.LibraryContext) { for (ParseTree pt : ((cqlParser.LibraryContext)context).children) { if (pt instanceof cqlParser.LibraryDefinitionContext) { cqlParser.LibraryDefinitionContext ldc = (cqlParser.LibraryDefinitionContext)pt; if (ldc.qualifiedIdentifier() != null && ldc.qualifiedIdentifier().identifier() != null) { return new VersionedIdentifier().withId(StringEscapeUtils.unescapeCql(ldc.qualifiedIdentifier().identifier().getText())); } } } } return null; }</code><technical_language>This suggestion is trivial I hesitate it, feel free ignore if wish, but... I personally prefer putting nullchecks condition a dedicated break. E.g., java while (context != null && !(context instanceof cqlParser.LibraryContext)) { context = context.parent; }</technical_language>

Target:
private VersionedIdentifier extractLibraryIdentifier(cqlParser parser) { RuleContext context = parser.getContext(); while (context != null && !(context instanceof cqlParser.LibraryContext)) { context = context.parent; } if (context instanceof cqlParser.LibraryContext) { cqlParser.LibraryDefinitionContext ldc = ((cqlParser.LibraryContext)context).libraryDefinition(); if (ldc != null && ldc.qualifiedIdentifier() != null && ldc.qualifiedIdentifier().identifier() != null) { return new VersionedIdentifier().withId(StringEscapeUtils.unescapeCql(ldc.qualifiedIdentifier().identifier().getText())); } } return null; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } <START> if (obj.getClass() != this.getClass()) { <END> return false; } EngineBackupLog other = (EngineBackupLog) obj; return (Objects.equals(dbName, other.dbName) && Objects.equals(doneAt, other.doneAt) && this.passed == other.passed && Objects.equals(outputMessage, other.outputMessage)); }</code><technical_language>here. findbugs expect if (!(obj instanceof EngineBackupLog)) { return false; }</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EngineBackupLog)) { return false; } EngineBackupLog other = (EngineBackupLog) obj; return (Objects.equals(dbName, other.dbName) && Objects.equals(doneAt, other.doneAt) && this.passed == other.passed && Objects.equals(outputMessage, other.outputMessage)); }
Source:
<code>protected void addFilesToWorkflowAttachment(List<File> workflowAttachment, File zippedEntry, File tempDir) { try { SwaggerUtility.unzipFile(zippedEntry, tempDir); } catch (IOException e) { System.out.println("Could not get files from workflow attachment " + zippedEntry.getName() + " Request not sent."); exceptionMessage(e, "Unable to get workflow attachment files from zip file " + zippedEntry.getName(), IO_ERROR); } try { String[] fileFilter = null; if (abstractEntryClient.isLocalEntry()) { fileFilter = new String[]{"yml", "yaml", "json", this.languageType.toString().toLowerCase()}; } Iterator it = FileUtils.iterateFiles(tempDir, fileFilter, true); while (it.hasNext()) { File afile = (File) it.next(); workflowAttachment.add(afile); } } catch (Exception e) { <START> e.printStackTrace(); <END> LOG.error("Unable to traverse directory " + tempDir.getName() + " to get workflow attachment files", e); exceptionMessage(e, "Unable to traverse directory " + tempDir.getName() + " to get workflow " + "attachment files", GENERIC_ERROR); } }</code><technical_language>if matches Dockstore's style</technical_language>

Target:
protected void addFilesToWorkflowAttachment(List<File> workflowAttachment, File zippedEntry, File tempDir) { try { SwaggerUtility.unzipFile(zippedEntry, tempDir); } catch (IOException e) { System.out.println("Could not get files from workflow attachment " + zippedEntry.getName() + " Request not sent."); exceptionMessage(e, "Unable to get workflow attachment files from zip file " + zippedEntry.getName(), IO_ERROR); } try { String[] fileFilter = null; if (abstractEntryClient.isLocalEntry()) { fileFilter = new String[]{"yml", "yaml", "json", this.languageType.toString().toLowerCase()}; } Iterator it = FileUtils.iterateFiles(tempDir, fileFilter, true); while (it.hasNext()) { File afile = (File) it.next(); workflowAttachment.add(afile); } } catch (Exception e) { LOG.error("Unable to traverse directory " + tempDir.getName() + " to get workflow attachment files", e); exceptionMessage(e, "Unable to traverse directory " + tempDir.getName() + " to get workflow " + "attachment files", GENERIC_ERROR); } }
Source:
<code>private Optional<TableToSweep> getTableToSweep() { return specificTableSweeper.getTxManager().runTaskWithRetry( tx -> { Optional<SweepProgress> progress = currentTable.flatMap( tableToSweep -> specificTableSweeper.getSweepProgressStore().loadProgress( tableToSweep.getTableRef())); SweepPriorityOverrideConfig overrideConfig = sweepPriorityOverrideConfig.get(); if (progress.map( realProgress -> shouldContinueSweepingCurrentTable(realProgress, overrideConfig)) .orElse(false)) { try { createLockForTableIfNecessary(progress.get()); if (currentTable.isPresent()) { <START> currentTable.get().refreshLock(); <END> } return currentTable; } catch (InterruptedException ex) { log.info("Sweep lost the lock for table {}", LoggingArgs.tableRef(progress.get().tableRef())); currentTable = Optional.empty(); } } log.info("Sweep is choosing a new table to sweep."); return getNextTableToSweep(tx, overrideConfig); }); }</code><technical_language>Expected behavior here? If fail refresh, lock set null</technical_language>

Target:
private Optional<TableToSweep> getTableToSweep() { return specificTableSweeper.getTxManager().runTaskWithRetry( tx -> { Optional<SweepProgress> progress = currentTable.flatMap( tableToSweep -> specificTableSweeper.getSweepProgressStore().loadProgress( tableToSweep.getTableRef())); SweepPriorityOverrideConfig overrideConfig = sweepPriorityOverrideConfig.get(); if (progress.map( realProgress -> shouldContinueSweepingCurrentTable(realProgress, overrideConfig)) .orElse(false)) { try { updateProgressAndRefreshLock(progress.get()); return currentTable; } catch (InterruptedException ex) { log.info("Sweep lost the lock for table {}", LoggingArgs.tableRef(progress.get().tableRef())); closeTableLockIfHeld(); currentTable = Optional.empty(); } } log.info("Sweep is choosing a new table to sweep."); closeTableLockIfHeld(); return getNextTableToSweep(tx, overrideConfig); }); }
Source:
<code>public void removed(final String name) throws Exception { <START> final String path = ZKPaths.makePath(ZKNODE_PATH, name); <END> zkClient.delete().forPath(path); }</code><technical_language>getZNodePath method here</technical_language>

Target:
public void removed(final String name) throws Exception { final String path = getZNodePath(name); created(name); zkClient.delete().forPath(path); }
Source:
<code>public ProjectInformation get(String projectUrl, String installationName) { SonarInstallation inst = SonarInstallation.get(installationName); if (inst == null) { Logger.LOG.info("Invalid installation name: " + installationName); return null; } try { String projectKey = extractProjectKey(projectUrl); String serverUrl = extractServerUrl(projectUrl); WsClient wsClient = new WsClient(client, serverUrl, projectKey, inst.getSonarLogin(), inst.getSonarPassword()); float version = SonarUtils.extractMajorMinor(wsClient.getServerVersion(serverUrl)); if (!checkServerUrl(serverUrl, inst)) { return null; } ProjectQualityGate qg; <START> if (version < 5.2) { <END> qg = wsClient.getQualityGateBefore52(); } else { qg = wsClient.getQualityGate52(); } ProjectInformation projectInfo = new ProjectInformation(projectKey); projectInfo.setName(qg.getProjectName()); projectInfo.setStatus(qg.getStatus()); projectInfo.setUrl(projectUrl); return projectInfo; } catch (Exception e) { Logger.LOG.log(Level.WARNING, "Error fetching project information", e); return null; } }</code><technical_language>hope release a 5.10 ;)</technical_language>

Target:
public ProjectInformation get(String projectUrl, String installationName) { SonarInstallation inst = SonarInstallation.get(installationName); if (inst == null) { Logger.LOG.info("Invalid installation name: " + installationName); return null; } try { String projectKey = extractProjectKey(projectUrl); String serverUrl = extractServerUrl(projectUrl); WsClient wsClient = new WsClient(client, serverUrl, projectKey, inst.getSonarLogin(), inst.getSonarPassword()); Float version = SonarUtils.extractMajorMinor(wsClient.getServerVersion(serverUrl)); if (version == null || !checkServerUrl(serverUrl, inst)) { return null; } ProjectQualityGate qg; if (version < 5.2f) { qg = wsClient.getQualityGateBefore52(); } else { qg = wsClient.getQualityGate52(); } ProjectInformation projectInfo = new ProjectInformation(projectKey); projectInfo.setName(qg.getProjectName()); projectInfo.setStatus(qg.getStatus()); projectInfo.setUrl(projectUrl); return projectInfo; } catch (Exception e) { Logger.LOG.log(Level.WARNING, "Error fetching project information", e); return null; } }
Source:
<code>public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); <START> if (Strings.isNullOrEmpty(row.getString("description"))) { <END> return Optional.absent(); } return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), "REMOVE THIS", row.getString("description"), row.getDate("creation_time").getTime())); } }); }</code><technical_language>row missing if LabelMeta is considered missing this if clause removed</technical_language>

Target:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> metaRow) { if (!metaRow.isPresent()) { return Optional.absent(); } final Row row = metaRow.get(); return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), "REMOVE THIS", row.getString("description"), row.getDate("creation_time").getTime())); } }); }
Source:
<code>public static SSLContext sslContext() throws GeneralSecurityException, IOException { SSLContext ctx = SSLContext.getInstance("TLS"); char[] storePass = GridTestProperties.getProperty("ssl.keystore.password").toCharArray(); KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance("SunX509"); KeyStore keyStore = KeyStore.getInstance("JKS"); <START> try(InputStream in = new FileInputStream(U.resolveIgnitePath(GridTestProperties <END> .getProperty("ssl.keystore.path")))) { keyStore.load(in, storePass); } keyMgrFactory.init(keyStore, storePass); ctx.init(keyMgrFactory.getKeyManagers(), new TrustManager[]{GridSslBasicContextFactory.getDisabledTrustManager()}, null); return ctx; }</code><technical_language>Need space try keyword</technical_language>

Target:
public static SSLContext sslContext() throws GeneralSecurityException, IOException { SSLContext ctx = SSLContext.getInstance("TLS"); char[] storePass = keyStorePassword().toCharArray(); KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance("SunX509"); KeyStore keyStore = KeyStore.getInstance("JKS"); try (InputStream in = new FileInputStream(U.resolveIgnitePath(GridTestProperties .getProperty("ssl.keystore.path")))) { keyStore.load(in, storePass); } keyMgrFactory.init(keyStore, storePass); ctx.init(keyMgrFactory.getKeyManagers(), new TrustManager[]{GridSslBasicContextFactory.getDisabledTrustManager()}, null); return ctx; }
Source:
<code>public void useWakeLockTest() throws IOException { WakeLock wakeLock = ShadowPowerManager.getLatestWakeLock(); <START> assertNull(wakeLock); <END> activity.useWakeLock(new Callback() { @Override public void onCall() { WakeLock lock = ShadowPowerManager.getLatestWakeLock(); assertTrue(lock.isHeld()); } }); wakeLock = ShadowPowerManager.getLatestWakeLock(); assertFalse(wakeLock.isHeld()); }</code><technical_language>FEST assertThat assertions instead</technical_language>

Target:
public void useWakeLockTest() throws IOException { WakeLock wakeLock = ShadowPowerManager.getLatestWakeLock(); assertThat(wakeLock).isNull(); activity.useWakeLock(new Callback() { @Override public void onCall() { WakeLock lock = ShadowPowerManager.getLatestWakeLock(); assertThat(lock.isHeld()).isTrue(); } }); wakeLock = ShadowPowerManager.getLatestWakeLock(); assertThat(wakeLock.isHeld()).isFalse(); }
Source:
<code>public boolean isGnosManifest() { <START> boolean result = false; <END> val isFile = resolveType(value).equals(Type.FILE); val isXml = value.toLowerCase().contains(".xml"); return isFile && isXml; }</code><technical_language>Unused</technical_language>

Target:
public boolean isGnosManifest() { val isFile = resolveType(value).equals(Type.FILE); val isXml = value.toLowerCase().contains(".xml"); return isFile && isXml; }
Source:
<code>public void invoke(Request request, Response response) throws IOException, ServletException { log.debug("Processing request with session:" + request.getRequestedSessionId()); getNext().invoke(request, response); Context context = request.getContext(); Manager manager = context.getManager(); Session session = request.getSessionInternal(false); if (session != null && !isUriExcluded(request.getRequestURI())) { log.debug("Persisting session with id: " + session.getId()); session.access(); session.endAccess(); if (manager instanceof StoreManager) { StoreManager storeManager = (StoreManager) manager; storeManager.getStore().save(session); storeManager.removeSuper(session); } else { log.error("In order to persist the session the manager must implement StoreManager"); } } else { <START> log.debug("Session not persisted"); <END> } }</code><technical_language>helpful include reason session is persisted. "Session persisted URI /foo/bar is excluded"</technical_language>

Target:
public void invoke(Request request, Response response) throws IOException, ServletException { log.debug("Processing request with session:" + request.getRequestedSessionId()); getNext().invoke(request, response); Context context = request.getContext(); Manager manager = context.getManager(); Session session = request.getSessionInternal(false); if (session != null && !isUriExcluded(request.getRequestURI())) { log.debug("Persisting session with id: " + session.getId()); session.access(); session.endAccess(); if (manager instanceof StoreManager) { StoreManager storeManager = (StoreManager) manager; storeManager.getStore().save(session); storeManager.removeSuper(session); } else { log.error("In order to persist the session the manager must implement StoreManager"); } } else { log.debug("Session not persisted (Non existent or the URI is ignored)"); } }
Source:
<code>public void onSetupComplete() { <START> log.info("onSetupComplete"); <END> }</code><technical_language>Is this want log in info debug level</technical_language>

Target:
public void onSetupComplete() { log.debug("onSetupComplete"); }
Source:
<code>boolean isBootstrapInProgress() { <START> File bootstrapFile = new File(dataDir, BOOTSTRAP_FILE_NAME); <END> return bootstrapFile.exists(); }</code><technical_language>combine lines</technical_language>

Target:
boolean isBootstrapInProgress() { return (new File(dataDir, BOOTSTRAP_FILE_NAME)).exists(); }
Source:
<code>static synchronized TaskDescriptor getTaskDescriptor() { if (_identifier != null) { return _identifier; } try { Iterator<TaskDescriptor> identifiers = _loader.iterator(); if (identifiers.hasNext()) { _identifier = identifiers.next(); if (identifiers.hasNext()) { <START> LOGGER.info("Found more than one provider for TaskDescriptor, picked first one"); <END> } } else { LOGGER.error("No provider found for TaskDescriptor, falling back to DefaultTaskDescriptor"); _identifier = getDefaultTaskDescriptor(); } } catch (ServiceConfigurationError e) { LOGGER.error("Unable to load provider for TaskDescriptor, falling back to DefaultTaskDescriptor", e.getMessage()); _identifier = getDefaultTaskDescriptor(); } return _identifier; }</code><technical_language>Log is e.g. class name full list e.g. class names debugging issues</technical_language>

Target:
static synchronized TaskDescriptor getTaskDescriptor() { if (_identifier != null) { return _identifier; } try { Iterator<TaskDescriptor> identifiers = _loader.iterator(); if (identifiers.hasNext()) { _identifier = identifiers.next(); LOGGER.info("Using TaskDescriptor: " + _identifier.getClass()); while (identifiers.hasNext()) { TaskDescriptor descriptor = identifiers.next(); LOGGER.debug("Discarding TaskDescriptor: as its not first one to be loaded: ", descriptor.getClass()); } } else { LOGGER.info("No provider found for TaskDescriptor, falling back to DefaultTaskDescriptor"); _identifier = getDefaultTaskDescriptor(); } } catch (ServiceConfigurationError e) { LOGGER.error("Unable to load provider for TaskDescriptor, falling back to DefaultTaskDescriptor", e.getMessage()); _identifier = getDefaultTaskDescriptor(); } return _identifier; }
Source:
<code>public ExternalMetadata(Map<String, Object> metadata) { <START> this.metadata = metadata; <END> }</code><technical_language>If this this.metadata = Map.copyOf(metadata), knowledge ExternalMetadata instance internal map map is [unmodifiable map](<LINK_0> feel warm fuzzy inside</technical_language>

Target:
public ExternalMetadata(Map<String, Object> metadata) { this.metadata = Map.copyOf(metadata); }
Source:
<code>public DiskWriteModel getDisk(int deviceId) { return fDisks.computeIfAbsent(deviceId, k -> new <START> DiskWriteModel(deviceId, checkNotNull(getStateSystemBuilder()))); <END> }</code><technical_language>k, in other files</technical_language>

Target:
public DiskWriteModel getDisk(int deviceId) { return fDisks.computeIfAbsent(deviceId, k -> new DiskWriteModel(k, checkNotNull(getStateSystemBuilder()))); }
Source:
<code>public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); <START> FileSystem fs = FileSystem.newInstance(path.toUri(), conf.getHadoopConfiguration()); <END> final OutputStream out = fs.create(path); final OutputStreamWriter streamWriter = new OutputStreamWriter( out, Charset.defaultCharset() ); final BufferedWriter writer = new BufferedWriter(streamWriter, WRITER_BUFFER_SIZE); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { String value = (String) record.value(); writer.write(value); writer.newLine(); } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { try { writer.close(); fs.close(); } catch (IOException e) { throw new ConnectException(e); } } }; } catch (IOException e) { throw new ConnectException(e); } }</code><technical_language>this final</technical_language>

Target:
public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); final FileSystem fs = FileSystem.newInstance(path.toUri(), conf.getHadoopConfiguration()); final OutputStream out = fs.create(path); final OutputStreamWriter streamWriter = new OutputStreamWriter( out, Charset.defaultCharset() ); final BufferedWriter writer = new BufferedWriter(streamWriter, WRITER_BUFFER_SIZE); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { String value = (String) record.value(); writer.write(value); writer.newLine(); } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { IOException error = null; try { writer.close(); } catch (IOException e) { error = e; throw new ConnectException(e); } finally { try { fs.close(); } catch (IOException e) { if (error == null) { throw new ConnectException(e); } } } } }; } catch (IOException e) { throw new ConnectException(e); } }
Source:
<code>public Signature resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes) throws OperatorNotFoundException { try { return operatorNamespace.resolveOperator(operatorType, argumentTypes); } catch (PrestoException e) { if (!(e instanceof OperatorNotFoundException)) { throw e; } } <START> throw new OperatorNotFoundException( <END> operatorType, argumentTypes.stream() .map(Type::getTypeSignature) .collect(toImmutableList())); }</code><technical_language>throw e is instance of OperatorNotFoundException? include info need</technical_language>

Target:
public Signature resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes) { return globalFunctionNamespace.resolveOperator(operatorType, argumentTypes); }
Source:
<code>public static void initEnvironment() { if(!integrationTestsStarted) { File testBranchFolder = TestResourceFile.getResourceFile("org/scenarioo/rest/testConfiguration"); System.setProperty("scenarioo.data", testBranchFolder.getAbsolutePath()); <START> ScenarioDocuBuildsManager.resetInstance(); <END> integrationTestsStarted = true; } }</code><technical_language>discussed offline before, I for this is a valid workaround in order prepare for release. I this a major technical debt, deal asap. I guess Spring Boot now, is time consider letting container do some of dependency injection for us. This way, deal this problem</technical_language>

Target:
public static void initEnvironment() { if(!integrationTestsStarted) { ScenarioDocuBuildsManager.resetInstance(); integrationTestsStarted = true; } }
Source:
<code>public static boolean isReservedCqlKeyword(String id) { <START> return id != null && RESERVED_KEYWORDS.contains(id); <END> }</code><technical_language>this work for mixed-case keywords, in Local_Quorum. I this is a silly edge case, handle way</technical_language>

Target:
public static boolean isReservedCqlKeyword(String id) { if (id == null) { return false; } int hash = caseInsensitiveHash(id); List<char[]> keywords = RESERVED_KEYWORDS.get(hash); if (keywords == null) { return false; } else { for (char[] keyword : keywords) { if (equalsIgnoreCaseAscii(id, keyword)) { return true; } } return false; } }
Source:
<code>protected void setUp() throws Exception { source = "void foo() {\r\n\r\n for(int i = 0; i < 10; i++){\r\n\r\n }\r\n\r\n"; <START> expectedSource = "void foo() {\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t}\r\n}"; END> super.setUp(); }</code><technical_language>expected source change more source</technical_language>

Target:
protected void setUp() throws Exception { source = "void foo() {\n" + "\n" + " for(int i = 0; i < 10; i++){\n" + "\n" + " }\n" + "\n"; expectedSource = "void foo() {\n" + " for (int i = 0; i < 10; i++) {\n" + " }\n" + "}"; super.setUp(); }
Source:
<code>public Optional<String> getReference() { if (isNullOrEmpty(transactionId) && isNullOrEmpty(payIdSub)) { return Optional.empty(); } <START> return Optional.of(transactionId + "/" + payIdSub); <END> }</code><technical_language>Careful - if for reason payIdSub transactionId is empty null assume a valid reference. For instance consider a situation able extract payIdSub build a reference is trasactionId + / for refunds for payment, - I lead some strange mismatches</technical_language>

Target:
public Optional<String> getReference() { if (isNullOrEmpty(transactionId) || isNullOrEmpty(payIdSub)) { return Optional.empty(); } return Optional.of(transactionId + "/" + payIdSub); }