auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String exportData(String parserType, Set<E> set, File file) throws Exception { OutputStreamWriter oWriter = new OutputStreamWriter(new FileOutputStream(file)); Parser<E> parser = parsers.get(parserType); if (parser != null) { try { parser.serialize(set, oWriter); return AutomationCommand.SUCCESS; } finally { oWriter.close(); } } else return String.format("%s! Parser \"%s\" not found!", AutomationCommand.FAIL, parserType); }

Target:
public String exportData(String parserType, Set<E> set, File file) throws Exception { OutputStreamWriter oWriter = new OutputStreamWriter(new FileOutputStream(file)); Parser<E> parser = parsers.get(parserType); if (parser != null) { try { parser.serialize(set, oWriter); return AutomationCommand.SUCCESS; } finally { oWriter.close(); } } else { return String.format("%s! Parser \"%s\" not found!", AutomationCommand.FAIL, parserType); } }
Source:
public ClientDetailsEntity retrieveByIdP(String idp) throws IllegalArgumentException { Object key = new ClientIdCacheKey("IdP+" + idp, releaseName); Date dbDate = retrieveLastModifiedDateByIdP(idp); ClientDetailsEntity clientDetails = null; try { clientDetailsIdPCache.acquireReadLockOnKey(key); clientDetails = toClientDetailsEntity(clientDetailsCache.get(key)); } finally { clientDetailsIdPCache.releaseReadLockOnKey(key); } if (needsFresh(dbDate, clientDetails)) { try { clientDetailsIdPCache.acquireWriteLockOnKey(key); clientDetails = toClientDetailsEntity(clientDetailsIdPCache.get(key)); if (needsFresh(dbDate, clientDetails)) { clientDetails = clientDetailsManager.findByIdP(idp); if (clientDetails == null) throw new IllegalArgumentException("Invalid idp " + idp); clientDetailsIdPCache.put(new Element(key, clientDetails)); } } finally { clientDetailsIdPCache.acquireWriteLockOnKey(key); } } return clientDetails; }

Target:
public ClientDetailsEntity retrieveByIdP(String idp) throws IllegalArgumentException { Object key = new ClientIdCacheKey("IdP+" + idp, releaseName); Date dbDate = retrieveLastModifiedDateByIdP(idp); ClientDetailsEntity clientDetails = null; try { clientDetailsIdPCache.acquireReadLockOnKey(key); clientDetails = toClientDetailsEntity(clientDetailsCache.get(key)); } finally { clientDetailsIdPCache.releaseReadLockOnKey(key); } if (needsFresh(dbDate, clientDetails)) { try { clientDetailsIdPCache.acquireWriteLockOnKey(key); clientDetails = toClientDetailsEntity(clientDetailsIdPCache.get(key)); if (needsFresh(dbDate, clientDetails)) { clientDetails = clientDetailsManager.findByIdP(idp); if (clientDetails == null) throw new IllegalArgumentException("Invalid idp " + idp); clientDetailsIdPCache.put(new Element(key, clientDetails)); } } finally { clientDetailsIdPCache.releaseWriteLockOnKey(key); } } return clientDetails; }
Source:
private OkHttpClient createOkHttpClientWithNoTimeouts() { return new OkHttpClient().newBuilder() .connectTimeout(0, TimeUnit.MILLISECONDS) .writeTimeout(0, TimeUnit.MILLISECONDS) .readTimeout(0, TimeUnit.MILLISECONDS) .build(); }

Target:
private OkHttpClient createOkHttpClientWithNoTimeouts() { return new OkHttpClient.Builder() .connectTimeout(0, TimeUnit.MILLISECONDS) .writeTimeout(0, TimeUnit.MILLISECONDS) .readTimeout(0, TimeUnit.MILLISECONDS) .build(); }
Source:
public double getBaseOperationCost() throws StandardException { double cost = 0.0; if (operand != null) { if (getConstantLength() == -1) { cost += SIMPLE_OP_COST * operand.getTypeServices().getNull().getLength(); } cost += SIMPLE_OP_COST * FN_CALL_COST_FACTOR; } return cost; }

Target:
public double getBaseOperationCost() throws StandardException { double cost = 0.0; if (operand != null) { if (getConstantLength() == -1) { cost += SIMPLE_OP_COST * Math.min(operand.getTypeServices().getNull().getLength(), 16); } cost += SIMPLE_OP_COST * FN_CALL_COST_FACTOR; } return cost; }
Source:
public OAuth2GrantPage build() { OAuth2GrantPage grantPage; String url = NUXEO_URL + "/oauth2/authorize?client_id=test-client&response_type=code"; if (extraParameters != null) { url += extraParameters.entrySet() .stream() .map(entry -> String.join("=", entry.getKey(), entry.getValue())) .collect(Collectors.joining("&", "&", "")); } driver.get(url); if (username != null && password != null) { LoginPage loginPage = asPage(LoginPage.class); grantPage = loginPage.login(username, password, OAuth2GrantPage.class); } else { grantPage = asPage(OAuth2GrantPage.class); } grantPage.checkClientName("Test Client"); grantPage.checkResponseType("code"); grantPage.checkClientId("test-client"); int fieldCount = 2; if (extraParameters != null) { extraParameters.forEach((key, value) -> { grantPage.checkExtraParameter(key, value); }); fieldCount += extraParameters.size(); } grantPage.checkFieldCount(fieldCount); return grantPage; }

Target:
public OAuth2GrantPage build() { OAuth2GrantPage grantPage; String url = NUXEO_URL + "/oauth2/authorize?client_id=test-client&response_type=code"; if (extraParameters != null) { url = URIUtils.addParametersToURIQuery(url, extraParameters); } driver.get(url); if (username != null && password != null) { LoginPage loginPage = asPage(LoginPage.class); grantPage = loginPage.login(username, password, OAuth2GrantPage.class); } else { grantPage = asPage(OAuth2GrantPage.class); } grantPage.checkClientName("Test Client"); grantPage.checkResponseType("code"); grantPage.checkClientId("test-client"); int fieldCount = 2; if (extraParameters != null) { extraParameters.forEach(grantPage::checkExtraParameter); fieldCount += extraParameters.size(); } grantPage.checkFieldCount(fieldCount); return grantPage; }
Source:
public static String getThrottleTierFromSwagger(Map<String, Object> extensions) throws APIManagementException { String trottleTier = null; ObjectMapper mapper = new ObjectMapper(); if (extensions.containsKey(APIConstants.X_WSO2_THROTTLING_TIER)) { Object object = extensions.get(APIConstants.X_WSO2_THROTTLING_TIER).toString(); trottleTier = mapper.convertValue(object, String.class); } return trottleTier; }

Target:
public static String getThrottleTierFromSwagger(Map<String, Object> extensions) throws APIManagementException { String throttleTier = null; ObjectMapper mapper = new ObjectMapper(); if (extensions.containsKey(APIConstants.X_WSO2_THROTTLING_TIER)) { Object object = extensions.get(APIConstants.X_WSO2_THROTTLING_TIER).toString(); throttleTier = mapper.convertValue(object, String.class); } return throttleTier; }
Source:
private void verifyWriteRaisesNpe(short version, Message message) throws Exception { ObjectSerializationCache cache = new ObjectSerializationCache(); try { int size = message.size(cache, version); ByteBuffer buf = ByteBuffer.allocate(size); ByteBufferAccessor byteBufferAccessor = new ByteBufferAccessor(buf); message.write(byteBufferAccessor, cache, version); fail("Expected to see a NullPointerException when writing " + message + " at version " + version); } catch (NullPointerException e) { } }

Target:
private void verifyWriteRaisesNpe(short version, Message message) throws Exception { ObjectSerializationCache cache = new ObjectSerializationCache(); assertThrows(NullPointerException.class, () -> { int size = message.size(cache, version); ByteBuffer buf = ByteBuffer.allocate(size); ByteBufferAccessor byteBufferAccessor = new ByteBufferAccessor(buf); message.write(byteBufferAccessor, cache, version); }); }
Source:
public byte exitStatus(boolean isStrict) { byte result = 0x0; if (!failedScenarios.isEmpty() || (isStrict && (!pendingScenarios.isEmpty() || !undefinedScenarios.isEmpty() || !ambiguousScenarios.isEmpty()))) { result |= ERRORS; } return result; }

Target:
public byte exitStatus(boolean isStrict) { byte result = 0x0; if (!failedScenarios.isEmpty() || !ambiguousScenarios.isEmpty() || (isStrict && (!pendingScenarios.isEmpty() || !undefinedScenarios.isEmpty()))) { result |= ERRORS; } return result; }
Source:
private BlockState onCanGrief(final EndermanEntity endermanEntity) { final BlockState heldBlockState = endermanEntity.getHeldBlockState(); return ((GrieferBridge) this.enderman).bridge$canGrief() ? heldBlockState : null; }

Target:
private BlockState impl$onCanGrief(final EndermanEntity endermanEntity) { final BlockState heldBlockState = endermanEntity.getHeldBlockState(); return ((GrieferBridge) this.enderman).bridge$canGrief() ? heldBlockState : null; }
Source:
public static BoolToken unifiable(Term term1, Term term2, TermContext context) { SymbolicConstraint constraint = new SymbolicConstraint(context); SymbolicUnifier unifier = new SymbolicUnifier(constraint, context); try { unifier.unify(term1, term2); } catch (UnificationFailure e) { return BoolToken.FALSE; } return constraint.isSubstitution() ? BoolToken.TRUE : null; }

Target:
public static BoolToken unifiable(Term term1, Term term2, TermContext context) { SymbolicConstraint constraint = new SymbolicConstraint(context); SymbolicUnifier unifier = new SymbolicUnifier(constraint, context); try { unifier.unify(term1, term2); } catch (UnificationFailure e) { return BoolToken.FALSE; } constraint.simplify(); if (constraint.isSubstitution()) { return BoolToken.TRUE; } else if (constraint.isFalse()) { return BoolToken.FALSE; } else { return null; } }
Source:
public void setupUI() { setMainView(); adapter = new HomeScreenAdapter(activity); mTopBanner = View.inflate(activity, R.layout.grid_header_top_banner, null); setupGridView(); }

Target:
private void setupUI() { setMainView(); adapter = new HomeScreenAdapter(activity); mTopBanner = View.inflate(activity, R.layout.grid_header_top_banner, null); setupGridView(); }
Source:
ObjectId getData() { return data; }

Target:
public ObjectId getData() { return data; }
Source:
public void read( RECORD record, PageCursor primaryCursor, RecordLoad mode, int recordSize ) throws IOException { int primaryStartOffset = primaryCursor.getOffset(); byte headerByte = primaryCursor.getByte(); boolean inUse = isInUse( headerByte ); boolean doubleRecordUnit = has( headerByte, HEADER_BIT_RECORD_UNIT ); if ( doubleRecordUnit ) { boolean firstRecordUnit = has( headerByte, HEADER_BIT_FIRST_RECORD_UNIT ); if ( !firstRecordUnit ) { record.clear(); primaryCursor.setCursorException( "Expected record to be the first unit in the chain, but record header says it's not" ); return; } long secondaryId = Reference.decode( primaryCursor ); long pageId = pageIdForRecord( secondaryId, primaryCursor.getCurrentPageSize(), recordSize ); int offset = offsetForId( secondaryId, primaryCursor.getCurrentPageSize(), recordSize ); PageCursor secondaryCursor = primaryCursor.openLinkedCursor( pageId ); final boolean secondaryHasNext = secondaryCursor.next(); if ( !secondaryHasNext || offset < 0 ) { record.clear(); primaryCursor.setCursorException( illegalSecondaryReferenceMessage( pageId ) ); return; } secondaryCursor.setOffset( offset + HEADER_BYTE); int primarySize = recordSize - (primaryCursor.getOffset() - primaryStartOffset); int secondarySize = recordSize - HEADER_BYTE; PageCursor composite = CompositePageCursor.compose( primaryCursor, primarySize, secondaryCursor, secondarySize ); doReadInternal( record, composite, recordSize, headerByte, inUse ); record.setSecondaryUnitId( secondaryId ); } else { doReadInternal( record, primaryCursor, recordSize, headerByte, inUse ); } }

Target:
public void read( RECORD record, PageCursor primaryCursor, RecordLoad mode, int recordSize ) throws IOException { int primaryStartOffset = primaryCursor.getOffset(); byte headerByte = primaryCursor.getByte(); boolean inUse = isInUse( headerByte ); boolean doubleRecordUnit = has( headerByte, HEADER_BIT_RECORD_UNIT ); if ( doubleRecordUnit ) { boolean firstRecordUnit = has( headerByte, HEADER_BIT_FIRST_RECORD_UNIT ); if ( !firstRecordUnit ) { record.clear(); primaryCursor.setCursorException( "Expected record to be the first unit in the chain, but record header says it's not" ); return; } long secondaryId = Reference.decode( primaryCursor ); long pageId = pageIdForRecord( secondaryId, primaryCursor.getCurrentPageSize(), recordSize ); int offset = offsetForId( secondaryId, primaryCursor.getCurrentPageSize(), recordSize ); PageCursor secondaryCursor = primaryCursor.openLinkedCursor( pageId ); if ( (!secondaryCursor.next()) | offset < 0 ) { record.clear(); primaryCursor.setCursorException( illegalSecondaryReferenceMessage( pageId ) ); return; } secondaryCursor.setOffset( offset + HEADER_BYTE); int primarySize = recordSize - (primaryCursor.getOffset() - primaryStartOffset); int secondarySize = recordSize - HEADER_BYTE; PageCursor composite = CompositePageCursor.compose( primaryCursor, primarySize, secondaryCursor, secondarySize ); doReadInternal( record, composite, recordSize, headerByte, inUse ); record.setSecondaryUnitId( secondaryId ); } else { doReadInternal( record, primaryCursor, recordSize, headerByte, inUse ); } }
Source:
public Collection<Integer> translateForBatch( SinkTransformation<InputT, CommT, WriterStateT, GlobalCommT> transformation, Context context) { StreamGraphUtils.validateTransformationUid(context.getStreamGraph(), transformation); final int parallelism = getParallelism(transformation, context); int writerId = addWriter( transformation, parallelism, context); int committerId = addCommitter( writerId, transformation, new BatchCommitterOperatorFactory<>(transformation.getSink()), parallelism, context); addGlobalCommitter( committerId >= 0 ? committerId : writerId, transformation, new BatchGlobalCommitterOperatorFactory<>(transformation.getSink()), context); return Collections.emptyList(); }

Target:
public Collection<Integer> translateForBatch( SinkTransformation<InputT, CommT, WriterStateT, GlobalCommT> transformation, Context context) { StreamGraphUtils.validateTransformationUid(context.getStreamGraph(), transformation); final int parallelism = getParallelism(transformation, context); int writerId = addWriter( transformation, parallelism, context); int committerId = addCommitter( writerId, transformation, new BatchCommitterOperatorFactory<>(transformation.getSink()), 1, 1, context); addGlobalCommitter( committerId >= 0 ? committerId : writerId, transformation, new BatchGlobalCommitterOperatorFactory<>(transformation.getSink()), context); return Collections.emptyList(); }
Source:
public void decorate(Object element, IDecoration decoration) { IIndexFileLocation ifl= null; IProject project= null; boolean isCDTProject = false; if (element instanceof IFile) { final IFile file = (IFile) element; project= file.getProject(); try { if (project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { ifl = IndexLocationFactory.getWorkspaceIFL(file); isCDTProject = true; } } catch (CoreException e) { CUIPlugin.log(e); } } else if (element instanceof ITranslationUnit) { final ITranslationUnit tu = (ITranslationUnit) element; ifl= IndexLocationFactory.getIFL(tu); project= tu.getCProject().getProject(); isCDTProject = true; } if (isCDTProject && isIndexed(project, ifl)) { decoration.addOverlay(INDEXED, IDecoration.TOP_LEFT); } }

Target:
public void decorate(Object element, IDecoration decoration) { IIndexFileLocation ifl= null; IProject project= null; if (element instanceof IFile) { final IFile file = (IFile) element; project= file.getProject(); try { if (project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { ifl = IndexLocationFactory.getWorkspaceIFL(file); } } catch (CoreException e) { CUIPlugin.log(e); } } else if (element instanceof ITranslationUnit) { final ITranslationUnit tu = (ITranslationUnit) element; ifl= IndexLocationFactory.getIFL(tu); project= tu.getCProject().getProject(); } if (ifl != null && isIndexed(project, ifl)) { decoration.addOverlay(INDEXED, IDecoration.TOP_LEFT); } }
Source:
public JButton getSaveButton() { if (saveButton == null) { saveButton = new JButton(Constant.messages.getString("menu.file.save")); saveButton.setIcon( DisplayUtils.getScaledIcon(new ImageIcon(ZAP.class.getResource("/resource/icon/16/096.png")))); saveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { final JFileChooser fc = new JFileChooser(System.getProperty("user.home")); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setMultiSelectionEnabled(false); fc.setSelectedFile(new File(OWASP_ZAP_ROOT_CA_FILENAME)); if (fc.showSaveDialog(DefaultExplorePanel.this) == JFileChooser.APPROVE_OPTION) { final File f = fc.getSelectedFile(); try { writePubCertificateToFile(f); } catch (final Exception e) { View.getSingleton().showWarningDialog(DefaultExplorePanel.this, Constant.messages .getString("quickstart.explore.warning.savefail".concat(e.getMessage()))); } } } }); } return saveButton; }

Target:
public JButton getSaveButton() { if (saveButton == null) { saveButton = new JButton(Constant.messages.getString("menu.file.save")); saveButton.setIcon( DisplayUtils.getScaledIcon(new ImageIcon(ZAP.class.getResource("/resource/icon/16/096.png")))); saveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { final JFileChooser fc = new JFileChooser(System.getProperty("user.home")); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setMultiSelectionEnabled(false); fc.setSelectedFile(new File(OWASP_ZAP_ROOT_CA_FILENAME)); if (fc.showSaveDialog(DefaultExplorePanel.this) == JFileChooser.APPROVE_OPTION) { final File f = fc.getSelectedFile(); try { writePubCertificateToFile(f); } catch (final Exception e) { View.getSingleton().showWarningDialog(DefaultExplorePanel.this, Constant.messages .getString("quickstart.explore.warning.savefail", e.getMessage())); } } } }); } return saveButton; }
Source:
public void updateClasspath(IProject project, IProgressMonitor monitor) { IJavaProject javaProject = JavaCore.create(project); if(javaProject != null) { try { IClasspathEntry containerEntry = getMavenContainerEntry(javaProject); IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID); IClasspathEntry[] mainClasspath = getClasspath(project, CLASSPATH_RUNTIME, monitor); HashSet<IPath> mainPaths = new HashSet<>(); for(IClasspathEntry ce : mainClasspath) { mainPaths.add(ce.getPath()); } IClasspathEntry[] testClasspath = getClasspath(project, CLASSPATH_DEFAULT, monitor); IClasspathEntry[] classpath = new IClasspathEntry[testClasspath.length]; for(int i = 0; i < testClasspath.length; i++ ) { IClasspathEntry classpathEntry = testClasspath[i]; if(mainPaths.contains(classpathEntry.getPath())) { classpath[i] = setOrRemoveTestAttribute(classpathEntry, false); } else { classpath[i] = setOrRemoveTestAttribute(classpathEntry, true); } } IClasspathContainer container = new MavenClasspathContainer(path, classpath); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject}, new IClasspathContainer[] {container}, monitor); saveContainerState(project, container); } catch(CoreException ex) { log.error(ex.getMessage(), ex); } } }

Target:
public void updateClasspath(IProject project, IProgressMonitor monitor) { IJavaProject javaProject = JavaCore.create(project); if(javaProject != null) { try { IClasspathEntry containerEntry = getMavenContainerEntry(javaProject); IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID); IClasspathEntry[] mainClasspath = getClasspath(project, CLASSPATH_RUNTIME, monitor); HashSet<IPath> mainPaths = new HashSet<>(); for(IClasspathEntry ce : mainClasspath) { mainPaths.add(ce.getPath()); } IClasspathEntry[] testClasspath = getClasspath(project, CLASSPATH_DEFAULT, monitor); IClasspathEntry[] classpath = new IClasspathEntry[testClasspath.length]; for(int i = 0; i < testClasspath.length; i++ ) { ClasspathEntryDescriptor classpathEntryDescriptor = new ClasspathEntryDescriptor(testClasspath[i]); boolean isTest = !mainPaths.contains(classpathEntryDescriptor.getPath()); classpathEntryDescriptor.setClasspathAttribute(IClasspathManager.TEST_ATTRIBUTE, isTest ? "test" : null); classpath[i] = classpathEntryDescriptor.toClasspathEntry(); } IClasspathContainer container = new MavenClasspathContainer(path, classpath); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject}, new IClasspathContainer[] {container}, monitor); saveContainerState(project, container); } catch(CoreException ex) { log.error(ex.getMessage(), ex); } } }
Source:
public synchronized void setUp() { if (fTraces == null) { fTraces = setupTraces(); } if (fExperiment == null) { fExperiment = new TmfExperimentStub(EXPERIMENT, fTraces, BLOCK_SIZE); fExperiment.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true); } }

Target:
public static void setUp() { ITmfTrace[] traces = setupTraces(); fExperiment = new TmfExperimentStub(EXPERIMENT, traces, BLOCK_SIZE); fExperiment.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true); }
Source:
protected PathRef getExistingUserWorkspaceRoot(CoreSession session, String username) { String uswrPath = computePathUserWorkspaceRoot(session, username); if (uswrPath == null) { return null; } PathRef rootref = new PathRef(uswrPath); if (session.exists(rootref)) { return rootref; } String path = CoreInstance.doPrivileged(session, s -> { DocumentModel uwsRootModel = doCreateUserWorkspacesRoot(session, rootref); DocumentModel docModel = s.getOrCreateDocument(uwsRootModel, doc -> initCreateUserWorkspacesRoot(s, doc)); return docModel.getPathAsString(); }); return new PathRef(path); }

Target:
protected PathRef getExistingUserWorkspaceRoot(CoreSession session, String username) { String uwrPath = computePathUserWorkspaceRoot(session, username); if (uwrPath == null) { return null; } PathRef rootref = new PathRef(uwrPath); if (session.exists(rootref)) { return rootref; } String path = CoreInstance.doPrivileged(session, s -> { DocumentModel uwsRootModel = doCreateUserWorkspacesRoot(session, rootref); DocumentModel docModel = s.getOrCreateDocument(uwsRootModel, doc -> initCreateUserWorkspacesRoot(s, doc)); return docModel.getPathAsString(); }); return new PathRef(path); }
Source:
public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property callbackUrl = new Property(); callbackUrl.setDisplayName("Callback Url"); callbackUrl.setName(IdentityApplicationConstants.OAuth2.CALLBACK_URL); callbackUrl.setRequired(true); callbackUrl.setDescription("Enter value corresponding to callback url."); callbackUrl.setDisplayOrder(1); configProperties.add(callbackUrl); Property clientId = new Property(); clientId.setName(OIDCAuthenticatorConstants.CLIENT_ID); clientId.setDisplayName("Client Id"); clientId.setRequired(true); clientId.setDescription("Enter Microsoft Live client identifier value"); clientId.setDisplayOrder(2); configProperties.add(clientId); Property clientSecret = new Property(); clientSecret.setName(OIDCAuthenticatorConstants.CLIENT_SECRET); clientSecret.setDisplayName("Client Secret"); clientSecret.setRequired(true); clientSecret.setConfidential(true); clientSecret.setDescription("Enter Microsoft Live client secret value"); clientSecret.setDisplayOrder(3); configProperties.add(clientSecret); return configProperties; }

Target:
public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property callbackUrl = new Property(); callbackUrl.setDisplayName("Callback Url"); callbackUrl.setName(IdentityApplicationConstants.OAuth2.CALLBACK_URL); callbackUrl.setDescription("Enter value corresponding to callback url."); callbackUrl.setDisplayOrder(3); configProperties.add(callbackUrl); Property clientId = new Property(); clientId.setName(OIDCAuthenticatorConstants.CLIENT_ID); clientId.setDisplayName("Client Id"); clientId.setRequired(true); clientId.setDescription("Enter Microsoft Live client identifier value"); clientId.setDisplayOrder(1); configProperties.add(clientId); Property clientSecret = new Property(); clientSecret.setName(OIDCAuthenticatorConstants.CLIENT_SECRET); clientSecret.setDisplayName("Client Secret"); clientSecret.setRequired(true); clientSecret.setConfidential(true); clientSecret.setDescription("Enter Microsoft Live client secret value"); clientSecret.setDisplayOrder(2); configProperties.add(clientSecret); return configProperties; }
Source:
protected static Lookup rewrite(Expression expression, NodePath path) throws XPathException { ArrayList<Expression> eqArgs = new ArrayList<>(2); if (expression instanceof GeneralComparison) { GeneralComparison comparison = (GeneralComparison) expression; eqArgs.add(comparison.getLeft()); eqArgs.add(comparison.getRight()); Lookup func = Lookup.create(comparison.getContext(), getOperator(expression), path); func.setArguments(eqArgs); return func; } else if (expression instanceof InternalFunctionCall) { InternalFunctionCall fcall = (InternalFunctionCall) expression; Function function = fcall.getFunction(); if (function instanceof Lookup) { final RangeIndex.Operator operator = RangeIndex.Operator.getByName(function.getName().getLocalPart()); if(function==null){ return null; } eqArgs.add(function.getArgument(0)); eqArgs.add(function.getArgument(1)); Lookup func = Lookup.create(function.getContext(), operator, path); func.setArguments(eqArgs); return func; } } return null; }

Target:
protected static Lookup rewrite(Expression expression, NodePath path) throws XPathException { ArrayList<Expression> eqArgs = new ArrayList<>(2); if (expression instanceof GeneralComparison) { GeneralComparison comparison = (GeneralComparison) expression; eqArgs.add(comparison.getLeft()); eqArgs.add(comparison.getRight()); Lookup func = Lookup.create(comparison.getContext(), getOperator(expression), path); if (func != null) { func.setArguments(eqArgs); return func; } } else if (expression instanceof InternalFunctionCall) { InternalFunctionCall fcall = (InternalFunctionCall) expression; Function function = fcall.getFunction(); if (function != null && function instanceof Lookup) { final RangeIndex.Operator operator = RangeIndex.Operator.getByName(function.getName().getLocalPart()); eqArgs.add(function.getArgument(0)); eqArgs.add(function.getArgument(1)); Lookup func = Lookup.create(function.getContext(), operator, path); func.setArguments(eqArgs); return func; } } return null; }
Source:
public void process(QueryEnded event) { String from = conf.get(GrillConfConstants.GRILL_MAIL_FROM_ADDRESS); String host = conf.get(GrillConfConstants.GRILL_MAIL_HOST); String port = conf.get(GrillConfConstants.GRILL_MAIL_PORT); int mailSmtpTimeout = Integer.parseInt(conf.get(GrillConfConstants.GRILL_MAIL_SMTP_TIMEOUT, GrillConfConstants.GRILL_MAIL_DEFAULT_SMTP_TIMEOUT)); int mailSmtpConnectionTimeout = Integer.parseInt(conf.get(GrillConfConstants.GRILL_MAIL_SMTP_CONNECTIONTIMEOUT, GrillConfConstants.GRILL_MAIL_DEFAULT_SMTP_CONNECTIONTIMEOUT)); String mailSubject = "Query " + event.getCurrentValue().toString() + ": " + event.getQueryHandle(); QueryContext queryContext = queryService.getQueryContext(event.getQueryHandle()); String mailMessage = queryContext.getStatus().toString(); String to = event.getUser(); String cc = queryContext.getConf().get(GrillConfConstants.GRILL_QUERY_RESULT_EMAIL_CC, GrillConfConstants.GRILL_QUERY_RESULT_DEFAULT_EMAIL_CC); LOG.info("Sending completion email for query handle: " + event.getQueryHandle()); sendMail(host, port, from, to, cc, mailSubject, mailMessage, mailSmtpTimeout, mailSmtpConnectionTimeout); }

Target:
public void process(QueryEnded event) { QueryContext queryContext = queryService.getQueryContext(event.getQueryHandle()); boolean whetherMailNotify = Boolean.parseBoolean(queryContext.getConf().get(GrillConfConstants.GRILL_WHETHER_MAIL_NOTIFY, GrillConfConstants.GRILL_WHETHER_MAIL_NOTIFY_DEFAULT)); if(!whetherMailNotify){ return; } String mailSubject = "Query " + queryContext.getStatus().getStatus() + ": " + event.getQueryHandle(); String mailMessage = createMailMessage(queryContext); String to = queryContext.getSubmittedUser(); String cc = queryContext.getConf().get(GrillConfConstants.GRILL_QUERY_RESULT_EMAIL_CC, GrillConfConstants.GRILL_QUERY_RESULT_DEFAULT_EMAIL_CC); LOG.info("Sending completion email for query handle: " + event.getQueryHandle()); sendMail(host, port, from, to, cc, mailSubject, mailMessage, mailSmtpTimeout, mailSmtpConnectionTimeout); }
Source:
protected Merger(final Repository local) { db = local; inserter = db.newObjectInserter(); reader = db.newObjectReader(); walk = new RevWalk(reader); }

Target:
protected Merger(final Repository local) { db = local; inserter = db.newObjectInserter(); reader = inserter.newReader(); walk = new RevWalk(reader); }
Source:
public void shouldReturnNullForParentFileOfRoot() { options.set(USERNAME, "user@domain.com"); CifsProcessConnection cifsWinRmConnection = new CifsProcessConnection(CIFS_PROTOCOL, options, INSTANCE); OverthereFile file = cifsWinRmConnection.getFile("C:\\"); assertThat(file.getParentFile(), nullValue()); }

Target:
public void shouldReturnNullForParentFileOfRoot() { options.set(USERNAME, "user@domain.com"); CifsWinRmConnection cifsWinRmConnection = new CifsWinRmConnection(CIFS_PROTOCOL, options, INSTANCE); OverthereFile file = cifsWinRmConnection.getFile("C:\\"); assertThat(file.getParentFile(), nullValue()); }
Source:
public void dispose() { getControl().dispose(); if (labelControl != null) { labelControl.dispose(); } }

Target:
public void dispose() { getControl().dispose(); if (getLabelControl() != null) { getLabelControl().dispose(); } }
Source:
public void addTonePacket(DtmfRawPacket p) { queue.offer(p); }

Target:
public void addTonePacket(DtmfRawPacket p) { queue.offer((DtmfRawPacket) p.clone()); }
Source:
private boolean restoreTable(String fileName, UUID streamId) throws IOException { FileInputStream fileInput = null; try { fileInput = new FileInputStream(fileName); } catch (FileNotFoundException e) { log.error("restoreTable can not find file {}", fileName); return false; } long numEntries = 0; TxnContext txn = corfuStore.txn(CORFU_SYSTEM_NAMESPACE); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txn.logUpdate(streamId, entry); try { while (fileInput.available()> 0) { OpaqueEntry opaqueEntry = OpaqueEntry.read(fileInput); List<SMREntry> smrEntries = opaqueEntry.getEntries().get(streamId); if (smrEntries == null || smrEntries.isEmpty()) { continue; } txn.logUpdate(streamId, smrEntries); numEntries++; log.debug("write uuid with numEntries", streamId, numEntries); } txn.commit(); fileInput.close(); } catch (IOException e) { log.error("restoreTable failed to read file {}", fileName); return false; } return true; }

Target:
private void restoreTable(String fileName, UUID streamId) throws IOException { try (FileInputStream fileInput = new FileInputStream(fileName)) { TxnContext txn = corfuStore.txn(CORFU_SYSTEM_NAMESPACE); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txn.logUpdate(streamId, entry); long numEntries = 0; while (fileInput.available() > 0) { OpaqueEntry opaqueEntry = OpaqueEntry.read(fileInput); List<SMREntry> smrEntries = opaqueEntry.getEntries().get(streamId); if (smrEntries == null || smrEntries.isEmpty()) { continue; } txn.logUpdate(streamId, smrEntries); numEntries += smrEntries.size(); } txn.commit(); log.info("completed restore of table with numEntries", streamId, numEntries); } catch (FileNotFoundException e) { log.error("restoreTable can not find file {}", fileName); throw e; } }
Source:
public int getMaxStackSize() { if (itemMaterial == null) { return 0; } else { return itemMaterial.getMaxStackSize(); } }

Target:
public int getMaxStackSize() { return itemMaterial.getMaxStackSize(); }
Source:
public void assertCopy(Object copy, Object source) { Assertions.assertFalse(copy == source); Assertions.assertEquals(copy, source); }

Target:
void assertCopy(Object copy, Object source) { Assertions.assertNotSame(copy, source); Assertions.assertEquals(copy, source); }
Source:
protected void doRollingUpgrade(RestClient client) { try (AeshTestConnection terminal = new AeshTestConnection()) { CLI.main(new AeshDelegatingShell(terminal), new String[]{}); terminal.readln("connect"); terminal.assertContains(" terminal.clear(); terminal.readln("migrate synchronize --cache=" + CACHE_NAME); } }

Target:
protected void doRollingUpgrade(RestClient client) { try (AeshTestConnection terminal = new AeshTestConnection()) { CLI.main(new AeshDelegatingShell(terminal), new String[]{}); terminal.readln("connect"); terminal.assertContains(" terminal.clear(); terminal.readln("migrate cluster synchronize --cache=" + CACHE_NAME); } }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("propertyName="); sb.append(propertyName); sb.append(",sortOrder="); sb.append(sortOrder); return sb.toString(); }

Target:
public String toString() { return "SortByImpl{" + "propertyName=" + propertyName + ", sortOrder=" + sortOrder + '}'; }
Source:
private EntityMetadataInformation determineSingleEntityMetadataInformation(SessionFactoryImplementor sessionFactory, List<Return> customQueryReturns) { EntityMetadataInformation metadataInformation = null; for ( Return queryReturn : customQueryReturns ) { if ( queryReturn instanceof RootReturn ) { if ( metadataInformation != null ) { return null; } RootReturn rootReturn = (RootReturn) queryReturn; OgmEntityPersister persister = (OgmEntityPersister) sessionFactory.getEntityPersister( rootReturn.getEntityName() ); metadataInformation = new EntityMetadataInformation( new DefaultEntityKeyMetadata( persister.getTableName(), persister.getRootTableIdentifierColumnNames() ), rootReturn.getEntityName() ); } } return metadataInformation; }

Target:
private EntityMetadataInformation determineSingleEntityMetadataInformation(SessionFactoryImplementor sessionFactory, List<Return> customQueryReturns) { EntityMetadataInformation metadataInformation = null; for ( Return queryReturn : customQueryReturns ) { if ( queryReturn instanceof RootReturn ) { if ( metadataInformation != null ) { return null; } RootReturn rootReturn = (RootReturn) queryReturn; OgmEntityPersister persister = (OgmEntityPersister) sessionFactory.getEntityPersister( rootReturn.getEntityName() ); metadataInformation = new EntityMetadataInformation( persister.getEntityKeyMetadata(), rootReturn.getEntityName() ); } } return metadataInformation; }
Source:
public void testPrioritizedJobsExecution() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", 2); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD); CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 8); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); logger.info("executedLow: {}", executedLow.getTime().getTime()); logger.info("executedHigh: {}", executedHigh.getTime().getTime()); logger.info("exec difference: {}", (executedLow.getTime().getTime() - executedHigh.getTime().getTime())); assertTrue(executedLow.getTime().getTime() >= executedHigh.getTime().getTime()); }

Target:
public void testPrioritizedJobsExecution() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", 2); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD); CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 8); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); assertTrue(executedLow.getTime().getTime() >= executedHigh.getTime().getTime()); }
Source:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; for (int i = 1; i < streamJoinOrder.size(); i++) { hashedInputs.put(streamJoinOrder.get(i), new HashMap<Object, ArrayList<TupleImpl>>()); } if(outputKeys==null) { throw new IllegalArgumentException("Must specify output fields via .select() method."); } }

Target:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; int i=0; for ( String stream : joinCriteria.keySet() ) { if(i>0) { hashedInputs.put(stream, new HashMap<Object, ArrayList<Tuple>>()); } ++i; } if(outputKeys==null) { throw new IllegalArgumentException("Must specify output fields via .select() method."); } }
Source:
public ByteArrayLenCodec(final CRAMCodec<Integer> lenCodec, final CRAMCodec<byte[]> byteCodec) { super(); this.lenCodec = lenCodec; this.byteCodec = byteCodec; }

Target:
public ByteArrayLenCodec(final CRAMCodec<Integer> lenCodec, final CRAMCodec<byte[]> byteCodec) { this.lenCodec = lenCodec; this.byteCodec = byteCodec; }
Source:
public RootDSEData(DirContext dirContext) throws NamingException { SearchControls controls = RootDSEQueryInfo.createSearchControls(); String query = RootDSEQueryInfo.ROOT_DSE_LDAP_QUERY; NamingEnumeration<SearchResult> searchResults = dirContext.search("", query, controls); while (searchResults.hasMoreElements()) { SearchResult searchResult = searchResults.nextElement(); Attributes attributes = searchResult.getAttributes(); Attribute attribute = attributes.get(RootDSEQueryInfo.DEFAULT_NAMING_CONTEXT_RESULT_ATTRIBUTE); if (attribute != null) { domainDN = (String) attribute.get(); } else { Attribute namingContextAttribute = attributes.get(RootDSEQueryInfo.NAMING_CONTEXTS_RESULT_ATTRIBUTE); Attribute rhdsAttribute = attributes.get(RootDSEQueryInfo.RHDS_PROPERTY); if (namingContextAttribute != null) { domainDN = getDefaultNamingContextFromNameingContexts(namingContextAttribute); if (rhdsAttribute != null) { ldapProviderType = LdapProviderType.rhds; } else { ldapProviderType = LdapProviderType.ipa; } } } } }

Target:
public RootDSEData(DirContext dirContext) throws NamingException { SearchControls controls = RootDSEQueryInfo.createSearchControls(); String query = RootDSEQueryInfo.ROOT_DSE_LDAP_QUERY; NamingEnumeration<SearchResult> searchResults = dirContext.search("", query, controls); while (searchResults.hasMoreElements()) { SearchResult searchResult = searchResults.nextElement(); Attributes attributes = searchResult.getAttributes(); Attribute attribute = attributes.get(RootDSEQueryInfo.DEFAULT_NAMING_CONTEXT_RESULT_ATTRIBUTE); if (attribute != null) { domainDN = (String) attribute.get(); ldapProviderType = LdapProviderType.activeDirectory; } else { Attribute namingContextAttribute = attributes.get(RootDSEQueryInfo.NAMING_CONTEXTS_RESULT_ATTRIBUTE); Attribute rhdsAttribute = attributes.get(RootDSEQueryInfo.RHDS_PROPERTY); if (namingContextAttribute != null) { domainDN = getDefaultNamingContextFromNamingContexts(namingContextAttribute); if (rhdsAttribute != null) { ldapProviderType = LdapProviderType.rhds; } else { ldapProviderType = LdapProviderType.ipa; } } } } }
Source:
public void parseManagementInterfaces(final XMLExtendedStreamReader reader, final ModelNode address, final Namespace expectedNs, final List<ModelNode> list) throws XMLStreamException { requireNoAttributes(reader); boolean interfaceDefined = false; while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, expectedNs); final Element element = Element.forName(reader.getLocalName()); switch (element) { case NATIVE_INTERFACE: { interfaceDefined = true; switch (expectedNs) { case DOMAIN_1_0: parseNativeManagementInterface1_0(reader, address, list); break; case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: case DOMAIN_1_4: parseManagementInterface1_1(reader, address, false, expectedNs, list); break; default: parseManagementInterface_1_5(reader, address, false, expectedNs, list); } break; } case HTTP_INTERFACE: { interfaceDefined = true; switch (expectedNs) { case DOMAIN_1_0: parseHttpManagementInterface1_0(reader, address, list); break; case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: case DOMAIN_1_4: parseManagementInterface1_1(reader, address, true, expectedNs, list); break; default: parseManagementInterface_1_5(reader, address, true, expectedNs, list); break; } break; } default: { throw unexpectedElement(reader); } } } if (!interfaceDefined) { throw missingRequiredElement(reader, EnumSet.of(Element.NATIVE_INTERFACE, Element.HTTP_INTERFACE)); } }

Target:
public void parseManagementInterfaces(final XMLExtendedStreamReader reader, final ModelNode address, final Namespace expectedNs, final List<ModelNode> list) throws XMLStreamException { requireNoAttributes(reader); boolean interfaceDefined = false; while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, expectedNs); final Element element = Element.forName(reader.getLocalName()); switch (element) { case NATIVE_INTERFACE: { interfaceDefined = true; switch (expectedNs) { case DOMAIN_1_0: parseNativeManagementInterface1_0(reader, address, list); break; case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: case DOMAIN_1_4: parseManagementInterface1_1(reader, address, false, expectedNs, list); break; default: parseManagementInterface_1_5(reader, address, false, expectedNs, list); } break; } case HTTP_INTERFACE: { interfaceDefined = true; switch (expectedNs) { case DOMAIN_1_0: parseHttpManagementInterface1_0(reader, address, list); break; case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: case DOMAIN_1_4: parseManagementInterface1_1(reader, address, true, expectedNs, list); break; default: parseManagementInterface_1_5(reader, address, true, expectedNs, list); break; } break; } default: { throw unexpectedElement(reader); } } } if (!interfaceDefined) { throw missingOneOf(reader, EnumSet.of(Element.NATIVE_INTERFACE, Element.HTTP_INTERFACE)); } }
Source:
void activateDeferredProfile() throws ProfileDataException{ }

Target:
void activateDeferredProfile() throws Exception{ }
Source:
private synchronized void activateHomeApp() { try { activateHomepageContext("/home", "homepage/%2Fhome"); activateHomepageContext("/home/api", "homepage/%2F"); } catch (Throwable e) { e.printStackTrace(); auditor.audit(Action.DEPLOY, "home", ResourceType.URI, ActionOutcome.FAILURE); log.failedToDeployTopology("home", e); } }

Target:
private synchronized void activateHomeApp() { try { activateHomepageContext("/", "homepage/%2Fhome"); activateHomepageContext("/homepage", "homepage/%2F"); } catch (Throwable e) { auditor.audit(Action.DEPLOY, "home", ResourceType.URI, ActionOutcome.FAILURE); log.failedToDeployTopology("home", e); } }
Source:
private Champ copyAndMigrateFromNodeToInline(final int bitpos, final Champ node) { final int oldIndex = this.contents.length - 1 - index(nodeMap, bitpos); final int newIndex = index(dataMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = new HashPrefixPayload[src.length]; assert oldIndex >= newIndex; System.arraycopy(src, 0, dst, 0, newIndex); KeyElement[] merged = new KeyElement[node.keyCount()]; int count = 0; for (int i=0; i < node.contents.length; i++) { KeyElement[] toAdd = node.contents[i].mappings; System.arraycopy(toAdd, 0, merged, count, toAdd.length); count += toAdd.length; } Arrays.sort(merged, Comparator.comparing(x -> x.key)); dst[newIndex] = new HashPrefixPayload(merged, null); System.arraycopy(src, newIndex, dst, newIndex + 1, oldIndex - newIndex); System.arraycopy(src, oldIndex + 1, dst, oldIndex + 1, src.length - oldIndex - 1); BitSet newNodeMap = BitSet.valueOf(nodeMap.toByteArray()); newNodeMap.set(bitpos, false); BitSet newDataMap = BitSet.valueOf(dataMap.toByteArray()); newDataMap.set(bitpos, true); return new Champ(newDataMap, newNodeMap, dst); }

Target:
private Champ copyAndMigrateFromNodeToInline(final int bitpos, final Champ node) { final int oldIndex = this.contents.length - 1 - getIndex(nodeMap, bitpos); final int newIndex = getIndex(dataMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = new HashPrefixPayload[src.length]; if (oldIndex > newIndex) throw new IllegalStateException("Invalid champ!"); System.arraycopy(src, 0, dst, 0, newIndex); KeyElement[] merged = new KeyElement[node.keyCount()]; int count = 0; for (int i=0; i < node.contents.length; i++) { KeyElement[] toAdd = node.contents[i].mappings; System.arraycopy(toAdd, 0, merged, count, toAdd.length); count += toAdd.length; } Arrays.sort(merged, Comparator.comparing(x -> x.key)); dst[newIndex] = new HashPrefixPayload(merged); System.arraycopy(src, newIndex, dst, newIndex + 1, oldIndex - newIndex); System.arraycopy(src, oldIndex + 1, dst, oldIndex + 1, src.length - oldIndex - 1); BitSet newNodeMap = BitSet.valueOf(nodeMap.toByteArray()); newNodeMap.set(bitpos, false); BitSet newDataMap = BitSet.valueOf(dataMap.toByteArray()); newDataMap.set(bitpos, true); return new Champ(newDataMap, newNodeMap, dst); }
Source:
public void testDefaultLoadBalancerFirstServerNotAvailable() throws Exception { KieServicesClient client = KieServicesFactory.newKieServicesClient(config); wireMockServer1.stop(); ServiceResponse<KieServerStateInfo> response = client.getServerState(); assertSuccess(response); assertTrue("Response contains containers.", response.getResult().getContainers().isEmpty()); }

Target:
public void testDefaultLoadBalancerFirstServerNotAvailable() throws Exception { KieServicesClient client = KieServicesFactory.newKieServicesClient(config); wireMockServer1.stop(); ServiceResponse<KieServerStateInfo> response = client.getServerState(); assertSuccess(response); Assertions.assertThat(response.getResult().getContainers()).isEmpty(); }