auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String SignCertificateRequest(String request, String label) <START> throws FileNotFoundException, UnsupportedEncodingException, IOException { <END> 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()); }</code><technical_language>tab in</technical_language>

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:
<code>public void testWithEmptyArrays() { final KeySet keySetOriginal = new KeySet(); final byte[] authenticationKey = {}; keySetOriginal.setAuthenticationKey(authenticationKey); final byte[] encryptionKey = {}; keySetOriginal.setEncryptionKey(encryptionKey); <START> final com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet keySetMapped = this.mapperFactory <END> .getMapperFacade().map(keySetOriginal, com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet.class); assertNotNull(keySetMapped); assertTrue(keySetMapped.getAuthenticationKey().length == 0); assertTrue(keySetMapped.getEncryptionKey().length == 0); }</code><technical_language>original mapper</technical_language>

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:
<code>public void previewUrl(String urlString) { urlPreviewResolver.resolvePreview(urlString) .thenAccept(optionalPreview -> { <START> if (!optionalPreview.isPresent()) { <END> 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)); }); }</code><technical_language>wanna call optionalPreview.ifPresent()? this more readable. In hideUrlPrview method 10 lines opposite. Due number of statements</technical_language>

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:
<code>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(); <START> assertTrue(next.get("cid") != null); <END> assertTrue(next.get("sid") != null); assertTrue(next.get("vid") != null); assertTrue(next.get("maf") != null); assertTrue(next.get("numGt") != null); } assertTrue(count > 0); }</code><technical_language>assertNotNull is available. please asserts package org.junit.Assert, junit.framework is deprecated</technical_language>

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:
<code>public void writeString(final String s) throws IOException { <START> log.debug("git> " + s); END> writePacket(Constants.encode(s)); }</code><technical_language>I expected tracing happen writePacket(buf, pos, len) level, captures packets (not packets strings). end() is flush-pkts happen</technical_language>

Target:
public void writeString(final String s) throws IOException { writePacket(Constants.encode(s)); }
Source:
<code>public static AddPrice ofVariantId(final Integer variantId, final PriceDraft price) { <START> return ofVariantId(variantId, price, true); <END> }</code><technical_language>Good idea reuse of... factory methods great :wink:</technical_language>

Target:
public static AddPrice ofVariantId(final Integer variantId, final PriceDraft price) { return ofVariantId(variantId, price, null); }
Source:
<code>boolean spends(Transaction txA, Transaction txB) { boolean spends = false; for (TransactionInput txInput : txA.getInputs()) { <START> spends |= txInput.getOutpoint().getHash().equals(txB.getHash()); <END> } return spends; }</code><technical_language>This "if (txInput.....) return true" right? need continue looping finding condition is correct</technical_language>

Target:
boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
Source:
<code>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()) { <START> innerBridge.field(PUBLIC | STATIC | FINAL, codeModel.INT, field.getName(), JExpr.lit(id--)) <END> .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); } }</code><technical_language>I kind of this debug logging... do added a flag enable debug logging, effectively turning for default case</technical_language>

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:
<code>private static Element getOKResponse(List<Element> responseEls) { <START> final List<Element> result = getResponses(responseEls, HTTP_OK_STATUSES); <END> return !result.isEmpty() ? result.get(0) : null; }</code><technical_language>problem sharing getResponses() method is creating a list for OK case is required, returning element</technical_language>

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:
<code>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(); <START> return argumentValue instanceof PyNameTree && ((PyNameTree) argumentValue).name().equals("True"); <END> } return false; }</code><technical_language>isTrueLiteral here</technical_language>

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:
<code><START> default List<T> getValue() { <END> IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? null : iterableStream.stream().collect(Collectors.toList()); }</code><technical_language>this marked deprecated is in Page</technical_language>

Target:
default List<T> getValue() { IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? new ArrayList<>() : iterableStream.stream().collect(Collectors.toList()); }
Source:
<code>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", <START> 2, programUUID, PhenotypicType.DATASET), meansVariableList, meansVariableTypeList); <END> 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()); }</code><technical_language>variable rank in next line start 3 4</technical_language>

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:
<code>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(), <START> new HashSet<String>( <END> Arrays.asList( "Origin: <LINK_0>" ) ) ) ), new HmRsStatus(Matchers.equalTo(HttpURLConnection.HTTP_OK)) ); }</code><technical_language>@antonini again, do need a HashSet here? new RqWithHeader(new RqFake(), "Origin: <LINK_0>")</technical_language>

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:
<code><START> public Element(T value, Element<T> prev, Element<T> next) { <END> this.value = value; this.prev = prev; this.next = next; }</code><technical_language>I I explained badly! I nested class declaration line 46 remain private originally, constructor method line 51 package-private. this sense? :slightly_smiling_face:</technical_language>

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

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:
<code>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(); <START> assertEquals("ffffffff-ffff-fffe-ffff-ffffffffffff", rs.getString(1)); <END> Object o = rs.getObject(1); assertEquals("java.util.UUID", o.getClass().getName()); stat.execute("drop table test_uuid"); }</code><technical_language>nice check query select * test_uuid id = ? prep.setObject(1, uuid, Type.JAVA_OBJECT) find inserted row</technical_language>

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:
<code>public void handleApplicationNotification(PreloaderNotification info) { if (info instanceof ErrorNotification) { handleErrorNotification((ErrorNotification) info); <START> } else { <END> stage.hide(); } }</code><technical_language>I prefer splashscreen immediately hide error occurs, left exception</technical_language>

Target:
public void handleApplicationNotification(PreloaderNotification info) { stage.hide(); if (info instanceof ErrorNotification) { handleErrorNotification((ErrorNotification) info); } }
Source:
<code>public void newFolderWithPathContainingFileSeparaterCreatesDirectories() throws IOException { tempFolder.create(); tempFolder.newFolder("temp1/temp2"); File temp1 = new File(tempFolder.getRoot(), "temp1"); assertFileIsDirectory(temp1); <START> assertFileIsDirectory(new File(temp1, "temp2")); <END> }</code><technical_language>This test run Windows, right</technical_language>

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:
<code>public void stop() { if (!leaderElection.isStopped()) { try { leaderElection.stopElectionThread(); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } } }</code><technical_language>a log instead of printing stackTrace</technical_language>

Target:
public void stop() { if (!leaderElection.isStopped()) { try { leaderElection.stopElectionThread(); } catch (InterruptedException e) { LOG.warn("LeaderElection stopped", e); } } }
Source:
<code><START> public String toString() { <END> return "TypedByteArray[length=" + length() + "]"; }</code><technical_language>needs @Override</technical_language>

Target:
@Override public String toString() { return "TypedByteArray[length=" + length() + "]"; }
Source:
<code>public void testRecord002() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String source = "package pkg;\n" + <START> "public record Point(int param1, int param2) {\n" + <END> " 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"); } }</code><technical_language>remove "public"</technical_language>

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:
<code>private void processCaptureResponse(boolean isImage) { File originalImage = ImageWidget.TEMP_FILE_FOR_IMAGE_CAPTURE; try { File unscaledFinalImage = moveAndScaleImage(originalImage, isImage); saveImageWidgetAnswer(unscaledFinalImage); } catch (IOException e) { <START> showCustomToast(Localization.get("image.capture.not.saved"), Toast.LENGTH_LONG); <END> } }</code><technical_language>set some text in e above, log throw error issue a console, losing info in 'e'</technical_language>

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:
<code>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(), <START> votersFactory.createSectionedShortNameStrictCountryLooseMatchVoter())); <END> AffOrgMatcher affOrgHashBucketMatcher = new AffOrgMatcher(); affOrgHashBucketMatcher.setAffOrgJoiner(affOrgHashBucketJoiner); affOrgHashBucketMatcher.setAffOrgMatchComputer(affOrgHashMatchComputer); affMatchingService.setAffOrgMatchers(Lists.newArrayList(affOrgHashBucketMatcher)); return affMatchingService; }</code><technical_language>immutable list</technical_language>

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:
<code>protected void addSuffixIfPresent(ExpressionBuilder builder) { <START> if (!this.suffix.trim().isEmpty()) { <END> builder.append(" ").append(suffix); } }</code><technical_language>trim suffix in, reading configuration</technical_language>

Target:
protected void addSuffixIfPresent(ExpressionBuilder builder) { if (!this.suffix.isEmpty()) { builder.append(" ").append(suffix); } }
Source:
<code>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) { <START> int elemsToRead = Math.min(nextBatchSize, subBatchSize); <END> 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(); }</code><technical_language>Actually, I need extra elemsToRead variable. Instead subBatchSize = Math.min(nextBatchSize, subBatchSize);</technical_language>

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:
<code>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()) { <START> Object[] coercedArgs = metaMethod.coerceArgumentsToClasses(arguments); <END> 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); }</code><technical_language>this called for unwrapped args</technical_language>

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:
<code>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() <START> .gameId(id) <END> .successfulConnectivityCheck(successfulCheck) .build(); }</code><technical_language>I this is a bit confused. API returns a "here is game id, way, I connect game!" relying client behavior shut send a disconnect message delist, waiting for alive time out. server rely client side implementation heavily, if connectivity check fails, ideally call post game endpoint and/or return a game id. If do return a game-id, arguably is more cohesive, keep-alive endpoint contract consistent</technical_language>

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:
<code>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()) { <START> Object key = entry.getKey(); <END> 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); } }</code><technical_language>Key is IPluginModelBase. need downcast further</technical_language>

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:
<code><START> public Account(short id, String name, JSONObject metadata) { <END> 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<>(); }</code><technical_language>is expected part of metadata</technical_language>

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:
<code>public FullExampleFamilyDefinition() { <START> super(NAME, new org.talend.components.service.rest.fullexample.FullExampleInputDefinition(), new FullExampleDatastoreDefinition(), new FullExampleDatasetDefinition()); <END> }</code><technical_language>need FullExampleInputDefinition for test I suggest remove remove class (FullExampleInputDefinition.java)</technical_language>

Target:
public FullExampleFamilyDefinition() { super(NAME, new FullExampleDatastoreDefinition(), new FullExampleDatasetDefinition()); }
Source:
<code><START> public ITmfTrace[] getActiveTraceSet() { <END> final ITmfTrace trace = fCurrentTrace; if (trace instanceof TmfExperiment) { final TmfExperiment exp = (TmfExperiment) trace; return exp.getTraces(); } return new ITmfTrace[] { trace }; }</code><technical_language>Add synchronized this method</technical_language>

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:
<code><START> public long getAllocatedRawCapacityInBytes() { <END> long allocatedRawCapacityInBytes = 0; for (Partition partition : partitionMap.values()) { allocatedRawCapacityInBytes += partition.getAllocatedRawCapacityInBytes(); } return allocatedRawCapacityInBytes; }</code><technical_language>calculate this initialization of clustermap. change recalculating minute is useful</technical_language>

Target:
public long getAllocatedRawCapacityInBytes() { return allocatedRawCapacityInBytes; }
Source:
<code>public void setPriorities(List<RuleSpecification<?>> ruleSpecGroup) { <START> priorities.clear(); <END> int priority = ruleSpecGroup.size() + priorities.size(); for (RuleSpecification<?> rule : ruleSpecGroup) { this.setPriority(rule, priority); priority--; } }</code><technical_language>remove clear() call (probably left refactor)</technical_language>

Target:
public void setPriorities(List<RuleSpecification<?>> ruleSpecGroup) { int priority = ruleSpecGroup.size() + priorities.size(); for (RuleSpecification<?> rule : ruleSpecGroup) { this.setPriority(rule, priority); priority--; } }
Source:
<code>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(); } <START> return 0; <END> }</code><technical_language>This is unintuitive - return number of characters need allow calling function decide do it</technical_language>

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:
<code>protected ObjectLockRetentionMode getRetentionMode() { GetObjectLockConfigurationRequest request = new GetObjectLockConfigurationRequest().withBucketName(bucketName); GetObjectLockConfigurationResult result; try { result = amazonS3.getObjectLockConfiguration(request); } catch (AmazonServiceException e) { return DEFAULT_RETENTION_MODE; } <START> ObjectLockConfiguration config = result.getObjectLockConfiguration(); if (config == null) { return DEFAULT_RETENTION_MODE; } ObjectLockRule rule = config.getRule(); if (rule == null) { return DEFAULT_RETENTION_MODE; } <END> 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); }</code><technical_language>If Optional creation is issue, save some lines: return Optional.ofNullable(result.getObjectLockConfiguration()) .map(ObjectLockConfiguration:: getRule) .map(ObjectLockRule:: getDefaultRetention) .map(DefaultRetention::getMode) .map(ObjectLockRetentionMode::valueOf) .orElse(DEFAULT_RETENTION_MODE);</technical_language>

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:
<code><START> public AddDiscountCodeController(final ContentRenderer contentRenderer, final FormFactory formFactory, <END> 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; }</code><technical_language>I inconsistence controllers, I remove public constructor a final class be</technical_language>

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:
<code>private ZapMenuItem getMenuItemMdReport() { if (menuItemMdReport == null) { menuItemMdReport = new ZapMenuItem("menu.report.md.generate"); <START> menuItemXmlReport.addActionListener((java.awt.event.ActionEvent e) -> { <END> ReportLastScan report = new ReportLastScan(); report.generateReport(getView(), getModel(), ReportLastScan.ReportType.MD); }); } return menuItemMdReport; }</code><technical_language>variable menuItemMdReport</technical_language>

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:
<code>private boolean isInvalidQueryExpression(final Operation operation) { <START> if (!operation.getLeftOperand().getReferencedElements().isEmpty()) { <END> final EObject data = operation.getLeftOperand().getReferencedElements().get(0); return !(data instanceof BusinessObjectData) && Objects.equals(operation.getRightOperand().getType(), ExpressionConstants.QUERY_TYPE); } return false; }</code><technical_language>operation.getLeftOperand().getReferencedElements() extracted left Operand is null</technical_language>

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:
<code>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; <START> DSpaceCSV dspaceCsv = new DSpaceCSV(new File(filename), context); <END> MetadataImport importer = new MetadataImport(context, dspaceCsv); importer.runImport(true, false, false, false); }</code><technical_language>a specific reason this integration test DSpace CLI command metadata-import anymore? I functionally this is thing. I preferably integration tests [black-box](<LINK_0> (e.g. need MetadataImport class. REST API calls CLI commands possible)</technical_language>

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"); }
Source:
<code>protected Map<K, V> copy(Map<K, V> source, Map dest) { for (Entry<K, V> entry : source.entrySet()) { K key = entry.getKey(); <START> K altKey; <END> if (key instanceof String) { altKey = (K) new CaseInsensitiveString((String) key); } else { altKey = key; } dest.put(altKey, entry.getValue()); } return dest; }</code><technical_language>I get rid of altKey variable else block well</technical_language>

Target:
protected Map<K, V> copy(Map<K, V> source, Map dest) { for (Entry<K, V> entry : source.entrySet()) { K key = entry.getKey(); if (key instanceof String) { key = (K) new CaseInsensitiveString((String) key); } dest.put(key, entry.getValue()); } return dest; }