auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private void doSearch() { <END> List<ProjectRightsBased> filterProjectsList = new ArrayList<ProjectRightsBased>(); boolean searchAll = false; if ((!"".equals(filterParentProjectTxt.getText().trim())) || (!"".equals(filterProjectNameTxt.getText().trim()))) { for (final ProjectRightsBased k : projectsRightsBasedList) { if (!"".equals(filterProjectNameTxt.getText())) { if (!"".equals(filterParentProjectTxt.getText())) { if ((k.getProjectData().getName().regionMatches(true, 0, filterProjectNameTxt .getText(), 0, filterProjectNameTxt.getText().length())) && (k.getProjectData().getParentName().regionMatches(true, 0, filterParentProjectTxt.getText(), 0, filterParentProjectTxt .getText().length()))) { filterProjectsList.add(k); } } else { if (k.getProjectData().getName().regionMatches(true, 0, filterProjectNameTxt.getText(), 0, filterProjectNameTxt.getText().length())) { filterProjectsList.add(k); } } } else { if (!"".equals(filterParentProjectTxt.getText())) { if ((k.getProjectData().getParentName() != null) && (k.getProjectData().getParentName().regionMatches(true, 0, filterParentProjectTxt.getText(), 0, filterParentProjectTxt .getText().length()))) { filterProjectsList.add(k); } } } } } else { filterProjectsList = projectsRightsBasedList; searchAll = true; } if (searchListener != null) { searchListener.onSearch(filterProjectsList, searchAll); } }</code><technical_language>considered support search/filtering regular expressions</technical_language>

Target:
private void doSearch() { List<ProjectData> filterProjectsList = new ArrayList<ProjectData>(); boolean searchAll = false; if ((!"".equals(filterParentProjectTxt.getText().trim())) || (!"".equals(filterProjectNameTxt.getText().trim()))) { for (final ProjectData k : projectDataList) { if (!"".equals(filterProjectNameTxt.getText())) { if (!"".equals(filterParentProjectTxt.getText())) { if ((k.getName().regionMatches(true, 0, filterProjectNameTxt .getText(), 0, filterProjectNameTxt.getText().length())) && k.getParentNameKey() != null && (k.getParentNameKey().get().regionMatches(true, 0, filterParentProjectTxt.getText(), 0, filterParentProjectTxt .getText().length()))) { filterProjectsList.add(k); } } else { if (k.getName().regionMatches(true, 0, filterProjectNameTxt.getText(), 0, filterProjectNameTxt.getText().length())) { filterProjectsList.add(k); } } } else { if (!"".equals(filterParentProjectTxt.getText())) { if (filterParentProjectTxt.getText().equals( Gerrit.getConfig().getWildProject().get())) { if (k.getParentNameKey() == null) { filterProjectsList.add(k); } } else if ((k.getParentNameKey() != null) && (k.getParentNameKey().get().regionMatches(true, 0, filterParentProjectTxt.getText(), 0, filterParentProjectTxt .getText().length()))) { filterProjectsList.add(k); } } } } } else { filterProjectsList = projectDataList; searchAll = true; } handlerManager.fireEvent(new SearchEvent(filterProjectsList, searchAll)); }
Source:
<code><START> public RetryPolicy(int retryTimeOut, <END> int retryNumber, int incomingHeartbeat, int outgoingHeartbeat, List<Class<? extends Exception>> retryableExceptions) { this.retryNumber = retryNumber; this.retryTimeOut = retryTimeOut; this.incomingHeartbeat = incomingHeartbeat; if (incomingHeartbeat != 0) { this.isIncomingHeartbeat.set(true); } this.outgoingHeartbeat = outgoingHeartbeat; if (outgoingHeartbeat != 0) { this.isOutgoingHeartbeat.set(true); } this.exceptions = Collections.unmodifiableList(retryableExceptions); }</code><technical_language>is c'tor inflation this class. settle for parameters ? raises question: vdsm-json-rpc-java compatible</technical_language>

Target:
public RetryPolicy(int retryTimeOut, int retryNumber, int incomingHeartbeat, int outgoingHeartbeat, List<Class<? extends Exception>> retryableExceptions) { this.retryNumber = retryNumber; this.retryTimeOut = retryTimeOut; setIncomingHeartbeat(incomingHeartbeat); setOutgoingHeartbeat(outgoingHeartbeat); this.exceptions = Collections.unmodifiableList(retryableExceptions); }
Source:
<code>void notifyChatRoomMemberJoined(ChatRoomMember chatMember) { super.notifyChatRoomMemberJoined(chatMember); String identifier = getParticipantIdentifier(chatMember); <START> this.transcriber.maybeAddParticipant(identifier); <END> this.transcriber.updateParticipant(identifier, chatMember); this.transcriber.participantJoined(identifier); }</code><technical_language>do need 3 function calls here? function Transcriber figure out</technical_language>

Target:
void notifyChatRoomMemberJoined(ChatRoomMember chatMember) { super.notifyChatRoomMemberJoined(chatMember); String identifier = getParticipantIdentifier(chatMember); this.transcriber.updateParticipant(identifier, chatMember); this.transcriber.participantJoined(identifier); }
Source:
<code>public void testInt3088MPutRecursiveFiltered() { <START> if (!sessionFactory.toString().startsWith("Mock for")) { <END> String dir = "sftpSource/"; this.inboundMGetRecursive.send(new GenericMessage<Object>(dir + "*")); while (output.receive(0) != null) { } this.inboundMPutRecursiveFiltered.send(new GenericMessage<File>(new File("/tmp/sftpOutboundTests/sftpSource"))); @SuppressWarnings("unchecked") Message<List<String>> out = (Message<List<String>>) this.output.receive(1000); assertNotNull(out); assertEquals(2, out.getPayload().size()); assertThat(out.getPayload().get(0), not(equalTo(out.getPayload().get(1)))); assertThat( out.getPayload().get(0), anyOf(equalTo("sftpTarget/slocalTarget1.txt"), equalTo("sftpTarget/slocalTarget2.txt"), equalTo("sftpTarget/subSftpSource/subSlocalTarget1.txt"))); assertThat( out.getPayload().get(1), anyOf(equalTo("sftpTarget/slocalTarget1.txt"), equalTo("sftpTarget/slocalTarget2.txt"), equalTo("sftpTarget/subSftpSource/subSlocalTarget1.txt"))); } }</code><technical_language>So, SftpServerRule? it</technical_language>

Target:
public void testInt3088MPutRecursiveFiltered() { String dir = "sftpSource/"; this.inboundMGetRecursive.send(new GenericMessage<Object>(dir + "*")); while (output.receive(0) != null) { } this.inboundMPutRecursiveFiltered.send(new GenericMessage<File>(new File("/tmp/sftpOutboundTests/sftpSource"))); @SuppressWarnings("unchecked") Message<List<String>> out = (Message<List<String>>) this.output.receive(1000); assertNotNull(out); assertEquals(2, out.getPayload().size()); assertThat(out.getPayload().get(0), not(equalTo(out.getPayload().get(1)))); assertThat( out.getPayload().get(0), anyOf(equalTo("sftpTarget/slocalTarget1.txt"), equalTo("sftpTarget/slocalTarget2.txt"), equalTo("sftpTarget/subSftpSource/subSlocalTarget1.txt"))); assertThat( out.getPayload().get(1), anyOf(equalTo("sftpTarget/slocalTarget1.txt"), equalTo("sftpTarget/slocalTarget2.txt"), equalTo("sftpTarget/subSftpSource/subSlocalTarget1.txt"))); }
Source:
<code>public void testDecodeWithNoSpaces() { AffineCipher affineCipher = new AffineCipher(); <START> assertEquals("thequickbrownfoxjumpsoverthelazydog", affineCipher.decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33)); <END> }</code><technical_language>This line is a bit long</technical_language>

Target:
public void testDecodeWithNoSpaces() { assertEquals("thequickbrownfoxjumpsoverthelazydog", affineCipher.decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33)); }
Source:
<code>private void configureShell() { shell.setText( title ); <START> Rectangle parentSize = parent.getDisplay().getBounds(); <END> Point prefSize = shell.computeSize( SWT.DEFAULT, SWT.DEFAULT ); shell.setSize( prefSize ); int locationX = ( parentSize.width - prefSize.x ) / 2 + parentSize.x; int locationY = ( parentSize.height - prefSize.y ) / 2 + parentSize.y; shell.setLocation( new Point( locationX, locationY ) ); shell.pack(); }</code><technical_language>Rename displaySize similar FileDialog</technical_language>

Target:
private void configureShell() { shell.setText( title ); Rectangle displaySize = parent.getDisplay().getBounds(); Point prefSize = shell.computeSize( SWT.DEFAULT, SWT.DEFAULT ); shell.setSize( prefSize ); int locationX = ( displaySize.width - prefSize.x ) / 2 + displaySize.x; int locationY = ( displaySize.height - prefSize.y ) / 2 + displaySize.y; shell.setLocation( new Point( locationX, locationY ) ); shell.pack(); }
Source:
<code>public List<RootInternalResourceGroup> getRootGroups() { <START> return (CopyOnWriteArrayList<RootInternalResourceGroup>) ((CopyOnWriteArrayList<RootInternalResourceGroup>) rootGroups).clone(); <END> }</code><technical_language>suggestion return ImmutableList.copyOf(rootGroups);</technical_language>

Target:
public List<RootInternalResourceGroup> getRootGroups() { return ImmutableList.copyOf(rootGroups); }
Source:
<code>public void testTaskNotStartedReassign() throws Exception { Reader reader = new InputStreamReader(getClass().getResourceAsStream(MvelFilePath.DeadlineWithMultipleReassignment)); Map<String, Object> vars = new HashMap<String, Object>(); vars.put("now", new Date()); Task task = (InternalTask) TaskFactory.evalTask(reader, vars); Environment environment = EnvironmentFactory.newEnvironment(); Map<String, Object> inputVars = new HashMap<String, Object>(); inputVars.put("NotStartedReassign", "[users:Tony Stark,Bobba Fet,Jabba Hutt|groups:]@[500ms]"); ((InternalTask) task).setDeadlines(HumanTaskHandlerHelper.setDeadlines(inputVars, Collections.emptyList(), environment)); taskService.addTask(task, inputVars); long taskId = task.getId(); task = taskService.getTaskById(taskId); String []owners = new String[] { "Tony Stark", "Bobba Fet", "Jabba Hutt" }; <START> Thread.sleep(1000); <END> for(String owner : owners) { taskService.claim(taskId, owner); task = taskService.getTaskById(taskId); Assert.assertEquals(task.getTaskData().getActualOwner().getId(), owner); Thread.sleep(1000); task = taskService.getTaskById(taskId); Assert.assertNull("it was not reclaimed", task.getTaskData().getActualOwner()); } taskService.claim(taskId, "Bobba Fet"); taskService.start(taskId, "Bobba Fet"); taskService.complete(taskId, "Bobba Fet", Collections.<String, Object>emptyMap()); }</code><technical_language>please change ahead.sleep event listeners - dedicated event listeners for tests utilise CountDownLatch tests more reliable</technical_language>

Target:
public void testTaskNotStartedReassign() throws Exception { Reader reader = new InputStreamReader(getClass().getResourceAsStream(MvelFilePath.DeadlineWithMultipleReassignment)); Map<String, Object> vars = new HashMap<String, Object>(); vars.put("now", new Date()); Task task = (InternalTask) TaskFactory.evalTask(reader, vars); Environment environment = EnvironmentFactory.newEnvironment(); Map<String, Object> inputVars = new HashMap<String, Object>(); inputVars.put("NotStartedReassign", "[users:Tony Stark,Bobba Fet,Jabba Hutt|groups:]@[500ms]"); ((InternalTask) task).setDeadlines(HumanTaskHandlerHelper.setDeadlines(inputVars, Collections.emptyList(), environment)); taskService.addTask(task, inputVars); long taskId = task.getId(); String []owners = new String[] { "Tony Stark", "Bobba Fet", "Jabba Hutt" }; for(String owner : owners) { CountDownTaskEventListener countDownListener = new CountDownTaskEventListener(1, true, false); addCountDownListner(countDownListener); taskService.claim(taskId, owner); task = taskService.getTaskById(taskId); Assert.assertEquals(task.getTaskData().getActualOwner().getId(), owner); countDownListener.waitTillCompleted(); task = taskService.getTaskById(taskId); Assert.assertNull("it was not reclaimed", task.getTaskData().getActualOwner()); removeCountDownListner(countDownListener); } taskService.claim(taskId, "Bobba Fet"); taskService.start(taskId, "Bobba Fet"); taskService.complete(taskId, "Bobba Fet", Collections.<String, Object>emptyMap()); }
Source:
<code>private Optional<ProcessResult> run(String[] command, Path dir) { ProcessRunner runner = new ProcessRunner(command, dir); try { return Optional.of(runner.call()); } catch (Exception e) { log.error("Running command failed {}", Arrays.deepToString(command), e); } <START> return Optional.absent(); <END> }</code><technical_language>This slightly easier parse mentally if this return in catch block</technical_language>

Target:
private ProcessResult run(String[] command, Path dir) throws IOException, InterruptedException { ProcessRunner runner = new ProcessRunner(command, dir); return runner.call(); }
Source:
<code>public void rename(String oldNamespaceName, String newNamespaceName) throws AccumuloSecurityException, NamespaceNotFoundException, AccumuloException, NamespaceExistsException { checkArgument(oldNamespaceName.length() <= MAX_NAMESPACE_LEN, "Namespaces longer than 1024 characters" + "are no longer supported and may result in unexpected behavior"); checkArgument(newNamespaceName.length() <= MAX_TABLE_NAME_LEN, <START> "Namespace is longer than 1024 characters"); <END> List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldNamespaceName.getBytes(UTF_8)), ByteBuffer.wrap(newNamespaceName.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); doNamespaceFateOperation(FateOperation.NAMESPACE_RENAME, args, opts, oldNamespaceName); }</code><technical_language>suggestion "Namespace is longer "+MAX_NAMESPACE_LEN+" characters");</technical_language>

Target:
public void rename(String oldNamespaceName, String newNamespaceName) throws AccumuloSecurityException, NamespaceNotFoundException, AccumuloException, NamespaceExistsException { checkArgument(newNamespaceName.length() <= MAX_TABLE_NAME_LEN, "Namespace is longer than " + MAX_TABLE_NAME_LEN + " characters"); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldNamespaceName.getBytes(UTF_8)), ByteBuffer.wrap(newNamespaceName.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); doNamespaceFateOperation(FateOperation.NAMESPACE_RENAME, args, opts, oldNamespaceName); }
Source:
<code>public void testSmallIntervals(final File input, final String reference_name, final String useFastAlgorithm) throws IOException { final File outfile = File.createTempFile("testSmallIntervals", ".wgs_metrics",TEMP_OUTPUT_DIR); final File ref = new File(reference_name); final File intervals = new File(TEST_DIR, "smallIntervals.interval_list"); final int sampleSize = 1000; <START> final String[] args = new String[] { <END> "INPUT=" + input.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath(), "REFERENCE_SEQUENCE=" + ref.getAbsolutePath(), "INTERVALS=" + intervals.getAbsolutePath(), "SAMPLE_SIZE=" + sampleSize, "COVERAGE_CAP=" + 40000, "USE_FAST_ALGORITHM=" + useFastAlgorithm }; Assert.assertEquals(runPicardCommandLine(args), 0); final MetricsFile<WgsMetrics, Comparable<?>> output = new MetricsFile<>(); try (FileReader reader = new FileReader(outfile)) { output.read(reader); } for (final WgsMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.GENOME_TERRITORY, 1000); Assert.assertEquals(metrics.PCT_EXC_ADAPTER, 0D); Assert.assertEquals(metrics.PCT_EXC_MAPQ, 0.0); Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.0); Assert.assertEquals(metrics.PCT_EXC_UNPAIRED, 0.0); Assert.assertEquals(metrics.MEAN_COVERAGE, 1727.6, .1); Assert.assertEquals(metrics.SD_COVERAGE, 695.68, 0.1); Assert.assertEquals(metrics.FOLD_80_BASE_PENALTY, 1.59, 0.01); Assert.assertEquals(metrics.FOLD_90_BASE_PENALTY, 3.36, 0.01); Assert.assertTrue(Double.isNaN(metrics.FOLD_95_BASE_PENALTY)); } }</code><technical_language>unnecessary array creation suggestion final String[] args = {</technical_language>

Target:
public void testSmallIntervals(final File input, final String reference_name, final String useFastAlgorithm) throws IOException { final File outfile = getTempOutputFile("testSmallIntervals", ".wgs_metrics"); final File ref = new File(reference_name); final File intervals = new File(TEST_DIR, "smallIntervals.interval_list"); final int sampleSize = 1000; final String[] args = { "INPUT=" + input.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath(), "REFERENCE_SEQUENCE=" + ref.getAbsolutePath(), "INTERVALS=" + intervals.getAbsolutePath(), "SAMPLE_SIZE=" + sampleSize, "COVERAGE_CAP=" + 40000, "USE_FAST_ALGORITHM=" + useFastAlgorithm }; Assert.assertEquals(runPicardCommandLine(args), 0); final MetricsFile<WgsMetrics, Comparable<?>> output = new MetricsFile<>(); try (FileReader reader = new FileReader(outfile)) { output.read(reader); } for (final WgsMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.GENOME_TERRITORY, 1000); Assert.assertEquals(metrics.PCT_EXC_ADAPTER, 0D); Assert.assertEquals(metrics.PCT_EXC_MAPQ, 0.0); Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.0); Assert.assertEquals(metrics.PCT_EXC_UNPAIRED, 0.0); Assert.assertEquals(metrics.MEAN_COVERAGE, 1727.6, .1); Assert.assertEquals(metrics.SD_COVERAGE, 695.68, 0.1); Assert.assertEquals(metrics.FOLD_80_BASE_PENALTY, 1.59, 0.01); Assert.assertEquals(metrics.FOLD_90_BASE_PENALTY, 3.36, 0.01); Assert.assertTrue(Double.isNaN(metrics.FOLD_95_BASE_PENALTY)); } }
Source:
<code>public HostNetworkProviderModel() { <START> getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); getNetworkProviderType().setIsAvailable(provider != null); getNetworkProviderType().setSelectedItem(provider == null ? null : provider.getType()); boolean isNeutron = getNetworkProviderType().getSelectedItem() == ProviderType.OPENSTACK_NETWORK || getNetworkProviderType().getSelectedItem() == ProviderType.EXTERNAL_NETWORK; getNeutronAgentModel().init(isNeutron && provider != null ? provider : new Provider<>(), getNetworkProviderType().getSelectedItem()); getNeutronAgentModel().setIsAvailable(isNeutron); }); <END> getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }</code><technical_language>I understand init called always, this allows simplification of code, e.g.: public HostNetworkProviderModel() { getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); boolean providerIsAvailable = provider != null; ProviderType providerType = providerIsAvailable ? provider.getType() : null; getNetworkProviderType().setIsAvailable(providerIsAvailable); getNetworkProviderType().setSelectedItem(providerType); getNeutronAgentModel().init(providerIsAvailable ? provider : new Provider<>(), providerType); getNeutronAgentModel().setIsAvailable(providerIsAvailable); });</technical_language>

Target:
public HostNetworkProviderModel() { getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); boolean providerIsAvailable = provider != null; ProviderType providerType = providerIsAvailable ? provider.getType() : null; getNetworkProviderType().setIsAvailable(providerIsAvailable); getNetworkProviderType().setSelectedItem(providerType); getNeutronAgentModel().init(providerIsAvailable ? provider : new Provider<>(), providerType); getNeutronAgentModel().setIsAvailable(true); }); getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }
Source:
<code>public Construct exec(Target t, Environment env, Construct... args) throws ConfigRuntimeException { MCPlayer m = Static.GetPlayer(args[0].val(), t); int effect = Static.getInt32(args[1], t); if (effect < 1 || effect > m.getMaxEffect()) { throw new ConfigRuntimeException("Invalid effect ID recieved, must be from 1-" + m.getMaxEffect(), ExceptionType.RangeException, t); } int strength = Static.getInt32(args[2], t); int seconds = 30; boolean ambient = false; boolean particles = true; if (args.length >= 4) { seconds = Static.getInt32(args[3], t); } <START> if (args.length == 5) { <END> ambient = Static.getBoolean(args[4]); } if (args.length == 6) { particles = Static.getBoolean(args[5]); } Static.AssertPlayerNonNull(m, t); if (seconds == 0) { return CBoolean.get(m.removeEffect(effect)); } else { m.addEffect(effect, strength, seconds, ambient, particles, t); return CBoolean.TRUE; } }</code><technical_language>This needs changed, want read in args[4] if length is 5 6. Change args.length >= 5. Also, args.length >= 6 below, for good measure</technical_language>

Target:
public Construct exec(Target t, Environment env, Construct... args) throws ConfigRuntimeException { MCPlayer m = Static.GetPlayer(args[0].val(), t); int effect = Static.getInt32(args[1], t); if (effect < 1 || effect > m.getMaxEffect()) { throw new ConfigRuntimeException("Invalid effect ID recieved, must be from 1-" + m.getMaxEffect(), ExceptionType.RangeException, t); } int strength = Static.getInt32(args[2], t); int seconds = 30; boolean ambient = false; boolean particles = true; if (args.length >= 4) { seconds = Static.getInt32(args[3], t); } if (args.length >= 5) { ambient = Static.getBoolean(args[4]); } if (args.length == 6) { particles = Static.getBoolean(args[5]); } Static.AssertPlayerNonNull(m, t); if (seconds == 0) { return CBoolean.get(m.removeEffect(effect)); } else { m.addEffect(effect, strength, seconds, ambient, particles, t); return CBoolean.TRUE; } }
Source:
<code>protected VdcReturnValueBase convertToVdcReturnValueBase(final VDSReturnValue vdsReturnValue) { VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setSucceeded(false); returnValue.setActionReturnValue(vdsReturnValue.getReturnValue()); returnValue.setExecuteFailedMessages(new ArrayList<String>() {{ String failedMesssage = null; <START> VDS vds = getVdsDAO().get(vdsReturnValue.getVdsError().getVdsId()); <END> if (vds != null) { failedMesssage = vds.getName() + ":"; } add(failedMesssage == null ? vdsReturnValue.getVdsError().getMessage() : failedMesssage.concat(vdsReturnValue.getVdsError().getMessage())); }} ); return returnValue; }</code><technical_language>append vdsName in message calling this method? calling vdsReturnValue.getVdsError().getVdsId() - assumption vdsId is set for VdsErrors. is a valid assumption</technical_language>

Target:
protected VdcReturnValueBase convertToVdcReturnValueBase(final VDSReturnValue vdsReturnValue) { VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setSucceeded(false); returnValue.setActionReturnValue(vdsReturnValue.getReturnValue()); returnValue.setExecuteFailedMessages(new ArrayList<String>() { { add(vdsReturnValue.getVdsError().getMessage()); } }); return returnValue; }
Source:
<code>public Response getDeploymentCfg(@Context final Server server) { String workingDir = server.getConfiguration(MyriaSystemConfigKeys.WORKING_DIRECTORY); String description = server.getConfiguration(MyriaSystemConfigKeys.DESCRIPTION); String fileName = server.getConfiguration(MyriaSystemConfigKeys.DEPLOYMENT_FILE); <START> String deploymentFile = workingDir + "/" + description + "-files" + "/" + description + "/" + fileName; <END> return Response.ok(deploymentFile).build(); }</code><technical_language>[File.separatorChar](<LINK_0> here, of if Myria Windows other issues</technical_language>

Target:
public Response getDeploymentCfg(@Context final Server server) { String workingDir = server.getConfiguration(MyriaSystemConfigKeys.WORKING_DIRECTORY); String description = server.getConfiguration(MyriaSystemConfigKeys.DESCRIPTION); String fileName = server.getConfiguration(MyriaSystemConfigKeys.DEPLOYMENT_FILE); String deploymentFile = workingDir + File.separatorChar + description + "-files" + File.separatorChar + description + File.separatorChar + fileName; return Response.ok(deploymentFile).build(); }
Source:
<code><START> public void testGetPermissionsObjectWithChildren() throws Exception { <END> indexObjectsInTripleStore(rootObj, workObj, fileObj, unitObj, collObj); MvcResult result = mvc.perform(get("/acl/getPermissions/" + uuid)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String,Object> respMap = getMapFromResponse(result); assertRespMapHasRequiredFields(respMap, uuid); Map<String,Object> aclMap = (Map<String, Object>) respMap.get("accessControls"); assertHasCorrectAccessControls(aclMap, uuid); assertTrue(aclMap.containsKey("memberPermissions")); }</code><technical_language>This test verify children objects returned in response</technical_language>

Target:
public void testGetPermissionsObjectWithChildren() throws Exception { indexObjectsInTripleStore(rootObj, workObj, fileObj, unitObj, collObj); MvcResult result = mvc.perform(get("/acl/getPermissions/" + uuid)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String,Object> respMap = getMapFromResponse(result); assertRespMapHasRequiredFields(respMap, uuid); Map<String,Object> aclMap = (Map<String, Object>) respMap.get("accessControls"); assertHasCorrectAccessControls(aclMap, uuid); assertTrue(aclMap.containsKey("memberPermissions")); List<Map<String, Object>> memberPermissions = (List<Map<String, Object>>) aclMap.get("memberPermissions"); Map<String, Object> memPermsMap = memberPermissions.get(0); assertHasCorrectAccessControls(memPermsMap, fileObj.getPid().getId()); }
Source:
<code>public void createTest() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); String groupName = "testGroup1"; groupRest.setName(groupName); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(post("/api/eperson/groups") .content(mapper.writeValueAsBytes(groupRest)).contentType(contentType)) .andExpect(status().isCreated()) .andExpect(jsonPath("name", Matchers.containsString(groupName))); <START> } <END></code><technical_language>try retrieve created group GET call (this assure new object persisted)</technical_language>

Target:
public void createTest() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); String groupName = "testGroup1"; groupRest.setName(groupName); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(post("/api/eperson/groups") .content(mapper.writeValueAsBytes(groupRest)).contentType(contentType)) .andExpect(status().isCreated()); getClient(authToken).perform(get("/api/eperson/groups")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._embedded.groups", Matchers.containsInAnyOrder( GroupMatcher.matchGroupWithName(groupName), GroupMatcher.matchGroupWithName("Administrator"), GroupMatcher.matchGroupWithName("Anonymous")))); }
Source:
<code>public List<Script> getScriptList(HttpServletRequest request) { final String type = (String) request.getAttribute("type"); this.path = getPath(request); this.path = stripExtension(this.path); <START> org.geoserver.platform.resource.Resource dir = scriptMgr.script(path); <END> List<Script> scripts = Lists.newArrayList(); if (dir != null) { Filter<Resource> filter = type != null ? new Filter<org.geoserver.platform.resource.Resource>() { @Override public boolean accept(org.geoserver.platform.resource.Resource pathname) { return type.equalsIgnoreCase(FilenameUtils.getExtension(pathname.name())); } } : new Filter<org.geoserver.platform.resource.Resource>() { @Override public boolean accept(org.geoserver.platform.resource.Resource pathname) { return true; } }; for (org.geoserver.platform.resource.Resource f : Resources.list(dir, filter)) { if (path.equals("apps")) { org.geoserver.platform.resource.Resource mainScript = scriptMgr.findAppMainScript(f); if (mainScript != null) { String name = mainScript.path().substring( f.parent().path().length() + 1).replace("\\", "/"); scripts.add(new Script(name)); } } else if (path.equals("wps")) { if (f.getType() == Type.DIRECTORY) { String namespace = f.name(); List<org.geoserver.platform.resource.Resource> files = f.list(); for(org.geoserver.platform.resource.Resource file: files) { String name = namespace + ":" + file.name(); scripts.add(new Script(name)); } } else { String name = f.name(); scripts.add(new Script(name)); } } else { String name = f.name(); scripts.add(new Script(name)); } } } else { } return scripts; }</code><technical_language>need full package name anymore</technical_language>

Target:
public List<Script> getScriptList(HttpServletRequest request) { final String type = (String) request.getAttribute("type"); this.path = getPath(request); this.path = stripExtension(this.path); Resource dir = scriptMgr.script(path); List<Script> scripts = Lists.newArrayList(); if (dir != null) { Filter<Resource> filter = type != null ? new Filter<Resource>() { @Override public boolean accept(Resource pathname) { return type.equalsIgnoreCase(FilenameUtils.getExtension(pathname.name())); } } : new Filter<Resource>() { @Override public boolean accept(Resource pathname) { return true; } }; for (Resource f : Resources.list(dir, filter)) { if (path.equals("apps")) { Resource mainScript = scriptMgr.findAppMainScript(f); if (mainScript != null) { String name = mainScript.path().substring( f.parent().path().length() + 1).replace("\\", "/"); scripts.add(new Script(name)); } } else if (path.equals("wps")) { if (f.getType() == Type.DIRECTORY) { String namespace = f.name(); List<Resource> files = f.list(); for(Resource file: files) { String name = namespace + ":" + file.name(); scripts.add(new Script(name)); } } else { String name = f.name(); scripts.add(new Script(name)); } } else { String name = f.name(); scripts.add(new Script(name)); } } } return scripts; }
Source:
<code>public boolean isConfigured() { return configured; <START> } <END></code><technical_language>change private configured</technical_language>

Target:
protected boolean isConfigured() { return configured; }
Source:
<code>public void readNewFeeds (int currentPage, int recentPage, String feedUrl) { int j = 0; FeedConfig[] newFeeds = new FeedConfig[recentPage - currentPage + 1]; String url = feedUrl.substring(0, feedUrl.lastIndexOf('/') + 1); for (int i = currentPage; i <= recentPage; i++) { newFeeds[j] = new FeedConfig(url + Integer.toString(i), "/([0-9a-f-]*)\\?"); j++; } <START> this.setFeedConfigs(new FeedConfigs(new HashSet<>(Arrays.asList(newFeeds)))); <END> }</code><technical_language>CollectionUtils.singletoList</technical_language>

Target:
public void readNewFeeds (int currentPage, int recentPage, String feedUrl) { List<FeedConfig> newFeeds = new ArrayList<>(); String url = feedUrl.substring(0, feedUrl.lastIndexOf('/') + 1); for (int i = currentPage; i <= recentPage; i++) { newFeeds.add(new FeedConfig(url + Integer.toString(i), "/([0-9a-f-]*)\\?")); } this.setFeedConfigs(new FeedConfigs(new HashSet<>(newFeeds))); }
Source:
<code><START> public void close() { <END> appenders.forEach(OutputStreamAppender::stop); }</code><technical_language>methods pkg local</technical_language>

Target:
void close() { appenders.forEach(OutputStreamAppender::stop); }
Source:
<code>public void onFailed(Guid cmdId, List<Guid> childCmdIds) { <START> getCommand(cmdId).onStopVmsFailed(); <END> CommandCoordinatorUtil.removeAllCommandsInHierarchy(cmdId); }</code><technical_language>call endAction(). need set setTaskGroupSuccess true. ConvertVmCallback for reference</technical_language>

Target:
public void onFailed(Guid cmdId, List<Guid> childCmdIds) { RemoveVmPoolCommand<? extends VmPoolParametersBase> cmd = getCommand(cmdId); CommandCoordinatorUtil.removeAllCommandsInHierarchy(cmdId); cmd.getParameters().setTaskGroupSuccess(false); cmd.endAction(); }
Source:
<code><START> private void printPartitionRebalancingFully(Map<String, List<SupplyPartitionInfo>> supplyInfoMap) { <END> if (hasPartitonToLog(supplyInfoMap, false)) { log.info("Partitions weren't present in any history reservation: [" + supplyInfoMap.entrySet().stream().map(entry -> "[grp=" + entry.getKey() + " part=[" + S.compact(entry.getValue().stream() .filter(info -> !info.isHistoryReserved()) .map(info -> info.part()).collect(Collectors.toSet())) + "]]" ).collect(Collectors.joining(", ")) + ']'); } if (hasPartitonToLog(supplyInfoMap, true)) { log.info("Partitions were reserved, but maximum available counter is greater than demanded: [" + supplyInfoMap.entrySet().stream().map(entry -> "[grp=" + entry.getKey() + ' ' + entry.getValue().stream().filter(SupplyPartitionInfo::isHistoryReserved).map(info -> "[part=" + info.part() + ", minCntr=" + info.minCntr() + ", maxReserved=" + info.maxReserved() + ", maxReservedNodeId=" + info.maxReservedNodeId() + ']' ).collect(Collectors.joining(", ")) + ']' ).collect(Collectors.joining(", ")) + ']'); } }</code><technical_language>I suggest wrap printing code try - catch block avoid node failure if printing code errors</technical_language>

Target:
private void printPartitionRebalancingFully(Map<String, List<SupplyPartitionInfo>> supplyInfoMap) { try { if (hasPartitionToLog(supplyInfoMap, false)) { log.info("Partitions weren't present in any history reservation: [" + supplyInfoMap.entrySet().stream().map(entry -> "[grp=" + entry.getKey() + " part=[" + S.compact(entry.getValue().stream() .filter(info -> !info.isHistoryReserved()) .map(info -> info.part()).collect(Collectors.toSet())) + "]]" ).collect(Collectors.joining(", ")) + ']'); } if (hasPartitionToLog(supplyInfoMap, true)) { log.info("Partitions were reserved, but maximum available counter is greater than demanded: [" + supplyInfoMap.entrySet().stream().map(entry -> "[grp=" + entry.getKey() + ' ' + entry.getValue().stream().filter(SupplyPartitionInfo::isHistoryReserved).map(info -> "[part=" + info.part() + ", minCntr=" + info.minCntr() + ", maxReserved=" + info.maxReserved() + ", maxReservedNodeId=" + info.maxReservedNodeId() + ']' ).collect(Collectors.joining(", ")) + ']' ).collect(Collectors.joining(", ")) + ']'); } } catch (Exception e) { log.error("An error happened during printing partitions that have no history.", e); } }
Source:
<code>public static boolean isInteger(Class<?> instanceClass) { if (instanceClass.isPrimitive()) { try { return Integer.class.getField(TYPE).get(null).equals(instanceClass) || Long.class.getField(TYPE).get(null).equals(instanceClass) <START> || Short.class.getField(TYPE).get(null).equals(instanceClass); <END> } catch (final IllegalArgumentException ex) { Activator.logException(ex); } catch (final SecurityException ex) { Activator.logException(ex); } catch (final IllegalAccessException ex) { Activator.logException(ex); } catch (final NoSuchFieldException ex) { Activator.logException(ex); } } else if (BigInteger.class.isAssignableFrom(instanceClass)) { return true; } else if (Integer.class.isAssignableFrom(instanceClass)) { return true; } else if (Long.class.isAssignableFrom(instanceClass)) { return true; } else if (Short.class.isAssignableFrom(instanceClass)) { return true; } return false; }</code><technical_language>add byte support</technical_language>

Target:
public static boolean isInteger(Class<?> instanceClass) { if (instanceClass.isPrimitive()) { try { return Integer.class.getField(TYPE).get(null).equals(instanceClass) || Long.class.getField(TYPE).get(null).equals(instanceClass) || Short.class.getField(TYPE).get(null).equals(instanceClass) || Byte.class.getField(TYPE).get(null).equals(instanceClass); } catch (final IllegalArgumentException ex) { Activator.logException(ex); } catch (final SecurityException ex) { Activator.logException(ex); } catch (final IllegalAccessException ex) { Activator.logException(ex); } catch (final NoSuchFieldException ex) { Activator.logException(ex); } } else if (BigInteger.class.isAssignableFrom(instanceClass)) { return true; } else if (Integer.class.isAssignableFrom(instanceClass)) { return true; } else if (Long.class.isAssignableFrom(instanceClass)) { return true; } else if (Short.class.isAssignableFrom(instanceClass)) { return true; } else if (Byte.class.isAssignableFrom(instanceClass)) { return true; } return false; }
Source:
<code>public List<TrackInfo> getTrackInfo() { return <START> isConnected() ? getImpl().getTracks() : null; <END> }</code><technical_language>getTracks()</technical_language>

Target:
public List<TrackInfo> getTrackInfo() { return getTracks(); }
Source:
<code>public boolean getCheckValue(Iterable<T> items, SelectionModel selectionModel) { if (!items.iterator().hasNext()) { return false; } boolean allSelected = true; for (T entity : items) { if (!selectionModel.isSelected(entity)) { <START> allSelected = false; <END> } } return allSelected; }</code><technical_language>replace this "return false" instead of iterating remaining elements</technical_language>

Target:
public boolean getCheckValue(Iterable<T> items, SelectionModel selectionModel) { if (!items.iterator().hasNext()) { return false; } boolean allSelected = true; for (T entity : items) { if (!selectionModel.isSelected(entity)) { return false; } } return true; }
Source:
<code><START> public void handleResponse(RestRequest restRequest, RestResponseChannel restResponseChannel, <END> ReadableStreamChannel response, Exception exception) throws RestServiceException { if (isRunning()) { asyncHandlerWorker.handleResponse(restRequest, restResponseChannel, response, exception); } else { restServerMetrics.asyncRequestHandlerUnavailableError.inc(); throw new RestServiceException( "Requests cannot be handled because the AsyncRequestResponseHandler is not available", RestServiceErrorCode.ServiceUnavailable); } }</code><technical_language>caller provide RestResponseChannel here? RestRequest (or should) RestResponseChannel is, you? put burden caller allow for mistakes made</technical_language>

Target:
public void handleResponse(RestRequest restRequest, RestResponseChannel restResponseChannel, ReadableStreamChannel response, Exception exception) throws RestServiceException { if (isRunning()) { asyncHandlerWorker.submitResponse(restRequest, restResponseChannel, response, exception); } else { restServerMetrics.asyncRequestHandlerUnavailableError.inc(); throw new RestServiceException( "Requests cannot be handled because the AsyncRequestResponseHandler is not available", RestServiceErrorCode.ServiceUnavailable); } }
Source:
<code>private static MailmapResult parseNameAndEmail(String line, boolean allowEmptyEmail) { int left, right; left = <START> line.indexOf("<"); <END> if (left == -1) { return null; } right = line.indexOf(">", left + 1); if (right == -1) { return null; } if (!allowEmptyEmail && (left + 1 == right)) { return null; } String name = left == 0 ? null : line.substring(0, left - 1).trim(); String email = line.substring(left + 1, right); return new MailmapResult(name, email, line.substring(right + 1).trim()); }</code><technical_language>single quote this a Char</technical_language>

Target:
private static MailmapResult parseNameAndEmail(String line, boolean allowEmptyEmail) { int left, right; left = line.indexOf('<'); if (left == -1) { return null; } right = line.indexOf('>', left + 1); if (right == -1) { return null; } if (!allowEmptyEmail && (left + 1 == right)) { return null; } String name = left == 0 ? null : line.substring(0, left - 1).trim(); String email = line.substring(left + 1, right); return new MailmapResult(name, email, line.substring(right + 1).trim()); }
Source:
<code>public boolean isExecutable() { <START> return getModelObject() != null && getModelObject().getId() != null; <END> }</code><technical_language>I this executable if review is open</technical_language>

Target:
public boolean isExecutable() { IReview review = ((ReviewDetailSection) getContext()).getReview(); ReviewStatus currentStatus = review.getState(); return getModelObject() != null && getModelObject().getId() != null && currentStatus != ReviewStatus.ABANDONED && currentStatus != ReviewStatus.MERGED; }
Source:
<code>public ArrayLiteralTreeImpl newArrayLiteralWithElements(Optional<List<InternalSyntaxToken>> commaTokens, ExpressionTree element, Optional<List<Tuple<List<InternalSyntaxToken>, ExpressionTree>>> restElements, Optional<List<InternalSyntaxToken>> restCommas ) { List<Tree> elementsAndCommas = Lists.newArrayList(); if (commaTokens.isPresent()) { for (InternalSyntaxToken comma : commaTokens.get()) { elementsAndCommas.add(comma); } } elementsAndCommas.add(element); if (restElements.isPresent()) { for (Tuple<List<InternalSyntaxToken>, ExpressionTree> t : restElements.get()) { elementsAndCommas.add(t.first().get(0)); t.first().remove(0); for (InternalSyntaxToken comma : t.first()) { <START> elementsAndCommas.add(comma); <END> } elementsAndCommas.add(t.second()); } } if (restCommas.isPresent()) { int nbEndingComma = restCommas.get().size(); elementsAndCommas.add(restCommas.get().get(0)); if (nbEndingComma > 1) { for (InternalSyntaxToken comma : restCommas.get().subList(1, nbEndingComma)) { elementsAndCommas.add(comma); } } } return new ArrayLiteralTreeImpl(elementsAndCommas); }</code><technical_language>@vilchik-elena elementsAndCommas.addAll(t.first())</technical_language>

Target:
public ArrayLiteralTreeImpl newArrayLiteralWithElements(Optional<List<InternalSyntaxToken>> commaTokens, ExpressionTree element, Optional<List<Tuple<List<InternalSyntaxToken>, ExpressionTree>>> restElements, Optional<List<InternalSyntaxToken>> restCommas ) { List<Tree> elementsAndCommas = Lists.newArrayList(); if (commaTokens.isPresent()) { elementsAndCommas.addAll(commaTokens.get()); } elementsAndCommas.add(element); if (restElements.isPresent()) { for (Tuple<List<InternalSyntaxToken>, ExpressionTree> t : restElements.get()) { elementsAndCommas.addAll(t.first()); elementsAndCommas.add(t.second()); } } if (restCommas.isPresent()) { elementsAndCommas.addAll(restCommas.get()); } return new ArrayLiteralTreeImpl(elementsAndCommas); }
Source:
<code>protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; <START> AttributeRenderer<? super Object> r = scope.st.impl.nativeGroup.getAttributeRenderer(o.getClass()); <END> String v; if ( r!=null ) v = r.toString(o, formatString, locale); else v = o.toString(); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }</code><technical_language>a fan of this. is inaccurate representation of types involved. recommendation is extract code initializes v a new helper method: private <T> String renderObject(InstanceScope scope, String formatString, Object o, Class<T> attributeType) { AttributeRenderer<? super T> r = scope.st.impl.nativeGroup.getAttributeRenderer(attributeType); if ( r!=null ) { return r.toString(attributeType.cast(o), formatString, locale); } else { return o.toString(); } } update this method define initialize v following: String v = renderObject(scope, formatString, o, o.getClass());</technical_language>

Target:
protected int writePOJO(STWriter out, InstanceScope scope, Object o, String[] options) throws IOException { String formatString = null; if ( options!=null ) formatString = options[Option.FORMAT.ordinal()]; String v = renderObject(scope, formatString, o, o.getClass()); int n; if ( options!=null && options[Option.WRAP.ordinal()]!=null ) { n = out.write(v, options[Option.WRAP.ordinal()]); } else { n = out.write(v); } return n; }
Source:
<code>public void processMatcher(ViatraQueryMatcher<?> matcher, QueryEvaluationHint hint) throws ViatraQueryException, QueryProcessingException { <START> if (hint.getQueryBackendFactory() instanceof ReteBackendFactory) { <END> ReteNetworkTrace trace = new ReteNetworkTrace(matcher, traceCollector); CoverageInfo<Node> reteCoverage = new ReteCoverage(matcher).reteCoverage(); CoverageInfo<PTraceable> newCoverage = trace.traceCoverage(matcher, reteCoverage); coverage = coverage.mergeWith(newCoverage); } }</code><technical_language>I this is correct. E.g., if a Rete matcher initialized, a matcher created LS hints, resulting backend Rete backend. matcher#getCapabilities instead</technical_language>

Target:
public void processMatcher(ViatraQueryMatcher<?> matcher, QueryEvaluationHint hint) throws ViatraQueryException, QueryProcessingException { if (matcher instanceof BaseMatcher) { BaseMatcher<?> baseMatcher = (BaseMatcher<?>) matcher; if (baseMatcher.getCapabilities() instanceof IncrementalMatcherCapability) { ReteNetworkTrace trace = new ReteNetworkTrace(matcher, traceCollector); CoverageInfo<Node> reteCoverage = new ReteCoverage(matcher).reteCoverage(); CoverageInfo<PTraceable> newCoverage = trace.traceCoverage(matcher, reteCoverage); coverage = coverage.mergeWith(newCoverage); } } }
Source:
<code>public Collection<GrantedAuthority> getAuthorities() { List<GrantedAuthority> roles = new ArrayList<>(1); <START> roles.add(new SimpleGrantedAuthority(getUser().getRole().getShortName())); <END> return roles; }</code><technical_language>return List.of(new SimpleGrantedAuthority(getUser().getRole().getShortName()))</technical_language>

Target:
public Collection<GrantedAuthority> getAuthorities() { return ImmutableList.of(new SimpleGrantedAuthority(getUser().getRole().getShortName())); }
Source:
<code>public static void writeClusterJob(@NotNull final CassandraCluster cluster, @NotNull final JsonGenerator json, @NotNull final String name, @Nullable final ClusterJobStatus jobStatus) throws IOException { if (jobStatus != null && jobStatus.hasJobType()) { json.writeObjectFieldStart(name); json.writeStringField("type", jobStatus.getJobType().name()); json.writeNumberField("started", jobStatus.getStartedTimestamp()); if (jobStatus.hasFinishedTimestamp()) { json.writeNumberField("finished", jobStatus.getFinishedTimestamp()); } else { json.writeNullField("finished"); } json.writeBooleanField("aborted", jobStatus.getAborted()); json.writeArrayFieldStart("remainingNodes"); for (final String node : jobStatus.getRemainingNodesList()) { json.writeString(node); } json.writeEndArray(); if (jobStatus.hasCurrentNode()) { json.writeObjectFieldStart("currentNode"); writeNodeJobStatus(cluster, json, jobStatus.getCurrentNode()); } else { json.writeNullField("currentNode"); } json.writeArrayFieldStart("completedNodes"); for (final NodeJobStatus nodeJobStatus : jobStatus.getCompletedNodesList()) { json.writeStartObject(); writeNodeJobStatus(cluster, json, nodeJobStatus); } json.writeEndArray(); <START> if (jobStatus.hasData()) json.writeStringField("data", jobStatus.getData()); <END> json.writeEndObject(); } else { json.writeNullField(name); } }</code><technical_language>Rename this json property renaming proto property</technical_language>

Target:
public static void writeClusterJob(@NotNull final CassandraCluster cluster, @NotNull final JsonGenerator json, @NotNull final String name, @Nullable final ClusterJobStatus jobStatus) throws IOException { if (jobStatus != null && jobStatus.hasJobType()) { json.writeObjectFieldStart(name); json.writeStringField("type", jobStatus.getJobType().name()); json.writeNumberField("started", jobStatus.getStartedTimestamp()); if (jobStatus.hasFinishedTimestamp()) { json.writeNumberField("finished", jobStatus.getFinishedTimestamp()); } else { json.writeNullField("finished"); } json.writeBooleanField("aborted", jobStatus.getAborted()); json.writeArrayFieldStart("remainingNodes"); for (final String node : jobStatus.getRemainingNodesList()) { json.writeString(node); } json.writeEndArray(); if (jobStatus.hasCurrentNode()) { json.writeObjectFieldStart("currentNode"); writeNodeJobStatus(cluster, json, jobStatus.getCurrentNode()); } else { json.writeNullField("currentNode"); } json.writeArrayFieldStart("completedNodes"); for (final NodeJobStatus nodeJobStatus : jobStatus.getCompletedNodesList()) { json.writeStartObject(); writeNodeJobStatus(cluster, json, nodeJobStatus); } json.writeEndArray(); if (jobStatus.hasBackupName()) json.writeStringField("backupName", jobStatus.getBackupName()); json.writeEndObject(); } else { json.writeNullField(name); } }