auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private FileInfo waitForChange() { IntByReference rcount = new IntByReference(); ULONG_PTRByReference rkey = new ULONG_PTRByReference(); PointerByReference roverlap = new PointerByReference(); if (! Kernel32.INSTANCE.GetQueuedCompletionStatus(port, rcount, rkey, roverlap, WinBase.INFINITE)) return null; synchronized (this) { <START> return handleMap.get(new HANDLE(new Pointer(rkey.getValue().longValue()))); <END> } }</code><technical_language>I this affect 32-bit version. In addition, I of _PTR variants add a .toPointer() method, clear integer pointer. rkey.getValue().toPointer() this expression more clear, avoid new Pointer(), implies different</technical_language>

Target:
private FileInfo waitForChange() { IntByReference rcount = new IntByReference(); ULONG_PTRByReference rkey = new ULONG_PTRByReference(); PointerByReference roverlap = new PointerByReference(); if (! Kernel32.INSTANCE.GetQueuedCompletionStatus(port, rcount, rkey, roverlap, WinBase.INFINITE)) return null; synchronized (this) { return handleMap.get(new HANDLE(rkey.getValue().toPointer())); } }
Source:
<code>public CloseableIteration<RyaStatement, RyaDAOException> query( final RyaStatement stmt, MongoDBRdfConfiguration conf) throws RyaDAOException { <START> Entry<RyaStatement, BindingSet> entry = new AbstractMap.SimpleEntry<>(stmt, new MapBindingSet()); <END> Collection<Entry<RyaStatement, BindingSet>> collection = Collections.singleton(entry); return new RyaStatementCursorIterator(queryWithBindingSet(collection, conf)); }</code><technical_language>Check RyaStatement Config null</technical_language>

Target:
public CloseableIteration<RyaStatement, RyaDAOException> query( final RyaStatement stmt, MongoDBRdfConfiguration conf) throws RyaDAOException { Preconditions.checkNotNull(stmt); Preconditions.checkNotNull(conf); Entry<RyaStatement, BindingSet> entry = new AbstractMap.SimpleEntry<>(stmt, new MapBindingSet()); Collection<Entry<RyaStatement, BindingSet>> collection = Collections.singleton(entry); return new RyaStatementCursorIterator(queryWithBindingSet(collection, conf)); }
Source:
<code>public ProtobufMatcherEvalContext(Object userContext, Object eventType, Object instance, Descriptor wrappedMessageDescriptor, SerializationContext serializationContext) { super(userContext, eventType, instance); this.serializationContext = serializationContext; try { Object inst = getInstance(); <START> if (inst instanceof WrappedByteArray) { <END> ProtobufParser.INSTANCE.parse(this, wrappedMessageDescriptor, ((WrappedByteArray) inst).getBytes()); } else { ProtobufParser.INSTANCE.parse(this, wrappedMessageDescriptor, (byte[]) inst); } } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>classes, inst.getClass()==WrappedByteArray.class (or inst.getClass().isArray() cheaper)</technical_language>

Target:
public ProtobufMatcherEvalContext(Object userContext, Object eventType, Object instance, Descriptor wrappedMessageDescriptor, SerializationContext serializationContext) { super(userContext, eventType, instance); this.serializationContext = serializationContext; try { Object inst = getInstance(); if (inst != null && inst.getClass() == WrappedByteArray.class) { ProtobufParser.INSTANCE.parse(this, wrappedMessageDescriptor, ((WrappedByteArray) inst).getBytes()); } else { ProtobufParser.INSTANCE.parse(this, wrappedMessageDescriptor, (byte[]) inst); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>private void readStatus(int status) { byte[] rawArray = null; if (status == 1) { rawArray = status1.read(); } else if (status == 2) { <START> rawArray = status1.read(); <END> } else if (status == 3) { readStatus3(); } if (rawArray != null) { double[] tempCurrents = new double[6]; tempCurrents[0] = ((rawArray[0] & 0xFF) << 2 | ((rawArray[1] & 0xC0) >> 6)) * 0.125; tempCurrents[1] = (((rawArray[1] & 0x3F) << 4) | ((rawArray[2] & 0xF0) >> 4)) * 0.125; tempCurrents[2] = (((rawArray[2] & 0x0F) << 6) | ((rawArray[3] & 0x3F) >> 2)) * 0.125; tempCurrents[3] = (((rawArray[3] & 0xC0) << 8) | ((rawArray[4] & 0xFF))) * 0.125; tempCurrents[4] = (((rawArray[5] & 0xFF) << 2) | ((rawArray[6] & 0xC0) >> 6)) * 0.125; tempCurrents[5] = (((rawArray[6] & 0x3F) << 4) | ((rawArray[7] & 0xF0) >> 4)) * 0.125; for (int i = 0; i < 6; i++) { if (tempCurrents[i] < 128) { cachedChannelCurrents[i + (status - 1) * 6] = tempCurrents[i]; } } lastRead = System.currentTimeMillis(); } }</code><technical_language>status2.read()</technical_language>

Target:
private void readStatus(int status) { byte[] rawArray = null; int numberCurrents = 6; if (status == 1) { rawArray = status1.read(); } else if (status == 2) { rawArray = status2.read(); } else if (status == 3) { rawArray = status3.read(); numberCurrents = 4; } if (rawArray != null) { double[] tempCurrents = new double[numberCurrents]; tempCurrents[0] = ((rawArray[0] & 0xFF) << 2 | ((rawArray[1] & 0xC0) >> 6)) * 0.125; tempCurrents[1] = (((rawArray[1] & 0x3F) << 4) | ((rawArray[2] & 0xF0) >> 4)) * 0.125; tempCurrents[2] = (((rawArray[2] & 0x0F) << 6) | ((rawArray[3] & 0x3F) >> 2)) * 0.125; tempCurrents[3] = (((rawArray[3] & 0xC0) << 8) | ((rawArray[4] & 0xFF))) * 0.125; if (numberCurrents == 6) { tempCurrents[4] = (((rawArray[5] & 0xFF) << 2) | ((rawArray[6] & 0xC0) >> 6)) * 0.125; tempCurrents[5] = (((rawArray[6] & 0x3F) << 4) | ((rawArray[7] & 0xF0) >> 4)) * 0.125; } else { cachedResistance = (rawArray[5] & 0xFF) / 1000.0; cachedVoltage = (rawArray[6] & 0xFF) * 0.05 + 4.0; } for (int i = 0; i < numberCurrents; i++) { if (tempCurrents[i] < 128) { cachedChannelCurrents[i + (status - 1) * 6] = tempCurrents[i]; } } lastRead = System.currentTimeMillis(); } }
Source:
<code>private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; <START> List<IMethod> rippleMethodsList= Arrays.asList(rippleMethods); <END> List<IMethod> filteredMethods= new ArrayList<>(rippleMethodsList.size()); for (Iterator<IMethod> iter= rippleMethodsList.iterator(); iter.hasNext(); ) { IMethod currentMethod= iter.next(); Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { fBinaryRefs.add((SearchMatch) match); } else { filteredMethods.add(currentMethod); } } fDeclarationToMatch= null; return toArray(filteredMethods); }</code><technical_language>iterate array</technical_language>

Target:
private IMethod[] getAllRippleMethods(IProgressMonitor pm, WorkingCopyOwner owner) throws CoreException { IMethod[] rippleMethods= findAllRippleMethods(pm, owner); if (fDeclarationToMatch == null) return rippleMethods; List<IMethod> filteredMethods= new ArrayList<>(rippleMethods.length / 2); for (IMethod currentMethod : rippleMethods) { Object match= fDeclarationToMatch.get(currentMethod); if (match != null) { fBinaryRefs.add((SearchMatch) match); } else { filteredMethods.add(currentMethod); } } fDeclarationToMatch= null; return toArray(filteredMethods); }
Source:
<code>public String deleteFieldVariable(String fieldVarId) throws DotDataException, DotSecurityException, DotRuntimeException, PortalException, SystemException { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); User user = userWebAPI.getLoggedInUser(req); boolean respectFrontendRoles = userWebAPI.isLoggedToFrontend(req); FieldAPI fieldAPI = APILocator.getFieldAPI(); FieldVariable fieldVar = fieldAPI.findFieldVariable(fieldVarId, user, respectFrontendRoles); fieldAPI.deleteFieldVariable(fieldVar, user, respectFrontendRoles); Field field = APILocator.getContentTypeFieldAPI().find(fieldVar.getFieldId()); <START> ContentTypeAPI tapi = APILocator.getContentTypeAPI(user); <END> ContentType type = tapi.find(field.contentTypeId()); tapi.updateModDate(type); return LanguageUtil.get(user, "message.fieldvariables.deleted"); }</code><technical_language>API before, if is user ask for instance</technical_language>

Target:
public String deleteFieldVariable(String fieldVarId) throws DotDataException, DotSecurityException, DotRuntimeException, PortalException, SystemException { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI(); User user = userWebAPI.getLoggedInUser(req); boolean respectFrontendRoles = userWebAPI.isLoggedToFrontend(req); FieldAPI fieldAPI = APILocator.getFieldAPI(); FieldVariable fieldVar = fieldAPI.findFieldVariable(fieldVarId, user, respectFrontendRoles); fieldAPI.deleteFieldVariable(fieldVar, user, respectFrontendRoles); Field field = APILocator.getContentTypeFieldAPI().find(fieldVar.getFieldId()); ContentTypeAPI contentTypeAPI = APILocator.getContentTypeAPI(user); ContentType type = contentTypeAPI.find(field.contentTypeId()); contentTypeAPI.updateModDate(type); return LanguageUtil.get(user, "message.fieldvariables.deleted"); }
Source:
<code>public void drawScreen(int par1, int par2, float par3) { drawDefaultBackground(); super.drawScreen(par1, par2, par3); int butHeight = 20; String txt = "Select Connection to Adjust"; int x = width / 2 - (Minecraft.getMinecraft().fontRendererObj.getStringWidth(txt) / 2); int y = height / 2 - butHeight * 3 - 5; drawString(Minecraft.getMinecraft().fontRendererObj, txt, x, y, ColorUtil.getARGB(Color.white)); for (int i = 0; i < 6; i++) { String blockName = adjacentBlockNames[i]; if (blockName == null) { continue; } int textWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(blockName); <START> drawString(Minecraft.getMinecraft().fontRendererObj, blockName, textPositions[i].x + 60 / 2 - textWidth / 2, textPositions[i].y, ColorUtil.getARGB(Color.gray)); <END> } if (Minecraft.getMinecraft().thePlayer.getName().contains("direwolf20") && ((EnderIO.proxy.getTickCount() / 16) & 1) == 1) { txt = "You can also right-click the connector directly"; x = width / 2 - (Minecraft.getMinecraft().fontRendererObj.getStringWidth(txt) / 2); y = height / 2 + butHeight * 3 - 5; drawString(Minecraft.getMinecraft().fontRendererObj, txt, x, y, ColorUtil.getARGB(Color.white)); } }</code><technical_language>move this up, is rendered ("behind") buttons? is a chance of overlap here. I need clean gl state text is rendered in case</technical_language>

Target:
public void drawScreen(int par1, int par2, float par3) { drawDefaultBackground(); for (EnumFacing dir : EnumFacing.VALUES) { String blockName = adjacentBlockNames.get(dir); if (blockName == null) { continue; } int textWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(blockName); Point p = textPositions.get(dir); drawString(Minecraft.getMinecraft().fontRendererObj, blockName, p.x + 60 / 2 - textWidth / 2, p.y, ColorUtil.getARGB(Color.gray)); } super.drawScreen(par1, par2, par3); int butHeight = 20; String txt = "Select Connection to Adjust"; int x = width / 2 - (Minecraft.getMinecraft().fontRendererObj.getStringWidth(txt) / 2); int y = height / 2 - butHeight * 3 - 5; drawString(Minecraft.getMinecraft().fontRendererObj, txt, x, y, ColorUtil.getARGB(Color.white)); if (Minecraft.getMinecraft().thePlayer.getName().contains("direwolf20") && ((EnderIO.proxy.getTickCount() / 16) & 1) == 1) { txt = "You can also right-click the connector directly"; x = width / 2 - (Minecraft.getMinecraft().fontRendererObj.getStringWidth(txt) / 2); y = height / 2 + butHeight * 3 - 5; drawString(Minecraft.getMinecraft().fontRendererObj, txt, x, y, ColorUtil.getARGB(Color.white)); } }
Source:
<code>public RingBitSet(int bitSetSize, RingBitSet sourceSet) { this(bitSetSize); int targetLength = Integer.min(bitSetSize, sourceSet.length); int sourceIndex = sourceSet.index; for (int i = 0; i < targetLength; i++) { this.setNextBit(sourceSet.bitSet.get(sourceIndex)); <START> sourceIndex = (sourceIndex + 1) % sourceSet.size; <END> } }</code><technical_language>I copy process in reverse order copy latest call results. Or</technical_language>

Target:
public RingBitSet(int bitSetSize, RingBitSet sourceSet) { this(bitSetSize); int targetLength = Integer.min(bitSetSize, sourceSet.length); int sourceIndex = sourceSet.index; int forwardIndex = sourceSet.size - sourceIndex; for (int i = 0; i < targetLength; i++) { this.setNextBit(sourceSet.bitSet.get(sourceIndex)); forwardIndex = (forwardIndex + 1) % sourceSet.size; sourceIndex = (sourceSet.size - forwardIndex) % sourceSet.size; } }
Source:
<code>public static void checkBlackPearlForTapeFailure(final Ds3Client client) throws IOException, SignatureException, TapeFailureException { <START> final Iterable<TapeFailure> tapeFailures = client.getTapeFailure(new GetTapeFailureRequest()).getTapeFailures(); <END> if (tapeFailures != null && !Iterables.isEmpty(tapeFailures)) { throw new TapeFailureException(tapeFailures.iterator()); } }</code><technical_language>I client.getTapeFailure() is implemented - done calling here</technical_language>

Target:
public static void checkBlackPearlForTapeFailure(final Ds3Client client) throws IOException, SignatureException, CommandException { final Iterable<TapeFailure> tapeFailures = client.getTapeFailure(new GetTapeFailureRequest()).getTapeFailures(); if (tapeFailures != null && !Iterables.isEmpty(tapeFailures)) { throw new CommandException(new TapeFailureException(tapeFailures.iterator())); } }
Source:
<code>protected ToggleButton convertToToggleButton(EngineCategoryDTO category) { final ToggleButton categoryButton = createSidebarToggleButton(category.getName()); <START> categoryButton.setId(String.format("%s-button", category.getName().toLowerCase().replace('.', '-'))); <END> categoryButton.setOnAction(event -> getControl().setSelectedElement(category)); return categoryButton; }</code><technical_language>I useful add a method buttonize, is responsible for conversion of a string: java public String buttonize(String pattern, String input) { return String.format(pattern, input.toLowerCase().replace('.', '-')) }</technical_language>

Target:
protected ToggleButton convertToToggleButton(EngineCategoryDTO category) { final ToggleButton categoryButton = createSidebarToggleButton(category.getName()); categoryButton .setId(String.format("engines-%s", SidebarToggleGroupBaseSkin.getToggleButtonId(category.getName()))); categoryButton.setOnAction(event -> getControl().setSelectedElement(category)); return categoryButton; }
Source:
<code>public List<Command> receive(final Command command) { LOG.trace("Received command of type {}", command.getClass().getSimpleName()); List<Command> response = new LinkedList(); if (!(command instanceof SignalCommand)) { for (DolphinServerAction it : dolphinServerActions) { it.setDolphinResponse(response); } serverModelStore.setCurrentResponse(response); } List<CommandHandler> actions = registry.getActionsFor(command.getClass()); if (actions.isEmpty()) { <START> LOG.debug("There is no server action registered for received command type {}, known commands types are {}", command.getClass().getSimpleName(), registry.getActions().keySet()); <END> return response; } List<CommandHandler> actionsCopy = new ArrayList<CommandHandler>(); actionsCopy.addAll(actions); try { for (CommandHandler action : actionsCopy) { action.handleCommand(command, response); } } catch (Exception exception) { throw exception; } return response; }</code><technical_language>This warn</technical_language>

Target:
public List<Command> receive(final Command command) { LOG.trace("Received command of type {}", command.getClass().getSimpleName()); List<Command> response = new LinkedList(); if (!(command instanceof SignalCommand)) { for (DolphinServerAction it : dolphinServerActions) { it.setDolphinResponse(response); } serverModelStore.setCurrentResponse(response); } List<CommandHandler> actions = registry.getActionsFor(command.getClass()); if (actions.isEmpty()) { LOG.warn("There is no server action registered for received command type {}, known commands types are {}", command.getClass().getSimpleName(), registry.getActions().keySet()); return response; } List<CommandHandler> actionsCopy = new ArrayList<CommandHandler>(); actionsCopy.addAll(actions); try { for (CommandHandler action : actionsCopy) { action.handleCommand(command, response); } } catch (Exception exception) { throw exception; } return response; }
Source:
<code>public void testAddingFlag() { <START> assertTrue(containsFlag( <END> new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(), Notification.DEFAULT_SOUND)); assertFalse(containsFlag( new Toggled(Notification.DEFAULT_SOUND, false, new NoSignal()).value(), Notification.DEFAULT_SOUND)); }</code><technical_language>containsFlag here, instead test expected outcome java assertThat(new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(), is(new NoSignal().value() | Notification.DEFAULT_SOUND)); assertThat(new Toggled(Notification.DEFAULT_SOUND, false, new NoSignal()).value(), is(new NoSignal().value()));</technical_language>

Target:
public void testAddingFlag() { assertThat(new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(), is(new NoSignal().value() | Notification.DEFAULT_SOUND)); assertThat(new Toggled(Notification.DEFAULT_SOUND, false, new NoSignal()).value(), is(new NoSignal().value())); }
Source:
<code>public void getClassNameWithoutPackage() { <START> FactIdentifier factIdentifier = DESCRIPTION; <END> assertEquals(factIdentifier.getClassNameWithoutPackage(), String.class.getSimpleName()); }</code><technical_language>I test more reliable a new FactIdentifier. If DESCRIPTION className change for reason, this test fail too. Wdyt</technical_language>

Target:
public void getClassNameWithoutPackage() { FactIdentifier factIdentifier = new FactIdentifier("test", "com.Test"); assertEquals(factIdentifier.getClassNameWithoutPackage(), "Test"); }
Source:
<code><START> public UploadModule getModule() { <END> if (this.module == null) { this.module = new UploadModule(); } return this.module; }</code><technical_language>this synchronized prevent race conditoins</technical_language>

Target:
public synchronized UploadModule getModule() { if (this.module == null) { return new UploadModule(); } return this.module; }
Source:
<code>public void updateTransactions(Account account, Urllib urlopen) throws LoginException, BankException, IOException { super.updateTransactions(account, urlopen); Matcher matcher; String response = urlopen.open( <START> "<LINK_0>"); <END> matcher = reTransactions.matcher(response); ArrayList<Transaction> transactions = new ArrayList<Transaction>(); while (matcher.find()) { transactions.add(new Transaction(matcher.group(1), Html.fromHtml(matcher.group(2).trim()).toString(), Helpers.parseBalance(matcher.group(3)))); } account.setTransactions(transactions); }</code><technical_language>Do mind setting url a constant</technical_language>

Target:
public void updateTransactions(Account account, Urllib urlopen) throws LoginException, BankException, IOException { super.updateTransactions(account, urlopen); Matcher matcher; String response = urlopen.open(URL_TRANSACTIONS); matcher = reTransactions.matcher(response); ArrayList<Transaction> transactions = new ArrayList<Transaction>(); while (matcher.find()) { transactions.add(new Transaction(matcher.group(1), Html.fromHtml(matcher.group(2).trim()).toString(), Helpers.parseBalance(matcher.group(3)))); } account.setTransactions(transactions); }
Source:
<code>@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CASE_CREATED_REQUEST_CODE) { if (resultCode == RESULT_OK && caseCreatedListener != null) { caseCreatedListener.onCaseCreated((Case) data.getSerializableExtra(EXTRA_DESK_CASE)); } } <START> } <END></code><technical_language>call super... in case</technical_language>

Target:
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CASE_CREATED_REQUEST_CODE) { if (resultCode == RESULT_OK && caseCreatedListener != null) { caseCreatedListener.onCaseCreated((Case) data.getSerializableExtra(EXTRA_DESK_CASE)); } } super.onActivityResult(requestCode, resultCode, data); }
Source:
<code>public void notifyEventTriggered(@NonNull final IEvent event) { sharedLogger.d(event.getTrackingKey() + " event triggered"); totalEventCountRulesManager.notifyEventTriggered(event); firstEventTimeRulesManager.notifyEventTriggered(event); lastEventTimeRulesManager.notifyEventTriggered(event); lastEventVersionCodeRulesManager.notifyEventTriggered(event); lastEventVersionNameRulesManager.notifyEventTriggered(event); if (event == USER_GAVE_POSITIVE_FEEDBACK) { final Activity activity = activityReferenceManager.getValidatedActivity(); if (activity != null) { for (final IFeedbackCollector positiveFeedbackCollector : positiveFeedbackCollectors) { final boolean feedbackCollected = positiveFeedbackCollector.collectFeedback(activity); if (feedbackCollected) { return; } } } } else if (event == USER_GAVE_CRITICAL_FEEDBACK) { final Activity activity = activityReferenceManager.getValidatedActivity(); if (activity != null) { for (final IFeedbackCollector criticalFeedbackCollector : criticalFeedbackCollectors) { final boolean feedbackCollected = criticalFeedbackCollector.collectFeedback(activity); if (feedbackCollected) { return; <START> } <END> } } } }</code><technical_language><b>Reporter: </b>PMD<br /><b>Violation: </b><a target="_blank" href="<LINK_0>">AvoidDeeplyNestedIfStmts</a><br /><b>Notes: </b>Deeply nested if..then statements hard read</technical_language>

Target:
public void notifyEventTriggered(@NonNull final IEvent event) { sharedLogger.d(event.getTrackingKey() + " event triggered"); totalEventCountRulesManager.notifyEventTriggered(event); firstEventTimeRulesManager.notifyEventTriggered(event); lastEventTimeRulesManager.notifyEventTriggered(event); lastEventVersionCodeRulesManager.notifyEventTriggered(event); lastEventVersionNameRulesManager.notifyEventTriggered(event); if (event == USER_GAVE_POSITIVE_FEEDBACK) { final Activity activity = activityReferenceManager.getValidatedActivity(); if (activity == null) { return; } for (final IFeedbackCollector positiveFeedbackCollector : positiveFeedbackCollectors) { if (positiveFeedbackCollector.tryCollectingFeedback( activity, new App(applicationContext), new Environment(applicationContext), new Device(applicationContext))) { return; } } } else if (event == USER_GAVE_CRITICAL_FEEDBACK) { final Activity activity = activityReferenceManager.getValidatedActivity(); if (activity == null) { return; } for (final IFeedbackCollector criticalFeedbackCollector : criticalFeedbackCollectors) { if (criticalFeedbackCollector.tryCollectingFeedback( activity, new App(applicationContext), new Environment(applicationContext), new Device(applicationContext))) { return; } } } }
Source:
<code>public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; solrMapper.configure(); <START> if (solrConfig.enableKerberos()) <END> HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer()); this.solrClient = new CloudSolrClient(solrConfig.getZkHostString()); this.toCommitTuples = new ArrayList<>(capacity()); }</code><technical_language>This moved solrMapper.configure() need set in code path</technical_language>

Target:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; if (solrConfig.isKerberosEnabled()) HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer()); this.solrClient = new CloudSolrClient(solrConfig.getZkHostString()); this.toCommitTuples = new ArrayList<>(capacity()); }
Source:
<code><START> public void testWithDifferentAWSCredentialsForDynamoDBAndCloudWatch() { <END> String test = StringUtils.join(new String[] { "streamName = a", "applicationName = b", "AWSCredentialsProvider = " + credentialName1, "AWSCredentialsProviderDynamoDB = " + credentialName1, "AWSCredentialsProviderCloudWatch = " + credentialName1, "failoverTimeMillis = 100", "shardSyncIntervalMillis = 500" }, '\n'); InputStream input = new ByteArrayInputStream(test.getBytes()); try { KinesisClientLibConfiguration config = configurator.getConfiguration(input); config.getKinesisCredentialsProvider().getCredentials(); fail("expect failure with wrong credentials provider"); } catch (Exception e) { } }</code><technical_language>This test appears succeed current code. sense test class names for credential provider. credential decoder ability load [custom class names](<LINK_0></technical_language>

Target:
public void testWithDifferentAWSCredentialsForDynamoDBAndCloudWatch() { String test = StringUtils.join(new String[] { "streamName = a", "applicationName = b", "AWSCredentialsProvider = " + credentialNameKinesis, "AWSCredentialsProviderDynamoDB = " + credentialNameDynamoDB, "AWSCredentialsProviderCloudWatch = " + credentialNameCloudWatch, "failoverTimeMillis = 100", "shardSyncIntervalMillis = 500" }, '\n'); InputStream input = new ByteArrayInputStream(test.getBytes()); KinesisClientLibConfiguration config = configurator.getConfiguration(input); try { config.getKinesisCredentialsProvider().getCredentials(); } catch (Exception e) { fail("Kinesis credential providers should not fail."); } try { config.getDynamoDBCredentialsProvider().getCredentials(); } catch (Exception e) { fail("DynamoDB credential providers should not fail."); } try { config.getCloudWatchCredentialsProvider().getCredentials(); } catch (Exception e) { fail("CloudWatch credential providers should not fail."); } }
Source:
<code>public void testSHEmptyRecycleBin() { try { File f = createTempFile(); W32FileUtils.getInstance().moveToTrash(new File[] { f }); int result = Shell32.INSTANCE.SHEmptyRecycleBin(null, null, Shell32.SHERB_NOCONFIRMATION | Shell32.SHERB_NOPROGRESSUI | Shell32.SHERB_NOSOUND); <START> assertTrue(result == 0); <END> } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>java assertEquals("Unexpected failure code", ERROR_SUCCESS, result); Try provide information failure - in this case, failed why</technical_language>

Target:
public void testSHEmptyRecycleBin() { File file = new File(System.getProperty("java.io.tmpdir"), System.nanoTime() + ".txt"); try { try { fillTempFile(file); W32FileUtils.getInstance().moveToTrash(new File[] { file }); } catch (IOException e) { throw new RuntimeException(e); } int result = Shell32.INSTANCE.SHEmptyRecycleBin(null, null, Shell32.SHERB_NOCONFIRMATION | Shell32.SHERB_NOPROGRESSUI | Shell32.SHERB_NOSOUND); assertEquals("Result should have been ERROR_SUCCESS when emptying Recycle Bin - there should have been a file in it.", W32Errors.ERROR_SUCCESS, result); } finally { if (file.exists()) { file.delete(); } } }
Source:
<code>public static StateTransition transitionBetween(State fromState, State toState){ <START> final StateTransition stateTransition = STATE_TRANSITION_MAP.get(new Tuple2<>(fromState, toState)); <END> if(stateTransition == null) { throw new IllegalStateException( String.format("Illegal state transition from %s to %s", fromState.toString(), toState.toString())); } return stateTransition; }</code><technical_language>Tuple.of()</technical_language>

Target:
public static StateTransition transitionBetween(State fromState, State toState){ final StateTransition stateTransition = STATE_TRANSITION_MAP.get(Tuple.of(fromState, toState)); if(stateTransition == null) { throw new IllegalStateException( String.format("Illegal state transition from %s to %s", fromState.toString(), toState.toString())); } return stateTransition; }
Source:
<code>private CSVWriter initCSVWriter(String path) { try { CSVWriter writer = new CSVWriter( new FileWriter(path), ';'); String[] headerLine = new String[] { "Rule Id", "Problem type", "Title", "Description", "Links", "Application", "File Name", "File Path", "Line", "Story points" }; writer.writeNext(headerLine); return writer; } catch (IOException e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>Yes, throw exception print STDERR create CSV. user notified, exception rethrown. This ensure error appears in rule-providers report a "failed" status for ExportCSVFileRuleProvider</technical_language>

Target:
private CSVWriter initCSVWriter(String path) { try { CSVWriter writer = new CSVWriter( new FileWriter(path), ';'); String[] headerLine = new String[] { "Rule Id", "Problem type", "Title", "Description", "Links", "Application", "File Name", "File Path", "Line", "Story points" }; writer.writeNext(headerLine); return writer; } catch (IOException e) { System.err.println("Windup was not able to create a CSV file " + path + ". CSV Export will not be generated."); throw new WindupException("Unable to create file " + path, e); } }
Source:
<code>public DefaultDockerClient(final URI uri) { URI originalUri = checkNotNull(uri, "uri"); <START> ClientConfig config = DEFAULT_CONFIG <END> .connectorProvider(new ApacheConnectorProvider()) .property(ApacheClientProperties.CONNECTION_MANAGER, new PoolingHttpClientConnectionManager(getSchemeRegistry(originalUri))); this.client = ClientBuilder.newClient(config); if (originalUri.getScheme().equals("unix")) { this.uri = UnixConnectionSocketFactory.sanitizeUri(originalUri); } else { this.uri = originalUri; } }</code><technical_language>final</technical_language>

Target:
public DefaultDockerClient(final URI uri) { this(new Builder().uri(uri)); }
Source:
<code>public void attachmentStandalone() throws IOException, URISyntaxException { byte[] bytesToDB = "binary data".getBytes(); ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB); Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain"); Document doc = db.find(Document.class, response.getId()); assertTrue(doc.getAttachments().containsKey("foo.txt")); <START> HttpConnection conn = Http.GET(new URI(db.getDBUri() + "/" + response.getId() + "/foo.txt")); <END> InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream(); ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); int n; while ((n = in.read()) != -1) { bytesOut.write(n); } bytesOut.flush(); in.close(); byte[] bytesFromDB = bytesOut.toByteArray(); assertArrayEquals(bytesToDB, bytesFromDB); }</code><technical_language>Is this of string concatenation intentional? I DatabaseURIHelper here, do this is alternative code path for building URL this serves check URL encoded correctly production code</technical_language>

Target:
public void attachmentStandalone() throws IOException, URISyntaxException { byte[] bytesToDB = "binary data".getBytes(); ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB); Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain"); Document doc = db.find(Document.class, response.getId()); assertTrue(doc.getAttachments().containsKey("foo.txt")); HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri()) .attachmentUri(response.getId(), "foo.txt")); InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream(); ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); int n; while ((n = in.read()) != -1) { bytesOut.write(n); } bytesOut.flush(); in.close(); byte[] bytesFromDB = bytesOut.toByteArray(); assertArrayEquals(bytesToDB, bytesFromDB); }
Source:
<code>public void setWS(String ws) { incrementSequenceNumber(); fWS = ws; if (fRoot != null && ws != null && <START> ws.length() > 0) { <END> Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.WS); nlNode.setTextContent(ws); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.WS); } }</code><technical_language>Please !string.isEmpty()</technical_language>

Target:
public void setWS(String ws) { incrementSequenceNumber(); fWS = ws; if (fRoot != null && ws != null && !ws.isEmpty()) { Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.WS); nlNode.setTextContent(ws); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.WS); } }
Source:
<code>public void lostConnection() { if (scheduledTask != null && !scheduledTask.isDone()) { return; } logger.info("Try to restore connection to '{}' every {}ms", getBrokerConnection().getName(), getReconnectFrequency()); this.scheduledTask = scheduler.scheduleWithFixedDelay(() -> { try { <START> getBrokerConnection().start(); <END> } catch (MqttException | ConfigurationException e) { logger.warn("Broker connection couldn't be started", e); } }, getFirstReconnectAfter(), getReconnectFrequency(), TimeUnit.MILLISECONDS); }</code><technical_language>connection established lost connection called a callback potential thread. omit read / write locks? functions called thread time (also isReconnecting)</technical_language>

Target:
public synchronized void lostConnection() { if (closed) { return; } if (scheduledTask != null && !scheduledTask.isDone()) { return; } logger.info("Try to restore connection to '{}' every {}ms", getBrokerConnection().getName(), getReconnectFrequency()); scheduledTask = scheduler.scheduleWithFixedDelay(() -> { try { getBrokerConnection().start(); } catch (MqttException | ConfigurationException e) { logger.warn("Broker connection couldn't be started", e); } }, getFirstReconnectAfter(), getReconnectFrequency(), TimeUnit.MILLISECONDS); }
Source:
<code>public boolean isAllowOtherReadResult(String datasource) { <START> return Boolean.parseBoolean(properties.getProperty("allow.other.read.result." + datasource)); <END> }</code><technical_language>please !Boolean.parseBoolean(... default is true</technical_language>

Target:
public boolean isAllowOtherReadResult(String datasource) { String property = properties.getProperty("allow.other.read.result." + datasource); if (property == null) { return true; } return Boolean.parseBoolean(property); }
Source:
<code>private List<PodData> getAllInjectablePods( ObjectMeta toCreateMeta, List<Container> toCreateContainers, Map<String, Map<String, Pod>> injectables) { <START> Set<String> machinesInPod = getMachineNames(toCreateMeta, toCreateContainers); <END> return machinesInPod .stream() .map(injectables::get) .filter(Objects::nonNull) .flatMap(m -> m.entrySet().stream()) .collect(toMap(Entry::getKey, Entry::getValue, (v1, v2) -> v1)) .values() .stream() .map(PodData::new) .collect(Collectors.toList()); }</code><technical_language>need collect getMachineNames if stream next line. return Stream getMachineNames is necessary inline it. If want split long stream chain I do Stream<String> machinesInPod = containers.stream().map(c -> Names.machineName(podMeta, c)); return machinesInPod .map(...</technical_language>

Target:
private List<PodData> getAllInjectablePods( ObjectMeta toCreateMeta, List<Container> toCreateContainers, Map<String, Map<String, Pod>> injectables) { return toCreateContainers .stream() .map(c -> Names.machineName(toCreateMeta, c)) .map(injectables::get) .filter(Objects::nonNull) .flatMap(m -> m.entrySet().stream()) .collect(toMap(Entry::getKey, Entry::getValue, (v1, v2) -> v1)) .values() .stream() .map(PodData::new) .collect(Collectors.toList()); }
Source:
<code>public static String prependIfNotEmpty(final String str, final String prefix) { <START> return isEmpty(str) ? EMPTY : defaultString(prefix) + str; <END> }</code><technical_language>suggestion return isEmpty(str) ? str : defaultString(prefix) + str;</technical_language>

Target:
public static String prependIfNotEmpty(final String str, final String prefix) { if (isEmpty(prefix) || isEmpty(str)) { return str; } return prefix + str; }
Source:
<code>protected void okPressed() { Collection<String> selectedItems = asString(items.getSelection()); <START> List<String> names = (List<String>) ConfigInfo.names(available); <END> boolean anyMatch = selectedItems.stream().anyMatch(names::contains); if (anyMatch) { selected = asString(items.getSelection()); super.okPressed(); } }</code><technical_language>need cast suggestion Collection<String> names = ConfigInfo.names(available);</technical_language>

Target:
protected void okPressed() { Collection<String> selectedItems = asString(items.getSelection()); List<String> names = ConfigInfo.names(available); boolean anyMatch = selectedItems.stream().anyMatch(names::contains); if (anyMatch) { selected = asString(items.getSelection()); super.okPressed(); } }
Source:
<code>public ErrorParserManager(IProject project, URI baseDirectoryURI, IMarkerGenerator markerGenerator, String[] parsersIDs) { fProject = project; fMarkerGenerator = markerGenerator; fDirectoryStack = new Vector<URI>(); fErrors = new ArrayList<ProblemMarkerInfo>(); enableErrorParsers(parsersIDs); <START> if (baseDirectoryURI != null) <END> fBaseDirectoryURI = baseDirectoryURI; else if (project != null) fBaseDirectoryURI = project.getLocationURI(); else fBaseDirectoryURI = org.eclipse.core.filesystem.URIUtil.toURI(System.getProperty("user.dir")); }</code><technical_language>Please bring braces back</technical_language>

Target:
public ErrorParserManager(IProject project, URI baseDirectoryURI, IMarkerGenerator markerGenerator, String[] parsersIDs) { fProject = project; fMarkerGenerator = markerGenerator; fDirectoryStack = new Vector<URI>(); fErrors = new ArrayList<ProblemMarkerInfo>(); enableErrorParsers(parsersIDs); if (baseDirectoryURI != null) { fBaseDirectoryURI = baseDirectoryURI; } else if (project != null) { fBaseDirectoryURI = project.getLocationURI(); } else { fBaseDirectoryURI = org.eclipse.core.filesystem.URIUtil.toURI(System.getProperty("user.dir")); } }
Source:
<code>private void getData(String sessionId) { if (sessionId.equals(this.sessionId)) { return; } this.sessionId = sessionId; SessionMatchingSetup sessionMatchingSetup = new SessionMatchingSetup( <START> databaseService.getWebClientProperties().isShowOnlyMatchedTests(), <END> EnumSet.of(SessionMatchingSetup.MatchBy.ALL)); RootNode controlTree = databaseService.getControlTreeForSessions( new HashSet<String>(Arrays.asList(sessionId)), sessionMatchingSetup); fetchSessionScopeData(controlTree); fetchPerTestData(controlTree); }</code><technical_language>properties already. please replace true</technical_language>

Target:
private void getData(String sessionId) { if (sessionId.equals(this.sessionId)) { return; } this.sessionId = sessionId; SessionMatchingSetup sessionMatchingSetup = new SessionMatchingSetup( true, EnumSet.of(SessionMatchingSetup.MatchBy.ALL)); RootNode controlTree = databaseService.getControlTreeForSessions( new HashSet<String>(Arrays.asList(sessionId)), sessionMatchingSetup); fetchSessionScopeData(controlTree); fetchPerTestData(controlTree); }
Source:
<code>public void onPostUploaded(OnPostUploaded event) { final PostModel post = event.post; if (post != null && post.getId() == mPost.getId()) { <START> if (!(mPostLoadingState == PostLoadingState.UPLOADING_FOR_PREVIEW) <END> && !(mPostLoadingState == PostLoadingState.REMOTE_AUTO_SAVING_FOR_PREVIEW) && !(mPostLoadingState == PostLoadingState.PREVIEWING) && !(mPostLoadingState == PostLoadingState.REMOTE_AUTO_SAVE_PREVIEW_ERROR) ) { View snackbarAttachView = findViewById(R.id.editor_activity); UploadUtils.onPostUploadedSnackbarHandler(this, snackbarAttachView, event.isError(), post, event.isError() ? event.error.message : null, getSite(), mDispatcher); if (!event.isError()) { mPost = post; mIsNewPost = false; invalidateOptionsMenu(); } } else { if (!event.isError() && !(mPostLoadingState == PostLoadingState.PREVIEWING) && !(mPostLoadingState == PostLoadingState.REMOTE_AUTO_SAVE_PREVIEW_ERROR) ) { mPost = post; mIsNewPost = false; invalidateOptionsMenu(); ActivityLauncher.previewPostOrPageForResult( EditPostActivity.this, mSite, mPost, mPostLoadingState == PostLoadingState.UPLOADING_FOR_PREVIEW ? RemotePreviewLogicHelper.RemotePreviewType.REMOTE_PREVIEW : RemotePreviewLogicHelper.RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE ); updatePostLoadingAndDialogState(PostLoadingState.PREVIEWING, mPost); } else if (event.isError() || (mPostLoadingState == PostLoadingState.REMOTE_AUTO_SAVE_PREVIEW_ERROR)) { updatePostLoadingAndDialogState(PostLoadingState.NONE); UploadUtils.showSnackbarError(findViewById(R.id.editor_activity), getString(R.string.remote_preview_operation_error)); } } } }</code><technical_language>thanks</technical_language>

Target:
public void onPostUploaded(OnPostUploaded event) { final PostModel post = event.post; if (post != null && post.getId() == mPost.getId()) { if (!isRemotePreviewingFromEditor()) { View snackbarAttachView = findViewById(R.id.editor_activity); UploadUtils.onPostUploadedSnackbarHandler(this, snackbarAttachView, event.isError(), post, event.isError() ? event.error.message : null, getSite(), mDispatcher); updatePostOnSuccessfulUpload(event, post); } else { if (!event.isError() && isUploadingPostForPreview()) { updatePostOnSuccessfulUpload(event, post); ActivityLauncher.previewPostOrPageForResult( EditPostActivity.this, mSite, post, mPostLoadingState == PostLoadingState.UPLOADING_FOR_PREVIEW ? RemotePreviewLogicHelper.RemotePreviewType.REMOTE_PREVIEW : RemotePreviewLogicHelper.RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE ); updatePostLoadingAndDialogState(PostLoadingState.PREVIEWING, mPost); } else if (event.isError() || isRemoteAutoSaveError()) { updatePostLoadingAndDialogState(PostLoadingState.NONE); UploadUtils.showSnackbarError(findViewById(R.id.editor_activity), getString(R.string.remote_preview_operation_error)); } } } }
Source:
<code>public void removeChildrenFromLRU() { if (children != null) { for (ExpressionInfo child : children) { removeChildFromLRU(child); } children = null; numChildrenHint = 0; } if (fakeChildren != null) { for (ExpressionInfo fakeChild : fakeChildren) { if (fakeChild == null) { break; } removeChildFromLRU(fakeChild); } clearFakeChildren(); <START> } <END> }</code><technical_language>fakeChildren removal cleaned a Vector</technical_language>

Target:
public void removeChildrenFromLRU() { if (children != null) { for (ExpressionInfo child : children) { removeChildFromLRU(child); } children = null; numChildrenHint = 0; } for (ExpressionInfo fakeChild : fakeChildren) { removeChildFromLRU(fakeChild); } fakeChildren.clear(); }
Source:
<code>public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order orderPlaced : ordersPlaced) { <START> if ((orderPlaced instanceof BuyOrder) && (newOrder instanceof BuyOrder)){ if ((orderPlaced instanceof SellOrder) <END> && (newOrder instanceof SellOrder)){ if (orderPlaced.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } } return false; }</code><technical_language>long hard understand if content. split this if s booleans</technical_language>

Target:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order orderPlaced : ordersPlaced) { boolean isBuyOrder = (orderPlaced instanceof BuyOrder) && (newOrder instanceof BuyOrder); boolean isSellOrder = (orderPlaced instanceof SellOrder) && (newOrder instanceof SellOrder); if (isBuyOrder && isSellOrder){ if (orderPlaced.getStockSymbol().equals(newOrder.getStockSymbol())) { return true; } } } return false; }
Source:
<code>public void save() { Settings settings = load(); try (OutputStream outputStream = new FileOutputStream(new File(settingsFileName))) { DefaultPropertiesPersister persister = new DefaultPropertiesPersister(); persister.store(settings.getProperties(), outputStream, "Phoenicis User Settings"); <START> } catch (Exception e) { <END> e.printStackTrace(); } }</code><technical_language>catch a more specific exception here? Thanks :-)</technical_language>

Target:
public void save() { Settings settings = load(); try (OutputStream outputStream = new FileOutputStream(new File(settingsFileName))) { DefaultPropertiesPersister persister = new DefaultPropertiesPersister(); persister.store(settings.getProperties(), outputStream, "Phoenicis User Settings"); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void run() { <START> dataLakeFileClient.upload(createRandomInputStream(options.getSize()), options.getSize(), true); <END> }</code><technical_language>Reuse input stream</technical_language>

Target:
public void run() { inputStream.reset(); dataLakeFileClient.upload(inputStream, options.getSize(), true); }
Source:
<code>private void xorHeaders(RawPacket source, RawPacket dest) { <START> dest.getBuffer()[0] ^= source.getBuffer()[0]; <END> dest.getBuffer()[1] ^= source.getBuffer()[1]; int length = (source.getLength() & 0xffff) - RawPacket.FIXED_HEADER_SIZE; dest.getBuffer()[2] ^= (length >> 8); dest.getBuffer()[3] ^= (length & 0x00ff); dest.getBuffer()[4] ^= source.getBuffer()[4]; dest.getBuffer()[5] ^= source.getBuffer()[5]; dest.getBuffer()[6] ^= source.getBuffer()[6]; dest.getBuffer()[7] ^= source.getBuffer()[7]; }</code><technical_language>current code creates 'dest' offset of 0, need account for 'source'</technical_language>

Target:
private void xorHeaders(RawPacket source, RawPacket dest) { dest.getBuffer()[0] ^= source.getBuffer()[source.getOffset() + 0]; dest.getBuffer()[1] ^= source.getBuffer()[source.getOffset() + 1]; int length = (source.getLength() & 0xffff) - RawPacket.FIXED_HEADER_SIZE; dest.getBuffer()[2] ^= (length >> 8); dest.getBuffer()[3] ^= (length & 0x00ff); dest.getBuffer()[4] ^= source.getBuffer()[source.getOffset() + 4]; dest.getBuffer()[5] ^= source.getBuffer()[source.getOffset() + 5]; dest.getBuffer()[6] ^= source.getBuffer()[source.getOffset() + 6]; dest.getBuffer()[7] ^= source.getBuffer()[source.getOffset() + 7]; }
Source:
<code>public Connection getDBConnection(DataSource dataSource, boolean autoCommit) throws SQLException { UnitOfWorkTransactionContext unitOfWorkTransactionContext = transactionContextThreadLocal.get(); if (unitOfWorkTransactionContext == null) { <START> throw new UnitOfWorkException("There is no transaction getting started"); <END> } Connection connection = unitOfWorkTransactionContext.getDBConnection(dataSource); if (!autoCommit) { connection.setAutoCommit(autoCommit); } return connection; }</code><technical_language>throw new UnitOfWorkException("Can get a connection Transaction context is started for datasource : "+ dataSource );</technical_language>

Target:
public Connection getDBConnection(DataSource dataSource, boolean autoCommit) throws SQLException { UnitOfWorkTransactionContext unitOfWorkTransactionContext = transactionContextThreadLocal.get(); if (unitOfWorkTransactionContext == null) { throw new UnitOfWorkException( "Can not get a connection as Transaction context is not started for dataSource : " + dataSource); } Connection connection = unitOfWorkTransactionContext.getDBConnection(dataSource); if (!autoCommit && connection.getAutoCommit()) { connection.setAutoCommit(autoCommit); } return connection; }
Source:
<code>public List<String> getSuggestions(CommandSource source, String arguments) throws CommandException { final List<String> retList = new ArrayList<String>(); this.command.addTabCompletionOptions((ICommandSender) source, arguments.split(" "), null); <START> return retList; <END> }</code><technical_language>retList is empty. passed call addTabCompletionOptions</technical_language>

Target:
public List<String> getSuggestions(CommandSource source, String arguments) throws CommandException { return this.command.addTabCompletionOptions((ICommandSender) source, arguments.split(" "), null); }