auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static IClasspathEntry newJrtEntry(IPath javaHome, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported) { if (accessRules == null || accessRules.length==0) { accessRules = ClasspathEntry.NO_ACCESS_RULES; } if (extraAttributes == null || extraAttributes.length==0) { extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES; } return new ClasspathEntry( IPackageFragmentRoot.K_BINARY, IClasspathEntry.CPE_JRT_SYSTEM, javaHome, ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE, sourceAttachmentPath, sourceAttachmentRootPath, null, <START> false, <END> accessRules, true, extraAttributes); }</code><technical_language>'isExported'</technical_language>

Target:
public static IClasspathEntry newJrtEntry(IPath javaHome, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported) { if (accessRules == null || accessRules.length==0) { accessRules = ClasspathEntry.NO_ACCESS_RULES; } if (extraAttributes == null || extraAttributes.length==0) { extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES; } return new ClasspathEntry( IPackageFragmentRoot.K_BINARY, IClasspathEntry.CPE_JRT_SYSTEM, javaHome, ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE, sourceAttachmentPath, sourceAttachmentRootPath, null, isExported, accessRules, true, extraAttributes); }
Source:
<code>boolean doTCPCheckMember(ID suspectMember, int port, boolean retryIfConnectFails) { Socket clientSocket = null; long giveupTime = System.currentTimeMillis() + services.getConfig().getMemberTimeout(); boolean passed = false; int iteration = 0; do { iteration++; if (iteration > 1) { try { Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } try { logger.debug("Checking member with TCP socket connection {}:{}.", suspectMember, suspectMember.getInetAddress(), port); clientSocket = socketCreator.forAdvancedUse() .connect(new HostAndPort(suspectMember.getHostName(), port), (int) memberTimeout, new ConnectTimeoutTask(services.getTimer(), memberTimeout), false, -1, false); clientSocket.setTcpNoDelay(true); passed = doTCPCheckMember(suspectMember, clientSocket); } catch (IOException e) { } finally { try { if (clientSocket != null) { <START> clientSocket.setSoLinger(true, 0); END> clientSocket.close(); } } catch (IOException e) { } } } while (retryIfConnectFails && !passed && !this.isShutdown() && System.currentTimeMillis() < giveupTime); return passed; }</code><technical_language>Good riddance</technical_language>

Target:
boolean doTCPCheckMember(ID suspectMember, int port, boolean retryIfConnectFails) { Socket clientSocket = null; long giveupTime = System.currentTimeMillis() + services.getConfig().getMemberTimeout(); boolean passed = false; int iteration = 0; do { iteration++; if (iteration > 1) { try { Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } } try { logger.debug("Checking member with TCP socket connection {}:{}.", suspectMember, suspectMember.getInetAddress(), port); clientSocket = socketCreator.forAdvancedUse() .connect(new HostAndPort(suspectMember.getHostName(), port), (int) memberTimeout, new ConnectTimeoutTask(services.getTimer(), memberTimeout), false, -1, false); clientSocket.setTcpNoDelay(true); passed = doTCPCheckMember(suspectMember, clientSocket); } catch (IOException e) { } catch (IllegalStateException e) { if (!isStopping) { logger.trace("Unexpected exception", e); } } finally { try { if (clientSocket != null) { clientSocket.setSoLinger(true, 0); clientSocket.close(); } } catch (IOException e) { } } } while (retryIfConnectFails && !passed && !this.isShutdown() && System.currentTimeMillis() < giveupTime); return passed; }
Source:
<code><START> private static File getFileFromClassLoaderBeforeLuna(String filename, ClassLoader classLoader) throws IOException { <END> String AssertionFailedErrorMessage = "no file found " + filename; try { Object classpathManager = MethodUtils.invokeExactMethod(classLoader, "getClasspathManager", null); if (classpathManager != null) { Object baseData = MethodUtils.invokeExactMethod(classpathManager, "getBaseData", null); if (baseData != null) { Object bundle = MethodUtils.invokeExactMethod(baseData, "getBundle", null); if (bundle != null) { Object entry = MethodUtils.invokeExactMethod(bundle, "getEntry", String.class); if (entry != null) { URL localURL = FileLocator.toFileURL((URL) entry); return new File(localURL.getFile()); } } } } } catch (NoSuchMethodException e) { AssertionFailedErrorMessage = "got NoSuchMethodException " + e.getMessage(); } catch (IllegalAccessException e) { AssertionFailedErrorMessage = "got IllegalAccessException " + e.getMessage(); } catch (InvocationTargetException e) { AssertionFailedErrorMessage = "got InvocationTargetException " + e.getMessage(); } throw new AssertionFailedError(AssertionFailedErrorMessage); }</code><technical_language>This logic is (on left). Is expected? wrong current approach</technical_language>

Target:
private static File getFileFromClassLoaderBeforeLuna(String filename, ClassLoader classLoader) throws Exception { Object classpathManager = MethodUtils.invokeExactMethod(classLoader, "getClasspathManager", null); Object baseData = MethodUtils.invokeExactMethod(classpathManager, "getBaseData", null); Object bundle = MethodUtils.invokeExactMethod(baseData, "getBundle", null); Object entry = MethodUtils.invokeExactMethod(bundle, "getEntry", String.class); URL localURL = FileLocator.toFileURL((URL) entry); return new File(localURL.getFile()); }
Source:
<code>public void executeSave() { QosParametersBase<NetworkQoS> parameters = new QosParametersBase<NetworkQoS>(); <START> parameters.setQosId(networkQoS.getId()); <END> parameters.setQos(networkQoS); Frontend.getInstance().runAction(VdcActionType.UpdateNetworkQoS, parameters, new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result1) { VdcReturnValueBase retVal = result1.getReturnValue(); boolean succeeded = false; if (retVal != null && retVal.getSucceeded()) { succeeded = true; } postSaveAction(succeeded); } }); }</code><technical_language>need set ID separately QoS QoS entity contains ID</technical_language>

Target:
public void executeSave() { QosParametersBase<NetworkQoS> parameters = new QosParametersBase<NetworkQoS>(); parameters.setQos(networkQoS); Frontend.getInstance().runAction(VdcActionType.UpdateNetworkQoS, parameters, new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result1) { VdcReturnValueBase retVal = result1.getReturnValue(); boolean succeeded = false; if (retVal != null && retVal.getSucceeded()) { succeeded = true; } postSaveAction(succeeded); } }); }
Source:
<code>private void validateJoinInputStreamPartitions(JobGraph jobGraph) { Multimap<JoinOperatorSpec, InputOperatorSpec> joinOpSpecToInputOpSpecs = OperatorSpecGraphAnalyzer.getJoinedInputOperatorSpecs(jobGraph.getSpecGraph()); List<JoinedStreamsGroup> joinedStreamsGroups = new ArrayList<>(); for (JoinOperatorSpec joinOpSpec : joinOpSpecToInputOpSpecs.keySet()) { Collection<InputOperatorSpec> joinedInputOpSpecs = joinOpSpecToInputOpSpecs.get(joinOpSpec); JoinedStreamsGroup joinedStreamsGroup = getJoinedStreamsGroup(joinOpSpec.getOpId(), joinedInputOpSpecs, jobGraph); joinedStreamsGroups.add(joinedStreamsGroup); } Collections.sort(joinedStreamsGroups, Comparator.comparing(JoinedStreamsGroup::getCategory)); <START> joinedStreamsGroups.forEach(ExecutionPlanner::validateJoinedStreamsGroupPartitions); <END> }</code><technical_language>validate is "assigning" partition counts.. cleaner separate out computation of partition-counts validation? example, computing of partition-counts depends order in process StreamEdgeGroups while validation not</technical_language>

Target:
private void validateJoinInputStreamPartitions(JobGraph jobGraph) { Multimap<JoinOperatorSpec, InputOperatorSpec> joinOpSpecToInputOpSpecs = OperatorSpecGraphAnalyzer.getJoinToInputOperatorSpecs(jobGraph.getSpecGraph()); List<StreamEdgeSet> streamEdgeSets = new ArrayList<>(); for (JoinOperatorSpec joinOpSpec : joinOpSpecToInputOpSpecs.keySet()) { Collection<InputOperatorSpec> joinedInputOpSpecs = joinOpSpecToInputOpSpecs.get(joinOpSpec); StreamEdgeSet streamEdgeSet = getStreamEdgeSet(joinOpSpec.getOpId(), joinedInputOpSpecs, jobGraph); streamEdgeSets.add(streamEdgeSet); } Collections.sort(streamEdgeSets, Comparator.comparingInt(e -> e.getCategory().getSortOrder())); streamEdgeSets.forEach(ExecutionPlanner::validateAndAssignStreamEdgeSetPartitions); }
Source:
<code>public void testAMeetingCannotBeCreatedWithoutOrganizer() { ExcelReader excelReader = new ExcelReader(EXCEL_INPUT_DATA); List<Map<String, String>> meetingData = excelReader.getMapValues("MeetingData"); String subject = meetingData.get(0).get("Subject"); String startTime = meetingData.get(0).get("Start time"); String endTime = meetingData.get(0).get("End time"); String attendee = meetingData.get(0).get("Attendee"); String body = meetingData.get(0).get("Body"); HomeTabletPage homeTabletPage = new HomeTabletPage(); SchedulePage schedulePage = homeTabletPage.clickScheduleBtn(); schedulePage.setSubjectTxtBox(subject) <START> .setStartTimeDate(startTime) <END> .setEndTimeDate(endTime) .setAttendeeTxtBoxPressingEnter(attendee) .setBodyTxtBox(body) .clickCreateBtn(); Assert.assertTrue(schedulePage.isErrorOrganizerLblDisplayed()); }</code><technical_language>steps 35, 36 38 neccesary</technical_language>

Target:
public void testAMeetingCannotBeCreatedWithoutOrganizer() { ExcelReader excelReader = new ExcelReader(EXCEL_INPUT_DATA); List<Map<String, String>> meetingData = excelReader.getMapValues("MeetingData"); String subject = meetingData.get(0).get("Subject"); String attendee = meetingData.get(0).get("Attendee"); String body = meetingData.get(0).get("Body"); HomeTabletPage homeTabletPage = new HomeTabletPage(); SchedulePage schedulePage = homeTabletPage.clickScheduleBtn(); schedulePage.setSubjectTxtBox(subject) .setAttendeeTxtBoxPressingEnter(attendee) .setBodyTxtBox(body) .clickCreateBtn(); Assert.assertTrue(schedulePage.isErrorOrganizerLblDisplayed()); }
Source:
<code>private static void checkRegisterNativeAllocation() throws Exception { long maxMem = Runtime.getRuntime().maxMemory(); int size = (int)(maxMem / 32); int allocationCount = 256; int <START> maxExpectedGcDurationMs = <END> 2000; ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); ref = allocPhantom(queue); long total = 0; for (int i = 0; !ref.isEnqueued() && i < allocationCount; ++i) { runtime.registerNativeAllocation(size); total += size; Thread.sleep(MAX_EXPECTED_GC_DURATION_MS / allocationCount); } if (queue.remove(MAX_EXPECTED_GC_DURATION_MS) == null) { throw new RuntimeException("GC failed to complete"); } while (total > 0) { runtime.registerNativeFree(size); total -= size; } }</code><technical_language>remove</technical_language>

Target:
private static void checkRegisterNativeAllocation() throws Exception { long maxMem = Runtime.getRuntime().maxMemory(); int size = (int)(maxMem / 32); int allocationCount = 256; ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); ref = allocPhantom(queue); long total = 0; for (int i = 0; !ref.isEnqueued() && i < allocationCount; ++i) { runtime.registerNativeAllocation(size); total += size; Thread.sleep(MAX_EXPECTED_GC_DURATION_MS / allocationCount); } if (queue.remove(MAX_EXPECTED_GC_DURATION_MS) == null) { throw new RuntimeException("GC failed to complete"); } while (total > 0) { runtime.registerNativeFree(size); total -= size; } }
Source:
<code>public @Nonnull String filter(@Nonnull String input) { ContentMappings mappings = ContentMappings.get(); Matcher m = IP_ADDRESS.matcher(input); List<String> searchList = new ArrayList<>(); List<String> replacementList = new ArrayList<>(); while (m.find()) { String ip = m.group(); if (!mappings.getStopWords().contains(ip)) { ContentMapping map = mappings.getMappingOrCreate(ip, InetAddressContentFilter::newMapping); searchList.add(ip); replacementList.add(map.getReplacement()); } } String filtered = input; if (!searchList.isEmpty()) { <START> filtered = StringUtils.replaceEach(input, searchList.toArray(new String[]{}), replacementList.toArray(new String[]{})); <END> } return filtered; }</code><technical_language>suggestion filtered = StringUtils.replaceEach(input, searchList.toArray(new String[0]), replacementList.toArray(new String[0]));</technical_language>

Target:
public @Nonnull String filter(@Nonnull String input) { ContentMappings mappings = ContentMappings.get(); Matcher m = IP_ADDRESS.matcher(input); List<String> searchList = new ArrayList<>(); List<String> replacementList = new ArrayList<>(); while (m.find()) { String ip = m.group(); if (!mappings.getStopWords().contains(ip)) { ContentMapping map = mappings.getMappingOrCreate(ip, InetAddressContentFilter::newMapping); searchList.add(ip); replacementList.add(map.getReplacement()); } } String filtered = input; if (!searchList.isEmpty()) { filtered = StringUtils.replaceEach(input, searchList.toArray(new String[0]), replacementList.toArray(new String[0])); } return filtered; }
Source:
<code>public Object configure() throws Exception { Class<?> oClass = nodeClass(_root); String id = _root.getAttribute("id"); Object obj = id == null ? null : _configuration.getIdMap().get(id); int index = 0; if (obj == null && oClass != null) { try { obj = construct(oClass, new Args(null, oClass, XmlConfiguration.getNodes(_root, "Arg"))); } catch (NoSuchMethodException x) { throw new IllegalStateException(String.format("No matching constructor %s in %s", oClass, _configuration)); } } else { XmlConfiguration.getNodes(_root, "Arg") <START> .forEach((node) -> LOG.warn("Ignored arg in {}", node, this._configuration._location)); <END> } if (id != null) _configuration.getIdMap().put(id, obj); _configuration.initializeDefaults(obj); configure(obj, _root, index); return obj; }</code><technical_language>I increment index variable Arg is</technical_language>

Target:
public Object configure() throws Exception { Class<?> oClass = nodeClass(_root); String id = _root.getAttribute("id"); Object obj = id == null ? null : _configuration.getIdMap().get(id); AttrOrElementNode aoeNode; if (obj == null && oClass != null) { aoeNode = new AttrOrElementNode(_root, "Arg"); try { obj = construct(oClass, new Args(null, oClass, aoeNode.getNodes("Arg"))); } catch (NoSuchMethodException x) { throw new IllegalStateException(String.format("No matching constructor %s in %s", oClass, _configuration)); } } else { aoeNode = new AttrOrElementNode(obj, _root, "Arg"); aoeNode.getNodes("Arg") .forEach((node) -> LOG.warn("Ignored arg in {}", node, this._configuration._location)); } if (id != null) _configuration.getIdMap().put(id, obj); _configuration.initializeDefaults(obj); configure(obj, _root, aoeNode.getNext()); return obj; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { <START> if (inputSchema.getField(config.messageField) != null) { <END> throw new IllegalArgumentException(String.format( "Input schema already contains message field %s. Please set messageField to a different value.", config.messageField)); } if (inputSchema.getField(config.codeField) != null) { throw new IllegalArgumentException(String.format( "Input schema already contains code field %s. Please set codeField to a different value.", config.codeField)); } if (inputSchema.getField(config.stageField) != null) { throw new IllegalArgumentException(String.format( "Input schema already contains stage field %s. Please set stageField to a different value.", config.stageField)); } Schema outputSchema = getOutputSchema(config, inputSchema); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); } }</code><technical_language>this produce NPE if config.messageField is set? for next</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { if (config.messageField != null && inputSchema.getField(config.messageField) != null) { throw new IllegalArgumentException(String.format( "Input schema already contains message field %s. Please set messageField to a different value.", config.messageField)); } if (config.codeField != null && inputSchema.getField(config.codeField) != null) { throw new IllegalArgumentException(String.format( "Input schema already contains code field %s. Please set codeField to a different value.", config.codeField)); } if (config.stageField != null && inputSchema.getField(config.stageField) != null) { throw new IllegalArgumentException(String.format( "Input schema already contains stage field %s. Please set stageField to a different value.", config.stageField)); } Schema outputSchema = getOutputSchema(config, inputSchema); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); } }
Source:
<code>public void run() { try { _task.acquire(); Integer lineNo = loadCheckpoint(); while (!_cancelRequested) { String text; try { text = _fileReader.readLine(); } catch (IOException e) { throw new RuntimeException("Reading file failed.", e); } if (text != null) { DatastreamEvent event = new DatastreamEvent(); event.payload = ByteBuffer.wrap(text.getBytes()); event.key = ByteBuffer.allocate(0); event.metadata = new HashMap<>(); <START> event.metadata.put("SchemaId", _producer.registerSchema(null)); <END> event.previous_payload = ByteBuffer.allocate(0); LOG.info("sending event " + text); _producer.send(new DatastreamEventRecord(event, 0, lineNo.toString())); LOG.info("Sending event succeeded"); ++lineNo; } else { try { Thread.sleep(POLL_WAIT_MS); } catch (InterruptedException e) { _isStopped = true; LOG.info("Stopped at line " + lineNo); } } } _task.release(); _isStopped = true; LOG.info("Stopped at line " + lineNo); } catch (Throwable e) { LOG.error("File processor is quitting with exception ", e); } }</code><technical_language>consistent, "PayloadSchemaId"? In future figure out a provide unified access some of standard metadata</technical_language>

Target:
public void run() { try { _task.acquire(); Integer lineNo = loadCheckpoint(); while (!_cancelRequested) { String text; try { text = _fileReader.readLine(); } catch (IOException e) { throw new RuntimeException("Reading file failed.", e); } if (text != null) { DatastreamEvent event = new DatastreamEvent(); event.payload = ByteBuffer.wrap(text.getBytes()); event.key = ByteBuffer.allocate(0); event.metadata = new HashMap<>(); event.metadata.put("PayloadSchemaId", _producer.registerSchema(null)); event.previous_payload = ByteBuffer.allocate(0); LOG.info("sending event " + text); _producer.send(new DatastreamEventRecord(event, 0, lineNo.toString())); LOG.info("Sending event succeeded"); ++lineNo; } else { try { Thread.sleep(POLL_WAIT_MS); } catch (InterruptedException e) { _isStopped = true; LOG.info("Stopped at line " + lineNo); } } } _task.release(); _isStopped = true; LOG.info("Stopped at line " + lineNo); } catch (Throwable e) { LOG.error("File processor is quitting with exception ", e); } }
Source:
<code><START> AbstractIcon getSelectedItem() { <END> return imageList.getSelectedValue(); }</code><technical_language>line split</technical_language>

Target:
public @Nullable AbstractIcon getSelectedItem() { return imageList.getSelectedValue(); }
Source:
<code>public Chain getAndAppend(long key, ByteBuffer payLoad) { try { EhcacheEntityResponse response = entity.invoke(EhcacheEntityMessage.getAndAppendOperation(cacheId, key, payLoad), true); if (response != null && response.getType() == EhcacheEntityResponse.Type.GET_RESPONSE) { return ((EhcacheEntityResponse.GetResponse)response).getChain(); <START> } <END> } catch (Exception e) { unwrapException(e, StoreAccessException.class); } return null; }</code><technical_language>else?</technical_language>

Target:
public Chain getAndAppend(long key, ByteBuffer payLoad) { EhcacheEntityResponse response; try { response = entity.invoke(EhcacheEntityMessage.getAndAppendOperation(cacheId, key, payLoad), true); } catch (Exception e) { throw new ServerStoreProxyException(e); } if (response != null && response.getType() == EhcacheEntityResponse.Type.GET_RESPONSE) { return ((EhcacheEntityResponse.GetResponse)response).getChain(); } else { throw new ServerStoreProxyException("Response for getAndAppend operation was invalid : " + response != null ? response.getType().toString() : "null message"); } }
Source:
<code>public Number getInternalValue(Number number) { BigDecimal value = new BigDecimal(number.toString()); ChartRange internal = getInternal(); ChartRange external = getExternal(); System.out.println(external.getMinimum()); System.out.println(external.getMaximum()); <START> System.out.println(external.getDelta()); <END> BigDecimal internalValue = value .subtract(external.getMinimum()) .multiply(internal.getDelta()) .divide(external.getDelta(), BIG_DECIMAL_DIVISION_SCALE, BigDecimal.ROUND_DOWN) .add(internal.getMinimum()); return checkNotNull(internalValue); }</code><technical_language>Remove 3 lines</technical_language>

Target:
public Number getInternalValue(Number number) { BigDecimal value = new BigDecimal(number.toString()); ChartRange internal = getInternal(); ChartRange external = getExternal(); BigDecimal internalValue = value .subtract(external.getMinimum()) .multiply(internal.getDelta()) .divide(external.getDelta(), BIG_DECIMAL_DIVISION_SCALE, BigDecimal.ROUND_DOWN) .add(internal.getMinimum()); return checkNotNull(internalValue); }
Source:
<code>public void savetofile(String f) { Writer writer = null; JAXBContext jc; try { jc = JAXBContext.newInstance(envelope.class); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(f), "utf-8")); marshaller.marshal(envel, writer); } catch (PropertyException e) { <START> e.printStackTrace(); <END> } catch (JAXBException e) { e.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { try { writer.close(); } catch (Exception ex) { } } }</code><technical_language>please remove TODO - please propper logging instead of printStackTrace()</technical_language>

Target:
public void savetofile(String f) { Writer writer = null; JAXBContext jc; try { jc = JAXBContext.newInstance(envelope.class); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(f), "utf-8")); marshaller.marshal(envel, writer); } catch (PropertyException e) { logger.error("error in xml processing - save file",e); } catch (JAXBException e) { logger.error("error in xml processing - save file",e); } catch (IOException ex) { logger.error("error in xml processing - save file",ex); } finally { try { writer.close(); } catch (Exception ex) { } } }
Source:
<code>public InetSocketAddress resolve(String name, boolean ipv6, boolean local) { int delimiter = name.lastIndexOf(':'); if (delimiter < 0) { throw new IllegalArgumentException(name); } String addrStr = name.substring(0, delimiter); String portStr = name.substring(delimiter + 1); if (addrStr.length() >= 2 && addrStr.charAt(0) == '[' && addrStr.charAt(addrStr.length() - 1) == ']') { addrStr = addrStr.substring(1, addrStr.length() - 1); } int port; if (portStr.equals("*") || portStr.equals("0")) { port = 0; } else { port = Integer.parseInt(portStr); if (port == 0) { throw new IllegalArgumentException(name); } } InetAddress addrNet = null; if (addrStr.equals("*")) { addrStr = ipv6 ? "::" : "0.0.0.0"; } try { InetAddress[] addresses = InetAddress.getAllByName(addrStr); if (ipv6) { <START> addrNet = Arrays.stream(InetAddress.getAllByName(addrStr)).filter(i -> i instanceof Inet6Address).findFirst().orElseGet(() -> addresses[0]); <END> } else { addrNet = Arrays.stream(InetAddress.getAllByName(addrStr)).filter(i -> i instanceof Inet4Address).findFirst().orElseGet(() -> null); } } catch (UnknownHostException e) { throw new ZMQException(e.getMessage(), ZError.EADDRNOTAVAIL, e); } if (addrNet == null) { throw new ZMQException(addrStr + " not found matching IPv4/IPv6 settings", ZError.EADDRNOTAVAIL); } return new InetSocketAddress(addrNet, port); }</code><technical_language>InetAddress.getAllByName(addrStr) equivalent addresses here</technical_language>

Target:
public InetSocketAddress resolve(String name, boolean ipv6, boolean local) { int delimiter = name.lastIndexOf(':'); if (delimiter < 0) { throw new IllegalArgumentException(name); } String addrStr = name.substring(0, delimiter); String portStr = name.substring(delimiter + 1); if (addrStr.length() >= 2 && addrStr.charAt(0) == '[' && addrStr.charAt(addrStr.length() - 1) == ']') { addrStr = addrStr.substring(1, addrStr.length() - 1); } int port; if (portStr.equals("*") || portStr.equals("0")) { port = 0; } else { port = Integer.parseInt(portStr); if (port == 0) { throw new IllegalArgumentException(name); } } InetAddress addrNet = null; if (addrStr.equals("*")) { addrStr = ipv6 ? "::" : "0.0.0.0"; } try { InetAddress[] addresses = InetAddress.getAllByName(addrStr); if (ipv6) { addrNet = Arrays.stream(addresses).filter(i -> i instanceof Inet6Address).findFirst().orElseGet(() -> addresses[0]); } else { addrNet = Arrays.stream(addresses).filter(i -> i instanceof Inet4Address).findFirst().orElseGet(() -> null); } } catch (UnknownHostException e) { throw new ZMQException(e.getMessage(), ZError.EADDRNOTAVAIL, e); } if (addrNet == null) { throw new ZMQException(addrStr + " not found matching IPv4/IPv6 settings", ZError.EADDRNOTAVAIL); } return new InetSocketAddress(addrNet, port); }
Source:
<code>public void modifyJobName() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "test_modify_job_name"; try { <START> Ds3ClientHelpers.wrap(client).ensureBucketExists(bucketName); <END> final Ds3ClientHelpers.Job job = wrap(client).startWriteJob(bucketName, Lists.newArrayList(new Ds3Object("testOne", 2))); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withName("newName")); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getName(), is("newName")); } finally { deleteAllContents(client, bucketName); } }</code><technical_language>call Ds3ClientHelpers.wrap here, in next expression call wrap() expressions thing</technical_language>

Target:
public void modifyJobName() throws IOException, SignatureException, XmlProcessingException { try { final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withName("newName")); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getName(), is("newName")); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
<code>public List<String> generateErrorMessages(List<ValidationError> errorsList, String syntaxErrorMessage, Map<ValidationFailureReason, String> failureReasonsToVdcBllMessagesMap, Map<ValidationFailureReason, String> failureReasonsToParameterFormatStrings) { if (errorsList == null || errorsList.isEmpty()) { return Collections.emptyList(); } if (errorsList.size() == 1 && errorsList.get(0).getReason() == ValidationFailureReason.SYNTAX_ERROR) { <START> return Arrays.asList(syntaxErrorMessage); <END> } if (errorsList.size() == 1 && errorsList.get(0).getReason() == ValidationFailureReason.UNSUPPORTED_VERSION) { return Arrays.asList(syntaxErrorMessage); } List<String> result = new ArrayList<String>(); Map<ValidationFailureReason, List<ValidationError>> resultMap = new HashMap<CustomPropertiesUtils.ValidationFailureReason, List<ValidationError>>(); separateValidationErrorsList(errorsList, resultMap); for (Map.Entry<ValidationFailureReason, String> entry : failureReasonsToVdcBllMessagesMap.entrySet()) { List<ValidationError> errorsListForReason = resultMap.get(entry.getKey()); String vdcBllMessage = entry.getValue(); String formatString = failureReasonsToParameterFormatStrings.get(entry.getKey()); addMessage(result, vdcBllMessage, formatString, errorsListForReason); } return result; }</code><technical_language>simplify squashing if statements if statement in manner: if (errorsList.size() == 1 && isSevereErrorDetected(errorsList.get(0).getReason())) { return Arrays.asList(syntaxErrorMessage); } boolean isSevereErrorDetected(ValidationFailureReason failure) { return failure == ValidationFailureReason.SYNTAX_ERROR || failure == ValidationFailureReason.UNSUPPORTED_VERSION; }</technical_language>

Target:
public List<String> generateErrorMessages(List<ValidationError> errorsList, String syntaxErrorMessage, Map<ValidationFailureReason, String> failureReasonsToVdcBllMessagesMap, Map<ValidationFailureReason, String> failureReasonsToParameterFormatStrings) { if (errorsList == null || errorsList.isEmpty()) { return Collections.emptyList(); } if (errorsList.size() == 1 && errorsList.get(0).getReason() == ValidationFailureReason.SYNTAX_ERROR) { return Arrays.asList(syntaxErrorMessage); } List<String> result = new ArrayList<String>(); Map<ValidationFailureReason, List<ValidationError>> resultMap = new HashMap<CustomPropertiesUtils.ValidationFailureReason, List<ValidationError>>(); separateValidationErrorsList(errorsList, resultMap); for (Map.Entry<ValidationFailureReason, String> entry : failureReasonsToVdcBllMessagesMap.entrySet()) { List<ValidationError> errorsListForReason = resultMap.get(entry.getKey()); String vdcBllMessage = entry.getValue(); String formatString = failureReasonsToParameterFormatStrings.get(entry.getKey()); addMessage(result, vdcBllMessage, formatString, errorsListForReason); } return result; }
Source:
<code>Mono<Response<AreaCodes>> getAllAreaCodesWithResponse( String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions, Context context) { LocationOptionsQueries locationOptionsQueries = new LocationOptionsQueries(); locationOptionsQueries.setLocationOptions(locationOptions); <START> if (locationOptions == null) { <END> Mono.error(new NullPointerException("'locationType' cannot be null.")); } if (countryCode == null) { Mono.error(new NullPointerException("'countryCode' cannot be null.")); } if (phonePlanId == null) { Mono.error(new NullPointerException("'phonePlanId' cannot be null.")); } try { if (context == null) { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries); } else { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries, context); } } catch (RuntimeException ex) { return monoError(logger, ex); } }</code><technical_language>do need this change? long this is try-catch, return a mono.error, right</technical_language>

Target:
Mono<Response<AreaCodes>> getAllAreaCodesWithResponse( String locationType, String countryCode, String phonePlanId, List<LocationOptionsQuery> locationOptions, Context context) { LocationOptionsQueries locationOptionsQueries = new LocationOptionsQueries(); locationOptionsQueries.setLocationOptions(locationOptions); try { Objects.requireNonNull(locationType, "'locationType' cannot be null."); Objects.requireNonNull(countryCode, "'countryCode' cannot be null."); Objects.requireNonNull(phonePlanId, "'phonePlanId' cannot be null."); if (context == null) { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries); } else { return phoneNumberAdministrations.getAllAreaCodesWithResponseAsync( locationType, countryCode, phonePlanId, locationOptionsQueries, context); } } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code><START> private static int compare(int a, int b) { <END> return a < b ? -1 : a > b ? 1 : 0; }</code><technical_language>This method implemented return a - b;</technical_language>

Target:
private static int compare(int a, int b) { return (a-b); }
Source:
<code>public static SetMultimap<String, String> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { <START> SetMultimap<String, String> valuesByType = NonNullUtils.checkNotNull(HashMultimap.create()); <END> for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { valuesByType.putAll(requirement.getType(), requirement.getValues()); } } return valuesByType; }</code><technical_language>This added external annotations instead</technical_language>

Target:
public static SetMultimap<String, String> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { SetMultimap<String, String> valuesByType = HashMultimap.create(); for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { valuesByType.putAll(requirement.getType(), requirement.getValues()); } } return valuesByType; }
Source:
<code>public void updateUsbSlots(VmBase oldVm, VmBase newVm) { <START> Objects.requireNonNull(oldVm); Objects.requireNonNull(newVm); <END> final UsbPolicy oldUsbPolicy = oldVm.getUsbPolicy(); final UsbPolicy newUsbPolicy = newVm.getUsbPolicy(); final int oldNumberOfSlots = getUsbSlots(oldVm.getId()).size(); final int newNumberOfUsbSlots = Config.<Integer> getValue(ConfigValues.NumberOfUSBSlots); if (UsbPolicy.DISABLED == oldUsbPolicy && UsbPolicy.ENABLED_NATIVE == newUsbPolicy) { disableNormalUsb(newVm.getId()); enableSpiceUsb(newVm.getId(), newNumberOfUsbSlots); return; } if (UsbPolicy.ENABLED_NATIVE == oldUsbPolicy && UsbPolicy.ENABLED_NATIVE == newUsbPolicy) { updateSpiceUsb(newVm.getId(), oldNumberOfSlots, newNumberOfUsbSlots); return; } if (UsbPolicy.ENABLED_NATIVE == oldUsbPolicy && UsbPolicy.DISABLED == newUsbPolicy) { disableSpiceUsb(newVm.getId()); enableNormalUsb(newVm); return; } if (UsbPolicy.DISABLED == oldUsbPolicy && UsbPolicy.DISABLED == newUsbPolicy) { updateNormalUsb(newVm); return; } throw new RuntimeException( format("Unexpected state: oldUsbPolicy=%s, newUsbPolicy=%s", oldUsbPolicy, newUsbPolicy)); }</code><technical_language>point in lines? I understand original of in variable assignments constructors redundant - fall right NPE</technical_language>

Target:
public void updateUsbSlots(VmBase oldVm, VmBase newVm) { final UsbPolicy oldUsbPolicy = oldVm.getUsbPolicy(); final UsbPolicy newUsbPolicy = newVm.getUsbPolicy(); final int oldNumberOfSlots = getUsbSlots(oldVm.getId()).size(); final int newNumberOfUsbSlots = Config.<Integer> getValue(ConfigValues.NumberOfUSBSlots); if (UsbPolicy.DISABLED == oldUsbPolicy && UsbPolicy.ENABLED_NATIVE == newUsbPolicy) { disableNormalUsb(newVm.getId()); enableSpiceUsb(newVm.getId(), newNumberOfUsbSlots); return; } if (UsbPolicy.ENABLED_NATIVE == oldUsbPolicy && UsbPolicy.ENABLED_NATIVE == newUsbPolicy) { updateSpiceUsb(newVm.getId(), oldNumberOfSlots, newNumberOfUsbSlots); return; } if (UsbPolicy.ENABLED_NATIVE == oldUsbPolicy && UsbPolicy.DISABLED == newUsbPolicy) { disableSpiceUsb(newVm.getId()); enableNormalUsb(newVm); return; } if (UsbPolicy.DISABLED == oldUsbPolicy && UsbPolicy.DISABLED == newUsbPolicy) { updateNormalUsb(newVm); return; } throw new RuntimeException( format("Unexpected state: oldUsbPolicy=%s, newUsbPolicy=%s", oldUsbPolicy, newUsbPolicy)); }
Source:
<code>public void setInput(Object input) { Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput, input != null ? input.getClass().getName() : <START> null); <END> if (input instanceof String) { setInformation((String)input); return; } fInput= (BrowserInformationControlInput)input; String content= null; if (fInput != null) content= fInput.getHtml(); fBrowserHasContent= content != null && content.length() > 0; if (!fBrowserHasContent) content= "<html><body ></html>"; boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; boolean resizable= isResizable(); String[] styles= null; if (RTL && resizable) styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; else if (RTL && !resizable) styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; else if (!resizable) styles= new String[] { "overflow:hidden;" }; else styles= new String[] { "overflow:scroll;" }; StringBuffer buffer= new StringBuffer(content); HTMLPrinter.insertStyles(buffer, styles); content= buffer.toString(); fCompleted= false; fBrowser.setText(content); for (IInputChangedListener listener : fInputChangeListeners) { listener.inputChanged(fInput); } }</code><technical_language>AFAIK passing 'null' instead of "null" discard/hide null</technical_language>

Target:
public void setInput(Object input) { Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput, input != null ? input.getClass().getName() : "null"); if (input instanceof String) { setInformation((String)input); return; } fInput= (BrowserInformationControlInput)input; String content= null; if (fInput != null) content= fInput.getHtml(); fBrowserHasContent= content != null && content.length() > 0; if (!fBrowserHasContent) content= "<html><body ></html>"; boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; boolean resizable= isResizable(); String[] styles= null; if (RTL && resizable) styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; else if (RTL && !resizable) styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; else if (!resizable) styles= new String[] { "overflow:hidden;" }; else styles= new String[] { "overflow:scroll;" }; StringBuffer buffer= new StringBuffer(content); HTMLPrinter.insertStyles(buffer, styles); content= buffer.toString(); fCompleted= false; fBrowser.setText(content); for (IInputChangedListener listener : fInputChangeListeners) { listener.inputChanged(fInput); } }
Source:
<code>protected Object handleRequestMessage(Message<?> requestMessage) { Collection<ConditionalStreamListenerHandler> matchingHandlers = findMatchingHandlers(requestMessage); if (matchingHandlers.size() == 0) { if (logger.isWarnEnabled()) { <START> logger.warn("Cannot find a @StreamListener matching " + requestMessage); <END> } return null; } else if (matchingHandlers.size() > 1) { for (ConditionalStreamListenerHandler matchingHandler : matchingHandlers) { if (!matchingHandler.isVoid()) { throw new MessagingException( "Multiple matching methods cannot return values for " + requestMessage); } } for (ConditionalStreamListenerHandler matchingMethod : matchingHandlers) { matchingMethod.handleMessage(requestMessage); } return null; } else { final ConditionalStreamListenerHandler singleMatchingHandler = matchingHandlers.iterator().next(); singleMatchingHandler.handleMessage(requestMessage); return null; } }</code><technical_language>Is ok display requestMessage in log</technical_language>

Target:
protected Object handleRequestMessage(Message<?> requestMessage) { Collection<ConditionalStreamListenerHandler> matchingHandlers = findMatchingHandlers(requestMessage); if (matchingHandlers.size() == 0) { if (logger.isWarnEnabled()) { logger.warn("Cannot find a @StreamListener matching for message with id: " + requestMessage.getHeaders().getId()); } return null; } else if (matchingHandlers.size() > 1) { for (ConditionalStreamListenerHandler matchingMethod : matchingHandlers) { matchingMethod.handleMessage(requestMessage); } return null; } else { final ConditionalStreamListenerHandler singleMatchingHandler = matchingHandlers.iterator().next(); singleMatchingHandler.handleMessage(requestMessage); return null; } }
Source:
<code><START> public static AbstractCalledFunction create(long start, long end, int depth, String value, @Nullable ICalledFunction parent) { <END> if (start > end) { throw new IllegalArgumentException(Messages.TimeError + '[' + start + ',' + end + ']'); } return new CalledStringFunction(start, end, value, depth, parent); }</code><technical_language>ICalledFunction CalledStringFunction</technical_language>

Target:
private static CalledStringFunction create(long start, long end, int depth, String value, @Nullable ICalledFunction parent) { if (start > end) { throw new IllegalArgumentException(Messages.TimeError + '[' + start + ',' + end + ']'); } return new CalledStringFunction(start, end, value, depth, parent); }
Source:
<code><START> public void test() { <END> JavaCheckVerifier.verify("src/test/files/checks/security/PasswordEncoder.java", new PasswordEncoderCheck()); }</code><technical_language>please, add a call JavaCheckVerifier.verifyNoIssueWithoutSemantic</technical_language>

Target:
public void test() { JavaCheckVerifier.verify("src/test/files/checks/security/PasswordEncoder.java", new PasswordEncoderCheck()); JavaCheckVerifier.verifyNoIssueWithoutSemantic("src/test/files/checks/security/PasswordEncoder.java", new PasswordEncoderCheck()); }
Source:
<code>protected void validate() throws AxonConfigurationException { <START> assertNonNull(repository, "The Repository is a hard requirement and should be provided"); <END> assertNonNull(commandTargetResolver, "The CommandTargetResolver is a hard requirement and should be provided"); if (aggregateModel == null) { assertNonNull( aggregateType, "No AggregateModel is set, whilst either it or the aggregateType is a hard requirement" ); return; } assertNonNull( aggregateModel, "No aggregateType is set, whilst either it or the AggregateModel is a hard requirement" ); }</code><technical_language>Repository null</technical_language>

Target:
protected void validate() throws AxonConfigurationException { assertNonNull(repository, "The Repository is a hard requirement and should be provided"); if (aggregateModel == null) { assertNonNull( aggregateType, "No AggregateModel is set, whilst either it or the aggregateType is a hard requirement" ); return; } assertNonNull( aggregateModel, "No aggregateType is set, whilst either it or the AggregateModel is a hard requirement" ); }
Source:
<code>public FilterStatsCalculator(Metadata metadata, ScalarStatsCalculator scalarStatsCalculator, StatsNormalizer normalizer) { this.metadata = requireNonNull(metadata, "metadata is null"); this.scalarStatsCalculator = requireNonNull(scalarStatsCalculator, "scalarStatsCalculator is null"); this.normalizer = requireNonNull(normalizer, "normalizer is null"); this.literalEncoder = new LiteralEncoder(metadata.getBlockEncodingSerde()); <START> this.resolution = new StandardFunctionResolution(metadata.getFunctionManager()); <END> }</code><technical_language>functionResolution</technical_language>

Target:
public FilterStatsCalculator(Metadata metadata, ScalarStatsCalculator scalarStatsCalculator, StatsNormalizer normalizer) { this.metadata = requireNonNull(metadata, "metadata is null"); this.scalarStatsCalculator = requireNonNull(scalarStatsCalculator, "scalarStatsCalculator is null"); this.normalizer = requireNonNull(normalizer, "normalizer is null"); this.literalEncoder = new LiteralEncoder(metadata.getBlockEncodingSerde()); this.functionResolution = new StandardFunctionResolution(metadata.getFunctionManager()); }
Source:
<code><START> protected void stopListeningForIOSamples(IIOSampleReceiveListener listener) { <END> if (dataReader == null) return; dataReader.removeIOSampleReceiveListener(listener); }</code><technical_language>Add a null checker also</technical_language>

Target:
protected void stopListeningForIOSamples(IIOSampleReceiveListener listener) { if (listener == null) throw new NullPointerException("Listener cannot be null."); if (dataReader == null) return; dataReader.removeIOSampleReceiveListener(listener); }
Source:
<code>public MetricSchemaRecordList deserialize(JsonParser jp, DeserializationContext context) throws IOException, JsonProcessingException { String scrollID = null; List<MetricSchemaRecord> records = Collections.emptyList(); JsonNode rootNode = jp.getCodec().readTree(jp); if(rootNode.has("_scroll_id")) { scrollID = rootNode.get("_scroll_id").asText(); } JsonNode hits = rootNode.get("hits").get("hits"); if(JsonNodeType.ARRAY.equals(hits.getNodeType())) { records = new ArrayList<>(hits.size()); Iterator<JsonNode> iter = hits.elements(); while(iter.hasNext()) { JsonNode hit = iter.next(); JsonNode source = hit.get("_source"); JsonNode namespaceNode = source.get(RecordType.NAMESPACE.getName()); JsonNode scopeNode = source.get(RecordType.SCOPE.getName()); JsonNode metricNode = source.get(RecordType.METRIC.getName()); JsonNode tagkNode = source.get(RecordType.TAGK.getName()); JsonNode tagvNode = source.get(RecordType.TAGV.getName()); JsonNode retentionNode = source.get(RecordType.RETENTIONDISCOVERY.getName()); records.add(new MetricSchemaRecord(namespaceNode == null ? null : namespaceNode.asText(), <START> scopeNode.asText(), <END> metricNode.asText(), tagkNode == null ? null : tagkNode.asText(), tagvNode == null ? null : tagvNode.asText(), retentionNode == null? null : retentionNode.asInt())); } } return new MetricSchemaRecordList(records, scrollID); }</code><technical_language>whitespace formatting changed</technical_language>

Target:
public MetricSchemaRecordList deserialize(JsonParser jp, DeserializationContext context) throws IOException, JsonProcessingException { String scrollID = null; List<MetricSchemaRecord> records = Collections.emptyList(); JsonNode rootNode = jp.getCodec().readTree(jp); if(rootNode.has("_scroll_id")) { scrollID = rootNode.get("_scroll_id").asText(); } JsonNode hits = rootNode.get("hits").get("hits"); if(JsonNodeType.ARRAY.equals(hits.getNodeType())) { records = new ArrayList<>(hits.size()); Iterator<JsonNode> iter = hits.elements(); while(iter.hasNext()) { JsonNode hit = iter.next(); JsonNode source = hit.get("_source"); JsonNode namespaceNode = source.get(RecordType.NAMESPACE.getName()); JsonNode scopeNode = source.get(RecordType.SCOPE.getName()); JsonNode metricNode = source.get(RecordType.METRIC.getName()); JsonNode tagkNode = source.get(RecordType.TAGK.getName()); JsonNode tagvNode = source.get(RecordType.TAGV.getName()); JsonNode retentionNode = source.get(RecordType.RETENTION_DISCOVERY.getName()); records.add(new MetricSchemaRecord(namespaceNode == null ? null : namespaceNode.asText(), scopeNode.asText(), metricNode.asText(), tagkNode == null ? null : tagkNode.asText(), tagvNode == null ? null : tagvNode.asText(), retentionNode == null? null : retentionNode.asInt())); } } return new MetricSchemaRecordList(records, scrollID); }
Source:
<code>public void banUser(String userName, WebDriver driver) { clickBanUser(userName, driver); chatBanModalButton.click(); waitForElementNotVisibleByElement(chatBanModal); PageObjectLogging.log("clickBanUser", userName+" ban modal is closed", <START> true, driver); <END> }</code><technical_language>remove 'driver' parameter log( ... ) method "driver" parameter screenshot taken, test execute longer, possibly omit screnshoots, increases execution tmie</technical_language>

Target:
public void banUser(String userName, WebDriver driver) { clickBanUser(userName, driver); chatBanModalButton.click(); waitForElementNotVisibleByElement(chatBanModal); PageObjectLogging.log("clickBanUser", userName+" ban modal is closed", true); }