auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setOpenFLPath(String openFLPath) { removeListener(); if (openFLPath.isEmpty()) { openFLPath = "project.xml"; } final VirtualFile projectXmlFile = VirtualFileManager.getInstance().findFileByUrl(openFLPath); if (projectXmlFile != null) { myAdapter = new VirtualFileAdapter() { @Override public void contentsChanged(@NotNull VirtualFileEvent event) { super.contentsChanged(event); if (event.getFile().equals(projectXmlFile)) { HaxeCompilerCompletionContributor.clearOpenFLDisplayArguments(); } } }; VirtualFileManager.getInstance().addVirtualFileListener(myAdapter); } }

Target:
public void setOpenFLPath(String openFLPath) { removeListener(); if (moduleSettings.getBuildConfig() != HaxeModuleSettingsBaseImpl.USE_OPENFL) { return; } if (openFLPath.isEmpty()) { openFLPath = "project.xml"; } final VirtualFile projectXmlFile = VirtualFileManager.getInstance().findFileByUrl(openFLPath); if (projectXmlFile != null) { myAdapter = new VirtualFileAdapter() { @Override public void contentsChanged(@NotNull VirtualFileEvent event) { super.contentsChanged(event); if (event.getFile().equals(projectXmlFile)) { String targetFlag = moduleSettings.getOpenFLTarget().getTargetFlag(); HaxeCompilerCompletionContributor.clearOpenFLDisplayArguments(mMyModule, targetFlag); } } }; VirtualFileManager.getInstance().addVirtualFileListener(myAdapter); } }
Source:
public <S extends ReadSupport> ParquetInputFormat(Class<S> readSupportClass) { this.readSupportClass = readSupportClass; }

Target:
public <S extends ReadSupport<T>> ParquetInputFormat(Class<S> readSupportClass) { this.readSupportClass = readSupportClass; }
Source:
public void stop() { if (System.getenv("ZEPPELIN_FORCE_STOP") != null) { if (isRunning()) { logger.info("Kill interpreter process of interpreter group: " + interpreterGroupId); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { logger.warn("ignore the exception when shutting down interpreter process.", e); } shutdown(); logger.info("Remote process of interpreter group: " + getInterpreterGroupId() + " is terminated"); } } }

Target:
public void stop() { if (System.getenv("ZEPPELIN_FORCE_STOP") != null) { if (isRunning()) { LOGGER.info("Kill interpreter process of interpreter group: {}", interpreterGroupId); try { callRemoteFunction(new RemoteFunction<Void>() { @Override public Void call(RemoteInterpreterService.Client client) throws Exception { client.shutdown(); return null; } }); } catch (Exception e) { LOGGER.warn("ignore the exception when shutting down interpreter process.", e); } shutdown(); LOGGER.info("Remote process of interpreter group: is terminated.", getInterpreterGroupId()); } } }
Source:
private Optional<String> readFromProjectRoot(final String filePath) { try { final File f = new File(filePath); final List<String> lines = IOUtils.readLines(new FileInputStream(f), Charsets.UTF_8); return Optional.of(String.join("\n", lines)); } catch (final IOException e) { return Optional.empty(); } }

Target:
private Optional<String> readFromProjectRoot(final String filePath) { try { final List<String> lines = Files.readAllLines(Paths.get(filePath), StandardCharsets.UTF_8); return Optional.of(String.join("\n", lines)); } catch (final IOException e) { return Optional.empty(); } }
Source:
public void deleteWorkflowRequest(String workflowExtRef) throws APIManagementException { Connection connection = null; PreparedStatement prepStmt = null; String query = SQLConstants.DELETE_WORKFLOW_REQUEST_SQL; try { connection = APIMgtDBUtil.getConnection(); connection.setAutoCommit(false); prepStmt = connection.prepareStatement(query); prepStmt.setString(1, workflowExtRef); prepStmt.executeUpdate(); connection.commit(); } catch (SQLException e) { handleException("Failed to delete the workflow request. ", e); } finally { APIMgtDBUtil.closeAllConnections(prepStmt, connection, null); } }

Target:
public void deleteWorkflowRequest(String workflowExtRef) throws APIManagementException { String query = SQLConstants.DELETE_WORKFLOW_REQUEST_SQL; try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement prepStmt = connection.prepareStatement(query)) { try { connection.setAutoCommit(false); prepStmt.setString(1, workflowExtRef); prepStmt.executeUpdate(); connection.commit(); } catch (SQLException e) { handleException("Failed to delete the workflow request. ", e); } finally { APIMgtDBUtil.closeAllConnections(prepStmt, connection, null); } } catch (SQLException e) { handleException("Failed to delete the workflow request. ", e); } }
Source:
public boolean isEntitySetReady() { return true; }

Target:
public final boolean isEntitySetReady() { synchronized(mPreparationLock) { if(!mEntitySetInitialized) { throw new RuntimeException("A Node Entity Factory was not prepared before usage. prepareEntities() must be called before a call to isEntitySetReady()"); } return isEntitySetReadyInternal(); } }
Source:
private boolean match(final MethodNode methodNode, final String superClassName) { firstIsLoadThis(methodNode); nextIs(Opcodes.ALOAD); nextIs(Opcodes.ILOAD); nextIsInvokeSuper(superClassName, CONSTRUCTOR_DESC); nextIs(Opcodes.RETURN); return cursor != null; }

Target:
private boolean match(final MethodNode methodNode, final String superClassName) { firstIsALoad0(methodNode); nextIs(Opcodes.ALOAD); nextIs(Opcodes.ILOAD); nextIsInvokeSuper(superClassName, CONSTRUCTOR_DESC); nextIs(Opcodes.RETURN); return cursor != null; }
Source:
public void waitForInitialRemoteData_throwsOnTimeout() { RealmLog.setLevel(LogLevel.DEBUG); SyncUser user = UserFactory.createUniqueUser(Constants.AUTH_URL); SyncConfiguration syncConfiguration = configFactory .createSyncConfigurationBuilder(user, Constants.SYNC_SERVER_URL) .initialData(bgRealm -> { for (int i = 0; i < 100; i++) { bgRealm.createObject(AllTypes.class); } }) .waitForInitialRemoteData(1, TimeUnit.MILLISECONDS) .build(); try { Realm.getInstance(syncConfiguration); fail("This should have timed out"); } catch (DownloadingRealmInterruptedException ignore) { } looperThread.testComplete(); }

Target:
public void waitForInitialRemoteData_throwsOnTimeout() { SyncUser user = UserFactory.createUniqueUser(Constants.AUTH_URL); SyncConfiguration syncConfiguration = configFactory .createSyncConfigurationBuilder(user, Constants.SYNC_SERVER_URL) .initialData(bgRealm -> { for (int i = 0; i < 100; i++) { bgRealm.createObject(AllTypes.class); } }) .waitForInitialRemoteData(1, TimeUnit.MILLISECONDS) .build(); try { Realm.getInstance(syncConfiguration); fail("This should have timed out"); } catch (DownloadingRealmInterruptedException ignore) { } looperThread.testComplete(); }
Source:
public static Intent getLaunchIntent(Context context, BoxCollaborationItem collaborationItem, BoxSession session) { if (collaborationItem == null || SdkUtils.isBlank(collaborationItem.getId()) || SdkUtils.isBlank(collaborationItem.getType())) throw new IllegalArgumentException("A valid folder must be provided for retrieving collaborations"); if (session == null || session.getUser() == null || SdkUtils.isBlank(session.getUser().getId())) throw new IllegalArgumentException("A valid user must be provided for retrieving collaborations"); Intent collabIntent = new Intent(context, BoxCollaborationsActivity.class); collabIntent.putExtra(CollaborationUtils.EXTRA_ITEM, collaborationItem); collabIntent.putExtra(CollaborationUtils.EXTRA_USER_ID, session.getUser().getId()); return collabIntent; }

Target:
public static Intent getLaunchIntent(Context context, BoxCollaborationItem collaborationItem, BoxSession session) { if (collaborationItem == null || SdkUtils.isBlank(collaborationItem.getId()) || SdkUtils.isBlank(collaborationItem.getType())) throw new IllegalArgumentException("A valid collaboration item must be provided for retrieving collaborations"); if (session == null || session.getUser() == null || SdkUtils.isBlank(session.getUser().getId())) throw new IllegalArgumentException("A valid user must be provided for retrieving collaborations"); Intent collabIntent = new Intent(context, BoxCollaborationsActivity.class); collabIntent.putExtra(CollaborationUtils.EXTRA_ITEM, collaborationItem); collabIntent.putExtra(CollaborationUtils.EXTRA_USER_ID, session.getUser().getId()); return collabIntent; }
Source:
public void testSynchronousContinuationTokenAlreadyCancelled() { CancellationTokenSource cts = new CancellationTokenSource(); cts.cancel(); Task<Integer> first = Task.forResult(1); Task<Integer> second = first.continueWith(new Continuation<Integer, Integer>() { public Integer then(Task<Integer> task) { return 2; } }, cts.getToken()); assertTrue(first.isCompleted()); assertTrue(second.isCancelled()); }

Target:
public void testSynchronousContinuationTokenAlreadyCancelled() { CancellationTokenSource cts = new CancellationTokenSource(); final Capture<Boolean> continuationRun = new Capture<>(false); cts.cancel(); Task<Integer> first = Task.forResult(1); Task<Integer> second = first.continueWith(new Continuation<Integer, Integer>() { public Integer then(Task<Integer> task) { continuationRun.set(true); return 2; } }, cts.getToken()); assertTrue(first.isCompleted()); assertTrue(second.isCancelled()); assertFalse(continuationRun.get()); }
Source:
public boolean getLastLocation(Position position, Date deviceTime) { boolean found = false; if (position.getDeviceId() != 0) { position.setOutdated(true); Position last = identityManager.getLastPosition(position.getDeviceId()); if (last != null) { position.setFixTime(last.getFixTime()); position.setValid(last.getValid()); position.setLatitude(last.getLatitude()); position.setLongitude(last.getLongitude()); position.setAltitude(last.getAltitude()); position.setSpeed(last.getSpeed()); position.setCourse(last.getCourse()); position.setAccuracy(last.getAccuracy()); found = true; } else { position.setFixTime(new Date(0)); } if (deviceTime != null) { position.setDeviceTime(deviceTime); } else { position.setDeviceTime(new Date()); } } return found; }

Target:
public void getLastLocation(Position position, Date deviceTime) { if (position.getDeviceId() != 0) { position.setOutdated(true); Position last = identityManager.getLastPosition(position.getDeviceId()); if (last != null) { position.setFixTime(last.getFixTime()); position.setValid(last.getValid()); position.setLatitude(last.getLatitude()); position.setLongitude(last.getLongitude()); position.setAltitude(last.getAltitude()); position.setSpeed(last.getSpeed()); position.setCourse(last.getCourse()); position.setAccuracy(last.getAccuracy()); } else { position.setFixTime(new Date(0)); } if (deviceTime != null) { position.setDeviceTime(deviceTime); } else { position.setDeviceTime(new Date()); } } }
Source:
public synchronized URL registerBlob(File file) { URL url = null; for (BlobServer server: servers) { url = server.registerBlob(file); if (url != null) { break; } } if (url != null) { log.info("Registered URL \"" + url + "\" for blob \"" + file.getAbsolutePath() + "\"."); } else { log.warn("Can't generate URL for blob \"" + file.getAbsolutePath() + "\"."); } return url; }

Target:
public URL registerBlob(File file) { BlobServer server = serverReference.get(); if (server == null) { log.error("Can't generate URL for blob \"" + file.getAbsolutePath() + "\" because no server has been registered."); return null; } return server.registerBlob(file); }
Source:
public void activate() { super.activate(); setProperlyConfigured(true); }

Target:
public void activate() { super.activate(); }
Source:
MimeBodyPart(MimeHeader header, Body body) throws MessagingException { this(body); mHeader = header; }

Target:
MimeBodyPart(MimeHeader header, Body body) throws MessagingException { this(body, null, header); }
Source:
public Printer(File inputFile, Severity maxSeverity, Formatter formatter) { this.inputFile = inputFile; this.maxSeverity = maxSeverity; this.formatter = formatter; shouldPrintParseErrorMessage = false; }

Target:
public Printer(File inputFile, Severity maxSeverity, Formatter formatter) { this.inputFile = inputFile; this.maxSeverity = maxSeverity; this.formatter = formatter; }
Source:
public HttpResponseStatus getProxiedOverlordScalingResponseStatus() { try { StatusResponseHolder response = makeRequest( HttpMethod.GET, StringUtils.format( "%s/druid/indexer/v1/scaling", coordinator ) ); return response.getStatus(); } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public HttpResponseStatus getProxiedOverlordScalingResponseStatus() { try { StatusResponseHolder response = makeRequest( HttpMethod.GET, StringUtils.format( "%s/druid/indexer/v1/scaling", coordinator ) ); return response.getStatus(); } catch (Exception e) { throw new RE(e, "Unable to get scaling status from [%s]", coordinator); } }
Source:
public void setCatalogVersion(long conglomerateNumber, String version) throws IOException { TableName tn = tableInfoFactory.getTableInfo(Long.toString(conglomerateNumber)); try { org.apache.hadoop.hbase.client.TableDescriptor td = admin.getDescriptor(tn); ((TableDescriptorBuilder.ModifyableTableDescriptor) td).setValue(SIConstants.CATALOG_VERSION_ATTR, version); boolean tableEnabled = admin.isTableEnabled(tn); if (tableEnabled) { admin.disableTable(tn); } admin.modifyTable(td); } finally { int wait = 0; if (tn != null && !admin.isTableEnabled(tn)) { admin.enableTable(tn); while (wait < 2000 && !admin.isTableEnabled(tn)) { try { Thread.sleep(100); wait++; } catch (InterruptedException e) { throw new IOException(e); } } } } }

Target:
public void setCatalogVersion(long conglomerateNumber, String version) throws IOException { TableName tn = tableInfoFactory.getTableInfo(Long.toString(conglomerateNumber)); try { org.apache.hadoop.hbase.client.TableDescriptor td = admin.getDescriptor(tn); ((TableDescriptorBuilder.ModifyableTableDescriptor) td).setValue(SIConstants.CATALOG_VERSION_ATTR, version); boolean tableEnabled = admin.isTableEnabled(tn); if (tableEnabled) { admin.disableTable(tn); } admin.modifyTable(td); } finally { int wait = 0; if (tn != null && !admin.isTableEnabled(tn)) { admin.enableTable(tn); while (wait < 2000 && !admin.isTableEnabled(tn)) { try { Thread.sleep(100); wait++; } catch (InterruptedException e) { throw new IOException(e); } } } if (!admin.isTableEnabled(tn)) { throw new IOException("Table " + tn.getNameAsString() + " is not enabled"); } } }
Source:
public static void beforeClass() throws Exception { zapInstallDir = Files.createDirectory(tempDir.resolve("install")).toAbsolutePath().toString(); Path xmlDir = Files.createDirectory(tempDir.resolve("install/xml")); Files.createFile(xmlDir.resolve("log4j.properties")); zapHomeDir = Files.createDirectory(tempDir.resolve("home")).toAbsolutePath().toString(); }

Target:
public static void beforeClass() throws Exception { Path installDir = Files.createDirectory(tempDir.resolve("install")); Path xmlDir = Files.createDirectory(installDir.resolve("xml")); Files.createFile(xmlDir.resolve("log4j.properties")); zapInstallDir = installDir.toAbsolutePath().toString(); zapHomeDir = Files.createDirectory(tempDir.resolve("home")).toAbsolutePath().toString(); }
Source:
public int getMonth() { return _calendar.getMonthValue(); }

Target:
public int getMonth() { return date.getMonthValue(); }
Source:
public PackingPlan pack() { while (true) { try { PackingPlanBuilder planBuilder = newPackingPlanBuilder(null); planBuilder.updateNumContainers(numContainers); planBuilder = getResourceCompliantRRAllocation(planBuilder); return planBuilder.build(); } catch (ConstraintViolationException e) { LOG.finest(String.format( "%s Increasing the number of containers to %s and attempting to place again.", e.getMessage(), this.numContainers + 1)); increaseNumContainers(1); resetToFirstContainer(); int totalInstances = TopologyUtils.getTotalInstance(topology); if (numContainers > totalInstances) { throw new PackingException("Cannot add to that container"); } } } }

Target:
public PackingPlan pack() { while (true) { try { PackingPlanBuilder planBuilder = newPackingPlanBuilder(null); planBuilder.updateNumContainers(numContainers); planBuilder = getResourceCompliantRRAllocation(planBuilder); return planBuilder.build(); } catch (ConstraintViolationException e) { LOG.finest(String.format( "%s Increasing the number of containers to %s and attempting to place again.", e.getMessage(), this.numContainers + 1)); retryWithAdditionalContainer(); } } }
Source:
public void thingAdded(Thing thing, ThingTrackerEvent thingTrackerEvent) { this.things.add(thing); logger.debug("Thing '{}' is tracked by ThingManager.", thing.getUID()); if ( storage != null && storage.get(thing.getUID().getAsString()) != null && !storage.get(thing.getUID().getAsString())) { setEnabled(thing.getUID(), false); } if (!isHandlerRegistered(thing)) { registerAndInitializeHandler(thing, getThingHandlerFactory(thing)); } else { logger.debug("Handler of tracked thing '{}' already registered.", thing.getUID()); } }

Target:
public void thingAdded(Thing thing, ThingTrackerEvent thingTrackerEvent) { this.things.add(thing); logger.debug("Thing '{}' is tracked by ThingManager.", thing.getUID()); if (!isHandlerRegistered(thing)) { registerAndInitializeHandler(thing, getThingHandlerFactory(thing)); } else { logger.debug("Handler of tracked thing '{}' already registered.", thing.getUID()); } }
Source:
public DocumentModel run(DocumentModel doc) throws OperationException, IOException { Property complexProperty = doc.getProperty(xpath); ListType ltype = (ListType) complexProperty.getField().getType(); if (!ltype.getFieldType().isComplexType()) { throw new OperationException("Property type is not supported by this operation"); } List<Object> newVals = ComplexTypeJSONDecoder.decodeList(ltype, ComplexJsonProperties); for (Object newVal : newVals) { complexProperty.addValue(newVal); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }

Target:
public DocumentModel run(DocumentModel doc) throws OperationException, IOException { Property complexProperty = doc.getProperty(xpath); ListType listType = (ListType) complexProperty.getField().getType(); if (!listType.getFieldType().isComplexType()) { throw new OperationException("Property type " + listType.getFieldType().getClass().getName() + " is not supported by this operation"); } List<Object> newVals = ComplexTypeJSONDecoder.decodeList(listType, complexJsonProperties); for (Object newVal : newVals) { complexProperty.addValue(newVal); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }
Source:
public String toString() { String[] partitionIdStrings = partitions.stream().map(p -> String.valueOf(p.id)).toArray(String[]::new); return String.format("Host %d sph:%d ha:%s (Partitions %s)", id, haGroup, String.join(",", partitionIdStrings)); }

Target:
public String toString() { String[] partitionIdStrings = partitions.stream().map(p -> String.valueOf(p.id)).toArray(String[]::new); return String.format("Host %d ha:%s (Partitions %s)", id, haGroup, String.join(",", partitionIdStrings)); }
Source:
private void executeFetchCommand(FetchNode node) { CommonUtils.runCommand("org.eclipse.egit.ui.team.SimpleFetch", new StructuredSelection(node)); }

Target:
private void executeFetchCommand(FetchNode node) { CommonUtils.runCommand(ActionCommands.SIMPLE_FETCH_ACTION, new StructuredSelection(node)); }
Source:
public static String setGrade(final Connection conn, final String userId, final String classification, final String itemId, final SrlGrade grade) throws DatabaseAccessException { String result; final String query = "SELECT * FROM Grades WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; try (PreparedStatement stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) { stmt.setString(1, userId); stmt.setString(2, classification); stmt.setString(3, itemId); try (final ResultSet rst = stmt.executeQuery()) { if (rst.next()) { rst.updateFloat("Grade", grade.getGrade()); rst.updateString("Comments", grade.getComment()); rst.updateRow(); result = "SET"; } else { rst.moveToInsertRow(); rst.updateString("UserID", userId); rst.updateString("SchoolItemType", classification); rst.updateString("SchoolItemID", itemId); rst.updateFloat("Grade", grade.getGrade()); rst.updateString("Comments", grade.getComment()); rst.insertRow(); rst.moveToCurrentRow(); result = "INSERT"; } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } return result; }

Target:
public static String setGrade(final Connection conn, final String userId, final String classification, final String itemId, final SrlGrade grade) throws DatabaseAccessException { String result; final String query = "SELECT * FROM Grades WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; try (PreparedStatement stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) { stmt.setString(1, userId); stmt.setString(2, classification); stmt.setString(3, itemId); try (final ResultSet rst = stmt.executeQuery()) { if (rst.next()) { rst.updateFloat(DatabaseStringConstants.GRADE, grade.getGrade()); rst.updateString(DatabaseStringConstants.COMMENTS, grade.getComment()); rst.updateRow(); result = "SET"; } else { rst.moveToInsertRow(); rst.updateString(DatabaseStringConstants.USER_ID, userId); rst.updateString(DatabaseStringConstants.SCHOOLITEMTYPE, classification); rst.updateString(DatabaseStringConstants.SCHOOLITEMID, itemId); rst.updateFloat(DatabaseStringConstants.GRADE, grade.getGrade()); rst.updateString(DatabaseStringConstants.COMMENTS, grade.getComment()); rst.insertRow(); rst.moveToCurrentRow(); result = "INSERT"; } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } return result; }
Source:
public static void afterClass() { SWTBotUtils.deleteProject(TRACE_PROJECT_NAME, fBot); fBot.closeAllEditors(); fLogger.removeAllAppenders(); }

Target:
public static void afterClass() { setTraceTypePreferences(CHECK_ALL); SWTBotUtils.deleteProject(TRACE_PROJECT_NAME, fBot); fBot.closeAllEditors(); fLogger.removeAllAppenders(); }
Source:
private VideoAttributesType generateVideoAttributes(Encoding encoding) { VideoAttributesType videoAttributes = new VideoAttributesType(); videoAttributes.setHorizontalSize(Optional.fromNullable(encoding.getVideoHorizontalSize()) .or(DEFAULT_HORIZONTAL_SIZE)); videoAttributes.setVerticalSize(Optional.fromNullable(encoding.getVideoVerticalSize()) .or(DEFAULT_VERTICAL_SIZE)); AspectRatioType aspectRatio = new AspectRatioType(); aspectRatio.setValue(Objects.firstNonNull(encoding.getVideoAspectRatio(), ASPECT_RATIO)); videoAttributes.getAspectRatio().add(aspectRatio); return videoAttributes; }

Target:
private VideoAttributesType generateVideoAttributes(Encoding encoding) { VideoAttributesType videoAttributes = new VideoAttributesType(); videoAttributes.setHorizontalSize(Objects.firstNonNull(encoding.getVideoHorizontalSize(), DEFAULT_HORIZONTAL_SIZE)); videoAttributes.setVerticalSize(Objects.firstNonNull(encoding.getVideoVerticalSize(), DEFAULT_VERTICAL_SIZE)); AspectRatioType aspectRatio = new AspectRatioType(); aspectRatio.setValue(Objects.firstNonNull(encoding.getVideoAspectRatio(), DEFAULT_ASPECT_RATIO)); videoAttributes.getAspectRatio().add(aspectRatio); return videoAttributes; }
Source:
public void serve() { try { ITransportPlugin transportPlugin = AuthUtils.GetTransportPlugin(_storm_conf, _login_conf); _server = transportPlugin.getServer(_port, _processor); _server.serve(); } catch (Exception ex) { LOG.error("ThriftServer is being stopped due to: " + ex, ex); if (_server != null) _server.stop(); System.exit(1); } }

Target:
public void serve() { try { ITransportPlugin transportPlugin = AuthUtils.GetTransportPlugin(_storm_conf, _login_conf); _server = transportPlugin.getServer(_port, _processor); _server.serve(); } catch (Exception ex) { LOG.error("ThriftServer is being stopped due to: " + ex, ex); if (_server != null) _server.stop(); Runtime.getRuntime().halt(1); } }
Source:
public boolean isInodeIndexedArchived(String inode){ if (!UtilMethods.isSet(inode)) { Logger.warn(this, "Requested Inode is not indexed because Inode is not set"); } return isInodeIndexedWithQuery("+inode:" + inode + String.format(" +deleted:%s",true)); }

Target:
public boolean isInodeIndexedArchived(String inode){ return isInodeIndexedArchived(inode, -1); }
Source:
public Map<String, IdealState> computeNewIdealStates(ResourceControllerDataProvider clusterData, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException, JMException { if (resourceMap.isEmpty()) { LOG.warn("There is no resource to be rebalanced by {}", this.getClass().getSimpleName()); return Collections.emptyMap(); } LOG.info("Start computing new ideal states for resources: {}", resourceMap.keySet().toString()); validateInput(clusterData, resourceMap); Map<String, IdealState> newIdealStates = computeBestPossibleStates(clusterData, resourceMap, currentStateOutput); for (IdealState is : newIdealStates.values()) { String resourceName = is.getResourceName(); ResourceAssignment finalAssignment = _mappingCalculator.computeBestPossiblePartitionState( clusterData, is, resourceMap.get(resourceName), currentStateOutput); is.getRecord().getMapFields().clear(); for (Partition partition : finalAssignment.getMappedPartitions()) { Map<String, String> newStateMap = finalAssignment.getReplicaMap(partition); is.setInstanceStateMap(partition.getPartitionName(), newStateMap == null ? Collections.emptyMap() : newStateMap); } } LOG.info("Finish computing new ideal states for resources: {}", resourceMap.keySet().toString()); _metricCollector.register(); return newIdealStates; }

Target:
public Map<String, IdealState> computeNewIdealStates(ResourceControllerDataProvider clusterData, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException { if (resourceMap.isEmpty()) { LOG.warn("There is no resource to be rebalanced by {}", this.getClass().getSimpleName()); return Collections.emptyMap(); } LOG.info("Start computing new ideal states for resources: {}", resourceMap.keySet().toString()); validateInput(clusterData, resourceMap); Map<String, IdealState> newIdealStates = computeBestPossibleStates(clusterData, resourceMap, currentStateOutput); for (IdealState is : newIdealStates.values()) { String resourceName = is.getResourceName(); ResourceAssignment finalAssignment = _mappingCalculator.computeBestPossiblePartitionState( clusterData, is, resourceMap.get(resourceName), currentStateOutput); is.getRecord().getMapFields().clear(); for (Partition partition : finalAssignment.getMappedPartitions()) { Map<String, String> newStateMap = finalAssignment.getReplicaMap(partition); is.setInstanceStateMap(partition.getPartitionName(), newStateMap == null ? Collections.emptyMap() : newStateMap); } } LOG.info("Finish computing new ideal states for resources: {}", resourceMap.keySet().toString()); return newIdealStates; }
Source:
public static String localizeProvider(String name) { if (name==null) { Assert.isTrue(false); return null; } switch (name) { case DIRECT_PROVIDER: return Messages.ProxySelector_0; case ECLIPSE_PROVIDER: return Messages.ProxySelector_1; case NATIVE_PROVIDER: return Messages.ProxySelector_2; default: break; } Assert.isTrue(false); return null; }

Target:
public static String localizeProvider(String name) { if (name != null) { switch (name) { case DIRECT_PROVIDER: return Messages.ProxySelector_0; case ECLIPSE_PROVIDER: return Messages.ProxySelector_1; case NATIVE_PROVIDER: return Messages.ProxySelector_2; default: break; } } Assert.isTrue(false); return null; }
Source:
public void onLoad(final InterstitialAd ad) { Log.d(TAG, "Interstitial mediation Ad loaded"); if (myTargetView != null) { myTargetView.start(); } listener.onAdLoaded(MyTargetAdapter.this); }

Target:
public void onLoad(final InterstitialAd ad) { Log.d(TAG, "Interstitial mediation Ad loaded"); listener.onAdLoaded(MyTargetAdapter.this); }
Source:
private static String branchToRef(String name) { if (name.startsWith(Branch.R_HEADS)) return Branch.R_HEADS + name; return name; }

Target:
private static String branchToRef(String name) { if (!name.startsWith(Branch.R_HEADS)) return Branch.R_HEADS + name; return name; }
Source:
private String xpath() { return String.format( "/github/repos/repo[@coords='%s']/collaborators/", this.coords ); }

Target:
private String xpath() { return String.format( "/github/repos/repo[@coords='%s']/collaborators", this.coords ); }
Source:
public void onGuiClosed() { NBTTagCompound nbtTagCompound = book.getTagCompound(); nbtTagCompound.setInteger("page", page); nbtTagCompound.setFloat("sliderProgress", sliderProgress); super.onGuiClosed(); }

Target:
public void onGuiClosed() { ItemGuideBook.setCurrentPage(page, sliderProgress, hand); super.onGuiClosed(); }
Source:
public DancerState getDancerState() { return dancerState != null ? dancerState : HAS_TOKEN; }

Target:
public DancerState getDancerState() { return this.dancerState != null ? dancerState : accessToken == null ? NO_TOKEN : HAS_TOKEN; }
Source:
private void updateId() { StringBuilder sb = new StringBuilder(triggerId); sb.append("-").append(triggerMode.ordinal()); sb.append("-").append(conditionSetSize); sb.append("-").append(conditionSetIndex); this.conditionId = sb.toString(); }

Target:
private void updateId() { StringBuilder sb = new StringBuilder(triggerId); sb.append("-").append(triggerMode.name()); sb.append("-").append(conditionSetSize); sb.append("-").append(conditionSetIndex); this.conditionId = sb.toString(); }
Source:
public void sendMessage_shouldFailIfMessageIsNull() throws MessageException { MessageService messageService = Context.getMessageService(); messageService.sendMessage(null); }

Target:
public void sendMessage_shouldFailIfMessageIsNull() throws MessageException { ms.sendMessage(null); }
Source:
private long getNextQueryTime() { if (fCurrent != null) { long endTime = fCurrent.getEndTime(); return (Long.max(endTime + 1, fLastQuery + fResolution)); } return Long.max(fInitialTime, fSS.getStartTime()); }

Target:
private long getNextQueryTime() { if (fCurrent != null) { long endTime = fCurrent.getEndTime(); return (fResolution == 1 ? endTime + 1 : ((endTime - fLastQueriedTime) / fResolution + 1) * fResolution); } return Long.max(fInitialTime, fSS.getStartTime()); }
Source:
public void testAvailableInputLocationRetrieval() { TestingInputsLocationsRetriever originalLocationRetriever = new TestingInputsLocationsRetriever .Builder() .connectConsumerToProducer(EV5, EV1) .connectConsumerToProducer(EV5, EV2) .connectConsumerToProducer(EV5, EV3) .connectConsumerToProducer(EV5, EV4) .build(); originalLocationRetriever.assignTaskManagerLocation(EV1); originalLocationRetriever.markScheduled(EV2); originalLocationRetriever.failTaskManagerLocation(EV3, new Throwable()); originalLocationRetriever.cancelTaskManagerLocation(EV4); SyncPreferredLocationsRetriever locationsRetriever = new DefaultSyncPreferredLocationsRetriever( executionVertexId -> Optional.empty(), originalLocationRetriever); Collection<TaskManagerLocation> preferredLocations = locationsRetriever .getPreferredLocations(EV5, Collections.emptySet()); TaskManagerLocation expectedLocation = originalLocationRetriever .getTaskManagerLocation(EV1) .get() .join(); assertThat(preferredLocations, hasSize(1)); assertThat(preferredLocations.iterator().next(), is(expectedLocation)); }

Target:
public void testAvailableInputLocationRetrieval() { TestingInputsLocationsRetriever originalLocationRetriever = new TestingInputsLocationsRetriever .Builder() .connectConsumerToProducer(EV5, EV1) .connectConsumerToProducer(EV5, EV2) .connectConsumerToProducer(EV5, EV3) .connectConsumerToProducer(EV5, EV4) .build(); originalLocationRetriever.assignTaskManagerLocation(EV1); originalLocationRetriever.markScheduled(EV2); originalLocationRetriever.failTaskManagerLocation(EV3, new Throwable()); originalLocationRetriever.cancelTaskManagerLocation(EV4); SyncPreferredLocationsRetriever locationsRetriever = new DefaultSyncPreferredLocationsRetriever( executionVertexId -> Optional.empty(), originalLocationRetriever); Collection<TaskManagerLocation> preferredLocations = locationsRetriever .getPreferredLocations(EV5, Collections.emptySet()); TaskManagerLocation expectedLocation = originalLocationRetriever .getTaskManagerLocation(EV1) .get() .join(); assertThat(preferredLocations, contains(expectedLocation)); }
Source:
private FTPSClient createSecureClient(boolean setKeystore) throws Exception { FTPSClient ftps = new FTPSClient(); if (setKeystore) { KeyManager keyManager = KeyManagerUtils.createClientKeyManager( new File(System.getProperty("javax.net.ssl.keyStore")), System.getProperty("javax.net.ssl.keyStorePassword")); ftps.setKeyManager(keyManager); } await() .atMost(30, TimeUnit.SECONDS) .pollDelay(1, TimeUnit.SECONDS) .dontCatchUncaughtExceptions() .until( () -> { ftps.connect(FTP_SERVER, Integer.parseInt(FTP_PORT.getPort())); return true; }); showServerReply(ftps); int connectionReply = ftps.getReplyCode(); if (!FTPReply.isPositiveCompletion(connectionReply)) { fail("FTP server refused connection: " + connectionReply); } boolean success = ftps.login(USERNAME, PASSWORD); showServerReply(ftps); if (!success) { fail("Could not log in to the FTP server."); } ftps.enterLocalPassiveMode(); ftps.setControlKeepAliveTimeout(300); ftps.setFileType(FTP.BINARY_FILE_TYPE); return ftps; }

Target:
private FTPSClient createSecureClient(boolean setKeystore) throws Exception { FTPSClient ftps = new FTPSClient(); if (setKeystore) { KeyManager keyManager = KeyManagerUtils.createClientKeyManager( new File(System.getProperty("javax.net.ssl.keyStore")), System.getProperty("javax.net.ssl.keyStorePassword")); ftps.setKeyManager(keyManager); } await() .atMost(30, TimeUnit.SECONDS) .pollDelay(1, TimeUnit.SECONDS) .dontCatchUncaughtExceptions() .until( () -> successfulFtpConnection(ftps, FTP_SERVER, Integer.parseInt(FTP_PORT.getPort()))); showServerReply(ftps); int connectionReply = ftps.getReplyCode(); if (!FTPReply.isPositiveCompletion(connectionReply)) { fail("FTP server refused connection: " + connectionReply); } boolean success = ftps.login(USERNAME, PASSWORD); showServerReply(ftps); if (!success) { fail("Could not log in to the FTP server."); } ftps.enterLocalPassiveMode(); ftps.setControlKeepAliveTimeout(300); ftps.setFileType(FTP.BINARY_FILE_TYPE); return ftps; }
Source:
private Mono<Message<?>> handleSendError(Message<?> requestMessage, Throwable exception) { if (logger.isDebugEnabled()) { logger.debug("failure occurred in gateway sendAndReceiveReactive: " + exception.getMessage()); } MessageChannel errorChannel = getErrorChannel(); if (errorChannel != null) { ErrorMessage errorMessage = buildErrorMessage(requestMessage, exception); try { return doSendAndReceiveMessageReactive(errorChannel, errorMessage, true); } catch (Exception errorFlowFailure) { return Mono.error( new MessagingException(errorMessage, "failure occurred in error-handling flow", errorFlowFailure)); } } else { return Mono.error(wrapExceptionIfNecessary(exception, "gateway received checked Exception")); } }

Target:
private Mono<Message<?>> handleSendError(Message<?> requestMessage, Throwable exception) { if (logger.isDebugEnabled()) { logger.debug("failure occurred in gateway sendAndReceiveReactive: " + exception.getMessage()); } MessageChannel errorChannel = getErrorChannel(); if (errorChannel != null) { ErrorMessage errorMessage = buildErrorMessage(requestMessage, exception); try { return doSendAndReceiveMessageReactive(errorChannel, errorMessage, true); } catch (Exception errorFlowFailure) { throw new MessagingException(errorMessage, "failure occurred in error-handling flow", errorFlowFailure); } } else { throw wrapExceptionIfNecessary(exception, "gateway received checked Exception"); } }
Source:
private void insertLinks() { Props azkProps = AzkabanExecutorServer.getApp().getAzkabanProps(); String baseURL = azkProps.get("azkaban.webserver.url"); if (baseURL == null) return; String flowName = node.getParentFlow().getFlowId(); String projectName = node.getParentFlow().getProjectName(); props.put(CommonJobProperties.EXECUTION_LINK, String.format("%s/executor?execid=%d", baseURL, executionId)); props.put(CommonJobProperties.JOBEXEC_LINK, String.format( "%s/executor?execid=%d&job=%s", baseURL, executionId, jobId)); props.put(CommonJobProperties.ATTEMPT_LINK, String.format( "%s/executor?execid=%d&job=%s&attempt=%d", baseURL, executionId, jobId, node.getAttempt())); props.put(CommonJobProperties.WORKFLOW_LINK, String.format( "%s/manager?project=%s&flow=%s", baseURL, projectName, flowName)); props.put(CommonJobProperties.JOB_LINK, String.format( "%s/manager?project=%s&flow=%s&job=%s", baseURL, projectName, flowName, jobId)); }

Target:
private void insertLinks() { Props azkProps = AzkabanExecutorServer.getApp().getAzkabanProps(); String baseURL = azkProps.get("azkaban.webserver.url"); if (baseURL == null){ return; } String flowName = node.getParentFlow().getFlowId(); String projectName = node.getParentFlow().getProjectName(); props.put(CommonJobProperties.EXECUTION_LINK, String.format("%s/executor?execid=%d", baseURL, executionId)); props.put(CommonJobProperties.JOBEXEC_LINK, String.format( "%s/executor?execid=%d&job=%s", baseURL, executionId, jobId)); props.put(CommonJobProperties.ATTEMPT_LINK, String.format( "%s/executor?execid=%d&job=%s&attempt=%d", baseURL, executionId, jobId, node.getAttempt())); props.put(CommonJobProperties.WORKFLOW_LINK, String.format( "%s/manager?project=%s&flow=%s", baseURL, projectName, flowName)); props.put(CommonJobProperties.JOB_LINK, String.format( "%s/manager?project=%s&flow=%s&job=%s", baseURL, projectName, flowName, jobId)); }
Source:
private void doWhatDoYouDoRequest(VoiceInput voiceInput, SsmlDocumentBuilder builder) { String bot = (String) voiceInput.getMetadata().get("bot"); if(bot == null || bot.isEmpty()){ builder.text("I don't have any info for this situation."); return; } switch(bot){ case "complibot": builder.text("I give you compliments and tell you how awesome you are, ").pause().text("and then I sit quietly and wait for you to talk to me again!").endSentence(); break; case "insultibot": builder.text("I mainly just tell you how awful you are. ").endSentence().text("Now, leave me alone.").endSentence(); break; default: builder.text("I don't have that info for the bot named '" + bot + "'.").endSentence(); return; } }

Target:
private void doWhatDoYouDoRequest(VoiceInput voiceInput, SsmlDocumentBuilder builder) { String bot = (String) voiceInput.getMetadata().get("bot"); if(StringUtils.isEmpty(bot)){ builder.text("I don't have any info for this situation."); return; } switch(bot){ case "complibot": builder.text("I give you compliments and tell you how awesome you are, ").pause().text("and then I sit quietly and wait for you to talk to me again!").endSentence(); break; case "insultibot": builder.text("I mainly just tell you how awful you are. ").endSentence().text("Now, leave me alone.").endSentence(); break; default: builder.text("I don't have any info for the bot named '" + bot + "'.").endSentence(); return; } }
Source:
public void brokerAdded(String brokerId, MqttBrokerConnection broker) { logger.trace("Found broker connection {}", brokerId); Map<String, Object> properties = new HashMap<>(); properties.put("host", broker.getHost()); properties.put("port", broker.getPort()); ThingUID thingUID; thingUID = new ThingUID(MqttBrokerBindingConstants.BRIDGE_TYPE_SYSTEMBROKER, brokerId); thingDiscovered(DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withLabel("Mqtt Broker (" + brokerId + " - " + broker.getHost() + ")").build()); }

Target:
public void brokerAdded(String brokerId, MqttBrokerConnection broker) { logger.trace("Found broker connection {}", brokerId); Map<String, Object> properties = new HashMap<>(); properties.put("host", broker.getHost()); properties.put("port", broker.getPort()); properties.put("brokerid", brokerId); ThingUID thingUID; thingUID = new ThingUID(MqttBindingConstants.BRIDGE_TYPE_SYSTEMBROKER, brokerId); thingDiscovered(DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withRepresentationProperty("brokerid").withLabel("MQTT Broker").build()); }
Source:
void populate(final int row, final PluginInfo plugin) { CheckBox checkBox = new CheckBox(); table.setWidget(row, 1, checkBox); table.setWidget( row, 2, new Anchor(plugin.name(), Gerrit.selfRedirect("/plugins/" + plugin.name() + "/"))); table.setText(row, 3, plugin.version()); if(plugin.isDisabled()) { table.setText(row, 4, Util.C.pluginDisabled()); } final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell()); setRowItem(row, plugin); }

Target:
void populate(final int row, final PluginInfo plugin) { if (plugin.isDisabled()) { table.setText(row, 1, plugin.name()); } else { table.setWidget( row, 1, new Anchor(plugin.name(), Gerrit.selfRedirect("/plugins/" + plugin.name() + "/"))); } table.setText(row, 2, plugin.version()); if (plugin.isDisabled()) { table.setText(row, 3, Util.C.pluginDisabled()); } final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); setRowItem(row, plugin); }
Source:
public static Person fromJSON(JSONObject json, int localTableBlogId) { if (json == null) { return null; } long personID = Long.parseLong(json.optString("ID")); String username = json.optString("login"); String firstName = json.optString("first_name"); String lastName = json.optString("last_name"); String displayName = json.optString("nice_name"); String avatarUrl = json.optString("avatar_URL"); Role role = Role.fromKey(json.optJSONArray("roles").optString(0)); return new Person(personID, localTableBlogId, username, firstName, lastName, displayName, avatarUrl, role); }

Target:
public static Person fromJSON(JSONObject json, int localTableBlogId) { if (json == null) { return null; } try { long personID = Long.parseLong(json.getString("ID")); String username = json.optString("login"); String firstName = json.optString("first_name"); String lastName = json.optString("last_name"); String displayName = json.optString("nice_name"); String avatarUrl = json.optString("avatar_URL"); Role role = Role.fromKey(json.optJSONArray("roles").optString(0)); return new Person(personID, localTableBlogId, username, firstName, lastName, displayName, avatarUrl, role); } catch (JSONException e) { AppLog.e(AppLog.T.PEOPLE, "JSON exception occurred while parsing the user json: " + e); } catch (NumberFormatException e) { AppLog.e(AppLog.T.PEOPLE, "The ID parsed from the JSON couldn't be converted to long: " + e); } return null; }
Source:
protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { if (event == null) throw new IllegalArgumentException("event must not be NULL"); Object selection = ((EvaluationContext) event.getApplicationContext()) .getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (selection == null) selection = ((EvaluationContext) event.getApplicationContext()) .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; if (selection instanceof TextSelection) { try { IEditorInput input = HandlerUtil.getActiveEditorChecked(event) .getEditorInput(); if (input == null) return StructuredSelection.EMPTY; IResource resource = ResourceUtil.getResource(input); if (resource != null) return new StructuredSelection(resource); } catch (ExecutionException e) { } } return StructuredSelection.EMPTY; }

Target:
protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { if (event == null) throw new IllegalArgumentException("event must not be NULL"); Object selection = HandlerUtil.getActiveMenuSelectionChecked(event); if (selection == null) selection = HandlerUtil.getCurrentSelectionChecked(event); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; if (selection instanceof TextSelection) { IEditorInput input = (IEditorInput) HandlerUtil.getVariable(event, ISources.ACTIVE_EDITOR_INPUT_NAME); if (input == null) return StructuredSelection.EMPTY; IResource resource = ResourceUtil.getResource(input); if (resource != null) return new StructuredSelection(resource); } return StructuredSelection.EMPTY; }
Source:
private ValueExtractorDescriptor getMostSpecific(Class<?> valueType, List<ValueExtractorDescriptor> extractors) { Set<ValueExtractorDescriptor> candidates = CollectionHelper.newHashSet( extractors.size() ); for ( ValueExtractorDescriptor descriptor : extractors ) { if ( candidates.size() == 0 ) { candidates.add( descriptor ); continue; } Iterator<ValueExtractorDescriptor> candidatesIterator = candidates.iterator(); boolean isNewRoot = true; while ( candidatesIterator.hasNext() ) { ValueExtractorDescriptor candidate = candidatesIterator.next(); if ( TypeHelper.isAssignable( candidate.getExtractedType(), descriptor.getExtractedType() ) ) { candidatesIterator.remove(); } else if ( TypeHelper.isAssignable( descriptor.getExtractedType(), candidate.getExtractedType() ) ) { isNewRoot = false; } } if ( isNewRoot ) { candidates.add( descriptor ); } } if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 ) { return candidates.iterator().next(); } else { throw LOG.unableToGetMostSpecificValueExtractorDueToSeveralValueExtractorsDefinedForParallelHierarchies( valueType, candidates ); } }

Target:
private ValueExtractorDescriptor getMostSpecific(Class<?> valueType, List<ValueExtractorDescriptor> extractors) { Set<ValueExtractorDescriptor> candidates = CollectionHelper.newHashSet( extractors.size() ); for ( ValueExtractorDescriptor descriptor : extractors ) { if ( candidates.isEmpty() ) { candidates.add( descriptor ); continue; } Iterator<ValueExtractorDescriptor> candidatesIterator = candidates.iterator(); boolean isNewRoot = true; while ( candidatesIterator.hasNext() ) { ValueExtractorDescriptor candidate = candidatesIterator.next(); if ( TypeHelper.isAssignable( candidate.getExtractedType(), descriptor.getExtractedType() ) ) { candidatesIterator.remove(); } else if ( TypeHelper.isAssignable( descriptor.getExtractedType(), candidate.getExtractedType() ) ) { isNewRoot = false; } } if ( isNewRoot ) { candidates.add( descriptor ); } } if ( candidates.isEmpty() ) { return null; } else if ( candidates.size() == 1 ) { return candidates.iterator().next(); } else { @SuppressWarnings("rawtypes") List<Class<? extends ValueExtractor>> valueExtractorCandidates = candidates.stream() .map( valueExtractorDescriptor -> valueExtractorDescriptor.getValueExtractor().getClass() ) .collect( Collectors.toList() ); throw LOG.unableToGetMostSpecificValueExtractorDueToSeveralValueExtractorsDefinedForParallelHierarchies( valueType, valueExtractorCandidates ); } }
Source:
public void testCronExpressionForWeekly() { StorageSyncSchedule schedule = new StorageSyncSchedule(); schedule.setFrequency(Frequency.WEEKLY); schedule.setHour(12); schedule.setMins(50); Day[] days = {Day.FRI, Day.SAT}; schedule.setDays(days); String expectedExpression = "0 50 12 ? * FRI,SAT *"; assertEquals(expectedExpression, schedule.toCronExpression()); List<Class<?>> validationGroup = new ArrayList<>(); List<String> result = ValidationUtils.validateInputs(validationGroup, schedule); assertEquals(true, result.isEmpty()); }

Target:
public void testCronExpressionForWeekly() { StorageSyncSchedule schedule = new StorageSyncSchedule(); schedule.setFrequency(Frequency.WEEKLY); schedule.setHour(12); schedule.setMins(50); Day[] days = {Day.SAT, Day.FRI}; schedule.setDays(days); String expectedExpression = "0 50 12 ? * FRI,SAT *"; assertEquals(expectedExpression, schedule.toCronExpression()); List<Class<?>> validationGroup = new ArrayList<>(); List<String> result = ValidationUtils.validateInputs(validationGroup, schedule); assertTrue(result.isEmpty()); }