auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Collection<UberfireDock> provideDocks(String perspectiveIdentifier) { List<UberfireDock> result = new ArrayList<>(); if (lastActiveContext == null) { lastActiveContext = dataModelerWBContext.getActiveContext(); } if (isGraphicMode(lastActiveContext)) { result.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", new DefaultPlaceRequest("DroolsDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksDroolsJBPMTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "BRIEFCASE", new DefaultPlaceRequest("JPADomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksPersistenceTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "COG", new DefaultPlaceRequest("AdvancedDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksAdvancedTitle())); if (authorizationManager.authorize(PLANNER_AVAILABLE, sessionInfo.getIdentity())) { result.add(new UberfireDock(UberfireDockPosition.EAST, ImagesResources.INSTANCE.optaPlannerDisabledIcon(), ImagesResources.INSTANCE.optaPlannerEnabledIcon(), new DefaultPlaceRequest("PlannerDomainScreen"), perspectiveIdentifier) .withSize(450).withLabel(constants.DocksOptaPlannerTitle())); } } return result; }

Target:
public Collection<UberfireDock> provideDocks(String perspectiveIdentifier) { List<UberfireDock> result = new ArrayList<>(); if (lastActiveContext == null) { lastActiveContext = dataModelerWBContext.getActiveContext(); } if (isGraphicMode(lastActiveContext)) { result.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", new DefaultPlaceRequest("DroolsDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksDroolsJBPMTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "BRIEFCASE", new DefaultPlaceRequest("JPADomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksPersistenceTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "COG", new DefaultPlaceRequest("AdvancedDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksAdvancedTitle())); if (authorizationManager.authorize(DataModelerFeatures.PLANNER_AVAILABLE, sessionInfo.getIdentity())) { result.add(new UberfireDock(UberfireDockPosition.EAST, ImagesResources.INSTANCE.optaPlannerDisabledIcon(), ImagesResources.INSTANCE.optaPlannerEnabledIcon(), new DefaultPlaceRequest("PlannerDomainScreen"), perspectiveIdentifier) .withSize(450).withLabel(constants.DocksOptaPlannerTitle())); } } return result; }
Source:
public void onMediaUploaded(OnMediaUploaded event) { if (!isAdded() || event.isError() || event.canceled) { return; } if (event.media == null || event.media.getLocalPostId() == 0 || mSite.getId() != event.media.getLocalSiteId()) { return; } PostModel post = mPostStore.getPostByLocalPostId(event.media.getLocalPostId()); if (post != null) { if ((event.media.isError() || event.canceled)){ if (post != null && !UploadService.isPostUploadingOrQueued(post)) { loadPosts(LoadMode.FORCED); } } else { mPostsListAdapter.updateProgressForPost(post); } } }

Target:
public void onMediaUploaded(OnMediaUploaded event) { if (!isAdded() || event.isError() || event.canceled) { return; } if (event.media == null || event.media.getLocalPostId() == 0 || mSite.getId() != event.media.getLocalSiteId()) { return; } PostModel post = mPostStore.getPostByLocalPostId(event.media.getLocalPostId()); if (post != null) { if ((event.media.isError() || event.canceled)){ if (!UploadService.isPostUploadingOrQueued(post)) { loadPosts(LoadMode.FORCED); } } else { mPostsListAdapter.updateProgressForPost(post); } } }
Source:
public void execute() throws MojoExecutionException { if ( "pom".equals( getProject().getPackaging() ) ) { getLog().info( "GWT generateAsync is skipped" ); return; } if (getProject() != null && getGenerateDirectory() != null) { getLog().info( "Anticipate addition of generated directory for automatic integration in eclipse" ); getProject().addCompileSourceRoot(getGenerateDirectory().getAbsolutePath()); } if ( encoding == null ) { getLog().warn( "Encoding is not set, your build will be platform dependent" ); encoding = Charset.defaultCharset().name(); } JavaDocBuilder builder = createJavaDocBuilder(); List<String> sourceRoots = getProject().getCompileSourceRoots(); boolean generated = false; for ( String sourceRoot : sourceRoots ) { try { generated |= scanAndGenerateAsync( new File( sourceRoot ), builder ); } catch ( Throwable e ) { getLog().error( "Failed to generate Async interface", e ); if ( failOnError ) { throw new MojoExecutionException( "Failed to generate Async interface", e ); } } } if ( generated ) { getLog().debug( "add compile source root " + getGenerateDirectory() ); addCompileSourceRoot( getGenerateDirectory() ); } }

Target:
public void execute() throws MojoExecutionException { if ( "pom".equals( getProject().getPackaging() ) ) { getLog().info( "GWT generateAsync is skipped" ); return; } getLog().info( "Anticipate addition of generated directory for automatic integration in eclipse" ); addCompileSourceRoot( getGenerateDirectory() ); if ( encoding == null ) { getLog().warn( "Encoding is not set, your build will be platform dependent" ); encoding = Charset.defaultCharset().name(); } JavaDocBuilder builder = createJavaDocBuilder(); List<String> sourceRoots = getProject().getCompileSourceRoots(); boolean generated = false; for ( String sourceRoot : sourceRoots ) { try { generated |= scanAndGenerateAsync( new File( sourceRoot ), builder ); } catch ( Throwable e ) { getLog().error( "Failed to generate Async interface", e ); if ( failOnError ) { throw new MojoExecutionException( "Failed to generate Async interface", e ); } } } }
Source:
private static Set<String> findExtendedTypes( final Component baseComponent ) { final LinkedList<AbstractType> types = new LinkedList<AbstractType>(); types.add( baseComponent ); final Set<String> typeNames = new LinkedHashSet<String>(); while (!types.isEmpty()) { final AbstractType type = types.removeFirst(); typeNames.add( type.getName() ); if (type instanceof Component) { final Component component = (Component) type; final Component extended = component.getExtendedComponent(); if (extended != null) { types.addLast( extended ); } types.addAll( component.getFacets() ); } else if (type instanceof Facet) { final Facet facet = (Facet) type; types.addAll( facet.getExtendedFacets() ); } } return typeNames; }

Target:
private static Set<String> findExtendedTypes( final Component baseComponent ) { final LinkedList<AbstractType> types = new LinkedList<AbstractType>(); types.addAll(ComponentHelpers.findAllExtendedComponents(baseComponent)); types.addAll(ComponentHelpers.findAllFacets(baseComponent)); final Set<String> typeNames = new LinkedHashSet<String>(); for (final AbstractType type : types) { typeNames.add(type.getName()); } return typeNames; }
Source:
private void onDequeue() { router.metrics.totalOperationsInExecution.incrementAndGet(); if (operationQueueStartTime != null) { long queueTime = System.currentTimeMillis() - operationQueueStartTime; router.metrics.operationQueuingTimeInMs.update(queueTime); logger.trace("Operation spent ms in execution queue", queueTime); router.metrics.operationDequeuingRate.mark(); } else { router.metrics.queueStartTimeNotRecordedError.inc(); } }

Target:
private void onDequeue() { if (operationQueueStartTime != null) { long queueTime = System.currentTimeMillis() - operationQueueStartTime; router.metrics.operationQueuingTimeInMs.update(queueTime); logger.trace("Operation spent ms in execution queue", queueTime); router.metrics.operationDequeuingRate.mark(); } else { router.metrics.queueStartTimeNotRecordedError.inc(); } }
Source:
public boolean equals(final Object obj) { if (!super.equals(obj)) { return false; } if (!(obj instanceof AccessSection)) { return false; } final AccessSection other = (AccessSection) obj; if (permissions.size() != other.permissions.size()) { return false; } final HashSet<Permission> same = new HashSet<Permission>(permissions); final HashSet<Permission> different = new HashSet<Permission>(2 * permissions.size()); different.addAll(permissions); different.addAll(other.permissions); same.retainAll(other.permissions); different.removeAll(same); return different.isEmpty(); }

Target:
public boolean equals(final Object obj) { if (!super.equals(obj) || !(obj instanceof AccessSection)) { return false; } return new HashSet<Permission>(permissions).equals(new HashSet<Permission>( ((AccessSection) obj).permissions)); }
Source:
public void testPullTimeoutAndRetry() throws NetworkException, InterruptedException { final CountDownLatch sendLatch = new CountDownLatch(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT); final long gracePeriod = 1000; final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); return null; }).when(mockSender).sendPullMsg(anyString(), anyObject()); new Thread(() -> { worker.pull(key); }).start(); assertTrue(sendLatch.await(PULL_RETRY_TIMEOUT_MS * ParameterWorkerImpl.MAX_PULL_RETRY_COUNT + gracePeriod, TimeUnit.MILLISECONDS)); verify(mockSender, times(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }

Target:
public void testPullTimeoutAndRetry() throws NetworkException, InterruptedException { final CountDownLatch sendLatch = new CountDownLatch(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT); final long gracePeriodMs = 100; final ExecutorService pool = Executors.newSingleThreadExecutor(); final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); return null; }).when(mockSender).sendPullMsg(anyString(), anyObject()); pool.execute(() -> worker.pull(key)); pool.shutdown(); assertTrue(sendLatch.await((PULL_RETRY_TIMEOUT_MS + gracePeriodMs) * ParameterWorkerImpl.MAX_PULL_RETRY_COUNT, TimeUnit.MILLISECONDS)); verify(mockSender, times(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }
Source:
protected boolean anyTimedOut(List<String> nodesUrl) { boolean timeout = false; for (String nodeUrl : nodesUrl) { timeout = timeout || pnTimeout.get(nodeUrl); } return timeout; }

Target:
protected boolean anyTimedOut(List<String> nodesUrl) { for (String nodeUrl : nodesUrl) { if (pnTimeout.get(nodeUrl)) { return true; } } return false; }
Source:
public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); }

Target:
public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); Group anon = groupService.findByName(context, Group.ANONYMOUS); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(anon.getID(), anon.getName()))); }
Source:
void should_pass_if_duration_has_matching_days() { assertThat(Duration.ofDays(4L)).hasDays(4L); }

Target:
void should_pass_if_duration_has_matching_days() { Duration duration = Duration.ofDays(4L); AbstractDurationAssert<?> durationAssert = assertThat(duration); assertThat(duration).hasDays(4L); }
Source:
public Command(Parcel in) throws Exception{ commandID = in.readString(); this.targetID = in.readParcelable(TypedID.class.getClassLoader()); this.issuerID = in.readParcelable(TypedID.class.getClassLoader()); this.aliasActions = new ArrayList<>(); in.readList(this.aliasActions, AliasAction.class.getClassLoader()); this.aliasActionResults = new ArrayList<>(); in.readList(this.aliasActionResults, AliasActionResult.class.getClassLoader()); this.commandState = (CommandState)in.readSerializable(); this.firedByTriggerID = in.readString(); this.created = (Long)in.readValue(Command.class.getClassLoader()); this.modified = (Long)in.readValue(Command.class.getClassLoader()); this.title = in.readString(); this.description = in.readString(); String metadata = in.readString(); if (!TextUtils.isEmpty(metadata)) { this.metadata = new JSONObject(metadata); }else{ this.metadata = null; } if (this.targetID == null) { throw new IllegalArgumentException("targetID is null"); } if (this.issuerID == null) { throw new IllegalArgumentException("issuerID is null"); } if (this.aliasActions == null || this.aliasActions.size() == 0) { throw new IllegalArgumentException("actions is null or empty"); } }

Target:
public Command(Parcel in) throws Exception{ this.commandID = in.readString(); this.targetID = in.readParcelable(TypedID.class.getClassLoader()); this.issuerID = in.readParcelable(TypedID.class.getClassLoader()); this.aliasActions = new ArrayList<>(); in.readList(this.aliasActions, AliasAction.class.getClassLoader()); this.aliasActionResults = new ArrayList<>(); in.readList(this.aliasActionResults, AliasActionResult.class.getClassLoader()); this.commandState = (CommandState)in.readSerializable(); this.firedByTriggerID = in.readString(); this.created = (Long)in.readValue(Command.class.getClassLoader()); this.modified = (Long)in.readValue(Command.class.getClassLoader()); this.title = in.readString(); this.description = in.readString(); String metadata = in.readString(); if (!TextUtils.isEmpty(metadata)) { this.metadata = new JSONObject(metadata); }else{ this.metadata = null; } if (this.targetID == null) { throw new IllegalArgumentException("targetID is null"); } if (this.issuerID == null) { throw new IllegalArgumentException("issuerID is null"); } if (this.aliasActions == null || this.aliasActions.size() == 0) { throw new IllegalArgumentException("actions is null or empty"); } }
Source:
private boolean checkKeyPermissions(List<KeyOperation> operations, KeyOperation keyOperation) { if (operations.contains(keyOperation)) { return true; } return false; }

Target:
private boolean checkKeyPermissions(List<KeyOperation> operations, KeyOperation keyOperation) { return operations.contains(keyOperation); }
Source:
protected PlannerBenchmarkResult readPlannerBenchmarkResult(File plannerBenchmarkResultFile) { if (!plannerBenchmarkResultFile.exists()) { throw new IllegalArgumentException("The plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ") does not exist."); } PlannerBenchmarkResult plannerBenchmarkResult; Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(plannerBenchmarkResultFile), "UTF-8"); plannerBenchmarkResult = (PlannerBenchmarkResult) xStream.fromXML(reader); } catch (ConversionException e) { logger.warn( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); String benchmarkReportDirectoryName = plannerBenchmarkResultFile.getParentFile().getName(); plannerBenchmarkResult = PlannerBenchmarkResult.createUnmarshallingFailedResult( benchmarkReportDirectoryName); } catch (IOException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } finally { IOUtils.closeQuietly(reader); } plannerBenchmarkResult.setBenchmarkReportDirectory(plannerBenchmarkResultFile.getParentFile()); restoreOmittedBidirectionalFields(plannerBenchmarkResult); return plannerBenchmarkResult; }

Target:
protected PlannerBenchmarkResult readPlannerBenchmarkResult(File plannerBenchmarkResultFile) { if (!plannerBenchmarkResultFile.exists()) { throw new IllegalArgumentException("The plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ") does not exist."); } PlannerBenchmarkResult plannerBenchmarkResult; Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(plannerBenchmarkResultFile), "UTF-8"); plannerBenchmarkResult = (PlannerBenchmarkResult) xStream.fromXML(reader); } catch (ConversionException e) { logger.warn( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); String benchmarkReportDirectoryName = plannerBenchmarkResultFile.getParentFile().getName(); plannerBenchmarkResult = PlannerBenchmarkResult.createUnmarshallingFailedResult( benchmarkReportDirectoryName); } catch (XStreamException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } catch (IOException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } finally { IOUtils.closeQuietly(reader); } plannerBenchmarkResult.setBenchmarkReportDirectory(plannerBenchmarkResultFile.getParentFile()); restoreOmittedBidirectionalFields(plannerBenchmarkResult); return plannerBenchmarkResult; }
Source:
public void saveAllWorlds(boolean dontLog) { if (!enableSaving) { return; } for (WorldServer worldserver : this.worlds) { if (worldserver != null && !worldserver.disableLevelSaving) { if (this.isDedicatedServer() && this.isServerRunning()) { final IMixinWorldServer spongeWorld = (IMixinWorldServer) worldserver; final int autoSaveInterval = spongeWorld.getActiveConfig().getConfig().getWorld().getAutoSaveInterval(); final boolean logAutoSave = spongeWorld.getActiveConfig().getConfig().getLogging().worldAutoSaveLogging(); if (autoSaveInterval <= 0 || ((WorldProperties) worldserver.getWorldInfo()).getSerializationBehavior() != SerializationBehaviors.AUTOMATIC) { if (logAutoSave) { LOGGER.warn("Auto-saving has been disabled for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName() + ". " + "No chunk data will be auto-saved - to re-enable auto-saving set 'auto-save-interval' to a value greater than" + " zero in the corresponding world config."); } continue; } if (this.tickCounter % autoSaveInterval != 0) { continue; } if (logAutoSave) { LOGGER.info("Auto-saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } } else if (!dontLog) { LOGGER.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } try { WorldManager.saveWorld(worldserver, false); } catch (MinecraftException ex) { ex.printStackTrace(); } } } }

Target:
public void saveAllWorlds(boolean dontLog) { if (!this.enableSaving) { return; } for (WorldServer worldserver : this.worlds) { if (worldserver != null && !worldserver.disableLevelSaving) { if (this.isDedicatedServer() && this.isServerRunning()) { final IMixinWorldServer spongeWorld = (IMixinWorldServer) worldserver; final int autoSaveInterval = spongeWorld.getActiveConfig().getConfig().getWorld().getAutoSaveInterval(); final boolean logAutoSave = spongeWorld.getActiveConfig().getConfig().getLogging().worldAutoSaveLogging(); if (autoSaveInterval <= 0 || ((WorldProperties) worldserver.getWorldInfo()).getSerializationBehavior() != SerializationBehaviors.AUTOMATIC) { if (logAutoSave) { LOGGER.warn("Auto-saving has been disabled for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName() + ". " + "No chunk data will be auto-saved - to re-enable auto-saving set 'auto-save-interval' to a value greater than" + " zero in the corresponding world config."); } continue; } if (this.tickCounter % autoSaveInterval != 0) { continue; } if (logAutoSave) { LOGGER.info("Auto-saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } } else if (!dontLog) { LOGGER.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } try { WorldManager.saveWorld(worldserver, false); } catch (MinecraftException ex) { ex.printStackTrace(); } } } }
Source:
public void searchTrucks(final String query) { if (query == null || query.isEmpty()) { forceClusterRender(activeTruckMarkers.values()); } else { Thread t = new Thread(new Runnable() { @Override public void run() { SimpleSearchRequest request = new SimpleSearchRequest(query, null, null); try { SimpleSearchResponse response = searchService.simpleSearch(request); searchResultMarkers = new HashMap<>(); List<SearchResponse> searchResponses = response.searchResponse; for (int i = 0, max = searchResponses.size(); i < max; i++) { String truckId = searchResponses.get(i).truck.id; TruckCluster currentMarker = activeTruckMarkers.get(truckId); if (currentMarker != null) { searchResultMarkers.put(truckId, activeTruckMarkers.get(truckId)); } } getActivity().runOnUiThread(new Runnable() { @Override public void run() { forceClusterRender(searchResultMarkers.values()); } }); } catch (ApiException e) { Timber.e("Got an error while searching for trucks."); } } }); t.start(); } }

Target:
public void searchTrucks(final String query) { if (query == null || query.isEmpty()) { serviceHelper.clearSearchQueryMatches(getActivity()); } else { getActivity().startService(SimpleSearchService.newIntent(getActivity(), query)); } }
Source:
public String getLayoutType(SpaceReference layoutSpaceRef) { BaseObject layoutPropertyObj = getLayoutPropertyObj(layoutSpaceRef); if ((layoutPropertyObj != null) && (layoutPropertyObj.getStringValue( ICellsClassConfig.LAYOUT_TYPE_FIELD) != null)) { return layoutPropertyObj.getStringValue(ICellsClassConfig.LAYOUT_TYPE_FIELD); } return ICellsClassConfig.PAGE_LAYOUT_VALUE; }

Target:
public String getLayoutType(SpaceReference layoutSpaceRef) { BaseObject layoutPropertyObj = getLayoutPropertyObj(layoutSpaceRef); if (layoutPropertyObj != null) { return layoutPropertyObj.getStringValue(ICellsClassConfig.LAYOUT_TYPE_FIELD); } return ICellsClassConfig.PAGE_LAYOUT_VALUE; }
Source:
public InputFormat getInputFormat() throws IOException { if (inputFormat != null) { return inputFormat; } else { try { inputFormat = (FileInputFormat) PigContext.resolveClassName(inputFormatClassName).newInstance(); return inputFormat; } catch (InstantiationException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } catch (IllegalAccessException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } } }

Target:
public InputFormat getInputFormat() throws IOException { try { return (FileInputFormat) PigContext.resolveClassName(inputFormatClassName).newInstance(); } catch (InstantiationException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } catch (IllegalAccessException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } }
Source:
void queueMutations(final MutationSet mutationsToSend) { queueThreadPool.submit(new Runnable() { public void run() { addMutations(mutationsToSend); } }); }

Target:
void queueMutations(final MutationSet mutationsToSend) throws InterruptedException { if (null == mutationsToSend) return; binningThreadPool.execute(new Runnable() { @Override public void run() { if (null != mutationsToSend) { try { log.trace("{} - binning mutations", Thread.currentThread().getName(), mutationsToSend.size()); addMutations(mutationsToSend); } catch (Exception e) { updateUnknownErrors("Error processing mutation set", e); } } } }); }
Source:
public void addTextOutput(TextOutput listener) { listener.onCues(currentCues); textOutputs.add(listener); }

Target:
public void addTextOutput(TextOutput listener) { if(currentCues != null) { listener.onCues(currentCues); } textOutputs.add(listener); }
Source:
public void readGraph() throws IOException { graphStorage.create(1000); processJunctions(); processRoads(); }

Target:
public void readGraph() { graphStorage.create(1000); processJunctions(); processRoads(); }
Source:
InputStream getInputStream() throws IOException; Object getAttribute(String name); void setAttribute(String name, Object value); String getPathInfo(); String getContextPath(); String getServletPath(); StringBuffer getRequestURL(); String getRequestURI(); String getQueryString(); WrappedSession getWrappedSession(); WrappedSession getWrappedSession(boolean allowSessionCreation); String getContentType(); Locale getLocale(); String getRemoteAddr(); boolean isSecure(); String getHeader(String headerName); VaadinService getService(); Cookie[] getCookies(); String getAuthType(); String getRemoteUser(); Principal getUserPrincipal(); boolean isUserInRole(String role); void removeAttribute(String name); Enumeration<String> getAttributeNames(); Enumeration<Locale> getLocales(); String getRemoteHost(); int getRemotePort(); String getCharacterEncoding(); BufferedReader getReader() throws IOException; String getMethod(); long getDateHeader(String name); Enumeration<String> getHeaderNames(); Enumeration<String> getHeaders(String name); static VaadinRequest getCurrent() { return CurrentInstance.get(VaadinRequest.class); }

Target:
InputStream getInputStream() throws IOException; Object getAttribute(String name); void setAttribute(String name, Object value); String getPathInfo(); String getContextPath(); StringBuffer getRequestURL(); String getRequestURI(); String getQueryString(); WrappedSession getWrappedSession(); WrappedSession getWrappedSession(boolean allowSessionCreation); String getContentType(); Locale getLocale(); String getRemoteAddr(); boolean isSecure(); String getHeader(String headerName); VaadinService getService(); Cookie[] getCookies(); String getAuthType(); String getRemoteUser(); Principal getUserPrincipal(); boolean isUserInRole(String role); void removeAttribute(String name); Enumeration<String> getAttributeNames(); Enumeration<Locale> getLocales(); String getRemoteHost(); int getRemotePort(); String getCharacterEncoding(); BufferedReader getReader() throws IOException; String getMethod(); long getDateHeader(String name); Enumeration<String> getHeaderNames(); Enumeration<String> getHeaders(String name); static VaadinRequest getCurrent() { return CurrentInstance.get(VaadinRequest.class); }
Source:
public static void testUpdateFail(String sqlText, List<String> expectedErrors, SpliceWatcher methodWatcher) throws AssertionError { try { methodWatcher.executeUpdate(sqlText); String failMsg = format("Update not expected to succeed.\n%s", sqlText); fail(failMsg); } catch (Exception e) { boolean found = expectedErrors.contains(e.getMessage()); if (!found) fail(format("\n + Unexpected error message: %s + \n", e.getMessage())); } }

Target:
protected void testUpdateFail(String sqlText, List<String> expectedErrors, SpliceWatcher methodWatcher) throws AssertionError { try { methodWatcher.executeUpdate(sqlText); String failMsg = format("Update not expected to succeed.\n%s", sqlText); fail(failMsg); } catch (Exception e) { boolean found = expectedErrors.contains(e.getMessage()); if (!found) fail(format("\n + Unexpected error message: %s + \n", e.getMessage())); } }
Source:
public void run() { InternalMigrationStatus migrationStatus = new VersionOneToVersionTwoMigrationStatus(MigrationStatus.Status.DB_NOT_PRESENT); if (!databasePath.exists()) { onUpdate(migrationStatus); return; } SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); PartialDownloadMigrationExtractor partialDownloadMigrationExtractor = new PartialDownloadMigrationExtractor(database); MigrationExtractor migrationExtractor = new MigrationExtractor(database); DownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); LocalFilesDirectory localFilesDirectory = new AndroidLocalFilesDirectory(context); UnlinkedDataRemover unlinkedDataRemover = new UnlinkedDataRemover(downloadsPersistence, localFilesDirectory); unlinkedDataRemover.remove(); migrationStatus.markAsExtracting(); onUpdate(migrationStatus); Log.d(TAG, "about to extract migrations, time is " + System.nanoTime()); Log.d(TAG, "partial migrations are all EXTRACTED, time is " + System.nanoTime()); migratePartialDownloads(database, partialDownloadMigrationExtractor, downloadsPersistence); migrateCompleteDownloads(migrationStatus, database, migrationExtractor, downloadsPersistence, internalFilePersistence); }

Target:
public void run() { InternalMigrationStatus migrationStatus = new VersionOneToVersionTwoMigrationStatus(MigrationStatus.Status.DB_NOT_PRESENT); if (!databasePath.exists()) { onUpdate(migrationStatus); return; } SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); PartialDownloadMigrationExtractor partialDownloadMigrationExtractor = new PartialDownloadMigrationExtractor(database); MigrationExtractor migrationExtractor = new MigrationExtractor(database); DownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); LocalFilesDirectory localFilesDirectory = new AndroidLocalFilesDirectory(context); UnlinkedDataRemover unlinkedDataRemover = new UnlinkedDataRemover(downloadsPersistence, localFilesDirectory); unlinkedDataRemover.remove(); migrationStatus.markAsExtracting(); onUpdate(migrationStatus); Log.d(TAG, "about to extract migrations, time is " + System.nanoTime()); migratePartialDownloads(database, partialDownloadMigrationExtractor, downloadsPersistence); migrateCompleteDownloads(migrationStatus, database, migrationExtractor, downloadsPersistence, internalFilePersistence); }
Source:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork); getHasMtu().setIsChangable(!externalNetwork); if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : getNetworkClusterList().getItems()) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }

Target:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork); getHasMtu().setIsChangable(!externalNetwork); if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }
Source:
public Iterable<Relationship> expand( Path path, BranchState<Double> state ) { double thisState = state.getState(); thisSideShortest.setValue( thisState ); if ( NoneStrictMath.compare( thisState + otherSideShortest.doubleValue(), shortestSoFar.doubleValue(), epsilon ) > 0 && stopAfterLowestCost ) { return Iterables.resourceIterable( Collections.emptyList() ); } return source.expand( path, state ); }

Target:
public Iterable<Relationship> expand( Path path, BranchState<Double> state ) { double thisState = state.getState(); thisSideShortest.setValue( thisState ); if ( NoneStrictMath.compare( thisState + otherSideShortest.doubleValue(), shortestSoFar.doubleValue(), epsilon ) > 0 && stopAfterLowestCost ) { return Iterables.emptyResourceIterable(); } return source.expand( path, state ); }
Source:
protected boolean finishPage(IRunnableWithProgress runnable) { IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable); try { PlatformUI.getWorkbench().getProgressService() .runInUI(getContainer(), op, ResourcesPlugin.getWorkspace().getRoot()); } catch (InvocationTargetException e) { return false; } catch (InterruptedException e) { return false; } return true; }

Target:
protected boolean finishPage(IRunnableWithProgress runnable) { IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable); try { PlatformUI.getWorkbench().getProgressService().runInUI( getContainer(), op, ResourcesPlugin.getWorkspace().getRoot()); } catch (InvocationTargetException|InterruptedException e) { return false; } return true; }
Source:
ValidationResult notRemovingLabeledNetworks(NetworkAttachment attachment, Map<String, VdsNetworkInterface> existingNics) { Network removedNetwork = existingNetworkRelatedToAttachment(attachment); if (!NetworkUtils.isLabeled(removedNetwork)) { return ValidationResult.VALID; } VdsNetworkInterface nic = existingNics.get(attachment.getNicName()); if (nic != null && !removedBondVdsNetworkInterfaceMap.containsKey(nic.getName())) { if (NetworkUtils.isLabeled(nic) && nic.getLabels().contains(removedNetwork.getLabel())) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, removedNetwork.getName()); } } return ValidationResult.VALID; }

Target:
ValidationResult notRemovingLabeledNetworks(NetworkAttachment attachment, Map<String, VdsNetworkInterface> existingNics) { Network removedNetwork = existingNetworkRelatedToAttachment(attachment); if (!NetworkUtils.isLabeled(removedNetwork)) { return ValidationResult.VALID; } VdsNetworkInterface nic = existingNics.get(attachment.getNicName()); if (nic != null && !removedBondVdsNetworkInterfaceMap.containsKey(nic.getName())) { if (NetworkUtils.isLabeled(nic) && nic.getLabels().contains(removedNetwork.getLabel())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, removedNetwork.getName()); } } return ValidationResult.VALID; }
Source:
public Iterator<T> iterator() { Iterator<T> inputIterator = fInputBuffer.iterator(); Iterator<T> queueIterator = Iterables.concat(fInnerQueue).iterator(); Iterator<T> outputIterator = fOutputBuffer.iterator(); return checkNotNull(Iterators.concat(inputIterator, queueIterator, outputIterator)); }

Target:
public Iterator<T> iterator() { return new Itr(); }
Source:
private void addMismatchReason(String reason) { if (_mismatchReason.length() > 0) { _mismatchReason.append(" "); } _mismatchReason.append(reason); }

Target:
public void addMismatchReason(String reason) { incrementMismatchCount(); addMismatchReasonInternal(reason); }
Source:
public void testBlobIdNotValid() throws Exception { ifServerRespond = true; initialize("9"); future = router.deleteBlob("123", new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (ExecutionException e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } future = router.deleteBlob("", new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Error is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } future = router.deleteBlob(null, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Error is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } assertCloseCleanup(); }

Target:
public void testBlobIdNotValid() throws Exception { String[] input = {"123", "abcd", "", "/", null}; for (String s : input) { future = router.deleteBlob(s, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } } }
Source:
public static <A, B> Ord<Either<A, B>> eitherOrd(final Ord<A> oa, final Ord<B> ob) { return new Ord<Either<A, B>>(e1 -> e2 -> e1.isLeft() ? e2.isLeft() ? oa.f.f(e1.left().value()).f(e2.left().value()) : Ordering.LT : e2.isLeft() ? Ordering.GT : ob.f.f(e1.right().value()).f(e2.right().value())); }

Target:
public static <A, B> Ord<Either<A, B>> eitherOrd(final Ord<A> oa, final Ord<B> ob) { return ord(e1 -> e2 -> e1.isLeft() ? e2.isLeft() ? oa.f.f(e1.left().value()).f(e2.left().value()) : Ordering.LT : e2.isLeft() ? Ordering.GT : ob.f.f(e1.right().value()).f(e2.right().value())); }
Source:
public Mono<DocumentResultCollection<DetectLanguageResult>> detectLanguages(List<String> textInputs) { return detectLanguagesWithResponse(textInputs, defaultCountryHint).flatMap(FluxUtil::toMono); }

Target:
public Mono<DocumentResultCollection<DetectLanguageResult>> detectLanguages(List<String> textInputs) { try { return detectLanguagesWithResponse(textInputs, defaultCountryHint).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { SavedPage dummyPage = new SavedPage(callingFragment.getTitle(), null); String selection = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelection(dummyPage, SavedPage.PERSISTENCE_HELPER.SELECTION_KEYS); String[] selectionArgs = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelectionArgs(dummyPage); return new CursorLoader( callingFragment.getActivity(), Uri.parse(SavedPage.PERSISTENCE_HELPER.getBaseContentURI().toString()), null, selection, selectionArgs, null); }

Target:
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { SavedPage dummyPage = new SavedPage(callingFragment.getTitle(), null); String selection = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelection(dummyPage, SavedPage.PERSISTENCE_HELPER.SELECTION_KEYS); String[] selectionArgs = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelectionArgs(dummyPage); return new CursorLoader( context, Uri.parse(SavedPage.PERSISTENCE_HELPER.getBaseContentURI().toString()), null, selection, selectionArgs, null); }
Source:
MergeOp(final GitRepositoryManager grm, final SchemaFactory<ReviewDb> sf, final ProjectCache pc, final FunctionState.Factory fs, final GitReferenceUpdated rq, final MergedSender.Factory msf, final MergeFailSender.Factory mfsf, @CanonicalWebUrl @Nullable final Provider<String> cwu, final ApprovalTypes approvalTypes, final PatchSetInfoFactory psif, final IdentifiedUser.GenericFactory iuf, final ChangeControl.GenericFactory changeControlFactory, @GerritPersonIdent final PersonIdent myIdent, final MergeQueue mergeQueue, @Assisted final Branch.NameKey branch, final ChangeHooks hooks, final AccountCache accountCache, final TagCache tagCache, final CreateCodeReviewNotes.Factory crnf, final SubmoduleOp.Factory subOpFactory, final WorkQueue workQueue, final RequestScopePropagator requestScopePropagator) { repoManager = grm; schemaFactory = sf; functionState = fs; projectCache = pc; replication = rq; mergedSenderFactory = msf; mergeFailSenderFactory = mfsf; urlProvider = cwu; this.approvalTypes = approvalTypes; patchSetInfoFactory = psif; identifiedUserFactory = iuf; this.changeControlFactory = changeControlFactory; this.mergeQueue = mergeQueue; this.hooks = hooks; this.accountCache = accountCache; this.tagCache = tagCache; codeReviewNotesFactory = crnf; this.subOpFactory = subOpFactory; this.workQueue = workQueue; this.requestScopePropagator = requestScopePropagator; this.myIdent = myIdent; destBranch = branch; toMerge = new ArrayList<CodeReviewCommit>(); commits = new HashMap<Change.Id, CodeReviewCommit>(); random = new Random(); }

Target:
MergeOp(final GitRepositoryManager grm, final SchemaFactory<ReviewDb> sf, final ProjectCache pc, final FunctionState.Factory fs, final GitReferenceUpdated rq, final MergedSender.Factory msf, final MergeFailSender.Factory mfsf, @CanonicalWebUrl @Nullable final Provider<String> cwu, final ApprovalTypes approvalTypes, final PatchSetInfoFactory psif, final IdentifiedUser.GenericFactory iuf, final ChangeControl.GenericFactory changeControlFactory, @GerritPersonIdent final PersonIdent myIdent, final MergeQueue mergeQueue, @Assisted final Branch.NameKey branch, final ChangeHooks hooks, final AccountCache accountCache, final TagCache tagCache, final CreateCodeReviewNotes.Factory crnf, final SubmoduleOp.Factory subOpFactory, final WorkQueue workQueue, final RequestScopePropagator requestScopePropagator) { repoManager = grm; schemaFactory = sf; functionState = fs; projectCache = pc; replication = rq; mergedSenderFactory = msf; mergeFailSenderFactory = mfsf; urlProvider = cwu; this.approvalTypes = approvalTypes; patchSetInfoFactory = psif; identifiedUserFactory = iuf; this.changeControlFactory = changeControlFactory; this.mergeQueue = mergeQueue; this.hooks = hooks; this.accountCache = accountCache; this.tagCache = tagCache; codeReviewNotesFactory = crnf; this.subOpFactory = subOpFactory; this.workQueue = workQueue; this.requestScopePropagator = requestScopePropagator; this.myIdent = myIdent; destBranch = branch; toMerge = new ArrayList<CodeReviewCommit>(); commits = new HashMap<Change.Id, CodeReviewCommit>(); }
Source:
protected List<List<LongArrayList>> purgePLIEntries() { List<List<LongArrayList>> pliList = new ArrayList<>(); Iterator<HashMap<String, LongArrayList>> columnsIterator = columns.iterator(); while (columnsIterator.hasNext()) { List<LongArrayList> clusters = new ArrayList<>(); for (LongArrayList cluster : columnsIterator.next().values()) { if (cluster.size() < 2) { continue; } clusters.add(cluster); } pliList.add(clusters); columnsIterator.remove(); } return pliList; }

Target:
protected List<List<LongArrayList>> purgePLIEntries() { List<List<LongArrayList>> rawPLIList = new ArrayList<>(); Iterator<HashMap<String, LongArrayList>> columnsIterator = columns.iterator(); while (columnsIterator.hasNext()) { List<LongArrayList> clusters = new ArrayList<>(); for (LongArrayList cluster : columnsIterator.next().values()) { if (cluster.size() < 2) { continue; } clusters.add(cluster); } rawPLIList.add(clusters); columnsIterator.remove(); } return rawPLIList; }
Source:
public void testEnableRule() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); settings.enableRule(RULE); assertThat(settings.isRuleActive(RULE)).isEqualTo(true); }

Target:
public void testEnableRule() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); settings.enableRule(RULE); assertThat(settings.isRuleExplicitlyDisabled(RULE)).isFalse(); }
Source:
public void deleteRow(String component1) { SchemaApiTestTable.SchemaApiTestRow row = SchemaApiTestTable.SchemaApiTestRow.of(component1); byte[] rowBytes = row.persistToBytes(); Set<Cell> cells = new HashSet<>(); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("c"))); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("d"))); t.delete(tableRef, cells); }

Target:
public void deleteRow(String component1) { SchemaApiTestTable.SchemaApiTestRow row = SchemaApiTestTable.SchemaApiTestRow.of(component1); byte[] rowBytes = row.persistToBytes(); Set<Cell> cells = Sets.newHashSetWithExpectedSize(2); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("c"))); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("d"))); t.delete(tableRef, cells); }
Source:
public MapSqlParameterMapper<GlusterVolumeEntity> getBatchMapper() { throw new RuntimeException("Unsupported operation"); }

Target:
public MapSqlParameterMapper<GlusterVolumeEntity> getBatchMapper() { throw new NotImplementedException("Unsupported operation"); }
Source:
protected void removeItemFromArrayProperty(DocumentModel doc, Property property) { if (index != null) { Serializable[] value = (Serializable[]) property.getValue(); List<Serializable> list = new ArrayList<>(Arrays.asList(value)); list.remove(index.intValue()); doc.setPropertyValue(xpath, list.toArray(new Serializable[0])); } else { doc.setPropertyValue(xpath, null); } }

Target:
protected void removeItemFromArrayProperty(DocumentModel doc, Property property) { if (index != null) { Serializable[] value = (Serializable[]) property.getValue(); List<Serializable> list = new ArrayList<>(Arrays.asList(value)); list.remove(index.intValue()); doc.setPropertyValue(xpath, (Serializable) list); } else { doc.setPropertyValue(xpath, null); } }
Source:
public Void call() throws Exception { OzoneConfiguration ozoneConfiguration = createOzoneConfiguration(); OzoneConfigurationProvider.setConfiguration(ozoneConfiguration); JooqConfigurationProvider.setConfiguration(sqlConfiguration); injector = Guice.createInjector(new ReconControllerModule(), new ReconRestServletModule() { @Override protected void configureServlets() { rest("/api/*") .packages("org.apache.hadoop.ozone.recon.api"); } }); ReconGuiceServletContextListener.setInjector(injector); LOG.info("Initializing Recon server..."); try { StatsSchemaDefinition statsSchemaDefinition = injector.getInstance( StatsSchemaDefinition.class); statsSchemaDefinition.initializeSchema(); UtilizationSchemaDefinition utilizationSchemaDefinition = injector.getInstance(UtilizationSchemaDefinition.class); utilizationSchemaDefinition.initializeSchema(); ReconInternalSchemaDefinition reconInternalSchemaDefinition = injector.getInstance(ReconInternalSchemaDefinition.class); reconInternalSchemaDefinition.initializeSchema(); LOG.info("Recon server initialized successfully!"); } catch (Exception e) { LOG.error("Error during initializing Recon server.", e); } httpServer = injector.getInstance(ReconHttpServer.class); LOG.info("Starting Recon server"); httpServer.start(); scheduleReconTasks(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { stop(); } catch (Exception e) { LOG.error("Error during stop Recon server", e); } })); return null; }

Target:
public Void call() throws Exception { OzoneConfiguration ozoneConfiguration = createOzoneConfiguration(); OzoneConfigurationProvider.setConfiguration(ozoneConfiguration); injector = Guice.createInjector(new ReconControllerModule(), new ReconRestServletModule() { @Override protected void configureServlets() { rest("/api/*") .packages("org.apache.hadoop.ozone.recon.api"); } }); ReconGuiceServletContextListener.setInjector(injector); LOG.info("Initializing Recon server..."); try { StatsSchemaDefinition statsSchemaDefinition = injector.getInstance( StatsSchemaDefinition.class); statsSchemaDefinition.initializeSchema(); UtilizationSchemaDefinition utilizationSchemaDefinition = injector.getInstance(UtilizationSchemaDefinition.class); utilizationSchemaDefinition.initializeSchema(); ReconInternalSchemaDefinition reconInternalSchemaDefinition = injector.getInstance(ReconInternalSchemaDefinition.class); reconInternalSchemaDefinition.initializeSchema(); LOG.info("Recon server initialized successfully!"); } catch (Exception e) { LOG.error("Error during initializing Recon server.", e); } httpServer = injector.getInstance(ReconHttpServer.class); LOG.info("Starting Recon server"); httpServer.start(); scheduleReconTasks(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { stop(); } catch (Exception e) { LOG.error("Error during stop Recon server", e); } })); return null; }