auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void handleBinInfo(ITmfEvent event, final Long vpid, final ITmfStateSystemBuilder ss, boolean statedump) { Long baddr = event.getContent().getFieldValue(Long.class, fLayout.fieldBaddr()); Long memsz = event.getContent().getFieldValue(Long.class, fLayout.fieldMemsz()); String path = event.getContent().getFieldValue(String.class, fLayout.fieldPath()); Long hasBuildIdValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasBuildId()); Long hasDebugLinkValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasDebugLink()); Long isPicValue = event.getContent().getFieldValue(Long.class, fLayout.fieldIsPic()); if (baddr == null || memsz == null || path == null || hasBuildIdValue == null || hasDebugLinkValue == null || (statedump && isPicValue == null)) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "[UstDebugInfoStateProvider:InvalidBinInfoEvent]", "event", event); return; } boolean isPic = (statedump ? (checkNotNull(isPicValue).longValue() != 0) : true); long ts = getBinInfoTimeStamp(event, vpid, statedump); boolean hasBuildId = (hasBuildIdValue != 0); boolean hasDebugLink = (hasDebugLinkValue != 0); PendingBinInfo p = new PendingBinInfo(hasBuildId, hasDebugLink, vpid, baddr, memsz, path, isPic); processPendingBinInfo(p, ts, ss); }

Target:
private void handleBinInfo(ITmfEvent event, final Long vpid, final ITmfStateSystemBuilder ss, boolean statedump) { Long baddr = event.getContent().getFieldValue(Long.class, fLayout.fieldBaddr()); Long memsz = event.getContent().getFieldValue(Long.class, fLayout.fieldMemsz()); String path = event.getContent().getFieldValue(String.class, fLayout.fieldPath()); Long hasBuildIdValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasBuildId()); Long hasDebugLinkValue = event.getContent().getFieldValue(Long.class, fLayout.fieldHasDebugLink()); Long isPicValue = event.getContent().getFieldValue(Long.class, fLayout.fieldIsPic()); if (baddr == null || memsz == null || path == null || hasBuildIdValue == null || hasDebugLinkValue == null || (statedump && isPicValue == null)) { TraceCompassLogUtils.traceInstant(LOGGER, Level.CONFIG, "UstDebugInfoStateProvider:InvalidBinInfoEvent", "event", event); return; } boolean isPic = (statedump ? (checkNotNull(isPicValue).longValue() != 0) : true); long ts = getBinInfoTimeStamp(event, vpid, statedump); boolean hasBuildId = (hasBuildIdValue != 0); boolean hasDebugLink = (hasDebugLinkValue != 0); PendingBinInfo p = new PendingBinInfo(hasBuildId, hasDebugLink, vpid, baddr, memsz, path, isPic); processPendingBinInfo(p, ts, ss); }
Source:
public SequencerServer(ServerContext serverContext) { this.serverContext = serverContext; Config config = Config.parse(serverContext.getServerConfig()); this.executor = Executors.newSingleThreadExecutor( new ServerThreadFactory("sequencer-", new ServerThreadFactory.ExceptionHandler())); globalLogTail = config.getInitialToken(); this.cache = new SequencerServerCache((int)config.getCacheSize()); setUpTimerNameCache(); }

Target:
public SequencerServer(ServerContext serverContext) { this.serverContext = serverContext; Config config = Config.parse(serverContext.getServerConfig()); this.executor = Executors.newSingleThreadExecutor( new ServerThreadFactory("sequencer-", new ServerThreadFactory.ExceptionHandler())); globalLogTail = Address.getMinAddress(); this.cache = new SequencerServerCache(config.getCacheSize(), globalLogTail - 1); setUpTimerNameCache(); }
Source:
public void updated(final Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Enumeration<String> configKeys = config.keys(); while (configKeys.hasMoreElements()) { String configKey = (String) configKeys.nextElement(); if ("service.pid".equals(configKey)) { continue; } String value = (String) config.get(configKey); logger.debug("Set config to {}",configKey,value); if(CONFIG_REFRESH.equals(configKey)) { if (isNotBlank(value)) { this.refreshInterval = Long.parseLong(value); } } else if (CONFIG_USER_ID.equals(configKey)) { this.user_id = value; } else if (CONFIG_KEY.equals(configKey)) { this.key = value; } else { throw new ConfigurationException(configKey, "the given configKey '" + configKey + "' is unknown"); } } setProperlyConfigured(true); } }

Target:
public void updated(final Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String useridString = (String) config.get("user_id"); if (StringUtils.isNotBlank(useridString)) { this.user_id = useridString; } String keyString = (String) config.get("key"); if (StringUtils.isNotBlank(keyString)) { this.key = keyString; } String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { this.refreshInterval = Long.parseLong(refreshIntervalString); } setProperlyConfigured(true); } }
Source:
public void requireViewClientAuthenticatorProviders() { if (!(canViewRealm() || root.hasOneAdminRole(AdminRoles.QUERY_CLIENTS))) { throw new ForbiddenException(); } }

Target:
public void requireViewClientAuthenticatorProviders() { if (!(canViewRealm() || root.hasOneAdminRole(AdminRoles.QUERY_CLIENTS, AdminRoles.VIEW_CLIENTS, AdminRoles.MANAGE_CLIENTS))) { throw new ForbiddenException(); } }
Source:
private void onOwnershipAckMsg(final MigrationMsg msg) { final String operationId = msg.getOperationId().toString(); final OwnershipAckMsg ownershipAckMsg = msg.getOwnershipAckMsg(); final int blockId = ownershipAckMsg.getBlockId(); final int oldOwnerId = ownershipAckMsg.getOldOwnerId(); final int newOwnerId = ownershipAckMsg.getNewOwnerId(); try (final TraceScope onOwnershipAckMsgScope = Trace.startSpan( String.format("on_ownership_ack_msg. blockId: %d", blockId), HTraceUtils.fromAvro(msg.getTraceInfo()))) { migrationManager.updateOwner(blockId, oldOwnerId, newOwnerId); final boolean ownershipAckMsgArrivedFirst; TraceInfo blockMovedMsgTraceInfo = null; synchronized (this) { ownershipAckMsgArrivedFirst = !blockMovedMsgArrivedBlockIds.containsKey(blockId); if (ownershipAckMsgArrivedFirst) { ownershipAckMsgArrivedBlockIds.add(blockId); } else { blockMovedMsgTraceInfo = blockMovedMsgArrivedBlockIds.remove(blockId).get(); } } if (!ownershipAckMsgArrivedFirst) { handleBlockMovedMsg(operationId, blockId, blockMovedMsgTraceInfo); } } }

Target:
private void onOwnershipAckMsg(final MigrationMsg msg) { final String operationId = msg.getOperationId().toString(); final OwnershipAckMsg ownershipAckMsg = msg.getOwnershipAckMsg(); final int blockId = ownershipAckMsg.getBlockId(); final int oldOwnerId = ownershipAckMsg.getOldOwnerId(); final int newOwnerId = ownershipAckMsg.getNewOwnerId(); try (final TraceScope onOwnershipAckMsgScope = Trace.startSpan( String.format("on_ownership_ack_msg. blockId: %d", blockId), HTraceUtils.fromAvro(msg.getTraceInfo()))) { migrationManager.updateOwner(blockId, oldOwnerId, newOwnerId); final boolean ownershipAckMsgArrivedFirst; TraceInfo blockMovedMsgTraceInfo = null; synchronized (this) { ownershipAckMsgArrivedFirst = !blockMovedMsgArrivedBlockIds.containsKey(blockId); if (ownershipAckMsgArrivedFirst) { ownershipAckMsgArrivedBlockIds.add(blockId); } else { blockMovedMsgTraceInfo = blockMovedMsgArrivedBlockIds.remove(blockId).get(); } } if (!ownershipAckMsgArrivedFirst) { processBlockMovedMsg(operationId, blockId, blockMovedMsgTraceInfo); } } }
Source:
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, String message) { try { executable.execute(); } catch (Throwable actualException) { if (expectedType.isInstance(actualException)) { return (T) actualException; } else { throw new AssertionFailedError(message, actualException); } } throw new AssertionFailedError(message); }

Target:
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, String message) { return assertThrows(expectedType, executable, () -> message); }
Source:
public boolean contains(T t) { final int element = toInt.apply(t); if (element < 0) { throw new IllegalArgumentException("bitset element must be >= 0"); } final int index = element >> ADDRESS_BITS_PER_WORD; return (getWord(index) & (1L << element)) != 0; }

Target:
public boolean contains(T t) { final int element = toInt.apply(t); if (element < 0) { throw new IllegalArgumentException("bitset element must be >= 0"); } final int index = element >> ADDRESS_BITS_PER_WORD; return index < getWordsNum() && (getWord(index) & (1L << element)) != 0; }
Source:
public void testRemoteListDirectory() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, null))).thenReturn(new StubGetBucketResponse(0)); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "baz"))).thenReturn(new StubGetBucketResponse(1)); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "/foo/baz"))).thenReturn(new StubGetBucketResponse(1)); Iterable<FileSystemKey> fileSystemKeys = Ds3ClientHelpers.wrap(ds3Client).remoteListDirectory(MYBUCKET, null, "/", null, 0); final List<FileSystemKey> contentsList = Lists.newArrayList(fileSystemKeys); assertThat(contentsList.size(), is(3)); }

Target:
public void testRemoteListDirectory() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, null))).thenReturn(new StubGetBucketResponse(0)); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "baz"))).thenReturn(new StubGetBucketResponse(1)); Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "/foo/baz"))).thenReturn(new StubGetBucketResponse(1)); final Iterable<FileSystemKey> fileSystemKeys = Ds3ClientHelpers.wrap(ds3Client).remoteListDirectory(MYBUCKET, null, "/", null, 0); final List<FileSystemKey> contentsList = Lists.newArrayList(fileSystemKeys); assertThat(contentsList.size(), is(3)); }
Source:
public ItemStack extractItem(int slot, int amount, boolean simulate) { if (amount == 0) return null; ItemStack[] stacks = this.stacks; validateSlotIndex(slot, stacks); ItemStack existing = stacks[slot]; if (existing == null) return null; int toExtract = Math.min(amount, existing.getMaxStackSize()); if (existing.stackSize <= toExtract) { if (!simulate) { stacks[slot] = null; onContentsChanged(slot); } return existing; } else { if (!simulate) { stacks[slot] = ItemHandlerHelper.copyStackWithSize(existing, existing.stackSize - toExtract); onContentsChanged(slot); } return ItemHandlerHelper.copyStackWithSize(existing, toExtract); } }

Target:
public ItemStack extractItem(int slot, int amount, boolean simulate) { if (amount == 0) return null; validateSlotIndex(slot); ItemStack existing = this.stacks[slot]; if (existing == null) return null; int toExtract = Math.min(amount, existing.getMaxStackSize()); if (existing.stackSize <= toExtract) { if (!simulate) { this.stacks[slot] = null; onContentsChanged(slot); } return existing; } else { if (!simulate) { this.stacks[slot] = ItemHandlerHelper.copyStackWithSize(existing, existing.stackSize - toExtract); onContentsChanged(slot); } return ItemHandlerHelper.copyStackWithSize(existing, toExtract); } }
Source:
protected boolean isSafariApp() { if (wirApplicationName != null && SAFARI.equals(wirApplicationName) && wirApplicationBundleIdentifier != null && SAFARIBUNDLEIDENTIFIER.equals(wirApplicationBundleIdentifier)) { return true; } return false; }

Target:
protected boolean isSafariApp() { if (SAFARI.equals(wirApplicationName) && SAFARIBUNDLEIDENTIFIER.equals(wirApplicationBundleIdentifier)) { return true; } return false; }
Source:
private UpdateFunction updateFunction() { UpdateFunction logToFileFunction = new UpdateFunction() { @Override public void update(DAGStatus status, Map<String, Progress> vertexProgressMap, String report) { SessionState.get().updateProgressMonitor(progressMonitor(status, vertexProgressMap)); console.printInfo(report); } }; UpdateFunction inPlaceUpdateFunction = new UpdateFunction() { @Override public void update(DAGStatus status, Map<String, Progress> vertexProgressMap, String report) { inPlaceUpdate.render(progressMonitor(status, vertexProgressMap)); console.logInfo(report); } }; return InPlaceUpdate.canRenderInPlace(hiveConf) && !SessionState.getConsole().getIsSilent() ? inPlaceUpdateFunction : logToFileFunction; }

Target:
private UpdateFunction updateFunction() { UpdateFunction logToFileFunction = new UpdateFunction() { @Override public void update(DAGStatus status, Map<String, Progress> vertexProgressMap, String report) { SessionState.get().updateProgressMonitor(progressMonitor(status, vertexProgressMap)); console.printInfo(report); } }; UpdateFunction inPlaceUpdateFunction = new UpdateFunction() { @Override public void update(DAGStatus status, Map<String, Progress> vertexProgressMap, String report) { inPlaceUpdate.render(progressMonitor(status, vertexProgressMap)); console.logInfo(report); } }; return InPlaceUpdate.canRenderInPlace(hiveConf) && !SessionState.getConsole().getIsSilent() && !SessionState.get().isHiveServerQuery() ? inPlaceUpdateFunction : logToFileFunction; }
Source:
public Map<AmplitudeData, EventScores> getPDF(final Collection<AmplitudeData> data) { final List<Long> timestamps = new ArrayList<>(); final List<Double> amplitudes = new ArrayList<>(); for(final AmplitudeData amplitudeData:data){ timestamps.add(Long.valueOf(amplitudeData.timestamp)); amplitudes.add(Double.valueOf(amplitudeData.amplitude)); } final WakeUpTimeScoringFunction wakeUpTimeScoreFunction = new WakeUpTimeScoringFunction(this.wakeUpStartPercentage); final Map<Long, Double> wakeUpTimePDF = wakeUpTimeScoreFunction.getPDF(timestamps); final SleepTimeScoringFunction sleepTimeScoreFunction = new SleepTimeScoringFunction(); final Map<Long, Double> sleepTimePDF = sleepTimeScoreFunction.getPDF(timestamps); final MotionScoringFunction amplitudeScoringFunction = new MotionScoringFunction(this.motionMaxPower); final Map<Double, Double> amplitudePDF = amplitudeScoringFunction.getPDF(amplitudes); final HashMap<AmplitudeData, EventScores> pdf = new HashMap<>(); for(final AmplitudeData datum:data){ final double sleepScore = sleepTimeScoreFunction.getScore(datum.timestamp, sleepTimePDF) * amplitudeScoringFunction.getScore(datum.amplitude, amplitudePDF); final double wakeUpScore = wakeUpTimeScoreFunction.getScore(datum.timestamp, wakeUpTimePDF) * amplitudeScoringFunction.getScore(datum.amplitude, amplitudePDF); pdf.put(datum, new EventScores(sleepScore, wakeUpScore)); } return pdf; }

Target:
public Map<AmplitudeData, EventScores> getPDF(final Collection<AmplitudeData> data) { final List<Long> timestamps = new ArrayList<>(data.size()); final List<Double> amplitudes = new ArrayList<>(data.size()); for(final AmplitudeData amplitudeData:data){ timestamps.add(Long.valueOf(amplitudeData.timestamp)); amplitudes.add(Double.valueOf(amplitudeData.amplitude)); } final WakeUpTimeScoringFunction wakeUpTimeScoreFunction = new WakeUpTimeScoringFunction(this.wakeUpStartPercentage); final Map<Long, Double> wakeUpTimePDF = wakeUpTimeScoreFunction.getPDF(timestamps); final SleepTimeScoringFunction sleepTimeScoreFunction = new SleepTimeScoringFunction(); final Map<Long, Double> sleepTimePDF = sleepTimeScoreFunction.getPDF(timestamps); final MotionScoringFunction amplitudeScoringFunction = new MotionScoringFunction(this.motionMaxPower); final Map<Double, Double> amplitudePDF = amplitudeScoringFunction.getPDF(amplitudes); final HashMap<AmplitudeData, EventScores> pdf = new HashMap<>(); for(final AmplitudeData datum:data){ final double sleepScore = sleepTimeScoreFunction.getScore(datum.timestamp, sleepTimePDF) * amplitudeScoringFunction.getScore(datum.amplitude, amplitudePDF); final double wakeUpScore = wakeUpTimeScoreFunction.getScore(datum.timestamp, wakeUpTimePDF) * amplitudeScoringFunction.getScore(datum.amplitude, amplitudePDF); pdf.put(datum, new EventScores(sleepScore, wakeUpScore)); } return pdf; }
Source:
protected void sendStartAuthentication(ServletRequest request, ServletResponse response, FilterChain chain, AuthenticationException reason) throws ServletException, IOException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; if (isJson(httpRequest) || isJsonFormat(httpRequest)) { httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } final Logger logger = LoggerFactory.getLogger(GoExceptionTranslationFilter.class); SavedRequest savedRequest = new SavedRequest(httpRequest, getPortResolver()); logger.debug("Authentication entry point being called; SavedRequest added to Session: " + savedRequest); if (isCreateSessionAllowed() && shouldRedirect(savedRequest.getRequestUrl())) { httpRequest.getSession().setAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY, savedRequest); } SecurityContextHolder.getContext().setAuthentication(null); determineAuthenticationPoint(httpRequest).commence(httpRequest, response, reason); }

Target:
protected void sendStartAuthentication(ServletRequest request, ServletResponse response, FilterChain chain, AuthenticationException reason) throws ServletException, IOException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; if (isJson(httpRequest) || isJsonFormat(httpRequest)) { httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } final Logger logger = LoggerFactory.getLogger(GoExceptionTranslationFilter.class); SavedRequest savedRequest = new SavedRequest(httpRequest, getPortResolver()); logger.debug("Authentication entry point being called; SavedRequest added to Session: {}", savedRequest); if (isCreateSessionAllowed() && shouldRedirect(savedRequest.getRequestUrl())) { httpRequest.getSession().setAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY, savedRequest); } SecurityContextHolder.getContext().setAuthentication(null); determineAuthenticationPoint(httpRequest).commence(httpRequest, response, reason); }
Source:
public void request(long n) { if (n > 0 && state.requestCount.getAndAdd(n) == 0) { if (n == Long.MAX_VALUE) { for (; !state.subscriber.isUnsubscribed(); ) { if (!doNext()) { break; } } } else { if (!state.subscriber.isUnsubscribed()) { do { if (!doNext()) { break; } } while (state.requestCount.decrementAndGet() > 0 && !state.subscriber.isUnsubscribed()); } } } }

Target:
public void request(long n) { if (n > 0 && BackpressureUtils.getAndAddRequest(state.requestCount, n) == 0) { if (n == Long.MAX_VALUE) { for (; !state.subscriber.isUnsubscribed(); ) { if (!doNext()) { break; } } } else if (!state.subscriber.isUnsubscribed()) { do { if (!doNext()) { break; } } while (state.requestCount.decrementAndGet() > 0 && !state.subscriber.isUnsubscribed()); } } }
Source:
public static void clearCache(Instance instance) { cacheResetCount.incrementAndGet(); getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZTABLES); getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES); tableMapCache = null; }

Target:
public static void clearCache(Instance instance) { getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZTABLES); getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES); instanceToMapCache.invalidate(instance.getInstanceID()); }
Source:
private void testGetNextTrainingData(final int numTotalInstances) { final int remainderForLatchMiniBatch = numTotalInstances % MINI_BATCH_SIZE; final int numMiniBatches = numTotalInstances / MINI_BATCH_SIZE + (remainderForLatchMiniBatch == 0 ? 0 : 1); final int sizeOfLastMiniBatch = remainderForLatchMiniBatch == 0 ? MINI_BATCH_SIZE : remainderForLatchMiniBatch; int miniBatchIdx = 0; Map<Long, Integer> trainingData = trainingDataProvider.getNextTrainingData(); while (!trainingData.isEmpty()) { miniBatchIdx++; for (final Long key : trainingData.keySet()) { assertEquals(kvMapBackingMemoryStore.get(key), trainingData.get(key)); } if (miniBatchIdx < numMiniBatches) { assertEquals("Should process MINI_BATCH_SIZE instances", MINI_BATCH_SIZE, trainingData.size()); } else if (miniBatchIdx == numMiniBatches) { assertEquals("The last mini-batch should process remaining instances", sizeOfLastMiniBatch, trainingData.size()); } else { fail("The total number of mini-batches is larger than expectation"); } trainingData = trainingDataProvider.getNextTrainingData(); } assertEquals("The total number of mini-batches is different from expectation", numMiniBatches, miniBatchIdx); }

Target:
private void testGetNextTrainingData(final int numTotalInstances) { final int remainderForLastMiniBatch = numTotalInstances % MINI_BATCH_SIZE; final int numMiniBatches = numTotalInstances / MINI_BATCH_SIZE + (remainderForLastMiniBatch == 0 ? 0 : 1); final int lastMiniBatchIdx = numMiniBatches - 1; final int sizeOfLastMiniBatch = remainderForLastMiniBatch == 0 ? MINI_BATCH_SIZE : remainderForLastMiniBatch; int miniBatchIdx = 0; Map<Long, Integer> trainingData = trainingDataProvider.getNextTrainingData(); while (!trainingData.isEmpty()) { for (final Long key : trainingData.keySet()) { assertEquals(memoryStore.get(key).getSecond(), trainingData.get(key)); } if (miniBatchIdx < lastMiniBatchIdx) { assertEquals("Should process MINI_BATCH_SIZE instances", MINI_BATCH_SIZE, trainingData.size()); } else if (miniBatchIdx == lastMiniBatchIdx) { assertEquals("The last mini-batch should process remaining instances", sizeOfLastMiniBatch, trainingData.size()); } else { fail("The total number of mini-batches is larger than expectation"); } trainingData = trainingDataProvider.getNextTrainingData(); miniBatchIdx++; } assertEquals("The total number of mini-batches is different from expectation", numMiniBatches, miniBatchIdx); }
Source:
private void getTopicList() { if (getTopicListCall != null) { getTopicListCall.cancel(); } getTopicListCall = discussionService.getCourseTopics(courseData.getCourse().getId()); getTopicListCall.enqueue(new ErrorHandlingCallback<CourseTopics>( getActivity(), this, errorNotification, snackbarErrorNotification, this) { @Override protected void onResponse(@NonNull final CourseTopics courseTopics) { logger.debug("GetTopicListTask success=" + courseTopics); ArrayList<DiscussionTopic> allTopics = new ArrayList<>(); allTopics.addAll(courseTopics.getNonCoursewareTopics()); allTopics.addAll(courseTopics.getCoursewareTopics()); List<DiscussionTopicDepth> allTopicsWithDepth = DiscussionTopicDepth.createFromDiscussionTopics(allTopics); discussionTopicsAdapter.setItems(allTopicsWithDepth); discussionTopicsAdapter.notifyDataSetChanged(); } @Override protected void onFinish() { if (!EventBus.getDefault().isRegistered(CourseDiscussionTopicsFragment.this)) { EventBus.getDefault().registerSticky(CourseDiscussionTopicsFragment.this); } } }); }

Target:
private void getTopicList() { if (getTopicListCall != null) { getTopicListCall.cancel(); } final TaskProgressCallback.ProgressViewController progressViewController = new TaskProgressCallback.ProgressViewController(progressSpinner); getTopicListCall = discussionService.getCourseTopics(courseData.getCourse().getId()); getTopicListCall.enqueue(new ErrorHandlingCallback<CourseTopics>( getActivity(), progressViewController, errorNotification, snackbarErrorNotification, this) { @Override protected void onResponse(@NonNull final CourseTopics courseTopics) { logger.debug("GetTopicListTask success=" + courseTopics); ArrayList<DiscussionTopic> allTopics = new ArrayList<>(); allTopics.addAll(courseTopics.getNonCoursewareTopics()); allTopics.addAll(courseTopics.getCoursewareTopics()); List<DiscussionTopicDepth> allTopicsWithDepth = DiscussionTopicDepth.createFromDiscussionTopics(allTopics); discussionTopicsAdapter.setItems(allTopicsWithDepth); discussionTopicsAdapter.notifyDataSetChanged(); } @Override protected void onFinish() { if (!EventBus.getDefault().isRegistered(CourseDiscussionTopicsFragment.this)) { EventBus.getDefault().registerSticky(CourseDiscussionTopicsFragment.this); } } }); }
Source:
public void destroy() throws Exception { super.cleanup(); deleteApplication(); }

Target:
public void destroy() throws Exception { deleteApplication(); super.cleanup(); }
Source:
public static WebArchive getDeployment() { final String javaHome = getSystemProperty("java.home"); final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") .addClass(TransactionalClient.class) .addClass(TransactionalService.class) .addClass(TransactionalServiceImpl.class) .addClass(TestSuiteEnvironment.class) .addAsManifestResource(new StringAsset("Dependencies: org.jboss.xts,org.jboss.jts\n"), "MANIFEST.MF") .addAsManifestResource(createPermissionsXmlAsset( new RuntimePermission("getClassLoader"), new RuntimePermission("accessDeclaredMembers"), new FilePermission(javaHome + File.separator + "lib" + File.separator + "jaxws.properties", "read"), new FilePermission(javaHome + File.separator + "lib" + File.separator + "wsdl.properties", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("org.apache.cxf.permission"), new SocketPermission(SERVER_HOST_PORT, "connect,resolve"), new RuntimePermission("createClassLoader"), new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read")), "permissions.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); return webArchive; }

Target:
public static WebArchive getDeployment() { final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") .addClass(TransactionalClient.class) .addClass(TransactionalService.class) .addClass(TransactionalServiceImpl.class) .addAsManifestResource(new StringAsset("Dependencies: org.jboss.xts,org.jboss.jts\n"), "MANIFEST.MF") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); return webArchive; }
Source:
public Response safeHandle(HttpRequest request) throws JSONException { SelendroidLogger.info("Got actions request"); JSONArray payload = getPayload(request).getJSONArray("payload"); int actionChainCount = payload.length(); boolean stillRunning = true; boolean allPaused; List<ActionChain> actionChains = new ArrayList<ActionChain>(); for (int i = 0; i < actionChainCount; i++) { actionChains.add(new ActionChain(payload.getJSONObject(i))); } while (stillRunning) { stillRunning = false; allPaused = true; for (ActionChain chain : actionChains) { if (chain.isPaused()) { stillRunning = true; } else if (chain.hasNext()) { stillRunning = true; JSONObject action = chain.next(); String actionName = action.getString("name"); SelendroidLogger.info("Performing action " + chain.getInputDevice() + "/" + actionName); if (!actionName.equals(TouchActionName.PAUSE)) { allPaused = false; ActionHandler handler = ActionHandler.getHandlerForInputDevice(chain.getInputDevice()); handler.handle(actionName, getSelendroidDriver(request), action, chain.getContext()); } } } if(allPaused) { int pauseTime = shortestPause(actionChains); try { Thread.sleep(pauseTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } updatePauseTimes(actionChains, pauseTime); } } return new SelendroidResponse(getSessionId(request), ""); }

Target:
public Response safeHandle(HttpRequest request) throws JSONException { SelendroidLogger.info("Got actions request"); JSONArray payload = getPayload(request).getJSONArray("payload"); int actionChainCount = payload.length(); boolean stillRunning = true; int longestPause; List<ActionChain> actionChains = new ArrayList<ActionChain>(); for (int i = 0; i < actionChainCount; i++) { actionChains.add(new ActionChain(payload.getJSONObject(i))); } while (stillRunning) { longestPause = 0; stillRunning = false; for (ActionChain chain : actionChains) { if (chain.hasNext()) { stillRunning = true; JSONObject action = chain.next(); String actionName = action.getString("name"); SelendroidLogger.info("Performing action " + chain.getInputDevice() + "/" + actionName); if (actionName.equals(TouchActionName.PAUSE)) { if (chain.getPauseTime() > longestPause) { longestPause = chain.getPauseTime(); } } else { ActionHandler handler = ActionHandler.getHandlerForInputDevice(chain.getInputDevice()); handler.handle(actionName, getSelendroidDriver(request), action, chain.getContext()); } } } if (longestPause > 0) { try { Thread.sleep(longestPause); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } return new SelendroidResponse(getSessionId(request), ""); }
Source:
public void setUp() throws Exception { cuMarshalService = new CUMarshalServiceImpl(); xmlFile = new File(EXAMPLE_FILE_NAME); }

Target:
public void setUp() { cuMarshalService = new CUMarshalServiceImpl(); xmlFile = new File(EXAMPLE_FILE_NAME); }
Source:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.USER_ADD_PROFILE : AuditLogType.USER_ADD_PROFILE_FAILED; }

Target:
public AuditLogType getAuditLogTypeValue() { UserProfile existingProfile = getUserProfile(); if (existingProfile != null && isSSHPublicKeyUpdate(existingProfile)) { return getSucceeded() ? AuditLogType.USER_UPDATE_PROFILE : AuditLogType.USER_UPDATE_PROFILE_FAILED; } else { return getSucceeded() ? AuditLogType.USER_ADD_PROFILE : AuditLogType.USER_ADD_PROFILE_FAILED; } }
Source:
public static org.ovirt.engine.api.model.ClusterFeature map(AdditionalFeature entity, org.ovirt.engine.api.model.ClusterFeature template) { org.ovirt.engine.api.model.ClusterFeature model = new org.ovirt.engine.api.model.ClusterFeature(); model.setName(entity.getName()); model.setId(entity.getId().toString()); return model; }

Target:
public static org.ovirt.engine.api.model.ClusterFeature map(AdditionalFeature entity, org.ovirt.engine.api.model.ClusterFeature template) { org.ovirt.engine.api.model.ClusterFeature model = template != null ? template : new org.ovirt.engine.api.model.ClusterFeature(); model.setName(entity.getName()); model.setId(entity.getId().toString()); return model; }
Source:
public CacheConfigurationBuilder<K, V> withResourcePools(ResourcePools resourcePools) { return new CacheConfigurationBuilder<K, V>(expiry, classLoader, evictionPrioritizer, evictionVeto, resourcePools, serviceConfigurations); }

Target:
public CacheConfigurationBuilder<K, V> withResourcePools(ResourcePools resourcePools) { if (resourcePools == null) { throw new NullPointerException("Null resource pools"); } CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<K, V>(this); otherBuilder.resourcePools = resourcePools; return otherBuilder; }
Source:
public GenericRecord parse(ByteBuffer bytes) { bytes.get(); int id = bytes.getInt(); int length = bytes.limit() - 1 - 4; int offset = bytes.position() + bytes.arrayOffset(); try { Schema schema = registry.getByID(id); DatumReader<GenericRecord> reader = new GenericDatumReader<>(schema); return reader.read(null, DecoderFactory.get().binaryDecoder(bytes.array(), offset, length, null)); } catch (RestClientException | IOException e) { throw new ParseException(e, "Fail to decode avro message!"); } }

Target:
public GenericRecord parse(ByteBuffer bytes) { try { bytes.get(); int id = bytes.getInt(); int length = bytes.limit() - 1 - 4; int offset = bytes.position() + bytes.arrayOffset(); Schema schema = registry.getByID(id); DatumReader<GenericRecord> reader = new GenericDatumReader<>(schema); return reader.read(null, DecoderFactory.get().binaryDecoder(bytes.array(), offset, length, null)); } catch (Exception e) { throw new ParseException(e, "Fail to decode avro message!"); } }
Source:
protected HttpWebRequest prepareHttpPoolingWebRequestForUrl(URI url, boolean acceptGzipEncoding, boolean allowAutoRedirect) throws ServiceLocalException, URISyntaxException { String scheme = url.getScheme(); if (!scheme.equalsIgnoreCase(EWSConstants.HTTP_SCHEME) && !scheme.equalsIgnoreCase(EWSConstants.HTTPS_SCHEME)) { String strErr = String.format("Protocol %s isn't supported for service request.", scheme); throw new ServiceLocalException(strErr); } if (httpPoolingClient == null) initializeHttpPoolingClient(); HttpClientWebRequest request = new HttpClientWebRequest(httpPoolingClient, httpContext); prepareHttpWebRequestForUrl(url, acceptGzipEncoding, allowAutoRedirect, request); return request; }

Target:
protected HttpWebRequest prepareHttpPoolingWebRequestForUrl(URI url, boolean acceptGzipEncoding, boolean allowAutoRedirect) throws ServiceLocalException, URISyntaxException { String scheme = url.getScheme(); if (!scheme.equalsIgnoreCase(EWSConstants.HTTP_SCHEME) && !scheme.equalsIgnoreCase(EWSConstants.HTTPS_SCHEME)) { String strErr = String.format("Protocol %s isn't supported for service request.", scheme); throw new ServiceLocalException(strErr); } if (httpPoolingClient == null) { initializeHttpPoolingClient(); } HttpClientWebRequest request = new HttpClientWebRequest(httpPoolingClient, httpContext); prepareHttpWebRequestForUrl(url, acceptGzipEncoding, allowAutoRedirect, request); return request; }
Source:
public Map<String, String> getSettings() { return ImmutableMap.of( Constants.SUPPORTED_ENVIRONMENTS, Joiner.on(",").join(workspaceManager.getSupportedRecipes())); }

Target:
public Map<String, String> getSettings() { return ImmutableMap.of( Constants.SUPPORTED_RECIPE_TYPES, Joiner.on(",").join(workspaceManager.getSupportedRecipes())); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AbbreviationViewModel that = (AbbreviationViewModel) o; return getName().equals(that.getName()) && isPseudoAbbreviation() == that.isPseudoAbbreviation(); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AbbreviationViewModel that = (AbbreviationViewModel) o; return Objects.equals(getName(), that.getName()) && isPseudoAbbreviation() == that.isPseudoAbbreviation(); }
Source:
public static String rawType(String type) { int openIndex = type.indexOf('<'); if (openIndex != -1) { int closeIndex = type.indexOf('>', openIndex); if (closeIndex != -1) { return type.substring(0, openIndex) + type.substring(closeIndex + 1); } } return type; }

Target:
public static String rawType(String type) { int lessThanIndex = type.indexOf('<'); if (lessThanIndex != -1) { return type.substring(0, lessThanIndex); } return type; }
Source:
public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); urlDataRunner(fileUrl -> beginTrainingUnlabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> trainingPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels).getSyncPoller(); trainingPoller.waitForCompletion(); SyncPoller<OperationResult, List<RecognizedForm>> syncPoller = client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) .setIncludeTextContent(false)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); }), FORM_JPG); }

Target:
public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); urlRunner(fileUrl -> beginTrainingUnlabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> trainingPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); SyncPoller<OperationResult, List<RecognizedForm>> syncPoller = client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); }), FORM_JPG); }
Source:
void findFormTypes1099FromFormCodeEmptyString() { try { FormTypes1099.findFormTypes1099FromFormCode(StringUtils.EMPTY); fail("Should have an illegal argument exception"); } catch (Exception e) { assertEquals(IllegalArgumentException.class, e.getClass()); } }

Target:
void findFormTypes1099FromFormCodeEmptyString() { try { FormTypes1099.findFormTypes1099FromFormCode(StringUtils.EMPTY); fail(SHOULD_HAVE_AN_ILLEGAL_ARGUMENT_EXCEPTION); } catch (Exception e) { assertEquals(IllegalArgumentException.class, e.getClass()); } }
Source:
private void checkPipelineExists(Request request, Response response) { if (isPipelineRequest(request)) { if (null == pipelineConfigService.getPipelineConfig(request.queryParams("pipeline_name"))) { throw halt(404, format("Cannot generate analytics. Pipeline with name:'%s' not found.", request.queryParams("pipeline_name"))); } } }

Target:
private void checkPipelineExists(Request request, Response response) { if (isPipelineRequest(request)) { if (null == pipelineConfigService.pipelineConfigNamed(request.queryParams("pipeline_name"))) { throw halt(404, format("Cannot generate analytics. Pipeline with name: '%s' not found.", request.queryParams("pipeline_name"))); } } }
Source:
private String getExoManifest() { String mainManifest = getMainManifest(); if (mainManifest != null) { String exoManifest = mainManifest.replace("main", "exo"); if (getProject().file(exoManifest).exists()) { return exoManifest; } else { return mainManifest; } } return null; }

Target:
private String getExoManifest() { String mainManifest = getMainManifest(); List<String> secondaryManifests = getSecondaryManifests(); if (secondaryManifests != null) { Optional<String> optionalExoManifest = secondaryManifests.stream().filter(manifest -> manifest.contains(getName())).findAny(); return optionalExoManifest.orElse(mainManifest); } return mainManifest; }
Source:
public Model makeModel(String id) { Model m = SAMPFactory.get(Model.class); m.setName(type.name().toLowerCase() + "." + id); String[] parNames = makeArray(this.getParnames(), String.class); Double[] parVals = makeArray(this.getParvals(), Double.class); Double[] parMins = makeArray(this.getParmins(), Double.class); Double[] parMaxs = makeArray(this.getParmaxs(), Double.class); Boolean[] parFrozens = makeArray(this.getParfrozen(), Boolean.class); for (int i=0; i<parNames.length; i++) { try { Parameter p = SAMPFactory.get(Parameter.class); p.setName(parNames[i]); p.setVal(parVals[i]); p.setMin(parMins[i]); p.setMax(parMaxs[i]); p.setFrozen(parFrozens[i] ? 1 : 0); m.addPar(p); } catch(IndexOutOfBoundsException ex) { throw new IllegalStateException("Array Shapes Mismatch", ex); } } return m; }

Target:
public Model makeModel(String id) { Model m = SAMPFactory.get(Model.class); m.setName(composeType(type, id)); String[] parNames = makeArray(this.getParnames(), String.class); Double[] parVals = makeArray(this.getParvals(), Double.class); Double[] parMins = makeArray(this.getParmins(), Double.class); Double[] parMaxs = makeArray(this.getParmaxs(), Double.class); Boolean[] parFrozens = makeArray(this.getParfrozen(), Boolean.class); for (int i=0; i<parNames.length; i++) { try { Parameter p = SAMPFactory.get(Parameter.class); p.setName(compose(id,parNames[i])); p.setVal(parVals[i]); p.setMin(parMins[i]); p.setMax(parMaxs[i]); p.setFrozen(parFrozens[i] ? 1 : 0); m.addPar(p); } catch(IndexOutOfBoundsException ex) { throw new IllegalStateException("Array Shapes Mismatch", ex); } } return m; }
Source:
private final AnnotatedTypeMirror fromMember(Tree tree) { if (!(tree instanceof MethodTree || tree instanceof VariableTree)) { throw new BugInCF( "AnnotatedTypeFactory.fromMember: not a method or variable declaration: " + tree); } if (shouldCache && fromMemberTreeCache.containsKey(tree)) { return fromMemberTreeCache.get(tree).deepCopy(); } AnnotatedTypeMirror result = TypeFromTree.fromMember(this, tree); if (checker.hasOption("mergeStubsWithSource")) { Element elt = TreeUtils.elementFromTree(tree); AnnotatedTypeMirror stubType = stubTypes.getAnnotatedTypeMirror(elt); if (stubType != null) { if (result == null) { result = stubType; } else { AnnotatedTypeMerger.merge(stubType, result); } } } if (shouldCache) { fromMemberTreeCache.put(tree, result.deepCopy()); } return result; }

Target:
private final AnnotatedTypeMirror fromMember(Tree tree) { if (!(tree instanceof MethodTree || tree instanceof VariableTree)) { throw new BugInCF( "AnnotatedTypeFactory.fromMember: not a method or variable declaration: " + tree); } if (shouldCache && fromMemberTreeCache.containsKey(tree)) { return fromMemberTreeCache.get(tree).deepCopy(); } AnnotatedTypeMirror result = TypeFromTree.fromMember(this, tree); if (checker.hasOption("mergeStubsWithSource")) { result = mergeStubsIntoType(result, tree); } if (shouldCache) { fromMemberTreeCache.put(tree, result.deepCopy()); } return result; }
Source:
private boolean deleteSegment() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); _tableName = tableConfig.getTableName(); ControllerTest.sendDeleteRequest(ControllerRequestURLBuilder.baseUrl(ClusterDescriptor.CONTROLLER_URL) .forSegmentDelete(_tableName, _segmentName)); long startTime = System.currentTimeMillis(); while (getOnlineSegmentCount() > 0) { if ((System.currentTimeMillis() - startTime) > DEFAULT_MAX_SLEEP_TIME_MS) { LOGGER.error("Delete segment verification failed, count is greater than zero after max wait time ms.", DEFAULT_MAX_SLEEP_TIME_MS); return false; } LOGGER .warn("Delete segment verification count greater than zero, will retry after ms.", DEFAULT_WAIT_TIME_MS); Thread.sleep(DEFAULT_WAIT_TIME_MS); } } catch (Exception e) { LOGGER.error("Request to delete the segment for the table failed.", _segmentName, _tableName, e); return false; } LOGGER.info("Successfully delete the segment for the table {}.", _segmentName, _tableName); return true; }

Target:
private boolean deleteSegment() { try { TableConfig tableConfig = JsonUtils.fileToObject(new File(_tableConfigFileName), TableConfig.class); _tableName = tableConfig.getTableName(); ControllerTest.sendDeleteRequest(ControllerRequestURLBuilder.baseUrl(ClusterDescriptor.CONTROLLER_URL) .forSegmentDelete(_tableName, _segmentName)); return verifySegmentDeleted(); } catch (Exception e) { LOGGER.error("Request to delete the segment for the table failed.", _segmentName, _tableName, e); return false; } }
Source:
public void dispose() { stereotypeItemProviderDecorators.clear(); super.dispose(); }

Target:
public void dispose() { for (Object object : stereotypeItemProviderDecorators.values()) { if (object instanceof IDisposable) { ((IDisposable)object).dispose(); } } super.dispose(); }
Source:
protected Pair<Double, ServerHolder> chooseBestServer( final DataSegment proposalSegment, final Iterable<ServerHolder> serverHolders, final boolean includeCurrentServer ) { Pair<Double, ServerHolder> bestServer = Pair.of(Double.POSITIVE_INFINITY, null); List<ListenableFuture<Pair<Double, ServerHolder>>> futures = Lists.newArrayList(); for (final ServerHolder server : serverHolders) { futures.add( exec.submit( new Callable<Pair<Double, ServerHolder>>() { @Override public Pair<Double, ServerHolder> call() throws Exception { return Pair.of(computeCost(proposalSegment, server, includeCurrentServer), server); } } ) ); } final ListenableFuture<List<Pair<Double, ServerHolder>>> resultsFuture = Futures.allAsList(futures); final List<Pair<Double, ServerHolder>> bestServers = new ArrayList<>(); try { for (Pair<Double, ServerHolder> server : resultsFuture.get()) { if (server.lhs < bestServer.lhs) { bestServer = server; } } for (Pair<Double, ServerHolder> server : resultsFuture.get()) { if (server.lhs == bestServer.lhs) { bestServers.add(server); } } bestServer = (bestServers.size() > 0) ? bestServers.get((int)Math.random()*bestServers.size()): bestServer; } catch (Exception e) { log.makeAlert(e, "Cost Balancer Multithread strategy wasn't able to complete cost computation.").emit(); } return bestServer; }

Target:
protected Pair<Double, ServerHolder> chooseBestServer( final DataSegment proposalSegment, final Iterable<ServerHolder> serverHolders, final boolean includeCurrentServer ) { Pair<Double, ServerHolder> bestServer = Pair.of(Double.POSITIVE_INFINITY, null); List<ListenableFuture<Pair<Double, ServerHolder>>> futures = Lists.newArrayList(); for (final ServerHolder server : serverHolders) { futures.add( exec.submit( new Callable<Pair<Double, ServerHolder>>() { @Override public Pair<Double, ServerHolder> call() throws Exception { return Pair.of(computeCost(proposalSegment, server, includeCurrentServer), server); } } ) ); } final ListenableFuture<List<Pair<Double, ServerHolder>>> resultsFuture = Futures.allAsList(futures); final List<Pair<Double, ServerHolder>> bestServers = new ArrayList<>(); bestServers.add(bestServer); try { for (Pair<Double, ServerHolder> server : resultsFuture.get()) { if (server.lhs <= bestServers.get(0).lhs) { if (server.lhs < bestServers.get(0).lhs) { bestServers.clear(); } bestServers.add(server); } } bestServer = bestServers.get((int) Math.random() * bestServers.size()); } catch (Exception e) { log.makeAlert(e, "Cost Balancer Multithread strategy wasn't able to complete cost computation.").emit(); } return bestServer; }
Source:
private CamusWrapper getWrappedRecord(String topicName, byte[] payload) throws IOException { CamusWrapper r = null; try { r = decoder.decode(payload); } catch (SchemaNotFoundException e) { mapperContext.getCounter(MSG_SKIPPED.SCHEMA_NOT_FOUND).increment(1); if (!skipSchemaErrors) { throw new IOException(e); } } catch (Exception e) { mapperContext.getCounter(MSG_SKIPPED.OTHER).increment(1); if (!skipSchemaErrors) { throw new IOException(e); } } return r; }

Target:
private CamusWrapper getWrappedRecord(String topicName, byte[] payload) throws IOException { CamusWrapper r = null; try { r = decoder.decode(payload); mapperContext.getCounter(KAFKA_MSG.DECODE_SUCCESSFUL).increment(1); } catch (SchemaNotFoundException e) { mapperContext.getCounter(KAFKA_MSG.SKIPPED_SCHEMA_NOT_FOUND).increment(1); if (!skipSchemaErrors) { throw new IOException(e); } } catch (Exception e) { mapperContext.getCounter(KAFKA_MSG.SKIPPED_OTHER).increment(1); if (!skipSchemaErrors) { throw new IOException(e); } } return r; }
Source:
public List<Long> getQuantiles(List<Double> quantiles) { List<Long> accumulator = new ArrayList<Long>(quantiles.size()); for (Double q : quantiles) { accumulator.add(getQuantile(q)); } return accumulator; }

Target:
public List<Long> getQuantiles(List<Double> quantiles) { List<Long> accumulator = new ArrayList<Long>(quantiles.size()); for (double q : quantiles) { accumulator.add(getQuantile(q)); } return accumulator; }
Source:
private void finishTimelineUpdate(final String eventTypeName) throws TimelineException { try { timelineSync.finishTimelineUpdate(eventTypeName); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); throw new TimelineException("Timeline update was interrupted for:" + eventTypeName); } catch (final RuntimeException re) { throw new TimelineException("Timeline update was interrupted for:" + eventTypeName, re); } }

Target:
private void finishTimelineUpdate(final String eventTypeName) throws TimelineException { try { timelineSync.finishTimelineUpdate(eventTypeName); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); throw new TimelineException("Timeline update was interrupted for:" + eventTypeName); } catch (final RuntimeException re) { throw new TimelineException("Failed to finish timeline update for:" + eventTypeName, re); } }