auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean equals(final Object other) { if (other == this) { return true; } if (!(other instanceof DefaultOrganization)) { return false; } final DefaultOrganization otherOrg = (DefaultOrganization) other; <START> return Objects.equal(_name, otherOrg._name); <END> }</code><technical_language>this id</technical_language>

Target:
public boolean equals(final Object other) { if (other == this) { return true; } if (!(other instanceof DefaultOrganization)) { return false; } final DefaultOrganization otherOrg = (DefaultOrganization) other; return Objects.equal(_id, otherOrg._id); }
Source:
<code>public boolean killOperation(UUID uuid, String userId) throws StandardException { RunningOperation op = operations.get(uuid); if (op == null) return false; Activation activation = op.getOperation().getActivation(); String databaseOwner = activation.getLanguageConnectionContext().getDataDictionary().getAuthorizationDatabaseOwner(); String runningUserId = activation.getLanguageConnectionContext().getCurrentUserId(activation); String groupuser = activation.getLanguageConnectionContext().getCurrentGroupUser(activation); if (!userId.equals(databaseOwner) && !userId.equals(runningUserId)) { if (groupuser != null) { if (!groupuser.equals(databaseOwner) && !groupuser.equals(runningUserId)) throw StandardException.newException(SQLState.AUTH_NO_PERMISSION_FOR_KILLING_OPERATION, userId, uuid.toString()); } else throw StandardException.newException(SQLState.AUTH_NO_PERMISSION_FOR_KILLING_OPERATION, userId, uuid.toString()); } unregisterOperation(uuid); op.getOperation().kill(); op.getThread().interrupt(); ResultSet rs=activation.getResultSet(); rs.close(); <START> <END> return true; }</code><technical_language>rs checked null calling close? I if null, I other code calls getResultSet() check for null, good do same</technical_language>

Target:
public boolean killOperation(UUID uuid, String userId) throws StandardException { RunningOperation op = operations.get(uuid); if (op == null) return false; Activation activation = op.getOperation().getActivation(); String databaseOwner = activation.getLanguageConnectionContext().getDataDictionary().getAuthorizationDatabaseOwner(); String runningUserId = activation.getLanguageConnectionContext().getCurrentUserId(activation); String groupuser = activation.getLanguageConnectionContext().getCurrentGroupUser(activation); if (!userId.equals(databaseOwner) && !userId.equals(runningUserId)) { if (groupuser != null) { if (!groupuser.equals(databaseOwner) && !groupuser.equals(runningUserId)) throw StandardException.newException(SQLState.AUTH_NO_PERMISSION_FOR_KILLING_OPERATION, userId, uuid.toString()); } else throw StandardException.newException(SQLState.AUTH_NO_PERMISSION_FOR_KILLING_OPERATION, userId, uuid.toString()); } unregisterOperation(uuid); op.getOperation().kill(); op.getThread().interrupt(); ResultSet rs=activation.getResultSet(); if (rs!=null && !rs.isClosed()) { rs.close(); } return true; }
Source:
<code>public List<ActivityMetadata> metadataForAnnouncements(@RequestParam final Long start, @RequestParam final Long end) throws JsonParseException, IOException, ValidationException { Date startDate = new Date(start); Date endDate = new Date(end); validateActivityDatesAndDateRange(start, end); <START> return activityMetadataManager.getActivityMetadataByConcept( <END> ActivityConcept.ANNOUNCEMENT, startDate, endDate); }</code><technical_language>announcement activity is public. I need a separate manager method right permissions. specially written queries in of DAOs get announcement activity a pain. Anonymous users able activity for public announcements logged-in users able announcement activity</technical_language>

Target:
public List<ActivityMetadata> metadataForAnnouncements(@RequestParam final Long start, @RequestParam final Long end) throws JsonParseException, IOException, ValidationException { Date startDate = new Date(start); Date endDate = new Date(end); validateActivityDatesAndDateRange(start, end); return activityMetadataManager.getAnnouncementActivityMetadata(startDate, endDate); }
Source:
<code>public void onEvent(final Event event, final Object source, final Object data) { Patient patient = ((PatientEvent) event).getPatient(); XWikiContext context = contextProvider.get(); XWiki wiki = context.getWiki(); try { XWikiDocument doc = wiki.getDocument(patient.getDocument(), context); if (isNew(doc, context)) { wiki.deleteDocument(doc, true, context); EntityReference defaultReference = new EntityReference(wiki.getDefaultPage(context), EntityType.DOCUMENT, new EntityReference(wiki.getDefaultSpace(context), EntityType.SPACE)); defaultReference = currentResolver.resolve(defaultReference, EntityType.DOCUMENT); String url = wiki.getURL(new DocumentReference(defaultReference), "view", context); <START> if (context.getResponse().isCommitted()) { <END> context.getResponse().setHeader("Location", url); context.getResponse().flushBuffer(); } else { context.getResponse().sendRedirect(url); } } } catch (XWikiException ex) { logger.error("Could not delete patient. {}", ex.getMessage()); } catch (IOException ex) { logger.error("Could not redirect user appropriately. {}", ex.getMessage()); } }</code><technical_language>missing a ! here</technical_language>

Target:
public void onEvent(final Event event, final Object source, final Object data) { Patient patient = ((PatientEvent) event).getPatient(); XWikiContext context = contextProvider.get(); XWiki wiki = context.getWiki(); try { XWikiDocument doc = wiki.getDocument(patient.getDocument(), context); if (isNew(doc, context)) { wiki.deleteDocument(doc, true, context); EntityReference defaultReference = new EntityReference(wiki.getDefaultPage(context), EntityType.DOCUMENT, new EntityReference(wiki.getDefaultSpace(context), EntityType.SPACE)); defaultReference = currentResolver.resolve(defaultReference, EntityType.DOCUMENT); String url = wiki.getURL(new DocumentReference(defaultReference), "view", context); context.getResponse().sendRedirect(url); } } catch (XWikiException ex) { logger.error("Could not delete patient. {}", ex.getMessage()); } catch (IOException ex) { logger.error("Could not redirect user appropriately. {}", ex.getMessage()); } }
Source:
<code>public boolean canCreate(ReviewDb db, RevWalk rw, RevObject object) { if (!canWrite()) { return false; } boolean owner; boolean admin; switch (getCurrentUser().getAccessPath()) { case REST_API: case JSON_RPC: owner = isOwner(); admin = getCurrentUser().getCapabilities().canAdministrateServer(); break; default: owner = false; admin = false; } if (object instanceof RevCommit) { if (admin || (owner && !isBlocked(Permission.CREATE))) { return true; } else if (!canPerform(Permission.CREATE)) { return false; } boolean isMerged = isMergedIntoBranchOrTag(db, rw, (RevCommit) object); <START> return isMerged || canUpdate(); <END> } else if (object instanceof RevTag) { final RevTag tag = (RevTag) object; try { rw.parseBody(tag); } catch (IOException e) { return false; } final PersonIdent tagger = tag.getTaggerIdent(); if (tagger != null) { boolean valid; if (getCurrentUser().isIdentifiedUser()) { final IdentifiedUser user = (IdentifiedUser) getCurrentUser(); final String addr = tagger.getEmailAddress(); valid = user.getEmailAddresses().contains(addr); } else { valid = false; } if (!valid && !owner && !canForgeCommitter()) { return false; } } if (tag.getFullMessage().contains("-----BEGIN PGP SIGNATURE-----\n")) { return owner || canPerform(Permission.PUSH_SIGNED_TAG); } else { return owner || canPerform(Permission.PUSH_TAG); } } else { return false; } }</code><technical_language>canUpdate is faster isMerged. run canUpdate first</technical_language>

Target:
public boolean canCreate(ReviewDb db, RevWalk rw, RevObject object) { if (!canWrite()) { return false; } boolean owner; boolean admin; switch (getCurrentUser().getAccessPath()) { case REST_API: case JSON_RPC: owner = isOwner(); admin = getCurrentUser().getCapabilities().canAdministrateServer(); break; default: owner = false; admin = false; } if (object instanceof RevCommit) { if (admin || (owner && !isBlocked(Permission.CREATE))) { return true; } else if (!canPerform(Permission.CREATE)) { return false; } else if (canUpdate()) { return true; } else if (isMergedIntoBranchOrTag(db, rw, (RevCommit) object)) { return true; } return false; } else if (object instanceof RevTag) { final RevTag tag = (RevTag) object; try { rw.parseBody(tag); } catch (IOException e) { return false; } final PersonIdent tagger = tag.getTaggerIdent(); if (tagger != null) { boolean valid; if (getCurrentUser().isIdentifiedUser()) { final IdentifiedUser user = (IdentifiedUser) getCurrentUser(); final String addr = tagger.getEmailAddress(); valid = user.getEmailAddresses().contains(addr); } else { valid = false; } if (!valid && !owner && !canForgeCommitter()) { return false; } } if (tag.getFullMessage().contains("-----BEGIN PGP SIGNATURE-----\n")) { return owner || canPerform(Permission.PUSH_SIGNED_TAG); } else { return owner || canPerform(Permission.PUSH_TAG); } } else { return false; } }
Source:
<code>private static List<org.eclipse.jetty.client.api.Request> getRequestForDestination(Destination destination) { PoolingHttpDestination poolingHttpDestination = (PoolingHttpDestination) destination; Queue<HttpExchange> httpExchanges = poolingHttpDestination.getHttpExchanges(); List<org.eclipse.jetty.client.api.Request> requests = httpExchanges.stream() .map(HttpExchange::getRequest) .collect(Collectors.toList()); ((DuplexConnectionPool) poolingHttpDestination.getConnectionPool()).getActiveConnections().stream() .filter(HttpConnectionOverHTTP.class::isInstance) .map(HttpConnectionOverHTTP.class::cast) .map(connection -> connection.getHttpChannel().getHttpExchange()) .filter(Objects::nonNull) .forEach(exchange -> requests.add(exchange.getRequest())); return requests.stream() .filter(Objects::nonNull) <START> .collect(Collectors.toList()); <END> }</code><technical_language>toImmutableList</technical_language>

Target:
private static List<org.eclipse.jetty.client.api.Request> getRequestForDestination(Destination destination) { PoolingHttpDestination poolingHttpDestination = (PoolingHttpDestination) destination; Queue<HttpExchange> httpExchanges = poolingHttpDestination.getHttpExchanges(); List<org.eclipse.jetty.client.api.Request> requests = httpExchanges.stream() .map(HttpExchange::getRequest) .collect(Collectors.toList()); ((DuplexConnectionPool) poolingHttpDestination.getConnectionPool()).getActiveConnections().stream() .filter(HttpConnectionOverHTTP.class::isInstance) .map(HttpConnectionOverHTTP.class::cast) .map(connection -> connection.getHttpChannel().getHttpExchange()) .filter(Objects::nonNull) .forEach(exchange -> requests.add(exchange.getRequest())); return requests.stream() .filter(Objects::nonNull) .collect(toImmutableList()); }
Source:
<code>private static boolean sameRelCollectionNoOrderConsidered( List<MutableRel> list0, List<MutableRel> list1) { <START> if (list0.size() == list1.size()) { <END> for (MutableRel rel: list0) { int index = list1.indexOf(rel); if (index == -1) { return false; } else { list1.remove(index); } } return true; } return false; }</code><technical_language>if (list0.size() != list1.size()) { return false; } ......</technical_language>

Target:
private static boolean sameRelCollectionNoOrderConsidered( List<MutableRel> list0, List<MutableRel> list1) { if (list0.size() != list1.size()) { return false; } for (MutableRel rel: list0) { int index = list1.indexOf(rel); if (index == -1) { return false; } else { list1.remove(index); } } return true; }
Source:
<code>private static int lastIndexOfTrim(byte[] raw, char ch, int pos) { <START> while (pos >= 0 && raw[pos] == ' ') { <END> pos--; } while (pos >= 0 && raw[pos] != ch) { pos--; } return pos; }</code><technical_language>Style-nit: curly braces simple loops</technical_language>

Target:
private static int lastIndexOfTrim(byte[] raw, char ch, int pos) { while (pos >= 0 && raw[pos] == ' ') pos--; while (pos >= 0 && raw[pos] != ch) pos--; return pos; }
Source:
<code>private void appendMediaFileAndSavePost(MediaFile mediaFile, String imageUrl, ImageLoader imageLoader) { mEditorFragment.appendMediaFile(mediaFile, imageUrl, mImageLoader); if (updatePostObject()) { <START> savePostToDb(); <END> } }</code><technical_language>call savePostAsync() here</technical_language>

Target:
private void appendMediaFileAndSavePost(MediaFile mediaFile, String imageUrl, ImageLoader imageLoader) { mEditorFragment.appendMediaFile(mediaFile, imageUrl, mImageLoader); savePostAsync(null); }
Source:
<code>public ColumnContext next() { if (!hasNext()) { throw new NoSuchElementException("Columns iterator exhausted"); } Reference ref = columns.next(); if (ref.column().isTopLevel() == false) { return new ColumnContext(tableInfo, ref, null); } Integer position = ref.position(); if (position == null) { <START> position = ordinal.intValue(); <END> } ordinal++; return new ColumnContext(tableInfo, ref, position); }</code><technical_language>ordinal a primitive int directly? ++ boxing (although values cached, a issue). memory footprint increase, due memory alignment I a short takes space int anyway</technical_language>

Target:
public ColumnContext next() { if (!hasNext()) { throw new NoSuchElementException("Columns iterator exhausted"); } Reference ref = columns.next(); if (ref.column().isTopLevel() == false) { return new ColumnContext(tableInfo, ref, null); } Integer position = ref.position(); if (position == null) { position = ordinal; } ordinal++; return new ColumnContext(tableInfo, ref, position); }
Source:
<code>protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { boolean ret = super.executeAnalysis(monitor); Map<String, SegmentStoreStatistics> segments = getPerSegmentTypeStats(); if(ret && segments != null) { fModel = new <START> SegmentStoreStatisticsDataModel("System Call", <END> segments); } return ret; }</code><technical_language>I repeating question patch set 13. string "System Call" externalized</technical_language>

Target:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { boolean ret = super.executeAnalysis(monitor); Map<String, SegmentStoreStatistics> segments = getPerSegmentTypeStats(); if(ret && segments != null) { fModel = new SegmentStoreStatisticsDataModel(nullToEmptyString(Messages.SystemCallLatencyStatisticsAnalysisModule_SystemCall)); } return ret; }
Source:
<code>public void registerLocalProviderInstance(Object provider, Map<Class<?>, Integer> contracts) { for (Object registered : getLocalProviderInstances()) { if (registered == provider) { <START> LOG.info("Provider already registered " + provider.getClass().getName()); <END> return; } } localProviderInstances.add(provider); configurationWrapper.registerLocalContract(provider.getClass(), contracts); }</code><technical_language>fixing this, infov(String format, Object param) method, string concatenation is executed if logger is configured print info messages</technical_language>

Target:
public void registerLocalProviderInstance(Object provider, Map<Class<?>, Integer> contracts) { for (Object registered : getLocalProviderInstances()) { if (registered == provider) { LOG.infov("Provider already registered {0}", provider.getClass().getName()); return; } } localProviderInstances.add(provider); configurationWrapper.registerLocalContract(provider.getClass(), contracts); }
Source:
<code>public void theGetProfileGenericDataRequestIsReceived(final Map<String, String> settings) throws Throwable { ProfileGenericDataRequest request = new ProfileGenericDataRequestBuilder() .withDeviceidentification(getString(settings, "DeviceIdentification", "TEST1024000000001")) .withObisCode(this.fillObisCode(settings)).withBeginDate(this.fillDate(settings, "beginDate")) .withEndDate(this.fillDate(settings, "endDate")).build(); ProfileGenericDataAsyncResponse asyncResponse = this.client.requestProfileGenericData(request); <START> assertTrue(asyncResponse != null); <END> Helpers.saveAsyncResponse(asyncResponse); }</code><technical_language>assertNotNull</technical_language>

Target:
public void theGetProfileGenericDataRequestIsReceived(final Map<String, String> settings) throws Throwable { ProfileGenericDataRequest request = new ProfileGenericDataRequestBuilder() .withDeviceidentification(getString(settings, "DeviceIdentification", "TEST1024000000001")) .withObisCode(this.fillObisCode(settings)).withBeginDate(this.fillDate(settings, "beginDate")) .withEndDate(this.fillDate(settings, "endDate")).build(); ProfileGenericDataAsyncResponse asyncResponse = this.client.requestProfileGenericData(request); assertNotNull(asyncResponse); Helpers.saveAsyncResponse(asyncResponse); }
Source:
<code>public int getRackId() { if (rackId == null) { <START> throw new IllegalStateException("rackId not defined for the data node " + hostname + ":" + port); <END> } return rackId; }</code><technical_language>IllegalStateException is thrown (not IllegalArgument)</technical_language>

Target:
public long getRackId() { return rackId; }
Source:
<code>protected void runImpl() throws IOException, Failure { <START> if (!projectControl.canPerformPackAction(receiveGroup)) { <END> throw new Failure(1, "fatal: receive-pack not permitted on this server"); } final ReceiveCommits receive = factory.create(projectControl, repo); ReceiveCommits.Capable r = receive.canUpload(); if (r != ReceiveCommits.Capable.OK) { throw new UnloggedFailure(1, "\nfatal: " + r.getMessage()); } verifyProjectVisible("reviewer", reviewerId); verifyProjectVisible("CC", ccId); receive.addReviewers(reviewerId); receive.addExtraCC(ccId); final ReceivePack rp = receive.getReceivePack(); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }</code><technical_language>groups ProjectControl</technical_language>

Target:
protected void runImpl() throws IOException, Failure { if (!projectControl.canRunReceivePack()) { throw new Failure(1, "fatal: receive-pack not permitted on this server"); } final ReceiveCommits receive = factory.create(projectControl, repo); ReceiveCommits.Capable r = receive.canUpload(); if (r != ReceiveCommits.Capable.OK) { throw new UnloggedFailure(1, "\nfatal: " + r.getMessage()); } verifyProjectVisible("reviewer", reviewerId); verifyProjectVisible("CC", ccId); receive.addReviewers(reviewerId); receive.addExtraCC(ccId); final ReceivePack rp = receive.getReceivePack(); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }
Source:
<code>public void changesSubscriptionBout() throws Exception { final String alias = "maxi"; final Aliases aliases = new DyBase().user(new URN("urn:test:1890")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); bout.subscribe(false); <START> Assert.assertFalse(bout.subscription()); <END> }</code><technical_language>@erimerturk MatcherAssert.assertThat</technical_language>

Target:
public void changesSubscriptionBout() throws Exception { final String alias = "maxi"; final Aliases aliases = new DyBase().user(new URN("urn:test:1890")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); bout.subscribe(false); MatcherAssert.assertThat( bout.subscription(), Matchers.equalTo(false) ); }
Source:
<code>private void reconcile() { if (highestContiguousMsgId == -1L && nonContiguousMsgIds.size() > 100) { Long min = Collections.min(nonContiguousMsgIds); LOGGER.info("Setting highestContiguousMsgId to from -1", min); highestContiguousMsgId = min; } <START> nonContiguousMsgIds.removeIf(x -> x <= highestContiguousMsgId); <END> List<Long> contiguousMsgIds = new ArrayList<>(); for (long msgId : (Iterable<Long>) () -> LongStream.iterate(highestContiguousMsgId + 1, id -> id + 1).iterator()) { if (!nonContiguousMsgIds.contains(msgId)) { break; } contiguousMsgIds.add(msgId); }; if (contiguousMsgIds.isEmpty()) { return; } highestContiguousMsgId = contiguousMsgIds.get(contiguousMsgIds.size() - 1); nonContiguousMsgIds.removeAll(contiguousMsgIds); }</code><technical_language>is this line iif block? highestContiguousMsgId is reset</technical_language>

Target:
private void reconcile() { if (highestContiguousMsgId == -1L && nonContiguousMsgIds.size() > 100) { Long min = nonContiguousMsgIds.first(); LOGGER.info("Setting highestContiguousMsgId to from -1", min); highestContiguousMsgId = min; } for (long msgId : nonContiguousMsgIds) { if (msgId <= highestContiguousMsgId) { nonContiguousMsgIds.remove(msgId); } else if (msgId > highestContiguousMsgId + 1) { break; } else { nonContiguousMsgIds.remove(msgId); highestContiguousMsgId = msgId; } } }
Source:
<code>public boolean isOpen() { <START> synchronized(portLock) { <END> return isOpen; } }</code><technical_language>synchronized for a code onliner unnecessary</technical_language>

Target:
public boolean isOpen() { return isOpen; }
Source:
<code>private MediaType requestedContent(WebRequest request) { List<MediaType> mediaTypes = new ArrayList<>(); try { mediaTypes.addAll(contentNegotiationManager.resolveMediaTypes((NativeWebRequest) request)); } catch (HttpMediaTypeNotAcceptableException e1) { <START> logger.error("Reuqested invalid content-type [{}]", request.getHeader(HttpHeaders.ACCEPT)); <END> mediaTypes.add(MediaType.APPLICATION_JSON); } MediaType result = mediaTypes.stream() .reduce(null, this::reduceByPriority); return Optional.ofNullable(result).orElse(MediaType.APPLICATION_JSON); }</code><technical_language>Please fix typo add exception parameter</technical_language>

Target:
private MediaType requestedContent(WebRequest request) { List<MediaType> mediaTypes = new ArrayList<>(); try { mediaTypes.addAll(contentNegotiationManager.resolveMediaTypes((NativeWebRequest) request)); } catch (HttpMediaTypeNotAcceptableException e1) { logger.error("Requested invalid content-type [{}]", request.getHeader(HttpHeaders.ACCEPT), e1); mediaTypes.add(MediaType.APPLICATION_JSON); } MediaType result = mediaTypes.stream() .reduce(null, this::reduceByPriority); return Optional.ofNullable(result).orElse(MediaType.APPLICATION_JSON); }
Source:
<code>public LogToJSONDataConverter(Configuration config) { <START> this.logger = Logging.getLogger(getClass()); <END> jsonProducer = ProcessingUtilsFactory.getPrinter(config); logParser = ProcessingUtilsFactory.getLogParser(config); if (config.containsKey(ProcessingUtilsFactory.CUSTOM_FIELDS_KEY)) { fields = config.readList(ProcessingUtilsFactory.CUSTOM_FIELDS_KEY, String.class); } }</code><technical_language>unnecessary</technical_language>

Target:
public LogToJSONDataConverter(Configuration config) { jsonProducer = ProcessingUtilsFactory.getPrinter(config); logParser = ProcessingUtilsFactory.getLogParser(config); if (config.containsKey(ProcessingUtilsFactory.CUSTOM_FIELDS_KEY)) { fields = config.readList(ProcessingUtilsFactory.CUSTOM_FIELDS_KEY, String.class); } }
Source:
<code>public void readRecoveredState(ExecutorService executor, ChannelStateReader reader) throws IOException { internalRequestPartitions(() -> executor.submit(() -> { for (InputChannel inputChannel : inputChannels.values()) { <START> if (inputChannel instanceof RemoteInputChannel) { try { ((RemoteInputChannel) inputChannel).readRecoveredState(reader); } catch (Throwable t) { inputChannel.setError(t); return; } } } for (InputChannel inputChannel : inputChannels.values()) { try { inputChannel.requestSubpartition(consumedSubpartitionIndex); } catch (Throwable t) { inputChannel.setError(t); return; } } <END> })); }</code><technical_language>I this block of code is forgetting getUnconsumedBuffer() LocalInputChannel spilled part of input data</technical_language>

Target:
public CompletableFuture<?> readRecoveredState(ExecutorService executor, ChannelStateReader reader) { List<CompletableFuture<?>> futures = getStateConsumedFuture(); executor.submit(() -> { Collection<InputChannel> channels; synchronized (requestLock) { channels = inputChannels.values(); } internalReadRecoveredState(reader, channels); }); return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); }
Source:
<code><START> boolean isA2dpPlaying(BluetoothDevice <END> device) { enforceCallingOrSelfPermission( BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission"); if (mA2dpSinkStreamHandler == null) return false; return mA2dpSinkStreamHandler.isPlaying(); }</code><technical_language>this need synchronized this work? Otherwise, a race check call</technical_language>

Target:
boolean isA2dpPlaying(BluetoothDevice device) { enforceCallingOrSelfPermission( BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission"); synchronized (mStreamHandlerLock) { if (mA2dpSinkStreamHandler == null) return false; return mA2dpSinkStreamHandler.isPlaying(); } }
Source:
<code>private void checkForIssue(ExpressionTree tree) { MethodInvocationTree nestedTree = extractMethodInvocation(tree); <START> if (nestedTree != null && NEGATIVE_METHODS.anyMatch(nestedTree)) { <END> addIssue(nestedTree, "Use the original value instead."); } }</code><technical_language>testing if expression is Integer.MIN_VALUE</technical_language>

Target:
private void checkForIssue(ExpressionTree tree) { if (tree.is(Tree.Kind.MEMBER_SELECT)) { Symbol identifierSymbol = ((MemberSelectExpressionTree) tree).identifier().symbol(); Type ownerType = identifierSymbol.owner().type(); if ("MIN_VALUE".equals(identifierSymbol.name()) && (ownerType.is("java.lang.Integer") || ownerType.is("java.lang.Long"))) { addIssue(tree, "Use the original value instead."); } } else { MethodInvocationTree nestedTree = extractMethodInvocation(tree); if (nestedTree != null && NEGATIVE_METHODS.anyMatch(nestedTree)) { addIssue(nestedTree, "Use the original value instead."); } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_coursedetail_tab); if (savedInstanceState != null) { selectedTab = savedInstanceState.getInt(TAB_ID); } setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData == null ){ String courseId = bundle.getString(Router.EXTRA_COURSE_ID); if (!TextUtils.isEmpty(courseId)){ SegmentFactory.getInstance().trackNotificationTapped(courseId); NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); <START> nMgr.cancelAll(); <END> Api api = new Api(this); courseData = api.getCourseById(courseId); if (courseData != null && courseData.getCourse() != null ) { bundle.putSerializable(Router.EXTRA_ENROLLMENT, courseData); selectedTab = courseInfoTabIndex; } } } if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ segIO.screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { Router.getInstance().showMyCourses(this); finish(); } }catch(Exception ex){ logger.error(ex); } }</code><technical_language>Do want do cancelAll? cancel notification</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_coursedetail_tab); if (savedInstanceState != null) { selectedTab = savedInstanceState.getInt(TAB_ID); } setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData == null ){ String courseId = bundle.getString(Router.EXTRA_COURSE_ID); if (!TextUtils.isEmpty(courseId)){ SegmentFactory.getInstance().trackNotificationTapped(courseId); Api api = new Api(this); courseData = api.getCourseById(courseId); if (courseData != null && courseData.getCourse() != null ) { bundle.putSerializable(Router.EXTRA_ENROLLMENT, courseData); selectedTab = courseInfoTabIndex; } } } if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ segIO.screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { Router.getInstance().showMyCourses(this); finish(); } }catch(Exception ex){ logger.error(ex); } }
Source:
<code>public FactoryParametersResolver getFactoryParametersResolver(Map<String, String> parameters) { <START> if (specificFactoryParametersResolvers != null) <END> for (FactoryParametersResolver factoryParametersResolver : specificFactoryParametersResolvers) { if (factoryParametersResolver.accept(parameters)) { return factoryParametersResolver; } } return defaultFactoryResolver.accept(parameters) ? defaultFactoryResolver : null; }</code><technical_language>please write if curly braces. nasty bugs</technical_language>

Target:
public FactoryParametersResolver getFactoryParametersResolver(Map<String, String> parameters) throws BadRequestException { if (specificFactoryParametersResolvers != null) { for (FactoryParametersResolver factoryParametersResolver : specificFactoryParametersResolvers) { if (factoryParametersResolver.accept(parameters)) { return factoryParametersResolver; } } } if (defaultFactoryResolver.accept(parameters)) { return defaultFactoryResolver; } else { throw new BadRequestException(FACTORY_NOT_RESOLVABLE); } }
Source:
<code>public static boolean openRenameWizard(String newName, IStructuredSelection structuredSelection) { <START> Map<String, Object> commandParameters = Collections.singletonMap(LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY, <END> newName); return runCommand(LTK_RENAME_ID, structuredSelection, commandParameters); }</code><technical_language>in case newName is null, pass emptyMap commandParameters. do think</technical_language>

Target:
public static boolean openRenameWizard(String newName, IStructuredSelection structuredSelection) { Map<String, Object> commandParameters; if (newName != null) { commandParameters = Collections.singletonMap(LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY, newName); } else { commandParameters = Collections.emptyMap(); } return runCommand(LTK_RENAME_ID, structuredSelection, commandParameters); }
Source:
<code>private String getResponse(String token, String searchPhrase, int itemStartNumber) throws ClientProtocolException, IOException { HttpPost post = new HttpPost("<LINK_0>"); post.setHeader("Content-type", "application/json"); <START> if (searchPhrase.contains(" ")) { <END> searchPhrase = "\"" + searchPhrase + "\""; } VideoRequest videoRequest = new VideoRequest(token, searchPhrase, itemsPerPage, itemStartNumber); JsonElement json = toJson(videoRequest); post.setEntity(new StringEntity(json.toString())); HttpResponse resp = new DefaultHttpClient().execute(post); InputStreamReader reader = new InputStreamReader(resp.getEntity().getContent()); return CharStreams.toString(reader); }</code><technical_language>Is downside quoting? escaping quotes in search phrase</technical_language>

Target:
private String getResponse(String token, String searchPhrase, int itemStartNumber) throws ClientProtocolException, IOException { HttpPost post = new HttpPost("<LINK_0>"); post.setHeader("Content-type", "application/json"); if (searchPhrase.contains(" ")) { searchPhrase = "\"" + searchPhrase.replaceAll("\"", "\\\"") + "\""; } VideoRequest videoRequest = new VideoRequest(token, searchPhrase, itemsPerPage, itemStartNumber); JsonElement json = toJson(videoRequest); post.setEntity(new StringEntity(json.toString())); HttpResponse resp = new DefaultHttpClient().execute(post); InputStreamReader reader = new InputStreamReader(resp.getEntity().getContent()); return CharStreams.toString(reader); }
Source:
<code>private <T> T mockTransformer(Map<String, Object> serviceProperties, Class<T> clazz) { T metacardTransformer = mock(clazz); ServiceReference<T> serviceReference = mock(ServiceReference.class); when(serviceReference.getPropertyKeys()) .thenReturn(serviceProperties.keySet().toArray(new String[0])); when(bundleContext.getService(serviceReference)).thenReturn(metacardTransformer); when(serviceReference.getProperty(eq(TransformerProperties.MIME_TYPE))) .thenReturn( serviceProperties .entrySet() .stream() .filter( stringObjectEntry -> stringObjectEntry.getKey().equals(TransformerProperties.MIME_TYPE)) .map(Map.Entry::getValue) .filter(List.class::isInstance) .map(List.class::cast) .flatMap(Collection::stream) .filter(String.class::isInstance) .map(String.class::cast) .collect(Collectors.toList())); when(serviceReference.getProperty(eq(Constants.SERVICE_ID))) .thenReturn( <START> serviceProperties <END> .entrySet() .stream() .filter( stringObjectEntry -> stringObjectEntry.getKey().equals(Constants.SERVICE_ID)) .map(Map.Entry::getValue) .filter(String.class::isInstance) .map(String.class::cast) .findFirst() .orElse(null)); serviceMap.computeIfAbsent(clazz, aClass -> new ArrayList()).add(serviceReference); return metacardTransformer; }</code><technical_language>thenReturn(serviceProperties.get(Constants.SERVICE_ID)) do thing</technical_language>

Target:
private <T> T mockTransformer(Map<String, Object> serviceProperties, Class<T> clazz) { T metacardTransformer = mock(clazz); ServiceReference<T> serviceReference = mock(ServiceReference.class); when(serviceReference.getPropertyKeys()) .thenReturn(serviceProperties.keySet().toArray(new String[0])); when(bundleContext.getService(serviceReference)).thenReturn(metacardTransformer); when(serviceReference.getProperty(eq(TransformerProperties.MIME_TYPE))) .thenReturn( serviceProperties .entrySet() .stream() .filter( stringObjectEntry -> stringObjectEntry.getKey().equals(TransformerProperties.MIME_TYPE)) .map(Map.Entry::getValue) .filter(List.class::isInstance) .map(List.class::cast) .flatMap(Collection::stream) .filter(String.class::isInstance) .map(String.class::cast) .collect(Collectors.toList())); when(serviceReference.getProperty(eq(Constants.SERVICE_ID))) .thenReturn(serviceProperties.get(Constants.SERVICE_ID)); serviceMap.computeIfAbsent(clazz, aClass -> new ArrayList()).add(serviceReference); return metacardTransformer; }
Source:
<code>private void updateMetaDataDescription(DiskImage diskImage) { StorageDomain storageDomain = getStorageDomainDAO().getForStoragePool(diskImage.getStorageIds().get(0), getVm().getStoragePoolId()); <START> if (!isDomainExistAndActive()) { <END> auditLogForNoMetadataDescriptionUpdate(AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED_SINCE_STORAGE_DOMAIN_NOT_ACTIVE, storageDomain, diskImage); return; } try { SetVolumeDescriptionVDSCommandParameters vdsCommandParameters = new SetVolumeDescriptionVDSCommandParameters(getVm().getStoragePoolId(), diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId(), getJsonDiskDescription()); runVdsCommand(VDSCommandType.SetVolumeDescription, vdsCommandParameters); } catch (Exception e) { log.error("Exception while setting volume description for disk. ERROR: '{}'", e); auditLogForNoMetadataDescriptionUpdate(AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED, storageDomain, diskImage); } }</code><technical_language>This change CDA messages in execute phase - eak. This if (getStorageDomainValidator(diskImage).isExistsAndUp().isValid()) {</technical_language>

Target:
private void updateMetaDataDescription(DiskImage diskImage) { StorageDomain storageDomain = getStorageDomainDAO().getForStoragePool(diskImage.getStorageIds().get(0), getVm().getStoragePoolId()); if (getStorageDomainValidator((DiskImage) getNewDisk()).isDomainExistAndActive().isValid()) { auditLogForNoMetadataDescriptionUpdate(AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_SKIPPED_SINCE_STORAGE_DOMAIN_NOT_ACTIVE, storageDomain, diskImage); return; } try { SetVolumeDescriptionVDSCommandParameters vdsCommandParameters = new SetVolumeDescriptionVDSCommandParameters(getVm().getStoragePoolId(), diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId(), getJsonDiskDescription()); runVdsCommand(VDSCommandType.SetVolumeDescription, vdsCommandParameters); } catch (Exception e) { log.error("Exception while setting volume description for disk. ERROR: '{}'", e); auditLogForNoMetadataDescriptionUpdate(AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED, storageDomain, diskImage); } }
Source:
<code>private DaoState(int chainHeight, LinkedList<Block> blocks, LinkedList<Cycle> cycles, TreeMap<TxOutputKey, TxOutput> unspentTxOutputMap, TreeMap<TxOutputKey, SpentInfo> spentInfoMap, List<String> confiscatedLockupTxList, TreeMap<String, Issuance> issuanceMap, List<ParamChange> paramChangeList, List<EvaluatedProposal> evaluatedProposalList, List<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsList) { this.chainHeight = chainHeight; this.blocks = blocks; this.cycles = cycles; this.unspentTxOutputMap = unspentTxOutputMap; this.spentInfoMap = spentInfoMap; this.confiscatedLockupTxList = confiscatedLockupTxList; this.issuanceMap = issuanceMap; this.paramChangeList = paramChangeList; this.evaluatedProposalList = evaluatedProposalList; this.decryptedBallotsWithMeritsList = decryptedBallotsWithMeritsList; txMap = blocks.stream() .flatMap(block -> block.getTxs().stream()) <START> .collect(Collectors.toMap(Tx::getId, Function.identity(), (x, y) -> y, HashMap::new)); <END> }</code><technical_language>Yes, I expected intention... I wondering change behaviour. previous code flatMap. public Stream<Tx> getTxStream() { return getBlocks().stream() .flatMap(block -> block.getTxs().stream()); } Do potential key conflics handled there? i assume mergeFunction overwrite a new if is standad behaviour if defined. mergeFunction is throwing exception if flatMap behaves same. a bit "esoteric" DAO deserve a bit of extra paranoia ;-)</technical_language>

Target:
private DaoState(int chainHeight, LinkedList<Block> blocks, LinkedList<Cycle> cycles, TreeMap<TxOutputKey, TxOutput> unspentTxOutputMap, TreeMap<TxOutputKey, SpentInfo> spentInfoMap, List<String> confiscatedLockupTxList, TreeMap<String, Issuance> issuanceMap, List<ParamChange> paramChangeList, List<EvaluatedProposal> evaluatedProposalList, List<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsList) { this.chainHeight = chainHeight; this.blocks = blocks; this.cycles = cycles; this.unspentTxOutputMap = unspentTxOutputMap; this.spentInfoMap = spentInfoMap; this.confiscatedLockupTxList = confiscatedLockupTxList; this.issuanceMap = issuanceMap; this.paramChangeList = paramChangeList; this.evaluatedProposalList = evaluatedProposalList; this.decryptedBallotsWithMeritsList = decryptedBallotsWithMeritsList; txCache = blocks.stream() .flatMap(block -> block.getTxs().stream()) .collect(Collectors.toMap(Tx::getId, Function.identity(), (x, y) -> x, HashMap::new)); }
Source:
<code>public BatchDTO convertJSONObjectToDTO(JSONObject jsonObject, boolean related) throws DataException { BatchDTO batchDTO = new BatchDTO(); batchDTO.setId(getIdFromJSONObject(jsonObject)); JSONObject batchObject = getSource(jsonObject); batchDTO.setTitle(getStringPropertyForDTO(batchObject, "title")); batchDTO.setType(getStringPropertyForDTO(batchObject, "type")); if (!related) { <START> batchDTO = convertRelatedJSONObjects(batchObject, batchDTO); <END> } return batchDTO; }</code><technical_language>batchObject sounds a bean. I prefere batchJSONObject</technical_language>

Target:
public BatchDTO convertJSONObjectToDTO(JSONObject jsonObject, boolean related) throws DataException { BatchDTO batchDTO = new BatchDTO(); batchDTO.setId(getIdFromJSONObject(jsonObject)); JSONObject batchJSONObject = getSource(jsonObject); batchDTO.setTitle(getStringPropertyForDTO(batchJSONObject, "title")); batchDTO.setType(getStringPropertyForDTO(batchJSONObject, "type")); if (!related) { batchDTO = convertRelatedJSONObjects(batchJSONObject, batchDTO); } return batchDTO; }
Source:
<code>public List<String> getList(String k, List<String> defaultValue) { if (!containsKey(k)) return defaultValue; String value = get(k); if (value.isEmpty()) { <START> return Collections.emptyList(); <END> } String[] pieces = value.split("\\s*,\\s*"); return Arrays.asList(pieces); }</code><technical_language>StringUtils.isNotBlank(value) instead of value.isEmpty()? cover " "</technical_language>

Target:
public List<String> getList(String k, List<String> defaultValue) { if (!containsKey(k)) return defaultValue; String value = get(k); if (value.trim().isEmpty()) { return defaultValue; } String[] pieces = value.split("\\s*,\\s*"); return Arrays.asList(pieces); }
Source:
<code>protected void unmapNode(ModelNode node) { unmapElement(node); ModelNode[] childrenNodes = node.getChildrenNodes(); if (childrenNodes != null) { for (ModelNode <START> childrenNode : <END> childrenNodes) { unmapNode(childrenNode); } } }</code><technical_language>rename childNode</technical_language>

Target:
protected void unmapNode(ModelNode node) { unmapElement(node); ModelNode[] childrenNodes = node.getChildrenNodes(); if (childrenNodes != null) { for (ModelNode childNode : childrenNodes) { unmapNode(childNode); } } }
Source:
<code>public WriteContext(MessageType schema, Map<String, String> extraMetaData) { super(); this.schema = Objects.requireNonNull(schema, "schema cannot be null"); <START> this.extraMetaData = Collections.unmodifiableMap(Objects.requireNonNull(extraMetaData, "extraMetaData")); <END> }</code><technical_language>suggestion this.extraMetaData = Collections.unmodifiableMap(Objects.requireNonNull(extraMetaData, "extraMetaData null"));</technical_language>

Target:
public WriteContext(MessageType schema, Map<String, String> extraMetaData) { super(); this.schema = Objects.requireNonNull(schema, "schema cannot be null"); this.extraMetaData = Collections.unmodifiableMap(Objects .requireNonNull(extraMetaData, "extraMetaData cannot be null")); }
Source:
<code>public Map<Long, Double> mappingScanner(MetricScanner scanner) { Map<Long, Double> absDatapoints = new HashMap<>(); synchronized (scanner) { while (scanner.hasNextDP()) { <START> Map.Entry<Long, Double> nextDP = scanner.getNextDP(); <END> absDatapoints.put(nextDP.getKey(), nextDP.getValue()); } } return absDatapoints; }</code><technical_language>I of Map.Entry here. Nicely done</technical_language>

Target:
public Map<Long, Double> mappingScanner(MetricScanner scanner) { Map<Long, Double> absDatapoints = new HashMap<>(); while (scanner.hasNextDP()) { Map.Entry<Long, Double> nextDP = scanner.getNextDP(); absDatapoints.put(nextDP.getKey(), Math.abs(nextDP.getValue())); } return absDatapoints; }
Source:
<code><START> private long <END> interval(Config rc, String section) { long interval = -1; try { interval = ConfigUtil.getTimeUnit(rc, section, null, KEY_INTERVAL, -1, TimeUnit.MILLISECONDS); if (interval == -1) { log.info(MessageFormat.format("{0} schedule parameter \"{0}.{1}\" is not configured", section, KEY_INTERVAL)); } } catch (IllegalArgumentException e) { log.error(MessageFormat.format("Invalid {0} schedule parameter \"{0}.{1}\"", section, KEY_INTERVAL), e); } return interval; }</code><technical_language>static (see below)</technical_language>

Target:
private static long interval(Config rc, String section) { long interval = -1; try { interval = ConfigUtil.getTimeUnit(rc, section, null, KEY_INTERVAL, -1, TimeUnit.MILLISECONDS); if (interval == -1) { log.info(MessageFormat.format("{0} schedule parameter \"{0}.{1}\" is not configured", section, KEY_INTERVAL)); } } catch (IllegalArgumentException e) { log.error(MessageFormat.format("Invalid {0} schedule parameter \"{0}.{1}\"", section, KEY_INTERVAL), e); } return interval; }
Source:
<code>public RGB <START> open () <END> { byte buffer = Converter.wcsToMbcs (null, title, true); long handle = 0; Display display = parent != null ? parent.getDisplay (): Display.getCurrent (); if (OS.GTK_VERSION >= OS.VERSION (3, 4, 0)) { handle = OS.gtk_color_chooser_dialog_new (buffer, parent.topHandle ()); GdkRGBA rgba = new GdkRGBA (); generateGdkRGBAFromRGB(rgba, handle); parseRGBSGtk3(handle, rgba); Dialog oldModal = setModal(handle, display); int signalId = setSignalId(); long hookId = setHookId(handle, display, signalId); display.sendPreExternalEventDispatchEvent (); int response = OS.gtk_dialog_run (handle); boolean success = buttonClicked(handle, display, oldModal, signalId, hookId, response); if (success) { rgb = generateRGBFromGdkRGBA(handle, rgba); } destroy(handle, display); if (!success) { return null; } } else { handle = OS.gtk_color_selection_dialog_new (buffer); GdkColor color = new GdkColor (); setUpWindowGtk2(handle); long colorsel = generateGdkColorFromRGB(color, handle); parseRGBSGtk2(color); Dialog oldModal = setModal(handle, display); int signalId = setSignalId(); long hookId = setHookId(handle, display, signalId); display.sendPreExternalEventDispatchEvent (); int response = OS.gtk_dialog_run (handle); boolean success = buttonClicked(handle, display, oldModal, signalId, hookId, response); if (success) { rgb = generateRGBFromGdkColor(color, colorsel); } recreateRGBS(color); destroy(handle, display); if (!success) { return null; } } return rgb; }</code><technical_language>done. some concerns code duplication method naming</technical_language>

Target:
public RGB open () { byte buffer = Converter.wcsToMbcs (null, title, true); long handle = 0; Display display = parent != null ? parent.getDisplay (): Display.getCurrent (); boolean success; if (OS.GTK_VERSION >= OS.VERSION (3, 4, 0)) { handle = OS.gtk_color_chooser_dialog_new (buffer, parent.topHandle ()); GdkRGBA rgba = new GdkRGBA (); setCurrentColorGtk3(rgba, handle); parseRGBSGtk3(handle, rgba); Dialog oldModal = setModal(handle, display); int signalId = lookupSignalId(); long hookId = addEmissionHook(handle, display, signalId); display.sendPreExternalEventDispatchEvent (); int response = OS.gtk_dialog_run (handle); success = buttonClicked(handle, display, oldModal, signalId, hookId, response); if (success) { rgb = acquireCurrentColorSelectionGtk3(handle, rgba); } } else { handle = OS.gtk_color_selection_dialog_new (buffer); GdkColor color = new GdkColor (); setUpWindowGtk2(handle); long colorsel = setCurrentColorGtk2(color, handle); parseRGBSGtk2(color); Dialog oldModal = setModal(handle, display); int signalId = lookupSignalId(); long hookId = addEmissionHook(handle, display, signalId); display.sendPreExternalEventDispatchEvent (); int response = OS.gtk_dialog_run (handle); success = buttonClicked(handle, display, oldModal, signalId, hookId, response); if (success) { rgb = acquireCurrentColorSelectionGtk2(color, colorsel); } recreateRGBS(color); } destroy(handle, display); if (!success) { return null; } return rgb; }
Source:
<code>public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll( Set<SystemStreamPartition> systemStreamPartitions, long timeout) throws InterruptedException { if (!proxy.isRunning()) { <START> LOG.info("KafkaSystemConsumer: proxy is not running. Stopping the consumer."); <END> stop(); String message = String.format("%s: KafkaConsumerProxy has stopped.", this); throw new SamzaException(message, proxy.getFailureCause()); } return super.poll(systemStreamPartitions, timeout); }</code><technical_language>add more context consumer this is? log this instead of KafkaSystemConsumer</technical_language>

Target:
public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll( Set<SystemStreamPartition> systemStreamPartitions, long timeout) throws InterruptedException { if (!proxy.isRunning()) { LOG.info("{}: KafkaConsumerProxy is not running. Stopping the consumer.", this); stop(); String message = String.format("%s: KafkaConsumerProxy has stopped.", this); throw new SamzaException(message, proxy.getFailureCause()); } return super.poll(systemStreamPartitions, timeout); }