auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testNettyClientConnectRetryMultipleThread() throws Exception { NettyTestUtil.NettyServerAndClient serverAndClient = createNettyServerAndClient(); UnstableNettyClient unstableNettyClient = new UnstableNettyClient(serverAndClient.client(), 2); PartitionRequestClientFactory factory = new PartitionRequestClientFactory(unstableNettyClient, 2); ConnectionID serverAddress = new ConnectionID(new InetSocketAddress(InetAddress.getLocalHost(), serverAndClient.server().getConfig().getServerPort()), 0); ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); List<Future<NettyPartitionRequestClient>> futures = new ArrayList<>(); for (int i = 0; i < 10; i++) { Future<NettyPartitionRequestClient> future = threadPoolExecutor.submit(new Callable<NettyPartitionRequestClient>() { @Override public NettyPartitionRequestClient call() { NettyPartitionRequestClient client = null; try { client = factory.createPartitionRequestClient(serverAddress); } catch (Exception e) { System.out.println(e.getMessage()); fail(); } return client; } }); futures.add(future); } futures.forEach(runnableFuture -> { NettyPartitionRequestClient client = null; <START> try { <END> client = runnableFuture.get(); System.out.println("Result = " + client == null ? "null" : client.toString()); assertNotNull(client); } catch (Exception e) { System.out.println(e.getMessage()); fail(); } }); threadPoolExecutor.shutdown(); serverAndClient.client().shutdown(); serverAndClient.server().shutdown(); }</code><technical_language>line removed</technical_language>

Target:
public void testNettyClientConnectRetryMultipleThread() throws Exception { NettyTestUtil.NettyServerAndClient serverAndClient = createNettyServerAndClient(); UnstableNettyClient unstableNettyClient = new UnstableNettyClient(serverAndClient.client(), 2); PartitionRequestClientFactory factory = new PartitionRequestClientFactory(unstableNettyClient, 2); ConnectionID serverAddress = new ConnectionID(new InetSocketAddress(InetAddress.getLocalHost(), serverAndClient.server().getConfig().getServerPort()), 0); ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); List<Future<NettyPartitionRequestClient>> futures = new ArrayList<>(); for (int i = 0; i < 10; i++) { Future<NettyPartitionRequestClient> future = threadPoolExecutor.submit(new Callable<NettyPartitionRequestClient>() { @Override public NettyPartitionRequestClient call() { NettyPartitionRequestClient client = null; try { client = factory.createPartitionRequestClient(serverAddress); } catch (Exception e) { fail(e.getMessage()); } return client; } }); futures.add(future); } futures.forEach(runnableFuture -> { NettyPartitionRequestClient client = null; try { client = runnableFuture.get(); assertNotNull(client); } catch (Exception e) { System.out.println(e.getMessage()); fail(); } }); threadPoolExecutor.shutdown(); serverAndClient.client().shutdown(); serverAndClient.server().shutdown(); }
Source:
<code>private void removeBucketAndResort(String bucketName) { final HashSet<String> names = new HashSet<>(); if (!buckets.isEmpty()) { final Iterator<QueueBucket> iterator = buckets.iterator(); QueueBucket prev = null; boolean isSorted = true; while (iterator.hasNext()) { QueueBucket b = iterator.next(); if (!names.add(b.getName())) { logger.error("Bucket " + b.getName() + " already existed in the list, removing"); isSorted = false; iterator.remove(); } else if (b.getName().equals(bucketName)) { iterator.remove(); if (!isSorted) break; } else { if (prev != null) { final int compare = comparator.compare(prev, b); isSorted = isSorted && compare <= 0; } prev = b; } } if (!isSorted) { logger.warn("Re-sorting buckets list"); resort(); } } <START> names.clear(); <END> }</code><technical_language>This is internal variable, do need clear here</technical_language>

Target:
private void removeBucketAndResort(String bucketName) { final HashSet<String> names = new HashSet<>(); if (!buckets.isEmpty()) { final Iterator<QueueBucket> iterator = buckets.iterator(); QueueBucket prev = null; boolean isSorted = true; while (iterator.hasNext()) { QueueBucket b = iterator.next(); if (!names.add(b.getName())) { logger.error("Bucket " + b.getName() + " already existed in the list, removing"); isSorted = false; iterator.remove(); } else if (b.getName().equals(bucketName)) { iterator.remove(); } else { if (prev != null) { final int compare = comparator.compare(prev, b); isSorted = isSorted && compare <= 0; } prev = b; } } logger.warn("Re-sorting buckets list"); resort(); } }
Source:
<code>public void verifyNoDomainForMemoryWhenDomainIsNotDataDomain() { for (StorageDomainType storageDomainType : StorageDomainType.values()) { if (!storageDomainType.isDataDomain()) { validStorageDomain.setStorageDomainType(storageDomainType); <START> verifyNoDomainForMemory(Arrays.asList(validStorageDomain)); <END> } } }</code><technical_language>Please Collections.singletonList()</technical_language>

Target:
public void verifyNoDomainForMemoryWhenDomainIsNotDataDomain() { for (StorageDomainType storageDomainType : StorageDomainType.values()) { if (!storageDomainType.isDataDomain()) { validStorageDomain.setStorageDomainType(storageDomainType); verifyNoDomainForMemory(Collections.singletonList(validStorageDomain)); } } }
Source:
<code>public long update() { session.getUser().checkAdmin(); Database db = session.getDatabase(); if (getSchema().resolveTableOrView(session, tableName) != null) { if (ifNotExists) { return 0; } throw DbException.get(ErrorCode.TABLE_OR_VIEW_ALREADY_EXISTS_1, tableName); } int id = getObjectId(); TableLink table = getSchema().createTableLink(id, tableName, driver, url, user, password, originalSchema, originalTable, emitUpdates, force); table.setTemporary(temporary); table.setGlobalTemporary(globalTemporary); table.setComment(comment); table.setReadOnly(readOnly); <START> if(fetchSize!=null){ <END> table.setFetchSize(fetchSize.getValue(session).getInt()); } if (temporary && !globalTemporary) { session.addLocalTempTable(table); } else { db.addSchemaObject(session, table); } return 0; }</code><technical_language>if (fetchSize != null) {</technical_language>

Target:
public long update() { session.getUser().checkAdmin(); Database db = session.getDatabase(); if (getSchema().resolveTableOrView(session, tableName) != null) { if (ifNotExists) { return 0; } throw DbException.get(ErrorCode.TABLE_OR_VIEW_ALREADY_EXISTS_1, tableName); } int id = getObjectId(); TableLink table = getSchema().createTableLink(id, tableName, driver, url, user, password, originalSchema, originalTable, emitUpdates, force); table.setTemporary(temporary); table.setGlobalTemporary(globalTemporary); table.setComment(comment); table.setReadOnly(readOnly); if (fetchSize > 0) { table.setFetchSize(fetchSize); } if (temporary && !globalTemporary) { session.addLocalTempTable(table); } else { db.addSchemaObject(session, table); } return 0; }
Source:
<code>public void finishMocking() { Mockito.framework().removeListener(listener); listener.testFinished(new TestFinishedEvent() { public Throwable getFailure() { return null; } public Object getTestClassInstance() { <START> return testClassInstances.get(0); <END> } public String getTestMethodName() { return null; } }); Mockito.validateMockitoUsage(); }</code><technical_language>This is unfortunate. fix #1232 improve API base this PR change</technical_language>

Target:
public void finishMocking() { finishMocking(null); }
Source:
<code>public static Block ipSubnetRange(@SqlType(StandardTypes.IPPREFIX) Slice value) { <START> validateIpPrefixAndGetBytes(value); <END> BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 2); IPADDRESS.writeSlice(blockBuilder, ipSubnetMin(value)); IPADDRESS.writeSlice(blockBuilder, ipSubnetMax(value)); return blockBuilder.build(); }</code><technical_language>is validated 3 times in this function</technical_language>

Target:
public static Block ipSubnetRange(@SqlType(StandardTypes.IPPREFIX) Slice value) { BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 2); IPADDRESS.writeSlice(blockBuilder, ipSubnetMin(value)); IPADDRESS.writeSlice(blockBuilder, ipSubnetMax(value)); return blockBuilder.build(); }
Source:
<code>static Object[] createLine(final double... points) { final MultiPath head = new MultiPath() <START> .M(0, <END> 0) .L(0, 0) .L(0, 0) .Z() .setFillAlpha(0) .setStrokeAlpha(0); final MultiPath tail = new MultiPath() .M(DECORATOR_WIDTH, DECORATOR_HEIGHT) .L(0, DECORATOR_HEIGHT) .L(DECORATOR_WIDTH / 2, 0) .Z() .setFillColor(ColorName.BLACK) .setFillAlpha(1); final OrthogonalPolyLine line = new OrthogonalPolyLine(Point2DArray.fromArrayOfDouble(points)); line.setCornerRadius(5); line.setDraggable(true); line.setSelectionStrokeOffset(SELECTION_OFFSET); line.setHeadOffset(head.getBoundingBox().getHeight()); line.setTailOffset(tail.getBoundingBox().getHeight()); final MultiPathDecorator headDecorator = new MultiPathDecorator(head); final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail); return new Object[]{line, headDecorator, tailDecorator}; }</code><technical_language>do need extra M L? M(0, 0).Z() enough</technical_language>

Target:
static Object[] createLine(final double... points) { final MultiPath head = new MultiPath(); final MultiPath tail = new MultiPath() .M(DECORATOR_WIDTH, DECORATOR_HEIGHT) .L(0, DECORATOR_HEIGHT) .L(DECORATOR_WIDTH / 2, 0) .Z() .setFillColor(ColorName.BLACK) .setFillAlpha(1); final OrthogonalPolyLine line = new OrthogonalPolyLine(Point2DArray.fromArrayOfDouble(points)); line.setCornerRadius(5); line.setDraggable(true); line.setSelectionStrokeOffset(SELECTION_OFFSET); line.setHeadOffset(head.getBoundingBox().getHeight()); line.setTailOffset(tail.getBoundingBox().getHeight()); final MultiPathDecorator headDecorator = new MultiPathDecorator(head); final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail); return new Object[]{line, headDecorator, tailDecorator}; }
Source:
<code>public static Optional<BackgroundCompactor> createAndRun(TransactionManager transactionManager, KeyValueService keyValueService, LockService lockService, Supplier<Boolean> inSafeHours) { if (!keyValueService.shouldManuallyCompact()) { return Optional.empty(); <START> } <END> BackgroundCompactor backgroundCompactor = new BackgroundCompactor(transactionManager, keyValueService, lockService, inSafeHours); backgroundCompactor.runInBackground(); return Optional.of(backgroundCompactor); }</code><technical_language>honest for this kind of I prefer a null object pattern (basically create-and-run a background compactor, if KVS manually compact compactor nothing) easier manage. I realise a significant break existing API, though. actionable, clear</technical_language>

Target:
public static Optional<BackgroundCompactor> createAndRun(TransactionManager transactionManager, KeyValueService keyValueService, LockService lockService, Supplier<Boolean> inSafeHours) { if (!keyValueService.shouldTriggerCompactions()) { return Optional.empty(); } BackgroundCompactor backgroundCompactor = new BackgroundCompactor(transactionManager, keyValueService, lockService, inSafeHours); backgroundCompactor.runInBackground(); return Optional.of(backgroundCompactor); }
Source:
<code>public void testNotFound() { assertCodeMakes( GET, URI.create("<LINK_1>"), NOT_FOUND.getStatusCode(), "Not Found", <START> "<itemNotFound code=\"NOT_FOUND.getStatusCode()\" xmlns=\"<LINK_0>\">\n <message>Object not Found</message>\n</itemNotFound>", <END> ResourceNotFoundException.class, "loadbalancers 2000 not found"); }</code><technical_language>incorrect</technical_language>

Target:
public void testNotFound() { assertCodeMakes( GET, URI.create("<LINK_1>"), NOT_FOUND.getStatusCode(), "Not Found", "<itemNotFound code=\"404\" xmlns=\"<LINK_0>\">\n <message>Object not Found</message>\n</itemNotFound>", ResourceNotFoundException.class, "loadbalancers 2000 not found"); }
Source:
<code>public void sendReminderNotification(String label) { <START> String NOTIFICATION_TITLE = label + " " + "\u23f0"; <END> String NOTIFICATION_TEXT = context.getString(R.string.reminders_notification_text); Intent intent = new Intent(context, AddGlucoseActivity.class); intent.putExtra("glucose_reminder_notification", true); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); Notification.Builder notificationBuilder; notificationBuilder = new Notification.Builder(context) .setContentTitle(NOTIFICATION_TITLE) .setContentText(NOTIFICATION_TEXT) .setAutoCancel(true) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setVibrate(new long[]{1000, 1000}) .setContentIntent(pendingIntent) .setSmallIcon(R.drawable.ic_stat_glucosio); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { notificationBuilder.setColor(context.getColor(R.color.glucosio_pink)); } Notification notification = notificationBuilder.build(); NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context); notificationManagerCompat.notify(NOTIFICATION_ID, notification); }</code><technical_language>capitalised</technical_language>

Target:
public void sendReminderNotification(String label) { String notificationTitle = label + " " + "\u23f0"; String[] arrayString = context.getResources().getStringArray(R.array.reminder_title_array); String notificationText = arrayString[generateRandomNumber(0, 1)]; Intent intent = new Intent(context, AddGlucoseActivity.class); intent.putExtra("glucose_reminder_notification", true); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); Notification.Builder notificationBuilder; notificationBuilder = new Notification.Builder(context) .setContentTitle(notificationTitle) .setContentText(notificationText) .setAutoCancel(true) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setVibrate(new long[]{1000, 1000}) .setContentIntent(pendingIntent) .setSmallIcon(R.drawable.ic_stat_glucosio); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { notificationBuilder.setColor(context.getColor(R.color.glucosio_pink)); } Notification notification = notificationBuilder.build(); NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context); notificationManagerCompat.notify(NOTIFICATION_ID, notification); }
Source:
<code>public void insertTableValuesAnalyzePipeline() throws SemanticException { boolean isPartitionStats = conf.getBoolVar(ConfVars.HIVE_STATS_COLLECT_PART_LEVEL_STATS) && tbl.isPartitioned(); if (isPartitionStats) { partSpec = new HashMap<>(); List<String> partKeys = Utilities.getColumnNamesFromFieldSchema(tbl.getPartitionKeys()); for (String partKey : partKeys) { partSpec.put(partKey, null); } } List<String> colNames = Utilities.getColumnNamesFromFieldSchema(tbl.getCols()); List<String> colTypes = ColumnStatsSemanticAnalyzer.getColumnTypes(tbl, colNames); String command = ColumnStatsSemanticAnalyzer.genRewrittenQuery( <START> tbl, colNames, colTypes, conf, partSpec, isPartitionStats, true); <END> insertAnalyzePipeline(command, true); }</code><technical_language>I pass tbl.getCols() instead of 2 lists getColumnTypes method removes some column names silently...it method work a list of FieldSchema entries</technical_language>

Target:
public void insertTableValuesAnalyzePipeline() throws SemanticException { boolean isPartitionStats = conf.getBoolVar(ConfVars.HIVE_STATS_COLLECT_PART_LEVEL_STATS) && tbl.isPartitioned(); if (isPartitionStats) { partSpec = new HashMap<>(); List<String> partKeys = Utilities.getColumnNamesFromFieldSchema(tbl.getPartitionKeys()); for (String partKey : partKeys) { partSpec.put(partKey, null); } } String command = ColumnStatsSemanticAnalyzer.genRewrittenQuery( tbl, conf, partSpec, isPartitionStats, true); insertAnalyzePipeline(command, true); }
Source:
<code>public Optional<SessionInfo> getSessionInfo(final String sessionId, final String dc) { WebTarget target = webTarget; if (dc != null) { target = target.queryParam("dc", dc); } target = addParams(target.path("info").path(sessionId), QueryOptions.BLANK); List<SessionInfo> sessionInfo = Arrays.asList(target <START> .request().accept(MediaType.APPLICATION_JSON_TYPE).get(SessionInfo[].class)); <END> return sessionInfo != null && sessionInfo.isEmpty() ? Optional.<SessionInfo>absent() : Optional.of(sessionInfo.get(0)); }</code><technical_language>SESSION_INFO_LIST_TYPE instead of array a list</technical_language>

Target:
public Optional<SessionInfo> getSessionInfo(final String sessionId, final String dc) { WebTarget target = webTarget; if (dc != null) { target = target.queryParam("dc", dc); } target = addParams(target.path("info").path(sessionId), QueryOptions.BLANK); List<SessionInfo> sessionInfo = target .request().accept(MediaType.APPLICATION_JSON_TYPE) .get(SESSION_INFO_LIST_TYPE); return sessionInfo != null && sessionInfo.isEmpty() ? Optional.<SessionInfo>absent() : Optional.of(sessionInfo.get(0)); }
Source:
<code>public void testMetacardMappers() { transformer.setMetacardMappers(Collections.singletonList(mockMetacardMapper())); InputStream inputStream = <START> new BufferedInputStream(getClass().getResourceAsStream("/FeatureMember.xml")); <END> Optional<Metacard> metacardOptional = transformer.apply(inputStream, mockWfsMetadata()); assertThat(metacardOptional.isPresent(), equalTo(true)); assertThat(metacardOptional.get().getAttribute("title"), notNullValue()); }</code><technical_language>closing BufferedInputStream in unit tests</technical_language>

Target:
public void testMetacardMappers() throws IOException { transformer.setMetacardMappers(Collections.singletonList(mockMetacardMapper())); try (InputStream inputStream = new BufferedInputStream(getClass().getResourceAsStream("/FeatureMember.xml"))) { Optional<Metacard> metacardOptional = transformer.apply(inputStream, mockWfsMetadata()); assertThat(metacardOptional.isPresent(), equalTo(true)); assertThat(metacardOptional.get().getAttribute("title"), notNullValue()); } }
Source:
<code>public void setClosed(boolean closed) { if (closed && !isClosed()) { builder.endBlock(); <START> builder.characters("\n"); END> builder.endBlock(); } super.setClosed(closed); }</code><technical_language>add newline</technical_language>

Target:
public void setClosed(boolean closed) { if (closed && !isClosed()) { builder.endBlock(); builder.endBlock(); } super.setClosed(closed); }
Source:
<code>public Map<String, Map<String, PropertyMapping>> mappingsForFunction() { Map<String, Map<String, PropertyMapping>> ret = new HashMap<>(); Map<String, PropertyMapping> attrs = new LinkedHashMap<>(); <START> if (maxLen >= 0) { <END> val maxLen = PropertyMapping.builder() .propertyNames(new String[]{"maxLen"}) .tfAttrName("maxlen") .build(); attrs.put("maxLen", maxLen); } ret.put(tensorflowName(), attrs); return ret; }</code><technical_language>this condition is happen initialization TF? ops import initialized default constructor, maxLen -1</technical_language>

Target:
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() { Map<String, Map<String, PropertyMapping>> ret = new HashMap<>(); Map<String, PropertyMapping> attrs = new LinkedHashMap<>(); if (is_static_maxlen) { val maxLen = PropertyMapping.builder() .propertyNames(new String[]{"maxLen"}) .tfAttrName("maxlen") .build(); attrs.put("maxLen", maxLen); } ret.put(tensorflowName(), attrs); return ret; }
Source:
<code>public int hashCode() { <START> int result = Objects.hashCode(memory); result = 31 * result + Objects.hashCode(vcores); <END> return result; }</code><technical_language>here. idiomatic create hash code for a primitive is call XYZ.hashCode(value) XYZ is class of primitive type</technical_language>

Target:
public int hashCode() { int result = Integer.hashCode(memory); result = 31 * result + Integer.hashCode(vcores); return result; }
Source:
<code>public void shouldSaveAConceptNumericWithAllowDecimalValue() throws Exception { Concept c = Context.getConceptService().getConcept(22); ConceptNumeric cn = new ConceptNumeric(c); <START> cn.addDescription(new ConceptDescription("some description", Context.getLocale())); <END> Context.getConceptService().saveConcept(cn); Assert.assertFalse(Context.getConceptService().getConceptNumeric(22).getAllowDecimal()); cn.setAllowDecimal(true); Context.getConceptService().saveConcept(cn); Assert.assertTrue(Context.getConceptService().getConceptNumeric(22).getAllowDecimal()); }</code><technical_language>Alternatively, i for pass in a null locale in ConceptSaveHandler set is returned Context.getLocale(), add a constructor takes a actual description locale get set save handler</technical_language>

Target:
public void shouldSaveAConceptNumericWithAllowDecimalValue() throws Exception { Concept c = Context.getConceptService().getConcept(22); ConceptNumeric cn = new ConceptNumeric(c); cn.addDescription(new ConceptDescription("some description", null)); Context.getConceptService().saveConcept(cn); Assert.assertFalse(Context.getConceptService().getConceptNumeric(22).getAllowDecimal()); cn.setAllowDecimal(true); Context.getConceptService().saveConcept(cn); Assert.assertTrue(Context.getConceptService().getConceptNumeric(22).getAllowDecimal()); }
Source:
<code>public void testNonTightHtmlTagIntolerantCheck() throws Exception { NonTightHtmlTagIntolerantCheck.visitJavadocTokenMethodCallCount = 0; final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagIntolerantCheck.class); checkConfig.addAttribute("violateExecutionOnNonTightHtml", "true"); final String[] expected = { "6: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), "13: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), "16: " + getCheckMessage(MSG_UNCLOSED_HTML, "li"), "21: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), "27: " + getCheckMessage(MSG_UNCLOSED_HTML, "tr"), "34: " + getCheckMessage(MSG_UNCLOSED_HTML, "li"), "40: " + getCheckMessage(MSG_UNCLOSED_HTML, "th"), "54: " + getCheckMessage(MSG_UNCLOSED_HTML, "li"), "71: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), "76: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), "85: " + getCheckMessage(MSG_UNCLOSED_HTML, "td"), "90: " + getCheckMessage(MSG_UNCLOSED_HTML, "html"), "97: " + getCheckMessage(MSG_UNCLOSED_HTML, "thead"), "124: " + getCheckMessage(MSG_UNCLOSED_HTML, "p"), }; <START> verify(checkConfig, getPath("InputAbstractJavadocNonTightHtmlTags.java"), expected); <END> Assert.assertEquals("Please ensure that method 'visitJavadocToken' is not called " + "more than thrice.", 3, NonTightHtmlTagIntolerantCheck.visitJavadocTokenMethodCallCount); }</code><technical_language>I this assert in a separate UT a separate input</technical_language>

Target:
public void testNonTightHtmlTagIntolerantCheck() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagIntolerantCheck.class); checkConfig.addAttribute("violateExecutionOnNonTightHtml", "true"); final String[] expected = { "6: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "16: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "21: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "27: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "tr"), "34: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "54: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "li"), "71: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "80: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "tr"), "124: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), }; verify(checkConfig, getPath("InputAbstractJavadocNonTightHtmlTags.java"), expected); }
Source:
<code>public CompareDiagramPostProcessor() { <START> super(null, null); <END> }</code><technical_language>is case for UMLDiffExtensionPostProcessor, this creates a totally useless post-processor. Change call reflects plugin.xml declaration : super(Pattern.compile("<LINK_0>\d.\d.\d/notation"), null);</technical_language>

Target:
public CompareDiagramPostProcessor() { super(Pattern.compile("<LINK_0>\\d.\\d.\\d/notation"), null); }
Source:
<code>public void testCloneBareRepositoryDefaultDirectory() throws IOException, URISyntaxException, JGitInternalException, GitAPIException { <START> CloneCommand command = Git.cloneRepository(); command.setURI(fileUri()); command.setBare(true); <END> command.verifyDirectories(new URIish(fileUri())); File directory = command.getDirectory(); assertEquals(git.getRepository().getWorkTree().getName() + Constants.DOT_GIT_EXT, directory.getName()); }</code><technical_language>optional: CloneCommand builder pattern, calls chained one: CloneCommand command = Git.cloneRepository().setURI(fileUri()).setBare(true); L161-162</technical_language>

Target:
public void testCloneBareRepositoryDefaultDirectory() throws IOException, URISyntaxException, JGitInternalException, GitAPIException { CloneCommand command = Git.cloneRepository().setURI(fileUri()).setBare(true); command.verifyDirectories(new URIish(fileUri())); File directory = command.getDirectory(); assertEquals(git.getRepository().getWorkTree().getName() + Constants.DOT_GIT_EXT, directory.getName()); }
Source:
<code>public boolean initializeUnityAds(Activity activity, String gameId) { if (!UnityAds.isSupported()) { Log.w(UnityAdapter.TAG, "The current device is not supported by Unity Ads."); return false; } if (UnityAds.isInitialized()) { return true; } MediationMetaData mediationMetaData = new MediationMetaData(activity); mediationMetaData.setName("AdMob"); mediationMetaData.setVersion(UnityAds.getVersion()); mediationMetaData.set("adapter_version", BuildConfig.VERSION_NAME); <START> mediationMetaData.commit(); <END> UnitySingletonListener listener = unitySingletonInstance.getUnitySingletonListenerInstance(); UnityAds.initialize(activity, gameId, listener, false, true); return true; }</code><technical_language>This setVersion is meant version of mediation sdk unity ads sdk version</technical_language>

Target:
public boolean initializeUnityAds(Activity activity, String gameId) { if (!UnityAds.isSupported()) { Log.w(UnityAdapter.TAG, "The current device is not supported by Unity Ads."); return false; } if (UnityAds.isInitialized()) { return true; } MediationMetaData mediationMetaData = new MediationMetaData(activity); mediationMetaData.setName("AdMob"); mediationMetaData.setVersion(MobileAds.getVersionString()); mediationMetaData.set("adapter_version", BuildConfig.VERSION_NAME); mediationMetaData.commit(); UnitySingletonListener listener = unitySingletonInstance.getUnitySingletonListenerInstance(); UnityAds.initialize(activity, gameId, listener, false, true); return true; }
Source:
<code>protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { Query<Boolean> connectQuery = new Query<Boolean>() { @Override public void execute(final DataRequestMonitor<Boolean> rm) { connect(new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), rm) { @Override @ConfinedToDsfExecutor("fExecutor") <START> protected void handleCompleted() { <END> if (isSuccess()) { setData(rm.getData()); } rm.done(); updateEnablement(); } }); } }; try { fExecutor.execute(connectQuery); connectQuery.get(); } catch (InterruptedException e) { } catch (ExecutionException e) { } catch (CancellationException e) { } catch (RejectedExecutionException e) { } }</code><technical_language>I concerned cancellation state is handled properly. safe doing: { super.handleCompleted(); updateEnablement(); }</technical_language>

Target:
protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { Query<Boolean> connectQuery = new Query<Boolean>() { @Override public void execute(final DataRequestMonitor<Boolean> rm) { connect(new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), rm) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { super.handleCompleted(); updateEnablement(); } }); } }; try { fExecutor.execute(connectQuery); connectQuery.get(); } catch (InterruptedException e) { } catch (ExecutionException e) { } catch (CancellationException e) { } catch (RejectedExecutionException e) { } }
Source:
<code>private void updateTypeElementFromATM( AnnotatedTypeMirror newATM, AnnotatedTypeMirror curATM, AnnotatedTypeFactory atf, ATypeElement typeToUpdate, int idx, TypeUseLocation defLoc) { if (idx == 1) { Set<Annotation> annosToRemove = getSupportedAnnosInSet(typeToUpdate.tlAnnotationsHere, atf); typeToUpdate.tlAnnotationsHere.removeAll(annosToRemove); <START> basetypes.put(typeToUpdate.description.toString(), newATM.getUnderlyingType()); <END> } if (curATM.getExplicitAnnotations().isEmpty()) { for (AnnotationMirror am : newATM.getAnnotations()) { addAnnotationsToATypeElement( newATM, typeToUpdate, defLoc, am, curATM.hasEffectiveAnnotation(am)); } } else if (curATM.getKind() == TypeKind.TYPEVAR) { for (AnnotationMirror am : newATM.getAnnotations()) { if (curATM.getAnnotationInHierarchy(am) != null) { break; } addAnnotationsToATypeElement( newATM, typeToUpdate, defLoc, am, curATM.hasEffectiveAnnotation(am)); } } if (newATM.getKind() == TypeKind.ARRAY && curATM.getKind() == TypeKind.ARRAY) { AnnotatedArrayType newAAT = (AnnotatedArrayType) newATM; AnnotatedArrayType oldAAT = (AnnotatedArrayType) curATM; updateTypeElementFromATM( newAAT.getComponentType(), oldAAT.getComponentType(), atf, typeToUpdate.innerTypes.getVivify( new InnerTypeLocation( TypeAnnotationPosition.getTypePathFromBinary( Collections.nCopies(2 * idx, 0)))), idx + 1, defLoc); } }</code><technical_language>Throw exception if key exists. diagnose problem if assumption (that collisions) is wrong</technical_language>

Target:
private void updateTypeElementFromATM( AnnotatedTypeMirror newATM, AnnotatedTypeMirror curATM, AnnotatedTypeFactory atf, ATypeElement typeToUpdate, int idx, TypeUseLocation defLoc) { if (idx == 1) { Set<Annotation> annosToRemove = getSupportedAnnosInSet(typeToUpdate.tlAnnotationsHere, atf); typeToUpdate.tlAnnotationsHere.removeAll(annosToRemove); } if (curATM.getExplicitAnnotations().isEmpty()) { for (AnnotationMirror am : newATM.getAnnotations()) { addAnnotationsToATypeElement( newATM, typeToUpdate, defLoc, am, curATM.hasEffectiveAnnotation(am)); } } else if (curATM.getKind() == TypeKind.TYPEVAR) { for (AnnotationMirror am : newATM.getAnnotations()) { if (curATM.getAnnotationInHierarchy(am) != null) { break; } addAnnotationsToATypeElement( newATM, typeToUpdate, defLoc, am, curATM.hasEffectiveAnnotation(am)); } } if (newATM.getKind() == TypeKind.ARRAY && curATM.getKind() == TypeKind.ARRAY) { AnnotatedArrayType newAAT = (AnnotatedArrayType) newATM; AnnotatedArrayType oldAAT = (AnnotatedArrayType) curATM; updateTypeElementFromATM( newAAT.getComponentType(), oldAAT.getComponentType(), atf, typeToUpdate.innerTypes.getVivify( new InnerTypeLocation( TypeAnnotationPosition.getTypePathFromBinary( Collections.nCopies(2 * idx, 0)))), idx + 1, defLoc); } }
Source:
<code>private static void descend(Method method, Object model, List<Class<?>> seen, int level) throws Exception { Class<?> type = method.getParameterTypes()[0]; Object child; <START> if (type.getName().equals(XML_GREGORIAN_CALENDAR)) { <END> child = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(1111, 10, 29)); } else { child = type.newInstance(); } method.invoke(model, child); if ((level == 1 || unseen(method, seen)) && (!XMLGregorianCalendar.class.isAssignableFrom(child.getClass()))) { populate(child, child.getClass(), seen, ++level); } }</code><technical_language>please put this (exceptional treatment) other treatment of kind done</technical_language>

Target:
private static void descend(Method method, Object model, List<Class<?>> seen, int level) throws Exception { Class<?> type = method.getParameterTypes()[0]; Object child = type.newInstance(); method.invoke(model, child); if (level == 1 || unseen(method, seen)) { populate(child, child.getClass(), seen, ++level); } }
Source:
<code>private Map<String, Object> getMinionConf() throws ConfigurationException { if (_configFileName != null) { return PinotConfigUtils.readConfigFromFile(_configFileName); } <START> return PinotConfigUtils.generateMinionConf(_minionPort); <END> }</code><technical_language>pass minionHost apply minionConf? For instance, _minionHost is for logging once</technical_language>

Target:
private Map<String, Object> getMinionConf() throws ConfigurationException, SocketException, UnknownHostException { if (_configFileName != null) { return PinotConfigUtils.readConfigFromFile(_configFileName); } return PinotConfigUtils.generateMinionConf(_minionHost, _minionPort); }
Source:
<code>public JettyRunner(Server server, final LifecycleManager manager) { this.server = server; LOG.info("Jetty server starting"); try { server.start(); int port = -1; for (Connector connector : server.getConnectors()) { if (connector.getName().equals(PLAINTEXT_CONNECTOR_NAME)) { port = ((ServerConnector)connector).getLocalPort(); break; } } <START> this.port = port; <END> LOG.info("Jetty server on port started", port); } catch (Exception e) { try { server.stop(); } catch (Exception e2) { } throw new ProvisionException("Jetty server failed to start", e); } }</code><technical_language>if connector found? throw exception</technical_language>

Target:
public JettyRunner(Server server, final LifecycleManager manager) { this.server = server; LOG.info("Jetty server starting"); try { server.start(); int port = -1; for (Connector connector : server.getConnectors()) { if (connector.getName().equals(UNENCRYPTED_CONNECTOR_NAME)) { port = ((ServerConnector)connector).getLocalPort(); break; } } this.port = port; LOG.info("Jetty server on port started", port); } catch (Exception e) { try { server.stop(); } catch (Exception e2) { } throw new ProvisionException("Jetty server failed to start", e); } }
Source:
<code>private VdcReturnValueBase restoreCinderDisk(CinderDisk cinderDisk, ImagesContainterParametersBase params) { Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RestoreFromCinderSnapshot, params, cloneContextAndDetachFromParent(), new SubjectEntity(VdcObjectType.Storage, cinderDisk.getStorageIds().get(0))); try { return future.get(); } catch (InterruptedException | ExecutionException e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>worth adding some log.</technical_language>

Target:
private VdcReturnValueBase restoreCinderDisk(CinderDisk cinderDisk, ImagesContainterParametersBase params) { Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RestoreFromCinderSnapshot, params, cloneContextAndDetachFromParent(), new SubjectEntity(VdcObjectType.Storage, cinderDisk.getStorageIds().get(0))); try { return future.get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); log.error("Error restoring snapshot"); } return null; }
Source:
<code>public void onNext(Event event) { if (operation == null || operation.isInProgress()) { <START> operation = projectionRepository.startBulkWrite(Durations.ofSeconds(40)); <END> } projectionRepository.internalDispatch(event); operation.checkExpiration(); }</code><technical_language>optional constructor parameter for now. If is absent, this mechanism enabled</technical_language>

Target:
public void onNext(Event event) { if (projectionRepository.status != Status.CATCHING_UP) { log().info("The catch-up is completing due to an overtime. Skipping event {}.", event); return; } if (projectionRepository.isBulkWriteRequired()) { if (!projectionRepository.isBulkWriteInProgress()) { operation = projectionRepository.startBulkWrite(projectionRepository.catchUpMaxDuration); } operation.checkExpiration(); if (!operation.isInProgress()) { return; } } projectionRepository.internalDispatch(event); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, null); textViewVersion = (TextView) view.findViewById(R.id.about_tv_version); listView = (ListView) view.findViewById(R.id.list); try { versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { <START> e.printStackTrace(); <END> } textViewVersion.setText(getString(R.string.about_version_title_template, versionName)); menuItems = new String[3]; menuItems[0] = getString(R.string.about_credits); menuItems[1] = getString(R.string.about_about); menuItems[2] = getString(R.string.about_send_feedback); ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, menuItems); listView.setAdapter(adapter); listView.setOnItemClickListener(this); return view; }</code><technical_language>Timber for printing exceptions</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, null); textViewVersion = (TextView) view.findViewById(R.id.about_tv_version); listView = (ListView) view.findViewById(R.id.list); try { versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { LoggingManager.Timber.d("Get version name error", e); } textViewVersion.setText(getString(R.string.about_version_title_template, versionName)); menuItems = new String[3]; menuItems[0] = getString(R.string.about_credits); menuItems[1] = getString(R.string.about_about); menuItems[2] = getString(R.string.about_send_feedback); ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, menuItems); listView.setAdapter(adapter); listView.setOnItemClickListener(this); return view; }
Source:
<code>private boolean validate(HasProtectionAccessTokenParams params) { final OxdServerConfiguration configuration = ServerLauncher.getInjector().getInstance(ConfigurationService.class).get(); if (configuration.getProtectCommandsWithAccessToken() != null && !configuration.getProtectCommandsWithAccessToken()) { return false; } final String accessToken = params.getProtectionAccessToken(); if (StringUtils.isBlank(accessToken)) { throw new ErrorResponseException(ErrorResponseCode.BLANK_PROTECTION_ACCESS_TOKEN); } if (params instanceof RegisterSiteParams) { return false; } final RpService rpService = ServerLauncher.getInjector().getInstance(RpService.class); final Rp rp = rpService.getRp(params.getOxdId()); final IntrospectionResponse introspectionResponse = introspect(accessToken, params.getOxdId()); LOG.trace("access_token: " + accessToken + ", introspection: " + introspectionResponse + ", clientId: " + rp.getClientId()); if (StringUtils.isBlank(introspectionResponse.getClientId())) { throw new ErrorResponseException(ErrorResponseCode.NO_CLIENT_ID_IN_INTROSPECTION_RESPONSE); } if (!IntrospectionService.getScopes(introspectionResponse).contains("oxd")) { throw new ErrorResponseException(ErrorResponseCode.PROTECTION_ACCESS_TOKEN_INSUFFICIENT_SCOPE); } if (!introspectionResponse.getClientId().equals(rp.getClientId())) { <START> throw new ErrorResponseException(ErrorResponseCode.INVALID_ID_TOKEN_MISMATCHED_CLIENT_ID); <END> } return true; }</code><technical_language>Wrong error, is access token</technical_language>

Target:
private boolean validate(HasProtectionAccessTokenParams params) { final OxdServerConfiguration configuration = ServerLauncher.getInjector().getInstance(ConfigurationService.class).get(); if (configuration.getProtectCommandsWithAccessToken() != null && !configuration.getProtectCommandsWithAccessToken()) { return false; } final String accessToken = params.getProtectionAccessToken(); if (StringUtils.isBlank(accessToken)) { throw new ErrorResponseException(ErrorResponseCode.BLANK_PROTECTION_ACCESS_TOKEN); } if (params instanceof RegisterSiteParams) { return false; } final RpService rpService = ServerLauncher.getInjector().getInstance(RpService.class); final Rp rp = rpService.getRp(params.getOxdId()); final IntrospectionResponse introspectionResponse = introspect(accessToken, params.getOxdId()); LOG.trace("access_token: " + accessToken + ", introspection: " + introspectionResponse + ", clientId: " + rp.getClientId()); if (StringUtils.isBlank(introspectionResponse.getClientId())) { throw new ErrorResponseException(ErrorResponseCode.NO_CLIENT_ID_IN_INTROSPECTION_RESPONSE); } if (!IntrospectionService.getScopes(introspectionResponse).contains("oxd")) { throw new ErrorResponseException(ErrorResponseCode.PROTECTION_ACCESS_TOKEN_INSUFFICIENT_SCOPE); } if (!introspectionResponse.getClientId().equals(rp.getClientId())) { throw new ErrorResponseException(ErrorResponseCode.INVALID_ACCESS_TOKEN_MISMATCHED_CLIENT_ID); } return true; }
Source:
<code><START> public void testStreamingLocal() throws Exception { <END> String[] ARGS = { "--references=" + helper.PLATINUM_GENOMES_BRCA1_REFERENCES, "--variantSetId=" + helper.PLATINUM_GENOMES_DATASET, "--hasNonVariantSegments", "--output=" + outputPrefix, "--useGrpc=true" }; testBase(ARGS); }</code><technical_language>useGrpc argument this pipeline, able successfully run this test? I get error java.lang.IllegalArgumentException: Class interface com.google.cloud.genomics.dataflow.pipelines.IdentityByState$Options missing a property named 'useGrpc'. I run it. I I needed do I ran [this issue](<LINK_1> (1) grab a [more version of alpn](<LINK_0> stick in ./lib (2) update activation section in pom.xml newer version</technical_language>

Target:
public void testStreamingLocal() throws Exception { String[] ARGS = { "--references=" + helper.PLATINUM_GENOMES_BRCA1_REFERENCES, "--variantSetId=" + helper.PLATINUM_GENOMES_DATASET, "--hasNonVariantSegments", "--output=" + outputPrefix }; testBase(ARGS); }
Source:
<code>public void insertMigratedData(int partitionId, Map<String, Map<Data, MultiMapValue>> map) { for (Map.Entry<String, Map<Data, MultiMapValue>> entry : map.entrySet()) { String name = entry.getKey(); MultiMapContainer container = getOrCreateCollectionContainerWithoutAccess(partitionId, name); Map<Data, MultiMapValue> collections = entry.getValue(); long maxRecordId = -1; for (Map.Entry<Data, MultiMapValue> multiMapValueEntry : collections.entrySet()) { MultiMapValue multiMapValue = multiMapValueEntry.getValue(); <START> MultiMapValue prevValue = container.getMultiMapValues().put(multiMapValueEntry.getKey(), multiMapValue); <END> if (prevValue != null) { container.decrementSize(prevValue.size()); } container.incrementSize(multiMapValue.size()); long recordId = getMaxRecordId(multiMapValue); maxRecordId = max(maxRecordId, recordId); } container.setId(maxRecordId); } }</code><technical_language>This approach suffers lack of cohesion. logic for updating size is multiple places. I expect a method container deal inserted piece of data update state needs updated. end a procedural approach (so hide size increment stuff)</technical_language>

Target:
public void insertMigratedData(int partitionId, Map<String, Map<Data, MultiMapValue>> map) { for (Map.Entry<String, Map<Data, MultiMapValue>> entry : map.entrySet()) { String name = entry.getKey(); MultiMapContainer container = getOrCreateCollectionContainerWithoutAccess(partitionId, name); Map<Data, MultiMapValue> collections = entry.getValue(); long maxRecordId = -1; for (Map.Entry<Data, MultiMapValue> multiMapValueEntry : collections.entrySet()) { MultiMapValue multiMapValue = multiMapValueEntry.getValue(); container.setValue(multiMapValueEntry.getKey(), multiMapValue); long recordId = getMaxRecordId(multiMapValue); maxRecordId = max(maxRecordId, recordId); } container.setId(maxRecordId); } }
Source:
<code>public Action<?, ?> downscaleClusterProxyRegistrationAction() { return new AbstractDownscaleAction<>(StackEvent.class) { @Override protected void doExecute(FreeIpaDownscaleContext context, StackEvent payload, Map<Object, Object> variables) throws Exception { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.DOWNSCALE_IN_PROGRESS, "Updating cluster proxy registration."); List<String> instanceIdsToRegister = stack.getNotDeletedInstanceMetaDataList().stream() .map(InstanceMetaData::getInstanceId) <START> .filter(instanceId -> !context.getInstanceIds().contains(instanceId)) <END> .collect(Collectors.toList()); ClusterProxyUpdateRegistrationRequest request = new ClusterProxyUpdateRegistrationRequest(stack.getId(), instanceIdsToRegister); sendEvent(context, request.selector(), request); } }; }</code><technical_language>here, AbstractDownscaleAction a method for instanceIds variables, put in context, info in 2 places</technical_language>

Target:
public Action<?, ?> downscaleClusterProxyRegistrationAction() { return new AbstractDownscaleAction<>(StackEvent.class) { @Override protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) throws Exception { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.DOWNSCALE_IN_PROGRESS, "Updating cluster proxy registration."); List<String> instanceIds = getInstanceIds(variables); List<String> instanceIdsToRegister = stack.getNotDeletedInstanceMetaDataList().stream() .map(InstanceMetaData::getInstanceId) .filter(instanceId -> !instanceIds.contains(instanceId)) .collect(Collectors.toList()); ClusterProxyUpdateRegistrationRequest request = new ClusterProxyUpdateRegistrationRequest(stack.getId(), instanceIdsToRegister); sendEvent(context, request.selector(), request); } }; }
Source:
<code>public CborObject toCbor() { Map<String, CborObject> cbor = new TreeMap<>(); <START> cbor.put("count", new CborObject.CborLong(bytesRead)); <END> cbor.put("caps", new CborObject.CborList(retrievedCapabilities)); return CborObject.CborMap.build(cbor); }</code><technical_language>rename count -> offset</technical_language>

Target:
public CborObject toCbor() { Map<String, CborObject> cbor = new TreeMap<>(); cbor.put("bytes", new CborObject.CborLong(bytesRead)); cbor.put("caps", new CborObject.CborList(retrievedCapabilities)); return CborObject.CborMap.build(cbor); }
Source:
<code>public ItemUseHandler getItemHandler() { return e -> { Location currentLoc = e.getPlayer().getLocation(); JsonObject json = createJsonFromLocation(currentLoc); <START> PersistentDataContainer pdc = item.getItemMeta().getPersistentDataContainer(); <END> pdc.set(locationKey, PersistentDataType.STRING, json.toString()); e.getPlayer().sendMessage("Successfully saved current location. You will teleport here when you fall in the void."); }; }</code><technical_language>e.getItem(), this is a fatal bug item refers ItemStack displayed in guide</technical_language>

Target:
public ItemUseHandler getItemHandler() { return e -> { Location currentLoc = e.getPlayer().getLocation(); JsonObject json = createJsonFromLocation(currentLoc); ItemStack item = e.getItem(); if (SlimefunPlugin.getProtectionManager().hasPermission(e.getPlayer(), currentLoc, ProtectableAction.PLACE_BLOCK) && item.hasItemMeta()) { ItemMeta itemMeta = item.getItemMeta(); itemMeta.getPersistentDataContainer().set(locationKey, PersistentJsonDataType.JSON_OBJECT, json); item.setItemMeta(itemMeta); SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.resurrected-location", true); } SlimefunPlugin.getLocalization().sendMessage(e.getPlayer(), "messages.talisman.resurrected-location-failed", true); }; }
Source:
<code>public void readSettings() { <START> String inFilePath = ModuleSettings.getConfigSetting(contextName, PROP_LASTINPUT_PATH); <END> if (null != inFilePath) { if (!inFilePath.isEmpty()) { pathTextField.setText(inFilePath); } } }</code><technical_language>this method need public</technical_language>

Target:
void readSettings() { String inFilePath = ModuleSettings.getConfigSetting(contextName, PROP_LASTINPUT_PATH); if (null != inFilePath) { if (!inFilePath.isEmpty()) { pathTextField.setText(inFilePath); } } }
Source:
<code>public void shouldReturnLastFinishedRun() { JobAction jobAction = getJobActionFromNewProjectWithWorkspaceFile(); Run<?, ?> run = jobAction.getLastFinishedRun(); <START> assertThat(run).isNotNull(); <END> }</code><technical_language>s.o</technical_language>

Target:
public void shouldReturnLastFinishedRun() { FreeStyleProject project = createJobWithWorkspaceFile("eclipse.txt"); enableWarningsWithFilePattern(project); scheduleBuildAndAssertStatus(project, Result.SUCCESS); JobAction firstJobAction = project.getAction(JobAction.class); Run<?, ?> firstRun = firstJobAction.getLastFinishedRun(); assertThat(firstRun.number).isEqualTo(1); scheduleBuildAndAssertStatus(project, Result.SUCCESS); JobAction secondJobAction = project.getAction(JobAction.class); Run<?, ?> secondRun = secondJobAction.getLastFinishedRun(); assertThat(secondRun.number).isEqualTo(2); }