auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException, InterruptedException { FileSplit split = (FileSplit) genericSplit; Configuration job = context.getConfiguration(); file = split.getPath(); FileSystem fs = file.getFileSystem(job); fileIn = fs.open(split.getPath()); String sheetName = job.get(SHEET_NAME); int sheetIndx = job.getInt(SHEET_NO, -1); Sheet sheet = null; try { Workbook workbook = WorkbookFactory.create(fileIn); if (sheetIndx < 0 && sheetName != null && !sheetName.isEmpty()) { sheet = workbook.getSheet(sheetName); } else { sheet = workbook.getSheetAt(sheetIndx); } <START> <END> } catch (Exception e) { throw new IllegalArgumentException("Exception while reading excel sheet. " + e.getMessage(), e); } fileRowLimitMap.put(file.getName(), job.getInt(ROWS_LIMIT, sheet.getPhysicalNumberOfRows())); rows = sheet.iterator(); lastRowNum = sheet.getLastRowNum(); rowIdx = 0; boolean skipFirstRow = job.getBoolean(SKIP_FIRST_ROW, false); if (skipFirstRow) { if (rows.hasNext()) { rowIdx = 1; } rows.next(); } }</code><technical_language>remove line</technical_language>

Target:
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException, InterruptedException { FileSplit split = (FileSplit) genericSplit; Configuration job = context.getConfiguration(); file = split.getPath(); FileSystem fs = file.getFileSystem(job); fileIn = fs.open(split.getPath()); String sheet = job.get(SHEET); String sheetValue = job.get(SHEET_VALUE); Sheet workSheet = null; try { Workbook workbook = WorkbookFactory.create(fileIn); if (sheet.equalsIgnoreCase(SHEET_NAME)) { workSheet = workbook.getSheet(sheetValue); } else { workSheet = workbook.getSheetAt(Integer.parseInt(sheetValue)); } } catch (Exception e) { throw new IllegalArgumentException("Exception while reading excel sheet. " + e.getMessage(), e); } rowCount = job.getInt(ROWS_LIMIT, workSheet.getPhysicalNumberOfRows()); rows = workSheet.iterator(); lastRowNum = workSheet.getLastRowNum(); rowIdx = 0; boolean skipFirstRow = job.getBoolean(SKIP_FIRST_ROW, false); if (skipFirstRow) { if (rows.hasNext()) { rowIdx = 1; } rows.next(); } }
Source:
<code>public void testFileOpen() throws IOException { Uri uri = Uri.parse("file:/ doReturn(mContentResolver).when(mContext).getContentResolver(); doReturn(mFileInputStream).when(mContentResolver).openInputStream(uri); <START> doReturn(10, -1).when(mFileInputStream).read(any(), <END> eq(0), eq(4096)); BluetoothOppSendFileInfo sendFileInfo = BluetoothOppSendFileInfo.generateFileInfo( mContext, uri, "text/plain", false); assertThat(sendFileInfo).isNotEqualTo(BluetoothOppSendFileInfo.SEND_FILE_INFO_ERROR); assertThat(sendFileInfo.mFileName).isEqualTo("OppTestFile.txt"); assertThat(sendFileInfo.mMimetype).isEqualTo("text/plain"); assertThat(sendFileInfo.mLength).isEqualTo(10); assertThat(sendFileInfo.mInputStream).isEqualTo(mFileInputStream); assertThat(sendFileInfo.mStatus).isEqualTo(0); }</code><technical_language>a private static final int track this verifying number</technical_language>

Target:
public void testFileOpen() throws IOException { Uri uri = Uri.parse("file:/ doReturn(mContentResolver).when(mContext).getContentResolver(); doReturn(mFileInputStream).when(mContentResolver).openInputStream(uri); doReturn(TEST_FILE_SIZE, -1).when(mFileInputStream).read(any(), eq(0), eq(4096)); BluetoothOppSendFileInfo sendFileInfo = BluetoothOppSendFileInfo.generateFileInfo( mContext, uri, "text/plain", false); assertThat(sendFileInfo).isNotEqualTo(BluetoothOppSendFileInfo.SEND_FILE_INFO_ERROR); assertThat(sendFileInfo.mFileName).isEqualTo("OppTestFile.txt"); assertThat(sendFileInfo.mMimetype).isEqualTo("text/plain"); assertThat(sendFileInfo.mLength).isEqualTo(10); assertThat(sendFileInfo.mInputStream).isEqualTo(mFileInputStream); assertThat(sendFileInfo.mStatus).isEqualTo(0); }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_language_list_entry, parent, false); } PageTitle langLink = (PageTitle) getItem(position); String wikiCode = langLink.getSite().getLanguage(); int langIndex = app.findWikiIndex(wikiCode); String localName = app.localNameFor(langIndex); TextView langLocalNameText = (TextView) convertView.findViewById(R.id.language_local_name); TextView articleLocalNameText = (TextView) convertView.findViewById(R.id.article_local_name); langLocalNameText.setText(localName); articleLocalNameText.setText(langLink.getText()); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); <START> Bidi bidi = new Bidi(localName, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT); <END> if (bidi.getBaseLevel() == 0) { params.gravity = Gravity.LEFT; } else { params.gravity = Gravity.RIGHT; } langLocalNameText.setLayoutParams(params); articleLocalNameText.setLayoutParams(params); return convertView; }</code><technical_language>This is pretty clever, simpler: need do is set layout_width of TextViews match_parent, text directionality effect automatically (no need set layout params dynamically)</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_language_list_entry, parent, false); } PageTitle langLink = (PageTitle) getItem(position); String wikiCode = langLink.getSite().getLanguage(); int langIndex = app.findWikiIndex(wikiCode); String localName = app.localNameFor(langIndex); TextView langLocalNameText = (TextView) convertView.findViewById(R.id.language_local_name); TextView articleLocalNameText = (TextView) convertView.findViewById(R.id.article_local_name); langLocalNameText.setText(localName); articleLocalNameText.setText(langLink.getText()); return convertView; }
Source:
<code>public Attribute setLabelAttribute(Boolean isLabelAttr) { set(IS_LABEL_ATTRIBUTE, isLabelAttr); <START> if (isLabelAttr != null && isLabelAttr) <END> { setNillable(false); } return this; }</code><technical_language>ususally put logic in entity class. confusing this setter side effects: addAttribute("blah").setNillable(true).setLabelAttribute(true)</technical_language>

Target:
public Attribute setLabelAttribute(Boolean isLabelAttr) { set(IS_LABEL_ATTRIBUTE, isLabelAttr); return this; }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.display_parameters: AnalyticsHelper.sendEventHit("Filters", AnalyticsHelper.CLICK, "YES"); createDialog(); default: <START> return super.onOptionsItemSelected(item); <END> } }</code><technical_language>uh, this method is kinda necessary..</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent i = getParentActivityIntent().putExtra("forceMainMenu", true); NavUtils.navigateUpTo(this, i); return super.onOptionsItemSelected(item); case R.id.display_parameters: AnalyticsHelper.sendEventHit("Filters", AnalyticsHelper.CLICK, "YES"); createDialog(); default: return super.onOptionsItemSelected(item); } }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Kind.STRING_LITERAL, ctx -> { PyStringLiteralTree tree = (PyStringLiteralTree) ctx.syntaxNode(); String stringLiteral = tree.trimmedQuotesValue().toLowerCase(); if (UNIX_WRITABLE_DIRECTORIES.stream().anyMatch(stringLiteral::startsWith) || <START> WINDOWS_WRITABLE_DIRECTORIES.matcher(stringLiteral).matches()) { <END> ctx.addIssue(tree, MESSAGE); } }); context.registerSyntaxNodeConsumer(Kind.CALL_EXPR, ctx -> { PyCallExpressionTree tree = (PyCallExpressionTree) ctx.syntaxNode(); if (isOsEnvironCall(tree, ctx.symbolTable().getSymbol(tree)) && tree.arguments().stream().anyMatch(this::isNonCompliantOsEnvironArgument)) { ctx.addIssue(tree, MESSAGE); } }); context.registerSyntaxNodeConsumer(Kind.SUBSCRIPTION, ctx -> { PySubscriptionExpressionTree tree = (PySubscriptionExpressionTree) ctx.syntaxNode(); if (isOsEnvironQualifiedExpression(tree.object()) && tree.subscripts().expressions().stream().anyMatch(this::isNonCompliantOsEnvironArgument)) { ctx.addIssue(tree, MESSAGE); } }); }</code><technical_language>I refine avoid some FPs: open("/tmpx") open("C:\Temperatures")</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Kind.STRING_LITERAL, ctx -> { PyStringLiteralTree tree = (PyStringLiteralTree) ctx.syntaxNode(); String stringLiteral = tree.trimmedQuotesValue().toLowerCase(Locale.ENGLISH); if (UNIX_WRITABLE_DIRECTORIES.stream().anyMatch(dir -> containsDirectory(stringLiteral, dir)) || WINDOWS_WRITABLE_DIRECTORIES.matcher(stringLiteral).matches()) { ctx.addIssue(tree, MESSAGE); } }); context.registerSyntaxNodeConsumer(Kind.CALL_EXPR, ctx -> { PyCallExpressionTree tree = (PyCallExpressionTree) ctx.syntaxNode(); if (isOsEnvironGetter(tree.callee(), ctx.symbolTable()) && tree.arguments().stream().map(PyArgumentTree::expression) .anyMatch(PubliclyWritableDirectoriesCheck::isNonCompliantOsEnvironArgument)) { ctx.addIssue(tree, MESSAGE); } }); context.registerSyntaxNodeConsumer(Kind.SUBSCRIPTION, ctx -> { PySubscriptionExpressionTree tree = (PySubscriptionExpressionTree) ctx.syntaxNode(); if (isOsEnvironQualifiedExpression(tree.object(), ctx.symbolTable()) && tree.subscripts().expressions().stream() .anyMatch(PubliclyWritableDirectoriesCheck::isNonCompliantOsEnvironArgument)) { ctx.addIssue(tree, MESSAGE); } }); }
Source:
<code>public static void main(String[] args) throws Exception { final NiftyBootstrap bootstrap = Guice.createInjector( Stage.PRODUCTION, new NiftyModule() { @Override protected void configureNifty() { bind().toInstance(new ThriftServerDefBuilder() .listen(8080) <START> .withProcessor(new scribe.Processor<scribe <END> .Iface>(new scribe.Iface() { @Override public ResultCode Log(List<LogEntry> messages) throws TException { for (LogEntry message : messages) { log.info("%s: %s", message.getCategory(), message.getMessage()); } return ResultCode.OK; } })) .withSSLConfiguration( new SSLServerConfiguration.Builder() .certFile("nifty-examples/certs/rsa.crt") .keyFile("nifty-examples/certs/rsa.key") .build()) .build() ); withNettyServerConfig(NettyConfigProvider.class); } } ).getInstance(NiftyBootstrap.class); bootstrap.start(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { bootstrap.stop(); } }); }</code><technical_language>This weird -- wrap</technical_language>

Target:
public static void main(String[] args) throws Exception { final NiftyBootstrap bootstrap = Guice.createInjector( Stage.PRODUCTION, new NiftyModule() { @Override protected void configureNifty() { SessionTicketKey[] keys = { createFakeSessionTicketKey() }; bind().toInstance(new ThriftServerDefBuilder() .listen(8080) .withProcessor(new scribe.Processor<scribe.Iface>(new scribe.Iface() { @Override public ResultCode Log(List<LogEntry> messages) throws TException { for (LogEntry message : messages) { log.info("%s: %s", message.getCategory(), message.getMessage()); } return ResultCode.OK; } })).withSSLConfiguration( OpenSslServerConfiguration.newBuilder() .certFile(new File(getClass().getResource("/rsa.crt").getFile())) .keyFile(new File(getClass().getResource("/rsa.key").getFile())) .allowPlaintext(true) .ticketKeys(keys) .build()) .build() ); withNettyServerConfig(NettyConfigProvider.class); } } ).getInstance(NiftyBootstrap.class); bootstrap.start(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { bootstrap.stop(); } }); }
Source:
<code>public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Subscription Creation Webservice Workflow.. "); } SubscriptionWorkflowDTO subsWorkflowDTO = (SubscriptionWorkflowDTO) workflowDTO; String callBackURL = subsWorkflowDTO.getCallbackUrl(); String message="Approve API ["+ subsWorkflowDTO.getApiName()+" - "+subsWorkflowDTO.getApiVersion()+ "] subscription creation request from subscriber - "+subsWorkflowDTO.getSubscriber()+ " for the application - "+subsWorkflowDTO.getApplicationName(); workflowDTO.setWorkflowDescription(message); workflowDTO.setMetadata("apiName", subsWorkflowDTO.getApiName()); workflowDTO.setMetadata("apiVersion", subsWorkflowDTO.getApiVersion()); workflowDTO.setMetadata("apiContext", subsWorkflowDTO.getApiContext()); workflowDTO.setMetadata("apiProvider", subsWorkflowDTO.getApiProvider()); workflowDTO.setMetadata("apiSubscriber", subsWorkflowDTO.getSubscriber()); workflowDTO.setMetadata("applicationName", subsWorkflowDTO.getApplicationName()); workflowDTO.setMetadata("TierName", subsWorkflowDTO.getTierName()); workflowDTO.setMetadata("workflowExternalRef", subsWorkflowDTO.getExternalWorkflowReference()); workflowDTO.setMetadata("callBackURL", callBackURL != null ? callBackURL : "?"); workflowDTO.setProperties("Workflow Process","Subscription Creation"); <START> <END> super.execute(workflowDTO); return new GeneralWorkflowResponse(); }</code><technical_language>remove properties metadata needed</technical_language>

Target:
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Subscription Creation Webservice Workflow.. "); } SubscriptionWorkflowDTO subsWorkflowDTO = (SubscriptionWorkflowDTO) workflowDTO; String callBackURL = subsWorkflowDTO.getCallbackUrl(); String message = "Approve API [" + subsWorkflowDTO.getApiName() + " - " + subsWorkflowDTO.getApiVersion() + "] subscription creation request from subscriber - " + subsWorkflowDTO.getSubscriber() + " for the application - " + subsWorkflowDTO.getApplicationName(); workflowDTO.setWorkflowDescription(message); super.execute(workflowDTO); return new GeneralWorkflowResponse(); }
Source:
<code>protected void verifyProcessor(@NonNull MethodTree method, @NonNull final List<? extends VariableTree> parameters) { final List<? extends ExpressionTree> exceptions = method.getThrows(); if(exceptions.size() > 0){ for(ExpressionTree exp : exceptions){ String name = ((JCTree.JCIdent)exp).getName().toString(); if(name.contains("Connector")){ <START> addError(null, "Exception '%s' in processor '%s' should be renamed without the 'Connector' part", name, method.getName().toString()); <END> } } } }</code><technical_language>suggest new name (by removing "Connector" part)</technical_language>

Target:
protected void verifyProcessor(@NonNull MethodTree method, @NonNull final List<? extends VariableTree> parameters) { final List<? extends ExpressionTree> exceptions = method.getThrows(); if (exceptions.size() > 0) { for (ExpressionTree exp : exceptions) { String name = ((JCTree.JCIdent) exp).getName().toString(); if (name.contains("Connector")) { String newName = name.replace("Connector", ""); addError(null, "Exception '%s' in processor '%s' should be renamed to %s", name, method.getName().toString(), newName); } } } }
Source:
<code>public void OnTimer() { try { log.info("Start deleteAgedOutAuditLogs"); DateTime latestTimeToKeep = DateTime.getNow().AddDays( Config.<Integer> GetValue(ConfigValues.AuditLogAgingThreashold) * -1); <START> DbFacade.getInstance().getAuditLogDao().removeAllBeforeDate(latestTimeToKeep); <END> } catch (RuntimeException e) { log.error("deleteAgedOutAuditLog failed with exception", e); } }</code><technical_language>add a "done" log message</technical_language>

Target:
public void OnTimer() { try { log.info("Start deleteAgedOutAuditLogs"); DateTime latestTimeToKeep = DateTime.getNow().AddDays( Config.<Integer> GetValue(ConfigValues.AuditLogAgingThreashold) * -1); DbFacade.getInstance().getAuditLogDao().removeAllBeforeDate(latestTimeToKeep); log.info("Finished deleteAgedOutAuditLogs"); } catch (RuntimeException e) { log.error("deleteAgedOutAuditLog failed with exception", e); } }
Source:
<code>public List<FeedItem> filter(List<FeedItem> items) { if(mProperties.length == 0) return items; List<FeedItem> result = new ArrayList<>(); if (showPlayed && showUnplayed) return result; if (showQueued && showNotQueued) return result; if (showDownloaded && showNotDownloaded) return result; for(FeedItem item : items) { if (showPlayed && !item.isPlayed()) continue; if (showUnplayed && item.isPlayed()) continue; if (showPaused && item.getState() != FeedItem.State.IN_PROGRESS) continue; boolean queued = DBReader.getQueueIDList().contains(item.getId()); if (showQueued && !queued) continue; if (showNotQueued && queued) continue; <START> boolean downloaded = item.getMedia() != null & item.getMedia().isDownloaded(); <END> if (showDownloaded && !downloaded) continue; if (showNotDownloaded && downloaded) continue; result.add(item); } return result; }</code><technical_language>NPEd me: & -> &&</technical_language>

Target:
public List<FeedItem> filter(List<FeedItem> items) { if(mProperties.length == 0) return items; List<FeedItem> result = new ArrayList<>(); if (showPlayed && showUnplayed) return result; if (showQueued && showNotQueued) return result; if (showDownloaded && showNotDownloaded) return result; for(FeedItem item : items) { if (showPlayed && !item.isPlayed()) continue; if (showUnplayed && item.isPlayed()) continue; if (showPaused && item.getState() != FeedItem.State.IN_PROGRESS) continue; boolean queued = DBReader.getQueueIDList().contains(item.getId()); if (showQueued && !queued) continue; if (showNotQueued && queued) continue; boolean downloaded = item.getMedia() != null && item.getMedia().isDownloaded(); if (showDownloaded && !downloaded) continue; if (showNotDownloaded && downloaded) continue; result.add(item); } return result; }
Source:
<code>private void attemptXoauth2(String username) throws MessagingException, IOException { CommandResponse response = executeSimpleCommandWithResponse("AUTH XOAUTH2 " + Authentication.computeXoauth(username, oauthTokenProvider.getToken(username, OAuth2TokenProvider.OAUTH2_TIMEOUT)), true); <START> if(response.replyCode == 334) { <END> retryXoauthWithNewToken = XOAuth2ChallengeParser.shouldRetry( response.message, mHost); Log.i(LOG_TAG, "Challenge response: "+ new Base64().decode(response.message)); executeSimpleCommandWithResponse("", false); } }</code><technical_language>magic constant</technical_language>

Target:
private void attemptXoauth2(String username) throws MessagingException, IOException { CommandResponse response = executeSimpleCommandWithResponse("AUTH XOAUTH2 " + Authentication.computeXoauth(username, oauthTokenProvider.getToken(username, OAuth2TokenProvider.OAUTH2_TIMEOUT)), true); if(response.replyCode == SMTP_CONTINUE_REQUEST) { retryXoauthWithNewToken = XOAuth2ChallengeParser.shouldRetry( response.message, mHost); executeSimpleCommandWithResponse("", false); } }
Source:
<code>public void orderingIsUnstable() { List<Integer> numbers = IntStream.range(0, 1000000).boxed().collect(Collectors.toList()); Iterable<Integer> numbersIterable = new UnstableOrderedIterable<>(numbers); List<Integer> iterationOrder = Lists.newArrayList(); numbersIterable.iterator().forEachRemaining(iterationOrder::add); List<Integer> secondIterationOrder = Lists.newArrayList(); <START> numbersIterable.iterator().forEachRemaining(secondIterationOrder::add); <END> assertThat(iterationOrder).isNotEqualTo(secondIterationOrder); assertThat(ImmutableSet.copyOf(iterationOrder)).isEqualTo(ImmutableSet.copyOf(numbers)); }</code><technical_language>List<Integer> iterationOrder = ImmutableList.copyOf(numbersIterable); List<Integer> secondIterationOrder = ImmutableList.copyOf(numbersIterable);</technical_language>

Target:
public void orderingIsUnstable() { Iterable<Integer> numbers = UnstableOrderedIterable.create(ImmutableList.of(1, 2), Comparator.naturalOrder()); assertThat(ImmutableList.copyOf(numbers)).containsExactly(1, 2); assertThat(ImmutableList.copyOf(numbers)).containsExactly(2, 1); assertThat(ImmutableList.copyOf(numbers)).containsExactly(1, 2); }
Source:
<code>public FeedbackSubmissionEditQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx, boolean isModeratedQuestion) { courseId = questionAttributes.courseId; questionNumber = questionAttributes.questionNumber; this.qnIndx = qnIndx; questionId = questionAttributes.getId(); questionText = questionAttributes.getQuestionDetails().questionText; visibilityMessages = questionAttributes.getVisibilityMessage(); questionType = questionAttributes.questionType; numberOfEntitiesToGiveFeedbackTo = questionAttributes.numberOfEntitiesToGiveFeedbackTo; this.isModeratedQuestion = isModeratedQuestion; isRecipientNameHidden = questionAttributes.isRecipientNameHidden(); <START> isTeamQuestion = (questionAttributes.giverType.equals(FeedbackParticipantType.TEAMS)); <END> }</code><technical_language>remove surrounding brackets</technical_language>

Target:
public FeedbackSubmissionEditQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx, boolean isModeratedQuestion) { courseId = questionAttributes.courseId; questionNumber = questionAttributes.questionNumber; this.qnIndx = qnIndx; questionId = questionAttributes.getId(); questionText = questionAttributes.getQuestionDetails().questionText; visibilityMessages = questionAttributes.getVisibilityMessage(); questionType = questionAttributes.questionType; numberOfEntitiesToGiveFeedbackTo = questionAttributes.numberOfEntitiesToGiveFeedbackTo; this.isModeratedQuestion = isModeratedQuestion; isRecipientNameHidden = questionAttributes.isRecipientNameHidden(); isTeamQuestion = questionAttributes.giverType.equals(FeedbackParticipantType.TEAMS); }
Source:
<code>public static List<String> getMatchingJobNames(Pattern pattern, int maxJobs) { Iterator<Job> jobs = Items.allItems(Jenkins.getInstance(), Job.class).iterator(); List<String> matchingJobNames = new ArrayList<>(); while(jobs.hasNext() && matchingJobNames.size() < maxJobs) { Job job = jobs.next(); <START> Matcher m = pattern.matcher(job.getDisplayName()); <END> if(m.matches()) { matchingJobNames.add(job.getDisplayName()); } } return matchingJobNames; }</code><technical_language><LINK_0></technical_language>

Target:
public static List<String> getMatchingJobNames(Pattern pattern, int maxJobs) { Iterator<Job> jobs = Items.allItems(Jenkins.getInstance(), Job.class).iterator(); List<String> matchingJobNames = new ArrayList<>(); while(jobs.hasNext() && matchingJobNames.size() < maxJobs) { Job job = jobs.next(); String jobName = job.getFullName(); Matcher m = pattern.matcher(jobName); if(m.matches()) { matchingJobNames.add(jobName); } } return matchingJobNames; }
Source:
<code>public Object format(ServiceDiscoveryConfigItem item, Object valueToTransform) { if (item.getDockerName().equalsIgnoreCase(ServiceDiscoveryConfigItem.CERTIFICATES.getDockerName())) { List<Number> certificateIds = (List<Number>) valueToTransform; List<String> certificateNames = new ArrayList<>(); for (Number certificateId : certificateIds) { String certName = getCertName(certificateId); if (StringUtils.isNotBlank(certName)) { <START> certificateNames.add(getCertName(certificateId)); <END> } } return certificateNames; } else if (item.getDockerName().equals(ServiceDiscoveryConfigItem.DEFAULT_CERTIFICATE.getDockerName())) { Integer defaultCertId = (Integer) valueToTransform; return getCertName(defaultCertId); } else { return null; } }</code><technical_language>Is a reason call getCertName() instead of certName</technical_language>

Target:
public Object format(ServiceDiscoveryConfigItem item, Object valueToTransform) { if (item.getDockerName().equalsIgnoreCase(ServiceDiscoveryConfigItem.CERTIFICATES.getDockerName())) { List<Number> certificateIds = (List<Number>) valueToTransform; List<String> certificateNames = new ArrayList<>(); for (Number certificateId : certificateIds) { String certName = getCertName(certificateId); if (StringUtils.isNotBlank(certName)) { certificateNames.add(certName); } } return certificateNames; } else if (item.getDockerName().equals(ServiceDiscoveryConfigItem.DEFAULT_CERTIFICATE.getDockerName())) { Integer defaultCertId = (Integer) valueToTransform; return getCertName(defaultCertId); } else { return null; } }
Source:
<code>protected void configure(HttpSecurity http) throws Exception { http.httpBasic() .and() .authorizeRequests() .antMatchers(HttpMethod.GET, "/user/**") .hasRole("USER") .and() .logout() .logoutUrl("/user/logout") .addLogoutHandler(logoutHandler) <START> .logoutSuccessHandler((new HttpStatusReturningLogoutSuccessHandler(HttpStatus.OK))) <END> .permitAll() .and() .csrf() .disable() .formLogin() .disable(); }</code><technical_language>Hey @kirill-vlasov - picky extra set of brackets here</technical_language>

Target:
protected void configure(HttpSecurity http) throws Exception { http.httpBasic() .and() .authorizeRequests() .antMatchers(HttpMethod.GET, "/user/**") .hasRole("USER") .and() .logout() .logoutUrl("/user/logout") .addLogoutHandler(logoutHandler) .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.OK)) .permitAll() .and() .csrf() .disable() .formLogin() .disable(); }
Source:
<code>private void setupLoggerFromProperties(final Properties props) { final String driverLogLevel = PGProperty.LOGGER_LEVEL.get(props); if (driverLogLevel == null) { return; } if ("OFF".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.OFF); return; } else if ("DEBUG".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINE); } else if ("TRACE".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINEST); } final String driverLogFile = PGProperty.LOGGER_FILE.get(props); if (driverLogFile != null && driverLogFile.equals(loggerHandlerFile)) { return; } for (java.util.logging.Handler handlers : PARENT_LOGGER.getHandlers()) { handlers.close(); PARENT_LOGGER.removeHandler(handlers); loggerHandlerFile = null; } java.util.logging.Handler handler = new java.util.logging.ConsoleHandler(); if (driverLogFile != null) { try { handler = new java.util.logging.FileHandler(driverLogFile); loggerHandlerFile = driverLogFile; } catch (Exception ex) { System.err.println("Cannot enable FileHandler, fallback to ConsoleHandler."); } } handler.setFormatter(new java.util.logging.SimpleFormatter()); <START> PARENT_LOGGER.setUseParentHandlers(false); <END> PARENT_LOGGER.addHandler(handler); }</code><technical_language>@jorsol , please clarify setUseParentHandlers(false) here? I expect for FileHandler only</technical_language>

Target:
private void setupLoggerFromProperties(final Properties props) { final String driverLogLevel = PGProperty.LOGGER_LEVEL.get(props); if (driverLogLevel == null) { return; } if ("OFF".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.OFF); return; } else if ("DEBUG".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINE); } else if ("TRACE".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINEST); } ExpressionProperties exprProps = new ExpressionProperties(props, System.getProperties()); final String driverLogFile = PGProperty.LOGGER_FILE.get(exprProps); if (driverLogFile != null && driverLogFile.equals(loggerHandlerFile)) { return; } for (java.util.logging.Handler handlers : PARENT_LOGGER.getHandlers()) { handlers.close(); PARENT_LOGGER.removeHandler(handlers); loggerHandlerFile = null; } java.util.logging.Handler handler = new java.util.logging.ConsoleHandler(); if (driverLogFile != null) { try { handler = new java.util.logging.FileHandler(driverLogFile); loggerHandlerFile = driverLogFile; } catch (Exception ex) { System.err.println("Cannot enable FileHandler, fallback to ConsoleHandler."); } } handler.setFormatter(new java.util.logging.SimpleFormatter()); PARENT_LOGGER.setUseParentHandlers(false); PARENT_LOGGER.addHandler(handler); }
Source:
<code>protected void updateData() { List<T> items = getModel().getItems() == null ? null : new ArrayList<T>(getModel().getItems()); if (items != null) { if (!getModel().hasItemsSorted()) { <START> Collections.sort(items, getDefaultItemComparator()); <END> } updateDataProvider(items); } }</code><technical_language>items is a list - call items.sort(getDefaultItemComparator())</technical_language>

Target:
protected void updateData() { List<T> items = getModel().getItems() == null ? null : new ArrayList<T>(getModel().getItems()); if (items != null) { if (!getModel().hasItemsSorted()) { items.sort(getDefaultItemComparator()); } updateDataProvider(items); } }
Source:
<code>public Object thenReturn(InvocationContext ctx, VisitableCommand command, Object returnValue) { if (future.isDone()) { try { future.getNow(null); return returnValue; <START> } catch (Throwable t) { <END> return this; } } return new SimpleAsyncInvocationStage(future.thenApply(o -> returnValue)); }</code><technical_language>future.isCompletedExceptionally() instead of catching exception switch QueuedAsyncInvocationStage future is done</technical_language>

Target:
public Object thenReturn(InvocationContext ctx, VisitableCommand command, Object returnValue) { if (future.isDone()) { return future.isCompletedExceptionally() ? this : returnValue; } return new QueueAsyncInvocationStage(ctx, command, future, (InvocationSuccessFunction) (rCtx, rCommand, rv) -> returnValue); }
Source:
<code><START> synchronized void shutdown() { <END> m_isShutdown = true; try { int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }</code><technical_language>This "synchronized" needed TLSNIOWriteStream.shutdown() protects it</technical_language>

Target:
void shutdown() { m_isShutdown = true; try { int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }
Source:
<code>CorfuRecord<V, M> create(@Nonnull final K key, @Nullable final V value, @Nullable final M metadata) { boolean beganNewTxn = false; try { <START> beganNewTxn = TxBegin(); <END> return corfuTable.put(key, new CorfuRecord<>(value, metadata)); } finally { if (beganNewTxn) { TxEnd(); } } }</code><technical_language>table manage transactions? violates logic of transactions</technical_language>

Target:
CorfuRecord<V, M> create(@Nonnull final K key, @Nullable final V value, @Nullable final M metadata) { boolean beganNewTxn = false; try { beganNewTxn = TxBegin(); CorfuRecord<V, M> previous = corfuTable.get(key); if (previous != null) { throw new RuntimeException("Cannot create a record on existing key."); } M newMetadata = null; if (metadataOptions.isMetadataEnabled()) { if (metadata == null) { throw new RuntimeException("Table::create needs non-null metadata"); } M metadataDefaultInstance = (M) getMetadataOptions().getDefaultMetadataInstance(); newMetadata = getNewMetadata(metadataDefaultInstance, metadata); } return corfuTable.put(key, new CorfuRecord<>(value, newMetadata)); } finally { if (beganNewTxn) { TxEnd(); } } }
Source:
<code>public String getName() { StringBuilder name = new StringBuilder(); for (int i = 0; i < (input.length - 1); i++) { <START> name.append(input[i].getName() + "/"); END> } name.append(input[input.length - 1].getName()); return name.toString(); }</code><technical_language>append instead of +</technical_language>

Target:
public String getName() { StringBuilder name = new StringBuilder(); for (int i = 0; i < (input.length - 1); i++) { name.append(input[i].getName()).append("/"); } name.append(input[input.length - 1].getName()); return name.toString(); }
Source:
<code>public List<EnsemblTranscript> fetchEnsemblTranscriptsByProteinIdsPOST( @ApiParam(value = "List of Ensembl protein IDs. For example [\"ENSP00000439985\",\"ENSP00000478460\",\"ENSP00000346196\"]", required = true, allowMultiple = true) @RequestBody List<String> proteinIds) { List<EnsemblTranscript> transcripts = new ArrayList<>(); for (String proteinId : proteinIds) { try { transcripts.addAll(this.ensemblService.getEnsemblTranscriptsByProteinId(proteinId)); } catch (EnsemblTranscriptNotFoundException e) { <START> e.printStackTrace(); <END> } } return transcripts; }</code><technical_language>This right. another service method takes a list returns a list, throw this exception</technical_language>

Target:
public List<EnsemblTranscript> fetchEnsemblTranscriptsByProteinIdsPOST( @ApiParam(value = "List of Ensembl protein IDs. For example [\"ENSP00000439985\",\"ENSP00000478460\",\"ENSP00000346196\"]", required = true, allowMultiple = true) @RequestBody List<String> proteinIds) { List<EnsemblTranscript> transcripts = new ArrayList<>(); for (String proteinId : proteinIds) { transcripts.addAll(this.ensemblService.getEnsemblTranscriptsByProteinId(proteinId)); } return transcripts; }
Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ForEachStatement actualStatement = (ForEachStatement) tree; Type variableType = actualStatement.variable().type().symbolType(); Type collectionItemType = getCollectionItemType(actualStatement.expression()); if (collectionItemType != null && !isMostPreciseType(variableType, collectionItemType)) { DownCastVisitor downCastVisitor = new DownCastVisitor(actualStatement.variable().symbol()); <START> actualStatement.accept(downCastVisitor); <END> if (downCastVisitor.hasDownCastOfLoopVariable) { List<JavaFileScannerContext.Location> locations = Collections.singletonList( new JavaFileScannerContext.Location(String.format(SECONDARY_MESSAGE, collectionItemType.name()), actualStatement.expression())); reportIssue(actualStatement.variable().type(), String.format(PRIMARY_MESSAGE, variableType.name()), locations, 0); } } }</code><technical_language>need visit statement of foreachstatement. expression variable</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ForEachStatement actualStatement = (ForEachStatement) tree; Type variableType = actualStatement.variable().type().symbolType(); Type collectionItemType = getCollectionItemType(actualStatement.expression()); if (collectionItemType != null && !isMostPreciseType(variableType, collectionItemType)) { DownCastVisitor downCastVisitor = new DownCastVisitor(actualStatement.variable().symbol()); actualStatement.statement().accept(downCastVisitor); if (downCastVisitor.hasDownCastOfLoopVariable) { List<JavaFileScannerContext.Location> locations = Collections.singletonList( new JavaFileScannerContext.Location(String.format(SECONDARY_MESSAGE, collectionItemType.name()), actualStatement.expression())); reportIssue(actualStatement.variable().type(), String.format(PRIMARY_MESSAGE, variableType.name()), locations, 0); } } }
Source:
<code>public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); IEditorInput editorInput = this.getEditorInput(); IFile sessionResourceFile = ((FileEditorInput) editorInput).getFile(); final URI sessionResourceURI = URI.createPlatformResourceURI(sessionResourceFile.getFullPath().toOSString(), true); try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); subMonitor.beginTask(MessageFormat.format(Messages.UI_SessionEditor_session_loading_task_title, new Object[0]), 1); session = SessionManager.INSTANCE.getSession(sessionResourceURI, subMonitor); if (!session.isOpen()) { session.open(monitor); } subMonitor.worked(1); subMonitor.done(); } }); } <START> catch (InvocationTargetException e) <END> { ErrorDialog.openError(getSite().getShell(), MessageFormat.format(Messages.UI_SessionEditor_session_loading_error_message, new Object[0]), e.getMessage(), Status.CANCEL_STATUS); } catch (InterruptedException e) { ErrorDialog.openError(getSite().getShell(), MessageFormat.format(Messages.UI_SessionEditor_session_loading_error_message, new Object[0]), e.getMessage(), Status.CANCEL_STATUS); } }</code><technical_language>a single catch for exceptions (since java7)</technical_language>

Target:
public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); IEditorInput editorInput = this.getEditorInput(); IFile sessionResourceFile = ((FileEditorInput) editorInput).getFile(); final URI sessionResourceURI = URI.createPlatformResourceURI(sessionResourceFile.getFullPath().toOSString(), true); try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); subMonitor.beginTask(MessageFormat.format(Messages.UI_SessionEditor_session_loading_task_title, new Object[0]), 1); session = SessionManager.INSTANCE.getSession(sessionResourceURI, subMonitor); if (!session.isOpen()) { session.open(monitor); } subMonitor.worked(1); subMonitor.done(); } }); } catch (InvocationTargetException | InterruptedException e) { ErrorDialog.openError(getSite().getShell(), MessageFormat.format(Messages.UI_SessionEditor_session_loading_error_message, new Object[0]), e.getMessage(), Status.CANCEL_STATUS); } }
Source:
<code>void fireEvent(Event event, ICluster cluster) { <START> listeners.stream().forEach(listener -> { <END> switch (event) { case CLUSTER_ADDED: listener.clusterAdded(this, cluster); break; case CLUSTER_REMOVED: listener.clusterRemoved(this, cluster); break; } }); }</code><technical_language>call forEach once, stream()</technical_language>

Target:
void fireEvent(Event event, ICluster cluster) { listeners.forEach(listener -> { switch (event) { case CLUSTER_ADDED: listener.clusterAdded(this, cluster); break; case CLUSTER_REMOVED: listener.clusterRemoved(this, cluster); break; } }); }
Source:
<code>public void setup() { GerritConnector connector = new GerritConnector(); <START> TasksUiPlugin.getRepositoryManager().addRepositoryConnector(connector); <END> TaskRepository repo = new TaskRepository(connector.getConnectorKind(), MOCK_REPO_URL); repo.setProperty(GerritConnector.CONNECTOR_KIND + ".usageType", "WITH_TASK_TOOL"); TaskRepository repoAlone = new TaskRepository(connector.getConnectorKind(), MOCK_REPO_URL_ALONE); repoAlone.setProperty(GerritConnector.CONNECTOR_KIND + ".usageType", "ALONE"); TasksUiPlugin.getRepositoryManager().addRepository(repo); TasksUiPlugin.getRepositoryManager().addRepository(repoAlone); reviewTask = getGerritTask(); localTask = getLocalTask(); TasksUiPlugin.getTaskList().addTask(reviewTask); TasksUiPlugin.getTaskList().addTask(localTask); forceTaskReviewLink(reviewTask, localTask); }</code><technical_language>Need remove this in teardown</technical_language>

Target:
public void setup() { connector = new GerritConnector(); TasksUiPlugin.getRepositoryManager().addRepositoryConnector(connector); repo = new TaskRepository(connector.getConnectorKind(), MOCK_REPO_URL); repo.setProperty(GerritConnector.CONNECTOR_KIND + ".usageType", "WITH_TASK_TOOL"); repoAlone = new TaskRepository(connector.getConnectorKind(), MOCK_REPO_URL_ALONE); repoAlone.setProperty(GerritConnector.CONNECTOR_KIND + ".usageType", "ALONE"); TasksUiPlugin.getRepositoryManager().addRepository(repo); TasksUiPlugin.getRepositoryManager().addRepository(repoAlone); reviewTask = getGerritTask(); localTask = getLocalTask(); TasksUiPlugin.getTaskList().addTask(reviewTask); TasksUiPlugin.getTaskList().addTask(localTask); forceTaskReviewLink(reviewTask, localTask); }
Source:
<code><START> protected Pool createPool(Owner owner, Product product, Long quantity, Date startDate, Date endDate, <END> String contractNr) { Pool pool = new Pool( owner, product, new HashSet<Product>(), quantity, startDate, endDate, contractNr, DEFAULT_ACCOUNT, DEFAULT_ORDER ); pool.setSourceSubscription(new SourceSubscription(Util.generateDbUUID(), "master")); return poolCurator.create(pool); }</code><technical_language>of new createPool methods offload work existing providing values expects reimplementing code</technical_language>

Target:
protected Pool createPool(Owner owner, Product product, Long quantity, Date startDate, Date endDate, String contractNr) { Pool pool = createPool(owner, product, quantity, startDate, endDate); pool.setContractNumber(contractNr); return poolCurator.merge(pool); }
Source:
<code>public void addToSlot(Object slot, PresenterWidget<?> child) { if (child == null || (child.slot == slot && child.parent == this)) { <START> return; <END> } adoptChild(slot, child); if (!child.isPopup()) { getView().addToSlot(slot, child); } else { monitorCloseEvent((PresenterWidget<? extends PopupView>) child); } if (isVisible()) { child.internalReveal(); } }</code><technical_language>This is wrong usage of addToSlot(). I if fire a NullPointerException child == null fire IllegalArgumentException child.slot == slot && child.parent == this</technical_language>

Target:
public void addToSlot(Object slot, PresenterWidget<?> child) { assert child != null : "cannot add null to a slot"; if (child.slot == slot && child.parent == this) { return; } adoptChild(slot, child); if (child.isPopup()) { monitorCloseEvent((PresenterWidget<? extends PopupView>) child); } else { getView().addToSlot(slot, child); } if (isVisible()) { child.internalReveal(); } }
Source:
<code>public String validate(String parameterValue, ModelValidatorContext context) throws ValidationException { try { return new URI(parameterValue).toString(); } catch (URISyntaxException e) { <START> throw new ValidationException(parameterValue + " is not a valid uri", e); <END> } }</code><technical_language>put uri in uppercase is acronyme</technical_language>

Target:
public String validate(String parameterValue, ModelValidatorContext context) throws ValidationException { try { return new URI(parameterValue).toString(); } catch (URISyntaxException e) { throw new ValidationException(parameterValue + " is not a valid URI.", e); } }
Source:
<code>public void setUp() throws Exception { dimensions = new ArrayList<String>(); dimensions.add("item1"); dimensions.add("item2"); dimensions.add("time"); testCaseSupplier = new TestCaseSupplier( "{\"item1\":\"value1\"," + "\"item2\":2," + "\"time\":1372121562 }" ); UpdateStreamFactory updateStreamFactory = new UpdateStreamFactory(testCaseSupplier, null, "time"); webbie = new WebFirehoseFactory(updateStreamFactory, "posix"); <START> firehose = webbie.connect(); <END> if (firehose.hasMore()) { inputRow = firehose.nextRow(); } else { throw new RuntimeException("queue is empty"); } }</code><technical_language>stuff this line a weird for setup. I tests re-worked this a part of individual test</technical_language>

Target:
public void setUp() throws Exception { dimensions.add("item1"); dimensions.add("item2"); dimensions.add("time"); webbie = new WebFirehoseFactory( new UpdateStreamFactory() { @Override public UpdateStream build() { return new MyUpdateStream(ImmutableMap.<String,Object>of("item1", "value1", "item2", 2, "time", "1372121562")); } }, "posix" ); webbie1 = new WebFirehoseFactory( new UpdateStreamFactory() { @Override public UpdateStream build() { return new MyUpdateStream(ImmutableMap.<String,Object>of("item1", "value1", "item2", 2, "time", "1373241600000")); } }, "auto" ); }
Source:
<code>public void testCheckAccessNullThread() { carbonSecurityManager = mock(CarbonSecurityManager.class); Thread thread = null; assertNull(thread); <START> carbonSecurityManager.checkAccess(thread); <END> }</code><technical_language>checkAccess method a null throw exception. IMO, do need mock this class. This method altered test for a null pointer expected exception</technical_language>

Target:
public void testCheckAccessNullThread() { System.setProperty("denied.system.properties", "mockDeniedProperty"); carbonSecurityManager = new CarbonSecurityManager(); Thread thread = null; assertNull(thread); carbonSecurityManager.checkAccess(thread); }
Source:
<code><START> public FusedLocationProviderApiImpl() { <END> }</code><technical_language>Empty public constructor removed</technical_language>

Target:
public FusedLocationProviderApiImpl() { connectionCallbacks = new HashSet<>(); }
Source:
<code>synchronized Slice stealWork() { for (;;) { DeltaTask maxTask = null; Slice maxSlice = null; int maxWork = 0; for (DeltaTask task : tasks) { Slice s = task.remaining(); if (s != null && maxWork < s.size()) { maxTask = task; maxSlice = s; maxWork = s.size(); } } if (maxTask == null) <START> break; <END> if (maxTask.tryStealWork(maxSlice)) return maxSlice; } return null; }</code><technical_language>nit: i return null remove ti end of method</technical_language>

Target:
synchronized Slice stealWork() { for (;;) { DeltaTask maxTask = null; Slice maxSlice = null; int maxWork = 0; for (DeltaTask task : tasks) { Slice s = task.remaining(); if (s != null && maxWork < s.size()) { maxTask = task; maxSlice = s; maxWork = s.size(); } } if (maxTask == null) return null; if (maxTask.tryStealWork(maxSlice)) return maxSlice; } }
Source:
<code>private void saveNewCommentsByFeedbackParticipant(List<FeedbackResponseCommentAttributes> commentsToSave) throws EntityDoesNotExistException { for (FeedbackResponseCommentAttributes frc : commentsToSave) { String responseRecipient = getRequestParamValue(frc.feedbackResponseId); <START> FeedbackResponseAttributes response = logic.getFeedbackResponse(frc.feedbackQuestionId, <END> frc.commentGiver, responseRecipient); frc.feedbackResponseId = response.getId(); try { logic.createFeedbackResponseComment(frc); } catch (InvalidParametersException e) { setStatusForException(e); } statusToAdmin += this.getClass().getName() + ":<br>" + "Adding comment to response: " + frc.feedbackResponseId + "<br>" + "in course/feedback session: " + frc.courseId + "/" + frc.feedbackSessionName + "<br>" + "by: " + frc.commentGiver + " at " + frc.createdAt + "<br>" + "comment text: " + frc.commentText.getValue(); } }</code><technical_language>Actually, ID of response is predictable java // Format is feedbackQuestionId%giverEmail%receiver // i.e. if response is feedback for team: qnId%giver@gmail.com%Team1 // if response is feedback for person: qnId%giver@gmail.com%reciever@email.com @Id private String feedbackResponseId; need get response. Another justification is data in GAE is strong consistent if access entity ID (in this case, FeedbackResponsesDb index query instead of ID query)</technical_language>

Target:
private void saveNewCommentsByFeedbackParticipant(List<FeedbackResponseCommentAttributes> commentsToSave) throws EntityDoesNotExistException { for (FeedbackResponseCommentAttributes frc : commentsToSave) { try { logic.createFeedbackResponseComment(frc); logic.putDocument(frc); statusToAdmin += this.getClass().getName() + ":<br>" + "Adding comment to response: " + frc.feedbackResponseId + "<br>" + "in course/feedback session: " + frc.courseId + "/" + frc.feedbackSessionName + "<br>" + "by: " + frc.commentGiver + " at " + frc.createdAt + "<br>" + "comment text: " + frc.commentText.getValue(); } catch (InvalidParametersException e) { setStatusForException(e); } } }