auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object auditLogGeneration(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable { MethodSignature signature = (MethodSignature) proceedingJoinPoint.getSignature(); Method method = signature.getMethod(); GenerateAuditLog auditLogAnnotation = method.getAnnotation(GenerateAuditLog.class); Object responseObject = proceedingJoinPoint.proceed(); if (auditLogAnnotation.scope().in(ALL, SUCCESS)) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getRequest(); HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getResponse(); ResponseStatus responseStatusAnnotation = method.getAnnotation(ResponseStatus.class); int responseCode = response != null ? response.getStatus() : 0; if (responseStatusAnnotation != null) { responseCode = responseStatusAnnotation.value().value(); } Object auditLogResponseObject = responseObject; if (responseObject instanceof ResponseEntity) { responseCode = ((ResponseEntity) responseObject).getStatusCode().value(); auditLogResponseObject = ((ResponseEntity) responseObject).getBody(); } if (responseCode == 0 || HttpStatus.valueOf(responseCode).is2xxSuccessful() || HttpStatus.valueOf(responseCode).is3xxRedirection()) { auditLogSender.sendAuditLog(request, extractRequestBody(proceedingJoinPoint), responseCode, auditLogResponseObject, auditLogAnnotation); } } return responseObject; }

Target:
public Object auditLogGeneration(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable { MethodSignature signature = (MethodSignature) proceedingJoinPoint.getSignature(); Method method = signature.getMethod(); GenerateAuditLog auditLogAnnotation = method.getAnnotation(GenerateAuditLog.class); Object responseObject = proceedingJoinPoint.proceed(); if (auditLogAnnotation.scope().in(ALL, SUCCESS)) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getRequest(); HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getResponse(); ResponseStatus responseStatusAnnotation = method.getAnnotation(ResponseStatus.class); int responseCode = response != null ? response.getStatus() : 0; if (responseStatusAnnotation != null) { responseCode = responseStatusAnnotation.value().value(); } Object auditLogResponseObject = responseObject; if (responseObject instanceof ResponseEntity) { responseCode = ((ResponseEntity) responseObject).getStatusCode().value(); auditLogResponseObject = ((ResponseEntity) responseObject).getBody(); } if (responseCode == 0 || !HttpStatus.valueOf(responseCode).isError()) { auditLogSender.sendAuditLog(request, extractRequestBody(proceedingJoinPoint), responseCode, auditLogResponseObject, auditLogAnnotation); } } return responseObject; }
Source:
PRED_change_branch_1(Term a1, Operation n) { arg1 = a1; cont = n; }

Target:
public PRED_change_branch_1(Term a1, Operation n) { arg1 = a1; cont = n; }
Source:
public DeviceFunction getDeviceFunction() { return DeviceFunction.GET_CONFIGURATION; }

Target:
public DeviceFunction getDeviceFunction() { return DeviceFunction.SCAN_MBUS_CHANNELS; }
Source:
CommandCenterTab(CampaignGUI gui, String name) { super(gui, name); MekHQ.registerHandler(this); }

Target:
public CommandCenterTab(CampaignGUI gui, String name) { super(gui, name); MekHQ.registerHandler(this); }
Source:
public synchronized String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element rootNode = doc.createElement(DIRECTOR_ROOT_NODE); doc.appendChild(rootNode); Element pathNode = doc.createElement(CONTAINERS_NODE); if(fDuplicates) { pathNode.setAttribute(DUPLICATES_ATTR, "true"); } else { pathNode.setAttribute(DUPLICATES_ATTR, "false"); } rootNode.appendChild(pathNode); if(fSourceContainers !=null){ for (ISourceContainer fSourceContainer : fSourceContainers) { Element node = doc.createElement(CONTAINER_NODE); ISourceContainer container = fSourceContainer; ISourceContainerType type = container.getType(); node.setAttribute(CONTAINER_TYPE_ATTR, type.getId()); node.setAttribute(CONTAINER_MEMENTO_ATTR, type.getMemento(container)); pathNode.appendChild(node); } } return DebugPlugin.serializeDocument(doc); }

Target:
public synchronized String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element rootNode = doc.createElement(DIRECTOR_ROOT_NODE); doc.appendChild(rootNode); Element pathNode = doc.createElement(CONTAINERS_NODE); if(fDuplicates) { pathNode.setAttribute(DUPLICATES_ATTR, "true"); } else { pathNode.setAttribute(DUPLICATES_ATTR, "false"); } rootNode.appendChild(pathNode); if(fSourceContainers !=null){ for (ISourceContainer container : fSourceContainers) { Element node = doc.createElement(CONTAINER_NODE); ISourceContainerType type = container.getType(); node.setAttribute(CONTAINER_TYPE_ATTR, type.getId()); node.setAttribute(CONTAINER_MEMENTO_ATTR, type.getMemento(container)); pathNode.appendChild(node); } } return DebugPlugin.serializeDocument(doc); }
Source:
public static void laconic(org.slf4j.Logger logger, Level level, String message, int max) { int messageCount = getAndIncrementMessageCount(message); if (messageCount <= max) { if (level.isInRange(Level.ERROR, Level.ALL)) { logger.error(message); } else if (level == Level.WARN) { logger.warn(message); } else if (level == Level.INFO) { logger.info(message); } else if (level == Level.DEBUG) { logger.debug(message); } } }

Target:
public static void laconic(org.slf4j.Logger logger, Level level, String message, int max) { if (shouldLog(message, max)) { if (level.isInRange(Level.ERROR, Level.ALL)) { logger.error(message); } else if (level == Level.WARN) { logger.warn(message); } else if (level == Level.INFO) { logger.info(message); } else if (level == Level.DEBUG) { logger.debug(message); } } }
Source:
void suspendAll() throws InterruptedException { for (ServiceTermination termination : terminations) { LOG.info("Suspending down '{}' service", termination.getServiceName()); eventService.publish(new SuspendingSystemServiceEvent(termination.getServiceName())); try { termination.suspend(); } catch (UnsupportedOperationException e) { LOG.info( "Suspending down '{}' service isn't supported, terminating it", termination.getServiceName()); doTerminate(termination); } catch (InterruptedException x) { LOG.error( "Interrupted while waiting for '{}' service to suspend", termination.getServiceName()); throw x; } LOG.info("Service '{}' is suspended", termination.getServiceName()); eventService.publish(new SystemServiceSuspendedEvent(termination.getServiceName())); } }

Target:
void suspendAll() throws InterruptedException { for (ServiceTermination termination : terminations) { LOG.info("Suspending down '{}' service", termination.getServiceName()); eventService.publish(new SuspendingSystemServiceEvent(termination.getServiceName())); try { termination.suspend(); eventService.publish(new SystemServiceSuspendedEvent(termination.getServiceName())); LOG.info("Service '{}' is suspended", termination.getServiceName()); } catch (UnsupportedOperationException e) { LOG.info( "Suspending down '{}' service isn't supported, terminating it", termination.getServiceName()); doTerminate(termination); } catch (InterruptedException x) { LOG.error( "Interrupted while waiting for '{}' service to suspend", termination.getServiceName()); throw x; } } }
Source:
private void validateWriteSizeLimitConfig() { int serializerSize = ZNRecordUtil.getSerializerWriteSizeLimit(); int zkClientSize = getWriteSizeLimit(); if (serializerSize > zkClientSize) { throw new IllegalStateException("ZNRecord serializer write size limit: " + serializerSize + " is greater than size limit in ZkClient: " + zkClientSize); } }

Target:
private void validateWriteSizeLimitConfig() { int serializerSize = ZNRecordUtil.getSerializerWriteSizeLimit(); LOG.info("ZNRecord serializer write size limit: {}; ZkClient write size limit: {}", serializerSize, WRITE_SIZE_LIMIT); if (serializerSize > WRITE_SIZE_LIMIT) { throw new IllegalStateException("ZNRecord serializer write size limit " + serializerSize + " is greater than ZkClient size limit " + WRITE_SIZE_LIMIT); } }
Source:
public static boolean canStop(StopMode stopMode, boolean isEntityStopped) { return stopMode == StopMode.ALWAYS || stopMode == StopMode.IF_NOT_STOPPED && !isEntityStopped; }

Target:
protected static boolean canStop(StopMode stopMode, boolean isEntityStopped) { return stopMode == StopMode.ALWAYS || stopMode == StopMode.IF_NOT_STOPPED && !isEntityStopped; }
Source:
private PendingResult<Status> addGeofence(LostApiClient client, Geofence geofence, PendingIntent pendingIntent) throws SecurityException { int pendingIntentId = (int) System.currentTimeMillis(); internalIntent = intentFactory.createIntent(context); internalIntent.addCategory(String.valueOf(pendingIntentId)); ParcelableGeofence pGeofence = (ParcelableGeofence) geofence; idToPendingIntent.put(pendingIntentId, pendingIntent); idToGeofence.put(pendingIntentId, pGeofence); PendingIntent internalPendingIntent = intentFactory.createPendingIntent(context, pendingIntentId, internalIntent); String requestId = String.valueOf(pGeofence.hashCode()); locationManager.addProximityAlert( pGeofence.getLatitude(), pGeofence.getLongitude(), pGeofence.getRadius(), pGeofence.getDuration(), internalPendingIntent); if (pGeofence.getRequestId() != null && !pGeofence.getRequestId().isEmpty()) { requestId = pGeofence.getRequestId(); } pendingIntentMap.put(requestId, pendingIntent); return new SimplePendingResult(true); }

Target:
private PendingResult<Status> addGeofence(LostApiClient client, Geofence geofence, PendingIntent pendingIntent) throws SecurityException { int pendingIntentId = idGenerator.generateId(); internalIntent = intentFactory.createIntent(context); internalIntent.addCategory(String.valueOf(pendingIntentId)); ParcelableGeofence pGeofence = (ParcelableGeofence) geofence; idToPendingIntent.put(pendingIntentId, pendingIntent); idToGeofence.put(pendingIntentId, pGeofence); PendingIntent internalPendingIntent = intentFactory.createPendingIntent(context, pendingIntentId, internalIntent); String requestId = String.valueOf(pGeofence.hashCode()); locationManager.addProximityAlert( pGeofence.getLatitude(), pGeofence.getLongitude(), pGeofence.getRadius(), pGeofence.getDuration(), internalPendingIntent); if (pGeofence.getRequestId() != null && !pGeofence.getRequestId().isEmpty()) { requestId = pGeofence.getRequestId(); } pendingIntentMap.put(requestId, pendingIntent); return new SimplePendingResult(true); }
Source:
public void testHoistedFunction2() { test("if (window) { f(); function f() }", "if (window) { f(); function f() }"); }

Target:
public void testHoistedFunction2() { test("if (window) { f(); function f() }", "if (window) { var f = function() {}; f(); }"); }
Source:
private IngestionPersistenceResult persistIngestion(long articlePk, ArticleMetadata articleMetadata) { Journal journal = fetchJournal(articleMetadata); return hibernateTemplate.execute(session -> { SQLQuery findNextIngestionNumber = session.createSQLQuery( "SELECT MAX(ingestionNumber) FROM articleIngestion WHERE articleId = :articleId"); findNextIngestionNumber.setParameter("articleId", articlePk); Number maxIngestionNumber = (Number) findNextIngestionNumber.uniqueResult(); int nextIngestionNumber = (maxIngestionNumber == null) ? FIRST_INGESTION_NUMBER : maxIngestionNumber.intValue() + 1; SQLQuery insertEvent = session.createSQLQuery("" + "INSERT INTO articleIngestion (articleId, ingestionNumber, title, publicationDate, revisionDate, articleType, journalId) " + "VALUES (:articleId, :ingestionNumber, :title, :publicationDate, :revisionDate, :articleType, :journalId)"); insertEvent.setParameter("articleId", articlePk); insertEvent.setParameter("ingestionNumber", nextIngestionNumber); insertEvent.setParameter("title", articleMetadata.getTitle()); insertEvent.setParameter("publicationDate", java.sql.Date.valueOf(articleMetadata.getPublicationDate())); insertEvent.setParameter("revisionDate", java.sql.Date.valueOf(articleMetadata.getRevisionDate())); insertEvent.setParameter("articleType", articleMetadata.getArticleType()); insertEvent.setParameter("journalId", journal.getJournalId()); insertEvent.executeUpdate(); long pk = getLastInsertId(session); return new IngestionPersistenceResult(pk, nextIngestionNumber); }); }

Target:
private IngestionPersistenceResult persistIngestion(long articlePk, ArticleMetadata articleMetadata) { Journal journal = fetchJournal(articleMetadata); return hibernateTemplate.execute(session -> { SQLQuery findNextIngestionNumber = session.createSQLQuery( "SELECT MAX(ingestionNumber) FROM articleIngestion WHERE articleId = :articleId"); findNextIngestionNumber.setParameter("articleId", articlePk); Number maxIngestionNumber = (Number) findNextIngestionNumber.uniqueResult(); int nextIngestionNumber = (maxIngestionNumber == null) ? FIRST_INGESTION_NUMBER : maxIngestionNumber.intValue() + 1; SQLQuery insertEvent = session.createSQLQuery("" + "INSERT INTO articleIngestion (articleId, ingestionNumber, title, publicationDate, revisionDate, articleType, journalId) " + "VALUES (:articleId, :ingestionNumber, :title, :publicationDate, :revisionDate, :articleType, :journalId)"); insertEvent.setParameter("articleId", articlePk); insertEvent.setParameter("ingestionNumber", nextIngestionNumber); insertEvent.setParameter("title", articleMetadata.getTitle()); insertEvent.setParameter("publicationDate", java.sql.Date.valueOf(articleMetadata.getPublicationDate())); insertEvent.setParameter("revisionDate", (articleMetadata.getRevisionDate() == null ? null : java.sql.Date.valueOf(articleMetadata.getRevisionDate()))); insertEvent.setParameter("articleType", articleMetadata.getArticleType()); insertEvent.setParameter("journalId", journal.getJournalId()); insertEvent.executeUpdate(); long pk = getLastInsertId(session); return new IngestionPersistenceResult(pk, nextIngestionNumber); }); }
Source:
public void refuseToBuildDisabledProject() throws Exception { FreeStyleProject project = j.createFreeStyleProject("the-project"); project.disable(); CLICommandInvoker invoker = new CLICommandInvoker(j, new BuildCommand()); CLICommandInvoker.Result result = invoker.invokeWithArgs("the-project"); assertThat(result, failedWith(CLIReturnCodeStandard.ILLEGAL_STATE.getCode())); assertThat(result.stderr(), containsString("ERROR: Cannot build the-project because it is disabled.")); assertNull("Project should not be built", project.getBuildByNumber(1)); }

Target:
public void refuseToBuildDisabledProject() throws Exception { FreeStyleProject project = j.createFreeStyleProject("the-project"); project.disable(); CLICommandInvoker invoker = new CLICommandInvoker(j, new BuildCommand()); CLICommandInvoker.Result result = invoker.invokeWithArgs("the-project"); assertThat(result, failedWith(StandardCLIReturnCode.ILLEGAL_STATE.getCode())); assertThat(result.stderr(), containsString("ERROR: Cannot build the-project because it is disabled.")); assertNull("Project should not be built", project.getBuildByNumber(1)); }
Source:
public CteValuesListDeleteHandlerImpl( SessionFactoryImplementor factory, HqlSqlWalker walker, String catalog, String schema) { super( factory, walker, catalog, schema ); final String idSubselect = generateIdSubselect( getTargetedQueryable() ); for ( Type type : getTargetedQueryable().getPropertyTypes() ) { if ( type.isCollectionType() ) { CollectionType cType = (CollectionType) type; AbstractCollectionPersister cPersister = (AbstractCollectionPersister) factory.getCollectionPersister( cType.getRole() ); if ( cPersister.isManyToMany() ) { deletes.add( generateDelete( cPersister.getTableName(), cPersister.getKeyColumnNames(), idSubselect, "bulk delete - m2m join table cleanup" ) ); } } } String[] tableNames = getTargetedQueryable().getConstraintOrderedTableNameClosure(); String[][] columnNames = getTargetedQueryable().getContraintOrderedTableKeyColumnClosure(); for ( int i = 0; i < tableNames.length; i++ ) { deletes.add( generateDelete( tableNames[i], columnNames[i], idSubselect, "bulk delete" ) ); } }

Target:
public CteValuesListDeleteHandlerImpl( SessionFactoryImplementor factory, HqlSqlWalker walker, String catalog, String schema) { super( factory, walker, catalog, schema ); final String idSubselect = generateIdSubselect( getTargetedQueryable() ); for ( Type type : getTargetedQueryable().getPropertyTypes() ) { if ( type.isCollectionType() ) { CollectionType cType = (CollectionType) type; AbstractCollectionPersister cPersister = (AbstractCollectionPersister) factory.getMetamodel().collectionPersister( cType.getRole() ); if ( cPersister.isManyToMany() ) { deletes.add( generateDelete( cPersister.getTableName(), cPersister.getKeyColumnNames(), idSubselect, "bulk delete - m2m join table cleanup" ) ); } } } String[] tableNames = getTargetedQueryable().getConstraintOrderedTableNameClosure(); String[][] columnNames = getTargetedQueryable().getContraintOrderedTableKeyColumnClosure(); for ( int i = 0; i < tableNames.length; i++ ) { deletes.add( generateDelete( tableNames[i], columnNames[i], idSubselect, "bulk delete" ) ); } }
Source:
public void asyncExec(Runnable runnable) { try { EDTExecutor.invokeLater(runnable); } catch (ProcessCanceledException e) { log.error("Synchronous execution on EDT interrupted - " + runnable, e); } }

Target:
public void asyncExec(Runnable runnable) { EDTExecutor.invokeLater(runnable); }
Source:
protected int computeGrowthAmount(Material material) { int amount = 0; if (!isAdult() && !(Material.HAY_BLOCK == material && !isTamed())) { Integer mapResult = GROWING_FOODS.get(material); if (mapResult != null) { amount = Math.min(mapResult, Math.abs(getAge())); } } return amount; }

Target:
protected int computeGrowthAmount(Material material) { if (!isAdult() && !(Material.HAY_BLOCK == material && !isTamed())) { Integer mapResult = GROWING_FOODS.get(material); if (mapResult != null) { return Math.min(mapResult, Math.abs(getAge())); } } return 0; }
Source:
private Map<String, String> makeParams() { HashMap<String, String> params = new HashMap<>(); params.put(Params.TO.paramName, to); params.put(Params.COMMENT.paramName, comment); params.put(Params.MESSAGE.paramName, message); params.put(Params.LABEL.paramName, label); params.put(Params.CODEPRO.paramName, getStringOrNull(codepro)); params.put(Params.EXPIRE.paramName, getStringOrNull(expirePeriod)); setAmount(params); return params; }

Target:
private Map<String, String> makeParams() { HashMap<String, String> params = new HashMap<>(); params.put(Params.TO.paramName, to); setAmount(params); if (comment != null) { params.put(Params.COMMENT.paramName, comment); } if (message != null) { params.put(Params.MESSAGE.paramName, message); } if (label != null) { params.put(Params.LABEL.paramName, label); } if (codepro != null) { params.put(Params.CODEPRO.paramName, codepro.toString()); } if (expirePeriod != null) { params.put(Params.EXPIRE.paramName, expirePeriod.toString()); } return params; }
Source:
private int getNumBytes(final List<Pair<Integer, Double>> columns) { return columns.size() * (Integer.SIZE + Double.SIZE); }

Target:
private int getNumBytes(final List<Pair<Integer, Double>> columns) { return Integer.SIZE + columns.size() * (Integer.SIZE + Double.SIZE); }
Source:
public void delete(final Breakpoint breakpoint) { readAllBreakpointMarker.then(onFulfilled -> { BreakpointStorageImpl.this.breakpoints.removeIf( b -> b.getLineNumber() == breakpoint.getLineNumber() && b.getPath().equals(breakpoint.getPath()) ); if (storage != null) { preserve(); } }); }

Target:
public void delete(final Breakpoint breakpoint) { readAllBreakpointMarker.then(onFulfilled -> { BreakpointStorageImpl.this.breakpoints.removeIf( b -> b.getLineNumber() == breakpoint.getLineNumber() && b.getPath().equals(breakpoint.getPath()) ); preserve(); }); }
Source:
protected void drawItemStackAt(ItemStack stack, int x, int y) { RenderHelper.enableGUIStandardItemLighting(); RenderHelper.disableStandardItemLighting(); itemRender.renderItemAndEffectIntoGUI(mc.thePlayer, stack, x, y); itemRender.renderItemOverlayIntoGUI(mc.fontRendererObj, stack, x, y, null); }

Target:
protected void drawItemStackAt(ItemStack stack, int x, int y) { RenderHelper.enableGUIStandardItemLighting(); itemRender.renderItemAndEffectIntoGUI(mc.thePlayer, stack, x, y); itemRender.renderItemOverlayIntoGUI(mc.fontRendererObj, stack, x, y, null); RenderHelper.disableStandardItemLighting(); }
Source:
public Socket open(int socketTimeout) throws IOException { boolean isHttpProxy = false; InetSocketAddress targetAddress = null; SocketChannel channel = null; try { targetAddress = JnlpAgentEndpointResolver.getResolvedHttpProxyAddress(host, port); if (targetAddress == null) { targetAddress = new InetSocketAddress(host, port); } else { isHttpProxy = true; } channel = SocketChannel.open(targetAddress); Socket socket = channel.socket(); socket.setTcpNoDelay(true); socket.setSoTimeout(socketTimeout); if (isHttpProxy) { String connectCommand = String.format("CONNECT %s:%s HTTP/1.1\r\nHost: %s\r\n\r\n", host, port, host); socket.getOutputStream().write(connectCommand.getBytes("UTF-8")); BufferedInputStream is = new BufferedInputStream(socket.getInputStream()); String line = readLine(is); String[] responseLineParts = line.split(" "); if (responseLineParts.length < 2 || !responseLineParts[1].equals("200")) throw new IOException("Got a bad response from proxy: " + line); while (!readLine(is).isEmpty()) { } } return socket; } catch (IOException e) { IOUtils.closeQuietly(channel); String suffix = ""; if (isHttpProxy) { suffix = " through proxy " + targetAddress.toString(); } throw new IOException("Failed to connect to " + host + ':' + port + suffix, e); } }

Target:
public Socket open(int socketTimeout) throws IOException { boolean isHttpProxy = false; InetSocketAddress targetAddress = null; SocketChannel channel = null; try { targetAddress = JnlpAgentEndpointResolver.getResolvedHttpProxyAddress(host, port); if (targetAddress == null) { targetAddress = new InetSocketAddress(host, port); } else { isHttpProxy = true; } channel = SocketChannel.open(targetAddress); Socket socket = channel.socket(); socket.setTcpNoDelay(true); socket.setSoTimeout(socketTimeout); if (isHttpProxy) { String connectCommand = String.format("CONNECT %s:%s HTTP/1.1\r\nHost: %s\r\n\r\n", host, port, host); socket.getOutputStream() .write(connectCommand.getBytes("UTF-8")); BufferedInputStream is = new BufferedInputStream(socket.getInputStream()); String line = readLine(is); String[] responseLineParts = line.split(" "); if (responseLineParts.length < 2 || !responseLineParts[1].equals("200")) { throw new IOException("Got a bad response from proxy: " + line); } while (!readLine(is).isEmpty()) { } } return socket; } catch (IOException e) { if (channel != null) { try { channel.close(); } catch (IOException suppressed) { e = ThrowableUtils.addSuppressed(e, suppressed); } } String suffix = ""; if (isHttpProxy) { suffix = " through proxy " + targetAddress.toString(); } throw new IOException("Failed to connect to " + host + ':' + port + suffix, e); } }
Source:
public void testUpdateToolPathDockerfile() throws IOException, TimeoutException, ApiException { ApiClient client = getWebClient(); UsersApi usersApi = new UsersApi(client); final Long userId = usersApi.getUser().getId(); usersApi.refresh(userId); ContainersApi toolsApi = new ContainersApi(client); final PublishRequest publishRequest = new PublishRequest(); publishRequest.setPublish(true); DockstoreTool c = getContainer(); DockstoreTool toolTest = toolsApi.registerManual(c); toolsApi.refresh(toolTest.getId()); toolTest.setDefaultDockerfilePath("/test1/Dockerfile"); toolsApi.updateTagContainerPath(toolTest.getId(),toolTest); toolsApi.refresh(toolTest.getId()); final CommonTestUtilities.TestingPostgres testingPostgres = getTestingPostgres(); final Long toolID = testingPostgres.runSelectStatement("select id from tool where name = 'testUpdatePath'", new ScalarHandler<>()); final Long tagID = testingPostgres.runSelectStatement("select tagid from tool_tag where toolid = "+toolID, new ScalarHandler<>()); final String path = testingPostgres.runSelectStatement("select dockerfilepath from tag where id = "+tagID, new ScalarHandler<>()); Assert.assertTrue("the cwl path should be changed to /test1/Dockerfile", path.equals("/test1/Dockerfile")); }

Target:
public void testUpdateToolPathDockerfile() throws IOException, TimeoutException, ApiException { ContainersApi toolsApi = setupWebService(); DockstoreTool c = getContainer(); DockstoreTool toolTest = toolsApi.registerManual(c); toolsApi.refresh(toolTest.getId()); toolTest.setDefaultDockerfilePath("/test1/Dockerfile"); toolsApi.updateTagContainerPath(toolTest.getId(),toolTest); toolsApi.refresh(toolTest.getId()); final String path = getPathfromDB("dockerfilepath"); Assert.assertTrue("the cwl path should be changed to /test1/Dockerfile", path.equals("/test1/Dockerfile")); }
Source:
public void writeHeaders(HttpServletRequest request, HttpServletResponse response) { headerWriters.forEach(headerWriter -> headerWriter.writeHeaders(request, response)); }

Target:
public void writeHeaders(HttpServletRequest request, HttpServletResponse response) { this.headerWriters.forEach(headerWriter -> headerWriter.writeHeaders(request, response)); }
Source:
public void testScanExerciseInTheWrongPlace() { plugin.scanExercise(simpleAllTestsPassProject, "ar.R"); Path availablePointsJson = simpleAllTestsPassProject.resolve(".available_points.json"); ImmutableList<TestDesc> re = null; try { re = new RExerciseDescParser(availablePointsJson).parse(); } catch (IOException e) { System.out.println("Something wrong: " + e.getMessage()); } assertTrue(re == null); }

Target:
public void testScanExerciseInTheWrongPlace() throws IOException { plugin.scanExercise(simpleAllTestsPassProject, "ar.R"); Path availablePointsJson = simpleAllTestsPassProject.resolve(".available_points.json"); exception.expect(IOException.class); new RExerciseDescParser(availablePointsJson).parse(); }
Source:
private void execute(final EventualMessage msg, final ActorProcessingThread currentThread, final WebDebugger dbg, final int i) { currentThread.currentMessage = msg; if (actor instanceof TracingActor) { TracingActor.handleBreakpointsAndStepping(msg, dbg, actor); } if (i >= 0 && VmSettings.MESSAGE_TIMESTAMPS) { executionTimeStamps[i] = System.currentTimeMillis(); } try { msg.execute(); } finally { if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } } }

Target:
private void execute(final EventualMessage msg, final ActorProcessingThread currentThread, final WebDebugger dbg, final int i) { currentThread.currentMessage = msg; if (VmSettings.ACTOR_TRACING) { TracingActor.handleBreakpointsAndStepping(msg, dbg, actor); } if (i >= 0 && VmSettings.MESSAGE_TIMESTAMPS) { executionTimeStamps[i] = System.currentTimeMillis(); } try { msg.execute(); } finally { if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } } }
Source:
private FileObject ingestFileObject(ContentObject parent, Resource parentResc, Resource childResc) throws DepositException, IOException { if (skipResumed(childResc)) { return null; } WorkObject work = (WorkObject) parent; FileObject obj = addFileToWork(work, childResc); addIngestionEventForChild(obj); addPremisEvents(obj); addDescription(work); addClicks(1); log.info("Created file object for deposit {}", obj.getPid(), getDepositPID()); return obj; }

Target:
private void ingestFileObject(ContentObject parent, Resource parentResc, Resource childResc) throws DepositException, IOException { if (skipResumed(childResc)) { return; } WorkObject work = (WorkObject) parent; FileObject obj = addFileToWork(work, childResc); addIngestionEventForChild(obj); addPremisEvents(obj); addDescription(obj); addClicks(1); log.info("Created file object for deposit {}", obj.getPid(), getDepositPID()); }
Source:
public final String getContent() throws IOException { if (content == null || charset == null) { return null; } ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteStreams.copy(new ByteArrayInputStream(content), out); return out.toString(charset.name()); }

Target:
public final String getContent() throws IOException { if (content == null) { return null; } return new String(content, charset.name()); }
Source:
public static void setup() { dataStore = new MetaDataStore(); dataStore.populateEntityDictionary(new EntityDictionary(new HashMap<>())); AggregationDictionary dictionary = new AggregationDictionary(new HashMap<>()); dictionary.bindEntity(PlayerStats.class); dictionary.bindEntity(Country.class); dictionary.bindEntity(SubCountry.class); dictionary.bindEntity(PlayerStatsView.class); dictionary.bindEntity(Player.class); dictionary.bindEntity(VideoGame.class); dataStore.storeMetaData(dictionary); }

Target:
public static void setup() { dataStore = new MetaDataStore(); AggregationDictionary dictionary = new AggregationDictionary(new HashMap<>()); dictionary.bindEntity(PlayerStats.class); dictionary.bindEntity(Country.class); dictionary.bindEntity(SubCountry.class); dictionary.bindEntity(PlayerStatsView.class); dictionary.bindEntity(Player.class); dictionary.bindEntity(VideoGame.class); dataStore.storeMetaData(dictionary); }
Source:
public boolean doPreparationsAndCheckCanAccessPrivateData(UUID id) { if (!getUserEntityById(id).canAccessPrivateData()) { return false; } withLockOnUser(id, user -> { boolean updated = doPreparations(user); if (updated) { userAnonymizedService.updateUserAnonymized(user.getAnonymized()); userRepository.save(user); } return null; }); return true; }

Target:
public boolean doPreparationsAndCheckCanAccessPrivateData(UUID id) { return withLockOnUser(id, user -> { if (!user.canAccessPrivateData()) { return false; } boolean updated = doPreparations(user); if (updated) { userAnonymizedService.updateUserAnonymized(user.getAnonymized()); userRepository.save(user); } return true; }); }
Source:
private Set<K> keySetWithPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.KEY); ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, toData(predicate)); ClientMessage response = invokeWithPredicate(request, predicate); MapKeySetWithPagingPredicateCodec.ResponseParameters resultParameters = MapKeySetWithPagingPredicateCodec .decodeResponse(response); if (resultParameters.response.isEmpty()) { return Collections.EMPTY_SET; } SerializationService serializationService = getSerializationService(); int size = resultParameters.response.size(); Set<K> keySet = new HashSet<>(size); K lastKey = null; for (int i = 0; i < size; i++) { K key = serializationService.toObject(resultParameters.response.get(i)); keySet.add(key); if (i == size - 1) { lastKey = key; } } resultParameters.response.forEach(data -> keySet.add(serializationService.toObject(data))); pagingPredicate.setAnchor(pagingPredicate.getPage(), new AbstractMap.SimpleImmutableEntry(lastKey, null)); return keySet; }

Target:
private Set keySetWithPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.KEY); PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService()); ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder); ClientMessage response = invokeWithPredicate(request, predicate); MapKeySetWithPagingPredicateCodec.ResponseParameters resultParameters = MapKeySetWithPagingPredicateCodec .decodeResponse(response); SerializationService serializationService = getSerializationService(); pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService)); return new UnmodifiableLazySet(resultParameters.response, serializationService); }
Source:
public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { Configuration conf = jobContext.getConfiguration(); URI uri = URI.create(conf.get(FS_URI)); String[] sourcePaths = conf.get(SOURCE_PATHS).split(","); Boolean recursiveCopy = conf.getBoolean(RECURSIVE_COPY, true); FileSystem fileSystem = FileSystem.get(uri, conf); int maxSplitSize = conf.getInt(MAX_SPLIT_SIZE, DEFAULT_MAX_SPLIT_SIZE); List<FileStatus> fileStatuses = new ArrayList<>(); List<String> baseFolders = new ArrayList<>(); for (String prefix : sourcePaths) { try { FileStatus fileStatus = fileSystem.getFileStatus(new Path(prefix)); if (fileStatus.isFile()) { prefix = ""; } recursivelyAddFileStatus(fileStatuses, baseFolders, prefix, fileStatus, recursiveCopy, fileSystem); } catch (Exception e) { LOG.warn(e.getMessage()); } } fileSystem.close(); List<AbstractFileMetadata> fileMetaDataList = getFileMetadaDataList(fileStatuses, baseFolders, fileStatuses.size(), getCredentialsFromConf(conf)); int numSplits = (fileMetaDataList.size() - 1) / maxSplitSize + 1; PriorityQueue<AbstractMetadataInputSplit> abstractInputSplits = new PriorityQueue<>(numSplits); for (int i = 0; i < numSplits; i++) { abstractInputSplits.add(getInputSplit()); } for (int i = 0; i < fileMetaDataList.size(); i++) { AbstractMetadataInputSplit minInputSplit = abstractInputSplits.poll(); minInputSplit.addFileMetadata(fileMetaDataList.get(i)); abstractInputSplits.add(minInputSplit); } List<InputSplit> inputSplits = new ArrayList<>(); inputSplits.addAll(abstractInputSplits); return inputSplits; }

Target:
public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException { Configuration conf = jobContext.getConfiguration(); URI uri = URI.create(conf.get(FS_URI)); String[] sourcePaths = conf.get(SOURCE_PATHS).split(","); boolean recursive = conf.getBoolean(RECURSIVE_COPY, true); FileSystem fileSystem = FileSystem.get(uri, conf); int maxSplitSize = conf.getInt(MAX_SPLIT_SIZE, DEFAULT_MAX_SPLIT_SIZE); List<AbstractFileMetadata> fileMetaDataList = new ArrayList<>(); for (String prefix : sourcePaths) { recursivelyAddFileStatus(fileMetaDataList, prefix, new Path(prefix), recursive, fileSystem, conf); } Collections.sort(fileMetaDataList); Collections.reverse(fileMetaDataList); int numSplits = (fileMetaDataList.size() - 1) / maxSplitSize + 1; PriorityQueue<AbstractMetadataInputSplit> abstractInputSplits = new PriorityQueue<>(numSplits); for (int i = 0; i < numSplits; i++) { abstractInputSplits.add(getInputSplit()); } List<InputSplit> inputSplits = new ArrayList<>(); for (AbstractFileMetadata fileMetadata : fileMetaDataList) { AbstractMetadataInputSplit minInputSplit = abstractInputSplits.poll(); minInputSplit.addFileMetadata(fileMetadata); if (minInputSplit.getLength() < maxSplitSize) { abstractInputSplits.add(minInputSplit); } else { inputSplits.add(minInputSplit); } } inputSplits.addAll(abstractInputSplits); return inputSplits; }
Source:
private static List<ITmfXmlStateAttribute> nullList() { final List<ITmfXmlStateAttribute> empty_LIST = Collections.<ITmfXmlStateAttribute>emptyList(); if (empty_LIST == null) { throw new IllegalStateException(); } return empty_LIST; }

Target:
private static List<ITmfXmlStateAttribute> nullList() { final List<ITmfXmlStateAttribute> emptyList = Collections.<ITmfXmlStateAttribute>emptyList(); if (emptyList == null) { throw new IllegalStateException(); } return emptyList; }
Source:
private void logSuccessfulMerge(ResourceMapping[] emfMappings) { final List<IResource> iResources = getInvolvedIResources(emfMappings); final MultiStatus multiStatus = new MultiStatus(EMFCompareIDEUIPlugin.PLUGIN_ID, 0, EMFCompareIDEUIMessages.getString("EMFResourceMappingMerger.successfulModelMerge", String.valueOf(iResources.size())), null); for (IResource iResource : iResources) { final Status status = new Status(IStatus.OK, EMFCompareIDEUIPlugin.PLUGIN_ID, iResource .getFullPath().toOSString()); multiStatus.add(status); } log(multiStatus); }

Target:
private void logSuccessfulMerge(ResourceMapping[] emfMappings) { logMessageWithEMFMappings("EMFResourceMappingMerger.successfulModelMerge", emfMappings); }
Source:
private ChannelHandler replace( Predicate<AbstractChannelHandlerContext> predicate, String newName, ChannelHandler newHandler) { checkMultiplicity(newHandler); if (newName == null) { newName = generateName(newHandler); } AbstractChannelHandlerContext oldCtx; AbstractChannelHandlerContext newCtx = newContext(newName, newHandler); final int idx; synchronized (handlers) { idx = findCtxIdx(predicate); if (idx == -1) { throw new NoSuchElementException(); } oldCtx = handlers.get(idx); assert oldCtx != head && oldCtx != tail && oldCtx != null; if (!oldCtx.name().equals(newName)) { if (context(newName) != null) { throw new IllegalArgumentException("Duplicate handler name: " + newName); } } AbstractChannelHandlerContext removed = handlers.remove(idx); assert removed != null; handlers.add(idx, newCtx); } EventExecutor executor = executor(); if (executor.inEventLoop()) { replace0(oldCtx, newCtx); } else { try { executor.execute(() -> replace0(oldCtx, newCtx)); } catch (Throwable cause) { synchronized (handlers) { handlers.remove(idx); handlers.add(idx, oldCtx); } throw cause; } } return oldCtx.handler(); }

Target:
private ChannelHandler replace( Predicate<AbstractChannelHandlerContext> predicate, String newName, ChannelHandler newHandler) { checkMultiplicity(newHandler); if (newName == null) { newName = generateName(newHandler); } AbstractChannelHandlerContext oldCtx; AbstractChannelHandlerContext newCtx = newContext(newName, newHandler); EventExecutor executor = executor(); boolean inEventLoop = executor.inEventLoop(); synchronized (handlers) { int idx = findCtxIdx(predicate); if (idx == -1) { throw new NoSuchElementException(); } oldCtx = handlers.get(idx); assert oldCtx != head && oldCtx != tail && oldCtx != null; if (!oldCtx.name().equals(newName)) { if (context(newName) != null) { throw new IllegalArgumentException("Duplicate handler name: " + newName); } } AbstractChannelHandlerContext removed = handlers.set(idx, newCtx); assert removed != null; if (!inEventLoop) { try { executor.execute(() -> replace0(oldCtx, newCtx)); return oldCtx.handler(); } catch (Throwable cause) { handlers.set(idx, oldCtx); throw cause; } } } replace0(oldCtx, newCtx); return oldCtx.handler(); }
Source:
private ArrayNode rawDiff() { if (rawDiff == null) { final DocumentMapping mapping = getMapping(); ObjectNode oldRevisionSource = mapper.valueToTree(oldRevision); ObjectNode newRevisionSource = mapper.valueToTree(newRevision); final JsonNode diff = JsonDiff.asJson(oldRevisionSource, newRevisionSource, DIFF_FLAGS); final ArrayNode rawDiff = ClassUtils.checkAndCast(diff, ArrayNode.class); final ArrayNode filteredRawDiff = mapper.createArrayNode(); final Iterator<JsonNode> elements = rawDiff.elements(); Set<String> fieldsToSkip = null; while (elements.hasNext()) { ObjectNode change = ClassUtils.checkAndCast(elements.next(), ObjectNode.class); final String property = getChangeRootProperty(change); if (fieldsToSkip != null && fieldsToSkip.contains(property)) { continue; } if (mapping.getRevisionFields().contains(property) && mapping.isCollection(property)) { change = new RevisionPropertyDiff(property, serializeToCommitDetailValue(oldRevisionSource, property), serializeToCommitDetailValue(newRevisionSource, property)) .asPatch(mapper, oldRevisionSource, true ); if (fieldsToSkip == null) { fieldsToSkip = Sets.newHashSetWithExpectedSize(1); } fieldsToSkip.add(property); } if (!Revision.Fields.CREATED.equals(property) && !Revision.Fields.REVISED.equals(property)) { filteredRawDiff.add(change); } } this.rawDiff = filteredRawDiff; } return this.rawDiff; }

Target:
private ArrayNode rawDiff() { if (rawDiff == null) { final DocumentMapping mapping = getMapping(); ObjectNode oldRevisionSource = mapper.valueToTree(oldRevision); ObjectNode newRevisionSource = mapper.valueToTree(newRevision); final JsonNode diff = JsonDiff.asJson(oldRevisionSource, newRevisionSource, DIFF_FLAGS); final ArrayNode rawDiff = ClassUtils.checkAndCast(diff, ArrayNode.class); final ArrayNode filteredRawDiff = mapper.createArrayNode(); final Iterator<JsonNode> elements = rawDiff.elements(); Set<String> fieldsToSkip = null; while (elements.hasNext()) { ObjectNode change = ClassUtils.checkAndCast(elements.next(), ObjectNode.class); final String property = getChangeRootProperty(change); if (Revision.isRevisionField(property) || (fieldsToSkip != null && fieldsToSkip.contains(property))) { continue; } if (mapping.getRevisionFields().contains(property) && mapping.isCollection(property)) { change = new RevisionPropertyDiff(property, serializeToCommitDetailValue(oldRevisionSource, property), serializeToCommitDetailValue(newRevisionSource, property)) .asPatch(mapper, oldRevisionSource, true ); if (fieldsToSkip == null) { fieldsToSkip = Sets.newHashSetWithExpectedSize(1); } fieldsToSkip.add(property); } filteredRawDiff.add(change); } this.rawDiff = filteredRawDiff; } return this.rawDiff; }
Source:
private void addArgumentsAsVariables() { Object[] args = mi.getArguments(); if (args.length == 0) { return; } Object targetObject = mi.getThis(); Class<?> targetClass = AopProxyUtils.ultimateTargetClass(targetObject); if (targetClass == null) { targetClass = targetObject.getClass(); } Method method = AopUtils.getMostSpecificMethod(mi.getMethod(), targetClass); String[] paramNames = parameterNameDiscoverer.getParameterNames(method); if (paramNames == null) { logger.warn("Unable to resolve method parameter names for method: " + method + ". Debug symbol information is required if you are using parameter names in expressions."); return; } for (int i = 0; i < args.length; i++) { if (paramNames[i] != null) { super.setVariable(paramNames[i], args[i]); } } }

Target:
private void addArgumentsAsVariables() { Object[] args = mi.getArguments(); if (args.length == 0) { return; } Object targetObject = mi.getThis(); Class<?> targetClass = AopProxyUtils.ultimateTargetClass(targetObject); if (targetClass == null) { targetClass = targetObject.getClass(); } Method method = AopUtils.getMostSpecificMethod(mi.getMethod(), targetClass); String[] paramNames = parameterNameDiscoverer.getParameterNames(method); if (paramNames == null) { logger.warn("Unable to resolve method parameter names for method: " + method + ". Debug symbol information is required if you are using parameter names in expressions."); return; } for (int i = 0; i < args.length; i++) { if (paramNames[i] != null) { setVariable(paramNames[i], args[i]); } } }
Source:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { try { GatewayOrder gatewayOrder = build3dsResponseAuthOrder(request); GatewayClient.Response response = authoriseClient.postRequestFor(null, request.getGatewayAccount(), gatewayOrder, ImmutableList.of(new HttpCookie(WORLDPAY_MACHINE_COOKIE_NAME, gatewayOrder.getProviderSessionId().get()))); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = getWorldpayGatewayResponse(response); if (!gatewayResponse.getBaseResponse().isPresent()) gatewayResponse.throwGatewayError(); BaseAuthoriseResponse authoriseResponse = gatewayResponse.getBaseResponse().get(); return Gateway3DSAuthorisationResponse.of(gatewayResponse.toString(), authoriseResponse.authoriseStatus(), authoriseResponse.getTransactionId()); } catch (GatewayErrorException e) { return Gateway3DSAuthorisationResponse.of(e.getMessage(), BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION); } }

Target:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { try { List<HttpCookie> cookies = request.getProviderSessionId() .map(providerSessionId -> singletonList(new HttpCookie(WORLDPAY_MACHINE_COOKIE_NAME, providerSessionId))) .orElse(emptyList()); GatewayClient.Response response = authoriseClient.postRequestFor( null, request.getGatewayAccount(), build3dsResponseAuthOrder(request), cookies); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = getWorldpayGatewayResponse(response); if (!gatewayResponse.getBaseResponse().isPresent()) gatewayResponse.throwGatewayError(); BaseAuthoriseResponse authoriseResponse = gatewayResponse.getBaseResponse().get(); return Gateway3DSAuthorisationResponse.of(gatewayResponse.toString(), authoriseResponse.authoriseStatus(), authoriseResponse.getTransactionId()); } catch (GatewayErrorException e) { return Gateway3DSAuthorisationResponse.of(e.getMessage(), BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION); } }
Source:
public void runTests(TestPage pageToTest) throws TestExecutionException { processingQueue.addLast(pageToTest); String html = pageToTest.getHtml(); try { if (html.isEmpty()) client.send(EMPTY_PAGE_CONTENT); else client.send(html); } catch (InterruptedException e) { exceptionOccurred(e); throw new TestExecutionException("Testing has been interrupted", e); } catch (IOException e) { exceptionOccurred(e); throw new TestExecutionException("Communication error during testing", e); } }

Target:
public void runTests(TestPage pageToTest) throws TestExecutionException { processingQueue.addLast(pageToTest); String html = pageToTest.getHtml(); try { if (html.isEmpty()) client.send(EMPTY_PAGE_CONTENT); else client.send(html); } catch (InterruptedException e) { Thread.currentThread().interrupt(); exceptionOccurred(e); throw new TestExecutionException("Testing has been interrupted", e); } catch (IOException e) { exceptionOccurred(e); throw new TestExecutionException("Communication error during testing", e); } }
Source:
public FindEventsResponse getFindEventsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final FindEventsAsyncRequest request) throws OsgpException { LOGGER.info("Get find events response for organisation: and device: {}.", organisationIdentification, request.getDeviceIdentification()); final FindEventsResponse response = new FindEventsResponse(); try { final List<MeterResponseData> meterResponseDataList = this.meterResponseDataService .dequeueMeterResponseData(request.getCorrelationUid()); final List<Event> events = this.getEventsFromMeterResponseData(meterResponseDataList); LOGGER.info("Get find events response: number of events: {}", events.size()); for (final Event event : events) { LOGGER.info("EventCode: {}, Timestamp: {}, EventCounter: {}", event.getEventCode(), event.getTimestamp(), event.getEventCounter()); } response.getEvents().addAll(this.managementMapper.mapAsList(events, com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event.class)); for (final MeterResponseData meterResponseData : meterResponseDataList) { this.throwExceptionIfResultNotOk(meterResponseData, "Find Events"); } response.setResult(OsgpResultType.OK); } catch (final MethodConstraintViolationException e) { LOGGER.error("FindEventsRequest Exception", e.getMessage(), e.getStackTrace(), e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_SMART_METERING, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }

Target:
public FindEventsResponse getFindEventsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final FindEventsAsyncRequest request) throws OsgpException { LOGGER.info("Get find events response for organisation: and device: {}.", organisationIdentification, request.getDeviceIdentification()); final FindEventsResponse response = new FindEventsResponse(); try { final List<MeterResponseData> meterResponseDataList = this.meterResponseDataService .dequeueMeterResponseData(request.getCorrelationUid()); for (final MeterResponseData meterResponseData : meterResponseDataList) { this.throwExceptionIfResultNotOk(meterResponseData, "Find Events"); } final List<Event> events = this.getEventsFromMeterResponseData(meterResponseDataList); LOGGER.info("Get find events response: number of events: {}", events.size()); for (final Event event : events) { LOGGER.info("EventCode: {}, Timestamp: {}, EventCounter: {}", event.getEventCode(), event.getTimestamp(), event.getEventCounter()); } response.getEvents().addAll(this.managementMapper.mapAsList(events, com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event.class)); response.setResult(OsgpResultType.OK); } catch (final MethodConstraintViolationException e) { LOGGER.error("FindEventsRequest Exception", e.getMessage(), e.getStackTrace(), e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_SMART_METERING, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }