auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); restorePreferences(); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); if (!isFinishing()) { startLoadingCollection(); } }

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.d("onCreate()"); mExtensions = new ReviewerExtRegistry(getBaseContext()); restorePreferences(); super.onCreate(savedInstanceState); setContentView(getContentViewAttr(mPrefFullscreenReview)); getDelegate().setHandleNativeActionModesEnabled(true); View mainView = findViewById(android.R.id.content); initNavigationDrawer(mainView); startLoadingCollection(); }
Source:
public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.s, s)) { this.s = s; if (s instanceof QueueSubscription) { @SuppressWarnings("unchecked") QueueSubscription<T> qs = (QueueSubscription<T>) s; int m = qs.requestFusion(ANY); if (m == SYNC) { fusionMode = m; this.queue = qs; done = true; actual.onSubscribe(this); return; } else if (m == ASYNC) { fusionMode = m; this.queue = qs; actual.onSubscribe(this); s.request(prefetch); return; } } queue = new SpscArrayQueue<T>(prefetch); actual.onSubscribe(this); s.request(prefetch); } }

Target:
public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.s, s)) { this.s = s; if (s instanceof QueueSubscription) { @SuppressWarnings("unchecked") QueueSubscription<T> qs = (QueueSubscription<T>) s; int m = qs.requestFusion(ANY); if (m == SYNC) { fusionMode = m; this.queue = qs; done = true; actual.onSubscribe(this); return; } if (m == ASYNC) { fusionMode = m; this.queue = qs; actual.onSubscribe(this); s.request(prefetch); return; } } queue = new SpscArrayQueue<T>(prefetch); actual.onSubscribe(this); s.request(prefetch); } }
Source:
private Object executeFindQuery(final KeyValueQuery<?> query, final QueryMethod queryMethod, final boolean distinct ) { Iterable<?> resultSet = this.keyValueOperations.find(query, queryMethod.getEntityInformation().getJavaType()); if (!queryMethod.isCollectionQuery() && !queryMethod.isPageQuery() && !queryMethod.isSliceQuery() && !queryMethod .isStreamQuery()) { return resultSet.iterator().hasNext() ? resultSet.iterator().next() : null; } if (queryMethod.isStreamQuery()) { if (distinct) { final List<?> list = IterableConverter.toList(resultSet); List<?> result = collectDistinct(list); return StreamUtils.createStreamFromIterator(result.iterator()); } return StreamUtils.createStreamFromIterator(resultSet.iterator()); } if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct().collect(Collectors.toList()); } return resultSet; }

Target:
private Object executeFindQuery(final KeyValueQuery<?> query, final QueryMethod queryMethod, final boolean distinct) { Iterable<?> resultSet = this.keyValueOperations.find(query, queryMethod.getEntityInformation().getJavaType()); if (!queryMethod.isCollectionQuery() && !queryMethod.isPageQuery() && !queryMethod.isSliceQuery() && !queryMethod .isStreamQuery()) { return resultSet.iterator().hasNext() ? resultSet.iterator().next() : null; } if (queryMethod.isStreamQuery()) { if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct(); } return StreamUtils.createStreamFromIterator(resultSet.iterator()); } if (distinct) { return StreamUtils.createStreamFromIterator(resultSet.iterator()).distinct().collect(Collectors.toList()); } return resultSet; }
Source:
void addTopicChange(final int word, final int topicIndex, final int delta) { if (!changedTopicCounts.containsKey(word)) { changedTopicCounts.put(word, new int[numTopics]); } final int[] changedTopicCountsForWord = changedTopicCounts.get(word); changedTopicCountsForWord[topicIndex] += delta; }

Target:
void addTopicChange(final int word, final int topicIndex, final int delta) { if (!changedTopicCounts.contains(word, topicIndex)) { changedTopicCounts.put(word, topicIndex, 0); } changedTopicCounts.put(word, topicIndex, delta + changedTopicCounts.get(word, topicIndex)); }
Source:
public static void setUpBeforeClass() throws Exception { util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); util.getConfiguration().setInt(LoadIncrementalHFiles.MAX_FILES_PER_REGION_PER_FAMILY, MAX_FILES_PER_REGION_PER_FAMILY); util.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY, KeyValueCodecWithTags.class.getCanonicalName()); util.getConfiguration().setBoolean(BulkLoadHFiles.BULK_LOAD_HFILES_BY_FAMILY, false); util.startMiniCluster(); setupNamespace(); }

Target:
public static void setUpBeforeClass() throws Exception { util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); util.getConfiguration().setInt(LoadIncrementalHFiles.MAX_FILES_PER_REGION_PER_FAMILY, MAX_FILES_PER_REGION_PER_FAMILY); util.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY, KeyValueCodecWithTags.class.getCanonicalName()); util.startMiniCluster(); setupNamespace(); }
Source:
protected static String joinNames(Command... commands) { StringJoiner joiner = new StringJoiner(", "); for (Command cs : commands) { joiner.add(cs.getName()); } return joiner.toString(); }

Target:
protected static String joinNames(Command... commands) { StringJoiner joiner = new StringJoiner(", "); for (Command c : commands) { joiner.add(c.getName()); } return joiner.toString(); }
Source:
public void testConnectionFactoryStringWithInvalidParameter() throws NamingException, JMSException { Hashtable<String, String> props = new Hashtable<>(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); props.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?foo=too"); Context ctx = new InitialContext(props); props.put("java.naming.provider.url", ""); new InitialContext(props); }

Target:
public void testConnectionFactoryStringWithInvalidParameter() throws Exception { Hashtable<String, String> props = new Hashtable<>(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"); props.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?foo=too"); AssertionLoggerHandler.startCapture(); try { new InitialContext(props); assertTrue("Expected to find AMQ212078", AssertionLoggerHandler.findText("AMQ212078")); } finally { AssertionLoggerHandler.stopCapture(); } }
Source:
private List<StorageServerConnections> parseFullTargets(List<String> iqnList) { ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(iqnList.size()); for (String fullTarget : iqnList) { StorageServerConnections con = StorageServerConnections.copyOf(getParameters().getConnection()); String[] tokens = fullTarget.split(","); String[] address = tokens[0].split(":"); String[] literals = tokens[1].split(" "); con.setport(address[1]); con.setportal(literals[0]); con.setiqn(literals[1]); log.infoFormat("Connection to {0} requested, VDSM returned {1}.", con.getconnection(), address[0]); connections.add(con); } return connections; }

Target:
private List<StorageServerConnections> parseFullTargets(List<String> iqnList) { ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(iqnList.size()); for (String fullTarget : iqnList) { StorageServerConnections con = StorageServerConnections.copyOf(getParameters().getConnection()); String[] tokens = fullTarget.split(","); String[] address = tokens[0].split(":"); String[] literals = tokens[1].split(" "); con.setport(address[1]); con.setportal(literals[0]); con.setiqn(literals[1]); log.info("Connection to requested, VDSM returned {}.", con.getconnection(), address[0]); connections.add(con); } return connections; }
Source:
public void path() { StubMappingScope scope = indexManager.createScope(); SearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .predicate( f -> f.matchAll() ) .requestTransformer( context -> { assertThat( context.getPath() ).isEqualTo( "/" + INDEX_NAME.toLowerCase( Locale.ROOT ) + "/_search" ); context.setPath( "/_search" ); assertThat( context.getPath() ).isEqualTo( "/_search" ); } ) .toQuery(); clientSpy.expectNext( ElasticsearchRequest.post() .pathComponent( URLEncodedString.fromString( "_search" ) ) .body( new Gson().fromJson( "{}", JsonObject.class ) ) .build(), ElasticsearchRequestAssertionMode.EXTENSIBLE ); query.fetchAll(); }

Target:
public void path() { StubMappingScope scope = indexManager.createScope(); SearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .predicate( f -> f.matchAll() ) .requestTransformer( context -> { assertThat( context.getPath() ).isEqualTo( "/" + INDEX_NAME + "/_search" ); context.setPath( "/_search" ); assertThat( context.getPath() ).isEqualTo( "/_search" ); } ) .toQuery(); clientSpy.expectNext( ElasticsearchRequest.post() .pathComponent( URLEncodedString.fromString( "_search" ) ) .body( new Gson().fromJson( "{}", JsonObject.class ) ) .build(), ElasticsearchRequestAssertionMode.EXTENSIBLE ); query.fetchAll(); }
Source:
private void logActiveFacts() { LOGGER.warn("facts: "); for (FactHandle handle : session.getFactHandles()) { LOGGER.warn(handle.toString()); } }

Target:
private void logActiveFacts() { LOGGER.warn("facts: "); session.getFactHandles().stream().map(Object::toString).forEach(LOGGER::warn); }
Source:
public InternalResourceGroup getRoot() { synchronized (root) { return root; } }

Target:
public InternalResourceGroup getRoot() { return root; }
Source:
private void initialise(boolean initView) { firstTime = true; if (initView) { initView(); } KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); AbstractAction escapeAction = new AbstractAction() { private static final long serialVersionUID = -8088438488574461587L; public void actionPerformed(ActionEvent e) { clearAndHide(); } }; getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE"); getRootPane().getActionMap().put("ESCAPE", escapeAction); }

Target:
private void initialise(boolean initView) { firstTime = true; if (initView) { initView(); } KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); AbstractAction escapeAction = new AbstractAction() { private static final long serialVersionUID = -8088438488574461587L; @Override public void actionPerformed(ActionEvent e) { clearAndHide(); } }; getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE"); getRootPane().getActionMap().put("ESCAPE", escapeAction); }
Source:
public void testTimeRange() { long referenceTimeInSecs = 10L; long errorMarginInSecs = 5L; TimeRange timeRangeWithNoErrorMargin = new TimeRange(referenceTimeInSecs, 0L); TimeRange timeRangeWithErrorMargin = new TimeRange(referenceTimeInSecs, errorMarginInSecs); assertEquals("Start time and end time should be equal for TimeRange with no error margin", timeRangeWithNoErrorMargin.getStartTimeInSecs(), timeRangeWithNoErrorMargin.getEndTimeInSecs()); assertEquals("TimeRange with no error margin is constructed incorrectly", referenceTimeInSecs, timeRangeWithNoErrorMargin.getStartTimeInSecs()); assertEquals("Start time of TimeRange with error margin is incorrect", referenceTimeInSecs - errorMarginInSecs, timeRangeWithErrorMargin.getStartTimeInSecs()); assertEquals("End time of TimeRange with error margin is incorrect", referenceTimeInSecs + errorMarginInSecs, timeRangeWithErrorMargin.getEndTimeInSecs()); }

Target:
public void testTimeRange() { Random rand = new Random(); long referenceTimeInMs = rand.nextInt(10000) + 10000; TimeRange timeRangeWithNoErrorMargin = new TimeRange(referenceTimeInMs, 0L); long errorMarginInMs = rand.nextInt(10000); TimeRange timeRangeWithErrorMargin = new TimeRange(referenceTimeInMs, errorMarginInMs); assertEquals("Start time and end time should be equal for TimeRange with no error margin", timeRangeWithNoErrorMargin.getStartTimeInMs(), timeRangeWithNoErrorMargin.getEndTimeInMs()); assertEquals("TimeRange with no error margin is constructed incorrectly", referenceTimeInMs, timeRangeWithNoErrorMargin.getStartTimeInMs()); assertEquals("Start time of TimeRange with error margin is incorrect", referenceTimeInMs - errorMarginInMs, timeRangeWithErrorMargin.getStartTimeInMs()); assertEquals("End time of TimeRange with error margin is incorrect", referenceTimeInMs + errorMarginInMs, timeRangeWithErrorMargin.getEndTimeInMs()); }
Source:
private void logSlowLockAcquisition(String lockId, LockClient currentHolder, long durationMillis) { if (isSlowLogEnabled() && durationMillis >= slowLogTriggerMillis) { SlowLockLogger.logger.info("Blocked for ms to acquire lock {}.", durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } else if (durationMillis > 100) { log.debug("Blocked for ms to acquire lock {}.", durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } }

Target:
protected void logSlowLockAcquisition(String lockId, LockClient currentHolder, long durationMillis) { String slowLockLogMessage = "Blocked for ms to acquire lock {}."; if (isSlowLogEnabled() && durationMillis >= slowLogTriggerMillis) { SlowLockLogger.logger.info(slowLockLogMessage, durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } else if (log.isDebugEnabled() && durationMillis > DEBUG_SLOW_LOG_TRIGGER_MILLIS) { log.debug(slowLockLogMessage, durationMillis, lockId, currentHolder == null ? "successfully" : "unsuccessfully"); } }
Source:
public CrashDetails(String crashIdentifier) { this.crashIdentifier = crashIdentifier; appStartDate = new Date(); appCrashDate = new Date(); isXamarinException = false; throwableStackTrace = ""; }

Target:
public CrashDetails(String crashIdentifier) { this.crashIdentifier = crashIdentifier; isXamarinException = false; throwableStackTrace = ""; }
Source:
private void setEntityStatus(Entity entity, MachinePoolMemberStatus status) { checkNotNull(entity, "What?"); ((EntityInternal) entity).setAttribute(SERVER_STATUS, status); }

Target:
private void setEntityStatus(Entity entity, MachinePoolMemberStatus status) { ((EntityInternal) entity).setAttribute(SERVER_STATUS, status); }
Source:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents < Integer.MAX_VALUE ? DEFAULT_FACTOR : (int) Math.ceil(nbEvents * 10.0 / Integer.MAX_VALUE); fMonitor = SubMonitor.convert(monitor, (int) Math.min(nbEvents / fEventFactor, Integer.MAX_VALUE)); }

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents / DEFAULT_FACTOR; fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR); }
Source:
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) { if (channel instanceof DirectChannel) { afterMessageHandled(message, channel, null, ex); } Message<?> retrievedMessage = getMessage(message); MessageBuilder<?> messageBuilder = MessageBuilder.fromMessage(retrievedMessage); Span currentSpan = getTracer().isTracing() ? getTracer().getCurrentSpan() : buildSpan(new MessagingTextMap(messageBuilder)); if (log.isDebugEnabled()) { log.debug("Completed sending and current span is " + currentSpan); } getTracer().continueSpan(currentSpan); if (currentSpan != null) { if (log.isDebugEnabled()) { log.debug("Marking span with client received"); } currentSpan.logEvent(Span.CLIENT_RECV); } addErrorTag(ex); if (log.isDebugEnabled()) { log.debug("Closing messaging span " + currentSpan); } getTracer().close(currentSpan); if (log.isDebugEnabled()) { log.debug("Messaging span " + currentSpan + " successfully closed"); } }

Target:
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) { if (isDirectChannel(channel)) { afterMessageHandled(message, channel, null, ex); } Message<?> retrievedMessage = getMessage(message); MessageBuilder<?> messageBuilder = MessageBuilder.fromMessage(retrievedMessage); Span currentSpan = getTracer().isTracing() ? getTracer().getCurrentSpan() : buildSpan(new MessagingTextMap(messageBuilder)); if (log.isDebugEnabled()) { log.debug("Completed sending and current span is " + currentSpan); } getTracer().continueSpan(currentSpan); if (currentSpan != null) { if (log.isDebugEnabled()) { log.debug("Marking span with client received"); } currentSpan.logEvent(Span.CLIENT_RECV); } addErrorTag(ex); if (log.isDebugEnabled()) { log.debug("Closing messaging span " + currentSpan); } getTracer().close(currentSpan); if (log.isDebugEnabled()) { log.debug("Messaging span " + currentSpan + " successfully closed"); } }
Source:
public static OperationStatus fromString(String name, boolean isComplete) { OperationStatus status = fromString(name, OperationStatus.class); status.completed = isComplete; return status; }

Target:
public static OperationStatus fromString(String name, boolean isComplete) { OperationStatus status = fromString(name, OperationStatus.class); if (status != null) { if (operationStatusMap != null && operationStatusMap.containsKey(name)) { OperationStatus operationStatus = operationStatusMap.get(name); if (operationStatus.isComplete() != isComplete) { throw new IllegalArgumentException(String.format("Cannot set complete status %s for operation" + "status %s", isComplete, name)); } } status.completed = isComplete; } return status; }
Source:
public String getError() { return "An entry’s parent is a file"; }

Target:
public String getError() { return "The entry's parent in the metastore database is a file."; }
Source:
public Datum eval(Tuple tuple) { Datum resultDatum; Writable params = new Writable[tuple.size()]; for (int i=0; i<tuple.size(); i++) { params[i] = WritableTypeConverter.convertDatum2Writable(tuple.asDatum(i)); } try { Writable result = (Writable)evalMethod.invoke(instance, params); resultDatum = WritableTypeConverter.convertWritable2Datum(result); } catch (Exception e) { throw new TajoInternalError(e); } return resultDatum; }

Target:
public Datum eval(Tuple tuple) { Datum resultDatum; for (int i=0; i<tuple.size(); i++) { params[i] = WritableTypeConverter.convertDatum2Writable(tuple.asDatum(i)); } try { Writable result = (Writable)evalMethod.invoke(instance, params); resultDatum = WritableTypeConverter.convertWritable2Datum(result); } catch (Exception e) { throw new TajoInternalError(e); } return resultDatum; }
Source:
private PagedColumnIterable(final Column columnRequest) { mColumn = columnRequest.getColumnName(); mCloser = Closer.create(); mColumnRequest = columnRequest; mTableName = KijiManagedHBaseTableName .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); }

Target:
private PagedColumnIterable(final Column columnRequest) { mColumn = columnRequest.getColumnName(); mColumnRequest = columnRequest; mTableName = KijiManagedHBaseTableName .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); }
Source:
private void run(String[] args) throws IOException { Nd4j.ENFORCE_NUMERICAL_STABILITY = true; Nd4j.getMemoryManager().setAutoGcWindow(GC_WINDOW); createDictionary(); File networkFile = new File(toTempPath(MODEL_FILENAME)); int offset = 0; if (networkFile.exists()) { System.out.println("Loading the existing network..."); net = ModelSerializer.restoreComputationGraph(networkFile); System.out.print("Enter d to start dialog or a number to continue training from that minibatch: "); String input; try (Scanner scanner = new Scanner(System.in)) { input = scanner.nextLine(); } if (input.toLowerCase().equals("d")) { startDialog(); } else { offset = Integer.valueOf(input); test(); } } else { System.out.println("Creating a new network..."); createComputationGraph(); } System.out.println("Number of parameters: " + net.numParams()); net.setListeners(new ScoreIterationListener(1)); train(networkFile, offset); }

Target:
private void run(String[] args) throws IOException { Nd4j.getMemoryManager().setAutoGcWindow(GC_WINDOW); createDictionary(); File networkFile = new File(toTempPath(MODEL_FILENAME)); int offset = 0; if (networkFile.exists()) { System.out.println("Loading the existing network..."); net = ModelSerializer.restoreComputationGraph(networkFile); System.out.print("Enter d to start dialog or a number to continue training from that minibatch: "); String input; try (Scanner scanner = new Scanner(System.in)) { input = scanner.nextLine(); } if (input.toLowerCase().equals("d")) { startDialog(); } else { offset = Integer.valueOf(input); test(); } } else { System.out.println("Creating a new network..."); createComputationGraph(); } System.out.println("Number of parameters: " + net.numParams()); net.setListeners(new ScoreIterationListener(1)); train(networkFile, offset); }
Source:
public void create() { this.optionsGroup = UIAssets.getOptionsGroup(); super.root = new Group(); root.setVisible(false); MyClickListener mClickListener = new MyClickListener(); newProject = new TextButton("Nuevo Proyecto", skin, "default-thin"); newProject.addListener(mClickListener); projectGallery = new TextButton("Galería de Proyectos", skin); projectGallery.addListener(mClickListener); cg = new CircularGroup(halfstageh, 135, 180, true, newProject, projectGallery); cg.setX(halfstagew); cg.setY(halfstageh); Table projectsTable = new Table(); projectsTable.defaults().space(10); ScrollPane sp = new ScrollPane(projectsTable); sp.setBounds(stagew * .1f, 10, stagew * .8f, stageh * .2f); sp.setScrollingDisabled(false, true); Texture t = new Texture(Gdx.files.internal("mockup/temp/proyecto.png")); t.setFilter(TextureFilter.Linear, TextureFilter.Linear); final int PROJECTS = 8; mProjects = new Array<Actor>(false, PROJECTS); for (int i = 0; i < PROJECTS; ++i) { Image im = new Image(t); im.addListener(mClickListener); projectsTable.add(im); mProjects.add(im); } root.addActor(sp); root.addActor(cg); stage.addActor(root); exitDialog = new Dialog("¿Salir?", skin, "exit-dialog") { protected void result (Object object) { if((Boolean) object){ Gdx.app.exit(); } } } .text("¿Estás seguro?") .button("Salir", true) .button("¡Todavía no!", false) .key(Keys.BACK, false) .key(Keys.ENTER, true); exitDialog.setMovable(false); }

Target:
public void create() { this.optionsGroup = UIAssets.getOptionsGroup(); super.root = new Group(); root.setVisible(false); MyClickListener mClickListener = new MyClickListener(); newProject = new TextButton("Nuevo Proyecto", skin, "default-thin"); newProject.addListener(mClickListener); projectGallery = new TextButton("Galería de Proyectos", skin); projectGallery.addListener(mClickListener); cg = new CircularGroup(halfstageh, 135, 180, true, newProject, projectGallery); cg.setX(halfstagew); cg.setY(halfstageh); Table projectsTable = new Table(); projectsTable.defaults().space(10); ScrollPane sp = new ScrollPane(projectsTable); sp.setBounds(stagew * .1f, 10, stagew * .8f, stageh * .2f); sp.setScrollingDisabled(false, true); Texture t = new Texture(Gdx.files.internal("mockup/temp/proyecto.png")); t.setFilter(TextureFilter.Linear, TextureFilter.Linear); final int PROJECTS = 8; mProjects = new Array<Actor>(false, PROJECTS); for (int i = 0; i < PROJECTS; ++i) { Image im = new Image(t); im.addListener(mClickListener); projectsTable.add(im); mProjects.add(im); } Image bg = new Image(skin.getRegion("bg")); bg.setTouchable(Touchable.disabled); bg.setBounds(0, 0, stagew, stageh); root.addActor(bg); root.addActor(sp); root.addActor(cg); stage.addActor(root); exitDialog = new Dialog("¿Salir?", skin, "exit-dialog") { protected void result(Object object) { if ((Boolean) object) { Gdx.app.exit(); } } }.text("¿Estás seguro?").button("Salir", true).button("¡Todavía no!", false).key(Keys.BACK, false).key(Keys.ENTER, true); exitDialog.setMovable(false); }
Source:
public byte[] getCacheKey() { byte[] valueBytes = StringUtils.toUtf8(value); return ByteBuffer.allocate(2 + valueBytes.length) .put(caseSensitive ? (byte)1 : 0) .put(CACHE_TYPE_ID) .put(valueBytes) .array(); }

Target:
public byte[] getCacheKey() { if (value == null) { return ByteBuffer.allocate(2) .put(CACHE_TYPE_ID) .put(caseSensitive ? (byte) 1 : 0).array(); } byte[] valueBytes = StringUtils.toUtf8(value); return ByteBuffer.allocate(2 + valueBytes.length) .put(CACHE_TYPE_ID) .put(caseSensitive ? (byte) 1 : 0) .put(valueBytes) .array(); }
Source:
public AuthorizationRest findOne(Context context, String id) { AuthorizationRest authorizationRest = null; String featureName; try { featureName = authorizationRestUtil.getFeatureName(id); } catch (IllegalArgumentException e) { log.warn(e.getMessage(), e); return null; } try { BaseObjectRest object = null; try { object = authorizationRestUtil.getObject(context, id); } catch (IllegalArgumentException e) { log.warn("Object informations not found in the specified id " + id, e); return null; } AuthorizationFeature authorizationFeature = null; if (featureName != null) { authorizationFeature = authorizationFeatureService.find(featureName); } if (authorizationFeature == null) { return null; } EPerson user; try { user = authorizationRestUtil.getEperson(context, id); } catch (IllegalArgumentException e) { log.warn("Invalid eperson informations in the specified id " + id, e); return null; } EPerson currUser = context.getCurrentUser(); context.setCurrentUser(user); if (authorizationFeatureService.isAuthorized(context, authorizationFeature, object)) { Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(authorizationFeature); authz.setObject(object); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } context.setCurrentUser(currUser); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return authorizationRest; }

Target:
public AuthorizationRest findOne(Context context, String id) { AuthorizationRest authorizationRest = null; String featureName; try { featureName = authorizationRestUtil.getFeatureName(id); } catch (IllegalArgumentException e) { log.warn(e.getMessage(), e); return null; } try { BaseObjectRest object = null; try { object = authorizationRestUtil.getObject(context, id); } catch (IllegalArgumentException e) { log.warn("Object informations not found in the specified id " + id, e); return null; } AuthorizationFeature authorizationFeature = null; if (featureName != null) { authorizationFeature = authorizationFeatureService.find(featureName); } if (authorizationFeature == null) { return null; } EPerson user; try { user = authorizationRestUtil.getEperson(context, id); } catch (IllegalArgumentException e) { log.warn("Invalid eperson informations in the specified id " + id, e); return null; } EPerson currUser = context.getCurrentUser(); if (currUser != user) { context.switchContextUser(user); } if (authorizationFeatureService.isAuthorized(context, authorizationFeature, object)) { Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(authorizationFeature); authz.setObject(object); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } if (currUser != user) { context.restoreContextUser(); } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return authorizationRest; }
Source:
public Map<String, Statistic<?, ?>> collectStatistics(Context context, Collection<String> statisticNames, long since) { Map<String, Statistic<?, ?>> statistics = new HashMap<String, Statistic<?, ?>>(statisticNames.size()); StandardEhcacheStatistics ehcacheStatistics = (StandardEhcacheStatistics) findExposedObject(context); if (ehcacheStatistics != null) { for (String statisticName : statisticNames) { statistics.put(statisticName, ehcacheStatistics.queryStatistic(statisticName, since)); } } return statistics; }

Target:
public Map<String, Statistic<?, ?>> collectStatistics(Context context, Collection<String> statisticNames, long since) { Map<String, Statistic<?, ?>> statistics = new HashMap<String, Statistic<?, ?>>(statisticNames.size()); StandardEhcacheStatistics ehcacheStatistics = (StandardEhcacheStatistics) findExposedObject(context); if (ehcacheStatistics != null) { for (String statisticName : statisticNames) { try { statistics.put(statisticName, ehcacheStatistics.queryStatistic(statisticName, since)); } catch (IllegalArgumentException ignored) { } } } return statistics; }
Source:
public void removeClassName() { HasStyleComponent component = new HasStyleComponent(); component.setClassName("foo Bar baz"); component.removeClassName("foo"); assertClasses(component, "Bar", "baz"); component.removeClassName("bar"); assertClasses(component, "Bar", "baz"); component.removeClassName("Bar"); assertClasses(component, "baz"); component.removeClassName("baz"); assertClasses(component); component.setClassName("removeMe"); component.setClassName(null); component.setClassName("foo"); component.getClassNames().remove("foo"); assertClasses(component); }

Target:
public void removeClassName() { HasStyleComponent component = new HasStyleComponent(); component.setClassName("foo Bar baz"); component.removeClassName("foo"); assertClasses(component, "Bar", "baz"); component.removeClassName("bar"); assertClasses(component, "Bar", "baz"); component.removeClassName("Bar"); assertClasses(component, "baz"); component.removeClassName("baz"); assertClasses(component); component.setClassName("foo"); component.getClassNames().remove("foo"); assertClasses(component); }
Source:
protected void syncSearch() { if (getEntity() == null) { return; } if (getEntity() != null) { GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) getEntity(); if (getItems() == glusterVolumeEntity.getBricks()) { getItemsChangedEvent().raise(this, EventArgs.Empty); } else { setItems(glusterVolumeEntity.getBricks()); } } else { setItems(null); } }

Target:
protected void syncSearch() { if (getEntity() != null) { GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) getEntity(); if (getItems() == glusterVolumeEntity.getBricks()) { getItemsChangedEvent().raise(this, EventArgs.Empty); } else { setItems(glusterVolumeEntity.getBricks()); } } else { setItems(null); } }
Source:
public void onDismissClick() { setResult(RESULT_DISMISS); finish(); }

Target:
public void onDismissClick() { setResult(RESULT_OK); finish(); }
Source:
private String trimPropertyName(String propName) { if ((propName.length()) > (NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1)) { return propName.substring(NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1).trim(); } else { return null; } }

Target:
private static String trimPropertyName(String propName) { if ((propName.length()) > (NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1)) { return propName.substring(NhincConstants.CUSTOM_HTTP_HEADERS.length() + 1).trim(); } else { return null; } }
Source:
public boolean equals(final Object o) { if (o == this) { return true; } else if (o == null || !o.getClass().equals(getClass())) { return false; } final DumpArchiveEntry rhs = (DumpArchiveEntry) o; if (rhs.header == null) { return false; } if (ino != rhs.ino) { return false; } return (summary != null || rhs.summary == null) && (summary == null || summary.equals(rhs.summary)); }

Target:
public boolean equals(final Object o) { if (o == this) { return true; } else if (o == null || !o.getClass().equals(getClass())) { return false; } final DumpArchiveEntry rhs = (DumpArchiveEntry) o; if (rhs.header == null) { return false; } if (ino != rhs.ino) { return false; } if ((summary == null && rhs.summary != null) || (summary != null && !summary.equals(rhs.summary))) { return false; } return true; }
Source:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { if (item instanceof IdentifierObjQualifier) { final IdentifierObjQualifier identifierObjQualifier = (IdentifierObjQualifier) item; Validate.notNull(objQualifierConverter, "'objQualifierConverter' must not be null!"); return objQualifierConverter.convertToUriQualifier(identifierObjQualifier) .map(uriObjQualifier -> new SimpleMeasureDefinition(uriObjQualifier, aggregation, computeRatio, filters)) .orElseThrow(() -> new IllegalArgumentException(format("The converter does not know how to convert identifier '%s'!", item))); } return this; }

Target:
public MeasureDefinition withObjUriQualifiers(final ObjQualifierConverter objQualifierConverter) { return ObjIdentifierUtilities.copyIfNecessary( this, item, uriObjQualifier -> new SimpleMeasureDefinition(uriObjQualifier, aggregation, computeRatio, filters), objQualifierConverter ); }
Source:
private PlanWithProperties planAndEnforce( PlanNode node, HashComputationSet requiredHashes, boolean pruneExtraHashSymbols, HashComputationSet preferredHashes) { PlanWithProperties result = plan(node, preferredHashes); boolean preferenceSatisfied; if (pruneExtraHashSymbols) { Set<HashComputation> resultHashes = result.getHashSymbols().keySet(); preferenceSatisfied = resultHashes.containsAll(requiredHashes.getHashes()) && ImmutableSet.builder() .addAll(requiredHashes.getHashes()) .addAll(preferredHashes.getHashes()) .build() .containsAll(resultHashes); } else { preferenceSatisfied = result.getHashSymbols().keySet().containsAll(requiredHashes.getHashes()); } if (preferenceSatisfied) { return result; } return enforce(result, requiredHashes); }

Target:
private PlanWithProperties planAndEnforce( PlanNode node, HashComputationSet requiredHashes, boolean pruneExtraHashSymbols, HashComputationSet preferredHashes) { PlanWithProperties result = plan(node, preferredHashes); boolean preferenceSatisfied; if (pruneExtraHashSymbols) { Set<HashComputation> resultHashes = result.getHashSymbols().keySet(); Set<HashComputation> requiredAndPreferredHashes = ImmutableSet.<HashComputation>builder() .addAll(requiredHashes.getHashes()) .addAll(preferredHashes.getHashes()) .build(); preferenceSatisfied = resultHashes.containsAll(requiredHashes.getHashes()) && requiredAndPreferredHashes.containsAll(resultHashes); } else { preferenceSatisfied = result.getHashSymbols().keySet().containsAll(requiredHashes.getHashes()); } if (preferenceSatisfied) { return result; } return enforce(result, requiredHashes); }
Source:
public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTDeclarationStatement declStatement = (IASTDeclarationStatement) declaration.getParent(); IASTNode node = declStatement.getParent(); if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }

Target:
public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTNode node = declaration.getParent(); if (node == null) return PROCESS_CONTINUE; node = node.getParent(); if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }
Source:
public void bind(SQLStatement<?> q, Parameter param, Bind b, Object arg) { String value = b != null ? b.value() : Bind.USE_PARAM_NAME; if (value.equals(Bind.USE_PARAM_NAME)) { if (param.isNamePresent()) { value = param.getName(); } else if (b == null && paramIndex >= 0) { value = Integer.toString(paramIndex); } else { throw new UnsupportedOperationException("A parameter was annotated with @Bind " + "but no name was specified, and parameter name data is not present " + "in the class file. " + param.getDeclaringExecutable() + " :: " + param); } } q.bind(paramIndex, arg); q.bind(value, arg); }

Target:
public void bind(SQLStatement<?> q, Parameter param, Bind b, Object arg) { final String bindName; if (b == null || b.value().equals(Bind.USE_PARAM_NAME)) { if (param.isNamePresent()) { bindName = param.getName(); } else { throw new UnsupportedOperationException("A parameter was not given a name, " + "and parameter name data is not present in the class file, for: " + param.getDeclaringExecutable() + " :: " + param); } } else { bindName = b.value(); } q.bind(paramIndex, arg); q.bind(bindName, arg); }
Source:
private void setUpSizeFilter(FileSearchData.FileType fileType) { int count = 0; DefaultListModel<FileSize> sizeListModel = (DefaultListModel<FileSize>) sizeList.getModel(); sizeListModel.removeAllElements(); if (null == fileType) { for (FileSize size : FileSize.values()) { sizeListModel.add(count, size); } } else { List<FileSearchData.FileSize> sizes; switch (fileType) { case VIDEO: sizes = FileSize.getOptionsForVideos(); break; case IMAGE: sizes = FileSize.getOptionsForImages(); break; case DOCUMENTS: sizes = FileSize.getOptionsForImages(); break; default: sizes = new ArrayList<>(); break; } for (FileSize size : sizes) { sizeListModel.add(count, size); } } }

Target:
private void setUpSizeFilter(FileSearchData.FileType fileType) { int count = 0; DefaultListModel<FileSize> sizeListModel = (DefaultListModel<FileSize>) sizeList.getModel(); sizeListModel.removeAllElements(); if (null == fileType) { for (FileSize size : FileSize.values()) { sizeListModel.add(count, size); } } else { List<FileSearchData.FileSize> sizes; switch (fileType) { case VIDEO: sizes = FileSize.getOptionsForVideos(); break; case IMAGE: sizes = FileSize.getDefaultSizeOptions(); break; case DOCUMENTS: sizes = FileSize.getDefaultSizeOptions(); break; default: sizes = new ArrayList<>(); break; } for (FileSize size : sizes) { sizeListModel.add(count, size); } } }
Source:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { builder.addConstructorArgValue(element.getAttribute("queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer", true); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "task-executor"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "expect-message"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "phase"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); }

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { builder.addConstructorArgValue(element.getAttribute("queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer", true); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "task-executor"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "phase"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); }
Source:
private void printTransformers(Class transformerClass, String type) throws Exception { Collection<ServiceReference> sref = bundleContext.getServiceReferences(transformerClass, "(id=*)"); List<TransformerProperties> transformersProperties = sref.stream().map(TransformerProperties::new).collect(Collectors.toList()); int activeTransformers = transformersProperties.size(); if (activeTransformers == 0) { console.printf(getNoActiveString(type)); return; } console.printf(getActiveNumString(type, activeTransformers)); Iterator<TransformerProperties> tpIterator = transformersProperties.iterator(); TransformerProperties tp; while (tpIterator.hasNext()) { tp = tpIterator.next(); if (allOption) console.printf("%s", tp.printAllProperties()); else console.printf("%s", tp.printDefaultProperties()); if (tpIterator.hasNext()) { console.printf("%n%s%n", StringUtils.repeat(LINE, 3)); } console.printf("%n"); } }

Target:
private void printTransformers(Class transformerClass, String type) throws InvalidSyntaxException { Collection<ServiceReference> sref = bundleContext.getServiceReferences(transformerClass, FILTER); List<TransformerProperties> transformersProperties = sref.stream().map(TransformerProperties::new).collect(Collectors.toList()); int activeTransformers = transformersProperties.size(); if (activeTransformers == 0) { console.printf("There are no active %s transformers%n%n", type); return; } console.printf("%n%n%n%nActive %s Transformers: %d%n%s%n%n", type, activeTransformers, LINE); Iterator<TransformerProperties> tpIterator = transformersProperties.iterator(); TransformerProperties tp; while (tpIterator.hasNext()) { tp = tpIterator.next(); if (allOption) { console.printf("%s", tp.printAllProperties()); } else { console.printf("%s", tp.printDefaultProperties()); } if (tpIterator.hasNext()) { console.printf("%n%s%n", StringUtils.repeat(LINE, 3)); } console.printf("%n"); } }
Source:
public ActualProperties visitAssignUniqueId(AssignUniqueId node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.getNodePartitioning().isPresent()) { return properties; } return ActualProperties.builderFrom(properties) .global(partitionedOn(FIXED_HASH_DISTRIBUTION, node.getOutputSymbols(), Optional.empty())) .build(); }

Target:
public ActualProperties visitAssignUniqueId(AssignUniqueId node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.getNodePartitioning().isPresent()) { return properties; } return ActualProperties.builderFrom(properties) .global(partitionedOn(ARBITRARY_DISTRIBUTION, ImmutableList.of(node.getIdColumn()), Optional.empty())) .build(); }
Source:
public void runTask() throws Exception { Set<ContractSituation> retirementSituations = Bennu.getInstance().getContractSituationsSet().stream() .filter(this::isRetiredSituation).filter(Objects::nonNull).collect(Collectors.toSet()); LocalDate today = new LocalDate(); Set<User> retiredTeachersUsers = Bennu.getInstance().getGiafProfessionalDataSet().stream() .filter(giafData -> isUsersWithRetirementTeacherSituations(giafData, retirementSituations, today)) .map(giafData -> giafData.getPersonProfessionalData().getPerson().getUser()).filter(Objects::nonNull) .collect(Collectors.toSet()); Group actualRetiredTeachersGroup = UserGroup.of(retiredTeachersUsers); DynamicGroup.get("retiredTeachers").mutator().changeGroup(actualRetiredTeachersGroup); }

Target:
public void runTask() throws Exception { Set<ContractSituation> retirementSituations = Bennu.getInstance().getContractSituationsSet().stream() .filter(this::isRetiredSituation).collect(Collectors.toSet()); LocalDate today = new LocalDate(); Set<User> retiredTeachersUsers = Bennu.getInstance().getGiafProfessionalDataSet().stream() .filter(giafData -> giafData.getPersonProfessionalData().getPerson() != null && isUsersWithRetirementTeacherSituations(giafData, retirementSituations, today)) .map(giafData -> giafData.getPersonProfessionalData().getPerson().getUser()).filter(Objects::nonNull) .collect(Collectors.toSet()); Group actualRetiredTeachersGroup = UserGroup.of(retiredTeachersUsers); DynamicGroup.get("retiredTeachers").mutator().changeGroup(actualRetiredTeachersGroup); }
Source:
private String getTokenToUse(String authTokenCredentialId, String token) { if (!StringUtils.isEmpty(authTokenCredentialId)) { StringCredentials credentials = CredentialsObtainer.lookupCredentials(authTokenCredentialId, null); if (credentials != null) { logger.fine("Using Integration Token Credential ID."); return credentials.getSecret().getPlainText(); } } logger.fine("Using Integration Token."); return token; }

Target:
private String getTokenToUse(String authTokenCredentialId, String token) { if (!StringUtils.isEmpty(authTokenCredentialId)) { StringCredentials credentials = CredentialsObtainer.lookupCredentials(authTokenCredentialId); if (credentials != null) { logger.fine("Using Integration Token Credential ID."); return credentials.getSecret().getPlainText(); } } logger.fine("Using Integration Token."); return token; }