auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
CompletionStage<ImmutableMap<ReportFormat, RenderedReport>> renderAll( final ImmutableSet<ReportFormat> formats, final Report report, final TimeRange timeRange ) { final Map<ReportFormat, RenderedReport> result = Maps.newConcurrentMap(); final CompletableFuture<?>[] resultSettingFutures = formats .stream() .map(format -> getRenderer(report.getSource(), format) .render( report.getSource(), format, timeRange, new DefaultRenderedReport.Builder() .setReport(report) .setFormat(format) .setGeneratedAt(_clock.instant()) .setTimeRange(timeRange), report.getTimeout() ) .whenComplete((res, err) -> { if (err != null) { LOGGER.warn() .setMessage("rendering failed") .addData("source", report.getSource()) .addData("format", format) .setThrowable(err) .log(); } }) .thenApply(builder -> result.put(format, builder.build())) .toCompletableFuture()) .toArray(CompletableFuture[]::new); return CompletableFuture.allOf(resultSettingFutures).thenApply(nothing -> ImmutableMap.copyOf(result)); }

Target:
CompletionStage<ImmutableMap<ReportFormat, RenderedReport>> renderAll( final ImmutableSet<ReportFormat> formats, final Report report, final TimeRange timeRange ) { final Map<ReportFormat, RenderedReport> result = Maps.newConcurrentMap(); final CompletableFuture<?>[] resultSettingFutures = formats .stream() .map(format -> getRenderer(report.getSource(), format) .render( report.getSource(), format, timeRange, new DefaultRenderedReport.Builder() .setReport(report) .setFormat(format) .setGeneratedAt(_clock.instant()) .setTimeRange(timeRange), report.getTimeout() ) .thenApply(builder -> result.put(format, builder.build())) .toCompletableFuture()) .toArray(CompletableFuture[]::new); return CompletableFuture.allOf(resultSettingFutures).thenApply(nothing -> ImmutableMap.copyOf(result)); }
Source:
public void testStompAutoCreateAddress() throws Exception { try { URI uri = new URI("ws+v12.stomp://localhost:61613"); StompClientConnection newConn = StompClientConnectionFactory.createClientConnection(uri); newConn.connect(defUser, defPass); subscribeQueue(newConn, "a-sub", "autoCreated"); unsubscribe(newConn, "a-sub"); newConn.disconnect(); verifier.validatePluginMethodsAtLeast(1, BEFORE_ADD_ADDRESS, AFTER_ADD_ADDRESS, BEFORE_REMOVE_ADDRESS, AFTER_REMOVE_ADDRESS); } catch (Throwable e) { fail(e.getMessage()); } }

Target:
public void testStompAutoCreateAddress() throws Exception { URI uri = new URI("ws+v12.stomp://localhost:61613"); StompClientConnection newConn = StompClientConnectionFactory.createClientConnection(uri); newConn.connect(defUser, defPass); subscribeQueue(newConn, "a-sub", "autoCreated"); unsubscribe(newConn, "a-sub"); newConn.disconnect(); verifier.validatePluginMethodsAtLeast(1, BEFORE_ADD_ADDRESS, AFTER_ADD_ADDRESS, BEFORE_REMOVE_ADDRESS, AFTER_REMOVE_ADDRESS); }
Source:
public void onSourceTaskCompleted(TaskAttemptIdentifier attempt) { completedUpstreamTasks ++; LOG.info("Source task attempt completion received at vertex {}", attempt, this.vertexName); }

Target:
public synchronized void onSourceTaskCompleted(TaskAttemptIdentifier attempt) { completedUpstreamTasks ++; LOG.info("Source task attempt completion received at vertex {}", attempt, this.vertexName); }
Source:
private void checkIfUsernameCanBeChanged() { AccountModel account = mAccountStore.getAccount(); mUsernamePreference.setEnabled(account.getUsernameCanBeChanged()); mUsernamePreference.setOnPreferenceClickListener(preference -> { showUsernameChangerFragment(); return false; }); }

Target:
private void checkIfUsernameCanBeChanged() { AccountModel account = mAccountStore.getAccount(); mUsernamePreference.setEnabled(account.getUsernameCanBeChanged()); mUsernamePreference.setOnPreferenceClickListener(preference -> { showUsernameChangerFragment(); return true; }); }
Source:
public Response inviteExistingUsersToEnrollDevice(List<String> usernames) { if (log.isDebugEnabled()) { log.debug("Sending enrollment invitation mail to existing user."); } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); try { for (String username : usernames) { String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS); Properties props = new Properties(); props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME)); props.setProperty("username", username); EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props); dms.sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.USER_ENROLLMENT_TEMPLATE, metaInfo); } } catch (DeviceManagementException e) { String msg = "Error occurred while inviting user to enrol their device"; if (e.getMessage() != null) { msg = e.getMessage(); } log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (UserStoreException e) { String msg = "Error occurred while getting claim values to invite user"; log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } return Response.status(Response.Status.OK).entity("Invitation mails have been sent.").build(); }

Target:
public Response inviteExistingUsersToEnrollDevice(List<String> usernames) { if (log.isDebugEnabled()) { log.debug("Sending enrollment invitation mail to existing user."); } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); try { for (String username : usernames) { String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS); Properties props = new Properties(); props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME)); props.setProperty("username", username); EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props); dms.sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.USER_ENROLLMENT_TEMPLATE, metaInfo); } } catch (DeviceManagementException e) { String msg = "Error occurred while inviting user to enrol their device"; if (e.getMessage() != null && !e.getMessage().isEmpty()) { msg = e.getMessage(); } log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (UserStoreException e) { String msg = "Error occurred while getting claim values to invite user"; log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } return Response.status(Response.Status.OK).entity("Invitation mails have been sent.").build(); }
Source:
public ImportResult importSpreadsheet(Workbook workbook, EClass eClass) { final ErrorReports errorReports = ErrorFactory.eINSTANCE.createErrorReports(); final Collection<EObject> result = readData(workbook, eClass, errorReports); return new ImportResultImpl(result, errorReports); }

Target:
public SpreadsheetImportResult importSpreadsheet(Workbook workbook, EClass eClass) { return readData(workbook, eClass); }
Source:
protected void finished(StepContext context) throws Exception { KubernetesCloud cloud = resolveCloud(); LOGGER.log(Level.FINE, () -> "Removing pod template " + podTemplate.getName() + " from cloud " + cloud.name); cloud.removeDynamicTemplate(podTemplate); }

Target:
protected void finished(StepContext context) throws Exception { try { KubernetesCloud cloud = resolveCloud(); LOGGER.log(Level.FINE, () -> "Removing pod template " + podTemplate.getName() + " from cloud " + cloud.name); cloud.removeDynamicTemplate(podTemplate); } catch (AbortException e) { LOGGER.log(Level.WARNING, e, () -> "Unable to resolve cloud for " + podTemplate.getName() + ". Maybe the cloud was removed while running the build?"); } }
Source:
public void testParsingJats10NestedInOAI() throws Exception { String filePath = "/eu/dnetlib/iis/workflows/ingest/pmc/metadata/data/document_jats10_nested_in_oai.xml"; InputStream inputStream = null; try { SAXParserFactory saxFactory = SAXParserFactory.newInstance(); saxFactory.setValidating(false); SAXParser saxParser = saxFactory.newSAXParser(); XMLReader reader = saxParser.getXMLReader(); reader.setFeature("<LINK_2>", false); reader.setFeature("<LINK_0>", false); reader.setFeature("<LINK_1>", false); ExtractedDocumentMetadata.Builder metaBuilder = ExtractedDocumentMetadata.newBuilder(); metaBuilder.setId("some-id"); metaBuilder.setText(""); PmcXmlHandler pmcXmlHandler = new PmcXmlHandler(metaBuilder); saxParser.parse(inputStream = PmcXmlHandler.class.getResourceAsStream(filePath), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); } finally { if (inputStream != null) { inputStream.close(); } } }

Target:
public void testParsingJats10NestedInOAI() throws Exception { saxParser.parse( inputStream = PmcXmlHandler.class .getResourceAsStream(xmlResourcesRootClassPath + "document_jats10_nested_in_oai.xml"), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); }
Source:
public SseEmitter logFileStream() throws IOException { final SseEmitter sseEmitter = new SseEmitter(sseTimeoutMillis); Resource logFileResource = getLogFileResource(); if (logFileResource == null) { sseEmitter.completeWithError( new IllegalStateException("Missing 'logging.file' or 'logging.path' properties")); return sseEmitter; } ForkJoinPool forkJoinPool = ForkJoinPool.commonPool(); forkJoinPool.execute( Tailer.create(logFileResource.getFile(), applicationContext.getBean(SseEmitterAwareTailerListenerAdapter.class, sseEmitter), 1000, true)); return sseEmitter; }

Target:
public SseEmitter logFileStream() throws IOException { final SseEmitter sseEmitter = new SseEmitter(sseTimeoutMillis); Resource logFileResource = getLogFileResource(); if (logFileResource == null) { sseEmitter.completeWithError( new IllegalStateException("Missing 'logging.file' or 'logging.path' properties")); return sseEmitter; } ForkJoinPool forkJoinPool = ForkJoinPool.commonPool(); forkJoinPool.execute( Tailer.create(logFileResource.getFile(), tailerListenerAdapterPrototypeFactory.apply(sseEmitter), 1000, true)); return sseEmitter; }
Source:
public TmfModelResponse<List<SegmentStoreTableColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<SegmentStoreTableColumnDataModel> model = new ArrayList<>(); for (ISegmentAspect baseAspect : BASE_ASPECT) { long id = fAspectMap.inverse().computeIfAbsent(baseAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) baseAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, baseAspect.getName(), baseAspect.getHelpText())); } for (ISegmentAspect segmentAspect : fSegmentStoreProvider.getSegmentAspects()) { long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText())); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }

Target:
public TmfModelResponse<List<SegmentStoreTableColumnDataModel>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { List<SegmentStoreTableColumnDataModel> model = new ArrayList<>(); Iterable<ISegmentAspect> segmentAspects = Iterables.concat(BASE_ASPECT, fSegmentStoreProvider.getSegmentAspects()); for (ISegmentAspect segmentAspect : segmentAspects) { long id = fAspectMap.inverse().computeIfAbsent(segmentAspect, a -> fAtomicLong.getAndIncrement()); fComparatorMap.put(id, (Comparator<ISegment>) segmentAspect.getComparator()); model.add(new SegmentStoreTableColumnDataModel(id, -1, segmentAspect.getName(), segmentAspect.getHelpText())); } return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
private void setDefaults() { fSwitchTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_SWITCH_TIMER)); fReadTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_READ_TIMER)); fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); if (fTargetNodeComponent.isTraceFileRotationSupported()) { fMaxSizeTraceText.setText(String.valueOf(IChannelInfo.DEFAULT_MAXIMUM_SIZE_TRACE_FILES)); fMaxNumberTraceText.setText(String.valueOf(IChannelInfo.DEFAULT_MAXIMUM_NUMBER_TRACE_FILES)); } if (fKernelButton.getSelection()) { fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_KERNEL)); fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_KERNEL)); } else { fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_UST)); fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_UST)); } }

Target:
private void setDefaults() { fSwitchTimerText.setText(DEFAULT_TEXT); fReadTimerText.setText(DEFAULT_TEXT); fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE); if (fTargetNodeComponent.isTraceFileRotationSupported()) { fMaxSizeTraceText.setText(DEFAULT_TEXT); fMaxNumberTraceText.setText(DEFAULT_TEXT); } fSubBufferSizeText.setText(DEFAULT_TEXT); fNumberOfSubBuffersText.setText(DEFAULT_TEXT); }
Source:
private void showFragment(Class activeFragmentClass) { Class[] fragmentClasses = new Class[] { DashboardFragment.class, GoalFragment.class }; FragmentManager mgr = getSupportFragmentManager(); FragmentTransaction transaction = mgr.beginTransaction(); try { for (Class klass : fragmentClasses) { Fragment fragment = mgr.findFragmentByTag(klass.getName()); if (klass == activeFragmentClass) { if (fragment != null) { transaction.show(fragment); } else { transaction.add(R.id.frmMainContent, (Fragment) klass.newInstance(), klass.getName()); } } else { if (fragment != null) { transaction.hide(fragment); } } } } catch (Exception e) { e.printStackTrace(); } transaction.commit(); }

Target:
private void showFragment(Class activeFragmentClass) { Class[] fragmentClasses = new Class[] { DashboardFragment.class, GoalDetailFragment.class }; FragmentManager mgr = getSupportFragmentManager(); FragmentTransaction transaction = mgr.beginTransaction(); try { for (Class klass : fragmentClasses) { Fragment fragment = mgr.findFragmentByTag(klass.getName()); if (klass == activeFragmentClass) { if (fragment != null) { transaction.show(fragment); } else { transaction.add(R.id.frmMainContent, (Fragment) klass.newInstance(), klass.getName()); } } else { if (fragment != null) { transaction.hide(fragment); } } } } catch (Exception e) { e.printStackTrace(); } transaction.commit(); }
Source:
private Guid getQuotaIdForDisk(DiskImage diskImage) { if (getParameters().getDiskInfoDestinationMap() != null && getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) { return getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId(); } else { return diskImage.getQuotaId(); } }

Target:
private Guid getQuotaIdForDisk(DiskImage diskImage) { if (getParameters().getDiskInfoDestinationMap() != null && getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) { return getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId(); } return diskImage.getQuotaId(); }
Source:
private void validateCommandHandlers() { List<List<MessageHandlingMember<? super T>>> handlers = new ArrayList<>(allCommandHandlers.values()); for (int i = 0; i < handlers.size() - 1; i++) { List<CommandMessageHandlingMember<? super T>> factoryCommands1 = factoryCommands(handlers.get(i)); List<CommandMessageHandlingMember<? super T>> factoryCommands2 = factoryCommands(handlers.get(i + 1)); for (CommandMessageHandlingMember<? super T> handler1 : factoryCommands1) { for (CommandMessageHandlingMember<? super T> handler2 : factoryCommands2) { Class<?> declaringClass1 = handler1.unwrap(Executable.class).get().getDeclaringClass(); Class<?> declaringClass2 = handler2.unwrap(Executable.class).get().getDeclaringClass(); String commandName1 = handler1.commandName(); String commandName2 = handler2.commandName(); if (commandName1.equals(commandName2) && !declaringClass1.equals(declaringClass2)) { throw new AggregateModellingException(format( "Aggregates %s and %s have the same creation @CommandHandler %s", declaringClass1, declaringClass2, commandName1)); } } } } }

Target:
private void validateCommandHandlers() { List<List<MessageHandlingMember<? super T>>> handlers = new ArrayList<>(allCommandHandlers.values()); for (int i = 0; i < handlers.size() - 1; i++) { List<CommandMessageHandlingMember<? super T>> factoryCommands1 = factoryCommands(handlers.get(i)); List<CommandMessageHandlingMember<? super T>> factoryCommands2 = factoryCommands(handlers.get(i + 1)); for (CommandMessageHandlingMember<? super T> handler1 : factoryCommands1) { for (CommandMessageHandlingMember<? super T> handler2 : factoryCommands2) { String commandName1 = handler1.commandName(); String commandName2 = handler2.commandName(); if (commandName1.equals(commandName2)) { Class<?> declaringClass1 = handler1.declaringClass(); Class<?> declaringClass2 = handler2.declaringClass(); if (!declaringClass1.equals(declaringClass2)) { throw new AggregateModellingException(format( "Aggregates %s and %s have the same creation @CommandHandler %s", declaringClass1, declaringClass2, commandName1)); } } } } } }
Source:
public void createSemanticTagAgentEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_AGENT_ENTITY, false, true); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.AGENT.name()); EdmAgent agentBody = (EdmAgent) ((EdmAgentBody) storedAnno.getBody()).getAgent(); assertNotNull(agentBody.getPrefLabel()); }

Target:
public void createSemanticTagAgentEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_AGENT_ENTITY, false, true); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.AGENT.name()); EdmAgent agentBody = (EdmAgent) ((EdmAgentBody) storedAnno.getBody()).getAgent(); assertNotNull(agentBody.getPrefLabel()); assertTrue(agentBody.getPrefLabel().size() == 43); assertNotNull(agentBody.getDateOfBirth()); assertNotNull(agentBody.getDateOfDeath()); }
Source:
private void clickStaticItem(OptionsMenuItem optionsMenuItem) { ViewInteraction materialTextView = onView( allOf(withId(R.id.title), withText(optionsMenuItem.getMenuText()), childAtPosition( childAtPosition( withId(R.id.content), 0), 0), isDisplayed())) .perform(click()); }

Target:
private void clickStaticItem(OptionsMenuItem optionsMenuItem) { onView(allOf(withId(ITEM_TITLE), withText(optionsMenuItem.getMenuText()))).perform(click()); }
Source:
public List<String> getPubsubPrefixes() { final List<String> pubsubPrefixes = options.getList(pubsubTopicPrefixArg.getDest()); return pubsubPrefixes.isEmpty() ? null : pubsubPrefixes; }

Target:
public List<String> getPubsubPrefixes() { return options.getList(pubsubTopicPrefixArg.getDest()); }
Source:
public void attachServoControl(ServoControl servo) throws Exception { if (isAttached(servo)) { return; } int pin = getAddress(servo.getPin()); double targetOutput = servo.getTargetOutput(); double velocity = servo.getSpeed(); Integer deviceId = attachDevice(servo, new Object[] { pin, targetOutput, velocity }); int uS = degreeToMicroseconds(targetOutput); msg.servoAttach(deviceId, pin, uS, (int) velocity, servo.getName()); servo.attach(this); }

Target:
public void attachServoControl(ServoControl servo) throws Exception { if (isAttached(servo)) { return; } int pin = getAddress(servo.getPin()); double targetOutput = servo.getTargetOutput(); double velocity = (servo.getSpeed() == null)?-1:servo.getSpeed(); Integer deviceId = attachDevice(servo, new Object[] { pin, targetOutput, velocity }); int uS = degreeToMicroseconds(targetOutput); msg.servoAttach(deviceId, pin, uS, (int) velocity, servo.getName()); servo.attach(this); }
Source:
public void visit(NodeTraversal t, Node n, Node parent) { JSDocInfo bestJSDocInfo = null; switch (n.getToken()) { case FUNCTION: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && (bestJSDocInfo.isConstructor() || bestJSDocInfo.isInterface())) { convertConstructorToClass(n, bestJSDocInfo); } break; case CALL: if ("goog.defineClass".equals(n.getFirstChild().getQualifiedName())) { convertDefineClassToClass(n); } break; case GETPROP: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && bestJSDocInfo.hasTypedefType()) { Node typedefNode = bestJSDocInfo.getTypedefType().getRoot(); if (containsSimpleTypes(typedefNode)) { createTypeAlias(n, parent); } else { String interfaceName = n.getSecondChild().getString(); Node interfaceMember = Node.newString(Token.INTERFACE_MEMBERS, interfaceName); typesToRename.put(n.getQualifiedName(), interfaceName); typesToFilename.put(n.getQualifiedName(), n.getSourceFileName()); types.put(interfaceName, interfaceMember); interfaceMember.setJSDocInfo(bestJSDocInfo); Node interfaceNode = new Node(Token.INTERFACE, IR.empty(), IR.empty(), interfaceMember); Node nameNode = Node.newString(Token.NAME, interfaceName); nameNode.addChildToBack(interfaceNode); Node exportNode = new Node(Token.EXPORT, new Node(Token.CONST, nameNode)); replaceExpressionOrAssignment(n, parent, exportNode); } } break; case NAME: case VAR: case LET: case CONST: createTypeAlias(n, parent); break; default: break; } }

Target:
public void visit(NodeTraversal t, Node n, Node parent) { JSDocInfo bestJSDocInfo = null; switch (n.getToken()) { case FUNCTION: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && (bestJSDocInfo.isConstructor() || bestJSDocInfo.isInterface())) { convertConstructorToClass(n, bestJSDocInfo); } break; case CALL: if ("goog.defineClass".equals(n.getFirstChild().getQualifiedName())) { convertDefineClassToClass(n); } break; case GETPROP: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo == null || !bestJSDocInfo.hasTypedefType()) { break; } Node typedefNode = bestJSDocInfo.getTypedefType().getRoot(); if (containsObject(typedefNode)) { String interfaceName = n.getSecondChild().getString(); Node interfaceMember = Node.newString(Token.INTERFACE_MEMBERS, interfaceName); typesToRename.put(n.getQualifiedName(), interfaceName); typesToFilename.put(n.getQualifiedName(), n.getSourceFileName()); types.put(interfaceName, interfaceMember); interfaceMember.setJSDocInfo(bestJSDocInfo); Node interfaceNode = new Node(Token.INTERFACE, IR.empty(), IR.empty(), interfaceMember); Node nameNode = Node.newString(Token.NAME, interfaceName); nameNode.addChildToBack(interfaceNode); Node exportNode = new Node(Token.EXPORT, new Node(Token.CONST, nameNode)); replaceExpressionOrAssignment(n, parent, exportNode); break; } createTypeAlias(n, parent); break; case NAME: case VAR: case LET: case CONST: createTypeAlias(n, parent); break; default: break; } }
Source:
public void aggregationLimit() throws Exception { final QueryResult result = query("sum(10ms) by *", builder -> { builder.options(Optional.of(QueryOptions.builder().failOnLimits(true).aggregationLimit(1L).build())); }); System.out.println(result); assertEquals(2, result.getErrors().size()); for (final RequestError e : result.getErrors()) { System.out.println(e); assertTrue((e instanceof QueryError)); final QueryError q = (QueryError) e; assertThat(q.getError(), containsString("Query exceeded quota")); } assertEquals(ResultLimits.of(ResultLimit.AGGREGATION), result.getLimits()); }

Target:
public void aggregationLimit() throws Exception { final QueryResult result = query("sum(10ms) by *", builder -> { builder.options(Optional.of(QueryOptions.builder().aggregationLimit(1L).build())); }); assertEquals(2, result.getErrors().size()); for (final RequestError e : result.getErrors()) { assertTrue((e instanceof QueryError)); final QueryError q = (QueryError) e; assertThat(q.getError(), containsString("Query exceeded quota")); } assertEquals(ResultLimits.of(ResultLimit.AGGREGATION), result.getLimits()); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((diskAlias == null) ? 0 : diskAlias.hashCode()); result = prime * result + ((diskDescription == null) ? 0 : diskDescription.hashCode()); result = prime * result + ((diskInterface == null) ? 0 : diskInterface.hashCode()); result = prime * result + ((propagateErrors == null) ? 0 : propagateErrors.hashCode()); result = prime * result + (shareable ? 1231 : 1237); result = prime * result + (isWipeAfterDelete() ? 1231 : 1237); result = prime * result + (boot ? 1231 : 1237); result = prime * result + ((sgio == null) ? 0 : sgio.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((diskAlias == null) ? 0 : diskAlias.hashCode()); result = prime * result + ((diskDescription == null) ? 0 : diskDescription.hashCode()); result = prime * result + ((diskInterface == null) ? 0 : diskInterface.hashCode()); result = prime * result + ((propagateErrors == null) ? 0 : propagateErrors.hashCode()); result = prime * result + (shareable ? 1231 : 1237); result = prime * result + (isWipeAfterDelete() ? 1231 : 1237); result = prime * result + (boot ? 1231 : 1237); result = prime * result + ((sgio == null) ? 0 : sgio.hashCode()); result = prime * result + ((cinderVolumeType == null) ? 0 : cinderVolumeType.hashCode()); return result; }
Source:
protected void check() throws IOException, ServletException { String exe = fixEmpty(request.getParameter("value")); if(exe==null) { ok(); return; } if(exe.indexOf(File.separatorChar)>=0) { File f = new File(exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } error("There's no such file: "+exe); } else { String path = EnvVars.masterEnvVars.get("PATH"); String tokenizedPath; String delimiter = null; if(path!=null) { StringBuilder tokenizedPathBuilder = new StringBuilder(); for (String _dir : Util.tokenize(path.replace("\\", "\\\\"),File.pathSeparator)) { if (delimiter == null) { delimiter = ", "; } else { tokenizedPathBuilder.append(delimiter); } tokenizedPathBuilder.append(_dir.replace('\\', '/')); File dir = new File(_dir); File f = new File(dir,exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(dir,exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } } tokenizedPath = tokenizedPathBuilder.toString(); tokenizedPath += "."; } else { tokenizedPath = "unavailable."; } error("There's no such executable "+exe+" in PATH: "+tokenizedPath); } }

Target:
protected void check() throws IOException, ServletException { String exe = fixEmpty(request.getParameter("value")); if(exe==null) { ok(); return; } if(exe.indexOf(File.separatorChar)>=0) { File f = new File(exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } error("There's no such file: "+exe); } else { String path = EnvVars.masterEnvVars.get("PATH"); String tokenizedPath; String delimiter = null; if(path!=null) { StringBuilder tokenizedPathBuilder = new StringBuilder(); for (String _dir : Util.tokenize(path.replace("\\", "\\\\"),File.pathSeparator)) { if (delimiter == null) { delimiter = ", "; } else { tokenizedPathBuilder.append(delimiter); } tokenizedPathBuilder.append(_dir.replace('\\', '/')); File dir = new File(_dir); File f = new File(dir,exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(dir,exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } } tokenizedPathBuilder.append('.'); tokenizedPath = tokenizedPathBuilder.toString(); } else { tokenizedPath = "unavailable."; } error("There's no such executable "+exe+" in PATH: "+tokenizedPath); } }
Source:
public static synchronized @NonNull SymbolProviderManager getInstance() { if (INSTANCE == null) { List<@NonNull SymbolProviderFactoryWrapper> providers = new ArrayList<>(); IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); for (IConfigurationElement element : configElements) { if (ELEM_NAME_PROVIDER.equals(element.getName())) { try { Object extension = element.createExecutableExtension(ATTR_CLASS); int priority = 0; try { priority = Integer.parseInt(element.getAttribute(ATTR_PRIORITY)); } catch (NumberFormatException e) { } providers.add(new SymbolProviderFactoryWrapper((ISymbolProviderFactory) extension, priority)); } catch (CoreException | ClassCastException e) { Activator.getDefault().logError("Exception while loading extensions", e); } } } providers.sort(Comparator.comparingLong(o -> o.priority)); INSTANCE = new SymbolProviderManager(Lists.reverse(providers)); } return INSTANCE; }

Target:
public static synchronized @NonNull SymbolProviderManager getInstance() { if (INSTANCE == null) { List<@NonNull SymbolProviderFactoryWrapper> providers = new ArrayList<>(); IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); for (IConfigurationElement element : configElements) { if (ELEM_NAME_PROVIDER.equals(element.getName())) { try { Object extension = element.createExecutableExtension(ATTR_CLASS); int priority = 0; try { priority = Integer.parseInt(element.getAttribute(ATTR_PRIORITY)); } catch (NumberFormatException e) { } providers.add(new SymbolProviderFactoryWrapper((ISymbolProviderFactory) extension, priority)); } catch (CoreException | ClassCastException e) { Activator.getDefault().logError("Exception while loading extensions", e); } } } providers.sort(Comparator.<SymbolProviderFactoryWrapper> comparingLong(o -> o.priority).reversed()); } return INSTANCE; }
Source:
private Tag next() throws LimitExceededException{ boolean shouldContinue; if (iterator != null) { while (iterator.hasNext()) { final Tag tag = iterator.next(); if (Verbs.isVerb(tag)) { shouldContinue=validation(tag); if (current != null && current.hasChildren() && shouldContinue) { final List<Tag> children = current.children(); if (children.contains(tag)) { continue; } } if (tag.name().equals(Verbs.gather) && tag.hasAttribute(GatherAttributes.ATTRIBUTE_HINTS) && !StringUtils.isEmpty(tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value())) { String hotWords = tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value(); List<String> hintList = Arrays.asList(hotWords.split(",")); if (hintList.size() > 50) { throw new LimitExceededException("HotWords limit exceeded. There are more than 50 phrases"); } for (String hint : hintList) { if (hint.length() > 100) { throw new LimitExceededException("HotWords limit exceeded. Hint with more than 100 characters found"); } } } current = tag; return current; } } } else { if(logger.isInfoEnabled()){ logger.info("iterator is null"); } } return null; }

Target:
private Tag next() throws LimitExceededException{ boolean AttributteValidator; if (iterator != null) { while (iterator.hasNext()) { final Tag tag = iterator.next(); if (Verbs.isVerb(tag)) { AttributteValidator=validation(tag); if (current != null && current.hasChildren()) { final List<Tag> children = current.children(); if (children.contains(tag)) { continue; } } if (tag.name().equals(Verbs.gather) && tag.hasAttribute(GatherAttributes.ATTRIBUTE_HINTS) && !StringUtils.isEmpty(tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value())) { String hotWords = tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value(); List<String> hintList = Arrays.asList(hotWords.split(",")); if (hintList.size() > 50) { throw new LimitExceededException("HotWords limit exceeded. There are more than 50 phrases"); } for (String hint : hintList) { if (hint.length() > 100) { throw new LimitExceededException("HotWords limit exceeded. Hint with more than 100 characters found"); } } } current = tag; return current; } } } else { if(logger.isInfoEnabled()){ logger.info("iterator is null"); } } return null; }
Source:
public void process(Element element, JCodeModel codeModel, EBeanHolder holder) { CustomTitle annotation = element.getAnnotation(CustomTitle.class); JFieldRef customTitleFeature = holder.classes().WINDOW.staticRef("FEATURE_CUSTOM_TITLE"); holder.init.body().invoke("requestWindowFeature").arg(customTitleFeature); holder.afterSetContentView.body().add(holder.contextRef.invoke("getWindow").invoke("setFeatureInt").arg(customTitleFeature).arg(lit(annotation.value()))); }

Target:
public void process(Element element, JCodeModel codeModel, EBeanHolder holder) { JFieldRef customTitleFeature = holder.classes().WINDOW.staticRef("FEATURE_CUSTOM_TITLE"); holder.init.body().invoke("requestWindowFeature").arg(customTitleFeature); JFieldRef contentViewId = annotationHelper.extractAnnotationFieldRefs(holder, element, CustomTitle.class, rClass.get(Res.LAYOUT), false).get(0); holder.afterSetContentView.body().add(holder.contextRef.invoke("getWindow").invoke("setFeatureInt").arg(customTitleFeature).arg(contentViewId)); }
Source:
protected IMicroblockContainerTile getMicroblockTile(IBlockAccess world, BlockPos pos) { TileEntity tile = world.getTileEntity(pos); return tile instanceof IMicroblockContainerTile ? (IMicroblockContainerTile) tile : null; }

Target:
protected IMicroblockContainerTile getMicroblockTile(IBlockAccess world, BlockPos pos) { TileEntity tile = world.getTileEntity(pos); if (tile == null) { return null; } return getMicroblockTile(tile); }
Source:
public void close() { try { reader.close(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public void close() { try { reader.close(); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); IToolchain toolchain = AbstractTestTools.getCandidateToolchain(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); toolchain.setOutputStream(out); toolchain.setErrorStream(err); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); Assert.assertEquals(0, out.size()); String errString = err.toString(); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) != -1); }

Target:
public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); IToolchain toolchain = AbstractTestTools.getCandidateToolchain(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); toolchain.setOutputStream(out); toolchain.setErrorStream(err); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); Assert.assertEquals(0, out.size()); String errString = err.toString(); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); warnIndex = errString.indexOf("WARNING:", warnIndex + 1); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) == -1); }
Source:
public void test() { SensorContextTester context = SensorContextTester.create(MODULE_BASE_DIR); HashMap<InputFile, Set<Integer>> projectLinesOfCode = new HashMap<>(); saveMetrics(context, projectLinesOfCode, false); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.FUNCTIONS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.STATEMENTS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.CLASSES).value()).isEqualTo(0); assertThat(projectLinesOfCode).hasSize(1); Set<Integer> linesOfCode = projectLinesOfCode.get(INPUT_FILE); assertThat(linesOfCode).containsOnly(2, 3, 4); }

Target:
public void test() { SensorContextTester context = SensorContextTester.create(MODULE_BASE_DIR); MetricsVisitor metricsVisitor = saveMetrics(context, false); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.FUNCTIONS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.STATEMENTS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.CLASSES).value()).isEqualTo(0); assertThat(metricsVisitor.linesOfCode().get(INPUT_FILE)).containsOnly(2, 3, 4); }
Source:
private static void convertAndAdd(Map<String, Object> config, CheckpointManagerConfigKey key, Object value) { if (key != null) { switch (key.getType()) { case INTEGER: config.put(key.value(), TypeUtils.getInteger(value)); break; case LONG: config.put(key.value(), TypeUtils.getLong(value)); break; case STRING: config.put(key.value(), value); break; case OBJECT: config.put(key.value(), value); break; default: throw new IllegalArgumentException(String.format( "config key %s is of type %s which is not yet supported", key, key.getType())); } } }

Target:
private static void convertAndAdd(Map<String, Object> config, CheckpointManagerConfigKey key, Object value) { if (key != null) { switch (key.getType()) { case INTEGER: config.put(key.value(), TypeUtils.getInteger(value)); break; case LONG: config.put(key.value(), TypeUtils.getLong(value)); break; case STRING: config.put(key.value(), value); break; case MAP: config.put(key.value(), value); break; default: throw new IllegalArgumentException(String.format( "config key %s is of type %s which is not yet supported", key, key.getType())); } } }
Source:
public boolean validateHostIsTrusted(VDS vds) { List<String> hosts = new ArrayList<String>(); hosts.add(vds.gethost_name()); List<AttestationValue> valueList = attestHosts(hosts); return valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED; }

Target:
public boolean validateHostIsTrusted(VDS vds) { List<String> hosts = new ArrayList<String>(); hosts.add(vds.getHostName()); List<AttestationValue> valueList = attestHosts(hosts); return valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED; }
Source:
public Iterable<RowKey> getKeys() { if ( currentState.isEmpty() ) { if ( cleared ) { return Collections.emptyList(); } else { return snapshot.getRowKeys(); } } else { Set<RowKey> keys = new LinkedHashSet<RowKey>( cleared ? currentState.size() : snapshot.size() + currentState.size() ); if ( !cleared ) { for ( RowKey rowKey : snapshot.getRowKeys() ) { keys.add( rowKey ); } } for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) { switch ( op.getValue().getType() ) { case PUT: keys.add( op.getKey() ); break; case REMOVE: keys.remove( op.getKey() ); break; } } return keys; } }

Target:
public Iterable<RowKey> getKeys() { if ( currentState.isEmpty() ) { if ( cleared ) { return Collections.emptyList(); } else { return snapshot.getRowKeys(); } } else { Set<RowKey> keys = CollectionHelper.newLinkedHashSet( cleared ? currentState.size() : snapshot.size() + currentState.size() ); if ( !cleared ) { for ( RowKey rowKey : snapshot.getRowKeys() ) { keys.add( rowKey ); } } for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) { switch ( op.getValue().getType() ) { case PUT: keys.add( op.getKey() ); break; case REMOVE: keys.remove( op.getKey() ); break; } } return keys; } }
Source:
public void onResume() { final Activity activity = getActivity(); if (activity instanceof QuranActivity) { boolean newValueOfShowSuraTranslatedName = quranSettings.isShowSuraTranslatedName(); if (this.showSuraTranslatedName != newValueOfShowSuraTranslatedName) { showHideSuraTranslatedName(newValueOfShowSuraTranslatedName); this.showSuraTranslatedName = newValueOfShowSuraTranslatedName; } disposable = ((QuranActivity) activity).getLatestPageObservable() .first(Constants.NO_PAGE) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(new DisposableSingleObserver<Integer>() { @Override public void onSuccess(Integer recentPage) { if (recentPage != Constants.NO_PAGE) { int sura = quranDisplayData.safelyGetSuraOnPage(recentPage); int juz = quranInfo.getJuzFromPage(recentPage); int position = sura + juz - 1; mRecyclerView.scrollToPosition(position); } } @Override public void onError(Throwable e) { } }); if (quranSettings.isArabicNames()) { updateScrollBarPositionHoneycomb(); } } super.onResume(); }

Target:
public void onResume() { final Activity activity = getActivity(); if (activity instanceof QuranActivity) { boolean newValueOfShowSuraTranslatedName = quranSettings.isShowSuraTranslatedName(); if (this.showSuraTranslatedName != newValueOfShowSuraTranslatedName) { showHideSuraTranslatedName(); this.showSuraTranslatedName = newValueOfShowSuraTranslatedName; } disposable = ((QuranActivity) activity).getLatestPageObservable() .first(Constants.NO_PAGE) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(new DisposableSingleObserver<Integer>() { @Override public void onSuccess(Integer recentPage) { if (recentPage != Constants.NO_PAGE) { int sura = quranDisplayData.safelyGetSuraOnPage(recentPage); int juz = quranInfo.getJuzFromPage(recentPage); int position = sura + juz - 1; mRecyclerView.scrollToPosition(position); } } @Override public void onError(Throwable e) { } }); if (quranSettings.isArabicNames()) { updateScrollBarPositionHoneycomb(); } } super.onResume(); }
Source:
public void channelInactive(final ChannelHandlerContext context) throws Exception { super.channelInactive(context); if (this.apnsConnection.handshakeCompleted) { if (this.apnsConnection.listener != null) { this.apnsConnection.listener.handleConnectionClosure(this.apnsConnection); } } if (this.apnsConnection.gracefulShutdownTimeoutFuture != null) { this.apnsConnection.gracefulShutdownTimeoutFuture.cancel(false); } }

Target:
public void channelInactive(final ChannelHandlerContext context) throws Exception { super.channelInactive(context); if (this.apnsConnection.handshakeCompleted) { if (this.apnsConnection.listener != null) { this.apnsConnection.listener.handleConnectionClosure(this.apnsConnection); } } if (this.apnsConnection.gracefulDisconnectionTimeoutFuture != null) { this.apnsConnection.gracefulDisconnectionTimeoutFuture.cancel(false); } }
Source:
public boolean next(StringValue target) { final char[] data = this.toTokenize.getCharArray(); final int limit = this.limit; int pos = this.pos; for (; pos < limit && Character.isWhitespace(data[pos]); pos++) { ; } if (pos >= limit) { this.pos = pos; return false; } final int start = pos; for (; pos < limit && !Character.isWhitespace(data[pos]); pos++) { ; } this.pos = pos; target.setValue(this.toTokenize, start, pos - start); return true; }

Target:
public boolean next(StringValue target) { final char[] data = this.toTokenize.getCharArray(); final int limit = this.limit; int pos = this.pos; for (; pos < limit && Character.isWhitespace(data[pos]); pos++) { } if (pos >= limit) { this.pos = pos; return false; } final int start = pos; for (; pos < limit && !Character.isWhitespace(data[pos]); pos++) { } this.pos = pos; target.setValue(this.toTokenize, start, pos - start); return true; }
Source:
public void edit(final VnicInstanceType model) { driver.edit(model); String vnicName = model.getNetworkInterface().getName(); profileEditor.addLabelStyleName(style.noDisplay()); profileEditor.addContentWidgetStyleName(style.contentStyle()); profileEditor.setElementId(ElementIdUtils.createElementId(elementId, vnicName)); syncSelectedItemWithNetworkInterface(model); model.getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { syncSelectedItemWithNetworkInterface(model); ValueChangeEvent.fire(ProfileInstanceTypeEditor.this, model); } }); }

Target:
public void edit(final VnicInstanceType model) { driver.edit(model); profileEditor.addLabelStyleName(style.noDisplay()); profileEditor.addContentWidgetStyleName(style.contentStyle()); profileEditor.setElementId(ElementIdUtils.createElementId(elementId, model.getNetworkInterface().getName())); syncSelectedItemWithNetworkInterface(model); model.getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { syncSelectedItemWithNetworkInterface(model); ValueChangeEvent.fire(ProfileInstanceTypeEditor.this, model); } }); }
Source:
private TimestampCreator getTimestampCreator() { TsBoundPersisterConfiguration timestampBoundPersistence = install.timestampBoundPersistence(); if (PaxosTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return getPaxosTimestampCreator(); } else if (DatabaseTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return new DbBoundTimestampCreator( ((DatabaseTsBoundPersisterConfiguration) timestampBoundPersistence) .keyValueServiceConfig()); } else { throw new RuntimeException(String.format("Unknown TsBoundPersisterConfiguration found %s", timestampBoundPersistence.getClass())); } }

Target:
private TimestampCreator getTimestampCreator() { TsBoundPersisterConfiguration timestampBoundPersistence = install.timestampBoundPersistence(); if (PaxosTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return getPaxosTimestampCreator(); } else if (DatabaseTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return new DbBoundTimestampCreator( ((DatabaseTsBoundPersisterConfiguration) timestampBoundPersistence) .keyValueServiceConfig()); } throw new RuntimeException(String.format("Unknown TsBoundPersisterConfiguration found %s", timestampBoundPersistence.getClass())); }
Source:
public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { try { dataSet = result; afterDataSetLookup(result); updateVisualization(); afterRedraw(); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } public void notFound() { String uuid = displayerSettings.getDataSetLookup().getDataSetUUID(); getView().errorDataSetNotFound(uuid); handleError("Data set not found: " + uuid); } @Override public boolean onError(final ClientRuntimeError error) { showError(error); drawn = false; return false; } }); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } }

Target:
public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { try { dataSet = result; afterDataSetLookup(result); updateVisualization(); afterRedraw(); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } public void notFound() { String uuid = displayerSettings.getDataSetLookup().getDataSetUUID(); getView().errorDataSetNotFound(uuid); handleError("Data set not found: " + uuid); } @Override public boolean onError(final ClientRuntimeError error) { showError(error); requestDraw(); return false; } }); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } }
Source:
public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter) { return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, FileOutputFormat.getDefaultWriteMode()); }

Target:
public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter) { return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, null); }
Source:
public static void assertSingleton(final Class azkabanClass, final Injector injector) { final Object azkabanObj1 = requireNonNull(injector.getInstance(azkabanClass)); final Object azkabanObj2 = requireNonNull(injector.getInstance(azkabanClass)); assertTrue(azkabanObj1 == azkabanObj2); }

Target:
public static void assertSingleton(final Class azkabanClass, final Injector injector) { final Object azkabanObj1 = injector.getInstance(azkabanClass); final Object azkabanObj2 = injector.getInstance(azkabanClass); assertThat(azkabanObj1).isSameAs(azkabanObj2).isNotNull(); }