auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testInterpolationNoDataEdges() { int width = 2; int height = 2; SampleModel sm = new ComponentSampleModel(DataBuffer.TYPE_BYTE, width, height, 1, 2, new int[] {0}); TiledImage source = new TiledImage(0, 0, width, height, 0, 0, sm, PlanarImage.createColorModel(sm)); int noDataValue = 1; source.setSample(0, 0, 0, 255); source.setSample(0, 1, 0, 64); source.setSample(1, 0, 0, 32); source.setSample(1, 1, 0, noDataValue); RenderingHints hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,BorderExtender.createInstance(BorderExtender.BORDER_COPY)); RenderedImage scaled = ScaleDescriptor.create(source, 32f, 32f, 0f, 0f, Interpolation.getInstance(Interpolation.INTERP_BILINEAR), null, null, RangeFactory.create(noDataValue, noDataValue), null, hints); Raster raster = scaled.getData(); int minX = raster.getMinX(); int minY = raster.getMinY(); int maxX = minX + raster.getWidth(); int maxY = minY + raster.getHeight(); int halfX = (minX + maxX) / 2; int halfY = (minY + maxY) / 2; for (int i = minY; i < maxY; i++) { for (int j = minX; j < maxX; j++) { int value = raster.getSample(j, i, 0); if (i > halfY && j > halfX) { assertTrue("Expected noData value but found different value", value == noDataValue); } else { <START> assertTrue("Expected valid value but found nodata", value > 0); <END> } } } }</code><technical_language>If nodata is 1, this test > 1</technical_language>

Target:
public void testInterpolationNoDataEdges() { int width = 2; int height = 2; SampleModel sm = new ComponentSampleModel(DataBuffer.TYPE_BYTE, width, height, 1, 2, new int[] {0}); TiledImage source = new TiledImage(0, 0, width, height, 0, 0, sm, PlanarImage.createColorModel(sm)); int noDataValue = 1; source.setSample(0, 0, 0, 255); source.setSample(0, 1, 0, 64); source.setSample(1, 0, 0, 32); source.setSample(1, 1, 0, noDataValue); RenderingHints hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,BorderExtender.createInstance(BorderExtender.BORDER_COPY)); RenderedImage scaled = ScaleDescriptor.create(source, 32f, 32f, 0f, 0f, Interpolation.getInstance(Interpolation.INTERP_BILINEAR), null, null, RangeFactory.create(noDataValue, noDataValue), null, hints); Raster raster = scaled.getData(); int minX = raster.getMinX(); int minY = raster.getMinY(); int maxX = minX + raster.getWidth(); int maxY = minY + raster.getHeight(); int halfX = (minX + maxX) / 2; int halfY = (minY + maxY) / 2; for (int i = minY; i < maxY; i++) { for (int j = minX; j < maxX; j++) { int value = raster.getSample(j, i, 0); if (i >= halfY && j >= halfX) { assertTrue("Expected noData value but found different value", value == noDataValue); } else { assertTrue("Expected valid value but found nodata", value != noDataValue); } } } }
Source:
<code><START> public synchronized void addOrUpdate(final PromiseResolverBreakpoint bId) { <END> FullSourceCoordinate coord = bId.getCoordinate(); BreakpointEnabling<PromiseResolverBreakpoint> existingBP = promiseResolverBreakpoints.get(coord); if (existingBP == null) { existingBP = new BreakpointEnabling<PromiseResolverBreakpoint>(bId); promiseResolverBreakpoints.put(coord, existingBP); } else { existingBP.setEnabled(bId.isEnabled()); } }</code><technical_language>this code repetitive, factor out a helper method here</technical_language>

Target:
public synchronized void addOrUpdate(final PromiseResolverBreakpoint bId) { saveBreakpoint(bId, promiseResolverBreakpoints); }
Source:
<code>public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath) throws WrongDMNTypeException { DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); <START> Map<String, List<String>> genericTypeInfoMap = new HashMap<>(); <END> for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); checkType(type, errorHolder, input.getName()); visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), genericTypeInfoMap, type, hiddenFacts, FactModelTree.Type.INPUT)); } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkType(type, errorHolder, decision.getName()); visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), genericTypeInfoMap, type, hiddenFacts, FactModelTree.Type.DECISION)); } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getTopLevelCollection().forEach(factModelTuple::addTopLevelCollectionError); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }</code><technical_language>this map for FactModelTrees? If I understood correctly, this means if data objects a list field name (i.e. Person.names Book.names) collapse in a single entry of map</technical_language>

Target:
public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath){ DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); checkTypeSupport(type, errorHolder, input.getName()); try { visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), type, hiddenFacts, FactModelTree.Type.INPUT)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkTypeSupport(type, errorHolder, decision.getName()); try { visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), type, hiddenFacts, FactModelTree.Type.DECISION)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getTopLevelCollection().forEach(factModelTuple::addTopLevelCollectionError); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }
Source:
<code>public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) { <START> return listTableSnapshots(tableNamePattern, snapshotNamePattern).thenApply(r->{ <END> for (SnapshotDescription snapshotDescription : r) { deleteSnapshot(snapshotDescription.getName()); } return null; }); }</code><technical_language>please rename r a bit more meaningful</technical_language>

Target:
public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) { return listTableSnapshots(tableNamePattern, snapshotNamePattern).thenApply(response->{ for (SnapshotDescription snapshotDescription : response) { deleteSnapshot(snapshotDescription.getName()); } return null; }); }
Source:
<code>public void shouldReturnIdentifierForLookupGeneratedIdentifier() { String className = GeneratedIdentifier.class.getSimpleName(); Map<String, String> lookupFields = new HashMap<>(); <START> lookupFields.put(IDENTIFIER_SOURCE_NAME, "BAH"); <END> GeneratedIdentifier generatedIdentifier = new GeneratedIdentifier(); generatedIdentifier.setValue("222"); when(identifierService.getLatestIdentifier(CONFIG_NAME, "BAH")).thenReturn(generatedIdentifier); Object object = taskDataProvider.lookup(className + '-' + CONFIG_NAME, "Generator source name", lookupFields); verify(identifierService).setLatestIdentifier(eq(CONFIG_NAME), eq("BAH"), eq(223L)); assertEquals(generatedIdentifier, object); }</code><technical_language>constant, please</technical_language>

Target:
public void shouldReturnIdentifierForLookupGeneratedIdentifier() { String className = GeneratedIdentifier.class.getSimpleName(); Map<String, String> lookupFields = new HashMap<>(); lookupFields.put(IDENTIFIER_SOURCE_NAME, IDENTIFIER_SOURCE_NAME_VALUE); GeneratedIdentifier generatedIdentifier = new GeneratedIdentifier(); generatedIdentifier.setValue("222"); when(identifierService.getLatestIdentifier(CONFIG_NAME, IDENTIFIER_SOURCE_NAME_VALUE)).thenReturn(generatedIdentifier); Object object = taskDataProvider.lookup(className + '-' + CONFIG_NAME, "Generator source name", lookupFields); verify(identifierService).setLatestIdentifier(eq(CONFIG_NAME), eq(IDENTIFIER_SOURCE_NAME_VALUE), eq(223L)); assertEquals(generatedIdentifier, object); }
Source:
<code>public Object getValueAt(int row, int column) { try { <START> Object value = super.getValueAt(row, column); <END> if (value == null) { value = LabelUtils.NULL_LABEL; } return value; } catch (Exception e) { System.out.println("!!! " + e.getMessage()); return null; } }</code><technical_language>do final if return NULL_LABEL in case of a null value, instead of dumping in variable :)</technical_language>

Target:
public Object getValueAt(int row, int column) { Object value = super.getValueAt(row, column); if (value == null) { value = LabelUtils.NULL_LABEL; } return value; }
Source:
<code>public void testPublicKeyCorrectlyCalculated() { BigInteger primeP = BigInteger.valueOf(23); BigInteger primeG = BigInteger.valueOf(5); BigInteger privateKey = BigInteger.valueOf(6); BigInteger expected = BigInteger.valueOf(8); <START> assertEquals(expected, diffieHellman.publicKey(primeP, primeG, privateKey)); <END> }</code><technical_language>assertEquals work BigInteger? give a good error message if test fails</technical_language>

Target:
public void testPublicKeyCorrectlyCalculated() { BigInteger primeA = BigInteger.valueOf(23); BigInteger primeB = BigInteger.valueOf(5); BigInteger privateKey = BigInteger.valueOf(6); BigInteger expected = BigInteger.valueOf(8); assertEquals(expected, diffieHellman.publicKey(primeA, primeB, privateKey)); }
Source:
<code>public void idle() { <START> DispatchAttempt dispatchAttempt = sendQueue.remove(); <END> Event event = dispatchAttempt.getEvent(); String address = dispatchAttempt.getAddress(); AuditLogEvent auditLogEvent; auditLogEvent = (AuditLogEvent) event; EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, auditLogEvent, isBodyHtml); if (StringUtils.isEmpty(address)) { log.error("Address is empty, cannot distribute message." + event.getName()); return; } log.info(String.format("Send email to [%s]%n subject:%n [%s]", address, message.getMessageSubject())); if (log.isDebugEnabled()) { log.debug(String.format("body:%n [%s]", message.getMessageBody())); } String errorMessage = null; boolean success = false; try { mailSender.send(address, message.getMessageSubject(), message.getMessageBody()); setChanged(); notifyObservers(DispatchData.success(event, address, EventNotificationMethod.EMAIL)); success = true; } catch (MessagingException ex) { errorMessage = ex.getMessage(); } dispatchAttempt.setAttempts(dispatchAttempt.getAttempts() + 1); if (!success) { if (dispatchAttempt.getAttempts() < maxRetries) { sendQueue.add(dispatchAttempt); } else { setChanged(); notifyObservers(DispatchData.failure(event, address, EventNotificationMethod.EMAIL, errorMessage)); } } }</code><technical_language>I unsure I follow... this attempt need attempt send entire queue, leaving entries failed next interval</technical_language>

Target:
public void idle() { Iterator<DispatchAttempt> iterator = sendQueue.iterator(); while (iterator.hasNext()) { DispatchAttempt attempt = iterator.next(); try { doDispatch(attempt); notifyObservers(DispatchResult.success(attempt.event, attempt.address, EventNotificationMethod.EMAIL)); iterator.remove(); } catch (Exception ex) { attempt.attempts++; if (attempt.attempts >= ATTEMPTS) { notifyObservers(DispatchResult.failure(attempt.event, attempt.address, EventNotificationMethod.EMAIL, ex.getMessage())); iterator.remove(); } } } }
Source:
<code>public void testRemoveFunctionExtension1() throws InterruptedException { log.info("RemoveFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol,price) as map1" + " insert into outputStream;" + "@info(name = 'query3') from outputStream select map1, map:remove(map1) as map2" + " insert into outputStream2;" ); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); <START> InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream"); <END> executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }</code><technical_language>lines needed. createExecutionplanRuntime throw exception</technical_language>

Target:
public void testRemoveFunctionExtension1() throws InterruptedException { log.info("RemoveFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol,price)" + " as map1 insert into outputStream;" + "@info(name = 'query3') from outputStream select map1, map:remove(map1) as map2" + " insert into outputStream2;" ); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }
Source:
<code>protected static Date getDeadlineDurationDate(String durationStr, int repeatCount) { try { if (DateTimeUtils.isRepeatable(durationStr)) { String[] repeatableParts = DateTimeUtils.parseISORepeatable(durationStr); String tempTimeDelay = repeatableParts[1]; String tempDateTimeStr = repeatableParts[2]; Date retDate; if (DateTimeUtils.isPeriod((tempDateTimeStr))) { retDate = new Date(DateTimeUtils.parseDateTime(tempTimeDelay) + repeatDuration(tempDateTimeStr, repeatCount)); } else { if(DateTimeUtils.isPeriod(tempTimeDelay)) { long firstRet = DateTimeUtils.parseDateTime(tempDateTimeStr) - Duration.parse(tempTimeDelay).toMillis(); retDate = new Date(firstRet + repeatDuration(tempTimeDelay, repeatCount)); } else { long duration = DateTimeUtils.parseDateTime(tempDateTimeStr) - DateTimeUtils.parseDateTime(tempTimeDelay); retDate = new Date(DateTimeUtils.parseDateTime(tempTimeDelay) + repeatDuration(duration, repeatCount)); <START> } <END> } return retDate; } else { if (DateTimeUtils.isPeriod((durationStr))) { return new Date(System.currentTimeMillis() + Duration.parse(durationStr).toMillis()); } else { return new Date(System.currentTimeMillis() + DateTimeUtils.parseDateAsDuration(durationStr)); } } } catch(Exception e) { throw new IllegalArgumentException("Unable to parse duration string: " + durationStr + " : " + e.getMessage()); } }</code><technical_language>This simplified to: if (DateTimeUtils.isPeriod((tempDateTimeStr))) { ... } else if(DateTimeUtils.isPeriod(tempTimeDelay)) { ... } else { ... }</technical_language>

Target:
protected static Date getDeadlineDurationDate(String durationStr, int repeatCount) { try { if (DateTimeUtils.isRepeatable(durationStr)) { String[] repeatableParts = DateTimeUtils.parseISORepeatable(durationStr); String tempTimeDelay = repeatableParts[1]; String tempDateTimeStr = repeatableParts[2]; Date deadlineDate; if (DateTimeUtils.isPeriod((tempDateTimeStr))) { deadlineDate = new Date(DateTimeUtils.parseDateTime(tempTimeDelay) + DateTimeUtils.parseDuration(tempDateTimeStr) * repeatCount); } else if(DateTimeUtils.isPeriod(tempTimeDelay)) { long firstRet = DateTimeUtils.parseDateTime(tempDateTimeStr) - Duration.parse(tempTimeDelay).toMillis(); deadlineDate = new Date(firstRet + DateTimeUtils.parseDuration(tempTimeDelay) * repeatCount); } else { long duration = DateTimeUtils.parseDateTime(tempDateTimeStr) - DateTimeUtils.parseDateTime(tempTimeDelay); deadlineDate = new Date(DateTimeUtils.parseDateTime(tempTimeDelay) + duration * repeatCount); } return deadlineDate; } else { if (DateTimeUtils.isPeriod((durationStr))) { return new Date(System.currentTimeMillis() + Duration.parse(durationStr).toMillis()); } else { return new Date(System.currentTimeMillis() + DateTimeUtils.parseDateAsDuration(durationStr)); } } } catch(Exception e) { throw new IllegalArgumentException("Unable to parse duration string: " + durationStr + " : " + e.getMessage()); } }
Source:
<code>public String generateDoc(PsiElement element, PsiElement originalElement) { if (element instanceof GoImportSpec) { element = ((GoImportSpec)element).getImportString().resolve(); } if (element instanceof GoNamedElement) { GoTopLevelDeclaration topLevel = PsiTreeUtil.getParentOfType(element, GoTopLevelDeclaration.class); Collection<PsiElement> children = PsiTreeUtil.findChildrenOfType(topLevel, element.getClass()); boolean alone = children.size() == 1 && children.iterator().next().equals(element); List<PsiComment> comments = getPreviousNonWsComment(alone ? topLevel : element); String result = "<pre>" + getSignature(element); result = result. replaceAll("\n", ""). replaceAll("\\s+", " "). replaceAll("\\(\\s", "("). <START> replaceAll(",\\s\\)", ")"); <END> if (!comments.isEmpty()) result += getCommentText(comments); return result + "</pre>"; } else if (element instanceof PsiDirectory) { String comments = getPackageComment(((PsiDirectory)element).findFile("doc.go")); if (comments != null) return comments; return getPackageComment(((PsiDirectory)element).findFile(((PsiDirectory)element).getName() + ".go")); } return null; }</code><technical_language>a nice create a one-liners. Please PSI for this. GoParameterInfoHandler</technical_language>

Target:
public String generateDoc(PsiElement element, PsiElement originalElement) { if (element instanceof GoImportSpec) { element = ((GoImportSpec)element).getImportString().resolve(); } if (element instanceof GoNamedElement) { GoTopLevelDeclaration topLevel = PsiTreeUtil.getParentOfType(element, GoTopLevelDeclaration.class); Collection<PsiElement> children = PsiTreeUtil.findChildrenOfType(topLevel, element.getClass()); boolean alone = children.size() == 1 && children.iterator().next().equals(element); List<PsiComment> comments = getPreviousNonWsComment(alone ? topLevel : element); String result = getSignature(element); if (!comments.isEmpty()) result += getCommentText(comments); return result.length() > 0 ? "<pre>" + result + "</pre>" : ""; } else if (element instanceof PsiDirectory) { String comments = getPackageComment(((PsiDirectory)element).findFile("doc.go")); if (comments != null) return comments; return getPackageComment(((PsiDirectory)element).findFile(((PsiDirectory)element).getName() + ".go")); } return null; }
Source:
<code>public Iterator<ChildReference> iterator( Name name, Context context ) { if (context != null && context.changes() != null) { return super.iterator(name, context); } else { return iterator(name); <START> } <END> }</code><technical_language>Ok, get picky here. returning if block, is need for else block. do this? if (context != null && context.changes() != null) { //we want context-sensitive behavior if changes. precomputed SNS index return super.iterator(name, context); } return iterator(name);</technical_language>

Target:
public Iterator<ChildReference> iterator( Name name, Context context ) { if (context != null && context.changes() != null) { return super.iterator(name, context); } return iterator(name); }
Source:
<code>static LinkedHashMap<String, String> getKeyPropertyList(ObjectName mbeanName) { LinkedHashMap<String, String> output = new LinkedHashMap<String, String>(); String properties = mbeanName.getKeyPropertyListString(); Matcher match = PROPERTY_PATTERN.matcher(properties); while (match.lookingAt()) { output.put(match.group(1), match.group(2)); properties = properties.substring(match.end()); <START> if (properties.startsWith(",")) <END> properties = properties.substring(1); match.reset(properties); } return output; }</code><technical_language>braces for clarity</technical_language>

Target:
static LinkedHashMap<String, String> getKeyPropertyList(ObjectName mbeanName) { LinkedHashMap<String, String> output = new LinkedHashMap<String, String>(); String properties = mbeanName.getKeyPropertyListString(); Matcher match = PROPERTY_PATTERN.matcher(properties); while (match.lookingAt()) { output.put(match.group(1), match.group(2)); properties = properties.substring(match.end()); if (properties.startsWith(",")) { properties = properties.substring(1); } match.reset(properties); } return output; }
Source:
<code>protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); <START> setTitle(myTitle); <END> }</code><technical_language>If a TitleAreaDialog is (which I convinced is necessary in this scenario), please set a description. Also, feels kind of weird setting a title of a dialog in a method meant for creation of buttons</technical_language>

Target:
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
Source:
<code>public void clickEdit() { clickAndWait(editLink); changeToMonoBook(); <START> PageObjectLogging.log("clickEdit", "click on Edit link", true, driver); <END> }</code><technical_language>driver</technical_language>

Target:
public void clickEdit() { clickAndWait(editLink); PageObjectLogging.log("clickEdit", "click on Edit link", true); }
Source:
<code>public String escapeIdent(String ident) { try { StringBuilder buf = new StringBuilder(); escapeIdentifier(buf, ident); return buf.toString(); } catch (SQLException e) { <START> throw new IllegalArgumentException("Invalid identifier name (contains \\0 character): " + ident); <END> } }</code><technical_language>Pass e a parameter</technical_language>

Target:
public String escapeIdent(String ident) { try { StringBuilder buf = new StringBuilder(); escapeIdentifier(buf, ident); return buf.toString(); } catch (SQLException ex) { throw new IllegalArgumentException( String.format(ENGLISH, "Invalid identifier name (%s): %s", ex.getMessage(), ident)); } }
Source:
<code>public void testNullPropertyWillNotBeAdded() { try { <START> ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); <END> configuration.setProperty("test-key", null); assertEquals(configuration.getProperty("test-key", null), null); assertEquals(configuration.getProperty("test-key", "a"), "a"); assertEquals(configuration.getProperty(TestConfigurationProvider.PROPERTY_3_NAME, null), null); assertFalse(configuration.getPropertyKeys().contains("test-key")); assertFalse(configuration.getPropertyKeys().contains(TestConfigurationProvider.PROPERTY_3_NAME)); } catch (Exception e) { fail("Error in test", e); } }</code><technical_language>Add final keyword</technical_language>

Target:
public void testNullPropertyWillNotBeAdded() { try { final ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); configuration.setProperty("test-key", null); assertEquals(configuration.getProperty("test-key", null), null); assertEquals(configuration.getProperty("test-key", "a"), "a"); assertEquals(configuration.getProperty(TestConfigurationProvider.PROPERTY_3_NAME, null), null); assertFalse(configuration.getPropertyKeys().contains("test-key")); assertFalse(configuration.getPropertyKeys().contains(TestConfigurationProvider.PROPERTY_3_NAME)); } catch (Exception e) { fail("Error in test", e); } }
Source:
<code>public static String createSelectionPlaceholdersOfSize(int size) { <START> String[] questionMarks = new String[size]; <END> for (int i = 0; i < size; i++) { questionMarks[i] = "?"; } return StringUtils.join(Arrays.asList(questionMarks), ", "); }</code><technical_language>like: int sizeOfResult = size * 3 - 2; char[] result = new char[sizeOfResult]; for (int i = 0; i < size -1; i++) { result[i] = '?'; result[i + 1] = ','; result[i + 2] = ' '; } if (i > 0) { result[sizeOfResult - 1] = '?'; } return new String(result); creates objects, instead of size + 5, is understandable simple</technical_language>

Target:
public static String createSelectionPlaceholdersOfSize(int size) { if (size == 0) { return ""; } int sizeOfResult = size * 3 - 2; char[] result = new char[sizeOfResult]; for (int i = 0; i < sizeOfResult - 1; i += 3) { result[i] = '?'; result[i + 1] = ','; result[i + 2] = ' '; } result[sizeOfResult - 1] = '?'; return new String(result); }
Source:
<code>default String describe(boolean pretty) { <START> ScriptBuilder builder = new ScriptBuilder(pretty); <END> builder .append("CREATE AGGREGATE ") .append(getKeyspace()) .append(".") .append(getSignature().getName()) .append("("); boolean first = true; for (int i = 0; i < getSignature().getParameterTypes().size(); i++) { if (first) { first = false; } else { builder.append(","); } DataType type = getSignature().getParameterTypes().get(i); builder.append(type.asCql(false, pretty)); } builder .append(")") .newLine() .append("SFUNC ") .append(getStateFuncSignature().getName()) .newLine() .append("STYPE ") .append(getStateType().asCql(false, pretty)); if (getFinalFuncSignature() != null) { builder.newLine().append("FINALFUNC ").append(getFinalFuncSignature().getName()); } if (getInitCond() != null) { builder.newLine().append("INITCOND ").append(formatInitCond()); } return builder.append(";").build(); }</code><technical_language>nice concept push common behaviors pretty printing</technical_language>

Target:
default String describe(boolean pretty) { ScriptBuilder builder = new ScriptBuilder(pretty); builder .append("CREATE AGGREGATE ") .append(getKeyspace()) .append(".") .append(getSignature().getName()) .append("("); boolean first = true; for (int i = 0; i < getSignature().getParameterTypes().size(); i++) { if (first) { first = false; } else { builder.append(","); } DataType type = getSignature().getParameterTypes().get(i); builder.append(type.asCql(false, pretty)); } builder .increaseIndent() .append(")") .newLine() .append("SFUNC ") .append(getStateFuncSignature().getName()) .newLine() .append("STYPE ") .append(getStateType().asCql(false, pretty)); if (getFinalFuncSignature() != null) { builder.newLine().append("FINALFUNC ").append(getFinalFuncSignature().getName()); } if (getInitCond() != null) { builder.newLine().append("INITCOND ").append(formatInitCond()); } return builder.append(";").build(); }
Source:
<code><START> public T blockingPeek() { <END> fOutputLock.lock(); try { if (fOutputBuffer.isEmpty()) { fOutputBuffer = checkNotNull(fInnerQueue.take()); } return checkNotNull(fOutputBuffer.peekLast()); } catch (InterruptedException e) { Activator.instance().logError("Buffered queue interrupted", e); throw new IllegalStateException(); } finally { fOutputLock.unlock(); } }</code><technical_language>a name methods defined in Queue/Deque, peek() in blocks. eventually add a normal peek() too, simply be: public @Nullable T peek() { return fOutputBuffer.peekLast(); }</technical_language>

Target:
public T blockingPeek() { fOutputLock.lock(); try { if (fOutputBuffer.isEmpty()) { fOutputBuffer = checkNotNull(fInnerQueue.take()); } return checkNotNull(fOutputBuffer.peek()); } catch (InterruptedException e) { Activator.instance().logError("Buffered queue interrupted", e); throw new IllegalStateException(); } finally { fOutputLock.unlock(); } }
Source:
<code>private static String readInstanceId(Path path) { <START> return readAllLines(path).get(0).split("instanceID=\"")[1].split("\"")[0]; <END> }</code><technical_language>in mind some forms gigantic. read line? return readOneLine(path).split("instanceID=\"")[1].split("\"")[0]; ![screen shot 2018-05-13 1 03 45 pm](<LINK_0></technical_language>

Target:
private static String readInstanceId(Path path) { return readFirstLine(path).split("instanceID=\"")[1].split("\"")[0]; }
Source:
<code><START> public static void afterClass() { <END> TMP_DIRECTORY.delete(); }</code><technical_language>fast :) I want PITA for change java.io.tmpdir original in afterClass method? I do internal commit if time for it</technical_language>

Target:
public static void afterClass() { TMP_DIRECTORY.delete(); System.setProperty("java.io.tmpdir", ORIGINAL_TMP_DIRECTORY); }
Source:
<code>public Optional<PlanNode> apply(PlanNode node, Context context) { if (!isPushAggregationThroughJoin(context.getSession())) { return Optional.empty(); } AggregationNode aggregationNode = (AggregationNode) node; PlanNode childNode = context.getLookup().resolve(aggregationNode.getSource()); if (!(childNode instanceof JoinNode)) { return Optional.empty(); } JoinNode joinNode = (JoinNode) childNode; <START> if (aggregationNode.getStep() != PARTIAL || aggregationNode.getGroupingSets().size() != 1) { <END> return Optional.empty(); } if (joinNode.getType() != JoinNode.Type.INNER || joinNode.getFilter().isPresent()) { return Optional.empty(); } if (allAggregationsOn(aggregationNode.getAggregations(), joinNode.getLeft().getOutputSymbols())) { return Optional.of(pushPartialToLeftChild(aggregationNode, joinNode)); } else if (allAggregationsOn(aggregationNode.getAggregations(), joinNode.getRight().getOutputSymbols())) { return Optional.of(pushPartialToRightChild(aggregationNode, joinNode)); } return Optional.empty(); }</code><technical_language>move this if lookup for join</technical_language>

Target:
public Optional<PlanNode> apply(PlanNode node, Context context) { if (!isPushAggregationThroughJoin(context.getSession())) { return Optional.empty(); } AggregationNode aggregationNode = (AggregationNode) node; if (aggregationNode.getStep() != PARTIAL || aggregationNode.getGroupingSets().size() != 1) { return Optional.empty(); } if (aggregationNode.getHashSymbol().isPresent()) { return Optional.empty(); } PlanNode childNode = context.getLookup().resolve(aggregationNode.getSource()); if (!(childNode instanceof JoinNode)) { return Optional.empty(); } JoinNode joinNode = (JoinNode) childNode; if (joinNode.getType() != JoinNode.Type.INNER) { return Optional.empty(); } if (allAggregationsOn(aggregationNode.getAggregations(), joinNode.getLeft().getOutputSymbols())) { return Optional.of(pushPartialToLeftChild(aggregationNode, joinNode, context)); } else if (allAggregationsOn(aggregationNode.getAggregations(), joinNode.getRight().getOutputSymbols())) { return Optional.of(pushPartialToRightChild(aggregationNode, joinNode, context)); } return Optional.empty(); }
Source:
<code>private boolean isAllowedWifiConnected() { boolean wifiConnected = mDeviceStateHolder.isWifiConnected(); if (wifiConnected) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Set<String> ssids = sp.getStringSet(PREF_SYNC_ONLY_WIFI_SSIDS, new HashSet<String>()); <START> if (ssids == null || ssids.isEmpty()) { END> Log.d(TAG, "All SSIDs allowed for syncing"); return true; } else { String ssid = mDeviceStateHolder.getWifiSsid(); if (ssid != null) { if (ssids.contains(ssid)) { Log.d(TAG, "SSID " + ssid + " found in whitelist"); return true; } Log.i(TAG, "SSID " + ssid + " not whitelisted"); return false; } else { Log.w(TAG, "SSID unknown (yet), cannot check SSID whitelist. Disallowing sync."); return false; } } } Log.d(TAG, "Wifi not connected"); return false; }</code><technical_language>need check for null, extra complexity</technical_language>

Target:
private boolean isAllowedWifiConnected() { boolean wifiConnected = mDeviceStateHolder.isWifiConnected(); if (wifiConnected) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Set<String> ssids = sp.getStringSet(PREF_SYNC_ONLY_WIFI_SSIDS, new HashSet<String>()); if (ssids.isEmpty()) { Log.d(TAG, "All SSIDs allowed for syncing"); return true; } else { String ssid = mDeviceStateHolder.getWifiSsid(); if (ssid != null) { if (ssids.contains(ssid)) { Log.d(TAG, "SSID " + ssid + " found in whitelist"); return true; } Log.i(TAG, "SSID " + ssid + " not whitelisted"); return false; } else { Log.w(TAG, "SSID unknown (yet), cannot check SSID whitelist. Disallowing sync."); return false; } } } Log.d(TAG, "Wifi not connected"); return false; }
Source:
<code>public void added(Provider<Rule> provider, Rule element) { Rule ruleCopy = RuleUtils.getRuleCopy(element); super.added(provider, ruleCopy); postRuleAddedEvent(ruleCopy); try { Rule resolvedRule = resolveRuleByTemplate(ruleCopy); if (resolvedRule.getTemplateUID() == null) { RuleStatusInfo statusInfo = disabledRulesStorage != null && disabledRulesStorage.get(ruleCopy.getUID()) == null ? new RuleStatusInfo(RuleStatus.INITIALIZING) : new RuleStatusInfo(RuleStatus.DISABLED); addToRuleEngine(resolvedRule, statusInfo); } if (ruleCopy != resolvedRule) { update(resolvedRule); } <START> } catch (Exception e) { <END> logger.debug("Added rule '{}' is invalid", ruleCopy.getUID(), e); } }</code><technical_language>catch generic Exceptions. this more specific</technical_language>

Target:
public void added(Provider<Rule> provider, Rule element) { String ruleUID = element.getUID(); Rule resolvedRule = element; try { resolvedRule = resolveRuleByTemplate(element); } catch (IllegalArgumentException e) { logger.debug("Added rule '{}' is invalid", ruleUID, e); } super.added(provider, element); if (element != resolvedRule) { if (provider instanceof ManagedRuleProvider) { update(resolvedRule); } else { super.updated(provider, element, resolvedRule); } } }
Source:
<code>public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); Utils.setContext(context); if (!LaunchManager.isWidgetEnabled()) { return; } if (intent.getAction() != null && intent.getAction().equals(ACTION_BUTTON_PRESS)) { if (WidgetManager.isWidgetTemporarilyVisible()) { WidgetManager.setWidgetTemporarilyVisible(false); updateMe(context); } long now = System.currentTimeMillis(); long diff = now - mLastTime; if (diff < TOUCH_INTERVAL) { mClicks++; } else { mClicks = 0; } mLastTime = now; if (WidgetManager.getTapCountToOpen() - 1 <= mClicks) { PinActivity.launch(context); <START> mClicks = 0; <END> } } }</code><technical_language>A fix is set mClicks 1 detecting click</technical_language>

Target:
public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); Utils.setContext(context); if (!LaunchManager.isWidgetEnabled()) { return; } if (intent.getAction() != null && intent.getAction().equals(ACTION_BUTTON_PRESS)) { if (WidgetManager.isWidgetTemporarilyVisible()) { WidgetManager.setWidgetTemporarilyVisible(false); updateMe(context); } long now = System.currentTimeMillis(); long diff = now - mLastTime; if (diff < TOUCH_INTERVAL) { mClicks++; } else { mClicks = 1; } mLastTime = now; if (WidgetManager.getTapCountToOpen() == mClicks) { PinActivity.launch(context); mClicks = 0; mLastTime = 0; } } }
Source:
<code>public State readChildState(String parentId, String name, Set<String> ignored) { processReceivedInvalidations(); String childCacheKey = computeChildCacheKey(parentId, name); String stateId = childCache.getIfPresent(childCacheKey); if (stateId != null) { State state = cache.getIfPresent(stateId); <START> if (state != null && parentId.equals(state.get(KEY_PARENT_ID)) && name.equals(state.get(KEY_NAME))) { <END> return state; } } State state = repository.readChildState(parentId, name, ignored); putInCache(state); return state; }</code><technical_language>if state != null parentId name differ, remove entry childCache invalid</technical_language>

Target:
public State readChildState(String parentId, String name, Set<String> ignored) { processReceivedInvalidations(); String childCacheKey = computeChildCacheKey(parentId, name); String stateId = childCache.getIfPresent(childCacheKey); if (stateId != null) { State state = cache.getIfPresent(stateId); if (state != null) { if (parentId.equals(state.get(KEY_PARENT_ID)) && name.equals(state.get(KEY_NAME))) { return state; } else { childCache.invalidate(childCacheKey); } } } State state = repository.readChildState(parentId, name, ignored); putInCache(state); return state; }
Source:
<code>protected void reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines( <START> BiConsumer<ConcurStandardAccountingExtractDetailLine, String> lineErrorReporter) { <END> List<ConcurStandardAccountingExtractDetailLine> linesForGroup = getDetailLinesSortedBySequenceNumberNumerically(); Set<String> sequenceNumbersForOrphanedCashAdvanceLines = getSequenceNumbersForOrphanedCashAdvanceLines(); for (ConcurStandardAccountingExtractDetailLine detailLine : linesForGroup) { String errorMessage = GROUP_WITH_ORPHANED_CASH_ADVANCE_MESSAGE; if (sequenceNumbersForOrphanedCashAdvanceLines.contains(detailLine.getSequenceNumber())) { errorMessage = String.format(ORPHANED_CASH_ADVANCE_MESSAGE_FORMAT, ORPHANED_CASH_ADVANCE_MESSAGE_FRAGMENT, detailLine.getCashAdvanceKey()); } lineErrorReporter.accept(detailLine, errorMessage); } }</code><technical_language>is advantage of a BiConsumer here</technical_language>

Target:
protected void reportAllLinesForGroupAsFailuresDueToOrphanedCashAdvanceLines( BiConsumer<ConcurStandardAccountingExtractDetailLine, String> lineErrorReporter) { List<ConcurStandardAccountingExtractDetailLine> linesForGroup = getDetailLinesSortedBySequenceNumberNumerically(); Set<String> sequenceNumbersForOrphanedCashAdvanceLines = getSequenceNumbersForOrphanedCashAdvanceLines(); for (ConcurStandardAccountingExtractDetailLine detailLine : linesForGroup) { String errorMessage; if (sequenceNumbersForOrphanedCashAdvanceLines.contains(detailLine.getSequenceNumber())) { errorMessage = collectorHelper.getFormattedValidationMessage( ConcurKeyConstants.CONCUR_SAE_ORPHANED_CASH_ADVANCE, detailLine.getCashAdvanceKey()); } else { errorMessage = collectorHelper.getValidationMessage(ConcurKeyConstants.CONCUR_SAE_GROUP_WITH_ORPHANED_CASH_ADVANCE); } lineErrorReporter.accept(detailLine, errorMessage); } }
Source:
<code>public static boolean isPossibleClientTermination(Throwable cause) { <START> if (cause instanceof SSLException) { return SSL_ENGINE_CLOSED_EXCEPTION_MSG.equals(cause.getMessage()); <END> } else if (cause instanceof IOException) { return CLIENT_RESET_EXCEPTION_MSG.equals(cause.getMessage()) || CLIENT_BROKEN_PIPE_EXCEPTION_MSG.equals( cause.getMessage()); } else { return false; } }</code><technical_language>SSLException is IOException, do this if-else statement</technical_language>

Target:
public static boolean isPossibleClientTermination(Throwable cause) { return cause instanceof IOException && (CLIENT_RESET_EXCEPTION_MSG.equals(cause.getMessage()) || CLIENT_BROKEN_PIPE_EXCEPTION_MSG.equals(cause.getMessage()) || SSL_ENGINE_CLOSED_EXCEPTION_MSG.equals( cause.getMessage())); }
Source:
<code>public void run() throws Exception { <START> Runnable actionMethod = actions.get(prefix); <END> if(actionMethod == null) { throw new IllegalArgumentException( String.format("No such action '%1$s' exists for module '%2$s'", prefix, getName()) ); } actionMethod.run(); }</code><technical_language>action parsed in this module</technical_language>

Target:
public void run() throws Exception { actionMethod.run(); }
Source:
<code>private static BasicDocumentRevision getFullRevisionFromCurrentCursor(Cursor cursor, List<? extends Attachment> attachments) { String docId = cursor.getString(0); long internalId = cursor.getLong(1); String revId = cursor.getString(2); long sequence = cursor.getLong(3); byte[] json = cursor.getBlob(4); boolean current = cursor.getInt(5) > 0; boolean deleted = cursor.getInt(6) > 0; long parent = -1L; if(cursor.columnType(7) == Cursor.FIELD_TYPE_INTEGER) { parent = cursor.getLong(7); } else if(cursor.columnType(7) == Cursor.FIELD_TYPE_NULL) { } else { <START> throw new IllegalArgumentException("Unexpected type: " + cursor.columnType(7)); END> } DocumentRevisionBuilder builder = new DocumentRevisionBuilder() .setDocId(docId) .setRevId(revId) .setBody(BasicDocumentBody.bodyWith(json)) .setDeleted(deleted) .setSequence(sequence) .setInternalId(internalId) .setCurrent(current) .setParent(parent) .setAttachments(attachments); return builder.build(); }</code><technical_language>Pretty Runtime is fine here. happen I guess. idea check for column check? schema change in a this true</technical_language>

Target:
private static BasicDocumentRevision getFullRevisionFromCurrentCursor(Cursor cursor, List<? extends Attachment> attachments) { String docId = cursor.getString(0); long internalId = cursor.getLong(1); String revId = cursor.getString(2); long sequence = cursor.getLong(3); byte[] json = cursor.getBlob(4); boolean current = cursor.getInt(5) > 0; boolean deleted = cursor.getInt(6) > 0; long parent = -1L; if(cursor.columnType(7) == Cursor.FIELD_TYPE_INTEGER) { parent = cursor.getLong(7); } else if(cursor.columnType(7) == Cursor.FIELD_TYPE_NULL) { } else { throw new RuntimeException("Unexpected type: " + cursor.columnType(7)); } DocumentRevisionBuilder builder = new DocumentRevisionBuilder() .setDocId(docId) .setRevId(revId) .setBody(BasicDocumentBody.bodyWith(json)) .setDeleted(deleted) .setSequence(sequence) .setInternalId(internalId) .setCurrent(current) .setParent(parent) .setAttachments(attachments); return builder.build(); }
Source:
<code>private void setSidePane(boolean displayed) { if (displayed) { gameDetailPane.setVisible(true); <START> gameDetailPane.setManaged(true); <END> toggleSidePaneButton.setText(i18n.get("view.hideSidePane")); gamesGridPane.getColumnConstraints().stream().filter(c -> c.getHgrow() == Priority.SOMETIMES).forEach(c -> c.setMinWidth(300)); } else { gameDetailPane.setVisible(false); gameDetailPane.setManaged(false); toggleSidePaneButton.setText(i18n.get("view.showSidePane")); gamesGridPane.getColumnConstraints().stream().filter(c -> c.getHgrow() == Priority.SOMETIMES).forEach(c -> c.setMinWidth(0)); gameViewContainer.setPrefWidth(10000); } }</code><technical_language>Please bind manged visible</technical_language>

Target:
private void setSidePane(boolean displayed) { if (displayed) { toggleSidePaneButton.setText(i18n.get("view.hideSidePane")); sidePaneColumn.setMinWidth(sidePaneColumn.getPrefWidth()); } else { toggleSidePaneButton.setText(i18n.get("view.showSidePane")); sidePaneColumn.setMinWidth(0); } }
Source:
<code>public Object getAdapter( Object adaptableObject, Class adapterType ) { Object molecule = null; if ( adaptableObject instanceof CMLMolecule) { CMLMolecule mol = (CMLMolecule) adaptableObject; <START> if ( adapterType.equals( CMLMolecule.class ) ) { <END> try { molecule = Activator.getDefault() .getJavaCDKManager().fromCml( mol.toCML() ); } catch ( BioclipseException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } catch ( IOException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } } } if(molecule !=null &&adapterType.isAssignableFrom( molecule.getClass())) return molecule; return null; }</code><technical_language>ICDKMolecule instead of CMLMolecule</technical_language>

Target:
public Object getAdapter( Object adaptableObject, Class adapterType ) { Object molecule = null; if ( adaptableObject instanceof CMLMolecule) { CMLMolecule mol = (CMLMolecule) adaptableObject; if ( adapterType.equals( ICDKMolecule.class ) ) { try { molecule = Activator.getDefault() .getJavaCDKManager().fromCml( mol.toCML() ); } catch ( BioclipseException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } catch ( IOException e ) { logger.debug( LogUtils.traceStringOf( e )); return null; } } } if(molecule !=null &&adapterType.isAssignableFrom( molecule.getClass())) return molecule; return null; }
Source:
<code>protected List<QuickActionType> getQuickActionTypes() { <START> ArrayList<QuickActionType> quickActionTypes = new ArrayList<>(); <END> quickActionTypes.add(AddPOIAction.TYPE); quickActionTypes.add(AddOSMBugAction.TYPE); quickActionTypes.add(ShowHideOSMBugAction.TYPE); return quickActionTypes; }</code><technical_language>ArrayList -> List</technical_language>

Target:
protected List<QuickActionType> getQuickActionTypes() { List<QuickActionType> quickActionTypes = new ArrayList<>(); quickActionTypes.add(AddPOIAction.TYPE); quickActionTypes.add(AddOSMBugAction.TYPE); quickActionTypes.add(ShowHideOSMBugAction.TYPE); return quickActionTypes; }
Source:
<code><START> private void connectNewPeers(){ <END> if (qcm != null && quorumVerifier != null && lastSeenQuorumVerifier != null) { Map<Long, QuorumServer> committedView = quorumVerifier.getAllMembers(); for (Entry<Long, QuorumServer> e: lastSeenQuorumVerifier.getAllMembers().entrySet()){ if (e.getKey() != getId() && !committedView.containsKey(e.getKey())) qcm.connectOne(e.getKey(), lastSeenQuorumVerifier); } } }</code><technical_language>@hanm, long discussion Jira, thanks for digging deeper problem. LGTM, a small suggestion: error-prone assume in future this method called other non-synchronized methods, add synchronize(qvLock) too</technical_language>

Target:
private void connectNewPeers(){ synchronized (QV_LOCK) { if (qcm != null && quorumVerifier != null && lastSeenQuorumVerifier != null) { Map<Long, QuorumServer> committedView = quorumVerifier.getAllMembers(); for (Entry<Long, QuorumServer> e : lastSeenQuorumVerifier.getAllMembers().entrySet()) { if (e.getKey() != getId() && !committedView.containsKey(e.getKey())) qcm.connectOne(e.getKey()); } } } }
Source:
<code>public ConfigDaoImpl(Configuration appConfig) throws ClassNotFoundException, SQLException, ConfigurationException, ConnectException, XPathExpressionException { valueColumn = appConfig.getString("configColumnValue"); configTable = appConfig.getString("configTable"); nameColumn = appConfig.getString("configColumnName"); versionColumn = appConfig.getString("configColumnVersion"); defaultColumn = appConfig.getString("configColumnDefault"); selectSql = MessageFormat.format("select {0} from {1} where {2}=? and {3} =?", valueColumn, configTable, nameColumn, versionColumn); updateSql = MessageFormat.format("update {0} set {1}=? where {2}=? and {3}=?", configTable, valueColumn, nameColumn, versionColumn); selectKeysForNameSql = MessageFormat.format("select * from {0} where {1}=? ", configTable, nameColumn); selectConfigDiff = MessageFormat.format("SELECT {0}, {1}, {2}, {3} FROM {4} WHERE {5} != {6}", nameColumn, valueColumn, defaultColumn, versionColumn, configTable, valueColumn, defaultColumn); <START> System.out.println(selectConfigDiff); <END> ds = new StandaloneDataSource(); }</code><technical_language>Please remove this debug output</technical_language>

Target:
public ConfigDaoImpl(Configuration appConfig) throws ClassNotFoundException, SQLException, ConfigurationException, ConnectException, XPathExpressionException { valueColumn = appConfig.getString("configColumnValue"); configTable = appConfig.getString("configTable"); nameColumn = appConfig.getString("configColumnName"); versionColumn = appConfig.getString("configColumnVersion"); defaultColumn = appConfig.getString("configColumnDefault"); selectSql = MessageFormat.format("select {0} from {1} where {2}=? and {3} =?", valueColumn, configTable, nameColumn, versionColumn); updateSql = MessageFormat.format("update {0} set {1}=? where {2}=? and {3}=?", configTable, valueColumn, nameColumn, versionColumn); selectKeysForNameSql = MessageFormat.format("select * from {0} where {1}=? ", configTable, nameColumn); selectConfigDiff = MessageFormat.format("SELECT {0}, {1}, {2}, {3} FROM {4} WHERE {5} != {6}", nameColumn, valueColumn, defaultColumn, versionColumn, configTable, valueColumn, defaultColumn); ds = new StandaloneDataSource(); }