auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testUnverifiedRowIncludesOnlyEmptyCell() throws Exception { String dataTableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { conn.createStatement().execute("create table " + dataTableName + " (id varchar(10) not null primary key, val1 varchar(10), val2 varchar(10), val3 varchar(10))" + tableDDLOptions); String indexTableName = generateUniqueName(); conn.createStatement().execute("CREATE INDEX " + indexTableName + " on " + dataTableName + " (val1) include (val2, val3)"); IndexRegionObserver.setFailPostIndexUpdatesForTesting(true); conn.createStatement().execute("upsert into " + dataTableName + " (id, val2) values ('a', 'abcc')"); conn.commit(); IndexRegionObserver.setFailPostIndexUpdatesForTesting(false); Table hIndexTable = conn.unwrap(PhoenixConnection.class).getQueryServices() .getTable(Bytes.toBytes(indexTableName)); long indexCnt = TestUtil.getRowCount(hIndexTable, false); assertEquals(1, indexCnt); assertEquals(true, verifyRowsForEmptyColValue(conn, indexTableName, IndexRegionObserver.UNVERIFIED_BYTES)); <START> Scan s = new Scan(); <END> int cntCellValues = 0; try (ResultScanner scanner = hIndexTable.getScanner(s)) { Result result; while ((result = scanner.next()) != null) { CellScanner cellScanner = result.cellScanner(); while (cellScanner.advance()) { cntCellValues++; } } } assertEquals(1, cntCellValues); verifyTableHealth(conn, dataTableName, indexTableName); } }</code><technical_language>nit: nice is this a separate function call. worry</technical_language>

Target:
public void testUnverifiedRowIncludesOnlyEmptyCell() throws Exception { String dataTableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { conn.createStatement().execute("create table " + dataTableName + " (id varchar(10) not null primary key, val1 varchar(10), val2 varchar(10), val3 varchar(10))" + tableDDLOptions); String indexTableName = generateUniqueName(); conn.createStatement().execute("CREATE INDEX " + indexTableName + " on " + dataTableName + " (val1) include (val2, val3)"); IndexRegionObserver.setFailPostIndexUpdatesForTesting(true); conn.createStatement().execute("upsert into " + dataTableName + " (id, val2) values ('a', 'abcc')"); conn.commit(); IndexRegionObserver.setFailPostIndexUpdatesForTesting(false); checkUnverifiedCellCount(conn, indexTableName); verifyTableHealth(conn, dataTableName, indexTableName); } }
Source:
<code>public void updateEntry(DocumentModel docModel) throws DirectoryException { checkPermission(SecurityConstants.WRITE); List<String> referenceFieldList = updateEntryWithoutReferences(docModel); for (String referenceFieldName : referenceFieldList) { List<Reference> references = directory.getReferences(referenceFieldName); if (references.size() > 1) { log.warn("Directory " + getDirectory().getName() + " cannot update field " + referenceFieldName + " for entry " + docModel.getId() + ": this field is associated with more than one reference"); } else { Reference reference = references.get(0); @SuppressWarnings("unchecked") List<String> targetIds = (List<String>) docModel.getProperty(schemaName, referenceFieldName); <START> if (reference.getClass() == referenceClassName) { <END> reference.setTargetIdsForSource(docModel.getId(), targetIds, this); } else { reference.setTargetIdsForSource(docModel.getId(), targetIds); } } } getDirectory().invalidateCaches(); }</code><technical_language>question createEntry</technical_language>

Target:
public void updateEntry(DocumentModel docModel) throws DirectoryException { checkPermission(SecurityConstants.WRITE); List<String> referenceFieldList = updateEntryWithoutReferences(docModel); for (String referenceFieldName : referenceFieldList) { List<Reference> references = directory.getReferences(referenceFieldName); if (references.size() > 1) { if (log.isWarnEnabled()) { log.warn("Directory " + getDirectory().getName() + " cannot update field " + referenceFieldName + " for entry " + docModel.getId() + ": this field is associated with more than one reference"); } } else { Reference reference = references.get(0); @SuppressWarnings("unchecked") List<String> targetIds = (List<String>) docModel.getProperty(schemaName, referenceFieldName); if (reference.getClass() == referenceClass) { reference.setTargetIdsForSource(docModel.getId(), targetIds, this); } else { reference.setTargetIdsForSource(docModel.getId(), targetIds); } } } getDirectory().invalidateCaches(); }
Source:
<code>public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection counts; try { counts = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } final List<Double> coverage = Doubles.asList(counts.counts().getColumn(0)); final List<SimpleInterval> intervals = counts.targets().stream().map(Target::getInterval).collect(Collectors.toList()); final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, intervals, coverage); <START> final List<Pair<SimpleInterval, Double>> intervalLog2CoveragePairs = segmenter.findSegments(); <END> final TargetCollection<SimpleInterval> tc = new HashedListTargetCollection<>(intervals); final List<ModeledSegment> segments = intervalLog2CoveragePairs.stream().map(pair -> new ModeledSegment(pair.getLeft(), tc.targetCount(pair.getLeft()), Math.pow(2, pair.getRight()))).collect(Collectors.toList()); SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }</code><technical_language>Conversion of List<Pair<SimpleInterval, Double>> List<ModeledSegment> moved a method CopyRatioSegmenter</technical_language>

Target:
public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection rcc; try { rcc = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, rcc); final List<ModeledSegment> segments = segmenter.getModeledSegments(); SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, false); return "SUCCESS"; }
Source:
<code>public static Collection<String> replaceWith(String propertyName, List<?> items, String separator, int maxNumberOfPrintedItems) { <START> int size = Math.min(maxNumberOfPrintedItems, items.size()); <END> List<String> printedItems = new ArrayList<String>(size); for (int i = 0; i < size; i++) { printedItems.add(String.format("\t%s", String.valueOf(items.get(i)))); } if (items.size() > maxNumberOfPrintedItems) { printedItems.add("\t..."); } ArrayList<String> replacements = new ArrayList<String>(); replacements.add(MessageFormat.format("${0} {1}", propertyName, StringUtils.join(printedItems, separator))); replacements.add(MessageFormat.format("${0}_COUNTER {1}", propertyName, items.size())); return replacements; }</code><technical_language>enforce input correctness ? i.e. org.apache.commons.lang.Validate.isTrue(maxNumberOfPrintedItems >= 0);</technical_language>

Target:
public static Collection<String> replaceWith(String propertyName, List<?> items, String separator, int maxNumberOfPrintedItems) { Validate.isTrue(maxNumberOfPrintedItems >= 0); int size = Math.min(maxNumberOfPrintedItems, items.size()); List<String> printedItems = new ArrayList<String>(size); for (int i = 0; i < size; i++) { printedItems.add(String.format("\t%s", String.valueOf(items.get(i)))); } if (items.size() > maxNumberOfPrintedItems) { printedItems.add("\t..."); } ArrayList<String> replacements = new ArrayList<String>(); replacements.add(MessageFormat.format("${0} {1}", propertyName, StringUtils.join(printedItems, separator))); replacements.add(MessageFormat.format("${0}_COUNTER {1}", propertyName, items.size())); return replacements; }
Source:
<code>public void setCheckbox(WebBrowserConfig webBrowserConfig, String url) throws MalformedURLException { UICheckbox saveHostName = find("saveHostName", UICheckbox.class); if (saveHostName != null) { saveHostName.setChecked(false); String hostName = new URL(url).getHost(); saveHostName.subscribe(checkbox -> { boolean isTrustedHostName = saveHostName.isChecked(); if (isTrustedHostName) { webBrowserConfig.addTrustedHostName(hostName); } else { webBrowserConfig.removeTrustedHostName(hostName); } }); UICheckbox saveUrl = find("saveUrl", UICheckbox.class); <START> if (saveUrl != null) { <END> saveUrl.setChecked(false); saveUrl.subscribe(checkbox -> { boolean isTrustedUrl = saveUrl.isChecked(); if (isTrustedUrl) { webBrowserConfig.addTrustedUrls(url); } else { webBrowserConfig.removeTrustedUrl(url); } }); } } }</code><technical_language>I highly doubt this nested in saveHostName if. separate imo</technical_language>

Target:
public void setCheckbox(WebBrowserConfig webBrowserConfig, String url) throws MalformedURLException { UICheckbox saveHostName = find("saveHostName", UICheckbox.class); if (saveHostName != null) { saveHostName.setChecked(false); String hostName = new URL(url).getHost(); saveHostName.subscribe(checkbox -> { boolean isTrustedHostName = saveHostName.isChecked(); if (isTrustedHostName) { webBrowserConfig.addTrustedHostName(hostName); } else { webBrowserConfig.removeTrustedHostName(hostName); } }); } UICheckbox saveUrl = find("saveUrl", UICheckbox.class); if (saveUrl != null) { saveUrl.setChecked(false); saveUrl.subscribe(checkbox -> { boolean isTrustedUrl = saveUrl.isChecked(); if (isTrustedUrl) { webBrowserConfig.addTrustedUrls(url); } else { webBrowserConfig.removeTrustedUrl(url); } }); } }
Source:
<code><START> public List<String> getColumnAliases() <END> { return createTableColumnAliases; }</code><technical_language>Optional<List<String>></technical_language>

Target:
public Optional<List<Identifier>> getColumnAliases() { return createTableColumnAliases; }
Source:
<code><START> public static HadoopSecurityManager loadHadoopSecurityManager(Props props, Logger log) <END> throws RuntimeException { Class<?> hadoopSecurityManagerClass = props.getClass(HADOOP_SECURITY_MANAGER_CLASS_PARAM, true, HadoopJobUtils.class.getClassLoader()); log.info("Loading hadoop security manager " + hadoopSecurityManagerClass.getName()); HadoopSecurityManager hadoopSecurityManager = null; try { Method getInstanceMethod = hadoopSecurityManagerClass.getMethod("getInstance", Props.class); hadoopSecurityManager = (HadoopSecurityManager) getInstanceMethod.invoke( hadoopSecurityManagerClass, props); } catch (InvocationTargetException e) { log.error("Could not instantiate Hadoop Security Manager " + hadoopSecurityManagerClass.getName() + e.getCause()); throw new RuntimeException(e.getCause()); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getCause()); } return hadoopSecurityManager; }</code><technical_language>This method throw exception caller decide do exception. is necessary in Logger</technical_language>

Target:
public static HadoopSecurityManager loadHadoopSecurityManager(Props props, Logger log) throws RuntimeException { Class<?> hadoopSecurityManagerClass = props.getClass(HADOOP_SECURITY_MANAGER_CLASS_PARAM, true, HadoopJobUtils.class.getClassLoader()); log.info("Loading hadoop security manager " + hadoopSecurityManagerClass.getName()); HadoopSecurityManager hadoopSecurityManager = null; try { Method getInstanceMethod = hadoopSecurityManagerClass.getMethod("getInstance", Props.class); hadoopSecurityManager = (HadoopSecurityManager) getInstanceMethod.invoke( hadoopSecurityManagerClass, props); } catch (InvocationTargetException e) { String errMsg = "Could not instantiate Hadoop Security Manager " + hadoopSecurityManagerClass.getName() + e.getCause(); log.error(errMsg); throw new RuntimeException(errMsg, e); } catch (Exception e) { throw new RuntimeException(e); } return hadoopSecurityManager; }
Source:
<code>boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; ResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); if (client.isFinished()) { QueryStatusInfo finalStatusInfo = client.finalStatusInfo(); if (finalStatusInfo.getError() != null) { throw resultsException(finalStatusInfo); } } executingClient.set(client); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } <START> while (resultSet.next()) { <END> } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); warning.set(fromPrestoWarnings(client.finalStatusInfo().getWarnings())); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }</code><technical_language>spurious formatting change</technical_language>

Target:
final boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; PrestoResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); if (client.isFinished()) { QueryStatusInfo finalStatusInfo = client.finalStatusInfo(); if (finalStatusInfo.getError() != null) { throw resultsException(finalStatusInfo); } } executingClient.set(client); WarningsManager warningsManager = new WarningsManager(); currentWarningsManager.set(Optional.of(warningsManager)); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer, warningsManager); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } while (resultSet.next()) { } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); warningsManager.addWarnings(client.finalStatusInfo().getWarnings()); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }
Source:
<code>boolean updateOomAdjLocked(ProcessRecord app, boolean oomAdjAll, String oomAdjReason) { <START> if (app == null || app.thread == null) { <END> return false; } final ProcessRecord TOP_APP = mService.getTopAppLocked(); final boolean wasCached = app.cached; mAdjSeq++; final int cachedAdj = app.getCurRawAdj() >= ProcessList.CACHED_APP_MIN_ADJ ? app.getCurRawAdj() : ProcessList.UNKNOWN_ADJ; boolean success = updateOomAdjLocked(app, cachedAdj, TOP_APP, false, SystemClock.uptimeMillis()); if (oomAdjAll && (wasCached != app.cached || app.getCurRawAdj() == ProcessList.UNKNOWN_ADJ)) { updateOomAdjLocked(oomAdjReason); } return success; }</code><technical_language>need add line 211 here, if this process is gone, other app's procstate/adj get impacted due this if (oomAdjAll) { updateOomAdjLocked(oomAdjReason); }</technical_language>

Target:
boolean updateOomAdjLocked(ProcessRecord app, boolean oomAdjAll, String oomAdjReason) { if (app == null || app.thread == null) { if (oomAdjAll) { updateOomAdjLocked(oomAdjReason); } return false; } final ProcessRecord TOP_APP = mService.getTopAppLocked(); final boolean wasCached = app.cached; mAdjSeq++; final int cachedAdj = app.getCurRawAdj() >= ProcessList.CACHED_APP_MIN_ADJ ? app.getCurRawAdj() : ProcessList.UNKNOWN_ADJ; boolean success = updateOomAdjLocked(app, cachedAdj, TOP_APP, false, SystemClock.uptimeMillis()); if (oomAdjAll && (wasCached != app.cached || app.getCurRawAdj() == ProcessList.UNKNOWN_ADJ)) { updateOomAdjLocked(oomAdjReason); } return success; }
Source:
<code>public void ensureVolumeAndBucketExist(OzoneConfiguration ozoneConfiguration, String volumeName, String bucketName) throws IOException { try (OzoneClient rpcClient = OzoneClientFactory .getRpcClient(ozoneConfiguration)) { OzoneVolume volume = null; try { volume = rpcClient.getObjectStore().getVolume(volumeName); } catch (OMException ex) { if (ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) { <START> rpcClient.getObjectStore().createVolume(volumeName); <END> volume = rpcClient.getObjectStore().getVolume(volumeName); } } try { volume.getBucket(bucketName); } catch (OMException ex) { if (ex.getResult() == ResultCodes.BUCKET_NOT_FOUND) { volume.createBucket(bucketName); } } } }</code><technical_language>I ex rethrown in else</technical_language>

Target:
public void ensureVolumeAndBucketExist(OzoneConfiguration ozoneConfiguration, String volumeName, String bucketName) throws IOException { try (OzoneClient rpcClient = OzoneClientFactory .getRpcClient(ozoneConfiguration)) { OzoneVolume volume = null; try { volume = rpcClient.getObjectStore().getVolume(volumeName); } catch (OMException ex) { if (ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) { rpcClient.getObjectStore().createVolume(volumeName); volume = rpcClient.getObjectStore().getVolume(volumeName); } else { throw ex; } } try { volume.getBucket(bucketName); } catch (OMException ex) { if (ex.getResult() == ResultCodes.BUCKET_NOT_FOUND) { volume.createBucket(bucketName); } throw ex; } } }
Source:
<code>public void doQuery(List<ITmfStateInterval> currentStateInfo, long t) throws TimeRangeException, StateSystemDisposedException { super.doQuery(currentStateInfo, t); if (isFinishedBuilding()) { return; } <START> for (int i = 0; i < fCache.size(); i++) { ITmfStateInterval interval = fCache.get(i); if (interval.intersects(t)) { currentStateInfo.set(i, interval); } } <END> List<@NonNull Integer> quarks = new ArrayList<>(); for (int i = 0; i < currentStateInfo.size(); i++) { if (currentStateInfo.get(i) == null) { quarks.add(i); } } if (!quarks.isEmpty()) { for (ITmfStateInterval interval : query2D(IntegerRangeCondition.forDiscreteRange(quarks), TimeRangeCondition.singleton(t))) { currentStateInfo.set(interval.getAttribute(), interval); } } fCache = new ArrayList<>(currentStateInfo); }</code><technical_language>full query parent class done a lines above, mix this for for for unassigned quarks below</technical_language>

Target:
public void doQuery(List<ITmfStateInterval> currentStateInfo, long t) throws TimeRangeException, StateSystemDisposedException { for (int i = 0; i < fCache.size(); i++) { ITmfStateInterval interval = fCache.get(i); if (interval.intersects(t)) { currentStateInfo.set(i, interval); } } super.doQuery(currentStateInfo, t); if (!isFinishedBuilding()) { List<@NonNull Integer> quarks = new ArrayList<>(); for (int i = 0; i < currentStateInfo.size(); i++) { if (currentStateInfo.get(i) == null) { quarks.add(i); } } if (!quarks.isEmpty()) { for (ITmfStateInterval interval : query2D(IntegerRangeCondition.forDiscreteRange(quarks), TimeRangeCondition.singleton(t))) { currentStateInfo.set(interval.getAttribute(), interval); } } } fCache = new ArrayList<>(currentStateInfo); }
Source:
<code>protected ClaimedTaskRest action(Context context, HttpServletRequest request, Integer id) throws SQLException, IOException, AuthorizeException { ClaimedTask task = null; task = claimedTaskService.find(context, id); XmlWorkflowServiceFactory factory = (XmlWorkflowServiceFactory) XmlWorkflowServiceFactory.getInstance(); Workflow workflow; try { workflow = factory.getWorkflowFactory().getWorkflow(task.getWorkflowItem().getCollection()); Step step = workflow.getStep(task.getStepID()); WorkflowActionConfig currentActionConfig = step.getActionConfig(task.getActionID()); workflowService .doState(context, context.getCurrentUser(), request, task.getWorkflowItem().getID(), workflow, currentActionConfig); if (!Action.getErrorFields(request).isEmpty()) { throw new UnprocessableEntityException("Missing required fields"); } context.addEvent(new Event(Event.MODIFY, Constants.ITEM, task.getWorkflowItem().getItem().getID(), null, itemService.getIdentifiers(context, task.getWorkflowItem().getItem()))); } catch (WorkflowConfigurationException | MessagingException | WorkflowException e) { <START> throw new RuntimeException(e.getMessage(), e); <END> } return null; }</code><technical_language>return a more useful error here. "Could claim task ID" + id</technical_language>

Target:
protected ClaimedTaskRest action(Context context, HttpServletRequest request, Integer id) throws SQLException, IOException { ClaimedTask task = null; task = claimedTaskService.find(context, id); if (task == null) { throw new ResourceNotFoundException("ClaimedTask ID " + id + " not found"); } XmlWorkflowServiceFactory factory = (XmlWorkflowServiceFactory) XmlWorkflowServiceFactory.getInstance(); Workflow workflow; try { workflow = factory.getWorkflowFactory().getWorkflow(task.getWorkflowItem().getCollection()); Step step = workflow.getStep(task.getStepID()); WorkflowActionConfig currentActionConfig = step.getActionConfig(task.getActionID()); workflowService .doState(context, context.getCurrentUser(), request, task.getWorkflowItem().getID(), workflow, currentActionConfig); if (!Action.getErrorFields(request).isEmpty()) { throw new UnprocessableEntityException( "Missing required fields: " + StringUtils.join(Action.getErrorFields(request), ",")); } } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (WorkflowException e) { throw new UnprocessableEntityException( "Invalid workflow action: " + e.getMessage(), e); } catch (WorkflowConfigurationException | MessagingException e) { throw new RuntimeException(e.getMessage(), e); } return null; }
Source:
<code>public void reloadEditableWidget() { <START> IDOMModel dom = (IDOMModel)underLyingModel; <END> Document document = dom.getDocument(); editableWidget.reload(document.getDocumentElement()); }</code><technical_language>is a chance underlyingModel null is lazily initialized. reload if underlying model exists</technical_language>

Target:
public void reloadEditableWidget() { if (underLyingModel != null) { IDOMModel dom = (IDOMModel) underLyingModel; Document document = dom.getDocument(); editableWidget.reload(document.getDocumentElement()); } }
Source:
<code>protected void onInit() { Assert.state(this.zeroMqProxy == null || this.connectSendUrl == null, <START> "Or 'zeroMqProxy' or 'connectUrl' can be provided (or none), but not both."); <END> super.onInit(); this.sendSocket.subscribe(); this.initialized = true; }</code><technical_language>suggestion "A 'zeroMqProxy' 'connectUrl' provided (or none), both.");</technical_language>

Target:
protected void onInit() { Assert.state(this.zeroMqProxy == null || this.connectSendUrl == null, "A 'zeroMqProxy' or 'connectUrl' can be provided (or none), but not both."); super.onInit(); this.sendSocket.subscribe(); this.initialized = true; }
Source:
<code>public static VectorGenerator zero(int size) { <START> return constant(VectorUtils.of(new double[size])); <END> }</code><technical_language>I guess VectorUtils.zeroes(size) here</technical_language>

Target:
public static VectorGenerator zero(int size) { return constant(VectorUtils.zeroes(size)); }
Source:
<code><START> static BindingPolicy getPolicyFromMexResponseForIntegrated(String mexResponse) throws Exception { <END> DocumentBuilderFactory builderFactory = SafeDocumentBuilderFactory.createInstance(); builderFactory.setNamespaceAware(true); DocumentBuilder builder = builderFactory.newDocumentBuilder(); Document xmlDocument = builder.parse(new ByteArrayInputStream(mexResponse.getBytes(Charset.forName("UTF-8")))); XPath xPath = XPathFactory.newInstance().newXPath(); NamespaceContextImpl nameSpace = new NamespaceContextImpl(); xPath.setNamespaceContext(nameSpace); String xpathExpression = " Map<String, BindingPolicy> policies = selectIntegratedPoliciesWithExpression(xmlDocument, xPath, xpathExpression); if (policies.isEmpty()) { log.debug("No matching policies"); return null; } else { Map<String, BindingPolicy> bindings = getMatchingBindings(xmlDocument, xPath, policies); if (bindings.isEmpty()) { log.debug("No matching bindings"); return null; } else { getPortsForPolicyBindings(xmlDocument, xPath, bindings, policies); return selectSingleMatchingPolicy(policies); } } }</code><technical_language>refactor this function a lot of is code duplication of getWsTrustEndpointFromMexResponse function</technical_language>

Target:
static BindingPolicy getPolicyFromMexResponseForIntegrated(String mexResponse) throws Exception { Document xmlDocument = createDocument(mexResponse); NamespaceContextImpl nameSpace = new NamespaceContextImpl(); XPath xPath = createXpath(nameSpace); String xpathExpression = " Map<String, BindingPolicy> policies = selectIntegratedPoliciesWithExpression(xmlDocument, xPath, xpathExpression); return processPolicies(policies, xmlDocument, xPath); }
Source:
<code>private boolean isPortVisible(String hostname, int port, int timeout) { boolean exitStatus = false; Socket s = null; String reason = null; try { s = new Socket(); s.setReuseAddress(true); SocketAddress sa = new InetSocketAddress(hostname, port); s.connect(sa, timeout); } catch (IOException e) { if (e.getMessage().equals("Connection refused")) { reason = "port " + port + " on " + hostname + " is closed."; } if (e instanceof UnknownHostException) { reason = "node " + hostname + " is unresolved."; } if (e instanceof SocketTimeoutException) { reason = "timeout while attempting to reach node " + hostname + " on port " + port; } <START> } finally { <END> if (s != null) { if (s.isConnected()) { LOGGER.info("Port " + port + " on " + hostname + " is reachable!"); exitStatus = true; } else { LOGGER.warning("Port " + port + " on " + hostname + " is not reachable; reason: " + reason); } try { s.close(); } catch (IOException e) { LOGGER.warning(e.getMessage()); } } } return exitStatus; }</code><technical_language>sense suppress other exceptions (runtime&Co)</technical_language>

Target:
private boolean isPortVisible(String hostname, int port, int timeout) { boolean exitStatus = false; Socket s = null; try { s = new Socket(); s.setReuseAddress(true); SocketAddress sa = new InetSocketAddress(hostname, port); s.connect(sa, timeout); } catch (IOException e) { LOGGER.warning(e.getMessage()); } finally { if (s != null) { if (s.isConnected()) { exitStatus = true; } try { s.close(); } catch (IOException e) { LOGGER.warning(e.getMessage()); } } } return exitStatus; }
Source:
<code>public void warmingCacheShouldNotPlaceUndueLoadOnTransactionService() throws Exception { long valuesToInsert = 1_000_000; doAnswer((invocation) -> { Collection<Long> timestamps = ((Collection<Long>) invocation.getArguments()[0]); if (timestamps.size() > 5_000) { fail("Requested more timestamps in a batch than is reasonable!"); } return timestamps.stream().collect(Collectors.toMap(n -> n, n -> n)); }).when(mockTransactionService).get(any()); TLongSet initialTimestamps = new TLongHashSet(); initialTimestamps.addAll(LongStream.range(0, valuesToInsert).boxed().collect(Collectors.toList())); CommitTsLoader loader = CommitTsLoader.create(mockTransactionService, initialTimestamps); assertThat(loader.load(valuesToInsert - 1)).isEqualTo(valuesToInsert - 1); <START> verify(mockTransactionService, atLeast(2)).get(any()); <END> }</code><technical_language>Is this avoid assuming 5000 batch size? checked explicitly above. prefer batch size protected refer directly</technical_language>

Target:
public void warmingCacheShouldNotPlaceUndueLoadOnTransactionService() throws Exception { long valuesToInsert = 1_000_000; doAnswer((invocation) -> { Collection<Long> timestamps = ((Collection<Long>) invocation.getArguments()[0]); if (timestamps.size() > AtlasDbConstants.TRANSACTION_TIMESTAMP_LOAD_BATCH_LIMIT) { fail("Requested more timestamps in a batch than is reasonable!"); } return timestamps.stream().collect(Collectors.toMap(n -> n, n -> n)); }).when(mockTransactionService).get(any()); TLongSet initialTimestamps = new TLongHashSet(); initialTimestamps.addAll(LongStream.range(0, valuesToInsert).boxed().collect(Collectors.toList())); CommitTsLoader loader = CommitTsLoader.create(mockTransactionService, initialTimestamps); assertThat(loader.load(valuesToInsert - 1)).isEqualTo(valuesToInsert - 1); }
Source:
<code>public Stream<BooleanResult> manualIndexDrop( @Name( "indexName" ) String legacyIndexName ) { IndexManager mgr = graphDatabaseAPI.index(); <START> List<BooleanResult> results = new ArrayList<>( 2 ); <END> if ( mgr.existsForNodes( legacyIndexName ) ) { Index<Node> index = mgr.forNodes( legacyIndexName ); results.add( new BooleanResult( true ) ); index.delete(); } if ( mgr.existsForRelationships( legacyIndexName ) ) { RelationshipIndex index = mgr.forRelationships( legacyIndexName ); results.add( new BooleanResult( true ) ); index.delete(); } if ( results.isEmpty() ) { results.add( new BooleanResult( false ) ); } return results.stream(); }</code><technical_language>Stream#of() well</technical_language>

Target:
public Stream<LegacyIndexInfo> manualIndexDrop( @Name( "indexName" ) String legacyIndexName ) { IndexManager mgr = graphDatabaseAPI.index(); List<LegacyIndexInfo> results = new ArrayList<>( 2 ); if ( mgr.existsForNodes( legacyIndexName ) ) { Index<Node> index = mgr.forNodes( legacyIndexName ); results.add( new LegacyIndexInfo( "NODE", legacyIndexName, mgr.getConfiguration( index ) ) ); index.delete(); } if ( mgr.existsForRelationships( legacyIndexName ) ) { RelationshipIndex index = mgr.forRelationships( legacyIndexName ); results.add( new LegacyIndexInfo( "RELATIONSHIP", legacyIndexName, mgr.getConfiguration( index ) ) ); index.delete(); } return results.stream(); }
Source:
<code>public void createConfigurationSource(String dest) throws FileNotFoundException, UnsupportedEncodingException { StringBuilder source = new StringBuilder(""); source.append(GenerationTemplates.cppInclude(ThreadConfigurationClassName.toLowerCase())); source.append(GenerationTemplates.cppInclude(RuntimeTemplates.RuntimeHeaderName)); source.append("\n\n"); List<String> templateParams = new ArrayList<String>(); templateParams.add(ConfiguratedThreadedRuntimeName); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntime, <START> RuntimeTemplates.RuntimeIterfaceName, templateParams)); <END> source.append("\n\n"); source.append(GenerationTemplates.putNamespace( FunctionTemplates.simpleFunctionDecl(RuntimeTemplates.UsingRuntime, CreatorFunction) + ";", NamespaceName)); Shared.writeOutSource(dest, GenerationTemplates.headerName(ConfigurationFile), Shared.format(HeaderTemplates.headerGuard(source.toString(), ConfigurationFile))); Shared.writeOutSource(dest, GenerationTemplates.sourceName(ConfigurationFile), Shared.format(createDeplyomentFunctionDefinition())); }</code><technical_language>Typo, Interface</technical_language>

Target:
public void createConfigurationSource(String dest) throws FileNotFoundException, UnsupportedEncodingException { StringBuilder source = new StringBuilder(""); source.append(GenerationTemplates.cppInclude(ThreadConfigurationClassName.toLowerCase())); source.append(GenerationTemplates.cppInclude(RuntimeTemplates.RuntimeHeaderName)); source.append("\n\n"); List<String> templateParams = new ArrayList<String>(); templateParams.add(ConfiguratedThreadedRuntimeName); source.append(GenerationTemplates.usingTemplateType(RuntimeTemplates.UsingRuntime, RuntimeTemplates.RuntimeInterfaceName, templateParams)); source.append("\n\n"); source.append(GenerationTemplates.putNamespace( FunctionTemplates.simpleFunctionDecl(RuntimeTemplates.UsingRuntime, CreatorFunction) + ";", NamespaceName)); Shared.writeOutSource(dest, GenerationTemplates.headerName(ConfigurationFile), Shared.format(HeaderTemplates.headerGuard(source.toString(), ConfigurationFile))); Shared.writeOutSource(dest, GenerationTemplates.sourceName(ConfigurationFile), Shared.format(createDeplyomentFunctionDefinition())); }
Source:
<code>public static BaseEdit fromEdit(Edit e) { BaseEdit goe = new BaseEdit(e.getBeginA(), e.getEndA(), e.getBeginB(), e.getEndB()); <START> if (e instanceof ReplaceEdit) { <END> ReplaceEdit re = (ReplaceEdit) e; List<BaseEdit> intlEdits = BaseEdit.fromEditList(re.getInternalEdits()); goe = new com.google.gerrit.prettify.common.ReplaceEdit(goe, intlEdits); } return goe; }</code><technical_language>remove ReplaceEdit. private hacked class</technical_language>

Target:
public static BaseEdit fromEdit(Edit e) { BaseEdit goe = new BaseEdit(e.getBeginA(), e.getEndA(), e.getBeginB(), e.getEndB()); return goe; }
Source:
<code>public void rebuildIndex(String entityTypeId) { Repository<Entity> repository = dataService.getRepository(entityTypeId); if (!repository.getCapabilities().contains(RepositoryCapability.INDEXABLE)) { <START> throw new MolgenisPermissionException("Repository [" + entityTypeId + "] is not an indexed repository"); <END> } indexService.rebuildIndex(repository); }</code><technical_language>is this a PermissionException? is message coded</technical_language>

Target:
public void rebuildIndex(String entityTypeId) { Repository<Entity> repository = dataService.getRepository(entityTypeId); if (!repository.getCapabilities().contains(RepositoryCapability.INDEXABLE)) { throw new RepositoryNotIndexedException(repository.getEntityType()); } indexService.rebuildIndex(repository); }
Source:
<code>protected void reallocateDanglingConcepts(Taxonomy taxonomy, TaxonConcept principal) { <START> List<TaxonConcept> accepted = this.getConcepts().stream().filter(tc -> tc.isFormal() && tc.hasAccepted()).collect(Collectors.toList()); <END> if (principal != null) { List<TaxonConcept> reallocated = new ArrayList<>(); boolean owned = principal.isOwned(); for (TaxonConcept tc : accepted) if (tc != principal && !tc.isOwned() && (owned || !tc.isAuthored())) { if (tc.isAuthored()) tc.addInferredSynonym(principal, taxonomy); else { principal.reallocate(tc, taxonomy); reallocated.add(tc); } } this.removeConcepts(reallocated); taxonomy.count("count.resolve.scientificName.principal"); } }</code><technical_language>this side-effects? a performance benefit moving of if condition below</technical_language>

Target:
protected void reallocateDanglingConcepts(Taxonomy taxonomy, TaxonConcept principal) { if (principal != null) { List<TaxonConcept> accepted = this.getConcepts().stream().filter(tc -> tc.isFormal() && tc.hasAccepted()).collect(Collectors.toList()); List<TaxonConcept> reallocated = new ArrayList<>(); boolean owned = principal.isOwned(); for (TaxonConcept tc : accepted) if (tc != principal && !tc.isOwned() && (owned || !tc.isAuthored())) { if (tc.isAuthored()) tc.addInferredSynonym(principal, taxonomy); else { principal.reallocate(tc, taxonomy); reallocated.add(tc); } } this.removeConcepts(reallocated); taxonomy.count("count.resolve.scientificName.principal"); } }
Source:
<code><START> public List<CertificateEvent> createEventsFromArende(String certificateId, LocalDateTime afterTimestamp) { <END> List<CertificateEvent> events = new ArrayList<>(); List<Arende> messages = new ArrayList<>(); if (afterTimestamp != null) { messages = arendeService.getArendenInternal(certificateId).stream().filter(m -> m.getTimestamp().isAfter(afterTimestamp)) .collect(Collectors.toList()); } else { messages = arendeService.getArendenInternal(certificateId); } if (!messages.isEmpty()) { for (Arende message : messages) { String sentBy = message.getSkickatAv() != null ? message.getSkickatAv() : UNKNOWN_USER; if (message.getSvarPaId() != null || message.getSvarPaReferens() != null) { events.add(save(certificateId, sentBy, EventCode.NYSVFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYSVFM))); } else { if (message.getPaminnelseMeddelandeId() != null) { events.add(save(certificateId, sentBy, EventCode.PAMINNELSE, message.getTimestamp())); } else if (message.getAmne() == ArendeAmne.KOMPLT) { events.add(save(certificateId, sentBy, EventCode.KOMPLBEGARAN, message.getTimestamp())); } else { events.add(save(certificateId, sentBy, EventCode.NYFRFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYFRFM))); } } } } return events; }</code><technical_language>this public</technical_language>

Target:
private List<CertificateEvent> createEventsFromArende(String certificateId, LocalDateTime afterTimestamp) { List<CertificateEvent> events = new ArrayList<>(); List<Arende> messages = new ArrayList<>(); if (afterTimestamp != null) { messages = arendeService.getArendenInternal(certificateId).stream().filter(m -> m.getTimestamp().isAfter(afterTimestamp)) .collect(Collectors.toList()); } else { messages = arendeService.getArendenInternal(certificateId); } if (!messages.isEmpty()) { for (Arende message : messages) { String sentBy = message.getSkickatAv() != null ? message.getSkickatAv() : UNKNOWN_USER; if (message.getSvarPaId() != null || message.getSvarPaReferens() != null) { events.add(save(certificateId, sentBy, EventCode.NYSVFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYSVFM))); } else { if (message.getPaminnelseMeddelandeId() != null) { events.add(save(certificateId, sentBy, EventCode.PAMINNELSE, message.getTimestamp())); } else if (message.getAmne() == ArendeAmne.KOMPLT) { events.add(save(certificateId, sentBy, EventCode.KOMPLBEGARAN, message.getTimestamp())); } else { events.add(save(certificateId, sentBy, EventCode.NYFRFM, message.getTimestamp(), getTitleForMessage(message, EventCode.NYFRFM))); } } } } return events; }
Source:
<code>public LoadData<String> buildLoadData(String s, int width, int height, Options options) { <START> return new LoadData(new ObjectKey(System.currentTimeMillis()), new CloudIconDataFetcher(context, s)); <END> }</code><technical_language>Type inferance missing, please new LoadData<>(...);</technical_language>

Target:
public LoadData<Bitmap> buildLoadData(String s, int width, int height, Options options) { return new LoadData<>(new ObjectKey(System.currentTimeMillis()), new CloudIconDataFetcher(context, s, width, height)); }
Source:
<code>public String read(ByteBuffer binary) throws IOException, ClassNotFoundException { byte[] bytes = new byte[binary.remaining()]; binary.get(bytes); String s = new String(bytes, CHARSET); <START> LOG.info("deserialized {}", s); <END> return s; }</code><technical_language>need for logging</technical_language>

Target:
public String read(ByteBuffer binary) throws IOException, ClassNotFoundException { byte[] bytes = new byte[binary.remaining()]; binary.get(bytes); return new String(bytes, CHARSET); }
Source:
<code>public static <D, T, S> Result<D, T, S> apply(final List<D> data, final List<T> positions, final HiddenMarkovModel<D, T, S> model) { Utils.nonNull(data); Utils.nonNull(positions); Utils.nonNull(model); final List<D> dataList = Collections.unmodifiableList(new ArrayList<>(data)); final List<T> positionList = Collections.unmodifiableList(new ArrayList<>(positions)); if (dataList.size() != positionList.size()) { throw new IllegalArgumentException("the data sequence and position sequence must have the same number of elements"); } final List<S> states = model.hiddenStates(); <START> Utils.nonNull(states, "the model hidden state list cannot be null"); <END> if (states.size() == 0) { throw new IllegalArgumentException("the model hidden state list must contain at least one element"); } final double[] forwardProbabilities = calculateLogForwardProbabilities(model, dataList, positionList); final double[] backwardProbabilities = calculateLogBackwardProbabilities(model, dataList, positionList); return new ArrayResult<>(dataList, positionList, model, forwardProbabilities, backwardProbabilities); }</code><technical_language>HiddenMarkovModel (or implementations) enforce this</technical_language>

Target:
public static <D, T, S> Result<D, T, S> apply(final List<D> data, final List<T> positions, final HiddenMarkovModel<D, T, S> model) { Utils.nonNull(data, "the input data sequence cannot be null."); Utils.nonNull(positions, "the input position sequence cannot be null."); Utils.nonNull(model, "the input model cannot be null"); final List<D> dataList = Collections.unmodifiableList(new ArrayList<>(data)); final List<T> positionList = Collections.unmodifiableList(new ArrayList<>(positions)); if (dataList.size() != positionList.size()) { throw new IllegalArgumentException("the data sequence and position sequence must have the same number of elements"); } final double[][] forwardProbabilities = calculateLogForwardProbabilities(model, dataList, positionList); final double[][] backwardProbabilities = calculateLogBackwardProbabilities(model, dataList, positionList); return new ArrayResult<>(dataList, positionList, model, forwardProbabilities, backwardProbabilities); }
Source:
<code>public String setValue(String value) throws GeneralSecurityException { String returnedValue = null; String password = null; try { <START> if (StringUtils.isNotBlank(value) && value.equals(INTERACTIVE_MODE)) { <END> password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } returnedValue = encrypt(password); } catch (Exception e) { String msg = "Failed to encrypt the current value"; Logger.getLogger(EngineConfig.class).debug(msg, e); throw new GeneralSecurityException(msg); } return returnedValue; }</code><technical_language>If "equalsIgnoreCase" instead of "equals" more user friendly</technical_language>

Target:
public String setValue(String value) throws GeneralSecurityException { String returnedValue = null; String password = null; try { if (StringUtils.isNotBlank(value) && value.equalsIgnoreCase(INTERACTIVE_MODE)) { password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } returnedValue = encrypt(password); } catch (Exception e) { String msg = "Failed to encrypt the current value"; Logger.getLogger(EngineConfig.class).debug(msg, e); throw new GeneralSecurityException(msg); } return returnedValue; }
Source:
<code>private int showErrorOnField(List<RegisterResponseFieldError> errors, IRegistrationFieldView fieldView) { int errorCount = 0; if (errors != null && !errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); for (RegisterResponseFieldError e : errors) { buffer.append(e.getUserMessage() + " "); errorCount ++; } fieldView.handleError(buffer.toString()); } <START> return errorCount; <END> }</code><technical_language>Do need return errorCount</technical_language>

Target:
private void showErrorOnField(List<RegisterResponseFieldError> errors, IRegistrationFieldView fieldView) { if (errors != null && !errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); for (RegisterResponseFieldError e : errors) { buffer.append(e.getUserMessage() + " "); } fieldView.handleError(buffer.toString()); } }
Source:
<code><START> public Boolean getCanViewEvalReleaseSig() { <END> boolean canView = evaluation != null && !evaluation.equals("") && !status.equals(Appraisal.STATUS_APPRAISAL_DUE) && !status.equals(Appraisal.STATUS_EMPLOYEE_REVIEW_DUE); return canView; }</code><technical_language>a bc reviewer able view supervisor signature? "reviewDue" status treated "employeeReviewDue" supervisor signature is concerned</technical_language>

Target:
public Boolean getCanViewEvalReleaseSig() { boolean canView = evaluation != null && !evaluation.equals("") && !status.equals(Appraisal.STATUS_APPRAISAL_DUE) && !status.equals(Appraisal.STATUS_EMPLOYEE_REVIEW_DUE) && !status.equals(Appraisal.STATUS_REVIEW_DUE); return canView; }
Source:
<code>public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } UUID uuid = activeTrace.getUUID(); Collection<String> collection = fCategories.get(uuid); if (collection.isEmpty()) { ContextDataSource dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataSource.ID, ContextDataSource.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } <START> Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } fCategories.putAll(uuid, data); <END> collection = data; } List<String> retVal = new ArrayList<>(collection); retVal.sort(null); return retVal; }</code><technical_language>ImmutableSet.Builder.toList? deduplicate return a lists</technical_language>

Target:
public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } UUID uuid = activeTrace.getUUID(); Collection<String> collection = fCategories.computeIfAbsent(uuid, new Function<Object, Collection<String>>() { @Override public Collection<String> apply(Object t) { ContextDataSource dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataSource.ID, ContextDataSource.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TmfTreeDataModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } return data; } }); List<String> retVal = new ArrayList<>(collection); retVal.sort(null); return retVal; }
Source:
<code>public String getName() { <START> return super.getName(); <END> }</code><technical_language>do return parents name instead of name store a lines above</technical_language>

Target:
public String getName() { return this.name; }
Source:
<code><START> @SuppressWarnings("unchecked") HistoryDetailFragmentAdapter(FragmentManager fragmentManager, <END> ArrayList<Revision> revisions) { super(fragmentManager); mRevisions = (ArrayList<Revision>) revisions.clone(); }</code><technical_language>suggestion @SuppressWarnings("unchecked") HistoryDetailFragmentAdapter(FragmentManager fragmentManager, ArrayList<Revision> revisions) { autocorrect a wild. revert this annotation line method another line for code style consistency</technical_language>

Target:
HistoryDetailFragmentAdapter(FragmentManager fragmentManager, ArrayList<Revision> revisions) { super(fragmentManager); mRevisions = (ArrayList<Revision>) revisions.clone(); }
Source:
<code>public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { try { jdbc.update("DELETE FROM "+ attributeToTablePrefix(attribute)+"_attr_values WHERE attr_id=?", attribute.getId()); jdbc.update("DELETE FROM attr_names WHERE id=?", attribute.getId()); <START> log.debug("Attribute deleted [{}]", attribute); <END> } catch (RuntimeException e) { throw new InternalErrorException(e); } }</code><technical_language>Attribute object is unncessary enclosed in [ ], createAttribute() method/message. I suggest Attribute created: Attribute deleted: {}</technical_language>

Target:
public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { try { jdbc.update("DELETE FROM "+ attributeToTablePrefix(attribute)+"_attr_values WHERE attr_id=?", attribute.getId()); jdbc.update("DELETE FROM attr_names WHERE id=?", attribute.getId()); log.debug("Attribute deleted: {}.", attribute); } catch (RuntimeException e) { throw new InternalErrorException(e); } }