auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<Object> getNearestMatches(ResourceInfo resourceInfo, DimensionInfo dimension, List<Object> values, String dimensionName) throws IOException { NearestMatchFinder finder = NearestMatchFinder.get(resourceInfo, dimension, dimensionName); List<Object> result = new ArrayList<>(); for (Object value : values) { Object nearest = finder.getNearest(value); if (nearest == null) { NearestMatchWarningAppender.addWarning(resourceInfo.prefixedName(), dimensionName, null, dimension.getUnits(), NotFound); result.add(value); } else if (value.equals(nearest)) { result.add(value); } else { NearestMatchWarningAppender.addWarning(resourceInfo.prefixedName(), dimensionName, nearest, dimension.getUnits(), Nearest); result.add(nearest); } } return result; }

Target:
private List<Object> getNearestMatches(ResourceInfo resourceInfo, DimensionInfo dimension, List<Object> values, String dimensionName) throws IOException { int maxRenderingTime = getMaxRenderingTime(); long maxTime = maxRenderingTime > 0 ? System.currentTimeMillis() + maxRenderingTime * 1000 : -1; NearestMatchFinder finder = NearestMatchFinder.get(resourceInfo, dimension, dimensionName); List<Object> result = new ArrayList<>(); for (Object value : values) { Object nearest = finder.getNearest(value); if (nearest == null) { NearestMatchWarningAppender.addWarning(resourceInfo.prefixedName(), dimensionName, null, dimension.getUnits(), NotFound); result.add(value); } else if (value.equals(nearest)) { result.add(value); } else { NearestMatchWarningAppender.addWarning(resourceInfo.prefixedName(), dimensionName, nearest, dimension.getUnits(), Nearest); result.add(nearest); } if (maxTime > 0 && System.currentTimeMillis() > maxTime) { throw new ServiceException( "Nearest matching dimension values required more time than allowed and has been forcefully stopped. " + "The max rendering time is " + (maxRenderingTime) + "s"); } } return result; }
Source:
public void setTitle(CharSequence title) { final View toolbar = findViewById(R.id.toolbar); if (toolbar != null) { final View titleView = toolbar.findViewById(R.id.toolbar_title_view); if (titleView != null && titleView instanceof TextView) { ((TextView) titleView).setText(title); super.setTitle(null); return; } } super.setTitle(title); }

Target:
public void setTitle(CharSequence title) { final View toolbar = findViewById(R.id.toolbar); if (toolbar != null) { final TextView titleView = getTitleView(); if (titleView != null) { titleView.setText(title); } } super.setTitle(title); }
Source:
void initWithConfig(IClientConfig clientConfig, IRule rule, IPing ping) { this.config = clientConfig; String clientName = clientConfig.getClientName(); this.name = clientName; int pingIntervalTime = Integer.parseInt("" + clientConfig.getProperty( CommonClientConfigKey.NFLoadBalancerPingInterval, Integer.parseInt("30"))); int maxTotalPingTime = Integer.parseInt("" + clientConfig.getProperty( CommonClientConfigKey.NFLoadBalancerMaxTotalPingTime, Integer.parseInt("2"))); setPingInterval(pingIntervalTime); setMaxTotalPingTime(maxTotalPingTime); setRule(rule); setPing(ping); setLoadBalancerStats(new LoadBalancerStats(clientName)); rule.setLoadBalancer(this); if (ping instanceof AbstractLoadBalancerPing) { ((AbstractLoadBalancerPing) ping).setLoadBalancer(this); } logger.info("Client: instantiated a LoadBalancer: {}", name, toString()); boolean enablePrimeConnections = clientConfig.get( CommonClientConfigKey.EnablePrimeConnections, DefaultClientConfigImpl.DEFAULT_ENABLE_PRIME_CONNECTIONS); if (enablePrimeConnections) { this.setEnablePrimingConnections(true); PrimeConnections primeConnections = new PrimeConnections( this.getName(), clientConfig); this.setPrimeConnections(primeConnections); } init(); }

Target:
void initWithConfig(IClientConfig clientConfig, IRule rule, IPing ping) { this.config = clientConfig; String clientName = clientConfig.getClientName(); this.name = clientName; int pingIntervalTime = Integer.parseInt("" + clientConfig.getProperty( CommonClientConfigKey.NFLoadBalancerPingInterval, Integer.parseInt("30"))); int maxTotalPingTime = Integer.parseInt("" + clientConfig.getProperty( CommonClientConfigKey.NFLoadBalancerMaxTotalPingTime, Integer.parseInt("2"))); setPingInterval(pingIntervalTime); setMaxTotalPingTime(maxTotalPingTime); setRule(rule); setPing(ping); setLoadBalancerStats(new LoadBalancerStats(clientName)); rule.setLoadBalancer(this); if (ping instanceof AbstractLoadBalancerPing) { ((AbstractLoadBalancerPing) ping).setLoadBalancer(this); } logger.info("Client: instantiated a LoadBalancer: {}", name, this); boolean enablePrimeConnections = clientConfig.get( CommonClientConfigKey.EnablePrimeConnections, DefaultClientConfigImpl.DEFAULT_ENABLE_PRIME_CONNECTIONS); if (enablePrimeConnections) { this.setEnablePrimingConnections(true); PrimeConnections primeConnections = new PrimeConnections( this.getName(), clientConfig); this.setPrimeConnections(primeConnections); } init(); }
Source:
public void noData() { FlowPanel noDataPanel = new FlowPanel(); noDataPanel.setWidth(width + "px"); noDataPanel.setHeight(height + "px"); Label lblNoData = new Label(C3DisplayerConstants.INSTANCE.common_noData()); noDataPanel.add(lblNoData); displayerPanel.clear(); displayerPanel.add(noDataPanel); }

Target:
public void noData() { FlowPanel noDataPanel = GWT.create(FlowPanel.class); noDataPanel.setWidth(width + "px"); noDataPanel.setHeight(height + "px"); Label lblNoData = GWT.create(Label.class); lblNoData.setText(C3DisplayerConstants.INSTANCE.common_noData()); noDataPanel.add(lblNoData); displayerPanel.clear(); displayerPanel.add(noDataPanel); }
Source:
public void doPut(HttpServletRequest request, HttpServletResponse response) { this.path = getPath(request); org.geoserver.platform.resource.Resource script; try { if (path.contains(":")) { path = path.replace(":","/"); } script = scriptMgr.script(path); } catch(IllegalStateException e) { throw new RestException(format("Error creating script file %s", path), HttpStatus.INTERNAL_SERVER_ERROR, e); } try { BufferedWriter w = new BufferedWriter(new OutputStreamWriter(script.out())); try { IOUtils.copy(request.getInputStream(), w); w.flush(); } finally { IOUtils.closeQuietly(w); } } catch(IOException e) { throw new RestException(format("Error writing script file %s", path), HttpStatus.INTERNAL_SERVER_ERROR, e); } response.setStatus(201); }

Target:
public void doPut(HttpServletRequest request, HttpServletResponse response) { this.path = getPath(request); try { if (path.contains(":")) { path = path.replace(":","/"); } script = scriptMgr.script(path); } catch(IllegalStateException e) { throw new RestException(format("Error creating script file %s", path), HttpStatus.INTERNAL_SERVER_ERROR, e); } try { BufferedWriter w = new BufferedWriter(new OutputStreamWriter(script.out())); try { IOUtils.copy(request.getInputStream(), w); w.flush(); } finally { IOUtils.closeQuietly(w); } } catch(IOException e) { throw new RestException(format("Error writing script file %s", path), HttpStatus.INTERNAL_SERVER_ERROR, e); } response.setStatus(201); }
Source:
public void registerSegmentHandoffCallback( SegmentDescriptor descriptor, Executor exec, Runnable handOffRunnable ) { log.info("Adding SegmentHandoffCallback for dataSource[%s] Segment[%s]", dataSource, descriptor); handOffCallbacks.put(descriptor, new Pair<>(exec, handOffRunnable)); }

Target:
public boolean registerSegmentHandoffCallback( SegmentDescriptor descriptor, Executor exec, Runnable handOffRunnable ) { log.info("Adding SegmentHandoffCallback for dataSource[%s] Segment[%s]", dataSource, descriptor); Pair<Executor, Runnable> prev = handOffCallbacks.putIfAbsent( descriptor, new Pair<>(exec, handOffRunnable) ); return prev == null; }
Source:
public static void init(Context context, String baseUrl, String dsn) { Sentry.getInstance().context = context; Sentry.getInstance().baseUrl = baseUrl; Sentry.getInstance().dsn = dsn; Sentry.getInstance().packageName = context.getPackageName(); Sentry.getInstance().client = new ProtocolClient(baseUrl); Sentry.getInstance().client.setDebug(true); submitStackTraces(context); UncaughtExceptionHandler currentHandler = Thread.getDefaultUncaughtExceptionHandler(); if (currentHandler != null) { Log.d("Debugged", "current handler class="+currentHandler.getClass().getName()); } if (!(currentHandler instanceof SentryUncaughtExceptionHandler)) { Thread.setDefaultUncaughtExceptionHandler( new SentryUncaughtExceptionHandler(currentHandler, context)); } }

Target:
public static void init(Context context, String baseUrl, String dsn) { Sentry.getInstance().context = context; Sentry.getInstance().baseUrl = baseUrl; Sentry.getInstance().dsn = dsn; Sentry.getInstance().packageName = context.getPackageName(); submitStackTraces(context); UncaughtExceptionHandler currentHandler = Thread.getDefaultUncaughtExceptionHandler(); if (currentHandler != null) { Log.d("Debugged", "current handler class="+currentHandler.getClass().getName()); } if (!(currentHandler instanceof SentryUncaughtExceptionHandler)) { Thread.setDefaultUncaughtExceptionHandler( new SentryUncaughtExceptionHandler(currentHandler, context)); } }
Source:
private boolean updateNote(long noteId, String[] fields, Set<String> tags) { if (!canUpdateNotesForModelId(-1L)) { throw new IllegalStateException("update permission not granted"); } Uri.Builder builder = FlashCardsContract.Note.CONTENT_URI.buildUpon(); Uri contentUri = builder.appendPath(Long.toString(noteId)).build(); ContentValues values = new ContentValues(); if (fields != null) { values.put(FlashCardsContract.Note.FLDS, Utils.joinFields(fields)); } if (tags != null) { values.put(FlashCardsContract.Note.TAGS, Utils.joinTags(tags)); } int numRowsUpdated = mResolver.update(contentUri, values, null, null); return numRowsUpdated > 0; }

Target:
private boolean updateNote(long noteId, String[] fields, Set<String> tags) { Uri.Builder builder = FlashCardsContract.Note.CONTENT_URI.buildUpon(); Uri contentUri = builder.appendPath(Long.toString(noteId)).build(); ContentValues values = new ContentValues(); if (fields != null) { values.put(FlashCardsContract.Note.FLDS, Utils.joinFields(fields)); } if (tags != null) { values.put(FlashCardsContract.Note.TAGS, Utils.joinTags(tags)); } int numRowsUpdated = mResolver.update(contentUri, values, null, null); return numRowsUpdated > 0; }
Source:
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { if (registry.containsBeanDefinition(MESSAGE_HISTORY_CONFIGURER)) { throw new BeanDefinitionStoreException("At most one 'MessageHistoryConfigurer' can be registered within a context."); } Map<String,Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(MessageHistory.class.getName()); AbstractBeanDefinition messageHistoryConfigurer = BeanDefinitionBuilder.genericBeanDefinition(MessageHistoryConfigurer.class) .addPropertyValue("componentNamePatterns", annotationAttributes.get("value")) .getBeanDefinition(); registry.registerBeanDefinition(MESSAGE_HISTORY_CONFIGURER, messageHistoryConfigurer); }

Target:
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { Map<String,Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnableMessageHistory.class.getName()); Object componentNamePatterns = annotationAttributes.get("value"); if (componentNamePatterns instanceof String[]) { StringBuilder componentNamePatternsString = new StringBuilder(); for (String s : (String[]) componentNamePatterns) { componentNamePatternsString.append(s).append(","); } componentNamePatterns = componentNamePatternsString.substring(0, componentNamePatternsString.length() - 1); } if (!registry.containsBeanDefinition(MESSAGE_HISTORY_CONFIGURER)) { Set<Object> componentNamePatternsSet = new ManagedSet<Object>(); componentNamePatternsSet.add(componentNamePatterns); AbstractBeanDefinition messageHistoryConfigurer = BeanDefinitionBuilder.genericBeanDefinition(MessageHistoryConfigurer.class) .addPropertyValue("componentNamePatternsSet", componentNamePatternsSet) .getBeanDefinition(); registry.registerBeanDefinition(MESSAGE_HISTORY_CONFIGURER, messageHistoryConfigurer); } else { @SuppressWarnings("unchecked") Set<Object> currentComponentNamePatternsSet = (Set<Object>) registry.getBeanDefinition(MESSAGE_HISTORY_CONFIGURER) .getPropertyValues().getPropertyValue("componentNamePatternsSet").getValue(); currentComponentNamePatternsSet.add(componentNamePatterns); } }
Source:
public PagedReferenceImpl(final PagePosition position, final PagedMessage message, final PageSubscription subscription) { this.position = position; this.message = new WeakReference<>(message); this.subscription = subscription; if (message != null) { this.largeMessage = message.getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE; this.transactionID = message.getTransactionID(); this.messageID = message.getMessage().getMessageID(); this.priority = message.getMessage().getPriority(); this.durable = message.getMessage().isDurable() ? IS_DURABLE : IS_NOT_DURABLE; getPersistentSize(); } else { this.largeMessage = UNDEFINED_IS_LARGE_MESSAGE; this.transactionID = -2; this.messageID = -1; this.messageSize = -1; this.priority = -1; this.durable = UNDEFINED_IS_DURABLE; } }

Target:
public PagedReferenceImpl(final PagePosition position, final PagedMessage message, final PageSubscription subscription) { this.position = position; this.message = new WeakReference<>(message); this.subscription = subscription; if (message != null) { this.largeMessage = message.getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE; this.transactionID = message.getTransactionID(); this.messageID = message.getMessage().getMessageID(); this.durable = message.getMessage().isDurable() ? IS_DURABLE : IS_NOT_DURABLE; this.deliveryTime = message.getMessage().getScheduledDeliveryTime(); getPersistentSize(); } else { this.largeMessage = UNDEFINED_IS_LARGE_MESSAGE; this.transactionID = -2; this.messageID = -1; this.messageSize = -1; this.durable = UNDEFINED_IS_DURABLE; this.deliveryTime = UNDEFINED_DELIVERY_TIME; } }
Source:
protected static boolean isProductionBuild() { final Properties props = new Properties(); final InputStream input = XmlOutput.class.getClassLoader().getResourceAsStream("/config.properties"); if (input == null) { System.err.println("Could not find property file."); } else { try { props.load(input); final String productionBuild = (String) props.get("productionBuild"); if (productionBuild.equals("true")) { return true; } else { System.err.println("Unknown productionBuild value[" + productionBuild + "]. Defaulting to fail for unknown XML elements."); } } catch (final IOException e) { System.err.println("Failed to load property file."); } } return false; }

Target:
protected static boolean isProductionBuild() { final Properties props = new Properties(); final InputStream input = XmlOutput.class.getClassLoader().getResourceAsStream("/config.properties"); if (input == null) { LOG.error("Could not find property file."); } else { try { props.load(input); final String productionBuild = (String) props.get("productionBuild"); if (productionBuild.equals("true")) { return true; } else { LOG.error("Unknown productionBuild value[" + productionBuild + "]. Defaulting to fail for unknown XML elements."); } } catch (final IOException e) { LOG.error("Failed to load property file: ", e); } } return false; }
Source:
private synchronized void startLogMaker() { if (nextLogMaker != null) { return; } nextLogMaker = new SimpleThreadPool(1, "WALog creator"); nextLogMaker.submit(new LoggingRunnable(log, new Runnable() { @Override public void run() { final ServerResources conf = tserver.getServerConfig(); final VolumeManager fs = conf.getFileSystem(); while (!nextLogMaker.isShutdown()) { DfsLogger alog = null; try { if (log.isDebugEnabled()) log.debug("Creating next WAL"); alog = new DfsLogger(tserver.getContext(), conf, syncCounter, flushCounter); alog.open(tserver.getClientAddressString()); String fileName = alog.getFileName(); if (log.isDebugEnabled()) log.debug("Created next WAL " + fileName); tserver.addNewLogMarker(alog); while (!nextLog.offer(alog, 12, TimeUnit.HOURS)) { log.info("Our WAL was not used for 12 hours: {}", fileName); } } catch (Exception t) { log.error("Failed to open WAL", t); if (alog != null) { try { alog.close(); } catch (Exception e) { log.error("Failed to close WAL after it failed to open", e); } try { Path path = alog.getPath(); if (fs.exists(path)) { fs.delete(path); } } catch (Exception e) { log.warn("Failed to delete a WAL that failed to open", e); } } try { nextLog.offer(t, 12, TimeUnit.HOURS); } catch (InterruptedException ex) { } } } } })); }

Target:
private synchronized void startLogMaker() { if (nextLogMaker != null) { return; } nextLogMaker = new SimpleThreadPool(1, "WALog creator"); nextLogMaker.submit(new LoggingRunnable(log, new Runnable() { @Override public void run() { final ServerResources conf = tserver.getServerConfig(); final VolumeManager fs = conf.getFileSystem(); while (!nextLogMaker.isShutdown()) { DfsLogger alog = null; try { log.debug("Creating next WAL"); alog = new DfsLogger(tserver.getContext(), conf, syncCounter, flushCounter); alog.open(tserver.getClientAddressString()); String fileName = alog.getFileName(); log.debug("Created next WAL {}", fileName); tserver.addNewLogMarker(alog); while (!nextLog.offer(alog, 12, TimeUnit.HOURS)) { log.info("Our WAL was not used for 12 hours: {}", fileName); } } catch (Exception t) { log.error("Failed to open WAL", t); if (alog != null) { try { alog.close(); } catch (Exception e) { log.error("Failed to close WAL after it failed to open", e); } try { Path path = alog.getPath(); if (fs.exists(path)) { fs.delete(path); } } catch (Exception e) { log.warn("Failed to delete a WAL that failed to open", e); } } try { nextLog.offer(t, 12, TimeUnit.HOURS); } catch (InterruptedException ex) { } } } } })); }
Source:
public void showLastAccessedView(final String lastAccessedSubSectionId, final String courseId, final View view) { if ( isActivityStarted() ) { if (!AppConstants.offline_flag) { if(courseId!=null && lastAccessedSubSectionId!=null){ logger.debug("lastAccessedSubSectionId : " + lastAccessedSubSectionId); CourseComponent lastAccessComponent = courseManager.getComponentById(courseId, lastAccessedSubSectionId); if (lastAccessComponent != null) { if (!lastAccessComponent.isContainer()) { if (lastAccessComponent.getParent() != null) lastAccessComponent = lastAccessComponent.getParent(); if (lastAccessComponent.getParent() != null) { lastAccessComponent = lastAccessComponent.getParent(); } } PrefManager.UserPrefManager userPrefManager = new PrefManager.UserPrefManager(MainApplication.instance()); if ( userPrefManager.isUserPrefVideoModel() && lastAccessComponent.getVideos().isEmpty() ) return; final CourseComponent finalLastAccessComponent = lastAccessComponent; super.showLastAccessedView(null, " " + lastAccessComponent.getName(), new View.OnClickListener() { @Override public void onClick(View v) { long currentTime = SystemClock.elapsedRealtime(); if (currentTime - lastClickTime > 1000) { lastClickTime = currentTime; environment.getRouter().showCourseContainerOutline( CourseVideoListActivity.this, courseData, finalLastAccessComponent.getId()); } } }); } else { hideLastAccessedView(view); } } } else { hideLastAccessedView(view); } } }

Target:
public void showLastAccessedView(final String lastAccessedSubSectionId, final String courseId, final View view) { if ( isActivityStarted() ) { if (!AppConstants.offline_flag) { if(courseId!=null && lastAccessedSubSectionId!=null){ CourseComponent lastAccessComponent = courseManager.getComponentById(courseId, lastAccessedSubSectionId); if (lastAccessComponent != null) { if (!lastAccessComponent.isContainer()) { if (lastAccessComponent.getParent() != null) lastAccessComponent = lastAccessComponent.getParent(); if (lastAccessComponent.getParent() != null) { lastAccessComponent = lastAccessComponent.getParent(); } } PrefManager.UserPrefManager userPrefManager = new PrefManager.UserPrefManager(MainApplication.instance()); if ( userPrefManager.isUserPrefVideoModel() && lastAccessComponent.getVideos().isEmpty() ) return; final CourseComponent finalLastAccessComponent = lastAccessComponent; super.showLastAccessedView(null, " " + lastAccessComponent.getName(), new View.OnClickListener() { @Override public void onClick(View v) { long currentTime = SystemClock.elapsedRealtime(); if (currentTime - lastClickTime > 1000) { lastClickTime = currentTime; environment.getRouter().showCourseContainerOutline( CourseVideoListActivity.this, courseData, finalLastAccessComponent.getId()); } } }); } else { hideLastAccessedView(view); } } } else { hideLastAccessedView(view); } } }
Source:
public String getError() { return String.format("getModificationTime mismatch - s3: %s, ms: %s", getS3FileStatus().getModificationTime(), getMsFileStatus().getModificationTime()); }

Target:
public String getError() { return String.format("File timestamp mismatch - S3: %s, MS: %s", getS3FileStatus().getModificationTime(), getMsFileStatus().getModificationTime()); }
Source:
public StreamEmitterAnnotationBeanPostProcessor streamEmitterAnnotationBeanPostProcessor() { return new StreamEmitterAnnotationBeanPostProcessor(); }

Target:
public static StreamEmitterAnnotationBeanPostProcessor streamEmitterAnnotationBeanPostProcessor() { return new StreamEmitterAnnotationBeanPostProcessor(); }
Source:
public ReactiveCouchbaseOperations getCouchbaseOperations(){ return operations; }

Target:
public RxJavaCouchbaseOperations getCouchbaseOperations(){ return operations; }
Source:
public static <T> void forEach(T[] array, Consumer<T> consumer) { Objects.requireNonNull(array, "Array must be non-null."); final int size = array.length; if (size == 0) { return; } else if (size == 1) { consumer.accept(array[0]); return; } for (int i = 0; i < size; ++i) { consumer.accept(array[i]); } }

Target:
public static <T> void forEach(T[] array, Consumer<T> consumer) { final int size = Objects.requireNonNull(array, "Array must be non-null.").length; for (int i = 0; i < size; ++i) { consumer.accept(array[i]); } }
Source:
private void enableHook() { if (getEntity() == null || getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ArrayList<VdcActionParametersBase> list = new ArrayList<VdcActionParametersBase>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(new GlusterHookParameters(getEntity().getId(), hook.getId())); } Frontend.RunMultipleAction(VdcActionType.EnableGlusterHook, list); }

Target:
private void enableHook() { if (getEntity() == null || getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ArrayList<VdcActionParametersBase> list = new ArrayList<VdcActionParametersBase>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(new GlusterHookParameters(getEntity().getId(), hook.getId())); } Frontend.RunMultipleAction(VdcActionType.EnableGlusterHook, list, null, null); }
Source:
public byte[] transform(String name, String transformedName, byte[] basicClass) { if (TrackerRegistry.TRACKER_CLASSES.contains(name)) { return basicClass; } final ClassReader classReader = new ClassReader(basicClass); final ClassNode classNode = new ClassNode(ASM5); classReader.accept(classNode, ClassReader.EXPAND_FRAMES); final Set<String> addedMethods = new HashSet<>(); boolean change = false; for (MethodNode methodNode : new ArrayList<>(classNode.methods)) { if (processMethodNode(classNode, methodNode, addedMethods)) { change = true; } } if (!change) { return basicClass; } final ClassWriter classWriter = new ClassWriter(ASM5); classNode.accept(classWriter); return classWriter.toByteArray(); }

Target:
public byte[] transform(String name, String transformedName, byte[] basicClass) { if (basicClass == null || TrackerRegistry.trackerClasses.contains(name)) { return basicClass; } final ClassReader classReader = new ClassReader(basicClass); final ClassWriter classWriter = new ClassWriter(classReader, 0); final TrackerClassVisitor classVisitor = new TrackerClassVisitor(classWriter); classReader.accept(classVisitor, 0); return classWriter.toByteArray(); }
Source:
protected synchronized void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof BluetoothAdapter) { UID uid = ((BluetoothAdapter) thingHandler).getUID(); ServiceRegistration<?> serviceReg = this.serviceRegs.get(uid); if (serviceReg != null) { serviceReg.unregister(); serviceRegs.remove(uid); } } }

Target:
protected synchronized void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof BluetoothAdapter) { UID uid = ((BluetoothAdapter) thingHandler).getUID(); ServiceRegistration<?> serviceReg = this.serviceRegs.remove(uid); if (serviceReg != null) { serviceReg.unregister(); } } }
Source:
protected FormModelHandler getHandlerForForm( FormDefinition form, Path path ) { FormModelHandler handler = modelHandlerManager.getFormModelHandler( form.getModel().getClass() ); if ( handler == null ) { return null; } handler.init( form.getModel(), path ); return handler; }

Target:
protected FormModelHandler getHandlerForForm( FormDefinition form, Path path ) { Optional<FormModelHandler> optional = Optional.ofNullable( modelHandlerManager.getFormModelHandler( form.getModel().getClass() ) ); if ( optional.isPresent() ) { optional.get().init( form.getModel(), path ); } return optional.orElse( null ); }
Source:
private List<BaseProjectNode> createTopLevelProjectNodes(List<OmniEclipseProject> projects, List<IProject> faultyProjects) { List<BaseProjectNode> allProjectNodes = Lists.newArrayList(); if(this.taskView.getState().isGroupProjects()) { for (OmniEclipseProject project : projects) { if (project.getParent() == null) { OmniGradleProject gradleProject = project.getGradleProject(); Optional<IProject> workspaceProject = CorePlugin.workspaceOperations().findProjectByName(project.getName()); allProjectNodes.add(new ProjectNode(null,project,gradleProject, workspaceProject, isIncludedProject(workspaceProject, project))); } } } else { for (OmniEclipseProject project : projects) { if (project.getParent() == null) { collectProjectNodesRecursively(project, null, allProjectNodes); } } } for (IProject faultyProject : faultyProjects) { allProjectNodes.add(new FaultyProjectNode(faultyProject)); } return allProjectNodes; }

Target:
private List<BaseProjectNode> createTopLevelProjectNodes(List<OmniEclipseProject> projects, List<IProject> faultyProjects) { List<BaseProjectNode> allProjectNodes = Lists.newArrayList(); if (this.taskView.getState().isProjectHierarchyFlattened()) { for (OmniEclipseProject project : projects) { if (project.getParent() == null) { collectProjectNodesRecursively(project, null, allProjectNodes); } } } else { for (OmniEclipseProject project : projects) { if (project.getParent() == null) { OmniGradleProject gradleProject = project.getGradleProject(); Optional<IProject> workspaceProject = CorePlugin.workspaceOperations().findProjectByName(project.getName()); allProjectNodes.add(new ProjectNode(null,project,gradleProject, workspaceProject, isIncludedProject(workspaceProject, project))); } } } for (IProject faultyProject : faultyProjects) { allProjectNodes.add(new FaultyProjectNode(faultyProject)); } return allProjectNodes; }
Source:
void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { FormRecognizerAsyncClient formRecognizerClient = getFormTrainingAsyncClient(httpClient, serviceVersion) .getFormRecognizerAsyncClient(); blankPdfDataRunner(data -> { SyncPoller<OperationResult, List<RecognizedReceipt>> syncPoller = formRecognizerClient.beginRecognizeReceipts( new RecognizeOptions(toFluxByteBuffer(data), BLANK_FORM_FILE_LENGTH) .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeTextContent(false)) .getSyncPoller(); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); }); }

Target:
void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { FormRecognizerAsyncClient formRecognizerClient = getFormTrainingAsyncClient(httpClient, serviceVersion) .getFormRecognizerAsyncClient(); blankPdfDataRunner(data -> { SyncPoller<OperationResult, List<RecognizedReceipt>> syncPoller = formRecognizerClient.beginRecognizeReceipts( new RecognizeOptions(toFluxByteBuffer(data), BLANK_FORM_FILE_LENGTH) .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); }); }
Source:
public void DeleteAndRestoreMapTests_003_DeleteMapByNotOwner() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName2, credentials.password2, wikiURL); InteractiveMapPageObject selectedMap = base.openInteractiveMapById(wikiURL, InteractiveMapsContent.mapToDeleteAndRestore); String tryDeleteMapId = selectedMap.getEmbedMapID(); DeleteAMapComponentObject deleteMapModal = selectedMap.deleteMap(); deleteMapModal.clickDeleteMap(); deleteMapModal.verifyDeleteMapError(); }

Target:
public void DeleteAndRestoreMapTests_003_DeleteMapByNotOwner() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName2, credentials.password2, wikiURL); InteractiveMapPageObject selectedMap = base.openInteractiveMapById(wikiURL, InteractiveMapsContent.mapToDeleteAndRestore[1]); DeleteAMapComponentObject deleteMapModal = selectedMap.deleteMap(); deleteMapModal.clickDeleteMap(); Assertion.assertEquals(InteractiveMapsContent.mapDeleteError, deleteMapModal.getDeleteMapError()); }
Source:
public static ObjectMapper getMsbJsonObjectMapper() { ObjectMapper mapper = new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .setSerializationInclusion(JsonInclude.Include.NON_NULL) .registerModule(new JSR310Module()); mapper.setVisibilityChecker(mapper.getSerializationConfig().getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) .withGetterVisibility(JsonAutoDetect.Visibility.NONE) .withSetterVisibility(JsonAutoDetect.Visibility.NONE)); return mapper; }

Target:
public static ObjectMapper getMsbJsonObjectMapper() { return new ObjectMapper() .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .setSerializationInclusion(JsonInclude.Include.NON_NULL) .registerModule(new JSR310Module()) .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); }
Source:
protected <T> T parseResponseStreamAndClose(InputStream inputStream, Class<T> clazz) throws IOException { try (InputStreamReader reader = new InputStreamReader(inputStream)) { T objectFromJson = GSON.fromJson(reader, clazz); if (objectFromJson == null) { throw new IOException("Docker responded with an empty stream."); } return objectFromJson; } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }

Target:
protected <T> T parseResponseStreamAndClose(InputStream inputStream, Class<T> clazz) throws IOException { try (InputStreamReader reader = new InputStreamReader(inputStream)) { T objectFromJson = GSON.fromJson(reader, clazz); if (objectFromJson == null) { LOG.error("Docker response doesn't contain any data, though it was expected to contain some."); throw new IOException("Internal server error. Unexpected response body received from Docker."); } return objectFromJson; } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }
Source:
public Trigger getTrigger( @NonNull String triggerID) throws ThingIFException { if (this.target == null) { throw new IllegalStateException("Can not perform this action before onboarding"); } if (TextUtils.isEmpty(triggerID)) { throw new IllegalArgumentException("triggerID is null or empty"); } String path = MessageFormat.format("/thing-if/apps/{0}/targets/{1}/triggers/{2}", this.app.getAppID(), this.target.getTypedID().toString(), triggerID); String url = Path.combine(this.app.getBaseUrl(), path); Map<String, String> headers = this.newHeader(); IoTRestRequest request = new IoTRestRequest(url, IoTRestRequest.Method.GET, headers); JSONObject responseBody = this.restClient.sendRequest(request); try { Trigger trigger = this.gson.fromJson(responseBody.toString(), Trigger.class); TriggerUtils.setTargetID(trigger, this.target.getTypedID()); return trigger; }catch (JsonParseException ex) { if (ex.getCause() instanceof ThingIFException) { throw (ThingIFException) ex.getCause(); } else { throw ex; } } }

Target:
public Trigger getTrigger( @NonNull String triggerID) throws ThingIFException { if (this.target == null) { throw new IllegalStateException("Can not perform this action before onboarding"); } if (TextUtils.isEmpty(triggerID)) { throw new IllegalArgumentException("triggerID is null or empty"); } String path = MessageFormat.format("/thing-if/apps/{0}/targets/{1}/triggers/{2}", this.app.getAppID(), this.target.getTypedID().toString(), triggerID); String url = Path.combine(this.app.getBaseUrl(), path); Map<String, String> headers = this.newHeader(); IoTRestRequest request = new IoTRestRequest(url, IoTRestRequest.Method.GET, headers); JSONObject responseBody = this.restClient.sendRequest(request); JsonObject triggerJson = new JsonParser().parse(responseBody.toString()).getAsJsonObject(); triggerJson.add("targetID", gson.toJsonTree(this.target.getTypedID())); try { return this.gson.fromJson(triggerJson, Trigger.class); }catch (JsonParseException ex) { if (ex.getCause() instanceof ThingIFException) { throw (ThingIFException) ex.getCause(); } else { throw ex; } } }
Source:
public void testAllColumns(String searchTerm) throws DAOException { final String filter = ALL_COLUMNS.getFilterName(); HomePage homePage = new HomePage(driver); User admin = DBUtility.getAdmin(); UserInfoPage userInfoPage = homePage.logIn(admin.getLogin(), admin.getPassword()); AdministrationPage administrationPage = userInfoPage.clickAdministrationTab(); for (SearchConditions conditions : SearchConditions.values()) { administrationPage.setFilters(filter) .setCondition(conditions) .fillSearchField(searchTerm) .clickSearchButton(); usersListFromView = administrationPage.getTableFromView(); administrationPage.clearSearchField(); usersListFromDB = DBUtility.getUserDao().getFilteredUsers(conditions, searchTerm); Comparator<User> userComparator = Comparator.comparing(User::getLogin); Comparator<UserFromView> userFromViewComparator = Comparator.comparing(UserFromView::getLogin); usersListFromDB.sort(userComparator); usersListFromView.sort(userFromViewComparator); loggingSoftAssert.assertTrue(areListsEqual(usersListFromView, usersListFromDB), filter + " " + conditions + " " + searchTerm); loggingSoftAssert.assertAll(); } administrationPage.clickLogOutButton(); }

Target:
public void testAllColumns(String searchTerm) throws DAOException { final SearchFilters filter = ALL_COLUMNS; HomePage homePage = new HomePage(driver); User admin = DBUtility.getAdmin(); UserInfoPage userInfoPage = homePage.logIn(admin.getLogin(), admin.getPassword()); AdministrationPage administrationPage = userInfoPage.clickAdministrationTab(); for (SearchConditions conditions : SearchConditions.values()) { administrationPage.setFilters(filter) .setCondition(conditions) .fillSearchField(searchTerm) .clickSearchButton(); usersListFromView = administrationPage.getTableFromView(); administrationPage.clearSearchField(); usersListFromDB = DBUtility.getUserDao().getFilteredUsers(conditions, searchTerm); Comparator<User> userComparator = Comparator.comparing(User::getLogin); Comparator<UserFromView> userFromViewComparator = Comparator.comparing(UserFromView::getLogin); usersListFromDB.sort(userComparator); usersListFromView.sort(userFromViewComparator); loggingSoftAssert.assertTrue(areListsEqual(usersListFromView, usersListFromDB), filter + " " + conditions + " " + searchTerm); loggingSoftAssert.assertAll(); } administrationPage.clickLogOutButton(); }
Source:
public void tearDown() { try (Closer closer = Closer.create()) { closer.register(clients::clear); for (Entry<String, TransportClient> entry : clients.entrySet()) { closer.register(entry.getValue()); } closer.register(() -> executor.shutdown()); } catch (IOException e) { throw new UncheckedIOException(e); } }

Target:
public void tearDown() { try (Closer closer = Closer.create()) { closer.register(clients::clear); for (Entry<String, TransportClient> entry : clients.entrySet()) { closer.register(entry.getValue()); } closer.register(executor::shutdown); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public void rawPredicate_invalidFieldName() { try { realm.where(AllTypes.class).rawPredicate(("foo = 'test data 0'"); fail(); } catch (IllegalStateException e) { assertEquals("No property 'foo' on object of type 'AllTypes'", e.getMessage()); } }

Target:
public void rawPredicate_invalidFieldName() { try { realm.where(AllTypes.class).rawPredicate("foo = 'test data 0'"); fail(); } catch (IllegalStateException e) { assertEquals("No property 'foo' on object of type 'AllTypes'", e.getMessage()); } }
Source:
public void test_call_java_objects() throws Throwable { Class<?> moduleClass = compileAndLoadGoloModule(SRC, "call-java-objects.golo"); Method new_integer = moduleClass.getMethod("new_integer"); assertThat((Integer) new_integer.invoke(null), is(666)); Method new_integer_from_imports = moduleClass.getMethod("new_integer_from_imports"); assertThat((Integer) new_integer_from_imports.invoke(null), is(666)); Method make_a_list = moduleClass.getMethod("make_a_list"); List<Integer> resultList = (List<Integer>) make_a_list.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); Method make_another_list = moduleClass.getMethod("make_another_list"); resultList = (List<Integer>) make_another_list.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); Method make_another_list_from_array = moduleClass.getMethod("make_another_list_from_array"); resultList = (List<Integer>) make_another_list_from_array.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); Method banged_singleton = moduleClass.getMethod("banged_singleton"); assertThat(banged_singleton.invoke(null),equalTo(banged_singleton.invoke(null))); }

Target:
public void test_call_java_objects() throws Throwable { Class<?> moduleClass = compileAndLoadGoloModule(SRC, "call-java-objects.golo"); Method new_integer = moduleClass.getMethod("new_integer"); assertThat((Integer) new_integer.invoke(null), is(666)); Method new_integer_from_imports = moduleClass.getMethod("new_integer_from_imports"); assertThat((Integer) new_integer_from_imports.invoke(null), is(666)); Method make_a_list = moduleClass.getMethod("make_a_list"); List<Integer> resultList = (List<Integer>) make_a_list.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); Method make_another_list = moduleClass.getMethod("make_another_list"); resultList = (List<Integer>) make_another_list.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); Method make_another_list_from_array = moduleClass.getMethod("make_another_list_from_array"); resultList = (List<Integer>) make_another_list_from_array.invoke(null); assertThat(resultList.size(), is(3)); assertThat(resultList, hasItems(1, 2, 3)); }
Source:
protected Reader getContentReader( String mid, IResource resource, HttpServletRequest request, List<ICacheKeyGenerator> keyGens) throws IOException { String less = readToString(resource.getReader()); LessEngine engine = new LessEngine(); try { return new StringReader(engine.compile(less, resource.getURI().toString (), compress)); } catch (LessException e) { e.printStackTrace(); } return new StringReader(" \n" + less); }

Target:
protected Reader getContentReader(String mid, IResource resource, HttpServletRequest request, List<ICacheKeyGenerator> keyGens) throws IOException { String less = readToString(resource.getReader()); try { return processCss(resource, request, LESS_ENGINE.compile(less, resource.getURI().toString())); } catch (LessException e) { throw new RuntimeException(e); } }
Source:
public RuleMatch[] match(AnalyzedSentence sentence) { List<RuleMatch> matches = new ArrayList<>(); AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace(); for (int i = 0; i < tokens.length; i++) { List<String> l = new ArrayList<>(); int j = 0; while (l.size() < maxLen && i+j < tokens.length) { l.add(tokens[i+j].getToken()); j++; String phrase = String.join(" ", l); String lcPhrase = phrase.toLowerCase(); String properSpelling = lcToProperSpelling.get(lcPhrase); if (properSpelling != null && !Utils.isAllUppercase(phrase) && !phrase.equals(properSpelling)) { if (i > 0 && tokens[i-1].isSentenceStart() && !Utils.startsWithUppercase(properSpelling)) { continue; } String msg; if (allWordsUppercase(properSpelling)) { msg = "If the term is a proper noun, use initial capitals."; } else { msg = "If the term is a proper noun, use the suggested capitalization."; } RuleMatch match = new RuleMatch(this, sentence, tokens[i].getStartPos(), tokens[i].getStartPos() + phrase.length(), msg); match.setSuggestedReplacement(properSpelling); matches.add(match); } } } return toRuleMatchArray(matches); }

Target:
public RuleMatch[] match(AnalyzedSentence sentence) { List<RuleMatch> matches = new ArrayList<>(); AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace(); for (int i = 0; i < tokens.length; i++) { List<String> l = new ArrayList<>(); int j = 0; while (l.size() < maxLen && i+j < tokens.length) { l.add(tokens[i+j].getToken()); j++; String phrase = String.join(" ", l); String lcPhrase = phrase.toLowerCase(); String properSpelling = lcToProperSpelling.get(lcPhrase); if (properSpelling != null && !Utils.isAllUppercase(phrase) && !phrase.equals(properSpelling)) { if (i > 0 && tokens[i-1].isSentenceStart() && !Utils.startsWithUppercase(properSpelling)) { continue; } String msg; if (allWordsUppercase(properSpelling)) { msg = "Más ainmfhocal dílis é, scríobh é i gceannlitreacha."; } else { msg = "If the term is a proper noun, use the suggested capitalization."; } RuleMatch match = new RuleMatch(this, sentence, tokens[i].getStartPos(), tokens[i].getStartPos() + phrase.length(), msg); match.setSuggestedReplacement(properSpelling); matches.add(match); } } } return toRuleMatchArray(matches); }
Source:
private List<FeatureCollection> execute(GetFeatureInfoRequest request) throws Exception { final List<MapLayerInfo> requestedLayers = request.getQueryLayers(); FeatureInfoRequestParameters requestParams = new FeatureInfoRequestParameters(request); if (!ClipWMSGetMapCallBack.validateClipParam(requestParams)) { return Collections.EMPTY_LIST; } List<FeatureCollection> results = new ArrayList<FeatureCollection>(requestedLayers.size()); int maxFeatures = request.getFeatureCount(); List<LayerIdentifier> identifiers = GeoServerExtensions.extensions(LayerIdentifier.class); for (int i = 0; i < requestedLayers.size(); i++) { final MapLayerInfo layer = requestedLayers.get(i); try { LayerIdentifier identifier = getLayerIdentifier(layer, identifiers); List<FeatureCollection> identifiedCollections = identifier.identify(requestParams, maxFeatures); if (identifiedCollections != null) { for (FeatureCollection identifierCollection : identifiedCollections) { FeatureCollection fc = selectProperties(requestParams, identifierCollection); maxFeatures = addToResults(fc, results, layer, request, maxFeatures); } if (maxFeatures <= 0) { break; } } } catch (Exception e) { throw new ServiceException( "Failed to run GetFeatureInfo on layer " + layer.getName(), e); } requestParams.nextLayer(); } return results; }

Target:
private List<FeatureCollection> execute(GetFeatureInfoRequest request) throws Exception { final List<MapLayerInfo> requestedLayers = request.getQueryLayers(); FeatureInfoRequestParameters requestParams = new FeatureInfoRequestParameters(request); List<FeatureCollection> results = new ArrayList<FeatureCollection>(requestedLayers.size()); int maxFeatures = request.getFeatureCount(); List<LayerIdentifier> identifiers = GeoServerExtensions.extensions(LayerIdentifier.class); for (int i = 0; i < requestedLayers.size(); i++) { final MapLayerInfo layer = requestedLayers.get(i); try { LayerIdentifier identifier = getLayerIdentifier(layer, identifiers); List<FeatureCollection> identifiedCollections = identifier.identify(requestParams, maxFeatures); if (identifiedCollections != null) { for (FeatureCollection identifierCollection : identifiedCollections) { FeatureCollection fc = selectProperties(requestParams, identifierCollection); maxFeatures = addToResults(fc, results, layer, request, maxFeatures); } if (maxFeatures <= 0) { break; } } } catch (Exception e) { throw new ServiceException( "Failed to run GetFeatureInfo on layer " + layer.getName(), e); } requestParams.nextLayer(); } return results; }
Source:
void assertParamValues(List<String> expectedValues, String paramName) throws URISyntaxException, InterruptedException { if (this.params == null) { this.params = this.actualParams(); } int paramsFound = 0; for (NameValuePair pair : params) { if (pair.getName().equals(paramName)) { assertEquals(expectedValues.get(paramsFound), pair.getValue()); paramsFound++; } } assertTrue(paramsFound == expectedValues.size()); }

Target:
void assertParamValues(List<String> expectedValues, String paramName) throws URISyntaxException, InterruptedException { if (this.params == null) { this.params = this.actualParams(); } int paramsFound = 0; for (NameValuePair pair : params) { if (pair.getName().equals(paramName)) { assertEquals(expectedValues.get(paramsFound), pair.getValue()); paramsFound++; } } assertEquals(paramsFound, expectedValues.size()); }
Source:
public void mergePatients_shouldChangeUserRecordsOfNonPreferredPersonToPreferredPerson() throws Exception { executeDataSet(USERS_WHO_ARE_PATIENTS_XML); Patient notPreferred = patientService.getPatient(2); voidOrders(Collections.singleton(notPreferred)); Calendar calendar = Calendar.getInstance(); calendar.set(1950, Calendar.FEBRUARY, 2); patientService.getPatient(6).setBirthdate(calendar.getTime()); Context.getPatientService().mergePatients(patientService.getPatient(6), notPreferred); User user = Context.getUserService().getUser(2); Assert.assertEquals(6, user.getPerson().getId().intValue()); }

Target:
public void mergePatients_shouldChangeUserRecordsOfNonPreferredPersonToPreferredPerson() throws Exception { executeDataSet(USERS_WHO_ARE_PATIENTS_XML); Patient notPreferred = patientService.getPatient(2); voidOrders(Collections.singleton(notPreferred)); Context.getPatientService().mergePatients(patientService.getPatient(6), notPreferred); User user = Context.getUserService().getUser(2); Assert.assertEquals(6, user.getPerson().getId().intValue()); }
Source:
public void testTenantContextUnLoadInTenantIdle() throws LazyLoadingTestException { assertEquals(getTenantStatus(TENANT_DOMAIN_1).isTenantContextLoaded(), true, "Tenant context is not loaded after tenant loginTenantUser"); log.info("Waiting for Tenant context to un-load :" + TENANT_DOMAIN_1); assertEquals(checkTenantAutoUnloading(TENANT_DOMAIN_1), true, "Tenant context is not unloaded after idle time"); }

Target:
public void testTenantContextUnLoadInTenantIdle() throws LazyLoadingTestException { assertTrue(getTenantStatus(tenantDomain1).isTenantContextLoaded(), "Tenant context is not loaded after tenant loginTenantUser"); log.info("Waiting for Tenant context to un-load :" + tenantDomain1); assertTrue(checkTenantAutoUnloading(tenantDomain1), "Tenant context is not unloaded after idle time"); }
Source:
public void hashFirstNRowComponents(int numberOfComponents) { Preconditions.checkState(state == State.DEFINING_ROW_COMPONENTS); Preconditions.checkState(rowComponents.isEmpty(), "hashRowComponent must be the first row component"); numberOfComponentsHashed = numberOfComponents; ignoreHotspottingChecks = true; }

Target:
public void hashFirstNRowComponents(int numberOfComponents) { Preconditions.checkState(numberOfComponents >= 0, "Need to specify a non-negative number of components to hash."); checkHashRowComponentsPreconditions("hashFirstNRowComponents"); numberOfComponentsHashed = numberOfComponents; ignoreHotspottingChecks = true; }