auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected ProjectState(final AnonymousUser anonymousUser, final ProjectCache projectCache, @WildProjectName final Project.NameKey wildProject, final ProjectControl.AssistedFactory projectControlFactory, final PrologEnvironment.Factory envFactory, final GitRepositoryManager gitMgr, @Assisted final ProjectConfig config, final RulesCache rulesCache) { this.anonymousUser = anonymousUser; this.projectCache = projectCache; this.wildProject = wildProject; this.projectControlFactory = projectControlFactory; this.envFactory = envFactory; this.gitMgr = gitMgr; this.config = config; this.lastCheckTime = System.currentTimeMillis(); <START> this.ruleLoader = rulesCache.getClassLoader(config.getRulesId()); <END> HashSet<AccountGroup.UUID> groups = new HashSet<AccountGroup.UUID>(); AccessSection all = config.getAccessSection(AccessSection.ALL); if (all != null) { Permission owner = all.getPermission(Permission.OWNER); if (owner != null) { for (PermissionRule rule : owner.getRules()) { GroupReference ref = rule.getGroup(); if (ref.getUUID() != null) { groups.add(ref.getUUID()); } } } } localOwners = Collections.unmodifiableSet(groups); }</code><technical_language>tests pass. pas in null for rulesCache in RefControlTest. Try running tests next time. :-)</technical_language>

Target:
protected ProjectState(final AnonymousUser anonymousUser, final ProjectCache projectCache, @WildProjectName final Project.NameKey wildProject, final ProjectControl.AssistedFactory projectControlFactory, final PrologEnvironment.Factory envFactory, final GitRepositoryManager gitMgr, @Assisted final ProjectConfig config, final RulesCache rulesCache) { this.anonymousUser = anonymousUser; this.projectCache = projectCache; this.wildProject = wildProject; this.projectControlFactory = projectControlFactory; this.envFactory = envFactory; this.gitMgr = gitMgr; this.config = config; this.lastCheckTime = System.currentTimeMillis(); if (rulesCache != null) { ruleLoader = rulesCache.getClassLoader(config.getRulesId()); } else { ruleLoader = null; } HashSet<AccountGroup.UUID> groups = new HashSet<AccountGroup.UUID>(); AccessSection all = config.getAccessSection(AccessSection.ALL); if (all != null) { Permission owner = all.getPermission(Permission.OWNER); if (owner != null) { for (PermissionRule rule : owner.getRules()) { GroupReference ref = rule.getGroup(); if (ref.getUUID() != null) { groups.add(ref.getUUID()); } } } } localOwners = Collections.unmodifiableSet(groups); }
Source:
<code>public BasicAuthDBConfig( final PasswordProvider initialAdminPassword, final PasswordProvider initialInternalClientPassword, final String initialAdminUser, final String initialAdminRole, final String initialAdminGroupMapping, final boolean enableCacheNotifications, final long cacheNotificationTimeout, final int credentialIterations ) { this.initialAdminPassword = initialAdminPassword; this.initialInternalClientPassword = initialInternalClientPassword; this.initialAdminUser = initialAdminUser; this.initialAdminRole = initialAdminRole; this.initialAdminGroupMapping = initialAdminGroupMapping; this.enableCacheNotifications = enableCacheNotifications; this.cacheNotificationTimeout = cacheNotificationTimeout; <START> this.iterations = credentialIterations; <END> }</code><technical_language>nit: Suggest renaming iterations getter</technical_language>

Target:
public BasicAuthDBConfig( final PasswordProvider initialAdminPassword, final PasswordProvider initialInternalClientPassword, final String initialAdminUser, final String initialAdminRole, final String initialAdminGroupMapping, final boolean enableCacheNotifications, final long cacheNotificationTimeout, final int credentialIterations ) { this.initialAdminPassword = initialAdminPassword; this.initialInternalClientPassword = initialInternalClientPassword; this.initialAdminUser = initialAdminUser; this.initialAdminRole = initialAdminRole; this.initialAdminGroupMapping = initialAdminGroupMapping; this.enableCacheNotifications = enableCacheNotifications; this.cacheNotificationTimeout = cacheNotificationTimeout; this.credentialIterations = credentialIterations; }
Source:
<code>public FastCubeBlockAccess(ICubeCache cache, Cube cube, int radius) { int n = radius*2 + 1; this.world = cube.getCubicWorld(); this.cache = new Cube[n][n][n]; this.originX = cube.getX() - radius; this.originY = cube.getY() - radius; this.originZ = cube.getZ() - radius; for (int relativeCubeX = -radius; relativeCubeX <= radius; relativeCubeX++) { for (int relativeCubeZ = -radius; relativeCubeZ <= radius; relativeCubeZ++) { Column column = cache.provideChunk( originX + relativeCubeX + radius, originZ + relativeCubeZ + radius); for (int relativeCubeY = -radius; relativeCubeY <= radius; relativeCubeY++) { this.cache[relativeCubeX + radius][relativeCubeY + radius][relativeCubeZ + radius] = <START> column.getCube(originY + relativeCubeY + radius); <END> } } } }</code><technical_language>This load cubes</technical_language>

Target:
public FastCubeBlockAccess(ICubeCache cache, Cube cube, int radius) { int n = radius*2 + 1; this.world = cube.getWorld(); this.cache = new Cube[n][n][n]; this.originX = cube.getX() - radius; this.originY = cube.getY() - radius; this.originZ = cube.getZ() - radius; for (int relativeCubeX = -radius; relativeCubeX <= radius; relativeCubeX++) { for (int relativeCubeZ = -radius; relativeCubeZ <= radius; relativeCubeZ++) { for (int relativeCubeY = -radius; relativeCubeY <= radius; relativeCubeY++) { this.cache[relativeCubeX + radius][relativeCubeY + radius][relativeCubeZ + radius] = cache.getLoadedCube(originX + relativeCubeX + radius, originY + relativeCubeY + radius, originZ + relativeCubeZ + radius); } } } }
Source:
<code>public boolean checkEndpoint(String hostname, String service) { if (service.equals("SRMv2")) { service = "SRM"; <START> } <END> for (EndpointItem item : list) { if (item.hostname.equals(hostname) && item.service.equals(service)) { return true; } } return false; }</code><technical_language>I thought need this mapping in compute engine</technical_language>

Target:
public boolean checkEndpoint(String hostname, String service) { for (EndpointItem item : fList) { if (item.hostname.equals(hostname) && item.service.equals(service)) { return true; } } return false; }
Source:
<code>public void testSegmentMemoriesResetWithNotNodeInTheMiddle() { String drl = "import " + FactA.class.getCanonicalName() + ";\n" + "import " + FactB.class.getCanonicalName() + ";\n" + "import " + FactC.class.getCanonicalName() + ";\n" + "rule R1\n" + "when\n" + " $factA : FactA( field1 == \"code1\")\n" + " not FactC( f2 == 1 && f1 == \"code1\")\n" + " $factB : FactB( f2 == 1 )\n" + "then\n" + "end\n" + "rule R2\n" + "when\n" + " $factA : FactA( field1 == \"code1\")\n" + " not FactC( f2 == 1 && f1 == \"code1\")\n" + " $factB : FactB( f2 == 3 )\n" + "then\n" + "end\n" + "rule R3\n" + "when\n" + " $factA: FactA( field1 == \"code1\")\n" + " $factC: FactC( f1 == \"code1\")\n" + "then\n" + "end"; KieContainer kcontainer = new KieHelper().addContent( drl, ResourceType.DRL ).getKieContainer(); KieSessionsPool pool = kcontainer.newKieSessionsPool( 1 ); <START> KieSession ksession = pool.newKieSession(); <END> createFactAndInsert(ksession); assertEquals(1, ksession.fireAllRules()); ksession.dispose(); ksession = pool.newKieSession(); createFactAndInsert(ksession); assertEquals(1, ksession.fireAllRules()); ksession.dispose(); pool.shutdown(); }</code><technical_language>This is a bit nitpicking, please dispose ksession in a try-finally block, disposed if bad happens</technical_language>

Target:
public void testSegmentMemoriesResetWithNotNodeInTheMiddle() { String drl = "import " + FactA.class.getCanonicalName() + ";\n" + "import " + FactB.class.getCanonicalName() + ";\n" + "import " + FactC.class.getCanonicalName() + ";\n" + "rule R1\n" + "when\n" + " $factA : FactA( field1 == \"code1\")\n" + " not FactC( f2 == 1 && f1 == \"code1\")\n" + " $factB : FactB( f2 == 1 )\n" + "then\n" + "end\n" + "rule R2\n" + "when\n" + " $factA : FactA( field1 == \"code1\")\n" + " not FactC( f2 == 1 && f1 == \"code1\")\n" + " $factB : FactB( f2 == 3 )\n" + "then\n" + "end\n" + "rule R3\n" + "when\n" + " $factA: FactA( field1 == \"code1\")\n" + " $factC: FactC( f1 == \"code1\")\n" + "then\n" + "end"; KieContainer kcontainer = new KieHelper().addContent( drl, ResourceType.DRL ).getKieContainer(); KieSessionsPool pool = kcontainer.newKieSessionsPool( 1 ); KieSession ksession = pool.newKieSession(); try { createFactAndInsert(ksession); assertEquals(1, ksession.fireAllRules()); } finally { ksession.dispose(); } ksession = pool.newKieSession(); try { createFactAndInsert(ksession); assertEquals(1, ksession.fireAllRules()); } finally { ksession.dispose(); } pool.shutdown(); }
Source:
<code>void submitDeleteBlobOperation(String blobIdString, FutureResult<Void> futureResult, Callback<Void> callback) { try { <START> BlobId blobId = RouterUtils.getBlobIdFromString(blobIdString, clusterMap); <END> DeleteOperation deleteOperation = new DeleteOperation(routerConfig, blobId, clusterMap, responseHandler, futureResult, callback, new DeleteRequestRegistrationCallbackImpl(), time); deleteOperations.add(deleteOperation); } catch (RouterException e) { NonBlockingRouter.completeOperation(futureResult, callback, null, e); } }</code><technical_language>I hope plan work logging metrics in a patch. need lot of trace logging in general</technical_language>

Target:
void submitDeleteBlobOperation(String blobIdString, FutureResult<Void> futureResult, Callback<Void> callback) { try { BlobId blobId = RouterUtils.getBlobIdFromString(blobIdString, clusterMap); DeleteOperation deleteOperation = new DeleteOperation(routerConfig, responseHandler, blobId, futureResult, callback, time); deleteOperations.add(deleteOperation); } catch (RouterException e) { NonBlockingRouter.completeOperation(futureResult, callback, null, e); } }
Source:
<code>private void testContent() { ______TS("content: typical page"); Url sessionsUrl = createUrl(Const.ActionURIs.ADMIN_SESSIONS_PAGE); sessionsPage = loginAdminToPage(browser, sessionsUrl, AdminSessionsPage.class); sessionsPage.verifyHtml("/adminSessionsPage.html"); ______TS("content: show filter"); <START> <END> sessionsPage.clickDetailButton(); sessionsPage.verifyHtmlMainContent("/adminSessionsPageShowFilter.html"); }</code><technical_language>Add __TS("content: hide filter")</technical_language>

Target:
private void testContent() { ______TS("content: typical page"); Url sessionsUrl = createUrl(Const.ActionURIs.ADMIN_SESSIONS_PAGE); sessionsPage = loginAdminToPage(browser, sessionsUrl, AdminSessionsPage.class); sessionsPage.verifyHtml("/adminSessionsPage.html"); ______TS("content: show filter"); sessionsPage.clickDetailButton(); sessionsPage.verifyHtmlMainContent("/adminSessionsPageShowFilter.html"); ______TS("content: hide filter"); sessionsPage.clickDetailButton(); sessionsPage.verifyHtmlMainContent("/adminSessionsPageHideFilter.html"); }
Source:
<code>public void cancel() { new CancelButton().click(); <START> new WaitWhile(new ShellIsActive("Open CDI Named Bean")); <END> }</code><technical_language>ShellIsAvailable</technical_language>

Target:
public void cancel() { new CancelButton().click(); new WaitWhile(new ShellIsAvailable("Open CDI Named Bean")); }
Source:
<code>public void restoreSnapshot(ClockSnapshot s) { synchronized (coreLock) { if (s.getId() != getId()) { return; } setNumber(s.getNumber()); <START> stop(); setTime(s.getTime()); if (s.isRunning()) { start(false); } } <END> }</code><technical_language>Stopping restarting a clock fire events. verified this unwanted effects anywhere</technical_language>

Target:
public void restoreSnapshot(ClockSnapshot s) { synchronized (coreLock) { if (s.getId() != getId()) { return; } setNumber(s.getNumber()); set(Value.TIME, s.getTime(), Flag.INTERNAL); if (s.isRunning()) { start(); } else { stop(); } } }
Source:
<code>void copy() throws IOException { FileInputStream input = new FileInputStream(src); FileOutputStream output = new FileOutputStream(dest); try { FileChannel channel = input.getChannel(); output.getChannel().transferFrom(channel, 0, channel.size()); <START> } finally { input.close(); output.close(); } <END> }</code><technical_language>need levels of try/finally input closed if FileOutputStream fails create</technical_language>

Target:
void copy() throws IOException { FileInputStream input = new FileInputStream(src); try { FileOutputStream output = new FileOutputStream(dest); try { FileChannel channel = input.getChannel(); output.getChannel().transferFrom(channel, 0, channel.size()); } finally { output.close(); } } finally { input.close(); } }
Source:
<code>public void testBug544975ProjectOpenBackgroundRefresh() throws Exception { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject("Bug544975"); try { create(project, false); IFile file = createFile(project, "someFile.txt", "some text"); long oldModificationStamp = file.getModificationStamp(); project.close(new NullProgressMonitor()); String expectedContents = "some changed text"; writeWithFileSystemAPI(file, expectedContents); project.open(IResource.BACKGROUND_REFRESH, new NullProgressMonitor()); Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, new NullProgressMonitor()); <START> long newModificationStamp = file.getModificationStamp(); assertNotEquals("Expected resource to be refreshed after opening project with BACKGROUND_REFRESH flag", oldModificationStamp, newModificationStamp); <END> } finally { project.delete(true, new NullProgressMonitor()); } }</code><technical_language>I modification times all, is unpredictable file systems have. Please add new file closed project, open project query if members() return new file too</technical_language>

Target:
public void testBug544975ProjectOpenBackgroundRefresh() throws Exception { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject("Bug544975"); try { create(project, false); createFile(project, "someFile.txt", "some text"); int initialMembers = project.members().length; project.close(new NullProgressMonitor()); URI projectUri = project.getLocationURI(); Path projectPath = Paths.get(projectUri); assertTrue("Test project must exist on file system", Files.exists(projectPath)); Path filePath = projectPath.resolve("someOtherFile.txt"); Files.createFile(filePath); project.open(IResource.BACKGROUND_REFRESH, new NullProgressMonitor()); Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, new NullProgressMonitor()); IResource[] members = project.members(); assertEquals("Expected new project resource to be found after opening with BACKGROUND_REFRESH", initialMembers + 1, members.length); } finally { project.delete(true, new NullProgressMonitor()); } }
Source:
<code>public static HistoryQuery unboundedHistoryQuerySinceSeq(long seqLowerBound) { return unboundedHistoryQuerySinceSeqForNamespaceAndUseCase( <START> TimelockCorruptionTestConstants.DEFAULT_NAMESPACE_AND_USE_CASE, seqLowerBound); <END> }</code><technical_language>nit: In other tests, statically imported this. do here, remove static imports elsewhere</technical_language>

Target:
public static HistoryQuery unboundedHistoryQuerySinceSeq(long seqLowerBound) { return unboundedHistoryQuerySinceSeqForNamespaceAndUseCase(DEFAULT_NAMESPACE_AND_USE_CASE, seqLowerBound); }
Source:
<code>public void testValidTableSchema() { DynamicConfigHelpers.setTableConfigPath("valid/"); String path = "src/test/resources/tables"; File file = new File(path); String absolutePath = file.getAbsolutePath(); try { ElideTableConfig config = DynamicConfigHelpers.getElideTablePojo( DynamicConfigHelpers.formatFilePath(absolutePath)); assertNotNull(config); } catch (JsonProcessingException e) { <START> log.error(e.getMessage()); <END> } }</code><technical_language>catching exception, failing test. Tests this propagate unexpected exceptions</technical_language>

Target:
public void testValidTableSchema() throws IOException { String path = "src/test/resources/tables"; File file = new File(path); String absolutePath = file.getAbsolutePath(); Map<String, Object> vars = DynamicConfigHelpers.getVariablesPojo( DynamicConfigHelpers.formatFilePath(absolutePath)); ElideTableConfig config = DynamicConfigHelpers.getElideTablePojo( DynamicConfigHelpers.formatFilePath(absolutePath), vars, "valid/"); assertNotNull(config); }
Source:
<code>public InputStream createInputStream(URI uri, Map<?, ?> options) throws IOException { InputStream stream = null; synchronized(prefetchedStreams) { stream = prefetchedStreams.get(uri); if (stream != null) { <START> prefetchedStreams.remove(uri); <END> return stream; } } final URI normalizedUri = normalize(uri); if (normalizedUri.isPlatformPlugin() || normalizedUri.toString().matches("(\\.\\./)+?plugins/.*")) { stream = super.createInputStream(normalizedUri, options); } else { final IResource targetFile; if (normalizedUri.isPlatform()) { IPath platformString = new Path(normalizedUri.trimFragment().toPlatformString(true)); IResource temp = ResourcesPlugin.getWorkspace().getRoot().getFile(platformString); if (!temp.exists() && normalizedUri.isPlatformResource() && platformString.segmentCount() > 1) { targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( platformString.removeFirstSegments(1)); } else { targetFile = temp; } } else { targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( new Path(normalizedUri.trimFragment().toString())); } if (targetFile != null) { stream = openRevisionStream(targetFile); } else { stream = super.createInputStream(uri, options); } } return stream; }</code><technical_language>do remove it</technical_language>

Target:
public InputStream createInputStream(URI uri, Map<?, ?> options) throws IOException { InputStream stream = prefetchedStreams.remove(uri); if (stream != null) { return stream; } final URI normalizedUri = normalize(uri); if (normalizedUri.isPlatformPlugin() || normalizedUri.toString().matches("(\\.\\./)+?plugins/.*")) { stream = super.createInputStream(normalizedUri, options); } else { final IResource targetFile; if (normalizedUri.isPlatform()) { IPath platformString = new Path(normalizedUri.trimFragment().toPlatformString(true)); IResource temp = ResourcesPlugin.getWorkspace().getRoot().getFile(platformString); if (!temp.exists() && normalizedUri.isPlatformResource() && platformString.segmentCount() > 1) { targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( platformString.removeFirstSegments(1)); } else { targetFile = temp; } } else { targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( new Path(normalizedUri.trimFragment().toString())); } if (targetFile != null) { stream = openRevisionStream(targetFile); } else { stream = super.createInputStream(uri, options); } } return stream; }
Source:
<code>public static int getHeartbeat(URL url) { String dubbo = url.getParameter(Constants.DUBBO_VERSION_KEY); return url.getParameter(Constants.HEARTBEAT_KEY, dubbo != null && <START> dubbo.startsWith("1.0.") ? Constants.DEFAULT_HEARTBEAT : 0); <END> }</code><technical_language>2.0.x widely adopted, 1.0.x compatible code unnecessary remove code cleaner. do think</technical_language>

Target:
public static int getHeartbeat(URL url) { return url.getParameter(Constants.HEARTBEAT_KEY, Constants.DEFAULT_HEARTBEAT); }
Source:
<code>protected boolean cannotAdapt(final IBinding inputBinding) throws CoreException { <START> if (inputBinding == null || inputBinding instanceof IProblemBinding) { <END> return true; } if (inputBinding instanceof PDOMBinding) { PDOMBinding pdomBinding = (PDOMBinding) inputBinding; if (pdomBinding.getPDOM() != getPDOM() && pdomBinding.isFileLocal()) { return true; } } return false; }</code><technical_language>Parameters generally adaptable PDOM. PDOMCPPLinkage.adaptBinding return null for a CPPParameter this change. In cases want store references function parameters in index parameters globally visible objects. place need parameter references is evaluation representing return expression of a constexpr function. other places operate function types, individual parameters</technical_language>

Target:
protected boolean cannotAdapt(final IBinding inputBinding) throws CoreException { if (inputBinding == null || inputBinding instanceof IProblemBinding || inputBinding instanceof IParameter) { return true; } if (inputBinding instanceof PDOMBinding) { PDOMBinding pdomBinding = (PDOMBinding) inputBinding; if (pdomBinding.getPDOM() != getPDOM() && pdomBinding.isFileLocal()) { return true; } } return false; }
Source:
<code>public String build(String amountToRefund, String currencyCode) { <START> return "{\n" + <END> new RequestHeaderBuilder(customerId, requestId, retryIndicator).build() + ",\n"+ "\"Refund\": {\n" + " \"Amount\": {\n" + " \"Value\": \""+amountToRefund+"\",\n" + " \"CurrencyCode\": \""+currencyCode+"\"\n" + " }\n" + "},\n" + "\"CaptureReference\": {\n" + " \"CaptureId\": \""+captureId+"\"\n" + " }"+ "}"; }</code><technical_language>json serializer, escaping tricky</technical_language>

Target:
public String build(String amountToRefund, String currencyCode) { var out = new StringWriter(); var requestHeaderBuilder = new RequestHeaderBuilder(customerId, requestId, retryIndicator); try (var writer = new JsonWriter(out)) { requestHeaderBuilder.appendTo(writer.beginObject()) .name("Refund").beginObject() .name("Amount").beginObject() .name("Value").value(amountToRefund) .name("CurrencyCode").value(currencyCode) .endObject() .endObject() .name("CaptureReference").beginObject() .name("CaptureId").value(captureId) .endObject() .endObject().flush(); } return out.toString(); }
Source:
<code>public void set(@Nullable String text) { if (text!=null && text.length() > 255) setAtOnce(text); else { WebElement e = resolve(); e.clear(); <START> e.sendKeys(StringUtils.isEmpty(text) ? StringUtils.EMPTY : text); <END> } }</code><technical_language>StringUtils.defaultString(Text)</technical_language>

Target:
public void set(@Nullable String text) { if (text!=null && text.length() > 255) setAtOnce(text); else { WebElement e = resolve(); e.clear(); e.sendKeys(StringUtils.defaultString(text)); } }
Source:
<code>public void testResolveImagesCustomSorterPreferringNonNull() { final Ordering<Image> sorterPreferringNonNullArch = new Ordering<Image>() { @Override public int compare(Image left, Image right) { return ComparisonChain.start() .compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch(), Ordering.<String> natural().nullsFirst()) .compare(left, right, TemplateBuilderImpl.DEFAULT_IMAGE_ORDERING) .result(); } }; Assert.assertTrue(TemplateBuilderImpl.DEFAULT_IMAGE_ORDERING.compare(image64bit, imageArchNull) < 0); <START> Assert.assertTrue(sorterPreferringNonNullArch.compare(image64bit, imageArchNull) > 0); <END> doTestResolveImages(Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of( image, imageArchNull, image64bit)), image64bit, new Function<TemplateBuilderImpl,TemplateBuilderImpl>() { @Override public TemplateBuilderImpl apply(TemplateBuilderImpl input) { return input.imageChooser(input.imageChooserFromOrdering(sorterPreferringNonNullArch)); } }); }</code><technical_language>Static import of Assert.assertTrue? add a descriptive message</technical_language>

Target:
public void testResolveImagesCustomSorterPreferringNonNull() { final Ordering<Image> sorterPreferringNonNullArch = new Ordering<Image>() { @Override public int compare(Image left, Image right) { return ComparisonChain.start() .compare(left.getOperatingSystem().getArch(), right.getOperatingSystem().getArch(), Ordering.<String> natural().nullsFirst()) .compare(left, right, TemplateBuilderImpl.DEFAULT_IMAGE_ORDERING) .result(); } }; assertTrue(TemplateBuilderImpl.DEFAULT_IMAGE_ORDERING.compare(image64bit, imageArchNull) < 0, "wrong default image ordering"); assertTrue(sorterPreferringNonNullArch.compare(image64bit, imageArchNull) > 0, "wrong custom image ordering"); doTestResolveImages(Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of( image, imageArchNull, image64bit)), image64bit, new Function<TemplateBuilderImpl,TemplateBuilderImpl>() { @Override public TemplateBuilderImpl apply(TemplateBuilderImpl input) { return input.imageChooser(input.imageChooserFromOrdering(sorterPreferringNonNullArch)); } }); }
Source:
<code>private <T> Mono<T> doGetMono(Class<T> type, String... pathSegments) { return client.headers(authorizedHeader()) <START> .doOnResponse(onResponseCallback) <END> .get() .uri(uri(pathSegments)) .responseSingle(decode(type)); }</code><technical_language>noticed error fix 0.8 callback is invoked</technical_language>

Target:
private <T> Mono<T> doGetMono(Class<T> type, String... pathSegments) { return Mono.from(client .headersWhen(authorizedHeader()) .get() .uri(uri(pathSegments)) .response(decode(type))); }
Source:
<code>public @Nonnull UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException { ImpersonatingUserDetailsService userDetailsService = new ImpersonatingUserDetailsService( Jenkins.getInstance().getSecurityRealm().getSecurityComponents().userDetails ); try { UserDetails userDetails = userDetailsService.loadUserByUsername(id); LOGGER.log(Level.FINE, "Impersonation of the user {0} was a success", new Object[]{ id }); return userDetails; } catch (UserMayOrMayNotExistException e) { LOGGER.log(Level.FINE, "The user {0} may or may not exist in the SecurityRealm, so we provide minimum access", new Object[]{ id }); } catch (UsernameNotFoundException e) { if(ALLOW_NON_EXISTENT_USER_TO_LOGIN){ <START> LOGGER.log(Level.FINE, "The user {0} was not found in the SecurityRealm but we are required to let it passes, due to ALLOW_NON_EXISTENT_USER_TO_LOGIN", new Object[]{ id }); <END> }else{ LOGGER.log(Level.FINE, "The user {0} was not found in the SecurityRealm", new Object[]{ id }); throw e; } } catch (DataAccessException e) { LOGGER.log(Level.FINE, "The user {0} retrieval just thrown a DataAccess exception with msg = {1}, so we provide minimum access", new Object[]{ id, e.getMessage() }); } return new LegitimateButUnknownUserDetails(id); }</code><technical_language>pass</technical_language>

Target:
public @Nonnull UserDetails getUserDetailsForImpersonation() throws UsernameNotFoundException { ImpersonatingUserDetailsService userDetailsService = new ImpersonatingUserDetailsService( Jenkins.getInstance().getSecurityRealm().getSecurityComponents().userDetails ); try { UserDetails userDetails = userDetailsService.loadUserByUsername(id); LOGGER.log(Level.FINE, "Impersonation of the user {0} was a success", new Object[]{ id }); return userDetails; } catch (UserMayOrMayNotExistException e) { LOGGER.log(Level.FINE, "The user {0} may or may not exist in the SecurityRealm, so we provide minimum access", new Object[]{ id }); } catch (UsernameNotFoundException e) { if(ALLOW_NON_EXISTENT_USER_TO_LOGIN){ LOGGER.log(Level.FINE, "The user {0} was not found in the SecurityRealm but we are required to let it pass, due to ALLOW_NON_EXISTENT_USER_TO_LOGIN", new Object[]{ id }); }else{ LOGGER.log(Level.FINE, "The user {0} was not found in the SecurityRealm", new Object[]{ id }); throw e; } } catch (DataAccessException e) { LOGGER.log(Level.FINE, "The user {0} retrieval just threw a DataAccess exception with msg = {1}, so we provide minimum access", new Object[]{ id, e.getMessage() }); } return new LegitimateButUnknownUserDetails(id); }
Source:
<code>public static void addAppender(String name, Properties properties) { if (getAppendersNames().contains(name)) { logger.warn("A logger appender with the name '{}' exists. Cannot add a new logger appender with the same name", name); } else { try { <START> Method method = PropertyConfigurator.class.getDeclaredMethod("parseAppender", Properties.class, String.class); <END> method.setAccessible(true); Appender appender = (Appender)method.invoke(new PropertyConfigurator(), properties, name); if (appender == null) { logger.warn("Cannot add a new logger appender. Name: {}, Properties: {}", name, properties); } else { Logger.getRootLogger().addAppender(appender); } } catch (Exception ex) { logger.warn("Cannot add a new logger appender. Name: {}, Properties: {}", name, properties, ex); } } }</code><technical_language>reuse method object for multiple appenders opposed constructing time</technical_language>

Target:
public static boolean addAppender(String name, Properties properties) { if (getAppendersNames().contains(name)) { logger.warn("A logger appender with the name '{}' exists. Cannot add a new logger appender with the same name", name); } else { try { Method method = PropertyConfigurator.class.getDeclaredMethod("parseAppender", Properties.class, String.class); method.setAccessible(true); Appender appender = (Appender)method.invoke(new PropertyConfigurator(), properties, name); if (appender == null) { logger.warn("Cannot add a new logger appender. Name: {}, Properties: {}", name, properties); } else { LogManager.getRootLogger().addAppender(appender); return true; } } catch (Exception ex) { logger.warn("Cannot add a new logger appender. Name: {}, Properties: {}", name, properties, ex); } } return false; }
Source:
<code>private String buildClipboardMessage(Row row) { <START> StringBuilder builder = new StringBuilder(); <END> builder.append(row.getLevel()) .append(", ") .append(row.getMessage()); return builder.toString(); }</code><technical_language>this builder concatenate 3 strings loops. I guess, is unnecessary here</technical_language>

Target:
private String buildClipboardMessage(Row row) { return row.getLevel() + ", " + row.getMessage(); }
Source:
<code><START> public void interleavedOperationsTest() <END> throws Exception { List<OperationInfo> opInfos = new ArrayList<>(); for (int i = 0; i < 10; i++) { Queue<OperationType> opChain = new LinkedList<>(); opChain.add(OperationType.PUT_NB); opChain.add(OperationType.AWAIT_CREATION); opChain.add(OperationType.GET_INFO_NB); opChain.add(OperationType.GET_NB); opChain.add(OperationType.DELETE_NB); opChain.add(OperationType.AWAIT_DELETION); opChain.add(OperationType.GET_INFO_DELETED_NB); opChain.add(OperationType.GET_DELETED_NB); opChain.add(OperationType.DELETE_NB); opInfos.add(testFramework.startOperationChain(32 * 1024, i, opChain)); } testFramework.checkOperationChains(opInfos); }</code><technical_language>Do a verify ssl feature is picked up? ssl parameters configured, used</technical_language>

Target:
public void interleavedOperationsTest() throws Exception { List<OperationChain> opChains = new ArrayList<>(); Random random = new Random(); for (int i = 0; i < 10; i++) { Queue<OperationType> operations = new LinkedList<>(); switch (i % 3) { case 0: operations.add(OperationType.PUT_NB); operations.add(OperationType.AWAIT_CREATION); operations.add(OperationType.GET_NB); operations.add(OperationType.GET_INFO_NB); operations.add(OperationType.DELETE_NB); operations.add(OperationType.AWAIT_DELETION); operations.add(OperationType.GET_DELETED_NB); operations.add(OperationType.GET_INFO_DELETED_NB); break; case 1: operations.add(OperationType.PUT_NB); operations.add(OperationType.AWAIT_CREATION); operations.add(OperationType.DELETE_NB); operations.add(OperationType.AWAIT_DELETION); operations.add(OperationType.GET_DELETED_NB); operations.add(OperationType.GET_INFO_DELETED_NB); operations.add(OperationType.GET_DELETED_NB); operations.add(OperationType.GET_INFO_DELETED_NB); break; case 2: operations.add(OperationType.PUT_NB); operations.add(OperationType.AWAIT_CREATION); operations.add(OperationType.GET_NB); operations.add(OperationType.GET_NB); operations.add(OperationType.GET_NB); operations.add(OperationType.GET_INFO_NB); break; } int blobSize = random.nextInt(100 * 1024); opChains.add(testFramework.startOperationChain(blobSize, i, operations)); } testFramework.checkOperationChains(opChains); }
Source:
<code>public void updateNode(final @Nonnull Node node) throws IOException { if (node == nodes.get(node.getNodeName())) { if (node instanceof EphemeralNode) { Util.deleteRecursive(new File(getNodesDir(), node.getNodeName())); } else { XmlFile xmlFile = new XmlFile(Jenkins.XSTREAM, new File(new File(getNodesDir(), node.getNodeName()), "config.xml")); xmlFile.write(node); <START> } <END> } }</code><technical_language>this fire a saveableListener state changed. (not [addNode](<LINK_0> do same? @stephenc ideas? this code is a duplicate of code in addNode() - pulled a private function</technical_language>

Target:
public boolean updateNode(final @Nonnull Node node) throws IOException { if (node == nodes.get(node.getNodeName())) { Queue.withLock(new Runnable() { @Override public void run() { jenkins.trimLabels(); } }); persistNode(node); return true; } return false; }
Source:
<code>public void resetTasksWithUnknownWorkerUUIDs(DbSession dbSession, Set<String> knownWorkerUUIDs) { <START> mapper(dbSession).resetTasksWithUnknownWorkerUUIDs(knownWorkerUUIDs, system2.now()); <END> }</code><technical_language>method is a collection a parameter is populate a "IN" clause, org.sonar.db.DatabaseUtils#executeLargeUpdates</technical_language>

Target:
public void resetTasksWithUnknownWorkerUUIDs(DbSession dbSession, Set<String> knownWorkerUUIDs) { if (knownWorkerUUIDs.isEmpty()) { mapper(dbSession).resetAllInProgressTasks(system2.now()); } else { executeLargeUpdates(knownWorkerUUIDs, (Consumer<List<String>>) uuids -> mapper(dbSession).resetTasksWithUnknownWorkerUUIDs(uuids, system2.now()) ); } }
Source:
<code>public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (shouldBlockRequest((HttpServletRequest) servletRequest)) { <START> LOGGER.info("Got a non-GET request: " + servletRequest); <END> ((HttpServletResponse) servletResponse).setStatus(HttpServletResponse.SC_FORBIDDEN); servletResponse.getWriter().write(""); } else { filterChain.doFilter(servletRequest, servletResponse); } }</code><technical_language>LOGGER.info? LOGGER.warn</technical_language>

Target:
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (shouldBlockRequest((HttpServletRequest) servletRequest)) { LOGGER.warn("Got a non-GET request: " + servletRequest); ((HttpServletResponse) servletResponse).setStatus(HttpServletResponse.SC_FORBIDDEN); servletResponse.getWriter().write(""); } else { filterChain.doFilter(servletRequest, servletResponse); } }
Source:
<code>public void sendMetric(Metric metric) { try { MeasureLong measure = measures.get(metric.getKey()); if (measure == null) { <START> measure = MeasureLong.create("Events", "Number of Events", "1"); <END> measures.put(metric.getKey(), measure); final List<TagKey> columns = new ArrayList<TagKey>(metric.getTags().size()); metric.getTags().keySet().forEach(tagName -> { columns.add(TagKey.create(tagName)); }); final View view = View.create( Name.create(metric.getKey()), metric.getKey(), measure, Sum.create(), columns); Stats.getViewManager().registerView(view); } final TagContextBuilder builder = tagger.emptyBuilder(); metric.getTags().forEach((k, v) -> { builder.put(TagKey.create(k), TagValue.create(v)); }); final TagContext context = builder.build(); statsRecorder.newMeasureMap().put(measure, (long) metric.getValue()).record(context); } catch (Exception ex) { log.error("Couldn't send metric %s", ex); throw ex; } }</code><technical_language>measure incremented is metric 1</technical_language>

Target:
public void sendMetric(Metric metric) { try { String metricName = getOutputMetricName(metric); MeasureLong measure = measures.get(metricName); if (measure == null) { if (measures.size() > maxViews) { throw new RuntimeException("maxViews exceeded. " + "Please increase in configuration or decrease number of metrics."); } measure = MeasureLong.create("Events", "Number of Events", "1"); measures.put(metricName, measure); final List<TagKey> columns = new ArrayList<TagKey>(metric.getTags().size()); metric.getTags().keySet().forEach(tagName -> { columns.add(TagKey.create(tagName)); }); final View view = View.create( Name.create(metricName), metricName, measure, Sum.create(), columns); Stats.getViewManager().registerView(view); } final TagContextBuilder builder = tagger.emptyBuilder(); metric.getTags().forEach((k, v) -> { builder.putPropagating(TagKey.create(k), TagValue.create(v)); }); final TagContext context = builder.build(); statsRecorder.newMeasureMap().put(measure, (long) metric.getValue()).record(context); } catch (Exception ex) { log.error("Couldn't send metric %s", ex); throw ex; } }
Source:
<code>public Hardware apply(final VirtualGuest from) { HardwareBuilder builder = new HardwareBuilder().ids(from.getId() + "") .name(from.getHostname()) .hypervisor("XenServer") .processors(ImmutableList.of(new Processor(from.getStartCpus(), 2))) .ram(from.getMaxMemory()); if (from.getVirtualGuestBlockDevices() != null) { builder.volumes( FluentIterable.from(from.getVirtualGuestBlockDevices()).filter(new Predicate<VirtualGuestBlockDevice>() { @Override public boolean apply(VirtualGuestBlockDevice input) { return input.getMountType().equals("Disk"); } }) .transform(new Function<VirtualGuestBlockDevice, Volume>() { @Override public Volume apply(VirtualGuestBlockDevice item) { float volumeSize = -1; if (item.getVirtualDiskImage() != null) { volumeSize = item.getVirtualDiskImage().getCapacity(); <START> } <END> return new VolumeImpl( item.getId() + "", from.isLocalDiskFlag() ? Volume.Type.LOCAL : Volume.Type.SAN, volumeSize, null, item.getBootableFlag() == 1, false); } }).toSet()); } return builder.build(); }</code><technical_language>sense return volumes size -1</technical_language>

Target:
public Hardware apply(final VirtualGuest from) { HardwareBuilder builder = new HardwareBuilder().ids(from.getId() + "") .name(from.getHostname()) .hypervisor("XenServer") .processors(ImmutableList.of(new Processor(from.getStartCpus(), 2))) .ram(from.getMaxMemory()); if (from.getVirtualGuestBlockDevices() != null) { builder.volumes( FluentIterable.from(from.getVirtualGuestBlockDevices()).filter(new Predicate<VirtualGuestBlockDevice>() { @Override public boolean apply(VirtualGuestBlockDevice input) { return input.getMountType().equals("Disk"); } }) .transform(new Function<VirtualGuestBlockDevice, Volume>() { @Override public Volume apply(VirtualGuestBlockDevice item) { float volumeSize = item.getVirtualDiskImage().getCapacity(); return new VolumeImpl( item.getId() + "", from.isLocalDiskFlag() ? Volume.Type.LOCAL : Volume.Type.SAN, volumeSize, null, item.getBootableFlag() == 1, false); } }).toSet()); } return builder.build(); }
Source:
<code>public void checkCredentialsChanged() { Credentials newCreds = workerState.stormClusterState.credentials(topologyId, null); if (!ObjectUtils.equals(newCreds, this.workerState.credentialsAtom.get())) { ClientAuthUtils.updateSubject(subject, autoCreds, (null == newCreds) ? null : newCreds.get_creds()); for (IRunningExecutor executor : executorsAtom.get()) { executor.credentialsChanged(newCreds); } <START> this.workerState.credentialsAtom.set(newCreds); <END> } }</code><technical_language>I race condition here. executor.credentialsChanged this.workerState.credentialsAtom.set(newCreds) is invoked, executor trigger credential update newCreds is updated yet</technical_language>

Target:
public void checkCredentialsChanged() { Credentials newCreds = workerState.stormClusterState.credentials(topologyId, null); if (!ObjectUtils.equals(newCreds, this.workerState.getCredentials())) { ClientAuthUtils.updateSubject(subject, autoCreds, (null == newCreds) ? null : newCreds.get_creds()); this.workerState.setCredentials(newCreds); for (IRunningExecutor executor : executorsAtom.get()) { executor.credentialsChanged(newCreds); } } }
Source:
<code>public void setImage (Image image) { checkWidget(); if ((style & SWT.SEPARATOR) != 0) return; <START> super.setImage (image); <END> enabledImage = image; if (!enabled && disabledImage != image) { enabledImage = image; return; } _setImage(image); }</code><technical_language>This line sets Item.image field instead of enabledImage</technical_language>

Target:
public void setImage (Image image) { checkWidget(); if ((style & SWT.SEPARATOR) != 0) return; super.setImage (image); if (!enabled && disabledImage != image) { return; } _setImage(image); }
Source:
<code>private static RestRequestMetricsGroup getMetricsGroupForGet(FrontendMetrics frontendMetrics, SubResource subResource) { RestRequestMetricsGroup group = null; if (subResource == null) { group = frontendMetrics.getBlobMetricsGroup; } else { switch (subResource) { case BlobInfo: group = frontendMetrics.getBlobInfoMetricsGroup; break; case UserMetadata: group = frontendMetrics.getUserMetadataMetricsGroup; break; case Replicas: group = frontendMetrics.getReplicasMetricsGroup; break; case Segment: <START> group = frontendMetrics.getSegmentMetricsGroup; <END> break; } } return group; }</code><technical_language>discussed offline. getBlobMetricsGroup metrics grouping consistent range requests</technical_language>

Target:
private static RestRequestMetricsGroup getMetricsGroupForGet(FrontendMetrics frontendMetrics, SubResource subResource) { RestRequestMetricsGroup group = null; if (subResource == null || subResource.equals(SubResource.Segment)) { group = frontendMetrics.getBlobMetricsGroup; } else { switch (subResource) { case BlobInfo: group = frontendMetrics.getBlobInfoMetricsGroup; break; case UserMetadata: group = frontendMetrics.getUserMetadataMetricsGroup; break; case Replicas: group = frontendMetrics.getReplicasMetricsGroup; break; } } return group; }
Source:
<code>public static void fixUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { if (record.getBaseQualities() != SAMRecord.NULL_QUALS) { <START> final byte[] referenceBases = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())).getBases(); <END> record.setAttribute(SAMTag.UQ.name(), SequenceUtil.sumQualitiesOfMismatches(record, referenceBases, 0, isBisulfiteSequence)); } }</code><technical_language>for ease of reading extract refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName()) a final variable</technical_language>

Target:
public static void fixUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { if (record.getBaseQualities() != SAMRecord.NULL_QUALS) { final byte[] referenceBases = refSeqWalker.get(record.getReferenceIndex()).getBases(); record.setAttribute(SAMTag.UQ.name(), SequenceUtil.sumQualitiesOfMismatches(record, referenceBases, 0, isBisulfiteSequence)); } }
Source:
<code>public static CliConfig fromEnvVar(Map<String, Object> config) throws URISyntaxException { final String master = environment.get("HELIOS_MASTER"); if (master == null) { return fromMap(config); } final URI uri = new URI(master); final Builder<String, Object> builder = ImmutableMap.<String, Object>builder(); if (config.containsKey(SRV_NAME_KEY)) { builder.put(SRV_NAME_KEY, config.get(SRV_NAME_KEY)); } final String scheme = uri.getScheme(); <START> if (scheme == null) { <END> throw new RuntimeException("Your environment variable HELIOS_MASTER=" + master + " is not a valid URI with a scheme."); } switch (scheme) { case DOMAIN_SCHEME: case DEPRECATED_SITE_SCHEME: builder.put(DOMAINS_KEY, ImmutableList.of(uri.getHost())).build(); break; case HTTP_SCHEME: builder.put(MASTER_ENDPOINTS_KEY, ImmutableList.of(master)); break; default: throw new RuntimeException("Your environment variable HELIOS_MASTER=" + master + " does not have a valid scheme."); } return fromMap(builder.build()); }</code><technical_language>isNullOrEmpty here? practice is treat null/empty strings same</technical_language>

Target:
public static CliConfig fromEnvVar(Map<String, Object> config) throws URISyntaxException { final String master = environment.get("HELIOS_MASTER"); if (master == null) { return fromMap(config); } final URI uri = new URI(master); final Builder<String, Object> builder = ImmutableMap.<String, Object>builder(); if (config.containsKey(SRV_NAME_KEY)) { builder.put(SRV_NAME_KEY, config.get(SRV_NAME_KEY)); } final String scheme = uri.getScheme(); if (isNullOrEmpty(scheme)) { throw new RuntimeException("Your environment variable HELIOS_MASTER=" + master + " is not a valid URI with a scheme."); } switch (scheme) { case DOMAIN_SCHEME: case DEPRECATED_SITE_SCHEME: builder.put(DOMAINS_KEY, ImmutableList.of(uri.getHost())).build(); break; case HTTP_SCHEME: builder.put(MASTER_ENDPOINTS_KEY, ImmutableList.of(master)); break; default: throw new RuntimeException("Your environment variable HELIOS_MASTER=" + master + " does not have a valid scheme."); } return fromMap(builder.build()); }
Source:
<code>void processMsgEcho( MsgEcho message ) throws IOException { final String content = message.getContent(); MsgEcho response = new MsgEcho( content.replaceFirst( "^PING:", "PONG:" ) ); <START> this.logger.fine( "Responding to DM Echo message " + content + "with response " + response.getContent()); <END> this.messagingClient.sendMessageToTheDm( response ); }</code><technical_language>" response "</technical_language>

Target:
void processMsgEcho( MsgEcho message ) throws IOException { final String content = message.getContent(); MsgEcho response = new MsgEcho( content.replaceFirst( "^PING:", "PONG:" ), message.getExpirationTime(), message.getUuid() ); this.logger.fine( "Responding to DM Echo message " + content + " with response " + response.getContent()); this.messagingClient.sendMessageToTheDm( response ); }
Source:
<code>public void apply(Player player, boolean resetActive) { GPPlayerData playerData = GriefPreventionPlugin.instance.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); <START> ; <END> boolean hideBorders = GriefPreventionPlugin.instance.worldEditProvider != null && GriefPreventionPlugin.instance.worldEditProvider.hasCUISupport(player) && GriefPreventionPlugin.getActiveConfig(player.getWorld().getProperties()).getConfig().claim.hideBorders; if (!hideBorders) { if (player.isOnline() && this.elements.size() > 0 && this.elements.get(0).getOriginal().getLocation().get().getExtent().equals(player.getWorld())) { Sponge.getGame().getScheduler().createTaskBuilder().delayTicks(1L) .execute(new VisualizationApplicationTask(player, playerData, this, resetActive)).submit(GriefPreventionPlugin.instance); } } }</code><technical_language>Fix typo</technical_language>

Target:
public void apply(Player player, boolean resetActive) { GPPlayerData playerData = GriefPreventionPlugin.instance.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId()); boolean hideBorders = GriefPreventionPlugin.instance.worldEditProvider != null && GriefPreventionPlugin.instance.worldEditProvider.hasCUISupport(player) && GriefPreventionPlugin.getActiveConfig(player.getWorld().getProperties()).getConfig().claim.hideBorders; if (!hideBorders) { if (player.isOnline() && this.elements.size() > 0 && this.elements.get(0).getOriginal().getLocation().get().getExtent().equals(player.getWorld())) { Sponge.getGame().getScheduler().createTaskBuilder().delayTicks(1L) .execute(new VisualizationApplicationTask(player, playerData, this, resetActive)).submit(GriefPreventionPlugin.instance); } } }
Source:
<code>public JobSpecification toJobSpecificationDTO( final com.netflix.genie.proto.JobSpecification protoSpec ) { return new JobSpecification( protoSpec.getCommandArgsList(), toExecutionResourceDTO(protoSpec.getJob()), toExecutionResourceDTO(protoSpec.getCluster()), toExecutionResourceDTO(protoSpec.getCommand()), protoSpec .getApplicationsList() .stream() .map(JobServiceProtoConverter::toExecutionResourceDTO) .collect(Collectors.toList()), protoSpec.getEnvironmentVariablesMap(), protoSpec.getIsInteractive(), new File(protoSpec.getJobDirectoryLocation()), <START> protoSpec.getArchiveLocation() <END> ); }</code><technical_language>null in proto fields of type string. This is work</technical_language>

Target:
public JobSpecification toJobSpecificationDTO( final com.netflix.genie.proto.JobSpecification protoSpec ) { return new JobSpecification( protoSpec.getCommandArgsList(), toExecutionResourceDTO(protoSpec.getJob()), toExecutionResourceDTO(protoSpec.getCluster()), toExecutionResourceDTO(protoSpec.getCommand()), protoSpec .getApplicationsList() .stream() .map(JobServiceProtoConverter::toExecutionResourceDTO) .collect(Collectors.toList()), protoSpec.getEnvironmentVariablesMap(), protoSpec.getIsInteractive(), new File(protoSpec.getJobDirectoryLocation()), StringUtils.isBlank(protoSpec.getArchiveLocation()) ? null : protoSpec.getArchiveLocation() ); }