auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void removeJson(MessageContext synCtx, SynapsePath jsonPath) throws IOException, PathNotFoundException { SynapseJsonPath synapseJsonPath = (SynapseJsonPath) jsonPath; Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); String jsonPathString = synapseJsonPath.toString(); jsonPathString = jsonPathString.substring(10, jsonPathString.length() - 1); <START> if (jsonPathString.equals("$") || jsonPathString.equals("$.")) { <END> JsonUtil.getNewJsonPayload(axis2MessageCtx, "", true, true); } else { String jsonString = IOUtils.toString(JsonUtil.getJsonPayload(axis2MessageCtx)); if (!StringUtils.isEmpty(jsonString)) { String result = jsonString; DocumentContext doc = JsonPath.parse(result); doc.delete(synapseJsonPath.getJsonPath()); result = doc.jsonString(); JsonUtil.getNewJsonPayload(axis2MessageCtx, result, true, true); } } }</code><technical_language>isWholeBody function here? <LINK_0></technical_language>

Target:
public void removeJson(MessageContext synCtx, SynapsePath jsonPath) throws IOException, PathNotFoundException { SynapseJsonPath synapseJsonPath = (SynapseJsonPath) jsonPath; Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); String jsonPathString = synapseJsonPath.toString(); jsonPathString = jsonPathString.substring(10, jsonPathString.length() - 1); String[] jsonPathArray = jsonPathString.split(","); String jsonString = IOUtils.toString(JsonUtil.getJsonPayload(axis2MessageCtx)); String result = jsonString; if (jsonPathArray.length > 0) { for (String path : jsonPathArray) { if (path.equals("$") || path.equals("$.")) { JsonUtil.getNewJsonPayload(axis2MessageCtx, "", true, true); result = ""; } else { DocumentContext doc = JsonPath.parse(result); doc.delete(path); result = doc.jsonString(); } } JsonUtil.getNewJsonPayload(axis2MessageCtx, result, true, true); } }
Source:
<code>protected void AddVmTemplateImages() { Guid vmSnapshotId = Guid.NewGuid(); for (DiskImage diskImage : mImages) { CreateImageTemplateParameters createParams = new CreateImageTemplateParameters(diskImage.getImageId(), getVmTemplateId(), getVmTemplateName(), getVmId()); createParams.setStorageDomainId(diskImage.getStorageIds().get(0)); createParams.setVmSnapshotId(vmSnapshotId); createParams.setEntityId(getParameters().getEntityId()); createParams.setDestinationStorageDomainId(diskInfoDestinationMap.get(diskImage.getId()) .getStorageIds() .get(0)); createParams.setDiskAlias(diskInfoDestinationMap.get(diskImage.getId()).getDiskAlias()); createParams.setParentParameters(getParameters()); if (getParameters().getDiskInfoDestinationMap() != null && getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) { createParams.setQuotaId(getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId() != null ? getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId() : null); } else { <START> createParams.setQuotaId(diskImage.getQuotaId()); <END> } VdcReturnValueBase retValue = Backend.getInstance().runInternalAction( VdcActionType.CreateImageTemplate, createParams, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!retValue.getSucceeded()) { throw new VdcBLLException(retValue.getFault().getError(), retValue.getFault().getMessage()); } getReturnValue().getTaskIdList().addAll(retValue.getInternalTaskIdList()); newDiskImages.add((DiskImage) retValue.getActionReturnValue()); } }</code><technical_language>getQuotaStorageConsumptionParameters() this line for disk's quota (line 493): Collection<DiskImage> disksList = diskInfoDestinationMap.values().size() > 0 ? diskInfoDestinationMap.values() : getVm().getDiskList(); is case here: for (DiskImage diskImage : mImages) { // mImages = getVm().getDiskList() .. fix; .. } please code for validating setting</technical_language>

Target:
protected void AddVmTemplateImages() { Guid vmSnapshotId = Guid.NewGuid(); for (DiskImage diskImage : mImages) { CreateImageTemplateParameters createParams = new CreateImageTemplateParameters(diskImage.getImageId(), getVmTemplateId(), getVmTemplateName(), getVmId()); createParams.setStorageDomainId(diskImage.getStorageIds().get(0)); createParams.setVmSnapshotId(vmSnapshotId); createParams.setEntityId(getParameters().getEntityId()); createParams.setDestinationStorageDomainId(diskInfoDestinationMap.get(diskImage.getId()) .getStorageIds() .get(0)); createParams.setDiskAlias(diskInfoDestinationMap.get(diskImage.getId()).getDiskAlias()); createParams.setParentParameters(getParameters()); createParams.setQuotaId(getQuotaIdForDisk(diskImage)); VdcReturnValueBase retValue = Backend.getInstance().runInternalAction( VdcActionType.CreateImageTemplate, createParams, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!retValue.getSucceeded()) { throw new VdcBLLException(retValue.getFault().getError(), retValue.getFault().getMessage()); } getReturnValue().getTaskIdList().addAll(retValue.getInternalTaskIdList()); newDiskImages.add((DiskImage) retValue.getActionReturnValue()); } }
Source:
<code>public List<ChePlugin> getTooling(RuntimeIdentity runtimeID, Collection<PluginMeta> pluginsMeta) throws InfrastructureException { String workspaceId = runtimeID.getWorkspaceId(); CompletableFuture<Void> startFuture = new CompletableFuture<>(); CompletableFuture<List<ChePlugin>> toolingFuture = new CompletableFuture<>(); KubernetesNamespace kubernetesNamespace = factory.create(workspaceId); E brokerEnvironment = brokerEnvironmentFactory.create(pluginsMeta, runtimeID); environmentProvisioner.provision(brokerEnvironment, runtimeID); ListenBrokerEvents listenBrokerEvents = getListenEventPhase(workspaceId, startFuture, toolingFuture); PrepareStorage prepareStorage = getPrepareStoragePhase(workspaceId, brokerEnvironment); WaitBrokerResult waitBrokerResult = getWaitBrokerPhase(toolingFuture); DeployBroker deployBroker = getDeployBrokerPhase( <START> runtimeID.getWorkspaceId(), kubernetesNamespace, brokerEnvironment, startFuture); <END> listenBrokerEvents.then(prepareStorage).then(deployBroker).then(waitBrokerResult); return listenBrokerEvents.execute(); }</code><technical_language>I set WS_ID in BrokerEnvironmentFactory, WDYT</technical_language>

Target:
public List<ChePlugin> getTooling(RuntimeIdentity runtimeID, Collection<PluginMeta> pluginsMeta) throws InfrastructureException { String workspaceId = runtimeID.getWorkspaceId(); CompletableFuture<List<ChePlugin>> toolingFuture = new CompletableFuture<>(); KubernetesNamespace kubernetesNamespace = factory.create(workspaceId); E brokerEnvironment = brokerEnvironmentFactory.create(pluginsMeta, runtimeID); environmentProvisioner.provision(brokerEnvironment, runtimeID); ListenBrokerEvents listenBrokerEvents = getListenEventPhase(workspaceId, toolingFuture); PrepareStorage prepareStorage = getPrepareStoragePhase(workspaceId, brokerEnvironment); WaitBrokerResult waitBrokerResult = getWaitBrokerPhase(toolingFuture); DeployBroker deployBroker = getDeployBrokerPhase( runtimeID.getWorkspaceId(), kubernetesNamespace, brokerEnvironment, toolingFuture); listenBrokerEvents.then(prepareStorage).then(deployBroker).then(waitBrokerResult); return listenBrokerEvents.execute(); }
Source:
<code><START> public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { <END> player = args.length < 2 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[0]); uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); network = NetworkHelper.getSoulNetwork(uuid); }</code><technical_language>for network. for commands handling moved here</technical_language>

Target:
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (args.length == 1 && (args[0].equals("?") || args[0].equals("help"))) { sender.sendMessage(new TextComponentTranslation(getHelp())); return; } player = args.length < 2 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[0]); uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); network = NetworkHelper.getSoulNetwork(uuid); subExecute(server, sender, args); }
Source:
<code>public Optional<RepositoryId> getLastViewedRepository() { if (sessionConfig.getLastViewedRepository().isEmpty()) { return Optional.empty(); } else { <START> RepositoryId repositoryId = RepositoryId.createFromId(sessionConfig.getLastViewedRepository()); <END> if (repositoryId == null) { return Optional.empty(); } else { return Optional.of(repositoryId); } } }</code><technical_language>treat if case guard clause this out of else</technical_language>

Target:
public Optional<RepositoryId> getLastViewedRepository() { if (sessionConfig.getLastViewedRepository().isEmpty()) { return Optional.empty(); } RepositoryId repositoryId = RepositoryId.createFromId(sessionConfig.getLastViewedRepository()); if (repositoryId == null) { return Optional.empty(); } return Optional.of(repositoryId); }
Source:
<code>public void rightClickAir(GlowPlayer player, ItemStack holding) { Iterator<Block> itr = new BlockIterator(player, 5); Block target = null; <START> while (itr.hasNext()) { <END> target = itr.next(); if (target.getType() != Material.AIR) { break; } } if (target != null) { BlockFace face = BlockFace.SELF; Material type = target.getType(); Material replaceWith; if (type == Material.WATER || type == Material.STATIONARY_WATER) { replaceWith = Material.WATER_BUCKET; } else if (type == Material.LAVA || type == Material.STATIONARY_LAVA) { replaceWith = Material.LAVA_BUCKET; } else { return; } if (target.getState().getRawData() != 8) { return; } PlayerBucketFillEvent bucketFill = EventFactory.onPlayerBucketFill(player, target, face, holding.getType(), holding); if (bucketFill.isCancelled()) { return; } if (player.getGameMode() != GameMode.CREATIVE) { if (holding.getAmount() == 1) { holding.setType(replaceWith); } else { holding.setAmount(holding.getAmount() - 1); player.getInventory().addItem(new ItemStack(replaceWith)); } } target.setType(Material.AIR); } }</code><technical_language>This section of code "last target"</technical_language>

Target:
public void rightClickAir(GlowPlayer player, ItemStack holding) { Iterator<Block> itr = new BlockIterator(player, 5); Block target = null; Block previousTarget = null; BlockType targetBlockType = null; boolean validTarget = false; while (itr.hasNext()) { previousTarget = target; target = itr.next(); targetBlockType = ItemTable.instance().getBlock(target.getType()); if (targetBlockType != null && targetBlockType instanceof BlockLiquid) { if (((BlockLiquid)targetBlockType).isCollectible((GlowBlockState) target.getState())) { validTarget = true; break; } } } if (target != null && validTarget == true) { BlockFace face; if (previousTarget != null) { face = target.getFace(previousTarget); } else { face = BlockFace.SELF; } Material replaceWith = ((BlockLiquid) targetBlockType).getBucketType(); PlayerBucketFillEvent bucketFill = EventFactory.onPlayerBucketFill(player, target, face, holding.getType(), holding); if (bucketFill.isCancelled()) { return; } if (player.getGameMode() != GameMode.CREATIVE) { if (holding.getAmount() == 1) { holding.setType(replaceWith); } else { holding.setAmount(holding.getAmount() - 1); player.getInventory().addItem(new ItemStack(replaceWith)); } } target.setType(Material.AIR); } }
Source:
<code>public void updateEvent(Event event, Position position) { try { dataManager.addEvent(event); } catch (SQLException error) { Log.warning(error); } Set<Long> users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId()); Device device = Context.getIdentityManager().getDeviceById(event.getDeviceId()); <START> if (device != null && device.getAttributes().containsKey("notifyOnly")) { <END> List<String> notifyOnly = Arrays.asList(device.getAttributes().get("notifyOnly").toString().split(" ")); for (long userId : users) { if (!notifyOnly.contains(Context.getPermissionsManager().getUser(userId).getEmail())) { users.remove(userId); } } } for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { Notification notification = getUserNotificationByType(userId, event.getType()); if (notification != null) { if (notification.getAttributes().containsKey("web")) { Context.getConnectionManager().updateEvent(userId, event, position); } if (notification.getAttributes().containsKey("mail")) { NotificationMail.sendMailAsync(userId, event, position); } } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position); } }</code><technical_language>lookupConfigString instead? Ideally want configurable globally in config instead of per-device</technical_language>

Target:
public void updateEvent(Event event, Position position) { try { dataManager.addEvent(event); } catch (SQLException error) { Log.warning(error); } Set<Long> users = new HashSet<>(Context.getPermissionsManager().getDeviceUsers(event.getDeviceId())); String notifyOnly = Context.getDeviceManager().lookupConfigString(event.getDeviceId(), "event.notifyOnly", null); if (notifyOnly != null) { List<String> notifyOnlyList = Arrays.asList(notifyOnly.split(" ")); for (long userId : users) { if (!notifyOnlyList.contains(Context.getPermissionsManager().getUser(userId).getEmail())) { users.remove(userId); } } } for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { Notification notification = getUserNotificationByType(userId, event.getType()); if (notification != null) { if (notification.getAttributes().containsKey("web")) { Context.getConnectionManager().updateEvent(userId, event, position); } if (notification.getAttributes().containsKey("mail")) { NotificationMail.sendMailAsync(userId, event, position); } } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position); } }
Source:
<code>public void dialogIsCancellable() { dialogFragment.show(fragmentManager, "tag"); <START> fragmentManager.executePendingTransactions(); <END> assertThat(shadowOf(dialogFragment.getDialog()).isCancelable(), equalTo(true)); }</code><technical_language>I do shadowOf(getMainLooper()).idle(); instead a more general of running looper</technical_language>

Target:
public void dialogIsCancellable() { dialogFragment.show(fragmentManager, "tag"); assertThat(shadowOf(dialogFragment.getDialog()).isCancelable(), equalTo(true)); }
Source:
<code>public void testCreateTableNotExistsTrue() throws Exception { CreateTable statement = new CreateTable(QualifiedName.of("test_table"), ImmutableList.of(new ColumnDefinition("a", "BIGINT", Optional.empty())), true, ImmutableMap.of(), Optional.empty()); try { getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList())); } <START> catch (RuntimeException e) { <END> fail("CreateTableTask shouldn't throw when notExists is set to true"); } assertEquals(metadata.getCreateTableCallCount(), 1); }</code><technical_language>Remove catch block exception propagate (which fails test)</technical_language>

Target:
public void testCreateTableNotExistsTrue() throws Exception { CreateTable statement = new CreateTable(QualifiedName.of("test_table"), ImmutableList.of(new ColumnDefinition("a", "BIGINT", Optional.empty())), true, ImmutableMap.of(), Optional.empty()); getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList())); assertEquals(metadata.getCreateTableCallCount(), 1); }
Source:
<code>public boolean removeOverview(ProjectOverview overview) throws IOException { if (overview.isDeletable()) { currentSession().delete(overview); <START> return true; <END> } return false; }</code><technical_language>If added a CascadeType Project's ProjectOverviews, overview need dissociated project delete</technical_language>

Target:
public boolean removeOverview(ProjectOverview overview) throws IOException { if (overview.isDeletable()) { overview.setProject(null); currentSession().delete(overview); return true; } return false; }
Source:
<code>protected boolean canDoAction() { if (!GlusterFeatureSupported.glusterGeoReplication(getVdsGroup().getCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEO_REP_NOT_SUPPORTED); } slaveVolume = getSlaveVolume(); if (slaveVolume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } if (slaveVolume.getStatus() != GlusterStatus.UP) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } slaveHost = getSlaveHost(); if <START> (slaveHost == <END> null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); } if (!areAllRemoteServersUp()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_REMOTE_HOSTS_ARE_NOT_ACCESSIBLE); } GlusterGeoRepSession geoRepSession = getGeoRepDao().getGeoRepSession(getGlusterVolumeId(), getParameters().getSlaveHost(), getParameters().getSlaveVolumeName()); if (geoRepSession != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_GEOREP_SESSION_ALREADY_CREATED); } return super.canDoAction(); }</code><technical_language>I hope need host well? applicable this host bricks</technical_language>

Target:
protected boolean canDoAction() { if (!GlusterFeatureSupported.glusterGeoReplication(getVdsGroup().getCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEO_REP_NOT_SUPPORTED); } slaveHost = getSlaveHost(); if (slaveHost == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); } if (slaveHost.getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP, String.format("$%1$s %2$s", "VdsName", slaveHost.getName())); } slaveVolume = getSlaveVolume(); if (slaveVolume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } if (slaveVolume.getStatus() != GlusterStatus.UP) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } if (!areAllRemoteServersUp()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_ONE_OR_MORE_REMOTE_HOSTS_ARE_NOT_ACCESSIBLE); } GlusterGeoRepSession geoRepSession = getGeoRepDao().getGeoRepSession(getGlusterVolumeId(), getParameters().getSlaveHost(), getParameters().getSlaveVolumeName()); if (geoRepSession != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_GEOREP_SESSION_ALREADY_CREATED); } return super.canDoAction(); }
Source:
<code>private void submitNewTask( TaskMonitor<SubTaskType> taskMonitor, SubTaskSpec<SubTaskType> spec ) { LOG.info("Submit a new task for spec[%s] and inputSplit[%s]", spec.getId(), spec.getInputSplit()); final ListenableFuture<SubTaskCompleteEvent<SubTaskType>> future = taskMonitor.submit(spec); Futures.addCallback( future, new FutureCallback<SubTaskCompleteEvent<SubTaskType>>() { @Override public void onSuccess(SubTaskCompleteEvent<SubTaskType> completeEvent) { taskCompleteEvents.offer(completeEvent); } @Override public void onFailure(Throwable t) { LOG.error(t, "Error while running a task for subTaskSpec[%s]", spec); taskCompleteEvents.offer(SubTaskCompleteEvent.fail(spec, t)); } }, <START> blockingQueueHandler <END> ); }</code><technical_language>taskCompleteEvents.offer(completeEvent); -- BlockingQueue.offer() is non-blocking</technical_language>

Target:
private void submitNewTask( TaskMonitor<SubTaskType> taskMonitor, SubTaskSpec<SubTaskType> spec ) { LOG.info("Submit a new task for spec[%s] and inputSplit[%s]", spec.getId(), spec.getInputSplit()); final ListenableFuture<SubTaskCompleteEvent<SubTaskType>> future = taskMonitor.submit(spec); Futures.addCallback( future, new FutureCallback<SubTaskCompleteEvent<SubTaskType>>() { @Override public void onSuccess(SubTaskCompleteEvent<SubTaskType> completeEvent) { taskCompleteEvents.offer(completeEvent); } @Override public void onFailure(Throwable t) { LOG.error(t, "Error while running a task for subTaskSpec[%s]", spec); taskCompleteEvents.offer(SubTaskCompleteEvent.fail(spec, t)); } }, Execs.directExecutor() ); }
Source:
<code>public void testArrayOfRow() { Optional<VerifierQueryEvent> event = createVerification("SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]", "SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]").run(); assertTrue(event.isPresent()); assertEvent(event.get(), SUCCEEDED, Optional.empty(), Optional.empty(), Optional.empty()); event = createVerification("SELECT ARRAY[ROW(1, 'a'), ROW(2, 'b')]", "SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]").run(); assertTrue(event.isPresent()); assertEvent( event.get(), FAILED, Optional.of(true), Optional.of("COLUMN_MISMATCH"), Optional.of("Test state SUCCEEDED, Control state SUCCEEDED\n" + "COLUMN MISMATCH\n" + "Control 1 rows, Test 1 rows\n" + "Mismatched Columns:\n" + <START> " _col0 \\(array\\(row\\(integer, varchar\\(1\\)\\)\\)\\): control\\(sorted_checksum: 71 b5 2f 7f 1e 9b a6 a4\\) test\\(sorted_checksum: b4 3c 7d 02 2b 14 77 12\\)\n")); <END> }</code><technical_language>I full context here, if fall unsorted array, sorted_checksum here</technical_language>

Target:
public void testArrayOfRow() { Optional<VerifierQueryEvent> event = createVerification("SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]", "SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]").run(); assertTrue(event.isPresent()); assertEvent(event.get(), SUCCEEDED, Optional.empty(), Optional.empty(), Optional.empty()); event = createVerification("SELECT ARRAY[ROW(1, 'a'), ROW(2, 'b')]", "SELECT ARRAY[ROW(1, 'a'), ROW(2, null)]").run(); assertTrue(event.isPresent()); assertEvent( event.get(), FAILED, Optional.of(true), Optional.of("COLUMN_MISMATCH"), Optional.of("Test state SUCCEEDED, Control state SUCCEEDED\n" + "COLUMN MISMATCH\n" + "Control 1 rows, Test 1 rows\n" + "Mismatched Columns:\n" + " _col0 \\(array\\(row\\(integer, varchar\\(1\\)\\)\\)\\): control\\(checksum: 71 b5 2f 7f 1e 9b a6 a4\\) test\\(checksum: b4 3c 7d 02 2b 14 77 12\\)\n")); }
Source:
<code>private static JSONObject getCollectionFields(OskariLayer layer) throws ServiceException { <START> final String url = layer.getUrl() + "collections/" + layer.getName() + "/queryables"; <END> try { final String rawResponse = IOHelper.getURL(url, layer.getUsername(), layer.getPassword()); final JSONObject response = new JSONObject(rawResponse); final JSONArray attributes = response.getJSONArray("queryables"); for (int i = 0; i < attributes.length(); i++) { JSONObject attribute = attributes.getJSONObject(i); String attributeName = attribute.getString("id"); attribute.put("name", attributeName); attribute.remove("id"); } final JSONObject result = new JSONObject(); result.put("attributes", attributes); result.put("geometryField", "geometry"); return result; } catch (IOException ex) { throw new ServiceException("Couldn't reach url: " + url); } catch (JSONException ex) { throw new ServiceException("Response is not a valid JSON string: " + url); } }</code><technical_language>queryables endpoint is for describing for example attributes search items. a comprehensive list of attributes items in collection have. do instead is querying /items endpoint for 10 features gather set of attribute names detected features. accurate</technical_language>

Target:
private static JSONObject getCollectionFields(OskariLayer layer) throws ServiceException { try { final JSONArray features = getCollectionItems(layer); final JSONObject attributes = getFeatureAttributes(features); final JSONObject result = new JSONObject(); result.put(ATTRIBUTES_KEY, attributes); result.put(GEOMETRY_FIELD_KEY, "geometry"); return result; } catch (JSONException ex) { throw new ServiceException("Couldn't parse collection items response", ex); } }
Source:
<code>public String valueForInsert(Object value) { if (value == null) { return null; } <START> var string = convert(value); <END> if (unbound() || string.length() <= lengthLimit) { return string; } else { if (string.substring(lengthLimit).isBlank()) { return string.substring(0, lengthLimit); } else { throw new IllegalArgumentException( "The value is too long for text type of the length: " + lengthLimit); } } }</code><technical_language>I able assert is a String. change signature (valueForInsert(T value)) run implicit cast logic. If match target type, added implicit cast, this point match type</technical_language>

Target:
public String valueForInsert(Object value) { if (value == null) { return null; } assert value instanceof String : "valueForInsert must be called only on objects of String type"; var string = (String) value; if (unbound() || string.length() <= lengthLimit) { return string; } else { if (isBlank(string, lengthLimit, string.length())) { return string.substring(0, lengthLimit); } else { if (string.length() > 20) { string = string.substring(0, 20) + "..."; } throw new IllegalArgumentException( "'" + string + "' is too long for the text type of length: " + lengthLimit); } } }
Source:
<code>public TimerJobInstance getTimerByName(String jobName) { if (localCache.containsKey(jobName)) { logger.debug("Found job in cache returning", jobName); return localCache.get(jobName); } TimerJobInstance found = null; for (Timer timer : timerService.getTimers()) { try { Serializable info = timer.getInfo(); if (info instanceof EjbTimerJob) { EjbTimerJob job = (EjbTimerJob) info; EjbGlobalJobHandle handle = (EjbGlobalJobHandle) job.getTimerJobInstance().getJobHandle(); if (handle.getUuid().equals(jobName)) { found = handle.getTimerJobInstance(); localCache.putIfAbsent(jobName, found); <START> logger.debug("Job does match timer and is going to be returned {}", jobName, found); <END> } } } catch (NoSuchObjectLocalException e) { logger.debug("Timer info for was not found ", timer); } } return found; }</code><technical_language>put in cache, return avoid iterating other timers, we</technical_language>

Target:
public TimerJobInstance getTimerByName(String jobName) { if (localCache.containsKey(jobName)) { logger.debug("Found job in cache returning", jobName); return localCache.get(jobName); } TimerJobInstance found = null; for (Timer timer : timerService.getTimers()) { try { Serializable info = timer.getInfo(); if (info instanceof EjbTimerJob) { EjbTimerJob job = (EjbTimerJob) info; EjbGlobalJobHandle handle = (EjbGlobalJobHandle) job.getTimerJobInstance().getJobHandle(); if (handle.getUuid().equals(jobName)) { found = handle.getTimerJobInstance(); localCache.putIfAbsent(jobName, found); logger.debug("Job does match timer and is going to be returned {}", jobName, found); break; } } } catch (NoSuchObjectLocalException e) { logger.debug("Timer info for was not found ", timer); } } return found; }
Source:
<code>public boolean equals(Object o) { <START> Section other = (Section) o; <END> return getId() == other.getId() && getLevel() == other.getLevel() && Utils.compareStrings(getHeading(), other.getHeading()) && Utils.compareStrings(getAnchor(), other.getAnchor()) && Utils.compareStrings(getContent(), other.getContent()) && getSubSections().equals(other.getSubSections()); }</code><technical_language>this throw a runtime exception if other object a Section</technical_language>

Target:
public boolean equals(Object o) { if (!(o instanceof Section)) { return false; } Section other = (Section) o; return getId() == other.getId() && getLevel() == other.getLevel() && Utils.compareStrings(getHeading(), other.getHeading()) && Utils.compareStrings(getAnchor(), other.getAnchor()) && Utils.compareStrings(getContent(), other.getContent()) && getSubSections().equals(other.getSubSections()); }
Source:
<code>public void testSpatialJoinContains() { assertPlan("SELECT b.name, a.name " + "FROM " + POINTS_SQL + ", " + POLYGONS_SQL + " " + "WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(lng, lat))", anyTree( spatialJoin("st_contains(st_geometryfromtext, st_point)", project(ImmutableMap.of("st_point", expression("ST_Point(lng, lat)")), anyTree(values(ImmutableMap.of("lng", 0, "lat", 1)))), anyTree(project(ImmutableMap.of("st_geometryfromtext", expression("ST_GeometryFromText(cast(wkt as varchar))")), anyTree(values(ImmutableMap.of("wkt", 0))))))), getQueryRunner().getPlanOptimizers(false)); assertPlan("SELECT * " + "FROM (SELECT length(name), * FROM " + POINTS_SQL + "), (SELECT length(name), * FROM " + POLYGONS_SQL + ") " + "WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(lng, lat))", anyTree( spatialJoin("st_contains(st_geometryfromtext, st_point)", project(ImmutableMap.of("st_point", expression("ST_Point(lng, lat)"), "length", expression("length(name)")), anyTree(values(ImmutableMap.of("lng", 0, "lat", 1, "name", 2)))), anyTree(project(ImmutableMap.of("st_geometryfromtext", expression("ST_GeometryFromText(cast(wkt as varchar))"), "length_2", expression("length(name_2)")), anyTree(values(ImmutableMap.of("wkt", 0, "name_2", 1))))))), <START> getQueryRunner().getPlanOptimizers(false)); <END> }</code><technical_language>do need this line</technical_language>

Target:
public void testSpatialJoinContains() { assertPlan("SELECT b.name, a.name " + "FROM " + POINTS_SQL + ", " + POLYGONS_SQL + " " + "WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(lng, lat))", anyTree( spatialJoin("st_contains(st_geometryfromtext, st_point)", project(ImmutableMap.of("st_point", expression("ST_Point(lng, lat)")), anyTree(values(ImmutableMap.of("lng", 0, "lat", 1)))), anyTree(project(ImmutableMap.of("st_geometryfromtext", expression("ST_GeometryFromText(cast(wkt as varchar))")), anyTree(values(ImmutableMap.of("wkt", 0)))))))); assertPlan("SELECT * " + "FROM (SELECT length(name), * FROM " + POINTS_SQL + "), (SELECT length(name), * FROM " + POLYGONS_SQL + ") " + "WHERE ST_Contains(ST_GeometryFromText(wkt), ST_Point(lng, lat))", anyTree( spatialJoin("st_contains(st_geometryfromtext, st_point)", project(ImmutableMap.of("st_point", expression("ST_Point(lng, lat)"), "length", expression("length(name)")), anyTree(values(ImmutableMap.of("lng", 0, "lat", 1, "name", 2)))), anyTree(project(ImmutableMap.of("st_geometryfromtext", expression("ST_GeometryFromText(cast(wkt as varchar))"), "length_2", expression("length(name_2)")), anyTree(values(ImmutableMap.of("wkt", 0, "name_2", 1)))))))); }
Source:
<code>public static void threadDumpMC () { boolean ret = true; if (LaunchFrame.MCRunning) { YNDialog yn = new YNDialog("TD_MC_MESSAGE", "TD_MC_CONFIRM", "TD_MC_TITLE"); yn.setVisible(true); yn.toFront(); if (yn.ready && yn.ret && LaunchFrame.MCRunning && LaunchFrame.getProcMonitor() != null) { Logger.logWarn("Getting thread dump from MC"); ret = OSUtils.genThreadDump(LaunchFrame.getProcMonitor().getPid()); } yn.setVisible(false); <START> if (ret) { <END> ErrorUtils.showClickableMessage(I18N.getLocaleString("TD_MC_FAIL_MESSAGE"), JOptionPane.ERROR_MESSAGE); } } else { Logger.logInfo("No Minecraft Process currently running to thread dump"); } }</code><technical_language>this !ret</technical_language>

Target:
public static void threadDumpMC () { boolean ret = true; if (LaunchFrame.MCRunning) { YNDialog yn = new YNDialog("TD_MC_MESSAGE", "TD_MC_CONFIRM", "TD_MC_TITLE"); yn.setVisible(true); yn.toFront(); if (yn.ready && yn.ret && LaunchFrame.MCRunning && LaunchFrame.getProcMonitor() != null) { Logger.logWarn("Getting thread dump from MC"); ret = OSUtils.genThreadDump(LaunchFrame.getProcMonitor().getPid()); } yn.setVisible(false); if (!ret) { ErrorUtils.showClickableMessage(I18N.getLocaleString("TD_MC_FAIL_MESSAGE"), JOptionPane.ERROR_MESSAGE); } } else { Logger.logInfo("No Minecraft Process currently running to thread dump"); } }
Source:
<code>public static void deleteTenantDir(int tenantId) { if (log.isDebugEnabled()) { log.debug("Deleting tenant directory of tenant: " + tenantId); } String tenantDirPath = CarbonUtils.getCarbonTenantsDirPath() + File.separator + tenantId; File tenantDir = new File(tenantDirPath); try { FileUtils.deleteDirectory(tenantDir); } catch (IOException e) { <START> log.error("Error in deleting tenant directory: " + tenantDirPath); <END> } }</code><technical_language>add e log</technical_language>

Target:
public static void deleteTenantDir(int tenantId) { if (log.isDebugEnabled()) { log.debug("Deleting tenant directory of tenant: " + tenantId); } String tenantDirPath = CarbonUtils.getCarbonTenantsDirPath() + File.separator + tenantId; File tenantDir = new File(tenantDirPath); try { FileUtils.deleteDirectory(tenantDir); } catch (IOException e) { log.error("Error in deleting tenant directory: " + tenantDirPath, e); } }
Source:
<code>public void handlePut(ActionParameters params) throws ActionException { params.requireAdminUser(); try { Announcement announcement = AnnouncementsParser.parseAnnouncementParams(params); final JSONObject result = new JSONObject(); int updateId = service.updateAnnouncement(announcement); JSONHelper.putValue(result, "id", updateId); AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", announcement.getId()) .withParam("title", announcement.getTitle()) .withParam("content", announcement.getContent()) .withParam("beginDate", announcement.getBeginDate()) .withParam("endDate", announcement.getEndDate()) .withParam("active", announcement.getActive()); ResponseHelper.writeResponse(params, result); } catch (JSONException e) { <START> LOG.error("Error updating announcement", e); <END> throw new ActionException("Cannot update announcement"); } }</code><technical_language>need LOG.error() here. throwing ActionException logged controller. Logging adds spam log files</technical_language>

Target:
public void handlePut(ActionParameters params) throws ActionException { params.requireAdminUser(); try { Announcement announcement = AnnouncementsParser.parseAnnouncementParams(params); final JSONObject result = new JSONObject(); int updateId = service.updateAnnouncement(announcement); JSONHelper.putValue(result, "id", updateId); AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", announcement.getId()) .withParam("title", announcement.getTitle()) .withParam("content", announcement.getContent()) .withParam("beginDate", announcement.getBeginDate()) .withParam("endDate", announcement.getEndDate()) .withParam("active", announcement.getActive()); ResponseHelper.writeResponse(params, result); } catch (JSONException e) { throw new ActionException("Cannot update announcement", e); } }
Source:
<code><START> public Matrix mul(final Matrix matrix) { <END> if (matrix.isDense()) { throw new UnsupportedOperationException(); } else { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$colon$times(((CSCMatrix) matrix).breezeMatrix, MatrixOps.EMUL_SS)); } }</code><technical_language>UnsupportedOperationException thrown this method</technical_language>

Target:
public Matrix mul(final Matrix matrix) { if (matrix.isDense()) { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$colon$times(((DenseMatrix) matrix).getBreezeMatrix(), MatrixOps.EMUL_MM)); } else { return new CSCMatrix((breeze.linalg.CSCMatrix<Double>) breezeMatrix.$colon$times(((CSCMatrix) matrix).breezeMatrix, MatrixOps.EMUL_SS)); } }
Source:
<code>private void initPreApplicationState() { logger.info(Utility.version(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)); UI.events = this; Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> logger.error(throwable.getMessage(), throwable)); TestController.setUI(this, getParameters()); prefs = TestController.loadApplicationPreferences(); KeyboardShortcuts.loadKeyboardShortcuts(prefs); eventBus = new EventBus(); if (TestController.isTestMode()) { registerTestEvents(); } registerEvent((UnusedStoredReposChangedEventHandler) e -> onRepoOpened()); registerEvent((UsedReposChangedEventHandler) e -> removeUnusedModelsAndUpdate()); uiManager = new UIManager(this); status = new HTStatusBar(this); updateProgressWindow = new UpdateProgressWindow(); if (!TestController.isTestMode()) { updateManager = new UpdateManager(updateProgressWindow); } else { <START> updateManager = new UpdateManagerStub(); <END> } updateManager.run(); }</code><technical_language>TestController. a methods conditionally create similar in there. able mockito stub it, need a new class</technical_language>

Target:
private void initPreApplicationState() { logger.info(Utility.version(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)); UI.events = this; Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> logger.error(throwable.getMessage(), throwable)); TestController.setUI(this, getParameters()); prefs = TestController.loadApplicationPreferences(); KeyboardShortcuts.loadKeyboardShortcuts(prefs); eventBus = new EventBus(); if (TestController.isTestMode()) { registerTestEvents(); } registerEvent((UnusedStoredReposChangedEventHandler) e -> onRepoOpened()); registerEvent((UsedReposChangedEventHandler) e -> removeUnusedModelsAndUpdate()); uiManager = new UIManager(this); status = new HTStatusBar(this); updateManager = TestController.createUpdateManager(); updateManager.run(); }
Source:
<code>public void throwIfNullProvider() throws Exception { Transaction transaction = newTransaction( AnonymousContext.writeToken() ); transaction.tokenWrite().labelGetOrCreateForName( "Person" ); createProperties( transaction, "name" ); commit(); newTransaction( AnonymousContext.full() ); String pattern = indexPattern( "Person", "name" ); <START> try <END> { callIndexProcedure( pattern, null ); fail( "Expected to fail" ); } catch ( ProcedureException e ) { assertThat( e.getMessage(), containsString( "Could not create index with specified index provider being null" ) ); } commit(); }</code><technical_language>a do this: E e = Assertions.assertThrows(E.class, () -> {...})</technical_language>

Target:
public void throwIfNullProvider() throws Exception { Transaction transaction = newTransaction( AnonymousContext.writeToken() ); transaction.tokenWrite().labelGetOrCreateForName( "Person" ); createProperties( transaction, "name" ); commit(); newTransaction( AnonymousContext.full() ); String pattern = indexPattern( "Person", "name" ); ProcedureException e = assertThrows( ProcedureException.class, () -> callIndexProcedure( pattern, null ) ); assertThat( e.getMessage(), containsString( "Could not create index with specified index provider being null" ) ); commit(); }
Source:
<code>private void checkRequiresCapability(Command cmd) throws UnloggedFailure { String pluginName = null; if (cmd instanceof BaseCommand) { pluginName = ((BaseCommand) cmd).getPluginName(); } try { CapabilityUtils.checkRequiresCapability(currentUser, pluginName, cmd.getClass()); } catch (AuthException e) { throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, <START> "fatal: cannot check capability"); <END> } }</code><technical_language>e.getMessage()</technical_language>

Target:
private void checkRequiresCapability(Command cmd) throws UnloggedFailure { String pluginName = null; if (cmd instanceof BaseCommand) { pluginName = ((BaseCommand) cmd).getPluginName(); } try { CapabilityUtils.checkRequiresCapability(currentUser, pluginName, cmd.getClass()); } catch (AuthException e) { throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, e.getMessage()); } }
Source:
<code>protected ValidationResult macAvailable() { Boolean allowDupMacs = Config.<Boolean> GetValue(ConfigValues.AllowDuplicateMacAddresses); if (allowDupMacs || !existsPluggedInterfaceWithSameMac(vmNetworkInterface)) { return ValidationResult.VALID; } else { <START> return new ValidationResult(VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE); <END> } }</code><technical_language>beneficial add mac address a replacement in this message (in a separate patch)</technical_language>

Target:
protected ValidationResult macAvailable() { Boolean allowDupMacs = Config.<Boolean> GetValue(ConfigValues.AllowDuplicateMacAddresses); VmInterfaceManager vmInterfaceManager = new VmInterfaceManager(); if (allowDupMacs || !vmInterfaceManager.existsPluggedInterfaceWithSameMac(vmNetworkInterface)) { return ValidationResult.VALID; } else { return new ValidationResult(VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE); } }
Source:
<code>private void writeMetrics() throws IOException { if (!isConnected()) { connect(); } if (metrics.size() > 0) { try { byte[] payload = GraphitePickler.pickleMetrics(metrics,charset); ByteBuffer byteBuffer = ByteBuffer.allocate(4 + payload.length).putInt(payload.length).put(payload); datagramChannel.send(byteBuffer, address); <START> this.failures = 0; <END> if (LOGGER.isDebugEnabled()) { LOGGER.debug("Wrote metrics", metrics.size()); } } catch (IOException e) { failures++; throw e; } finally { metrics.clear(); } } }</code><technical_language>please elaborate need reset counter? In PickledGraphite do that</technical_language>

Target:
private void writeMetrics() throws IOException { if (!isConnected()) { connect(); } if (metrics.size() > 0) { try { byte[] payload = GraphitePickler.pickleMetrics(metrics,charset); ByteBuffer byteBuffer = ByteBuffer.allocate(4 + payload.length).putInt(payload.length).put(payload); datagramChannel.send(byteBuffer, address); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Wrote metrics", metrics.size()); } } catch (IOException e) { failures++; throw e; } finally { metrics.clear(); } } }
Source:
<code><START> public static String getMessage(final String key) { <END> return getMessage(key, LocaleFilter.DEFAULT_LOCALE); }</code><technical_language>is this method static? singleton access methods getInstance() static</technical_language>

Target:
public String getMessage(final String key) { return getMessage(key, LocaleFilter.DEFAULT_LOCALE); }
Source:
<code>public void shibboleth(HttpServletResponse response, @RequestParam(name = "redirectUrl", required = false) String redirectUrl) throws IOException { if (redirectUrl == null) { <START> redirectUrl = ConfigurationManager.getProperty("dspace.url"); <END> } log.info("Redirecting to " + redirectUrl); response.sendRedirect(redirectUrl); }</code><technical_language>This configuration needs updating dspace.ui.url. Also, ConfigurationService (which @Autowired other services)</technical_language>

Target:
public void shibboleth(HttpServletResponse response, @RequestParam(name = "redirectUrl", required = false) String redirectUrl) throws IOException { if (redirectUrl == null) { redirectUrl = configurationService.getProperty("dspace.ui.url"); } log.info("Redirecting to " + redirectUrl); response.sendRedirect(redirectUrl); }
Source:
<code>public boolean isValid(String value, ConstraintValidatorContext context) { <START> return isNotBlank(value) && value.matches(TWENTY_FOUR_LOWER_CASE_HEXADECIMAL_CHARACTERS.pattern()); <END> }</code><technical_language>No, turning a string recompiling again! return isNotBlank(value) && TWENTY_FOUR_LOWER_CASE_HEXADECIMAL_CHARACTERS.matcher(value).matches();</technical_language>

Target:
public boolean isValid(String value, ConstraintValidatorContext context) { return isNotBlank(value) && TWENTY_FOUR_LOWER_CASE_HEXADECIMAL_CHARACTERS.matcher(value).matches(); }
Source:
<code>public Boolean isAjaxRequest() { <START> return HttpHeaderConstants.XML_HTTP_REQUEST.equals(headers.get(HttpHeaderConstants.X_REQUESTED_WITH)); <END> }</code><technical_language>this match case-sensitive, case-insensitive</technical_language>

Target:
public boolean isAjaxRequest() { return HttpHeaderConstants.XML_HTTP_REQUEST.equalsIgnoreCase(headers.get(HttpHeaderConstants.X_REQUESTED_WITH)); }
Source:
<code>private String getHashKey(HashingAlgorithm hashingAlgorithm, Boolean shouldEncodeHashKey, Integer maxDigestBytes, Integer maxHashLength, String encoder) { if (null == hashingAlgorithm) { return null; } final String key = hashingAlgorithm.toString()+ maxDigestBytes != null ? maxDigestBytes.toString() : "-" + maxHashLength != null ? maxHashLength.toString() : "-" + encoder != null ? encoder : "-"; String val = hashedKeysByAlgorithm.get(key); if(val == null) { <START> val = KeyHasher.getHashedKeyEncoded(canonicalKey, hashingAlgorithm, maxDigestBytes, maxHashLength, encoder); <END> hashedKeysByAlgorithm.put(key , val); } if (log.isDebugEnabled()) log.debug("getHashKey : " + val); return val; }</code><technical_language>good accessor getCanonicalKey()</technical_language>

Target:
private String getHashKey(HashingAlgorithm hashingAlgorithm, Boolean shouldEncodeHashKey, Integer maxDigestBytes, Integer maxHashLength, String encoder) { if (null == hashingAlgorithm) { return null; } final String key = hashingAlgorithm.toString()+ maxDigestBytes != null ? maxDigestBytes.toString() : "-" + maxHashLength != null ? maxHashLength.toString() : "-" + encoder != null ? encoder : "-"; String val = hashedKeysByAlgorithm.get(key); if(val == null) { val = KeyHasher.getHashedKeyEncoded(getCanonicalKey(false), hashingAlgorithm, maxDigestBytes, maxHashLength, encoder); hashedKeysByAlgorithm.put(key , val); } if (log.isDebugEnabled()) log.debug("getHashKey : " + val); return val; }
Source:
<code>public void changeCustomAuthorizationHeaderInAPI(String customAuth) throws Exception { HttpResponse getSwaggerResponse = apiPublisher.getSwagger("PhoneVerifyAPI-1", "1.0.0", API_DEVELOPER_USERNAME); APIManageBean apiManageBean = new APIManageBean("PhoneVerifyAPI-1", "1.0.0", API_DEVELOPER_USERNAME, "https", "disabled", "resource_level", "Production and Sandbox", getSwaggerResponse.getData(), "Unlimited,Gold,Bronze"); apiManageBean.setAuthorizationHeader(customAuth); HttpResponse apiManageResponse = apiPublisher.manageAPI(apiManageBean); verifyResponse(apiManageResponse); <START> org.wso2.am.integration.test.utils.bean.APILifeCycleStateRequest updateLifeCycle = <END> new org.wso2.am.integration.test.utils.bean.APILifeCycleStateRequest("PhoneVerifyAPI-1", API_DEVELOPER_USERNAME, APILifeCycleState.PUBLISHED); HttpResponse apiPublishResponse = apiPublisher.changeAPILifeCycleStatus(updateLifeCycle); verifyResponse(apiPublishResponse); }</code><technical_language>reason class name package name importing top of class</technical_language>

Target:
public void changeCustomAuthorizationHeaderInAPI(String customAuth) throws Exception { HttpResponse getSwaggerResponse = apiPublisher.getSwagger("PhoneVerifyAPI-1", "1.0.0", API_DEVELOPER_USERNAME); APIManageBean apiManageBean = new APIManageBean("PhoneVerifyAPI-1", "1.0.0", API_DEVELOPER_USERNAME, "https", "disabled", "resource_level", "Production and Sandbox", getSwaggerResponse.getData(), "Unlimited,Gold,Bronze"); apiManageBean.setAuthorizationHeader(customAuth); HttpResponse apiManageResponse = apiPublisher.manageAPI(apiManageBean); verifyResponse(apiManageResponse); APILifeCycleStateRequest updateLifeCycle = new APILifeCycleStateRequest("PhoneVerifyAPI-1", API_DEVELOPER_USERNAME, APILifeCycleState.PUBLISHED); HttpResponse apiPublishResponse = apiPublisher.changeAPILifeCycleStatus(updateLifeCycle); verifyResponse(apiPublishResponse); }
Source:
<code><START> public ResponseEntity<VocabularyVersionDTO> releaseVersion() { <END> String vocabularyVersion = vocabularyService.getVocabularyReleaseVersion(); return ResponseEntity.ok(new VocabularyVersionDTO(vocabularyVersion)); }</code><technical_language>entity</technical_language>

Target:
public VocabularyVersionDTO releaseVersion() { String vocabularyVersion = vocabularyService.getOMOPVocabularyVersion(); return converterUtils.convert(vocabularyVersion, VocabularyVersionDTO.class); }