auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static JavaFile createJavaFile(RuntimePermissionsAnnotatedElement element) { List<ExecutableElement> permissionsMethods = element.getAllNeedsPermissionsMethods(); TypeSpec clazz = TypeSpec.classBuilder(element.getDispatcherClassName()) .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addFields(createFields(permissionsMethods)) .addMethod(createConstructor()) .addMethods(createNeedsPermissionMethods(element)) .addMethods(createNeedsPermissionsMethods(element)) .addMethod(createOnRequestPermissionsResult(element.getClassName(), permissionsMethods, element)) .build(); String packageName = element.getPackageName(); return JavaFile.builder(packageName, clazz).build(); }

Target:
static JavaFile createJavaFile(RuntimePermissionsAnnotatedElement element) { List<ExecutableElement> permissionsMethods = element.getAllNeedsPermissionsMethods(); TypeSpec clazz = TypeSpec.classBuilder(element.getDispatcherClassName()) .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addFields(createFields(permissionsMethods)) .addMethod(createConstructor()) .addMethods(createNeedsPermissionMethods(element)) .addMethods(createNeedsPermissionsMethods(element)) .addMethod(createOnRequestPermissionsResult(element)) .build(); String packageName = element.getPackageName(); return JavaFile.builder(packageName, clazz).build(); }
Source:
public VPNConfigParser(Json json) { super(json, TypeLiteral.get(VPNConfig.class)); }

Target:
VPNConfigParser(Json json) { super(json, TypeLiteral.get(VPNConfig.class)); }
Source:
public List<RpslObject> getByKeys(final ObjectType type, final Collection<CIString> searchKeys) { final List<RpslObject> result = new ArrayList<>(searchKeys.size()); for (final CIString searchKey : searchKeys) { try { result.add(getByKey(type, searchKey)); } catch (EmptyResultDataAccessException ignored) { LOGGER.debug("EmptyResultDataAccessException in class ", ignored.getMessage(), ignored.getClass().getName()); } } return result; }

Target:
public List<RpslObject> getByKeys(final ObjectType type, final Collection<CIString> searchKeys) { final List<RpslObject> result = new ArrayList<>(searchKeys.size()); for (final CIString searchKey : searchKeys) { try { result.add(getByKey(type, searchKey)); } catch (EmptyResultDataAccessException ignored) { } } return result; }
Source:
public void testWithSet() { final AlarmNotification alarmNotification = new AlarmNotification(AlarmType.CLOCK_INVALID, true); final Set<AlarmNotification> alarmNotificationSet = new TreeSet<AlarmNotification>(); alarmNotificationSet.add(alarmNotification); final AlarmNotifications alarmNotifications = new AlarmNotifications(alarmNotificationSet); final AlarmNotificationsDto alarmNotificationsDto = this.configurationMapper.map(alarmNotifications, AlarmNotificationsDto.class); assertNotNull(alarmNotifications); assertNotNull(alarmNotificationsDto); assertNotNull(alarmNotificationSet); assertNotNull(alarmNotificationsDto.getAlarmNotifications()); assertEquals(alarmNotificationSet.size(), alarmNotificationsDto.getAlarmNotifications().size()); assertFalse(alarmNotificationSet.isEmpty()); assertFalse(alarmNotificationsDto.getAlarmNotifications().isEmpty()); assertEquals(alarmNotificationSet.isEmpty(), alarmNotificationsDto.getAlarmNotifications().isEmpty()); final AlarmNotificationDto alarmNotificationDto = new AlarmNotificationDto(AlarmTypeDto.CLOCK_INVALID, true); assertTrue(alarmNotificationsDto.getAlarmNotifications().contains(alarmNotificationDto)); }

Target:
public void testWithSet() { final AlarmNotification alarmNotification = new AlarmNotification(AlarmType.CLOCK_INVALID, true); final Set<AlarmNotification> alarmNotificationSet = new TreeSet<AlarmNotification>(); alarmNotificationSet.add(alarmNotification); final AlarmNotifications alarmNotifications = new AlarmNotifications(alarmNotificationSet); final AlarmNotificationsDto alarmNotificationsDto = this.configurationMapper.map(alarmNotifications, AlarmNotificationsDto.class); assertNotNull(alarmNotificationsDto); assertNotNull(alarmNotificationsDto.getAlarmNotificationsSet()); assertEquals(alarmNotificationSet.size(), alarmNotificationsDto.getAlarmNotificationsSet().size()); assertFalse(alarmNotificationsDto.getAlarmNotificationsSet().isEmpty()); final AlarmNotificationDto alarmNotificationDto = new AlarmNotificationDto(AlarmTypeDto.CLOCK_INVALID, true); assertTrue(alarmNotificationsDto.getAlarmNotificationsSet().contains(alarmNotificationDto)); }
Source:
public static String SignCertificateRequest(String request, String label) throws FileNotFoundException, UnsupportedEncodingException, IOException { File pkicertdir = new File(Config.resolveCABasePath(), "certs"); File pkireqdir = new File(Config.resolveCABasePath(), "requests"); String reqFileName = String.format("%1$sreq.pem", label); String certFileName = String.format("%1$scert.pem", label); OutputStream os = null; try { os = new FileOutputStream( new File( pkireqdir, reqFileName ) ); os.write(request.getBytes("UTF-8")); } finally { if (os == null) { try { os.close(); } catch (IOException e) { log.error("error during close", e); } } } if ( !new OpenSslCAWrapper().SignCertificateRequest( reqFileName, Config.<Integer> GetValue(ConfigValues.VdsCertificateValidityInYears) * 365, certFileName ) ) { throw new RuntimeException("Certificate enrollment failed"); } return FileUtil.readAllText(new File(pkicertdir, certFileName).getPath()); }

Target:
public static String SignCertificateRequest(String request, String label) throws IOException { File pkicertdir = new File(Config.resolveCABasePath(), "certs"); File pkireqdir = new File(Config.resolveCABasePath(), "requests"); String reqFileName = String.format("%1$sreq.pem", label); String certFileName = String.format("%1$scert.pem", label); OutputStream os = null; try { os = new FileOutputStream( new File( pkireqdir, reqFileName ) ); os.write(request.getBytes("UTF-8")); } finally { if (os == null) { try { os.close(); } catch (IOException e) { log.error("error during close", e); } } } if ( !new OpenSslCAWrapper().SignCertificateRequest( reqFileName, Config.<Integer> GetValue(ConfigValues.VdsCertificateValidityInYears) * 365, certFileName ) ) { throw new RuntimeException("Certificate enrollment failed"); } return FileUtil.readAllText(new File(pkicertdir, certFileName).getPath()); }
Source:
public void testWithEmptyArrays() { final KeySet keySetOriginal = new KeySet(); final byte[] authenticationKey = {}; keySetOriginal.setAuthenticationKey(authenticationKey); final byte[] encryptionKey = {}; keySetOriginal.setEncryptionKey(encryptionKey); final com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet keySetMapped = this.mapperFactory .getMapperFacade().map(keySetOriginal, com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet.class); assertNotNull(keySetMapped); assertTrue(keySetMapped.getAuthenticationKey().length == 0); assertTrue(keySetMapped.getEncryptionKey().length == 0); }

Target:
public void testWithEmptyArrays() { final KeySet keySetOriginal = new KeySet(); final byte[] authenticationKey = {}; keySetOriginal.setAuthenticationKey(authenticationKey); final byte[] encryptionKey = {}; keySetOriginal.setEncryptionKey(encryptionKey); final com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet keySetMapped = this.configurationMapper .map(keySetOriginal, com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet.class); assertNotNull(keySetMapped); assertNotNull(keySetMapped.getAuthenticationKey()); assertTrue(keySetMapped.getAuthenticationKey().length == 0); assertNotNull(keySetMapped.getEncryptionKey()); assertTrue(keySetMapped.getEncryptionKey().length == 0); }
Source:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { final long start = System.currentTimeMillis(); try { filterChain.doFilter(request, response); } finally { final long time = System.currentTimeMillis(); final Long timing = time - start; final String userAgent = Optional.ofNullable(request.getHeader("User-Agent")).orElse("-"); final String user = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName).orElse("-"); final String method = request.getMethod(); final String path = request.getRequestURI(); final String query = Optional.ofNullable(request.getQueryString()).map(q -> "?" + q).orElse(""); final String contentEncoding = Optional.ofNullable(request.getHeader(HttpHeaders.CONTENT_ENCODING)) .orElse("-"); final String acceptEncoding = Optional.ofNullable(request.getHeader(HttpHeaders.ACCEPT_ENCODING)) .orElse("-"); final Long contentLength = request.getContentLengthLong() == -1 ? 0 : request.getContentLengthLong(); ACCESS_LOGGER.info("[ACCESS_LOG] \"{}{}\" \"{}\" \"{}\" statusCode: ms \"{}\" \"{}\" bytes", method, path, query, userAgent, user, response.getStatus(), timing, contentEncoding, acceptEncoding, contentLength); nakadiKpiPublisher.publish(accessLogEventType, () -> new JSONObject() .put("method", method) .put("path", path) .put("query", query) .put("app", user) .put("app_hashed", nakadiKpiPublisher.hash(user)) .put("status_code", response.getStatus()) .put("response_time_ms", timing)); } }

Target:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { final long start = System.currentTimeMillis(); try { filterChain.doFilter(request, response); } finally { final long time = System.currentTimeMillis(); final Long timing = time - start; final String userAgent = Optional.ofNullable(request.getHeader("User-Agent")).orElse("-"); final String user = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName).orElse("-"); final String method = request.getMethod(); final String path = request.getRequestURI(); final String query = Optional.ofNullable(request.getQueryString()).map(q -> "?" + q).orElse(""); final String contentEncoding = Optional.ofNullable(request.getHeader(HttpHeaders.CONTENT_ENCODING)) .orElse("-"); final String acceptEncoding = Optional.ofNullable(request.getHeader(HttpHeaders.ACCEPT_ENCODING)) .orElse("-"); final Long contentLength = request.getContentLengthLong() == -1 ? 0 : request.getContentLengthLong(); ACCESS_LOGGER.info("{} \"{}{}\" \"{}\" \"{}\" {}ms \"{}\" \"{}\" {}B", method, path, query, userAgent, user, response.getStatus(), timing, contentEncoding, acceptEncoding, contentLength); nakadiKpiPublisher.publish(accessLogEventType, () -> new JSONObject() .put("method", method) .put("path", path) .put("query", query) .put("app", user) .put("app_hashed", nakadiKpiPublisher.hash(user)) .put("status_code", response.getStatus()) .put("response_time_ms", timing)); } }
Source:
public void previewUrl(String urlString) { urlPreviewResolver.resolvePreview(urlString) .thenAccept(optionalPreview -> { if (!optionalPreview.isPresent()) { return; } Preview preview = optionalPreview.get(); linkPreviewTooltip = new Tooltip(preview.getDescription()); linkPreviewTooltip.setAutoHide(true); linkPreviewTooltip.setAnchorLocation(PopupWindow.AnchorLocation.CONTENT_BOTTOM_LEFT); linkPreviewTooltip.setGraphic(preview.getNode()); linkPreviewTooltip.setContentDisplay(ContentDisplay.TOP); Platform.runLater(() -> linkPreviewTooltip.show(StageHolder.getStage(), lastMouseX + 20, lastMouseY)); }); }

Target:
public void previewUrl(String urlString) { urlPreviewResolver.resolvePreview(urlString).thenAccept(optionalPreview -> optionalPreview.ifPresent(preview -> { linkPreviewTooltip = new Tooltip(preview.getDescription()); linkPreviewTooltip.setAutoHide(true); linkPreviewTooltip.setAnchorLocation(AnchorLocation.CONTENT_BOTTOM_LEFT); linkPreviewTooltip.setGraphic(preview.getNode()); linkPreviewTooltip.setContentDisplay(ContentDisplay.TOP); Platform.runLater(() -> linkPreviewTooltip.show(StageHolder.getStage(), lastMouseX + 20, lastMouseY)); })); }
Source:
public void shouldWriteAllFieldsIntoMongoDb() throws Exception { String dbName = jobOptions.getDbName(); JobTestUtils.cleanDBs(dbName); String statsPath = VariantData.getPopulationStatsPath(); JsonLineMapper mapper = new JsonLineMapper(); Map<String, Object> map = mapper.mapLine(statsPath, 0); PopulationStats populationStats = new PopulationStats(); populationStats.setCohortId((String)map.get("cid")); populationStats.setVariantId((String)map.get("vid")); populationStats.setStudyId((String)map.get("sid")); populationStats.setMaf((Double)map.get("maf")); populationStats.setMgf((Double)map.get("mgf")); populationStats.setMafAllele((String)map.get("mafAl")); populationStats.setMgfGenotype((String)map.get("mgfGt")); populationStats.setMissingAlleles((Integer) map.get("missAl")); populationStats.setMissingGenotypes((Integer) map.get("missGt")); populationStats.setGenotypeCount((Map<String, Integer>) map.get("numGt")); List<PopulationStats> populationStatsList = Arrays.asList(populationStats); StatisticsMongoWriter statisticsMongoWriter = new StatisticsMongoWriter( jobOptions.getMongoOperations(), jobOptions.getDbCollectionsStatsName()); statisticsMongoWriter.write(populationStatsList); MongoClient mongoClient = new MongoClient(); DBCollection statsCollection = mongoClient.getDB(dbName).getCollection(jobOptions.getDbCollectionsStatsName()); DBCursor cursor = statsCollection.find(); int count = 0; while (cursor.hasNext()) { count++; DBObject next = cursor.next(); assertTrue(next.get("cid") != null); assertTrue(next.get("sid") != null); assertTrue(next.get("vid") != null); assertTrue(next.get("maf") != null); assertTrue(next.get("numGt") != null); } assertTrue(count > 0); }

Target:
public void shouldWriteAllFieldsIntoMongoDb() throws Exception { List<PopulationStatistics> populationStatisticsList = buildPopulationStatsList(); StatisticsMongoWriter statisticsMongoWriter = new StatisticsMongoWriter( jobOptions.getMongoOperations(), jobOptions.getDbCollectionsStatsName()); int n = 1; for (int i = 0; i < n; i++) { statisticsMongoWriter.write(populationStatisticsList); } DB db = new MongoClient().getDB(dbName); DBCollection statsCollection = db.getCollection(jobOptions.getDbCollectionsStatsName()); DBCursor cursor = statsCollection.find(); int count = 0; while (cursor.hasNext()) { count++; DBObject next = cursor.next(); assertNotNull(next.get("cid")); assertNotNull(next.get("sid")); assertNotNull(next.get("vid")); assertNotNull(next.get("maf")); assertNotNull(next.get("numGt")); } assertEquals(n, count); }
Source:
public void writeString(final String s) throws IOException { log.debug("git> " + s); writePacket(Constants.encode(s)); }

Target:
public void writeString(final String s) throws IOException { writePacket(Constants.encode(s)); }
Source:
public static AddPrice ofVariantId(final Integer variantId, final PriceDraft price) { return ofVariantId(variantId, price, true); }

Target:
public static AddPrice ofVariantId(final Integer variantId, final PriceDraft price) { return ofVariantId(variantId, price, null); }
Source:
boolean spends(Transaction txA, Transaction txB) { boolean spends = false; for (TransactionInput txInput : txA.getInputs()) { spends |= txInput.getOutpoint().getHash().equals(txB.getHash()); } return spends; }

Target:
boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
Source:
public JDefinedClass innerRun(Provider<ASTType> astTypeProvider) { ASTType implementation = astTypeProvider.get(); log.debug("Processing @Bridge on " + implementation); ASTAnnotation bridgeAnnotation = implementation.getASTAnnotation(Bridge.class); ASTType target = bridgeAnnotation.getProperty("value", ASTType.class); try { log.debug("Creating Bridge for " + target); JDefinedClass rBridgeImpl = generationUtil.defineClass(ClassNamer.className(target).build().append("Bridge")); for (ASTType innerType : target.getInnerTypes()) { String innerName = innerType.getPackageClass().getCanonicalName(); if(innerName.contains(".")) { innerName = innerName.substring(innerName.lastIndexOf(".") + 1); } JDefinedClass innerBridge = rBridgeImpl._class(PUBLIC | STATIC | FINAL, innerName); for (ASTField field : innerType.getFields()) { innerBridge.field(PUBLIC | STATIC | FINAL, codeModel.INT, field.getName(), JExpr.lit(id--)) .annotate(RMapping.class) .param("clazz", generationUtil.ref(innerType).dotclass()) .param("name", field.getName()); } } return rBridgeImpl; } catch (JClassAlreadyExistsException e) { throw new TransfuseRuntimeException("Class Already exists", e); } }

Target:
public JDefinedClass innerRun(Provider<ASTType> astTypeProvider) { ASTType implementation = astTypeProvider.get(); log.debug("Processing @Bridge on " + implementation); ASTAnnotation bridgeAnnotation = implementation.getASTAnnotation(Bridge.class); ASTType target = bridgeAnnotation.getProperty("value", ASTType.class); try { log.debug("Creating Bridge for " + target); JDefinedClass rBridgeImpl = generationUtil.defineClass(ClassNamer.className(target).build().append("Bridge")); for (ASTType innerType : target.getInnerTypes()) { String innerName = innerType.getPackageClass().getCanonicalName(); if(innerName.contains(".")) { innerName = innerName.substring(innerName.lastIndexOf(".") + 1); } JDefinedClass innerBridge = rBridgeImpl._class(PUBLIC | STATIC | FINAL, innerName); for (ASTField field : innerType.getFields()) { log.debug("Mapping " + target + "." + innerName + "." + field.getName() + " = " + id); innerBridge.field(PUBLIC | STATIC | FINAL, codeModel.INT, field.getName(), JExpr.lit(id--)) .annotate(RMapping.class) .param("clazz", generationUtil.ref(innerType).dotclass()) .param("name", field.getName()); } } return rBridgeImpl; } catch (JClassAlreadyExistsException e) { throw new TransfuseRuntimeException("Class Already exists", e); } }
Source:
private static Element getOKResponse(List<Element> responseEls) { final List<Element> result = getResponses(responseEls, HTTP_OK_STATUSES); return !result.isEmpty() ? result.get(0) : null; }

Target:
private static Element getOKResponse(List<Element> responseEls) { for (Element responseEl : responseEls) { String statusValue = responseEl.getAttribute("status"); if (statusValue.isEmpty()) { return responseEl; } for (String status : statusValue.split("\\s")) { if (HTTP_OK_STATUSES.contains(status)) { return responseEl; } } } return null; }
Source:
private static boolean isDebugArgument(PyArgumentTree argument) { if (!(argument.keywordArgument() instanceof PyAtomTree)) { return false; } PyExpressionTree keywordArgument = ((PyAtomTree) argument.keywordArgument()).atom(); if (keywordArgument instanceof PyNameTree && debugProperties.contains(((PyNameTree) keywordArgument).name())) { if (!argument.expression().is(Kind.ATOM)) { return false; } PyExpressionTree argumentValue = ((PyAtomTree) argument.expression()).atom(); return argumentValue instanceof PyNameTree && ((PyNameTree) argumentValue).name().equals("True"); } return false; }

Target:
private static boolean isDebugArgument(PyArgumentTree argument) { PyNameTree keywordArgument = argument.keywordArgument(); if (keywordArgument != null && debugProperties.contains((keywordArgument).name())) { return isTrueLiteral(argument.expression()); } return false; }
Source:
default List<T> getValue() { IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? null : iterableStream.stream().collect(Collectors.toList()); }

Target:
default List<T> getValue() { IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? new ArrayList<>() : iterableStream.stream().collect(Collectors.toList()); }
Source:
private DataSet createMeansDataset( final DmsProject study, final String[] csvHeader, final DataSet plotDataSet, final CVTerm lSMean, final boolean hasDuplicateColumnsInFile) { final VariableTypeList meansVariableTypeList = new VariableTypeList(); final VariableList meansVariableList = new VariableList(); final DatasetValues datasetValues = new DatasetValues(); datasetValues.setVariables(meansVariableList); final String programUUID = study.getProgramUUID(); final String datasetName = study.getName() + "-MEANS"; this.addMeansVariableToLists( this.createMeansVariable(TermId.DATASET_NAME.getId(), datasetName, "Dataset name (local)", datasetName, 1, programUUID, PhenotypicType.DATASET), meansVariableList, meansVariableTypeList); this.addMeansVariableToLists( this.createMeansVariable(TermId.DATASET_TITLE.getId(), "DATASET_TITLE", "Dataset title (local)", "My Dataset Description", 2, programUUID, PhenotypicType.DATASET), meansVariableList, meansVariableTypeList); this.createMeansVariablesFromPlotDatasetAndAddToList(plotDataSet, meansVariableTypeList, 4); this.createMeansVariablesFromImportFileAndAddToList(csvHeader, plotDataSet.getVariableTypes().getVariates(), meansVariableTypeList, programUUID, lSMean, hasDuplicateColumnsInFile); final DatasetReference datasetReference = this.studyDataManager .addDataSet(study.getProjectId(), meansVariableTypeList, datasetValues, programUUID, DatasetTypeEnum.MEANS_DATA.getId()); return this.studyDataManager.getDataSet(datasetReference.getId()); }

Target:
private DataSet createMeansDataset( final DmsProject study, final String[] csvHeader, final DataSet plotDataSet, final CVTerm lSMean, final boolean hasDuplicateColumnsInFile) { final VariableTypeList meansVariableTypeList = new VariableTypeList(); final VariableList meansVariableList = new VariableList(); final DatasetValues datasetValues = new DatasetValues(); datasetValues.setVariables(meansVariableList); final String programUUID = study.getProgramUUID(); final String datasetName = study.getName() + "-MEANS"; this.addMeansVariableToLists( this.createMeansVariable(TermId.DATASET_NAME.getId(), datasetName, "Dataset name (local)", datasetName, 1, programUUID, PhenotypicType.DATASET), meansVariableList, meansVariableTypeList); this.addMeansVariableToLists( this.createMeansVariable(TermId.DATASET_TITLE.getId(), "DATASET_TITLE", "Dataset title (local)", "My Dataset Description", 2, programUUID, PhenotypicType.DATASET), meansVariableList, meansVariableTypeList); this.createMeansVariablesFromPlotDatasetAndAddToList(plotDataSet, meansVariableTypeList, 3); this.createMeansVariablesFromImportFileAndAddToList(csvHeader, plotDataSet.getVariableTypes().getVariates(), meansVariableTypeList, programUUID, lSMean, hasDuplicateColumnsInFile); final DatasetReference datasetReference = this.studyDataManager .addDataSet(study.getProjectId(), meansVariableTypeList, datasetValues, programUUID, DatasetTypeEnum.MEANS_DATA.getId()); return this.studyDataManager.getDataSet(datasetReference.getId()); }
Source:
public void handleConnectionsWithCorrectDomainOnOrigin() throws Exception { MatcherAssert.assertThat( "Invalid HTTP status for a request with correct domain.", new TkCORS( new TkFixed(new RsText()), "<LINK_0>", "<LINK_1>" ).act( new RqWithHeaders( new RqFake(), new HashSet<String>( Arrays.asList( "Origin: <LINK_0>" ) ) ) ), new HmRsStatus(Matchers.equalTo(HttpURLConnection.HTTP_OK)) ); }

Target:
public void handleConnectionsWithCorrectDomainOnOrigin() throws Exception { MatcherAssert.assertThat( "Invalid HTTP status for a request with correct domain.", new TkCORS( new TkFixed(new RsText()), "<LINK_0>", "<LINK_1>" ).act( new RqWithHeaders( new RqFake(), "Origin: <LINK_0>" ) ), new HmRsStatus(Matchers.equalTo(HttpURLConnection.HTTP_OK)) ); }
Source:
public Element(T value, Element<T> prev, Element<T> next) { this.value = value; this.prev = prev; this.next = next; }

Target:
Element(T value, Element<T> prev, Element<T> next) { this.value = value; this.prev = prev; this.next = next; }
Source:
public <T> T getAuthenticatorService(String method, Class<T> iface) { if ("DDF".equals(method) && iface.equals(Authenticator.class)) { return iface.cast(new JettyAuthenticator()); } return null; }

Target:
public <T> T getAuthenticatorService(String method, Class<T> iface) { if (JettyAuthenticator.DDF_AUTH_METHOD.equals(method) && iface.equals(Authenticator.class)) { return iface.cast(new JettyAuthenticator()); } return null; }
Source:
private void testUUIDAsJavaObject(Connection conn) throws SQLException { Statement stat = conn.createStatement(); stat.execute("create table test_uuid(id uuid primary key)"); UUID uuid = new UUID(-2, -1); PreparedStatement prep = conn.prepareStatement( "insert into test_uuid values(?)"); prep.setObject(1, uuid, java.sql.Types.JAVA_OBJECT); prep.execute(); ResultSet rs = stat.executeQuery("select * from test_uuid"); rs.next(); assertEquals("ffffffff-ffff-fffe-ffff-ffffffffffff", rs.getString(1)); Object o = rs.getObject(1); assertEquals("java.util.UUID", o.getClass().getName()); stat.execute("drop table test_uuid"); }

Target:
private void testUUIDAsJavaObject(Connection conn) throws SQLException { String uuidStr = "12345678-1234-4321-8765-123456789012"; Statement stat = conn.createStatement(); stat.execute("create table test_uuid(id uuid primary key)"); UUID origUUID = UUID.fromString(uuidStr); PreparedStatement prep = conn.prepareStatement("insert into test_uuid values(?)"); prep.setObject(1, origUUID, java.sql.Types.JAVA_OBJECT); prep.execute(); prep = conn.prepareStatement("select * from test_uuid where id=?"); prep.setObject(1, origUUID, java.sql.Types.JAVA_OBJECT); ResultSet rs = prep.executeQuery(); rs.next(); Object o = rs.getObject(1); assertTrue(o instanceof UUID); UUID selectedUUID = (UUID) o; assertTrue(selectedUUID.toString().equals(uuidStr)); assertTrue(selectedUUID.equals(origUUID)); stat.execute("drop table test_uuid"); }
Source:
public void handleApplicationNotification(PreloaderNotification info) { if (info instanceof ErrorNotification) { handleErrorNotification((ErrorNotification) info); } else { stage.hide(); } }

Target:
public void handleApplicationNotification(PreloaderNotification info) { stage.hide(); if (info instanceof ErrorNotification) { handleErrorNotification((ErrorNotification) info); } }
Source:
public void newFolderWithPathContainingFileSeparaterCreatesDirectories() throws IOException { tempFolder.create(); tempFolder.newFolder("temp1/temp2"); File temp1 = new File(tempFolder.getRoot(), "temp1"); assertFileIsDirectory(temp1); assertFileIsDirectory(new File(temp1, "temp2")); }

Target:
public void newFolderWithPathContainingFileSeparaterCreatesDirectories() throws IOException { tempFolder.create(); tempFolder.newFolder("temp1" + File.separator + "temp2"); File temp1 = new File(tempFolder.getRoot(), "temp1"); assertFileIsDirectory(temp1); assertFileIsDirectory(new File(temp1, "temp2")); }
Source:
public void stop() { if (!leaderElection.isStopped()) { try { leaderElection.stopElectionThread(); } catch (InterruptedException e) { e.printStackTrace(); } } }

Target:
public void stop() { if (!leaderElection.isStopped()) { try { leaderElection.stopElectionThread(); } catch (InterruptedException e) { LOG.warn("LeaderElection stopped", e); } } }
Source:
public String toString() { return "TypedByteArray[length=" + length() + "]"; }

Target:
@Override public String toString() { return "TypedByteArray[length=" + length() + "]"; }
Source:
public void testRecord002() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String source = "package pkg;\n" + "public record Point(int param1, int param2) {\n" + " public Point {\n" + " if (param1 > 5) {\n" + " System.out.println(\"error\");\n" + " }\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true ); try { ASTNode node = buildAST(source, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); } catch(UnsupportedOperationException e) { fail("Should not throw UnsupportedOperationException"); } }

Target:
public void testRecord002() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String contents = "public record X(int param1, int param2) {\n" + " public X {\n" + " if (param1 > 5) {\n" + " System.out.println(\"error\");\n" + " }\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true ); IJavaProject javaProject = this.workingCopy.getJavaProject(); String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true); try { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE); ASTNode node = buildAST( contents, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit compilationUnit = (CompilationUnit) node; assertProblemsSize(compilationUnit, 0); } finally { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old); } }
Source:
private void processCaptureResponse(boolean isImage) { File originalImage = ImageWidget.TEMP_FILE_FOR_IMAGE_CAPTURE; try { File unscaledFinalImage = moveAndScaleImage(originalImage, isImage); saveImageWidgetAnswer(unscaledFinalImage); } catch (IOException e) { showCustomToast(Localization.get("image.capture.not.saved"), Toast.LENGTH_LONG); } }

Target:
private void processCaptureResponse(boolean isImage) { File originalImage = ImageWidget.TEMP_FILE_FOR_IMAGE_CAPTURE; try { File unscaledFinalImage = moveAndScaleImage(originalImage, isImage); saveImageWidgetAnswer(unscaledFinalImage); } catch (IOException e) { e.printStackTrace(); showCustomToast(Localization.get("image.capture.not.saved"), Toast.LENGTH_LONG); } }
Source:
private static AffMatchingService createAffMatchingService() { AffMatchingService affMatchingService = new AffMatchingService(); affMatchingService.setAffiliationReader(new IisAffiliationReader()); affMatchingService.setOrganizationReader(new IisOrganizationReader()); affMatchingService.setAffMatchResultWriter(new IisAffMatchResultWriter()); AffOrgJoiner affOrgHashBucketJoiner = new AffOrgHashBucketJoiner(); AffOrgMatchComputer affOrgHashMatchComputer = new AffOrgMatchComputer(); AffOrgMatchVotersFactory votersFactory = new AffOrgMatchVotersFactory(); affOrgHashMatchComputer.setAffOrgMatchVoters(Lists.newArrayList( votersFactory.createNameCountryStrictMatchVoter(), votersFactory.createNameStrictCountryLooseMatchVoter(), votersFactory.createSectionedNameStrictCountryLooseMatchVoter(), votersFactory.createSectionedNameLevensteinCountryLooseMatchVoter(), votersFactory.createSectionedShortNameStrictCountryLooseMatchVoter())); AffOrgMatcher affOrgHashBucketMatcher = new AffOrgMatcher(); affOrgHashBucketMatcher.setAffOrgJoiner(affOrgHashBucketJoiner); affOrgHashBucketMatcher.setAffOrgMatchComputer(affOrgHashMatchComputer); affMatchingService.setAffOrgMatchers(Lists.newArrayList(affOrgHashBucketMatcher)); return affMatchingService; }

Target:
private static AffMatchingService createAffMatchingService() { AffMatchingService affMatchingService = new AffMatchingService(); affMatchingService.setAffiliationReader(new IisAffiliationReader()); affMatchingService.setOrganizationReader(new IisOrganizationReader()); affMatchingService.setAffMatchResultWriter(new IisAffMatchResultWriter()); AffOrgJoiner affOrgHashBucketJoiner = new AffOrgHashBucketJoiner(); AffOrgMatchComputer affOrgHashMatchComputer = new AffOrgMatchComputer(); affOrgHashMatchComputer.setAffOrgMatchVoters(ImmutableList.of( createNameCountryStrictMatchVoter(), createNameStrictCountryLooseMatchVoter(), createSectionedNameStrictCountryLooseMatchVoter(), createSectionedNameLevenshteinCountryLooseMatchVoter(), createSectionedShortNameStrictCountryLooseMatchVoter())); AffOrgMatcher affOrgHashBucketMatcher = new AffOrgMatcher(); affOrgHashBucketMatcher.setAffOrgJoiner(affOrgHashBucketJoiner); affOrgHashBucketMatcher.setAffOrgMatchComputer(affOrgHashMatchComputer); affMatchingService.setAffOrgMatchers(Lists.newArrayList(affOrgHashBucketMatcher)); return affMatchingService; }
Source:
protected void addSuffixIfPresent(ExpressionBuilder builder) { if (!this.suffix.trim().isEmpty()) { builder.append(" ").append(suffix); } }

Target:
protected void addSuffixIfPresent(ExpressionBuilder builder) { if (!this.suffix.isEmpty()) { builder.append(" ").append(suffix); } }
Source:
public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.skip(readOffset); } } BlockBuilder builder = type.createBlockBuilder(null, nextBatchSize); if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.getSetBits(type, nextBatchSize, builder); } else { int subBatchSize = Math.min(nextBatchSize, MAX_BATCH_SIZE); if (nullVector.length < subBatchSize) { nullVector = new boolean[subBatchSize]; } while (nextBatchSize > 0) { int elemsToRead = Math.min(nextBatchSize, subBatchSize); int nullValues = presentStream.getUnsetBits(elemsToRead, nullVector); if (nullValues != elemsToRead) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.getSetBits(type, elemsToRead, builder, nullVector); } else { for (int i = 0; i < elemsToRead; i++) { builder.appendNull(); } } nextBatchSize -= elemsToRead; } } readOffset = 0; nextBatchSize = 0; return builder.build(); }

Target:
public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.skip(readOffset); } } BlockBuilder builder = type.createBlockBuilder(null, nextBatchSize); if (presentStream == null) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.getSetBits(type, nextBatchSize, builder); } else { assureVectorSize(); while (nextBatchSize > 0) { int subBatchSize = min(nextBatchSize, MAX_BATCH_SIZE); int nullValues = presentStream.getUnsetBits(subBatchSize, nullVector); if (nullValues != subBatchSize) { if (dataStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } dataStream.getSetBits(type, subBatchSize, builder, nullVector); } else { for (int i = 0; i < subBatchSize; i++) { builder.appendNull(); } } nextBatchSize -= subBatchSize; } } readOffset = 0; nextBatchSize = 0; return builder.build(); }
Source:
private Object doInvokeMethod(Object target, String methodName, Object[] arguments, boolean isStatic) { Object[] args = GroovyRuntimeUtil.asArgumentArray(arguments); if (isGetMetaClassCallOnGroovyObject(target, methodName, args, isStatic)) { return ((GroovyObject) target).getMetaClass(); } MetaMethod metaMethod = delegate.pickMethod(methodName, ReflectionUtil.getTypes(args)); Method method = GroovyRuntimeUtil.toMethod(metaMethod); Object[] unwrappedArgs = GroovyRuntimeUtil.asUnwrappedArgumentArray(args); if (method != null && method.getDeclaringClass().isAssignableFrom(configuration.getType())) { if (!isStatic && !ReflectionUtil.isFinalMethod(method) && !configuration.isGlobal()) { Object[] coercedArgs = metaMethod.coerceArgumentsToClasses(arguments); return metaMethod.invoke(target, coercedArgs); } } if (metaMethod != null && metaMethod.getDeclaringClass().getTheClass() == GroovyObject.class) { if ("invokeMethod".equals(methodName)) { return invokeMethod(target, (String) unwrappedArgs[0], GroovyRuntimeUtil.asArgumentArray(unwrappedArgs[1])); } if ("getProperty".equals(methodName)) { return getProperty(target, (String) unwrappedArgs[0]); } if ("setProperty".equals(methodName)) { setProperty(target, (String) unwrappedArgs[0], unwrappedArgs[1]); return null; } } IMockInvocation invocation = createMockInvocation(metaMethod, target, methodName, args, isStatic); IMockController controller = specification.getSpecificationContext().getMockController(); return controller.handle(invocation); }

Target:
private Object doInvokeMethod(Object target, String methodName, Object[] arguments, boolean isStatic) { Object[] args = GroovyRuntimeUtil.asArgumentArray(arguments); if (isGetMetaClassCallOnGroovyObject(target, methodName, args, isStatic)) { return ((GroovyObject) target).getMetaClass(); } MetaMethod metaMethod = delegate.pickMethod(methodName, ReflectionUtil.getTypes(args)); Method method = GroovyRuntimeUtil.toMethod(metaMethod); Object[] unwrappedArgs = GroovyRuntimeUtil.asUnwrappedArgumentArray(args); if (method != null && method.getDeclaringClass().isAssignableFrom(configuration.getType())) { if (!isStatic && !ReflectionUtil.isFinalMethod(method) && !configuration.isGlobal()) { Object[] coercedArgs = metaMethod.coerceArgumentsToClasses(unwrappedArgs); return metaMethod.invoke(target, coercedArgs); } } if (metaMethod != null && metaMethod.getDeclaringClass().getTheClass() == GroovyObject.class) { if ("invokeMethod".equals(methodName)) { return invokeMethod(target, (String) unwrappedArgs[0], GroovyRuntimeUtil.asArgumentArray(unwrappedArgs[1])); } if ("getProperty".equals(methodName)) { return getProperty(target, (String) unwrappedArgs[0]); } if ("setProperty".equals(methodName)) { setProperty(target, (String) unwrappedArgs[0], unwrappedArgs[1]); return null; } } IMockInvocation invocation = createMockInvocation(metaMethod, target, methodName, args, isStatic); IMockController controller = specification.getSpecificationContext().getMockController(); return controller.handle(invocation); }
Source:
PostGameResponse postGame(final ApiKey apiKey, final LobbyGame lobbyGame) { final String id = UUID.randomUUID().toString(); games.put(new GameId(apiKey, id), lobbyGame); playerMessagingBus.broadcastMessage( new LobbyGameUpdatedMessage( LobbyGameListing.builder().gameId(id).lobbyGame(lobbyGame).build())); log.info("Posted game: {}", id); final boolean successfulCheck = connectivityCheck.test(getHostForGame(lobbyGame)); return PostGameResponse.builder() .gameId(id) .successfulConnectivityCheck(successfulCheck) .build(); }

Target:
public String postGame(final ApiKey apiKey, final LobbyGame lobbyGame) { final String id = UUID.randomUUID().toString(); games.put(new GameId(apiKey, id), lobbyGame); final var lobbyGameListing = LobbyGameListing.builder().gameId(id).lobbyGame(lobbyGame).build(); lobbyGameDao.insertLobbyGame(apiKey, lobbyGameListing); playerMessagingBus.broadcastMessage(new LobbyGameUpdatedMessage(lobbyGameListing)); log.info("Posted game: {}", id); return id; }
Source:
private void removeDuplicatedModels(Map<IPluginModelBase, String> fModels, Q7Target target) { String path = target.getInstallLocation().getAbsolutePath(); List<IPluginModelBase> keysForRemove = new ArrayList<IPluginModelBase>(); Map<UniquePluginModel, IPluginModelBase> cache = new HashMap<UniquePluginModel, IPluginModelBase>(); for (Entry<IPluginModelBase, String> entry : fModels.entrySet()) { Object key = entry.getKey(); if (key instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) key; UniquePluginModel uniqueModel = new UniquePluginModel(model); IPluginModelBase secondModel = cache.get(uniqueModel); if (secondModel != null) { if (secondModel.getInstallLocation().contains(path)) { keysForRemove.add(secondModel); } else { keysForRemove.add(model); } } else { cache.put(uniqueModel, model); } } } for (IPluginModelBase key : keysForRemove) { fModels.remove(key); } }

Target:
private void removeDuplicatedModels(Map<IPluginModelBase, String> fModels, Q7Target target) { String path = target.getInstallLocation().getAbsolutePath(); List<IPluginModelBase> keysForRemove = new ArrayList<IPluginModelBase>(); Map<UniquePluginModel, IPluginModelBase> cache = new HashMap<UniquePluginModel, IPluginModelBase>(); for (Entry<IPluginModelBase, String> entry : fModels.entrySet()) { Object key = entry.getKey(); IPluginModelBase model = (IPluginModelBase) key; UniquePluginModel uniqueModel = new UniquePluginModel(model); IPluginModelBase secondModel = cache.get(uniqueModel); if (secondModel != null) { if (secondModel.getInstallLocation().contains(path)) { keysForRemove.add(secondModel); } else { keysForRemove.add(model); } } else { cache.put(uniqueModel, model); } } for (IPluginModelBase key : keysForRemove) { fModels.remove(key); } }
Source:
public Account(short id, String name, JSONObject metadata) { if (name == null) { throw new IllegalArgumentException("accountName cannot be null"); } this.id = id; this.name = name; this.metadata = metadata; idContainerMap = new HashMap<>(); nameContainerMap = new HashMap<>(); }

Target:
public Account(short id, String name, JSONObject metadata) { if (name == null) { throw new IllegalArgumentException("accountName cannot be null"); } this.id = id; this.name = name; this.metadata = metadata; containerIdToContainerMap = new HashMap<>(); containerNameToContainerMap = new HashMap<>(); }
Source:
public FullExampleFamilyDefinition() { super(NAME, new org.talend.components.service.rest.fullexample.FullExampleInputDefinition(), new FullExampleDatastoreDefinition(), new FullExampleDatasetDefinition()); }

Target:
public FullExampleFamilyDefinition() { super(NAME, new FullExampleDatastoreDefinition(), new FullExampleDatasetDefinition()); }
Source:
public ITmfTrace[] getActiveTraceSet() { final ITmfTrace trace = fCurrentTrace; if (trace instanceof TmfExperiment) { final TmfExperiment exp = (TmfExperiment) trace; return exp.getTraces(); } return new ITmfTrace[] { trace }; }

Target:
public synchronized ITmfTrace[] getActiveTraceSet() { final ITmfTrace trace = fCurrentTrace; if (trace instanceof TmfExperiment) { final TmfExperiment exp = (TmfExperiment) trace; return exp.getTraces(); } return new ITmfTrace[] { trace }; }
Source:
public long getAllocatedRawCapacityInBytes() { long allocatedRawCapacityInBytes = 0; for (Partition partition : partitionMap.values()) { allocatedRawCapacityInBytes += partition.getAllocatedRawCapacityInBytes(); } return allocatedRawCapacityInBytes; }

Target:
public long getAllocatedRawCapacityInBytes() { return allocatedRawCapacityInBytes; }
Source:
public void setPriorities(List<RuleSpecification<?>> ruleSpecGroup) { priorities.clear(); int priority = ruleSpecGroup.size() + priorities.size(); for (RuleSpecification<?> rule : ruleSpecGroup) { this.setPriority(rule, priority); priority--; } }

Target:
public void setPriorities(List<RuleSpecification<?>> ruleSpecGroup) { int priority = ruleSpecGroup.size() + priorities.size(); for (RuleSpecification<?> rule : ruleSpecGroup) { this.setPriority(rule, priority); priority--; } }
Source:
private int addFieldToDescriptionMap(Map<String, Object> descriptionMap, String diskAlias, String fieldName, String fieldValue, int descriptionAvailableLength) { if ((descriptionAvailableLength -= getJsonFieldPotentialOverhead(fieldName, descriptionMap)) > 0) { if (fieldValue.length() > descriptionAvailableLength) { fieldValue = fieldValue.substring(0, descriptionAvailableLength); auditLogNoSpaceToStoreEntireDiskField(diskAlias, fieldName, fieldValue); } descriptionMap.put(fieldName, fieldValue); return descriptionAvailableLength - fieldValue.length(); } return 0; }

Target:
private int addFieldToDescriptionMap(Map<String, Object> descriptionMap, String diskAlias, String fieldName, String fieldValue, int descriptionAvailableLength) { if ((descriptionAvailableLength -= getJsonFieldPotentialOverhead(fieldName, descriptionMap)) > 0) { if (fieldValue.length() > descriptionAvailableLength) { fieldValue = fieldValue.substring(0, descriptionAvailableLength); } descriptionMap.put(fieldName, fieldValue); return descriptionAvailableLength - fieldValue.length(); } return descriptionAvailableLength; }
Source:
protected ObjectLockRetentionMode getRetentionMode() { GetObjectLockConfigurationRequest request = new GetObjectLockConfigurationRequest().withBucketName(bucketName); GetObjectLockConfigurationResult result; try { result = amazonS3.getObjectLockConfiguration(request); } catch (AmazonServiceException e) { return DEFAULT_RETENTION_MODE; } ObjectLockConfiguration config = result.getObjectLockConfiguration(); if (config == null) { return DEFAULT_RETENTION_MODE; } ObjectLockRule rule = config.getRule(); if (rule == null) { return DEFAULT_RETENTION_MODE; } DefaultRetention defaultRetention = rule.getDefaultRetention(); if (defaultRetention == null) { return DEFAULT_RETENTION_MODE; } String mode = defaultRetention.getMode(); if (mode == null) { return DEFAULT_RETENTION_MODE; } return ObjectLockRetentionMode.valueOf(mode); }

Target:
protected ObjectLockRetentionMode getRetentionMode() { GetObjectLockConfigurationRequest request = new GetObjectLockConfigurationRequest().withBucketName(bucketName); GetObjectLockConfigurationResult result; try { result = amazonS3.getObjectLockConfiguration(request); } catch (AmazonServiceException e) { return DEFAULT_RETENTION_MODE; } return Optional.ofNullable(result.getObjectLockConfiguration()) .map(ObjectLockConfiguration::getRule) .map(ObjectLockRule::getDefaultRetention) .map(DefaultRetention::getMode) .map(ObjectLockRetentionMode::valueOf) .orElse(DEFAULT_RETENTION_MODE); }
Source:
public AddDiscountCodeController(final ContentRenderer contentRenderer, final FormFactory formFactory, final AddDiscountCodeFormData formData, final CartFinder cartFinder, final CartPageContentFactory pageContentFactory, final AddDiscountCodeControllerAction controllerAction, final CartReverseRouter cartReverseRouter) { super(contentRenderer, formFactory, formData, cartFinder, pageContentFactory, controllerAction); this.cartReverseRouter = cartReverseRouter; }

Target:
AddDiscountCodeController(final ContentRenderer contentRenderer, final FormFactory formFactory, final AddDiscountCodeFormData formData, final CartFinder cartFinder, final CartPageContentFactory pageContentFactory, final AddDiscountCodeControllerAction controllerAction, final CartReverseRouter cartReverseRouter) { super(contentRenderer, formFactory, formData, cartFinder, pageContentFactory, controllerAction); this.cartReverseRouter = cartReverseRouter; }
Source:
private ZapMenuItem getMenuItemMdReport() { if (menuItemMdReport == null) { menuItemMdReport = new ZapMenuItem("menu.report.md.generate"); menuItemXmlReport.addActionListener((java.awt.event.ActionEvent e) -> { ReportLastScan report = new ReportLastScan(); report.generateReport(getView(), getModel(), ReportLastScan.ReportType.MD); }); } return menuItemMdReport; }

Target:
private ZapMenuItem getMenuItemMdReport() { if (menuItemMdReport == null) { menuItemMdReport = new ZapMenuItem("menu.report.md.generate"); menuItemMdReport.addActionListener(e -> new ReportLastScan().generateReport(getView(), getModel(), ReportLastScan.ReportType.MD)); } return menuItemMdReport; }
Source:
private boolean isInvalidQueryExpression(final Operation operation) { if (!operation.getLeftOperand().getReferencedElements().isEmpty()) { final EObject data = operation.getLeftOperand().getReferencedElements().get(0); return !(data instanceof BusinessObjectData) && Objects.equals(operation.getRightOperand().getType(), ExpressionConstants.QUERY_TYPE); } return false; }

Target:
private boolean isInvalidQueryExpression(final Operation operation) { if (leftOperandHasReferencedElement(operation)) { final EObject data = operation.getLeftOperand().getReferencedElements().get(0); return !(data instanceof BusinessObjectData) && Objects.equals(operation.getRightOperand().getType(), ExpressionConstants.QUERY_TYPE); } return false; }
Source:
private void performImportScript(String[] csv) throws Exception { String filename = "test.csv"; BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename), "UTF-8")); for (String csvLine : csv) { out.write(csvLine + "\n"); } out.flush(); out.close(); out = null; DSpaceCSV dspaceCsv = new DSpaceCSV(new File(filename), context); MetadataImport importer = new MetadataImport(context, dspaceCsv); importer.runImport(true, false, false, false); }

Target:
private void performImportScript(String[] csv) throws Exception { String filename = "test.csv"; BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename), "UTF-8")); for (String csvLine : csv) { out.write(csvLine + "\n"); } out.flush(); out.close(); out = null; runDSpaceScript("metadata-import", "-f", "test.csv", "-e", "admin@email.com", "-s"); }