auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void applyBinaryPatch(File f, FileHeader fh) throws PatchApplyException { if (fh.getChangeType() != ChangeType.ADD) { throw new PatchApplyException( <START> "Only addition of new binary files is implemented"); <END> } BinaryHunk forwardBinaryHunk = fh.getForwardBinaryHunk(); byte[] buf = forwardBinaryHunk.getBuffer(); int bufPos = forwardBinaryHunk.getStartOffset(); int totalDecodedSize = calcTotalBinaryDecodedLength(buf, bufPos); byte[] allDecodedBytes = new byte[totalDecodedSize]; int decPos = 0; bufPos = nextLF(buf, bufPos); while (buf[bufPos] != '\n') { int decodedLineLength = resolveDecodedLength(buf[bufPos++]); int nextLF = nextLF(buf, bufPos); byte[] decodedLine = decode85(buf, bufPos, nextLF - bufPos - 1, decodedLineLength); System.arraycopy(decodedLine, 0, allDecodedBytes, decPos, decodedLineLength); decPos += decodedLineLength; bufPos = nextLF; } byte[] inflated = new byte[0]; try { inflated = inflate(allDecodedBytes, forwardBinaryHunk.getSize()); } catch (DataFormatException dfe) { throw new PatchApplyException("Unable to inflate compressed data", dfe); } try (FileOutputStream fos = new FileOutputStream(f)) { fos.write(inflated); } catch (IOException ioe) { throw new PatchApplyException("Unable to write data to file", ioe); } }</code><technical_language>in JGitText. In general messages in exceptions a constants JGitText</technical_language>

Target:
private void applyBinaryPatch(File f, FileHeader fh) throws PatchApplyException { if (fh.getChangeType() != ChangeType.ADD) { throw new PatchApplyException( JGitText.get().onlyBinaryAddSupported); } BinaryHunk forwardBinaryHunk = fh.getForwardBinaryHunk(); byte[] buf = forwardBinaryHunk.getBuffer(); int bufPos = forwardBinaryHunk.getStartOffset(); int totalDecodedSize = calcTotalBinaryDecodedLength(buf, bufPos); byte[] allDecodedBytes = new byte[totalDecodedSize]; int decPos = 0; bufPos = nextLF(buf, bufPos); while (buf[bufPos] != '\n') { int decodedLineLength = resolveDecodedLength(buf[bufPos++]); int nextLF = nextLF(buf, bufPos); byte[] decodedLine = decode85(buf, bufPos, nextLF - bufPos - 1, decodedLineLength); System.arraycopy(decodedLine, 0, allDecodedBytes, decPos, decodedLineLength); decPos += decodedLineLength; bufPos = nextLF; } byte[] inflated; try { inflated = inflate(allDecodedBytes, forwardBinaryHunk.getSize()); } catch (DataFormatException dfe) { throw new PatchApplyException( JGitText.get().unableToInflateCompressedData, dfe); } try (FileOutputStream fos = new FileOutputStream(f)) { fos.write(inflated); } catch (IOException ioe) { throw new PatchApplyException( String.format(JGitText.get().unableToWrite, f.getName()), ioe); } }
Source:
<code>public ASTNode transform(InnerRHSRewrite innerRHSRewrite) { <START> Term[] theNewRHS = new Term[innerRHSRewrite.theRHS.length]; <END> for (int i = 0; i < theNewRHS.length; i++) { if (innerRHSRewrite.theRHS[i] != null) theNewRHS[i] = (Term) innerRHSRewrite.theRHS[i].accept(this); } return new InnerRHSRewrite(theNewRHS); }</code><technical_language>poor encapsulation</technical_language>

Target:
public ASTNode transform(InnerRHSRewrite innerRHSRewrite) { Term[] theNewRHS = new Term[innerRHSRewrite.theRHS.length]; for (int i = 0; i < theNewRHS.length; i++) { if (innerRHSRewrite.theRHS[i] != null) theNewRHS[i] = (Term) innerRHSRewrite.theRHS[i].accept(this); } if(Arrays.equals(theNewRHS, innerRHSRewrite.theRHS)) { return innerRHSRewrite; } else { return new InnerRHSRewrite(theNewRHS); } }
Source:
<code>private void addUserToCache(User user){ <START> cache.put(StringUtils.lowerCase(user.getUserId()), <END> user); if (this.eventService != null) { this.eventService.fireEvent(new EventUserUpdate(user)); } }</code><technical_language>StringUtils.lowerCase() default locale, while other toLowerCase() conversions in this class Locale.ENGLISH explicitly. In general result different. user.getUserId().toLowerCase(Locale.ENGLISH) here, too</technical_language>

Target:
private void addUserToCache(User user){ cache.put(user.getUserId().toLowerCase(Locale.ENGLISH), user); if (this.eventService != null) { this.eventService.fireEvent(new EventUserUpdate(user)); } }
Source:
<code>private static double getVersionValue(String version) { if(version.contains("-")) { version = version.substring(0, version.indexOf('-')); } version = version.replace('_', '.'); String[] versionParts = version.split("\\."); double versionValue = 0; for(int i = 0; i < versionParts.length; i++) { <START> int part = Integer.valueOf(versionParts[i]); <END> versionValue += part * Math.pow(10, versionParts.length - (i - 1) * 3); } return versionValue; }</code><technical_language>do some more strict checking here, throw exception if null a number. a good idea crash a bad java.version</technical_language>

Target:
private static double getVersionValue(String version) { if(version.contains("-")) { version = version.substring(0, version.indexOf('-')); } version = version.replace('_', '.'); String[] versionParts = version.split("\\."); double versionValue = 0; for(int i = 0; i < versionParts.length; i++) { try { int part = Integer.valueOf(versionParts[i]); versionValue += part * Math.pow(10, versionParts.length - (i - 1) * 3); } catch(NumberFormatException e) { continue; } } return versionValue; }
Source:
<code>public Storable fromMap (Map<String, Object> map) { id = (Long) map.get(ID); name = (String) map.get(NAME); timestamp = (Long) map.get(TIMESTAMP); <START> ObjectMapper mapper = new ObjectMapper(); <END> try { serviceUISpecification = mapper.readValue((String) map.get(UI_SPECIFICATION), TopologyComponentUISpecification.class); } catch (IOException e) { throw new RuntimeException(e); } registerClass = (String) map.get(REGISTER_CLASS); return this; }</code><technical_language>this able reused. a static field</technical_language>

Target:
public Storable fromMap (Map<String, Object> map) { id = (Long) map.get(ID); name = (String) map.get(NAME); timestamp = (Long) map.get(TIMESTAMP); try { serviceUISpecification = mapper.readValue((String) map.get(UI_SPECIFICATION), TopologyComponentUISpecification.class); } catch (IOException e) { throw new RuntimeException(e); } registerClass = (String) map.get(REGISTER_CLASS); return this; }
Source:
<code>public void createEcKey(HttpClient httpClient, KeyServiceVersion keyServiceVersion) { createKeyAsyncClient(httpClient, keyServiceVersion); <START> createEcKeyRunner((expected) -> client.createEcKey(expected)); <END> }</code><technical_language>is important assert result of operation is correct, I add assertion method (createRsaKey)</technical_language>

Target:
public void createEcKey(HttpClient httpClient, KeyServiceVersion keyServiceVersion) { createKeyAsyncClient(httpClient, keyServiceVersion); createEcKeyRunner((expected) -> StepVerifier.create(client.createEcKey(expected)) .assertNext(response -> assertKeyEquals(expected, response)) .verifyComplete()); }
Source:
<code>public void perform(Run<?,?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) throws InterruptedException { try { listener.getLogger().println(Messages.Fingerprinter_Recording()); Map<String,String> record = new HashMap<>(); if(targets.length()!=0) { String expandedTargets = targets; <START> if (build instanceof AbstractBuild) expandedTargets = environment.expand(expandedTargets); <END> record(build, workspace, listener, record, expandedTargets); } FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class); if (fingerprintAction != null) { fingerprintAction.add(record); } else { build.addAction(new FingerprintAction(build,record)); } if (enableFingerprintsInDependencyGraph) { Jenkins.get().rebuildDependencyGraphAsync(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed())); build.setResult(Result.FAILURE); } }</code><technical_language>suggestion if (build instanceof AbstractBuild) { // expansion for pipelines expandedTargets = environment.expand(expandedTargets); }</technical_language>

Target:
public void perform(Run<?,?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) throws InterruptedException { try { listener.getLogger().println(Messages.Fingerprinter_Recording()); Map<String,String> record = new HashMap<>(); if(targets.length()!=0) { String expandedTargets = targets; if (build instanceof AbstractBuild) { expandedTargets = environment.expand(expandedTargets); } record(build, workspace, listener, record, expandedTargets); } FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class); if (fingerprintAction != null) { fingerprintAction.add(record); } else { build.addAction(new FingerprintAction(build,record)); } if (enableFingerprintsInDependencyGraph) { Jenkins.get().rebuildDependencyGraphAsync(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed())); build.setResult(Result.FAILURE); } }
Source:
<code>public GHPermissionType fetch(String username) throws IOException, InterruptedException { if (repo == null) { listener.getLogger().format("Connecting to %s to check permissions of obtain list of %s for %s/%s%n", apiUri, username, repoOwner, repository); StandardCredentials credentials = Connector.lookupScanCredentials( (Item) getOwner(), apiUri, credentialsId ); github = Connector.connect(apiUri, credentials); <START> String fullName = repoOwner + "/" + removeEnd(repository, ".git"); <END> repo = github.getRepository(fullName); } return repo.getPermission(username); }</code><technical_language>Ditto, I this issues in other places well, this is of places tests catch it. I done in GitHubRepositoryInfo</technical_language>

Target:
public GHPermissionType fetch(String username) throws IOException, InterruptedException { if (repo == null) { listener.getLogger().format("Connecting to %s to check permissions of obtain list of %s for %s/%s%n", apiUri, username, repoOwner, repository); StandardCredentials credentials = Connector.lookupScanCredentials( (Item) getOwner(), apiUri, credentialsId ); github = Connector.connect(apiUri, credentials); String fullName = repoOwner + "/" + repository; repo = github.getRepository(fullName); } return repo.getPermission(username); }
Source:
<code>public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { for (String key : BotaniaAPI.brewMap.keySet()) { CraftTweakerAPI.logCommand(key); } if (sender != null) { <START> sender.sendMessage(new TextComponentString("List generated; see crafttweaker.log in your minecraft dir")); <END> } }</code><technical_language>recommend sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); get a clickable directlink crafttweaker.log</technical_language>

Target:
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { for (String key : BotaniaAPI.brewMap.keySet()) { CraftTweakerAPI.logCommand(key); } if (sender != null) { sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); } }
Source:
<code>public void testSyncCommandFailure() throws Exception { final ZooKeeper zk = createClient(); <START> SyncCommand cmd = new SyncCommand(); <END> cmd.setZk(zk); cmd.parse("sync /dddd".split(" ")); try { runCommandExpect(cmd, new ArrayList<String>()); fail("Path doesn't exist so, command should fail."); } catch (CliWrapperException e) { assertEquals(KeeperException.Code.NONODE, ((KeeperException) e.getCause()).code()); assertEquals("Node does not exist: /dddd", e.getMessage()); } }</code><technical_language>This final</technical_language>

Target:
public void testSyncCommandFailure() throws Exception { final ZooKeeper zk = createClient(); final SyncCommand cmd = new SyncCommand(); cmd.setZk(zk); cmd.parse("sync /dddd".split(" ")); try { runCommandExpect(cmd, new ArrayList<String>()); fail("Command did not fail, even the path does not exist."); } catch (CliWrapperException e) { assertEquals(KeeperException.Code.NONODE, ((KeeperException) e.getCause()).code()); assertEquals("Node does not exist: /dddd", e.getMessage()); } }
Source:
<code>private void handleFailure(Throwable t) { if (message.doCallbackOnFailure()) { MessageOut response = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE) .withParameter(ParameterType.FAILURE_RESPONSE, MessagingService.ONE_BYTE); if (t instanceof TombstoneOverwhelmingException) { <START> response = response.withParameter(ParameterType.FAILURE_REASON.FAILURE_REASON, Shorts.checkedCast(RequestFailureReason.READ_TOO_MANY_TOMBSTONES.code)); <END> } MessagingService.instance().sendReply(response, id, message.from); } }</code><technical_language>a bug in code compile work (with a warning). remove extra one</technical_language>

Target:
private void handleFailure(Throwable t) { if (message.doCallbackOnFailure()) { MessageOut response = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE) .withParameter(ParameterType.FAILURE_RESPONSE, MessagingService.ONE_BYTE); if (t instanceof TombstoneOverwhelmingException) { response = response.withParameter(ParameterType.FAILURE_REASON, Shorts.checkedCast(RequestFailureReason.READ_TOO_MANY_TOMBSTONES.code)); } MessagingService.instance().sendReply(response, id, message.from); } }
Source:
<code>public void onBackPressed() { if (mDraftNeedsSaving) { if (mEncryptCheckbox.isChecked()) { showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED); } else if (isDraftsFolderDisabled()) { showDialog(DIALOG_CONFIRM_DISCARD_ON_BACK); } else { showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); } } else { <START> onDiscard(); <END> } }</code><technical_language>this a draft i open do change deleted! previous commit erroneously message_discarded_toast in this case, delete draft. <LINK_0></technical_language>

Target:
public void onBackPressed() { if (mDraftNeedsSaving) { if (mEncryptCheckbox.isChecked()) { showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED); } else if (isDraftsFolderDisabled()) { showDialog(DIALOG_CONFIRM_DISCARD_ON_BACK); } else { showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); } } else { if (mDraftId == INVALID_DRAFT_ID) { onDiscard(); } else { super.onBackPressed(); } } }
Source:
<code>private IASTInitializerClause initClause(boolean allowSkipping) throws EndOfFileException, BacktrackException { if (LT(1) == IToken.tLBRACE) { return bracedInitList(allowSkipping); } TemplateIdStrategy strat= fTemplateParameterListStrategy; final BinaryExprCtx ctx= strat != null ? BinaryExprCtx.eInTemplateID : BinaryExprCtx.eNotInTemplateID; IASTExpression assignmentExpression = expression(ExprKind.eAssignment, ctx, null, strat); <START> if (allowSkipping && skipTrivialExpressionsInAggregateInitializers) { <END> if (!ASTQueries.canContainName(assignmentExpression)) { translationUnit.setSkippedNodes(true); return null; } } return assignmentExpression; }</code><technical_language>nice if skipping of trivial expressions in initializers start reaching a large number of them</technical_language>

Target:
private IASTInitializerClause initClause(boolean allowSkipping) throws EndOfFileException, BacktrackException { if (LT(1) == IToken.tLBRACE) { return bracedInitList(allowSkipping); } TemplateIdStrategy strat= fTemplateParameterListStrategy; final BinaryExprCtx ctx= strat != null ? BinaryExprCtx.eInTemplateID : BinaryExprCtx.eNotInTemplateID; return expression(ExprKind.eAssignment, ctx, null, strat); }
Source:
<code>public void setup(Context.OperatorContext context) { operatorName = Preconditions.checkNotNull(context.getName(), "operator name"); <START> foundOperatorName = true; <END> }</code><technical_language>Assertion is missing for operator name</technical_language>

Target:
public void setup(Context.OperatorContext context) { operatorName = Preconditions.checkNotNull(context.getName(), "operator name"); }
Source:
<code>static ByteBuf encodeFollowsFragment( ByteBufAllocator allocator, int mtu, int streamId, ByteBuf metadata, ByteBuf data) { int remaining = mtu - FrameHeaderFlyweight.size(); ByteBuf metadataFragment = null; if (metadata.isReadable()) { remaining -= 3; int r = Math.min(remaining, metadata.readableBytes()); remaining -= r; metadataFragment = metadata.readRetainedSlice(r); } ByteBuf dataFragment = Unpooled.EMPTY_BUFFER; if (remaining > 0 && data.isReadable()) { int r = Math.min(remaining, data.readableBytes()); dataFragment = data.readRetainedSlice(r); } boolean follows = <START> metadata == Unpooled.EMPTY_BUFFER <END> ? data.isReadable() : data.isReadable() || metadata.isReadable(); return PayloadFrameFlyweight.encode( allocator, streamId, follows, false, true, metadataFragment, dataFragment); }</code><technical_language>check this? metadata.isReadable() do this</technical_language>

Target:
static ByteBuf encodeFollowsFragment( ByteBufAllocator allocator, int mtu, int streamId, ByteBuf metadata, ByteBuf data) { int remaining = mtu - FrameHeaderFlyweight.size(); ByteBuf metadataFragment = null; if (metadata.isReadable()) { remaining -= 3; int r = Math.min(remaining, metadata.readableBytes()); remaining -= r; metadataFragment = metadata.readRetainedSlice(r); } ByteBuf dataFragment = Unpooled.EMPTY_BUFFER; if (remaining > 0 && data.isReadable()) { int r = Math.min(remaining, data.readableBytes()); dataFragment = data.readRetainedSlice(r); } boolean follows = data.isReadable() || metadata.isReadable(); return PayloadFrameFlyweight.encode( allocator, streamId, follows, false, true, metadataFragment, dataFragment); }
Source:
<code>public XMLFileResourceProvider(final String configFileName, final WebApplicationContext appCtx, final String configFileDirectory, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { if(configFileDirectory==null && storageDirFinder==null) { throw new NullPointerException("At least one of configFileDirectory or storageDirFinder must not be null"); } this.context = appCtx; this.configFileName = configFileName; if(configFileDirectory!=null) { <START> if (configFileDirectory.startsWith("/") || configFileDirectory.contains(":\\") <END> || configFileDirectory.startsWith("\\\\")) { log.info("Provided configuration directory as absolute path '" + configFileDirectory + "'"); this.configDirectory = new File(configFileDirectory); } else { String baseDir = context.getServletContext().getRealPath(""); log.info("Provided configuration directory relative to servlet context '" + baseDir + "': " + configFileDirectory); this.configDirectory = new File(baseDir, configFileDirectory); } } else { this.configDirectory = new File(storageDirFinder.getDefaultPath()); } log.info("Will look for " + configFileName + " in '" + configDirectory + "'"); }</code><technical_language>if ((new File(configFileDirectory)).isAbsolute()) { in GeoServer</technical_language>

Target:
public XMLFileResourceProvider(final String configFileName, final WebApplicationContext appCtx, final String configFileDirectory, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { if(configFileDirectory==null && storageDirFinder==null) { throw new NullPointerException("At least one of configFileDirectory or storageDirFinder must not be null"); } this.context = appCtx; this.configFileName = configFileName; if(configFileDirectory!=null) { if (new File(configFileDirectory).isAbsolute()) { log.info("Provided configuration directory as absolute path '" + configFileDirectory + "'"); this.configDirectory = new File(configFileDirectory); } else { String baseDir = context.getServletContext().getRealPath(""); log.info("Provided configuration directory relative to servlet context '" + baseDir + "': " + configFileDirectory); this.configDirectory = new File(baseDir, configFileDirectory); } } else { this.configDirectory = new File(storageDirFinder.getDefaultPath()); } log.info("Will look for " + configFileName + " in '" + configDirectory + "'"); }
Source:
<code>private void updateAllDatabases() { dbOpenHelper.getReadableDatabase().close(); <START> SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); <END> CategoryDao.Table.onDelete(db); appDatabase.getContributionDao().deleteAll(); BookmarkPicturesDao.Table.onDelete(db); BookmarkLocationsDao.Table.onDelete(db); }</code><technical_language>existing users Contributions data - upgrade - remain disk forever</technical_language>

Target:
private void updateAllDatabases() { dbOpenHelper.getReadableDatabase().close(); SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); CategoryDao.Table.onDelete(db); dbOpenHelper.deleteTable(db,CONTRIBUTIONS_TABLE); appDatabase.getContributionDao().deleteAll(); BookmarkPicturesDao.Table.onDelete(db); BookmarkLocationsDao.Table.onDelete(db); }
Source:
<code>void afterPush(@Nullable Repository repo, ReplicaPushRequest req) { Collection<ReceiveCommand> cmds = req.getCommands(); ReceiveCommand acceptCmd = null; ReceiveCommand commitCmd = null; List<ReceiveCommand> stages = null; for (ReceiveCommand c : cmds) { if (getSystem().getTxnAccepted().equals(c.getRefName())) { acceptCmd = c; } else if (getSystem().getTxnCommitted().equals(c.getRefName())) { commitCmd = c; } else if (c.getResult() == OK && c.getType() == CREATE && c.getRefName().startsWith(getSystem().getTxnStage())) { if (stages == null) { stages = new ArrayList<>(); } stages.add(c); } } if (repo != null && acceptCmd != null && acceptCmd.getResult() != OK) { <START> checkLagging(repo, acceptCmd, req); <END> } leader.lock.lock(); try { for (ReceiveCommand c : cmds) { running.remove(c.getRefName()); } Throwable err = req.getException(); if (err != null) { state = OFFLINE; error = err.toString(); retryLater(req); leader.onReplicaUpdate(this); return; } lastRetryMillis = 0; error = null; updateView(req, acceptCmd, commitCmd); if (acceptCmd != null && acceptCmd.getResult() == OK) { state = hasAccepted(leader.getHead()) ? CURRENT : LAGGING; if (stages != null) { staged.put(acceptCmd.getNewId(), stages); } } leader.onReplicaUpdate(this); nextPush(); } finally { leader.lock.unlock(); } }</code><technical_language>a void function invisible side effects? this return new state assign "state" variable. reset state "CURRENT" if other conditions triggered</technical_language>

Target:
void afterPush(@Nullable Repository repo, ReplicaPushRequest req) { Collection<ReceiveCommand> cmds = req.getCommands(); ReceiveCommand acceptCmd = null; ReceiveCommand commitCmd = null; List<ReceiveCommand> stages = null; for (ReceiveCommand c : cmds) { if (getSystem().getTxnAccepted().equals(c.getRefName())) { acceptCmd = c; } else if (getSystem().getTxnCommitted().equals(c.getRefName())) { commitCmd = c; } else if (c.getResult() == OK && c.getType() == CREATE && c.getRefName().startsWith(getSystem().getTxnStage())) { if (stages == null) { stages = new ArrayList<>(); } stages.add(c); } } if (repo != null && acceptCmd != null && acceptCmd.getResult() != OK) { state = checkLagging(repo, acceptCmd, req); } leader.lock.lock(); try { for (ReceiveCommand c : cmds) { running.remove(c.getRefName()); } Throwable err = req.getException(); if (err != null) { state = OFFLINE; error = err.toString(); retryLater(req); leader.onReplicaUpdate(this); return; } lastRetryMillis = 0; error = null; updateView(req, acceptCmd, commitCmd); if (acceptCmd != null && acceptCmd.getResult() == OK) { state = hasAccepted(leader.getHead()) ? CURRENT : LAGGING; if (stages != null) { staged.put(acceptCmd.getNewId(), stages); } } leader.onReplicaUpdate(this); runNextPushRequest(); } finally { leader.lock.unlock(); } }
Source:
<code>public List<T> getAll(Guid userID, boolean isFiltered) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource(); if (userID != null) { parameterSource = parameterSource.addValue("user_id", userID.getUuid()); } if (isFiltered) { switch (getQosType()) { case NETWORK: return getCallsHandler().executeReadList("GetAllNetworkQos", createEntityRowMapper(), parameterSource); case CPU: return getCallsHandler().executeReadList("GetAllCpuQos", createEntityRowMapper(), <START> getCustomMapSqlParameterSource()); <END> case STORAGE: return getCallsHandler().executeReadList("GetAllStorageQos", createEntityRowMapper(), parameterSource); case HOSTNETWORK: return getCallsHandler().executeReadList("GetAllHostNetworkQos", createEntityRowMapper(), parameterSource); } } parameterSource = parameterSource.addValue("qos_type", getQosType()); return getCallsHandler().executeReadList("GetAllQosByQosType", createEntityRowMapper(), parameterSource); }</code><technical_language>patameterSource added user_id relevant stored procedure</technical_language>

Target:
public List<T> getAll(Guid userID, boolean isFiltered) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource(); if (userID != null) { parameterSource = parameterSource.addValue("user_id", userID.getUuid()); } if (isFiltered) { switch (getQosType()) { case NETWORK: return getCallsHandler().executeReadList("GetAllNetworkQos", createEntityRowMapper(), parameterSource); case CPU: return getCallsHandler().executeReadList("GetAllCpuQos", createEntityRowMapper(), parameterSource); case STORAGE: return getCallsHandler().executeReadList("GetAllStorageQos", createEntityRowMapper(), parameterSource); case HOSTNETWORK: return getCallsHandler().executeReadList("GetAllHostNetworkQos", createEntityRowMapper(), parameterSource); } } parameterSource = parameterSource.addValue("qos_type", getQosType()); return getCallsHandler().executeReadList("GetAllQosByQosType", createEntityRowMapper(), parameterSource); }
Source:
<code><START> private HyperLogLog[] getUniqueElements(int blockSize, long uniqueElements) <END> { HyperLogLog[] array = new HyperLogLog[blockSize]; for (int j = 0; j < blockSize; j++) { HyperLogLog firstHll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS); for (long i = j * uniqueElements / blockSize; i < j * uniqueElements / blockSize + uniqueElements / blockSize; i++) { firstHll.add(i); } array[j] = firstHll; } return array; }</code><technical_language>For varargs I OK leave it. Varargs good for readability. For output, lets java ImmutableList.Builder<HyperLogLog> builder = ImmutableList.builder(); build.add(...) // times needed return builder.build;</technical_language>

Target:
private List<HyperLogLog> getUniqueElements(int blockSize, long uniqueElements) { ImmutableList.Builder<HyperLogLog> builder = ImmutableList.builder(); for (int j = 0; j < blockSize; j++) { HyperLogLog firstHll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS); for (long i = j * uniqueElements / blockSize; i < j * uniqueElements / blockSize + uniqueElements / blockSize; i++) { firstHll.add(i); } builder.add(firstHll); } return builder.build(); }
Source:
<code>public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { if (this.clientRegistrationRepository != null && this.authorizedClientRepository != null) { OAuth2AuthorizedClientArgumentResolver authorizedClientArgumentResolver = new OAuth2AuthorizedClientArgumentResolver( this.clientRegistrationRepository, this.authorizedClientRepository); <START> if (accessTokenResponseClient != null) { <END> authorizedClientArgumentResolver.setClientCredentialsTokenResponseClient(accessTokenResponseClient); } argumentResolvers.add(authorizedClientArgumentResolver); } }</code><technical_language>Please update accessTokenResponseClient this.accessTokenResponseClient - common practice team prefix this for class members</technical_language>

Target:
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { if (this.clientRegistrationRepository != null && this.authorizedClientRepository != null) { OAuth2AuthorizedClientArgumentResolver authorizedClientArgumentResolver = new OAuth2AuthorizedClientArgumentResolver( this.clientRegistrationRepository, this.authorizedClientRepository); if (this.accessTokenResponseClient != null) { authorizedClientArgumentResolver.setClientCredentialsTokenResponseClient(accessTokenResponseClient); } argumentResolvers.add(authorizedClientArgumentResolver); } }
Source:
<code>protected ValidationResult isVmInterfacesConfigured(VM vm) { for (VmNetworkInterface nic : vm.getInterfaces()) { if (nic.getVnicProfileId() == null) { <START> return !FeatureSupported.networkLinking(vm.getVdsGroupCompatibilityVersion()) ? <END> new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED) : ValidationResult.VALID; } } return ValidationResult.VALID; }</code><technical_language>mind reverting condition a positive form ? return FeatureSupported.networkLinking(vm.getVdsGroupCompatibilityVersion()) ? ValidationResult.VALID: new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED);</technical_language>

Target:
protected ValidationResult isVmInterfacesConfigured(VM vm) { for (VmNetworkInterface nic : vm.getInterfaces()) { if (nic.getVnicProfileId() == null) { return FeatureSupported.networkLinking(vm.getVdsGroupCompatibilityVersion()) ? ValidationResult.VALID: new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED); } } return ValidationResult.VALID; }
Source:
<code>private void handleThumbnailFromJfif(ByteOrderedDataInputStream in, HashMap thumbnailData) throws IOException { ExifAttribute jpegInterchangeFormatAttribute = (ExifAttribute) thumbnailData.get(TAG_JPEG_INTERCHANGE_FORMAT); ExifAttribute jpegInterchangeFormatLengthAttribute = (ExifAttribute) thumbnailData.get(TAG_JPEG_INTERCHANGE_FORMAT_LENGTH); if (jpegInterchangeFormatAttribute != null && jpegInterchangeFormatLengthAttribute != null) { int thumbnailOffset = jpegInterchangeFormatAttribute.getIntValue(mExifByteOrder); int thumbnailLength = jpegInterchangeFormatLengthAttribute.getIntValue(mExifByteOrder); <START> if (mMimeType == IMAGE_TYPE_JPEG || mMimeType == IMAGE_TYPE_RAF || mMimeType == IMAGE_TYPE_RW2 || mMimeType == IMAGE_TYPE_PNG || mMimeType == IMAGE_TYPE_WEBP) { thumbnailOffset += mExifOffset; } else if (mMimeType == IMAGE_TYPE_ORF) { thumbnailOffset += mOrfMakerNoteOffset; } <END> thumbnailLength = Math.min(thumbnailLength, in.getLength() - thumbnailOffset); if (DEBUG) { Log.d(TAG, "Setting thumbnail attributes with offset: " + thumbnailOffset + ", length: " + thumbnailLength); } if (thumbnailOffset > 0 && thumbnailLength > 0) { mHasThumbnail = true; mThumbnailOffset = thumbnailOffset; mThumbnailLength = thumbnailLength; if (mFilename == null && mAssetInputStream == null && mSeekableFileDescriptor == null) { byte[] thumbnailBytes = new byte[thumbnailLength]; in.seek(thumbnailOffset); in.readFully(thumbnailBytes); mThumbnailBytes = thumbnailBytes; } } } }</code><technical_language>Q) switch-case here? (for readability)</technical_language>

Target:
private void handleThumbnailFromJfif(ByteOrderedDataInputStream in, HashMap thumbnailData) throws IOException { ExifAttribute jpegInterchangeFormatAttribute = (ExifAttribute) thumbnailData.get(TAG_JPEG_INTERCHANGE_FORMAT); ExifAttribute jpegInterchangeFormatLengthAttribute = (ExifAttribute) thumbnailData.get(TAG_JPEG_INTERCHANGE_FORMAT_LENGTH); if (jpegInterchangeFormatAttribute != null && jpegInterchangeFormatLengthAttribute != null) { int thumbnailOffset = jpegInterchangeFormatAttribute.getIntValue(mExifByteOrder); int thumbnailLength = jpegInterchangeFormatLengthAttribute.getIntValue(mExifByteOrder); switch (mMimeType) { case IMAGE_TYPE_JPEG: case IMAGE_TYPE_RAF: case IMAGE_TYPE_RW2: case IMAGE_TYPE_PNG: case IMAGE_TYPE_WEBP: thumbnailOffset += mExifOffset; break; case IMAGE_TYPE_ORF: thumbnailOffset += mOrfMakerNoteOffset; break; } thumbnailLength = Math.min(thumbnailLength, in.getLength() - thumbnailOffset); if (DEBUG) { Log.d(TAG, "Setting thumbnail attributes with offset: " + thumbnailOffset + ", length: " + thumbnailLength); } if (thumbnailOffset > 0 && thumbnailLength > 0) { mHasThumbnail = true; mThumbnailOffset = thumbnailOffset; mThumbnailLength = thumbnailLength; if (mFilename == null && mAssetInputStream == null && mSeekableFileDescriptor == null) { byte[] thumbnailBytes = new byte[thumbnailLength]; in.seek(thumbnailOffset); in.readFully(thumbnailBytes); mThumbnailBytes = thumbnailBytes; } } } }
Source:
<code><START> public PageCacheIntArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException <END> { super( pagedFile, Integer.BYTES, length, defaultValue, base ); }</code><technical_language>constructor package private</technical_language>

Target:
PageCacheIntArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException { super( pagedFile, Integer.BYTES, length, defaultValue | defaultValue << Integer.SIZE, base ); }
Source:
<code>private void remove() { if (getEntity() != null) { if (getWindow() != null) { return; } Snapshot snapshot = getSelectedItem(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().deleteSnapshotTitle()); model.setHelpTag(HelpTag.delete_snapshot); model.setHashName("delete_snapshot"); String msg = messages.areYouSureYouWantToDeleteSanpshot(DateTimeFormat.getFormat(DATE_FORMAT) .format(snapshot.getCreationDate()), snapshot.getDescription()); String backupSupportedRawDisks = getRawFormatDisksWithBackupEnabled(); if <START> (backupSupportedRawDisks!= null) <END> { msg += messages.backupEnableWillRemovedForDisks(backupSupportedRawDisks); } model.setMessage(msg); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); } }</code><technical_language>missing space operator</technical_language>

Target:
private void remove() { if (getEntity() != null) { if (getWindow() != null) { return; } Snapshot snapshot = getSelectedItem(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().deleteSnapshotTitle()); model.setHelpTag(HelpTag.delete_snapshot); model.setHashName("delete_snapshot"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(messages.areYouSureYouWantToDeleteSanpshot(DateTimeFormat.getFormat(DATE_FORMAT) .format(snapshot.getCreationDate()), snapshot.getDescription());) String backupSupportedRawDisks = getRawFormatDisksWithBackupEnabled(); if (!backupSupportedRawDisks.isEmpty()) { stringBuilder.append(messages.backupEnableWillRemovedForDisks(backupSupportedRawDisks)); } model.setMessage(stringBuilder.toString()); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); } }
Source:
<code>public void end(OperationTiming overallTiming) { if (overallTiming == null && timings.isEmpty()) { return; } long wallEnd = ticker.read(); long cpuEnd; long userEnd; if (wallEnd - intervalWallStart < minNanosForCpuTiming) { cpuEnd = currentThreadCpuTime(); <START> userEnd = currentThreadUserTime(); <END> } else { cpuEnd = intervalCpuStart; userEnd = intervalUserStart; } if (overallTiming != null) { long wallDuration = wallEnd - wallStart; overallTiming.recordWallTime(wallDuration); if (cpuEnd > cpuStart) { overallTiming.recordEstimatedCpuTime(cpuEnd - cpuStart); overallTiming.recordEstimatedUserTime(userEnd - userStart); } else { overallTiming.recordEstimatedCpuTime(wallDuration); overallTiming.recordEstimatedUserTime(wallDuration); } } long totalUnaccountedCpuWallNanos = timings.values().stream() .mapToLong(InternalTiming::getCpuUnaccountedWallNanos) .sum(); long totalMeasuredCpuNanos = timings.values().stream() .mapToLong(InternalTiming::getCpuMeasuredNanos) .sum(); long totalUnaccountedCpuNanos = max(0, cpuEnd - cpuStart - totalMeasuredCpuNanos); long totalMeasuredUserNanos = timings.values().stream() .mapToLong(InternalTiming::getUserMeasuredNanos) .sum(); long totalUnaccountedUserNanos = max(0, userEnd - userStart - totalMeasuredUserNanos); for (InternalTiming timing : timings.values()) { timing.recordTimings(totalUnaccountedCpuNanos, totalUnaccountedUserNanos, totalUnaccountedCpuWallNanos); } }</code><technical_language>In case decided drop final estimate - this simplified</technical_language>

Target:
public void end(OperationTiming overallTiming) { if (overallTiming == null && timings.isEmpty()) { return; } long wallEnd = ticker.read(); long cpuEnd = currentThreadCpuTime(); long userEnd = currentThreadUserTime(); if (overallTiming != null) { long wallDuration = wallEnd - wallStart; overallTiming.recordWallTime(wallDuration); if (cpuEnd > cpuStart) { overallTiming.recordEstimatedCpuTime(cpuEnd - cpuStart); overallTiming.recordEstimatedUserTime(userEnd - userStart); } else { overallTiming.recordEstimatedCpuTime(wallDuration); overallTiming.recordEstimatedUserTime(wallDuration); } } long totalUnaccountedCpuWallNanos = timings.values().stream() .mapToLong(InternalTiming::getCpuUnaccountedWallNanos) .sum(); long totalMeasuredCpuNanos = timings.values().stream() .mapToLong(InternalTiming::getCpuMeasuredNanos) .sum(); long totalUnaccountedCpuNanos = max(0, cpuEnd - cpuStart - totalMeasuredCpuNanos); long totalMeasuredUserNanos = timings.values().stream() .mapToLong(InternalTiming::getUserMeasuredNanos) .sum(); long totalUnaccountedUserNanos = max(0, userEnd - userStart - totalMeasuredUserNanos); for (InternalTiming timing : timings.values()) { timing.recordTimings(totalUnaccountedCpuNanos, totalUnaccountedUserNanos, totalUnaccountedCpuWallNanos); } }
Source:
<code>protected IStatus validate() { final String connectionName = this.connectionNameModelObservable .getValue(); if (connectionName == null || connectionName.isEmpty()) { return ValidationStatus.error(WizardMessages.getString( "DockerConnectionPage.validation.missingConnectionName.msg")); } else if (!connectionName.equals(this.initialConnectionName) && DockerConnectionManager.getInstance() .findConnection(connectionName) != null) { return ValidationStatus.error(WizardMessages.getString( "DockerConnectionPage.validation.duplicateConnectionName.msg")); } <START> System.err.println("Name Validation status: OK"); <END> return ValidationStatus.ok(); }</code><technical_language>nls marker</technical_language>

Target:
protected IStatus validate() { final String connectionName = this.connectionNameModelObservable .getValue(); if (connectionName == null || connectionName.isEmpty()) { return ValidationStatus.error(WizardMessages.getString( "DockerConnectionPage.validation.missingConnectionName.msg")); } else if (!connectionName.equals(this.initialConnectionName) && DockerConnectionManager.getInstance() .findConnection(connectionName) != null) { return ValidationStatus.error(WizardMessages.getString( "DockerConnectionPage.validation.duplicateConnectionName.msg")); } return ValidationStatus.ok(); }
Source:
<code>protected AnchorListItem getBulkClaim(final ExtendedPagedTable<TaskSummary> extendedPagedTable) { <START> final AnchorListItem bulkAbortNavLink = GWT.create(AnchorListItem.class); <END> bulkAbortNavLink.setText(constants.Bulk_Claim()); bulkAbortNavLink.setIcon(IconType.LOCK); bulkAbortNavLink.setIconFixedWidth(true); bulkAbortNavLink.addClickHandler(event -> confirmPopup.show(constants.Claim_tasks(), constants.Claim(), constants.Claim_Confirmation(), getClaimCommand(extendedPagedTable)) ); return bulkAbortNavLink; }</code><technical_language>local variables called bulkAbortNavLink, is intended? assume match operation i.e. bulkClaimNavLink in this case</technical_language>

Target:
protected AnchorListItem getBulkClaim(final ExtendedPagedTable<TaskSummary> extendedPagedTable) { final AnchorListItem bulkClaimNavLink = GWT.create(AnchorListItem.class); bulkClaimNavLink.setText(constants.Bulk_Claim()); bulkClaimNavLink.setIcon(IconType.LOCK); bulkClaimNavLink.setIconFixedWidth(true); bulkClaimNavLink.addClickHandler(event -> confirmPopup.show(constants.Claim_tasks(), constants.Claim(), constants.Claim_Confirmation(), getClaimCommand(extendedPagedTable)) ); return bulkClaimNavLink; }
Source:
<code>public void cleanup() throws Exception { if (workspaceItem != null) { <START> System.out.println("remove workspaceitem"); <END> deleteWsi(workspaceItem); } if (workflowItem != null) { System.out.println("remove workflowitem"); delete(workflowItem); } if (item != null) { System.out.println("remove item!!!"); deleteItem(item); } }</code><technical_language>remove this System.out.println ;)</technical_language>

Target:
public void cleanup() throws Exception { if (workspaceItem != null) { deleteWsi(workspaceItem); } if (workflowItem != null) { delete(workflowItem); } if (item != null) { deleteItem(item); } }
Source:
<code>protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedServerLaunch hostControllerLaunch = hostControllerReference.get(); <START> if (hostControllerLaunch != null && hostControllerLaunch.getHostController() != null) { <END> ctx.disconnectController(); } }</code><technical_language>this in isAvailable()? prevent CLI offering option. is fine, people command if valid</technical_language>

Target:
protected void doHandle(CommandContext ctx) throws CommandLineException { EmbeddedServerLaunch hostControllerLaunch = hostControllerReference.get(); if (hostControllerLaunch != null) { ctx.disconnectController(); } }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_menu, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setIconifiedByDefault(false); MenuItem searchItem = menu.findItem(R.id.action_search); <START> searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { <END> @Override public boolean onMenuItemActionExpand(MenuItem menuItem) { return true; } @Override public boolean onMenuItemActionCollapse(MenuItem menuItem) { getLoaderManager().restartLoader(0, null, (MainMode)getFragmentManager().findFragmentByTag(MainMode.class.getSimpleName())); return true; } }); return super.onCreateOptionsMenu(menu); }</code><technical_language>Please move listener desired mode</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_menu, menu); return super.onCreateOptionsMenu(menu); }
Source:
<code>protected NIC populate(NIC model, VmNetworkInterface entity) { BackendVmNicsResource parent = (BackendVmNicsResource)collection; Guid clusterId = parent.getClusterId(); network network = parent.getClusterNetwork(clusterId, null, model.getNetwork().getName()); String networkId = network == null ? null : network.getId().toString(); model.getNetwork().setId(networkId); model.getNetwork().setName(null); if (model.isSetPortMirroring() && model.getPortMirroring().isSetNetworks() && model.getPortMirroring().getNetworks().getNetworks().size() == 1) { model.getPortMirroring().getNetworks().getNetworks().get(0).setId(networkId); <START> } <END> return parent.addStatistics(model, entity, uriInfo, httpHeaders); }</code><technical_language>Shahar, this is backend->user mapping, need this /if/ conditions /model/ (client resource), instead need check if P.M enabled in /network/ obj. if create PortMirroring in /model/ (client resource)</technical_language>

Target:
protected NIC populate(NIC model, VmNetworkInterface entity) { BackendVmNicsResource parent = (BackendVmNicsResource)collection; Guid clusterId = parent.getClusterId(); network network = parent.getClusterNetwork(clusterId, null, model.getNetwork().getName()); String networkId = network == null ? null : network.getId().toString(); model.getNetwork().setId(networkId); model.getNetwork().setName(null); if (entity.isPortMirroring()) { PortMirroring portMirroring = new PortMirroring(); Networks networks = new Networks(); Network net = new Network(); net.setId(networkId); portMirroring.setNetworks(networks); portMirroring.getNetworks().getNetworks().add(net); model.setPortMirroring(portMirroring); } return parent.addStatistics(model, entity, uriInfo, httpHeaders); }
Source:
<code>protected StatusRow lockStatusRow(UUID queryId) { try (Statement stmt = connection.createStatement()) { ResultSet rs = stmt.executeQuery(String.format(ENGLISH, <START> "SELECT completed_at FROM %s WHERE query_id = '%s' FOR UPDATE NOWAIT", <END> escapeIdent(statusTableName), queryId.toString()) ); if (rs.next()) { rs.getTimestamp(1); if (rs.wasNull()) { return StatusRow.LOCKED_NOT_COMPLETED; } else { return StatusRow.LOCKED_COMPLETED; } } else { return StatusRow.NOT_EXISTS; } } catch (SQLException ex) { throw new DatabaseException("Failed to lock a status row", ex); } }</code><technical_language>SQL error code is "55P03": embulk_demo=# select * queues for update nowait; ERROR: 55P03: obtain lock row in relation "queues" LOCATION: heap_lock_tuple, heapam.c:4679</technical_language>

Target:
protected StatusRow lockStatusRow(UUID queryId) throws LockConflictException { try (Statement stmt = connection.createStatement()) { ResultSet rs = stmt.executeQuery(String.format(ENGLISH, "SELECT completed_at FROM %s WHERE query_id = '%s' FOR UPDATE NOWAIT", escapeIdent(statusTableName), queryId.toString()) ); if (rs.next()) { rs.getTimestamp(1); if (rs.wasNull()) { return StatusRow.LOCKED_NOT_COMPLETED; } else { return StatusRow.LOCKED_COMPLETED; } } else { return StatusRow.NOT_EXISTS; } } catch (SQLException ex) { if (ex.getSQLState().equals("55P03")) { throw new LockConflictException("Failed to acquire a status row lock", ex); } else { throw new DatabaseException("Failed to lock a status row", ex); } } }
Source:
<code>private String getAddressConsideringPciSlotOccupancy(VmDevice vmDevice){ String address = vmDevice.getAddress(); if (StringUtils.isEmpty(address)) { return address; } Map<String, String> deviceAddressMap = XmlRpcStringUtils.string2Map(address); if (!ADDRESS_TYPE_PCI.equals(deviceAddressMap.get(ADDRESS_TYPE))){ return address; } VmDeviceId deviceId = vmDevice.getId(); VmDeviceId deviceIdOccupyingPciSlot = occupiedPciSlots.get(deviceAddressMap); if <START> (deviceIdOccupyingPciSlot == null || deviceIdOccupyingPciSlot.equals(deviceId)){ <END> return address; } return ""; }</code><technical_language>worth explain, address is returned "" is returned. Extracting this condition boolean variable named 'uniqueAddressOrSameDevice' (or name) help</technical_language>

Target:
private String getAddressConsideringPciSlotOccupancy(VmDevice vmDevice){ String address = vmDevice.getAddress(); VmDevicePciAddress deviceAddress = new VmDevicePciAddress(address); if (!deviceAddress.isPciAddress()){ return address; } VmDeviceId deviceId = vmDevice.getId(); VmDeviceId deviceIdOccupyingPciSlot = occupiedPciSlots.get(deviceAddress); if (deviceIdOccupyingPciSlot == null || deviceIdOccupyingPciSlot.equals(deviceId)){ return address; } return ""; }