auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int start() throws Throwable { bossGroup = new NioEventLoopGroup( 1 ); workerGroup = new NioEventLoopGroup(); ServerBootstrap server = new ServerBootstrap(); server.group( bossGroup, workerGroup ).channel( NioServerSocketChannel.class ) .childHandler( new ChannelInitializer<SocketChannel>() { @Override public void initChannel( SocketChannel ch ) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast( new ByteToMessageDecoder() { @Override protected void decode( ChannelHandlerContext ctx, ByteBuf in, List<Object> list ) throws Exception { if ( in.readableBytes() < 5 ) { return; } checkClientSocketStatus( in ); ctx.close(); } @Override public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause ) { cause.printStackTrace(); ctx.close(); } } ); } } ); serverChannel = server.bind( 0 ).sync().channel(); return ((InetSocketAddress) serverChannel.localAddress()).getPort(); }

Target:
public int start() throws Throwable { workerGroup = new NioEventLoopGroup(); ServerBootstrap server = new ServerBootstrap(); server.group( workerGroup ).channel( NioServerSocketChannel.class ) .childHandler( new ChannelInitializer<SocketChannel>() { @Override public void initChannel( SocketChannel ch ) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast( new ByteToMessageDecoder() { @Override protected void decode( ChannelHandlerContext ctx, ByteBuf in, List<Object> list ) throws Exception { if ( in.readableBytes() < 5 ) { return; } checkClientSocketStatus( in ); ctx.pipeline().remove( this ); ctx.close(); } @Override public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause ) { cause.printStackTrace(); ctx.close(); } } ); } } ); serverChannel = server.bind( 0 ).sync().channel(); return ((InetSocketAddress) serverChannel.localAddress()).getPort(); }
Source:
private void writeCombinedReportDocuments(Map<String, List<Report.Test>> testsByName) { for (List<String> combined : testReportConfig.combinedTests) { List<TestAggregations> testAggregations = new ArrayList<>(); StringBuilder sb = new StringBuilder(); for (String testName : combined) { if (sb.length() != 0) sb.append('_'); sb.append(testName); List<Report.Test> reportedTests = testsByName.get(testName); if (reportedTests == null) { log.warn("Test " + testName + " was not found!"); continue; } TestAggregations ta = new TestAggregations(testName, reportedTests); testAggregations.add(ta); } if (testAggregations.isEmpty()) { log.warn("No tests to combine"); return; } CombinedReportDocument testReport = new CombinedReportDocument(testAggregations, sb.toString(), combined, targetDir, testReportConfig); freemarker.template.Configuration cfg = initConfig(); try { testReport.createReportDirectory(); testReport.calculateClusterSizes(); testReport.createTestCharts(); Template reportTemplate = cfg.getTemplate("testReport.ftl"); PrintWriter printWriter = new PrintWriter(targetDir + File.separator + "test_" + testReport.testName + ".html"); Map root = new HashMap(); root.put("testReport", testReport); root.put("enums", DefaultObjectWrapper.getDefaultInstance().getEnumModels()); reportTemplate.process(root, printWriter); printWriter.close(); } catch (Exception e) { log.error("Templating exception", e); } } }

Target:
private void writeCombinedReportDocuments(Map<String, List<Report.Test>> testsByName) { for (List<String> combined : testReportConfig.combinedTests) { List<TestAggregations> testAggregations = new ArrayList<>(); StringBuilder sb = new StringBuilder(); for (String testName : combined) { if (sb.length() != 0) sb.append('_'); sb.append(testName); List<Report.Test> reportedTests = testsByName.get(testName); if (reportedTests == null) { log.warn("Test " + testName + " was not found!"); continue; } TestAggregations ta = new TestAggregations(testName, reportedTests); testAggregations.add(ta); } if (testAggregations.isEmpty()) { log.warn("No tests to combine"); return; } CombinedReportDocument testReport = new CombinedReportDocument(testAggregations, sb.toString(), combined, targetDir, testReportConfig); testReport.createReportDirectory(); testReport.calculateClusterSizes(); testReport.createTestCharts(); Map root = new HashMap(); root.put("testReport", testReport); root.put("enums", DefaultObjectWrapper.getDefaultInstance().getEnumModels()); processTemplate(root, targetDir, "test_" + testReport.testName + ".html", "testReport.ftl"); } }
Source:
private I18n(InputStream stream, String fallbackId) { this.keys = new HashMap<String, String>(); if (stream == null) return; try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) if (!line.isEmpty() && line.charAt(0) != 35) { String[] values = line.split("=", 2); this.keys.put(values[0], values[1]); } } catch (IOException e) { Log.warn("Could not load all translation keys", e); } if (!keys.containsKey("language.name")) keys.put("language.name", fallbackId); }

Target:
private I18n(InputStream stream, String fallbackId) { this.keys = new HashMap<String, String>(); if (stream == null) return; try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) { if (!line.isEmpty() && line.charAt(0) != '#') { String[] values = line.split("=", 2); this.keys.put(values[0], values[1]); } } } catch (IOException e) { Log.warn("Could not load all translation keys", e); } if (!keys.containsKey("language.name")) keys.put("language.name", fallbackId.toLowerCase(Locale.ENGLISH)); }
Source:
public Observable<List<GitHubRepository>> getRepositories() { return repositories; }

Target:
public Observable<List<GitHubRepository>> getRepositories() { return repositories.hide(); }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws WrongAttributeValueException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute); } if (!perunSession.getPerunBl().getModulesUtilsBl().isFQDNValid(perunSession, (String) attribute.getValue())) { throw new WrongAttributeValueException(attribute, "Bad replicaDestination attribute format " + attribute.getValue() + ". It should be" + "fully qualified domain name."); } }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws WrongAttributeValueException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute, resource, "This attribute can't be empty"); } if (!perunSession.getPerunBl().getModulesUtilsBl().isFQDNValid(perunSession, (String) attribute.getValue())) { throw new WrongAttributeValueException(attribute, resource, "Bad replicaDestination attribute format " + attribute.getValue() + ". It should be" + "fully qualified domain name."); } }
Source:
public void retrieveSubjectToken_noRegion_expectThrows() { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); IOException response = new IOException(); transportFactory.transport.addResponseErrorSequence(response); final AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); IOException e = assertThrows( IOException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { awsCredential.retrieveSubjectToken(); } }); assertThat(e.getMessage()).isEqualTo("Failed to retrieve AWS region."); }

Target:
public void retrieveSubjectToken_noRegion_expectThrows() { MockExternalAccountCredentialsTransportFactory transportFactory = new MockExternalAccountCredentialsTransportFactory(); IOException response = new IOException(); transportFactory.transport.addResponseErrorSequence(response); final AwsCredentials awsCredential = (AwsCredentials) AwsCredentials.newBuilder(AWS_CREDENTIAL) .setHttpTransportFactory(transportFactory) .setCredentialSource(buildAwsCredentialSource(transportFactory)) .build(); IOException e = assertThrows( IOException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { awsCredential.retrieveSubjectToken(); } }); assertEquals("Failed to retrieve AWS region.", e.getMessage()); }
Source:
public Map<String, String> getLabelsMap() { Set<LabelAtom> labelSet = getLabelSet(); ImmutableMap.Builder<String, String> builder = ImmutableMap.<String, String> builder(); if (!labelSet.isEmpty()) { for (LabelAtom label : labelSet) { builder.put("buildlabel",label == null ? DEFAULT_ID : "jenkins_" + label.getName()); } } return builder.build(); }

Target:
public Map<String, String> getLabelsMap() { Set<LabelAtom> labelSet = getLabelSet(); ImmutableMap.Builder<String, String> builder = ImmutableMap.<String, String> builder(); if (!labelSet.isEmpty()) { for (LabelAtom label : labelSet) { builder.put("jenkins/label",label == null ? DEFAULT_ID : label.getName()); } } return builder.build(); }
Source:
public List<String> getTableNames(String keySpace) { return cluster.getMetadata().getKeyspace(keySpace).getTables().stream().map(TableMetadata::getName).collect(toList()); }

Target:
public List<String> getTableNames(String keySpace) { Metadata clusterMetadata = cluster.getMetadata(); KeyspaceMetadata keyspaceMetadata = clusterMetadata.getKeyspace(keySpace); return keyspaceMetadata.getTables().stream() .map(TableMetadata::getName) .collect(toList()); }
Source:
private void refreshUI() { updateController.filterSortCountRefresh(getAllUIFilters()); }

Target:
private void refreshUI() { updateController.filterSortRefresh(getAllUIFilters()); }
Source:
public void testGetTriggerTask() throws Exception { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertNotNull(caseId); assertTrue(caseId.startsWith(CASE_HR_ID_PREFIX)); List<TaskSummary> caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_YODA, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); TaskSummary task = caseTasks.get(0); assertNotNull(task); assertEquals(HELLO_1_TASK, task.getName()); assertEquals(USER_YODA, task.getActualOwner()); caseClient.triggerAdHocFragment(CONTAINER_ID, caseId, HELLO_2_TASK, Collections.EMPTY_MAP); changeUser(USER_JOHN); caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_JOHN, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); task = caseTasks.get(0); assertNotNull(task); assertEquals(HELLO_2_TASK, task.getName()); assertEquals(USER_JOHN, task.getActualOwner()); changeUser(USER_YODA); caseClient.destroyCaseInstance(CONTAINER_ID, caseId); }

Target:
public void testGetTriggerTask() throws Exception { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertNotNull(caseId); assertTrue(caseId.startsWith(CASE_HR_ID_PREFIX)); changeUser(USER_JOHN); List<TaskSummary> caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_JOHN, 0, 10); assertNotNull(caseTasks); assertEquals(0, caseTasks.size()); changeUser(USER_YODA); caseClient.triggerAdHocFragment(CONTAINER_ID, caseId, HELLO_2_TASK, Collections.EMPTY_MAP); changeUser(USER_JOHN); caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_JOHN, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); TaskSummary task = caseTasks.get(0); assertNotNull(task); assertEquals(HELLO_2_TASK, task.getName()); assertEquals(USER_JOHN, task.getActualOwner()); changeUser(USER_YODA); caseTasks = caseClient.findCaseTasksAssignedAsPotentialOwner(caseId, USER_YODA, 0, 10); assertNotNull(caseTasks); assertEquals(1, caseTasks.size()); task = caseTasks.get(0); assertNotNull(task); assertEquals(HELLO_1_TASK, task.getName()); assertEquals(USER_YODA, task.getActualOwner()); caseClient.destroyCaseInstance(CONTAINER_ID, caseId); }
Source:
public AnnotationMirror greatestLowerBound( final AnnotationMirror a1, final AnnotationMirror a2) { if (AnnotationUtils.areSame(a1, BOTTOM) || AnnotationUtils.areSame(a2, BOTTOM)) { return BOTTOM; } if (!AnnotationUtils.hasElementValue(a1, "value")) { return a2; } if (!AnnotationUtils.hasElementValue(a2, "value")) { return a1; } if (isAccumulatorAnnotation(a1) && isAccumulatorAnnotation(a2)) { Set<String> a1Val = new LinkedHashSet<>( ValueCheckerUtils.getValueOfAnnotationWithStringArgument(a1)); Set<String> a2Val = new LinkedHashSet<>( ValueCheckerUtils.getValueOfAnnotationWithStringArgument(a2)); a1Val.addAll(a2Val); return createAccumulatorAnnotation(a1Val.toArray(new String[0])); } else { return BOTTOM; } }

Target:
public AnnotationMirror greatestLowerBound( final AnnotationMirror a1, final AnnotationMirror a2) { if (AnnotationUtils.areSame(a1, bottom) || AnnotationUtils.areSame(a2, bottom)) { return bottom; } List<String> a1Val = getAccumulatedValues(a1); List<String> a2Val = getAccumulatedValues(a2); if (a1Val.containsAll(a2Val)) { return a1; } if (a2Val.containsAll(a1Val)) { return a2; } a1Val.addAll(a2Val); return createAccumulatorAnnotation(a1Val); }
Source:
public FeedbackResponseAttributes(String feedbackSessionName, String courseId, String feedbackQuestionId, FeedbackQuestionType feedbackQuestionType, String giverEmail, String giverSection, String recipientEmail, String recipientSection, Text responseMetaData) { this.feedbackSessionName = Sanitizer.sanitizeTitle(feedbackSessionName); this.courseId = Sanitizer.sanitizeTitle(courseId); this.feedbackQuestionId = feedbackQuestionId; this.feedbackQuestionType = feedbackQuestionType; this.giverEmail = Sanitizer.sanitizeEmail(giverEmail); this.giverSection = giverSection; this.recipientEmail = recipientEmail; this.recipientSection = recipientSection; this.responseMetaData = responseMetaData; this.createdAt = new Date(); this.updatedAt = new Date(); }

Target:
public FeedbackResponseAttributes(String feedbackSessionName, String courseId, String feedbackQuestionId, FeedbackQuestionType feedbackQuestionType, String giverEmail, String giverSection, String recipientEmail, String recipientSection, Text responseMetaData) { this.feedbackSessionName = Sanitizer.sanitizeTitle(feedbackSessionName); this.courseId = Sanitizer.sanitizeTitle(courseId); this.feedbackQuestionId = feedbackQuestionId; this.feedbackQuestionType = feedbackQuestionType; this.giverEmail = Sanitizer.sanitizeEmail(giverEmail); this.giverSection = giverSection; this.recipientEmail = recipientEmail; this.recipientSection = recipientSection; this.responseMetaData = responseMetaData; }
Source:
public void apply(final Task task, final String action, final ActionRequest request, final ActionListener listener, final ActionFilterChain chain) { chain.proceed(task, action, request, new ActionListener<ActionResponse>() { @SuppressWarnings("unchecked") @Override public void onResponse(ActionResponse response) { if(INDICES_FIELD_STATS_READ_ACTION.equals(action) && response instanceof FieldStatsResponse) { if(((FieldStatsResponse)response).getIndicesMergedFieldStats().size() == 0) { LOGGER.trace("Modifying the response to be {}", RestStatus.NOT_FOUND); Throwable err = new ElasticsearchException("The index is empty. This could mean data has not yet been collected.\n" + "You can use the Time Picker to change the time filter or select a higher time interval", RestStatus.NO_CONTENT); listener.onFailure(err); } } listener.onResponse(response); } @Override public void onFailure(Throwable e) { LOGGER.trace("Evaluating failure for action '{}' to see if we need to change from a 403", action); Throwable err = e; if( INDICES_FIELD_STATS_READ_ACTION.equals(action) && request instanceof FieldStatsRequest) { for (String index : ((FieldStatsRequest)request).indices()) { if(!client.indexExists(index)) { LOGGER.trace("Modifying the response to be {}", RestStatus.NOT_FOUND); err = new ElasticsearchException("The index '" + index + "' was not found. This could mean data has not yet been collected.", RestStatus.NOT_FOUND); break; } } } listener.onFailure(err); } }); }

Target:
public void apply(final Task task, final String action, final ActionRequest request, final ActionListener listener, final ActionFilterChain chain) { chain.proceed(task, action, request, new ActionListener<ActionResponse>() { @SuppressWarnings("unchecked") @Override public void onResponse(ActionResponse response) { if(INDICES_FIELD_STATS_READ_ACTION.equals(action) && response instanceof FieldStatsResponse) { if(((FieldStatsResponse)response).getIndicesMergedFieldStats().isEmpty()) { LOGGER.trace("Modifying the response to be {}", RestStatus.NO_CONTENT); Throwable err = new ElasticsearchException("The index returned an empty result. " + "You can use the Time Picker to change the time filter or select a higher time interval", RestStatus.NO_CONTENT); listener.onFailure(err); return; } } listener.onResponse(response); } @Override public void onFailure(Throwable e) { LOGGER.trace("Evaluating failure for action '{}' to see if we need to change from a 403", action); Throwable err = e; if( INDICES_FIELD_STATS_READ_ACTION.equals(action) && request instanceof FieldStatsRequest) { for (String index : ((FieldStatsRequest)request).indices()) { if(!client.indexExists(index)) { LOGGER.trace("Modifying the response to be {}", RestStatus.NOT_FOUND); err = new ElasticsearchException("The index '" + index + "' was not found. This could mean data has not yet been collected.", RestStatus.NOT_FOUND); break; } } } listener.onFailure(err); } }); }
Source:
static int startIndex(String ref) { if (ref == null || !ref.startsWith(REFS_CHANGES)) { return -1; } int ls = REFS_CHANGES.length(); int le = nextNonDigit(ref, ls); if (le - ls != 2 || le >= ref.length() || ref.charAt(le) != '/') { return -1; } int cs = le + 1; if (cs >= ref.length() || ref.charAt(cs) == '0') { return -1; } int ce = nextNonDigit(ref, cs); if (ce >= ref.length() || ref.charAt(le) != '/') { return -1; } switch (ce - cs) { case 0: return -1; case 1: if (ref.charAt(ls) != '0' || ref.charAt(ls + 1) != ref.charAt(cs)) { return -1; } break; default: if (ref.charAt(ls) != ref.charAt(ce - 2) || ref.charAt(ls + 1) != ref.charAt(ce - 1)) { return -1; } break; } return cs; }

Target:
static int startIndex(String ref) { if (ref == null || !ref.startsWith(REFS_CHANGES)) { return -1; } int ls = REFS_CHANGES.length(); int le = nextNonDigit(ref, ls); if (le - ls != 2 || le >= ref.length() || ref.charAt(le) != '/') { return -1; } int cs = le + 1; if (cs >= ref.length() || ref.charAt(cs) == '0') { return -1; } int ce = nextNonDigit(ref, cs); if (ce >= ref.length() || ref.charAt(ce) != '/') { return -1; } switch (ce - cs) { case 0: return -1; case 1: if (ref.charAt(ls) != '0' || ref.charAt(ls + 1) != ref.charAt(cs)) { return -1; } break; default: if (ref.charAt(ls) != ref.charAt(ce - 2) || ref.charAt(ls + 1) != ref.charAt(ce - 1)) { return -1; } break; } return cs; }
Source:
private void bindGpioPin(MCP23017BindingProvider provider, String itemName) { try { int address = provider.getBusAddress(itemName); MCP23017GpioProvider mcp = mcpProviders.get(address); if(mcp == null) { try { mcp = new MCP23017GpioProvider(I2CBus.BUS_1, address); mcp.setPollingTime(pollingInterval); } catch (UnsupportedBusNumberException ex) { throw new IllegalArgumentException("Tried to access not available I2C bus"); } mcpProviders.put(address, mcp); } Pin pin = provider.getPin(itemName); PinMode mode = provider.getPinMode(itemName); if (mode.equals(PinMode.DIGITAL_OUTPUT)) { GpioPinDigitalOutput output = gpio.provisionDigitalOutputPin(mcp, pin, itemName, provider.getDefaultState(itemName)); gpioPins.put(itemName, output); logger.debug("Provisioned Digital Output for " + itemName); } else if (mode.equals(PinMode.DIGITAL_INPUT)) { GpioPinDigitalInput input = gpio.provisionDigitalInputPin(mcp, pin, itemName, PinPullResistance.OFF); input.setDebounce(20); input.addListener(this); gpioPins.put(itemName, input); logger.debug("Provisioned Digital Input for " + itemName); } else { throw new IllegalArgumentException("Invalid Pin Mode in config " + mode.name()); } } catch (IOException e) { logger.error("IO ERROR " + e.getMessage()); } }

Target:
private void bindGpioPin(MCP23017BindingProvider provider, String itemName) { try { int address = provider.getBusAddress(itemName); MCP23017GpioProvider mcp = mcpProviders.get(address); if (mcp == null) { try { mcp = new MCP23017GpioProvider(I2CBus.BUS_1, address); mcp.setPollingTime(pollingInterval); } catch (UnsupportedBusNumberException ex) { throw new IllegalArgumentException("Tried to access not available I2C bus"); } mcpProviders.put(address, mcp); } Pin pin = provider.getPin(itemName); PinMode mode = provider.getPinMode(itemName); if (mode.equals(PinMode.DIGITAL_OUTPUT)) { GpioPinDigitalOutput output = gpio.provisionDigitalOutputPin(mcp, pin, itemName, provider.getDefaultState(itemName)); gpioPins.put(itemName, output); logger.debug("Provisioned digital output for {}", itemName); } else if (mode.equals(PinMode.DIGITAL_INPUT)) { GpioPinDigitalInput input = gpio.provisionDigitalInputPin(mcp, pin, itemName, PinPullResistance.OFF); input.setDebounce(20); input.addListener(this); gpioPins.put(itemName, input); logger.debug("Provisioned digital input for {}", itemName); } else { throw new IllegalArgumentException("Invalid Pin Mode in config " + mode.name()); } } catch (IOException exception) { logger.error("I/O error {}", exception.getMessage()); } }
Source:
private Anchor createConfigureMenuItem(String title, String id) { Anchor itemAnchor; itemAnchor = configureLink; Span titleSpan = new Span(); titleSpan.addStyleName(PatternflyStyles.LIST_GROUP_ITEM_VALUE); titleSpan.setText(title); itemAnchor.add(titleSpan); itemAnchor.setId(id); itemAnchor.addClickHandler(e -> { e.preventDefault(); }); return itemAnchor; }

Target:
private Anchor createConfigureMenuItem(String title, String id) { Anchor itemAnchor = configureLink; Span titleSpan = new Span(); titleSpan.addStyleName(PatternflyStyles.LIST_GROUP_ITEM_VALUE); titleSpan.setText(title); itemAnchor.add(titleSpan); itemAnchor.setId(id); itemAnchor.addClickHandler(e -> { e.preventDefault(); }); return itemAnchor; }
Source:
public String toString() { StringBuilder result = new StringBuilder(); if (!getLang().equals("und") && getLang() != null) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }

Target:
public String toString() { StringBuilder result = new StringBuilder(); if (getLang() != null && !getLang().equals("und")) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }
Source:
public long restore(DataTree dt, Map<Long, Integer> sessions, PlayBackListener listener) throws IOException { long snapLoadingStartTime = Time.currentElapsedTime(); long deserializeResult = snapLog.deserialize(dt, sessions); ServerMetrics.getMetrics().STARTUP_SNAP_LOAD_TIME.add(Time.currentElapsedTime() - snapLoadingStartTime); FileTxnLog txnLog = new FileTxnLog(dataDir); boolean trustEmptyDB; File initFile = new File(dataDir.getParent(), "initialize"); if (Files.deleteIfExists(initFile.toPath())) { LOG.info("Initialize file found, an empty database will not block voting participation"); trustEmptyDB = true; } else { trustEmptyDB = autoCreateDB; } if (-1L == deserializeResult) { if (txnLog.getLastLoggedZxid() != -1) { if (!trustEmptySnapshot) { throw new IOException(EMPTY_SNAPSHOT_WARNING + "Something is broken!"); } else { LOG.warn(EMPTY_SNAPSHOT_WARNING + "This should only be allowed during upgrading."); trustEmptySnapshot = false; } } if (trustEmptyDB) { save(dt, (ConcurrentHashMap<Long, Integer>) sessions, false); return 0L; } else { LOG.warn("Unexpected empty data tree, setting zxid to -1"); dt.lastProcessedZxid = -1L; return -1L; } } long highestZxid = fastForwardFromEdits(dt, sessions, listener); DataTree.ZxidDigest snapshotZxidDigest = dt.getDigestFromLoadedSnapshot(); if (snapshotZxidDigest != null) { LOG.warn("Highest txn zxid 0x{} is not covering the snapshot " + "digest zxid 0x{}, which might lead to inconsistent state", Long.toHexString(highestZxid), Long.toHexString(snapshotZxidDigest.getZxid())); } return highestZxid; }

Target:
public long restore(DataTree dt, Map<Long, Integer> sessions, PlayBackListener listener) throws IOException { long snapLoadingStartTime = Time.currentElapsedTime(); long deserializeResult = snapLog.deserialize(dt, sessions); ServerMetrics.getMetrics().STARTUP_SNAP_LOAD_TIME.add(Time.currentElapsedTime() - snapLoadingStartTime); FileTxnLog txnLog = new FileTxnLog(dataDir); boolean trustEmptyDB; File initFile = new File(dataDir.getParent(), "initialize"); if (Files.deleteIfExists(initFile.toPath())) { LOG.info("Initialize file found, an empty database will not block voting participation"); trustEmptyDB = true; } else { trustEmptyDB = autoCreateDB; } if (-1L == deserializeResult) { if (txnLog.getLastLoggedZxid() != -1) { if (!trustEmptySnapshot) { throw new IOException(EMPTY_SNAPSHOT_WARNING + "Something is broken!"); } else { LOG.warn(EMPTY_SNAPSHOT_WARNING + "This should only be allowed during upgrading."); } } if (trustEmptyDB) { save(dt, (ConcurrentHashMap<Long, Integer>) sessions, false); return 0L; } else { LOG.warn("Unexpected empty data tree, setting zxid to -1"); dt.lastProcessedZxid = -1L; return -1L; } } long highestZxid = fastForwardFromEdits(dt, sessions, listener); DataTree.ZxidDigest snapshotZxidDigest = dt.getDigestFromLoadedSnapshot(); if (snapshotZxidDigest != null) { LOG.warn("Highest txn zxid 0x{} is not covering the snapshot " + "digest zxid 0x{}, which might lead to inconsistent state", Long.toHexString(highestZxid), Long.toHexString(snapshotZxidDigest.getZxid())); } return highestZxid; }
Source:
private void writeHttpResponse(HttpServletResponse response, Map<String, Object> outputMessage) throws IOException { response.setContentType("org/apache/tajo/storage/text/html"); OutputStream out = response.getOutputStream(); out.write(om.writeValueAsBytes(outputMessage)); out.flush(); out.close(); }

Target:
private void writeHttpResponse(HttpServletResponse response, Map<String, Object> outputMessage) throws IOException { response.setContentType("text/html"); OutputStream out = response.getOutputStream(); out.write(om.writeValueAsBytes(outputMessage)); out.flush(); out.close(); }
Source:
public Map<String, String> getSmallRowRangeColumn2(RangeRequest rangeRequest) { ColumnSelection colSelection = ColumnSelection.create(ImmutableList.of(PtBytes.toCachedBytes("d"))); rangeRequest = rangeRequest.getBuilder().retainColumns(colSelection).build(); Preconditions.checkArgument(rangeRequest.getColumnNames().size() <= 1, "Must not request columns other than Column2."); Map<String, String> resultsMap = new LinkedHashMap<>(); BatchingVisitableView.of(t.getRange(tableRef, rangeRequest)) .immutableCopy().forEach(entry -> { SchemaApiTestTable.SchemaApiTestRowResult resultEntry = SchemaApiTestTable.SchemaApiTestRowResult.of(entry); resultsMap.put(resultEntry.getRowName().getComponent1(), resultEntry.getColumn2()); }); return resultsMap; }

Target:
public LinkedHashMap<String, String> getSmallRowRangeColumn2(RangeRequest rangeRequest) { ColumnSelection colSelection = ColumnSelection.create(ImmutableList.of(PtBytes.toCachedBytes("d"))); rangeRequest = rangeRequest.getBuilder().retainColumns(colSelection).build(); Preconditions.checkArgument(rangeRequest.getColumnNames().size() <= 1, "Must not request columns other than Column2."); LinkedHashMap<String, String> resultsMap = new LinkedHashMap<>(); BatchingVisitableView.of(t.getRange(tableRef, rangeRequest)) .immutableCopy().forEach(entry -> { SchemaApiTestTable.SchemaApiTestRowResult resultEntry = SchemaApiTestTable.SchemaApiTestRowResult.of(entry); resultsMap.put(resultEntry.getRowName().getComponent1(), resultEntry.getColumn2()); }); return resultsMap; }
Source:
private static Optional<JsonObject> readJson(String path) { final Optional<JsonElement> e = read(path).map(bytes -> parser.parse(new String(bytes, StandardCharsets.UTF_8))); return e.isPresent() && !e.get().isJsonNull() ? e.map(o -> o.getAsJsonObject()) : Optional.empty(); }

Target:
private static Optional<JsonObject> readJson(String path) { final Optional<JsonElement> e = read(path).map(bytes -> parser.parse(new String(bytes, StandardCharsets.UTF_8))); return e.filter(o -> !o.isJsonNull()).map(JsonElement::getAsJsonObject); }
Source:
public CommentBodyWrapperEditor(Composite parent, int style) { if (Platform.getPreferencesService().getBoolean("org.eclipse.papyrus.infra.ui", RichtextPreferencePage.USE_CK_EDITOR, false, null)) { richTextEditor = new CommentBodyRichTextEditor(parent, style); normalEditor = null; } else { normalEditor = new CommentBodyEditor(parent, style); richTextEditor = null; } if (richTextEditor == null && normalEditor == null) { normalEditor = new CommentBodyEditor(parent, style); } }

Target:
public CommentBodyWrapperEditor(Composite parent, int style) { if (Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, RichtextPreferencePage.USE_CK_EDITOR, false, null)) { richTextEditor = new CommentBodyRichTextEditor(parent, style); normalEditor = null; } else { normalEditor = new CommentBodyEditor(parent, style); richTextEditor = null; } if (richTextEditor == null && normalEditor == null) { normalEditor = new CommentBodyEditor(parent, style); } }
Source:
protected void setStudy(Study study, HttpSession session) { String boardUrl = study.getBoardUrl(); if (boardUrl == null) { String accessToken = (String) session.getAttribute("accessToken"); if (accessToken != null) { try { boardUrl = getStudyBuildService().getCurrentBoardUrl(accessToken, study); study.setBoardUrl(boardUrl); try { getStudyDao().update(study); } catch (StaleStateException e) { } } catch (Exception e) { logger.error(e.getMessage(), e); } } } session.setAttribute("study", study); }

Target:
protected void setStudy(Study study, HttpSession session) { getCurrentBoardUrl(study, session); session.setAttribute("study", study); }
Source:
public static void main(String[] args) throws Exception { final Options options = getOptions(); final CommandLineParser parser = new PosixParser(); final CommandLine commandLine; try { commandLine = parser.parse(options, args); } catch (ParseException e) { System.err.println(e.getMessage()); printHelp(options); return; } final ApplicationContext applicationContext = PortalApplicationContextLocator.getApplicationContext(); try { final Binding binding = new SpringBinding(applicationContext); binding.setVariable("logger", LOGGER); if (commandLine.hasOption("script")) { final String scriptName = commandLine.getOptionValue("script"); final File scriptFile = getAbsoluteFile(scriptName); final CompilerConfiguration conf = new CompilerConfiguration(System.getProperties()); final GroovyShell shell = new GroovyShell(binding, conf); shell.run(scriptFile, args); } } finally { if (applicationContext instanceof DisposableBean) { ((DisposableBean) applicationContext).destroy(); } } }

Target:
public static void main(String[] args) throws Exception { final Options options = getOptions(); final CommandLineParser parser = new PosixParser(); final CommandLine commandLine; try { commandLine = parser.parse(options, args); } catch (ParseException e) { System.err.println(e.getMessage()); printHelp(options); return; } final ApplicationContext applicationContext = PortalApplicationContextLocator.getApplicationContext(); try { final Binding binding = new SpringBinding(applicationContext); binding.setVariable("logger", LOGGER); final CompilerConfiguration conf = new CompilerConfiguration(System.getProperties()); final GroovyShell shell = new GroovyShell(binding, conf); if (commandLine.hasOption("script")) { final String scriptName = commandLine.getOptionValue("script"); final File scriptFile = getAbsoluteFile(scriptName); shell.run(scriptFile, args); } } finally { if (applicationContext instanceof DisposableBean) { ((DisposableBean) applicationContext).destroy(); } } }
Source:
public SplitStreamlet(StreamletImpl<R> parent, Map<String, SerializablePredicate<R>> splitFns) { StreamletUtils.require(splitFns.size() > 0, "At least one entry is required"); for (String stream: splitFns.keySet()) { StreamletUtils.checkNotBlank(stream, "Stream id can not be empty"); } this.parent = parent; this.splitFns = splitFns; setNumPartitions(parent.getNumPartitions()); }

Target:
public SplitStreamlet(StreamletImpl<R> parent, Map<String, SerializablePredicate<R>> splitFns) { this.parent = parent; this.splitFns = splitFns; setNumPartitions(parent.getNumPartitions()); }
Source:
public void testFullTextExtractionFilterValidMimeType() throws Exception { getMockEndpoint("mock:direct:fulltext.extraction").expectedMessageCount(1); createContext(extractionRoute); template.sendBodyAndHeaders("", createEvent(fileID, eventTypes)); assertMockEndpointsSatisfied(); }

Target:
public void testFullTextExtractionFilterValidMimeType() throws Exception { getMockEndpoint("mock:direct:fulltext.extraction").expectedMessageCount(1); createContext(EXTRACTION_ROUTE); template.sendBodyAndHeaders("", createEvent(FILE_ID)); assertMockEndpointsSatisfied(); }
Source:
public PhysicalPlan<PartitionedQuery, MistEvent.Direction> chainOperators( final PhysicalPlan<Operator, MistEvent.Direction> plan) { final Map<Source, Map<PartitionedQuery, MistEvent.Direction>> sourceMap = new HashMap<>(); final Map<PartitionedQuery, Set<Sink>> sinkMap = new HashMap<>(); final DAG<PartitionedQuery, MistEvent.Direction> partitionedQueryDAG = new AdjacentListDAG<>(); final Map<Operator, PartitionedQuery> partitionedQueryMap = new HashMap<>(); for (final Map.Entry<Source, Map<Operator, MistEvent.Direction>> entry : plan.getSourceMap().entrySet()) { final Map<Operator, MistEvent.Direction> rootOperatorEdges = entry.getValue(); final Map<PartitionedQuery, MistEvent.Direction> partitionedQueries = new HashMap<>(); final Iterator<Operator> rootOperators = rootOperatorEdges.keySet().iterator(); while (rootOperators.hasNext()) { final Operator rootOperator = rootOperators.next(); final MistEvent.Direction edgeDirection = rootOperatorEdges.get(rootOperator); PartitionedQuery currOpChain = partitionedQueryMap.get(rootOperator); if (currOpChain == null) { currOpChain = new DefaultPartitionedQuery(); partitionedQueryMap.put(rootOperator, currOpChain); currOpChain.insertToTail(rootOperator); chainOperatorHelper(plan, partitionedQueryMap, partitionedQueryDAG, sinkMap, rootOperator, null, currOpChain, edgeDirection); } partitionedQueries.put(currOpChain, edgeDirection); } sourceMap.put(entry.getKey(), partitionedQueries); } return new DefaultPhysicalPlanImpl<>(sourceMap, partitionedQueryDAG, sinkMap); }

Target:
public PhysicalPlan<PartitionedQuery, MistEvent.Direction> chainOperators( final PhysicalPlan<Operator, MistEvent.Direction> plan) { final Map<Source, Map<PartitionedQuery, MistEvent.Direction>> sourceMap = new HashMap<>(); final Map<PartitionedQuery, Set<Sink>> sinkMap = new HashMap<>(); final DAG<PartitionedQuery, MistEvent.Direction> partitionedQueryDAG = new AdjacentListDAG<>(); final Map<Operator, PartitionedQuery> partitionedQueryMap = new HashMap<>(); for (final Map.Entry<Source, Map<Operator, MistEvent.Direction>> entry : plan.getSourceMap().entrySet()) { final Map<Operator, MistEvent.Direction> rootOperatorEdges = entry.getValue(); final Map<PartitionedQuery, MistEvent.Direction> partitionedQueries = new HashMap<>(); for (final Map.Entry<Operator, MistEvent.Direction> opAndEdge : rootOperatorEdges.entrySet()) { final Operator rootOperator = opAndEdge.getKey(); final MistEvent.Direction edgeDirection = opAndEdge.getValue(); PartitionedQuery currOpChain = partitionedQueryMap.get(rootOperator); if (currOpChain == null) { currOpChain = new DefaultPartitionedQuery(); partitionedQueryMap.put(rootOperator, currOpChain); currOpChain.insertToTail(rootOperator); chainOperatorHelper(plan, partitionedQueryMap, partitionedQueryDAG, sinkMap, rootOperator, null, currOpChain, edgeDirection); } partitionedQueries.put(currOpChain, edgeDirection); } sourceMap.put(entry.getKey(), partitionedQueries); } return new DefaultPhysicalPlanImpl<>(sourceMap, partitionedQueryDAG, sinkMap); }
Source:
private void updatePartitionPools(SequencerPartitionContainer<SequencerPoolPartition> source, SequencerPartitionContainer<SequencerPoolPartition> managed) throws IOException { for (SequencerPoolPartition sourcePartition : source.getPartitions()) { for (SequencerPoolPartition managedPartition : source.getPartitions()) { if (sourcePartition.getId() == managedPartition.getId()) { Pool sourcePool = sourcePartition.getPool(); Pool managedPool = managedPartition.getPool(); if (sourcePool == null && managedPool == null) continue; if (sourcePool == null && managedPool != null) { managedPartition.setPool(null); } else if (sourcePool != null && managedPool == null) { managedPartition.setPool(getPoolById(sourcePool.getId())); } else if (sourcePool.getId() == managedPool.getId()) { managedPartition.setPool(getPoolById(sourcePool.getId())); } } } } }

Target:
private void updatePartitionPools(SequencerPartitionContainer<SequencerPoolPartition> source, SequencerPartitionContainer<SequencerPoolPartition> managed) throws IOException { for (SequencerPoolPartition sourcePartition : source.getPartitions()) { for (SequencerPoolPartition managedPartition : source.getPartitions()) { if (sourcePartition.getId() == managedPartition.getId()) { Pool sourcePool = sourcePartition.getPool(); Pool managedPool = managedPartition.getPool(); if (sourcePool == null && managedPool == null) continue; if (sourcePool == null && managedPool != null) { managedPartition.setPool(null); } else if (sourcePool != null && managedPool == null) { managedPartition.setPool(getPoolById(sourcePool.getId())); } else if (sourcePool.getId() != managedPool.getId()) { managedPartition.setPool(getPoolById(sourcePool.getId())); } } } } }
Source:
public static EndpointContext extractContext(Identity identity, boolean preventConnectionInitiation) { Principal peerIdentity = null; if (identity != null) { if (identity.isPSK()) { peerIdentity = new PreSharedKeyIdentity(identity.getPskIdentity()); } else if (identity.isRPK()) { peerIdentity = new RawPublicKeyIdentity(identity.getRawPublicKey()); } else if (identity.isX509()) { peerIdentity = new X500Principal("CN=" + identity.getX509CommonName()); } } if (peerIdentity != null) { if (preventConnectionInitiation) { return new MapBasedEndpointContext(identity.getPeerAddress(), peerIdentity, DtlsEndpointContext.KEY_HANDSHAKE_MODE, DtlsEndpointContext.HANDSHAKE_MODE_NONE); } } return new AddressEndpointContext(identity.getPeerAddress(), peerIdentity); }

Target:
public static EndpointContext extractContext(Identity identity, boolean preventConnectionInitiation) { Principal peerIdentity = null; if (identity != null) { if (identity.isPSK()) { peerIdentity = new PreSharedKeyIdentity(identity.getPskIdentity()); } else if (identity.isRPK()) { peerIdentity = new RawPublicKeyIdentity(identity.getRawPublicKey()); } else if (identity.isX509()) { peerIdentity = new X500Principal("CN=" + identity.getX509CommonName()); } } if (peerIdentity != null && preventConnectionInitiation) { return new MapBasedEndpointContext(identity.getPeerAddress(), peerIdentity, DtlsEndpointContext.KEY_HANDSHAKE_MODE, DtlsEndpointContext.HANDSHAKE_MODE_NONE); } return new AddressEndpointContext(identity.getPeerAddress(), peerIdentity); }
Source:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final Resource original = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); delegate.execute(context, operation); assert context.isBooting() == false; if (context.isBooting()) { return; } final Resource domain = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); if (context.getRunningMode() == RunningMode.ADMIN_ONLY) { return; } if (syncWithMaster(domain, hostElement)) { final MasterDomainControllerClient masterDomainControllerClient = (MasterDomainControllerClient) context.getServiceRegistry(false).getRequiredService(MasterDomainControllerClient.SERVICE_NAME).getValue(); masterDomainControllerClient.fetchAndSyncMissingConfiguration(context, original); } }

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final Resource original = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); delegate.execute(context, operation); assert context.isBooting() == false; if (context.isBooting()) { return; } final Resource domain = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); if (syncWithMaster(domain, hostElement)) { MasterDomainControllerClient masterDomainControllerClient = null; try { masterDomainControllerClient = (MasterDomainControllerClient) context.getServiceRegistry(false).getRequiredService(MasterDomainControllerClient.SERVICE_NAME).getValue(); } catch (ServiceNotFoundException e) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) { return; } throw e; } masterDomainControllerClient.fetchAndSyncMissingConfiguration(context, original); } }
Source:
public static boolean isIanaResource(final RpslObject resource) { final RpslAttribute netname = resource.findAttribute(AttributeType.NETNAME); final boolean status = (netname != null && IANA_NETNAME.equals(netname.getValue().trim())); LOGGER.debug("Is inetnum with netname iana? {}", resource.getKey(), netname != null ? netname.getValue() : null, status); return status; }

Target:
public static boolean isIanaResource(final RpslObject resource) { final RpslAttribute netname = resource.findAttribute(AttributeType.NETNAME); return (netname != null && IANA_NETNAME.equals(netname.getValue().trim())); }
Source:
public CdnDTO clone() { CdnDTO copy = super.clone(); CertificateDTO cdnCert = this.getCertificate(); copy.cert = cdnCert != null ? cdnCert.clone() : null; return copy; }

Target:
public CdnDTO clone() { CdnDTO copy = super.clone(); CertificateDTO cdnCert = this.getCertificate(); copy.setCertificate(cdnCert != null ? cdnCert.clone() : null); return copy; }
Source:
public TaskResult call() { long startTimeMillis = System.currentTimeMillis(); IMetricsScope scope = MetricsHelper.getMetricsScope(); scope.addDimension(MetricsHelper.SHARD_ID_DIMENSION_NAME, shardInfo.getShardId()); scope.addData(RECORDS_PROCESSED_METRIC, 0, StandardUnit.Count, MetricsLevel.SUMMARY); scope.addData(DATA_BYTES_PROCESSED_METRIC, 0, StandardUnit.Bytes, MetricsLevel.SUMMARY); getRecordsCache.setMetricOperation(this.getClass().getSimpleName()); Exception exception = null; try { if (dataFetcher.isShardEndReached()) { LOG.info("Reached end of shard " + shardInfo.getShardId()); return new TaskResult(null, true); } final ProcessRecordsInput processRecordsInput = getRecordsResult(); throttlingReporter.success(); List<Record> records = processRecordsInput.getRecords(); if (!records.isEmpty()) { scope.addData(RECORDS_PROCESSED_METRIC, records.size(), StandardUnit.Count, MetricsLevel.SUMMARY); } else { handleNoRecords(startTimeMillis); } records = deaggregateRecords(records); recordProcessorCheckpointer.setLargestPermittedCheckpointValue( filterAndGetMaxExtendedSequenceNumber(scope, records, recordProcessorCheckpointer.getLastCheckpointValue(), recordProcessorCheckpointer.getLargestPermittedCheckpointValue())); if (shouldCallProcessRecords(records)) { callProcessRecords(processRecordsInput, records); } } catch (ProvisionedThroughputExceededException pte) { throttlingReporter.throttled(); exception = pte; backoff(); } catch (RuntimeException e) { LOG.error("ShardId " + shardInfo.getShardId() + ": Caught exception: ", e); exception = e; backoff(); } return new TaskResult(exception); }

Target:
public TaskResult call() { long startTimeMillis = System.currentTimeMillis(); IMetricsScope scope = MetricsHelper.getMetricsScope(); scope.addDimension(MetricsHelper.SHARD_ID_DIMENSION_NAME, shardInfo.getShardId()); scope.addData(RECORDS_PROCESSED_METRIC, 0, StandardUnit.Count, MetricsLevel.SUMMARY); scope.addData(DATA_BYTES_PROCESSED_METRIC, 0, StandardUnit.Bytes, MetricsLevel.SUMMARY); Exception exception = null; try { if (dataFetcher.isShardEndReached()) { LOG.info("Reached end of shard " + shardInfo.getShardId()); return new TaskResult(null, true); } final ProcessRecordsInput processRecordsInput = getRecordsResult(); throttlingReporter.success(); List<Record> records = processRecordsInput.getRecords(); if (!records.isEmpty()) { scope.addData(RECORDS_PROCESSED_METRIC, records.size(), StandardUnit.Count, MetricsLevel.SUMMARY); } else { handleNoRecords(startTimeMillis); } records = deaggregateRecords(records); recordProcessorCheckpointer.setLargestPermittedCheckpointValue( filterAndGetMaxExtendedSequenceNumber(scope, records, recordProcessorCheckpointer.getLastCheckpointValue(), recordProcessorCheckpointer.getLargestPermittedCheckpointValue())); if (shouldCallProcessRecords(records)) { callProcessRecords(processRecordsInput, records); } } catch (ProvisionedThroughputExceededException pte) { throttlingReporter.throttled(); exception = pte; backoff(); } catch (RuntimeException e) { LOG.error("ShardId " + shardInfo.getShardId() + ": Caught exception: ", e); exception = e; backoff(); } return new TaskResult(exception); }