auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { BigtableSnapshotName snapshotName = new BigtableSnapshotName(snapshot.getName()); BigtableTableName tableName = new BigtableTableName(snapshot.getSourceTable().getName()); <START> HBaseProtos.SnapshotDescription snapDesc = HBaseProtos.SnapshotDescription.newBuilder() <END> .setName(snapshotName.getSnapshotId()) .setTable(tableName.getTableId()) .setCreationTime(TimeUnit.SECONDS.toMillis(snapshot.getCreateTime().getSeconds())) .build(); response.add(new SnapshotDescription(snapDesc.getName(), TableName.valueOf(snapDesc.getTable()), SnapshotType.valueOf(snapDesc.getType().toString()) , snapDesc.getOwner(), snapDesc.getCreationTime(), snapDesc.getVersion())); } return response; }</code><technical_language>need HBaseProtos.SnapshotDescriptionhere. convert Bigtable's Snapshot HBase's SnapshotDescription directly</technical_language>

Target:
public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { response.add(new SnapshotDescription( snapshot.getName(), TableName.valueOf(snapshot.getSourceTable().getName()))); } return response; }
Source:
<code>public boolean isKeyFrame(byte[] buff, int off, int len) { <START> if (buff == null || len < 1 || buff.length < len) <END> { return false; } int nalType = buff[off] & kTypeMask; if (nalType == kFuA) { if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }</code><technical_language>@mdaneshi, do sense this in static methods wrote? if (buf == null || Math.min(buf.length, len) < + 1 /* required array length for this method work correctly */) { return false; } I this is a common practice currently in libjitsi a sloppy access arrays, I change this write more defensive code possible</technical_language>

Target:
public static boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || buff.length < off + Math.max(len, 1)) { return false; } int nalType = buff[off] & kTypeMask; if (nalType == kFuA) { if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }
Source:
<code>public void stop(ComponentContext context) throws InterruptedException { super.stop(context); <START> redirectResolver = new DefaultRedirectResolver(); <END> }</code><technical_language>Do need stop ? If not, more sense put in start method (and remove field init)</technical_language>

Target:
public void stop(ComponentContext context) throws InterruptedException { super.stop(context); redirectResolver = null; }
Source:
<code>private String parameterValidation(final Boolean active, final String sortBy, final String sortOrder) { final List<String> sortbyFields = ImmutableList.<String>builder().add("trialDbId").add("trialName").add("programDbId").add("programName").add("startDate").add("endDate").add("active").build(); final List<String> sortOrders = ImmutableList.<String>builder().add(TrialResourceBrapi.ASCENDING).add(TrialResourceBrapi.DESCENDING).build(); if (active != null && !active) { <START> return gerMessageError(1); <END> } if (!StringUtils.isBlank(sortBy) && !sortbyFields.contains(sortBy)) { return gerMessageError(2); } if (!StringUtils.isBlank(sortOrder) && !sortOrders.contains(sortOrder)) { return gerMessageError(3); } return ""; }</code><technical_language>I more clear combine logic of gerMessageError parameterValidation remove switch</technical_language>

Target:
private String parameterValidation(final Boolean active, final String sortBy, final String sortOrder) { final List<String> sortbyFields = ImmutableList.<String>builder().add("trialDbId").add("trialName").add("programDbId").add("programName").add("startDate").add("endDate").add("active").build(); final List<String> sortOrders = ImmutableList.<String>builder().add(TrialResourceBrapi.ORDER_BY_ASCENDING).add(TrialResourceBrapi.ORDER_BY_DESCENDING).build(); if (active != null && !active) { return "No inactive studies found."; } if (!StringUtils.isBlank(sortBy) && !sortbyFields.contains(sortBy)) { return "sortBy bad filter, expect trialDbId/trialName/programDbId/programName/startDate/endDate/active"; } if (!StringUtils.isBlank(sortOrder) && !sortOrders.contains(sortOrder)) { return "sortOrder bad filter, expect asc/desc"; } return ""; }
Source:
<code>public void startTraining(SilentUpdatesMessage message) { if (accumulator != null) { if (message.getOriginatorId() == transport.getOwnOriginatorId()) { return; } ; try { if (!bypassMode.get()) { updatesBuffer.put(message.getUpdates()); } } catch (Exception e) { throw new RuntimeException(e); } } else if (params != null && stepFunction != null) { synchronized (this) { int encoding = message.getUpdates().data().getInt(3); if (encoding == 0) { Nd4j.getExecutioner().thresholdDecode(message.getUpdates(), updates); sparseCounter.incrementAndGet(); <START> } else if (encoding == 1) { <END> Nd4j.getExecutioner().bitmapDecode(message.getUpdates(), updates); denseCounter.incrementAndGet(); } if ((sparseCounter.get() + denseCounter.get()) % 100 == 0) { log.info("Sparse/Dense ratio: {}", String.format("%.2f", (sparseCounter.get() +1) / (double) (denseCounter.get() + 1))); } hasSomething.set(true); if (updatesCount.incrementAndGet() % Math.max(transport.numberOfKnownClients(), 5) == 0) { stepFunction.step(params, updates); Nd4j.getMemoryManager().memset(updates); hasSomething.set(false); } } if (transport.numberOfKnownClients() > 1) { transport.sendMessageToAllClients(message, message.getOriginatorId(), transport.getOwnOriginatorId()); } } else throw new DL4JInvalidConfigException("Neither GradientsAccumulator or StepFunction is defined!"); }</code><technical_language>Magic constants</technical_language>

Target:
public void startTraining(SilentUpdatesMessage message) { if (accumulator != null) { if (message.getOriginatorId() == transport.getOwnOriginatorId()) { return; } ; try { if (!bypassMode.get()) { updatesBuffer.put(message.getUpdates()); } } catch (Exception e) { throw new RuntimeException(e); } } else if (params != null && stepFunction != null) { synchronized (this) { int encoding = message.getUpdates().data().getInt(3); if (encoding == ThresholdCompression.FLEXIBLE_ENCODING) { Nd4j.getExecutioner().thresholdDecode(message.getUpdates(), updates); sparseCounter.incrementAndGet(); } else if (encoding == ThresholdCompression.BITMAP_ENCODING) { Nd4j.getExecutioner().bitmapDecode(message.getUpdates(), updates); denseCounter.incrementAndGet(); } else throw new DL4JInvalidConfigException("Unknown compression header received: " + encoding); hasSomething.set(true); if (updatesCount.incrementAndGet() % Math.max(transport.numberOfKnownClients(), 5) == 0) { stepFunction.step(params, updates); Nd4j.getMemoryManager().memset(updates); hasSomething.set(false); } } if (transport.numberOfKnownClients() > 1) { transport.sendMessageToAllClients(message, message.getOriginatorId(), transport.getOwnOriginatorId()); } } else throw new DL4JInvalidConfigException("Neither GradientsAccumulator or StepFunction is defined!"); }
Source:
<code>public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); <START> log.debug(MessageFormat.format("requestXML:{0},uri:{1}", bufferedRequest.getInputStreamString(),request.getRequestURI())); <END> BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }</code><technical_language>"[Authentication Entry Point] uri: {0} body: {1}"</technical_language>

Target:
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); log.debug(MessageFormat.format("[Authentication Entry Point] uri: {0} body: {1}",request.getRequestURI(),bufferedRequest.getInputStreamString())); BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }
Source:
<code>protected void closeConnection() { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if ((socket != null) && (!socket.isClosed())) { try { socket.close(); } catch (IOException e) { <START> logger.warn("Could not close socket in {}: ", receiverNode, this.thing.getUID(), e); <END> } } receiverNodes.put(receiverNode, null); } }</code><technical_language>this is warn logging provide e.getMessage() instead re-add placeholder</technical_language>

Target:
protected void closeConnection() { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if ((socket != null) && (!socket.isClosed())) { try { socket.close(); } catch (IOException e) { logger.warn("Could not close socket in {}: {}", receiverNode, this.thing.getUID(), e.getMessage()); } } receiverNodes.put(receiverNode, null); } }
Source:
<code>public List<String> getItems() throws Exception { if (kit == null) { throw new Exception(tl("kitNotFound")); } try { final Object kitItems = kit.get("items"); if (kitItems instanceof List) { return (List) kitItems; } throw new Exception("Invalid item list"); } catch (Exception e) { ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); throw new Exception(tl("kitError2"), e); <START> } <END> }</code><technical_language>This validates kit is correctly formatted in config - is a reason for removing this</technical_language>

Target:
public List<String> getItems() throws Exception { if (kit == null) { throw new Exception(tl("kitNotFound")); } try { final List<String> itemList = new ArrayList<String>(); final Object kitItems = kit.get("items"); if (kitItems instanceof List) { for (Object item : (List) kitItems) { if (item instanceof String) { itemList.add(item.toString()); continue; } throw new Exception("Invalid kit item: " + item.toString()); } return itemList; } throw new Exception("Invalid item list"); } catch (Exception e) { ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); throw new Exception(tl("kitError2"), e); } }
Source:
<code>public void refresh() { EEFIdeUiPlugin.getPlugin().debug("EEFSection#refresh(...)"); <START> IMessageManager messageManager = this.tabbedPropertySheetPage.getForm().getMessageManager(); EAttribute auditEAttribute = EefPackage.Literals.EEF_RULE_AUDIT_DESCRIPTION__AUDIT_EXPRESSION; EAttribute messageEAttribute = EefPackage.Literals.EEF_VALIDATION_RULE_DESCRIPTION__MESSAGE_EXPRESSION; EEFPage page = this.eefSectionDescriptor.getEEFPage(); List<EEFSemanticValidationRuleDescription> semanticValidationRules = page.getDescription().getSemanticValidationRules(); for (EEFSemanticValidationRuleDescription semanticValidationRule : semanticValidationRules) { boolean isValid = true; for (EEFRuleAuditDescription audit : semanticValidationRule.getAudits()) { String auditExpression = audit.getAuditExpression(); Boolean result = new Eval(page.getInterpreter(), page.getVariableManager()).get(auditEAttribute, auditExpression, Boolean.class); isValid = isValid && (result != null && result.booleanValue()); if (!isValid) { break; } } if (isValid) { messageManager.removeMessage(semanticValidationRule); } else { String messageExpression = semanticValidationRule.getMessageExpression(); String message = new Eval(page.getInterpreter(), page.getVariableManager()).get(messageEAttribute, messageExpression, String.class); messageManager.addMessage(semanticValidationRule, message, null, semanticValidationRule.getSeverity().getValue()); } } <END> for (ILifecycleManager lifecycleManager : lifecycleManagers) { lifecycleManager.refresh(); } this.tabbedPropertySheetPage.getForm().getMessageManager().update(); }</code><technical_language>code in widget group controller. try merge in place</technical_language>

Target:
public void refresh() { EEFIdeUiPlugin.getPlugin().debug("EEFSection#refresh(...)"); this.lifecycleManager.refresh(); }
Source:
<code>public boolean verifyCreated(int timeToLive, int futureTimeToLive, Date invocationDate) { Date date = invocationDate == null ? new Date() : invocationDate; long invocationTime = date.getTime(); if (futureTimeToLive > 0) { <START> date.setTime(invocationTime + futureTimeToLive * 1000); <END> } if (!verifyCreatedAfter(date)) { return false; } invocationTime -= timeToLive * 1000; date.setTime(invocationTime); if (!verifyCreatedBefore(date)) { return false; } LOG.info("Validation of Timestamp: Everything is ok"); return true; }</code><technical_language>I follow logic here. setTime line 93 overridden setTime line 103</technical_language>

Target:
public boolean verifyCreated(int timeToLive, int futureTimeToLive, Date invocationDate) { Date currentInvocationDate = invocationDate == null ? new Date() : invocationDate; long invocationTime = currentInvocationDate.getTime(); if (futureTimeToLive > 0) { currentInvocationDate.setTime(invocationTime + futureTimeToLive * 1000); } if (!verifyCreatedAfter(currentInvocationDate)) { return false; } invocationTime -= timeToLive * 1000; currentInvocationDate.setTime(invocationTime); if (!verifyCreatedBefore(currentInvocationDate)) { return false; } LOG.info("Validation of Timestamp: Everything is ok"); return true; }
Source:
<code>public MessageQueue queue() { <START> return MessageQueue.CertificationSuccess_EventMessage; <END> }</code><technical_language>MessageQueue.RegisterBankAccount_EventMessage</technical_language>

Target:
public MessageQueue queue() { return MessageQueue.RegisterBankAccount_EventMessage; }
Source:
<code><START> public Map<String, Serializable> getCachedMetaData( final String key ) { <END> final IPluginCacheManager cacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = cacheManager.getCache(); return cache.getMetaData( key ); }</code><technical_language>is reason this method public, I suppose. call this method elsewhere</technical_language>

Target:
private Map<String, Serializable> getCachedMetaData( final String key ) { final IPluginCacheManager cacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = cacheManager.getCache(); return cache.getMetaData( key ); }
Source:
<code>protected void setAdditionalParameters() { String moderatedInstructorEmail = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_INSTRUCTOR); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_INSTRUCTOR, moderatedInstructorEmail); <START> moderatedInstructor = logic.getInstructorForEmail(courseId, moderatedInstructorEmail); <END> }</code><technical_language>Need check if instructor exists</technical_language>

Target:
protected void setAdditionalParameters() throws EntityDoesNotExistException { String moderatedInstructorEmail = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedInstructorEmail); moderatedInstructor = logic.getInstructorForEmail(courseId, moderatedInstructorEmail); if (moderatedInstructor == null) { throw new EntityDoesNotExistException("Instructor Email " + moderatedInstructorEmail + " does not exist in " + courseId + "."); } }
Source:
<code><START> public boolean isThis() { <END> if (this.token == Token.NAME) { return "this".equals(this.getOriginalName()); } return this.token == Token.THIS; }</code><technical_language>I want is\* methods check token type else</technical_language>

Target:
public boolean isThis() { return this.token == Token.THIS; }
Source:
<code>public BrokerReduceService(PinotConfiguration config) { _maxReduceThreadsPerQuery = config.getProperty(CommonConstants.Broker.CONFIG_OF_MAX_REDUCE_THREADS_PER_QUERY, CommonConstants.Broker.MAX_REDUCE_THREADS_PER_QUERY); <START> LOGGER.info("Initializing BrokerReduceService with reduce threads.", _maxReduceThreadsPerQuery); <END> ThreadFactory reduceThreadFactory = new ThreadFactoryBuilder().setDaemon(false).setPriority(QUERY_RUNNER_THREAD_PRIORITY) .setNameFormat(REDUCE_THREAD_NAME_FORMAT).build(); ExecutorService delegate = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), reduceThreadFactory); _reduceExecutorService = MoreExecutors.listeningDecorator(delegate); }</code><technical_language>Log number worker threads threads query? Also, if is single-threaded, need launch executor service</technical_language>

Target:
public BrokerReduceService(PinotConfiguration config) { _maxReduceThreadsPerQuery = config.getProperty(CommonConstants.Broker.CONFIG_OF_MAX_REDUCE_THREADS_PER_QUERY, CommonConstants.Broker.DEFAULT_MAX_REDUCE_THREADS_PER_QUERY); int numThreadsInExecutorService = Runtime.getRuntime().availableProcessors(); LOGGER.info("Initializing BrokerReduceService with threads, and max reduce threads.", numThreadsInExecutorService, _maxReduceThreadsPerQuery); ThreadFactory reduceThreadFactory = new ThreadFactoryBuilder().setDaemon(false).setPriority(QUERY_RUNNER_THREAD_PRIORITY) .setNameFormat(REDUCE_THREAD_NAME_FORMAT).build(); _reduceExecutorService = Executors.newFixedThreadPool(numThreadsInExecutorService, reduceThreadFactory); }
Source:
<code>public URI reconstructURI(ServiceInstance instance, URI original) { Assert.notNull(instance, "instance can not be null"); String serviceId = instance.getServiceId(); RibbonLoadBalancerContext context = this.clientFactory .getLoadBalancerContext(serviceId); Server server = new Server(instance.getHost(), instance.getPort()); boolean secure = isSecure(server, serviceId); URI uri = original; if (secure) { <START> uri = UriComponentsBuilder.fromUri(uri).scheme("https").build(true).toUri(); <END> } return context.reconstructURIWithServer(server, uri); }</code><technical_language>This RibbonUtils.updateToHttpsIfNeeded</technical_language>

Target:
public URI reconstructURI(ServiceInstance instance, URI original) { Assert.notNull(instance, "instance can not be null"); String serviceId = instance.getServiceId(); RibbonLoadBalancerContext context = this.clientFactory .getLoadBalancerContext(serviceId); Server server = new Server(instance.getHost(), instance.getPort()); IClientConfig clientConfig = clientFactory.getClientConfig(serviceId); ServerIntrospector serverIntrospector = serverIntrospector(serviceId); URI uri = RibbonUtils.updateToHttpsIfNeeded(original, clientConfig, serverIntrospector, server); return context.reconstructURIWithServer(server, uri); }
Source:
<code>public Long countDocuments(String query) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.countDocuments(overrideNullQuery(query)); if (!response.equals("")) { <START> JsonReader jsonReader = Json.createReader(new StringReader(response)); <END> JsonObject result = jsonReader.readObject(); return result.getJsonNumber("count").longValue(); } else { return 0L; } }</code><technical_language>JsonReader is a closeable class created object is closed. a try-with-resources statement</technical_language>

Target:
public Long countDocuments(String query) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.countDocuments(overrideNullQuery(query)); if (!response.equals("")) { try (JsonReader jsonReader = Json.createReader(new StringReader(response))) { JsonObject result = jsonReader.readObject(); return result.getJsonNumber("count").longValue(); } } else { return 0L; } }
Source:
<code>private void start() { for (IServer server : ServerCore.getServers()) { <START> if (server.getServerType() == null || server.getServerType().getId().equals(WSTUtils.LIVERELOAD_SERVER_TYPE)) { <END> continue; } Logger.info("Adding ServerListener to existing server: " + server.getName()); addServerListener(server); if (server.getServerState() == IServer.STATE_STARTED) { Logger.info("Also adding PublishListener to existing server: " + server.getName()); addPublishListener(server); } } }</code><technical_language>WSTUtils.LIVERELOAD_SERVER_TYPE.equals(server.getServerType().getId()) is safer, covers _unlikely_ case of a null id</technical_language>

Target:
private void start() { for (IServer server : ServerCore.getServers()) { if (server.getServerType() == null || WSTUtils.LIVERELOAD_SERVER_TYPE.equals(server.getServerType().getId())) { continue; } Logger.info("Adding ServerListener to existing server: " + server.getName()); addServerListener(server); if (server.getServerState() == IServer.STATE_STARTED) { Logger.info("Also adding PublishListener to existing server: " + server.getName()); addPublishListener(server); } } }
Source:
<code>public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { if (Slimefun.hasUnlocked(e.getPlayer(), ExplosivePickaxe.this, true)) { e.getBlock().getWorld().createExplosion(e.getBlock().getLocation(), 0.0F); e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1F); List<Block> blocks = new ArrayList<>(); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x == 0 && y == 0 && z == 0) { continue; } blocks.add(e.getBlock().getRelative(x, y, z)); } } } <START> EntityExplodeEvent entityExplodeEvent = new EntityExplodeEvent(e.getPlayer(), e.getBlock().getLocation(), blocks, 0); <END> Bukkit.getServer().getPluginManager().callEvent(entityExplodeEvent); if (!entityExplodeEvent.isCancelled()) { entityExplodeEvent.blockList().forEach(b -> { breakBlock(e.getPlayer(), item, b, fortune, drops); }); } } return true; } else { return false; } } }; }</code><technical_language>a fan of EntityExplodeEvent, this b BlockExplodeEvent actual broken block. This is gonna lead weird behaviour plugins</technical_language>

Target:
public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { if (Slimefun.hasUnlocked(e.getPlayer(), ExplosivePickaxe.this, true)) { e.getBlock().getWorld().createExplosion(e.getBlock().getLocation(), 0.0F); e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1F); List<Block> blocks = new ArrayList<>(); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x == 0 && y == 0 && z == 0) { continue; } blocks.add(e.getBlock().getRelative(x, y, z)); } } } BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(e.getBlock(), blocks, 0); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { blockExplodeEvent.blockList().forEach(b -> breakBlock(e.getPlayer(), item, b, fortune, drops)); } } return true; } else { return false; } } }; }
Source:
<code>public void displayHelpWidget() { <START> Window.alert( "Coming soon!" ); <END> }</code><technical_language>spaces brackets removed</technical_language>

Target:
public void displayHelpWidget() { }
Source:
<code><START> public void testCreateAndDeleteInstance() { <END> String testInstance = generateId(); String testCluster = generateId(); try { InstanceAdminExample testInstanceAdmin = new InstanceAdminExample(projectId, testInstance, testCluster); testInstanceAdmin.createProdInstance(); assertTrue(adminClient.exists(testInstance)); testInstanceAdmin.deleteInstance(); assertFalse(adminClient.exists(testInstance)); } catch (Exception e) { e.printStackTrace(); fail(); } }</code><technical_language>test throw exception</technical_language>

Target:
public void testCreateAndDeleteInstance() throws IOException { String testInstance = generateId(); String testCluster = generateId(); InstanceAdminExample testInstanceAdmin = new InstanceAdminExample(projectId, testInstance, testCluster); testInstanceAdmin.createProdInstance(); assertTrue(adminClient.exists(testInstance)); testInstanceAdmin.deleteInstance(); assertFalse(adminClient.exists(testInstance)); }
Source:
<code>private BitSet newPartitions() { <START> BitSet bitSet = new BitSet(20); <END> for(int k=0;k<bitSet.length();k++){ bitSet.set(k); } return bitSet; }</code><technical_language>is this a magic 20 instead of props.getInteger(PARTITION_OPERATION_THREAD_COUNT)</technical_language>

Target:
private BitSet newPartitions() { HazelcastProperties properties = new HazelcastProperties(config); BitSet bitSet = new BitSet(properties.getInteger(PARTITION_COUNT)); for (int k = 0; k < bitSet.size(); k++) { bitSet.set(k); } return bitSet; }
Source:
<code>public void should_canUserSeeProcessInstance_call_engine_api() throws Exception { <START> final boolean expected = true; <END> checkCanUserSeeProcessInstanceWhenApiReturn(expected); }</code><technical_language>inlined</technical_language>

Target:
public void should_canUserSeeProcessInstance_call_engine_api() throws Exception { checkCanUserSeeProcessInstanceWhenApiReturn(true); }
Source:
<code>public String toString() { return toStringHelper(this) .add("streamName", streamName) .add("streamId", streamId) .add("streamType", streamType) <START> .add("path", orcDataSource) <END> .toString(); }</code><technical_language>orcDataSource.getId() ? change "path" "dataSource"</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("streamName", streamName) .add("streamId", streamId) .add("streamType", streamType) .add("dataSource", orcDataSource.getId()) .toString(); }
Source:
<code>private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd) { RebaseTodoLine.Action action = null; AbbreviatedObjectId commit = null; int nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); int tokenCount = 0; while (tokenCount < 3 && nextSpace < lineEnd) { switch (tokenCount) { case 0: String actionToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, <START> StandardCharsets.UTF_8); <END> tokenBegin = nextSpace; action = RebaseTodoLine.Action.parse(actionToken); if (action == null) return null; break; case 1: nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); String commitToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, StandardCharsets.UTF_8); tokenBegin = nextSpace; commit = AbbreviatedObjectId.fromString(commitToken); break; case 2: return new RebaseTodoLine(action, commit, RawParseUtils.decode( buf, tokenBegin, 1 + lineEnd)); } tokenCount++; } if (tokenCount == 2) return new RebaseTodoLine(action, commit, ""); return null; }</code><technical_language>import this static</technical_language>

Target:
private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd) { RebaseTodoLine.Action action = null; AbbreviatedObjectId commit = null; int nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); int tokenCount = 0; while (tokenCount < 3 && nextSpace < lineEnd) { switch (tokenCount) { case 0: String actionToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, UTF_8); tokenBegin = nextSpace; action = RebaseTodoLine.Action.parse(actionToken); if (action == null) return null; break; case 1: nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); String commitToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, UTF_8); tokenBegin = nextSpace; commit = AbbreviatedObjectId.fromString(commitToken); break; case 2: return new RebaseTodoLine(action, commit, RawParseUtils.decode(buf, tokenBegin, 1 + lineEnd)); } tokenCount++; } if (tokenCount == 2) return new RebaseTodoLine(action, commit, ""); return null; }
Source:
<code>@Override public E take() throws InterruptedException { lock.lock(); try { while (queue.isEmpty()) { nonEmpty.await(); } E peek = queue.peek(); if (peek == null) { throw new NoSuchElementException(); } queue.remove(); return peek; } catch (IOException e) { <START> QueueFile.<Error>getSneakyThrowable(e); <END> return null; } finally { lock.unlock(); } }</code><technical_language>throws</technical_language>

Target:
@Override public E take() throws InterruptedException { lock.lock(); try { while (queue.isEmpty()) { nonEmpty.await(); } E peek = queue.peek(); if (peek == null) { throw new ConcurrentModificationException(); } queue.remove(); return peek; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
<code><START> void privilegesToAnonymousShouldBeAdded(String privilegeName, String acceptHeader) <END> { PrivilegeListForm privilegeListForm = new PrivilegeListForm(); List<PrivilegeForm> privilegeForms = new ArrayList<>(); PrivilegeForm privilegeForm = new PrivilegeForm(privilegeName, ""); privilegeForms.add(privilegeForm); privilegeListForm.setPrivileges(privilegeForms); given().contentType(MediaType.APPLICATION_JSON_VALUE) .header(HttpHeaders.ACCEPT, acceptHeader) .body(privilegeListForm) .when() .post(getContextBaseUrl() + "/authorization/anonymous/privileges") .peek() .then() .statusCode(HttpStatus.OK.value()) .body(containsString(SUCCESSFUL_ASSIGN_PRIVILEGES)); }</code><technical_language>Cosmetic: please, follow project's coding convention for method parameters</technical_language>

Target:
void privilegesToAnonymousShouldBeAdded(String privilegeName, String acceptHeader) { PrivilegeListForm privilegeListForm = new PrivilegeListForm(); List<PrivilegeForm> privilegeForms = new ArrayList<>(); PrivilegeForm privilegeForm = new PrivilegeForm(privilegeName, ""); privilegeForms.add(privilegeForm); privilegeListForm.setPrivileges(privilegeForms); given().contentType(MediaType.APPLICATION_JSON_VALUE) .accept(acceptHeader) .body(privilegeListForm) .when() .post(getContextBaseUrl() + "/authorization/anonymous/privileges") .peek() .then() .statusCode(HttpStatus.OK.value()) .body(containsString(SUCCESSFUL_ASSIGN_PRIVILEGES)); }
Source:
<code><START> public String getCeTaskUuid() { <END> return ceTaskUuid; }</code><technical_language>replaced benefits Optional return type</technical_language>

Target:
public Optional<String> getCeTaskUuid() { return ofNullable(ceTaskUuid); }
Source:
<code>private String formatForMotorDisplay(String prefix, Double value) { if (value == null) { return ""; } if (advancedMinimalMotorView) { <START> return String.format("%s %.3f", prefix, value); <END> } else { return String.format("%s: %.2f", prefix, value); } }</code><technical_language>room 3dp</technical_language>

Target:
private String formatForMotorDisplay(String prefix, Double value) { if (value == null) { return ""; } if (advancedMinimalMotorView) { return String.format("%s %.3f", prefix, value); } else { return String.format("%s: %.3f", prefix, value); } }
Source:
<code>public void process(final K key, final V value) { final long startNs = time.nanoseconds(); try { processor.process(key, value); } catch (final ClassCastException e) { final String keyClass = key == null ? "unknown because key is null" : key.getClass().getName(); final String valueClass = value == null ? "unknown because value is null" : value.getClass().getName(); throw new StreamsException(String.format("ClassCastException invoking Processor. Do the Processor's " + "input types match the deserialized types? Check the serde setup and change the default serdes in " + "StreamConfig or provide correct serdes via method parameters. Make sure the Processor can accept " + "the deserialized input of type key: %s, and value: %s.%n" + "Note that also although wrong serdes are a common cause of error, the cast exception might have " + "another cause (in user code, for example). For example, if a processor wires in a store, but casts " <START> + "the generics incorrectly, a class cast exception could be raiused during processing, but the " <END> + "cause would not be wrong serdes.", keyClass, valueClass), e); } nodeMetrics.nodeProcessTimeSensor.record(time.nanoseconds() - startNs); }</code><technical_language>suggestion + "the generics incorrectly, a class cast exception raised processing, "</technical_language>

Target:
public void process(final K key, final V value) { final long startNs = time.nanoseconds(); try { processor.process(key, value); } catch (final ClassCastException e) { final String keyClass = key == null ? "unknown because key is null" : key.getClass().getName(); final String valueClass = value == null ? "unknown because value is null" : value.getClass().getName(); throw new StreamsException(String.format("ClassCastException invoking Processor. Do the Processor's " + "input types match the deserialized types? Check the Serde setup and change the default Serdes in " + "StreamConfig or provide correct Serdes via method parameters. Make sure the Processor can accept " + "the deserialized input of type key: %s, and value: %s.%n" + "Note that although incorrect Serdes are a common cause of error, the cast exception might have " + "another cause (in user code, for example). For example, if a processor wires in a store, but casts " + "the generics incorrectly, a class cast exception could be raised during processing, but the " + "cause would not be wrong Serdes.", keyClass, valueClass), e); } nodeMetrics.nodeProcessTimeSensor.record(time.nanoseconds() - startNs); }
Source:
<code>public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError error = response.getError(); <START> if (error != null || object == null) { <END> setResult(IdpResponse.fromError(error == null ? new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, "Facebook graph request failed") : error.getException())); return; } String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException ignored) try { name = object.getString("name"); } catch (JSONException ignored) try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) setResult(createIdpResponse(mResult, email, name, photoUri)); }</code><technical_language>This if statement is a bit packed. conditions error outside. Suggest separate if-return-error statements for error conditions</technical_language>

Target:
public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError error = response.getError(); if (error != null) { setResult(Resource.<IdpResponse>forFailure(new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, error.getException()))); return; } if (object == null) { setResult(Resource.<IdpResponse>forFailure(new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, "Facebook graph request failed"))); return; } String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException ignored) try { name = object.getString("name"); } catch (JSONException ignored) try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) setResult(Resource.forSuccess(createIdpResponse(mResult, email, name, photoUri))); }
Source:
<code>private boolean isPassthrough(String hcid) { String propertyName; NhincConstants.UDDI_SPEC_VERSION specVersion = getOrganizationSpecVersion(hcid); if(specVersion.equals(NhincConstants.UDDI_SPEC_VERSION.SPEC_2_0)) { <START> propertyName = "docquery.20.outboundDocQuery"; <END> } else { propertyName = "docquery.30.outboundDocQuery"; } String propValue = null; try { propValue = getPropAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, propertyName); } catch (PropertyAccessException ex) { LOG.warn("Unable to read property: {})", propertyName, ex); } return NullChecker.isNotNullish(propValue); }</code><technical_language>I feel beneficial constants for this</technical_language>

Target:
private static boolean isPassthrough(String hcid) { String propertyName; NhincConstants.UDDI_SPEC_VERSION specVersion = getOrganizationSpecVersion(hcid); if(specVersion.equals(NhincConstants.UDDI_SPEC_VERSION.SPEC_2_0)) { propertyName = DOC_QUERY_20_MODE_OUT_PROPNAME; } else { propertyName = DOC_QUERY_30_MODE_OUT_PROPNAME; } String propValue = null; try { propValue = getPropAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, propertyName); } catch (PropertyAccessException ex) { LOG.warn("Unable to read property: {})", propertyName, ex); } return NullChecker.isNotNullish(propValue); }
Source:
<code>public Object perform(String name, Object obj, ApiRequest request) { <START> if (obj instanceof MachineDriverRecord) { <END> MachineDriverUpdateInput machineDriverUpdate = request.proxyRequestObject(MachineDriverUpdateInput.class); ((MachineDriverRecord) obj).setMd5checksum(machineDriverUpdate.getmd5checksum()); if (StringUtils.isNotBlank(machineDriverUpdate.getUri())) { ((MachineDriverRecord) obj).setName(machineDriverUpdate.getName()); } if (StringUtils.isNotBlank(machineDriverUpdate.getUri())) { ((MachineDriverRecord) obj).setUri(machineDriverUpdate.getUri()); } ((MachineDriverRecord) obj).setState(CommonStatesConstants.INACTIVE); objectManager.persist(obj); return objectManager.reload(obj); } throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "NotMachineDriver"); }</code><technical_language>do instanceof cast implementation (MachineDriverRecord), interface (MachineDriver)</technical_language>

Target:
public Object perform(String name, Object obj, ApiRequest request) { if (obj instanceof MachineDriver) { MachineDriverUpdateInput machineDriverUpdate = request.proxyRequestObject(MachineDriverUpdateInput.class); MachineDriver driver = ((MachineDriverRecord) obj); driver.setMd5checksum(machineDriverUpdate.getmd5checksum()); if (StringUtils.isNotBlank(machineDriverUpdate.getUri())) { driver.setName(machineDriverUpdate.getName()); } if (StringUtils.isNotBlank(machineDriverUpdate.getUri())) { driver.setUri(machineDriverUpdate.getUri()); } driver.setState(CommonStatesConstants.INACTIVE); DataAccessor.fields(obj).withKey(MachineDriverErrorActionHandler.ERROR_MESSAGE) .set(null); objectManager.persist(obj); return objectManager.reload(obj); } throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "NotMachineDriver"); }
Source:
<code>public void addDriver(Person p) { <START> addDriver(Objects.requireNonNull(p), false); <END> }</code><technical_language>this duplicate nonNull check</technical_language>

Target:
public void addDriver(Person p) { addDriver(p, false); }
Source:
<code>public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { <START> List<EngineBackupLog> logs = multipleResults(entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName)); <END> if (logs.isEmpty()) { return null; } else { return logs.get(0); } }</code><technical_language>1. Do detach returned result intentionally? 2. Instead of multipleResult method returning element of result , query.setMaxResults(1) return singleResult(query). solves (1) also</technical_language>

Target:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { TypedQuery query = entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName); query.setMaxResults(1); EngineBackupLog log = singleResult(query); return log; }
Source:
<code>public String toString() { <START> return "Integration Bus of BoundedContext Name = " + context.getValue(); <END> }</code><technical_language>This outdated</technical_language>

Target:
public String toString() { return "IntegrationBroker of <" + context.getValue() + '>'; }
Source:
<code>public void runQuery(Guid guid) { startProgress("getCount"); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.setHandleFailure(true); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { stopProgress(); AbstractErrataCountModel errataCountModel = (AbstractErrataCountModel) model; VdcQueryReturnValue returnValueObject = (VdcQueryReturnValue) returnValue; ErrataCounts resultEntity = returnValueObject.getReturnValue(); if (resultEntity != null && returnValueObject.getSucceeded()) { <START> errataCountModel.setMessage(null); <END> errataCountModel.setErrataCounts(resultEntity); } else { errataCountModel.setMessage(null); errataCountModel.setMessage( constants.katelloProblemRetrievingErrata() + " " + returnValueObject.getExceptionMessage()); } } }; Frontend.getInstance().runQuery(getQueryType(), new IdQueryParameters(guid), _asyncQuery); }</code><technical_language>statement errataCountModel.setMessage(null); appears in if-else blocks I assume extracted them</technical_language>

Target:
public void runQuery(Guid guid) { startProgress("getCount"); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.setHandleFailure(true); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { stopProgress(); AbstractErrataCountModel errataCountModel = (AbstractErrataCountModel) model; VdcQueryReturnValue returnValueObject = (VdcQueryReturnValue) returnValue; ErrataCounts resultEntity = returnValueObject.getReturnValue(); errataCountModel.setMessage(null); if (resultEntity != null && returnValueObject.getSucceeded()) { errataCountModel.setErrataCounts(resultEntity); } else { errataCountModel.setMessage( constants.katelloProblemRetrievingErrata() + " " + returnValueObject.getExceptionMessage()); } } }; Frontend.getInstance().runQuery(getQueryType(), new IdQueryParameters(guid), _asyncQuery); }
Source:
<code>private void activateDataCenter() { <START> StorageDomain masterDomain = storageDomainDao.getStorageDomains(getStoragePool().getId(), StorageDomainType.Master) .stream() .findFirst() .orElse(null); <END> calcStoragePoolStatusByDomainsStatus(); log.info("Master domain id:'{}' Master domain status:'{}'", masterDomain != null ? masterDomain.getId() : null, masterDomain != null ? masterDomain.getStatus() : null); if (masterDomain != null && (masterDomain.getStatus() == StorageDomainStatus.Active || masterDomain.getStatus() == StorageDomainStatus.Unknown || masterDomain.getStatus() == StorageDomainStatus.Inactive)) { resetSPM(); } }</code><technical_language>This is unrelated patch (and wrong anyway)</technical_language>

Target:
private void activateDataCenter() { StorageDomain masterDomain = storageDomainDao.getStorageDomains(getStoragePool().getId(), StorageDomainType.Master).stream().findFirst().orElse(null); calcStoragePoolStatusByDomainsStatus(); if (masterDomain == null) { log.info("no master domain found"); } else { log.info("Master domain id:'{}' has status:'{}'", masterDomain.getId(), masterDomain.getStatus()); if (masterDomain.getStatus() == StorageDomainStatus.Active || masterDomain.getStatus() == StorageDomainStatus.Unknown || masterDomain.getStatus() == StorageDomainStatus.Inactive) { resetSPM(); } } }
Source:
<code>protected Control createDialogArea(Composite parent) { final GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true); parent.setLayout(new GridLayout(1, true)); parent.setLayoutData(parentData); final ScrolledComposite wrapper = new ScrolledComposite(parent, SWT.V_SCROLL); wrapper.setExpandHorizontal(true); wrapper.setExpandVertical(true); final FillLayout wrapperLayout = new FillLayout(); wrapperLayout.marginHeight = 10; wrapperLayout.marginWidth = 10; wrapper.setLayout(wrapperLayout); wrapper.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); final Composite emfFormsParent = new Composite(wrapper, SWT.NONE); wrapper.setContent(emfFormsParent); emfFormsParent.setLayout(new GridLayout()); try { final VViewModelProperties properties = VViewFactory.eINSTANCE.createViewModelLoadingProperties(); <START> properties.addInheritableProperty("useOnModifyDatabinding", "true"); <END> ECPSWTViewRenderer.INSTANCE.render(emfFormsParent, newObject, properties); } catch (final ECPRendererException e) { } wrapper.setMinSize(wrapper.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return parent; }</code><technical_language>sense create a constant for key</technical_language>

Target:
protected Control createDialogArea(Composite parent) { final GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true); parent.setLayout(new GridLayout(1, true)); parent.setLayoutData(parentData); final ScrolledComposite wrapper = new ScrolledComposite(parent, SWT.V_SCROLL); wrapper.setExpandHorizontal(true); wrapper.setExpandVertical(true); final FillLayout wrapperLayout = new FillLayout(); wrapperLayout.marginHeight = 10; wrapperLayout.marginWidth = 10; wrapper.setLayout(wrapperLayout); wrapper.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); final Composite emfFormsParent = new Composite(wrapper, SWT.NONE); wrapper.setContent(emfFormsParent); emfFormsParent.setLayout(new GridLayout()); try { final VViewModelProperties properties = VViewFactory.eINSTANCE.createViewModelLoadingProperties(); properties.addInheritableProperty(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY, EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE); ECPSWTViewRenderer.INSTANCE.render(emfFormsParent, newObject, properties); } catch (final ECPRendererException e) { } wrapper.setMinSize(wrapper.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return parent; }
Source:
<code>protected List<Object[]> selectIds( SharedSessionContractImplementor session, QueryParameters queryParameters) { List<Object[]> ids = new ArrayList<>(); try { try (PreparedStatement ps = session.getJdbcCoordinator() .getStatementPreparer() .prepareStatement( idSelect, false )) { <START> int sum = 1; <END> for ( ParameterSpecification parameterSpecification : idSelectParameterSpecifications ) { sum += parameterSpecification.bind( ps, queryParameters, session, sum ); } ResultSet rs = session .getJdbcCoordinator() .getResultSetReturn() .extract( ps ); while ( rs.next() ) { Object[] result = new Object[targetedPersister.getIdentifierColumnNames().length]; for ( String columnName : targetedPersister.getIdentifierColumnNames() ) { Object column = rs.getObject( columnName ); result[rs.findColumn( columnName ) - 1] = column; } ids.add( result ); } } } catch ( SQLException e ) { throw convert( e, "could not select ids for bulk operation", idSelect ); } return ids; }</code><technical_language>This variable called position similar</technical_language>

Target:
protected List<Object[]> selectIds( SharedSessionContractImplementor session, QueryParameters queryParameters) { List<Object[]> ids = new ArrayList<>(); try { try (PreparedStatement ps = session.getJdbcCoordinator() .getStatementPreparer() .prepareStatement( idSelect, false )) { int position = 1; for ( ParameterSpecification parameterSpecification : idSelectParameterSpecifications ) { position += parameterSpecification.bind( ps, queryParameters, session, position ); } ResultSet rs = session .getJdbcCoordinator() .getResultSetReturn() .extract( ps ); while ( rs.next() ) { Object[] result = new Object[targetedPersister.getIdentifierColumnNames().length]; for ( String columnName : targetedPersister.getIdentifierColumnNames() ) { Object column = rs.getObject( columnName ); result[rs.findColumn( columnName ) - 1] = column; } ids.add( result ); } } } catch ( SQLException e ) { throw convert( e, "could not select ids for bulk operation", idSelect ); } return ids; }