auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAsyncWIHExecutedMoreThanOnceOnOracle() throws InterruptedException { KieSession ksession = createKSession(PROCESS); WorkItemManager wim = ksession.getWorkItemManager(); wim.registerWorkItemHandler("async", new AsyncWorkItemHandler(getExecutorService(), CounterCommand.class.getName())); ksession.startProcess(PROCESS_ID); Thread.sleep(10000); Assertions.assertThat(CounterCommand.getCounter()).as("The job has not been executed").isNotEqualTo(0); Assertions.assertThat(CounterCommand.getCounter()).as("The job has been executed multiple times").isEqualTo(1); }

Target:
public void testAsyncWIHExecutedMoreThanOnceOnOracle() throws Exception { KieSession ksession = createKSession(PROCESS); TrackingProcessEventListener tpel = new TrackingProcessEventListener(); ksession.addEventListener(tpel); WorkItemHandler wih = new AsyncWorkItemHandler(getExecutorService(), CounterCommand.class.getName()); ksession.getWorkItemManager().registerWorkItemHandler("async", wih); ksession.startProcess(PROCESS_ID); boolean completed = tpel.waitForProcessToComplete(10000); Assertions.assertThat(completed).as("The process should have finished in 10s").isTrue(); Assertions.assertThat(CounterCommand.getCounter()).as("The job has not been executed").isNotEqualTo(0); Assertions.assertThat(CounterCommand.getCounter()).as("The job has been executed multiple times").isEqualTo(1); }
Source:
public CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot(PhysicalSlotRequest physicalSlotRequest) { SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); requests.put(slotRequestId, physicalSlotRequest); CompletableFuture<TestingPhysicalSlot> resultFuture; try { resultFuture = physicalSlotCreator.apply( taskManagerLocation, taskManagerGateway, physicalSlotRequest.getSlotProfile().getPhysicalSlotResourceProfile()); } catch (Throwable t) { resultFuture = FutureUtils.completedExceptionally(t); } responses.put(slotRequestId, resultFuture); return resultFuture.thenApply(physicalSlot -> new PhysicalSlotRequest.Result( slotRequestId, physicalSlot)); }

Target:
public CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot( PhysicalSlotRequest physicalSlotRequest) { SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); requests.put(slotRequestId, physicalSlotRequest); CompletableFuture<TestingPhysicalSlot> resultFuture; try { resultFuture = physicalSlotCreator.apply( physicalSlotRequest.getSlotProfile().getPhysicalSlotResourceProfile()); } catch (Throwable t) { resultFuture = FutureUtils.completedExceptionally(t); } responses.put(slotRequestId, resultFuture); return resultFuture.thenApply( physicalSlot -> new PhysicalSlotRequest.Result(slotRequestId, physicalSlot)); }
Source:
public void addSearchItem(String item, int index) { List<String> recents = new ArrayList<>(); Query<Search> query = mBucketSearch.query(); try (ObjectCursor<Search> cursor = query.execute()) { Search search = mBucketSearch.get(KEY_SEARCH); if (cursor.moveToNext()) { recents = cursor.getObject().getRecent(); } recents.remove(item); recents.add(index, item); search.setRecent(recents.subList(0, recents.size() > MAX_RECENT_SEARCHES ? MAX_RECENT_SEARCHES : recents.size())); search.save(); } catch (BucketObjectMissingException exception) { try { Search search = mBucketSearch.newObject(KEY_SEARCH); search.save(); } catch (BucketObjectNameInvalid invalid) { Log.e("addSearchItem", "Could not create search object", invalid); } } }

Target:
public void addSearchItem(String item, int index) { Preferences preferences = getPreferences(); if (preferences != null) { List<String> recents = preferences.getRecentSearches(); recents.remove(item); recents.add(index, item); preferences.setRecentSearches(recents.subList(0, recents.size() > MAX_RECENT_SEARCHES ? MAX_RECENT_SEARCHES : recents.size())); preferences.save(); } else { Log.e("addSearchItem", "Could not get preferences entity"); } }
Source:
public void testSuperExpression() throws JaxenException { ASTCompilationUnit acu = parseAndTypeResolveForClass15(SuperExpression.class); List<AbstractJavaTypeNode> expressions = convertList( acu.findChildNodesWithXPath(" AbstractJavaTypeNode.class); int index = 0; assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, ((TypeNode) expressions.get(index++).jjtGetParent().jjtGetChild(1)).getType()); assertEquals(SuperExpression.class, expressions.get(index++).getType()); assertEquals(SuperExpression.class, expressions.get(index++).getType()); assertEquals("All expressions not tested", index, expressions.size()); }

Target:
public void testSuperExpression() throws JaxenException { ASTCompilationUnit acu = parseAndTypeResolveForClass15(SuperExpression.class); List<AbstractJavaTypeNode> expressions = convertList( acu.findChildNodesWithXPath(" AbstractJavaTypeNode.class); int index = 0; assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperClass.class, expressions.get(index++).getType()); assertEquals(SuperExpression.class, ((TypeNode) expressions.get(index).jjtGetParent().jjtGetChild(0)).getType()); assertEquals(SuperClass.class, ((TypeNode) expressions.get(index++).jjtGetParent().jjtGetChild(1)).getType()); assertEquals(SuperExpression.class, expressions.get(index++).getType()); assertEquals(SuperExpression.class, expressions.get(index++).getType()); assertEquals("All expressions not tested", index, expressions.size()); }
Source:
public long getNumUserSessions(DbUser user) { return sessionInfoMap.entrySet() .stream() .filter(map -> ((DbUser) map.getValue().contentOfSession.get(USER_PARAMETER_NAME)).getId() .equals(user.getId()) && getSessionValid((String) map.getValue().contentOfSession.get(ENGINE_SESSION_ID), false)) .count(); }

Target:
public long getNumUserSessions(DbUser user) { return sessionInfoMap.keySet() .stream() .filter(sessionId -> getUser(sessionId, false).getId().equals(user.getId())) .filter(sessionId -> getSessionValid(sessionId, false)) .count(); }
Source:
public void setFilter(EvalNode filter) { }

Target:
public void setFilter(EvalNode filter) { throw new UnsupportedException(); }
Source:
public boolean isComplete() { return unassigned.size() == 0; }

Target:
public boolean isComplete() { return unassigned.isEmpty(); }
Source:
protected void incrementReferences() { ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); writeLock.lock(); try { referenceCount++; } finally { writeLock.unlock(); } }

Target:
private void incrementReferences() { ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); writeLock.lock(); referenceCount++; writeLock.unlock(); }
Source:
public List<ConfigMemorySize> getMemorySizeList(String path) { List<ConfigMemorySize> l = new ArrayList<>(); List<? extends ConfigValue> list = getList(path); for (ConfigValue v : list) { if (v.valueType() == ConfigValueType.NUMBER) { l.add(ConfigMemorySize.ofBytes(((Number) v.unwrapped()).longValue())); } else if (v.valueType() == ConfigValueType.STRING) { String s = (String) v.unwrapped(); BigInteger n = parseBytesAsBigInteger(s, v.origin(), path); l.add(ConfigMemorySize.ofBytes(n)); } else { throw new ConfigException.WrongType(v.origin(), path, "memory size string or number of bytes", v.valueType() .name()); } } return l; }

Target:
public List<ConfigMemorySize> getMemorySizeList(String path) { return getBytesListBigInteger(path).stream() .map(ConfigMemorySize::ofBytes) .collect(Collectors.toList()); }
Source:
public Row deserialize(byte[] message) throws IOException { try { inputStream.setBuffer(message); Decoder decoder = DecoderFactory.get().binaryDecoder(inputStream, null); record = datumReader.read(record, decoder); return convertAvroRecordToRow(schema, typeInfo, record); } catch (Exception e) { throw new IOException("Failed to deserialize Avro record.", e); } }

Target:
public Row deserialize(byte[] message) throws IOException { try { decoder = DecoderFactory.get().binaryDecoder(message, decoder); record = datumReader.read(record, decoder); return convertAvroRecordToRow(schema, typeInfo, record); } catch (Exception e) { throw new IOException("Failed to deserialize Avro record.", e); } }
Source:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("digibytefix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); } catch (Throwable e) { } } String preferedFiatCurrency = ICurrencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate, preferedFiatCurrency); } else if ("coinmarketcap".equalsIgnoreCase(exchangeType)) { String preferedFiatCurrency = ICurrencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new CoinmarketcapRateSource(preferedFiatCurrency); } } return null; }

Target:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("digibytefix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); } catch (Throwable e) { } } String preferedFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate, preferedFiatCurrency); } else if ("livecoin".equalsIgnoreCase(exchangeType)) { String preferedFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new LiveCoinRateSource(preferedFiatCurrency); } } return null; }
Source:
private TypedOutput buildBody() { switch (methodInfo.requestType) { case SIMPLE: { int bodyIndex = methodInfo.bodyIndex; if (bodyIndex == RestMethodInfo.NO_BODY) { return null; } Object body = args[bodyIndex]; if (body == null) { throw new IllegalArgumentException("Body must not be null."); } if (body instanceof TypedOutput) { return (TypedOutput) body; } else { return converter.toBody(body); } } case FORM_URL_ENCODED: { FormUrlEncodedTypedOutput body = new FormUrlEncodedTypedOutput(); String[] requestFormFields = methodInfo.requestFormFields; for (int i = 0; i < requestFormFields.length; i++) { String name = requestFormFields[i]; if (name != null) { Object value = args[i]; if (value != null) { body.addField(name, String.valueOf(value)); } } } return body; } case MULTIPART: { MultipartTypedOutput body = new MultipartTypedOutput(); String[] requestMultipartPart = methodInfo.requestMultipartPart; for (int i = 0; i < requestMultipartPart.length; i++) { String name = requestMultipartPart[i]; if (name != null) { Object value = args[i]; if (value != null) { if (value instanceof TypedOutput) { body.addPart(name, (TypedOutput) value); } else { body.addPart(name, converter.toBody(value)); } } } } return body; } default: throw new IllegalArgumentException("Unknown request type " + methodInfo.requestType); } }

Target:
private TypedOutput buildBody() { switch (methodInfo.requestType) { case SIMPLE: { int bodyIndex = methodInfo.bodyIndex; if (bodyIndex == RestMethodInfo.NO_BODY) { return null; } Object body = args[bodyIndex]; if (body == null) { throw new IllegalArgumentException("Body must not be null."); } if (body instanceof TypedOutput) { return (TypedOutput) body; } else { return converter.toBody(body); } } case FORM_URL_ENCODED: { FormUrlEncodedTypedOutput body = new FormUrlEncodedTypedOutput(); String[] requestFormFields = methodInfo.requestFormFields; for (int i = 0; i < requestFormFields.length; i++) { String name = requestFormFields[i]; if (name != null) { Object value = args[i]; if (value != null) { body.addField(name, String.valueOf(value)); } } } return body; } case MULTIPART: { MultipartTypedOutput body = new MultipartTypedOutput(); String[] requestMultipartPart = methodInfo.requestMultipartPart; for (int i = 0; i < requestMultipartPart.length; i++) { String name = requestMultipartPart[i]; if (name != null) { Object value = args[i]; if (value == null) { throw new IllegalArgumentException("Multipart part must not be null: " + name + "."); } if (value instanceof TypedOutput) { body.addPart(name, (TypedOutput) value); } else { body.addPart(name, converter.toBody(value)); } } } return body; } default: throw new IllegalArgumentException("Unknown request type " + methodInfo.requestType); } }
Source:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (!operation.hasDefined(CommonAttributes.JGROUPS_CLUSTER.getName()) && operation.hasDefined(CommonAttributes.LEGACY_JGROUPS_CLUSTER.getName())) { operation.get(CommonAttributes.JGROUPS_CLUSTER.getName()).set(operation.get(CommonAttributes.LEGACY_JGROUPS_CLUSTER.getName())); operation.remove(CommonAttributes.LEGACY_JGROUPS_CLUSTER.getName()); } if (operation.hasDefined(JGROUPS_CLUSTER.getName())) { if (operation.hasDefined(JGROUPS_CHANNEL_FACTORY.getName()) && !operation.hasDefined(JGROUPS_CHANNEL.getName())) { String channel = operation.get(JGROUPS_CLUSTER.getName()).asString(); operation.get(JGROUPS_CHANNEL.getName()).set(channel); PathAddress channelAddress = context.getCurrentAddress().getParent().getParent().getParent().append(ModelDescriptionConstants.SUBSYSTEM, "jgroups").append("channel", channel); ModelNode addChannelOperation = Util.createAddOperation(channelAddress); addChannelOperation.get("stack").set(operation.get(JGROUPS_CHANNEL_FACTORY.getName())); context.addStep(addChannelOperation, AddIfAbsentStepHandler.INSTANCE, OperationContext.Stage.MODEL); } } super.execute(context, operation); }

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { CommonAttributes.renameChannelToCluster(operation); if (operation.hasDefined(JGROUPS_CLUSTER.getName())) { if (operation.hasDefined(JGROUPS_CHANNEL_FACTORY.getName()) && !operation.hasDefined(JGROUPS_CHANNEL.getName())) { String channel = operation.get(JGROUPS_CLUSTER.getName()).asString(); operation.get(JGROUPS_CHANNEL.getName()).set(channel); PathAddress channelAddress = context.getCurrentAddress().getParent().getParent().getParent().append(ModelDescriptionConstants.SUBSYSTEM, "jgroups").append("channel", channel); ModelNode addChannelOperation = Util.createAddOperation(channelAddress); addChannelOperation.get("stack").set(operation.get(JGROUPS_CHANNEL_FACTORY.getName())); context.addStep(addChannelOperation, AddIfAbsentStepHandler.INSTANCE, OperationContext.Stage.MODEL); } } super.execute(context, operation); }
Source:
public boolean isOob(final OAuthConfig config) { return "oob".equals(config.getCallback()); }

Target:
public static boolean isOob(final OAuthConfig config) { return "oob".equals(config.getCallback()); }
Source:
protected void setupContent(ViewGroup rootView) { mEmailInput = rootView.findViewById(R.id.login_email_row); if (BuildConfig.DEBUG) { mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL); } mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); mEmailInput.getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean hasFocus) { if (hasFocus && !mIsDisplayingEmailHints && !mHasDismissedEmailHints) { mIsDisplayingEmailHints = true; getEmailHints(); } } }); mEmailInput.getEditText().setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { if (!mIsDisplayingEmailHints && !mHasDismissedEmailHints) { mIsDisplayingEmailHints = true; getEmailHints(); } } }); LinearLayout googleLoginButton = rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK); EditTextUtils.hideSoftInput(mEmailInput.getEditText()); if (NetworkUtils.checkConnection(getActivity())) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); mIsSocialLogin = true; mLoginListener.showGoogleLoginScreen(LoginEmailFragment.this); } } }); }

Target:
protected void setupContent(ViewGroup rootView) { mEmailInput = rootView.findViewById(R.id.login_email_row); if (BuildConfig.DEBUG) { mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL); } mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); mEmailInput.getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean hasFocus) { if (hasFocus && !mIsDisplayingEmailHints && !mHasDismissedEmailHints) { mIsDisplayingEmailHints = true; getEmailHints(); } } }); mEmailInput.getEditText().setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { if (!mIsDisplayingEmailHints && !mHasDismissedEmailHints) { mIsDisplayingEmailHints = true; getEmailHints(); } } }); LinearLayout googleLoginButton = rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { mAnalyticsListener.trackSocialButtonClick(); EditTextUtils.hideSoftInput(mEmailInput.getEditText()); if (NetworkUtils.checkConnection(getActivity())) { if (isAdded()) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); mIsSocialLogin = true; mLoginListener.addGoogleLoginFragment(LoginEmailFragment.this); } else { AppLog.e(T.NUX, "Google login could not be started. LoginEmailFragment was not attached."); showErrorDialog(getString(R.string.login_error_generic_start)); } } } }); }
Source:
private synchronized void resetIdempotentProducerId() { if (isTransactional()) throw new IllegalStateException("Cannot reset producer state for a transactional producer. " + "You must either abort the ongoing transaction or reinitialize the transactional producer instead"); setProducerIdAndEpoch(ProducerIdAndEpoch.NONE); transitionTo(State.UNINITIALIZED); }

Target:
private void resetIdempotentProducerId() { if (isTransactional()) throw new IllegalStateException("Cannot reset producer state for a transactional producer. " + "You must either abort the ongoing transaction or reinitialize the transactional producer instead"); log.debug("Resetting idempotent producer ID. ID and epoch before reset are {}", this.producerIdAndEpoch); setProducerIdAndEpoch(ProducerIdAndEpoch.NONE); transitionTo(State.UNINITIALIZED); }
Source:
public boolean isVMWithMemoryCompatible(VM vm) { if (vm == null) { return true; } Version recentClusterVersion = vm.getClusterCompatibilityVersion(); Version originalClusterVersion = vm.getClusterCompatibilityVersionOrigin(); if (vm.getCustomCompatibilityVersion() != null) { return true; } return originalClusterVersion != null && recentClusterVersion.getMajor() == originalClusterVersion.getMajor() && recentClusterVersion.getMinor() == originalClusterVersion.getMinor(); }

Target:
public boolean isVMWithMemoryCompatible(VM vm) { if (vm == null || vm.getCustomCompatibilityVersion() != null) { return true; } Version recentClusterVersion = vm.getClusterCompatibilityVersion(); Version originalClusterVersion = vm.getClusterCompatibilityVersionOrigin(); return originalClusterVersion != null && recentClusterVersion.getMajor() == originalClusterVersion.getMajor() && recentClusterVersion.getMinor() == originalClusterVersion.getMinor(); }
Source:
public Entity changeDimension(DimensionType dimensionIn) { final Entity entity = super.changeDimension(dimensionIn); if (entity instanceof EnderPearlEntity) { this.perlThrower = null; this.thrower = null; } return entity; }

Target:
public Entity shadow$changeDimension(DimensionType dimensionIn) { final Entity entity = super.shadow$changeDimension(dimensionIn); if (entity instanceof EnderPearlEntity) { this.perlThrower = null; this.owner = null; } return entity; }
Source:
public static void move(File from, File to, boolean DEBUG) throws IOException { try { Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { if (DEBUG) { Debug.println("Failed to move atomically: " + from + " to " + to); } Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING); } if (DEBUG) { Debug.println("Successfully moved file: " + from + " to " + to); } }

Target:
public static void move(File from, File to, boolean DEBUG) throws IOException { try { Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { if (DEBUG) { Debug.println("Failed to move atomically: " + from + " to " + to); } rm(to, DEBUG); Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING); } if (DEBUG) { Debug.println("Successfully moved file: " + from + " to " + to); } }
Source:
public void testDoesEvaluateResultsWithFullConcurrency() { Stream<Integer> values = ConcurrentStreams.map( ImmutableList.of(1, 2, 3, 4), value -> value + 1, executor, 4, TIMEOUT); Assert.assertEquals(values.collect(Collectors.toList()), ImmutableList.of(2, 3, 4, 5)); }

Target:
public void testDoesEvaluateResultsWithFullConcurrency() { Stream<Integer> values = ConcurrentStreams.map( ImmutableList.of(1, 2, 3, 4, 5, 6, 7), value -> value + 1, executor, 7); Assert.assertEquals(values.collect(Collectors.toList()), ImmutableList.of(2, 3, 4, 5, 6, 7, 8)); }
Source:
private static String getConfigKey(FileStore s) { return javaVersionPrefix + s.name(); }

Target:
private static String getConfigKey(FileStore s) { final String storeKey; if (SystemReader.getInstance().isWindows()) { Object attribute = null; try { attribute = s.getAttribute("volume:vsn"); } catch (IOException ignored) { } if (attribute instanceof Integer) { storeKey = attribute.toString(); } else { storeKey = s.name(); } } else { storeKey = s.name(); } return javaVersionPrefix + storeKey; }
Source:
public NetSocket resume() { pause = false; if (pendingData != null) { if (dataHandler != null) { if (!pendingData.isEmpty()) { for (;;) { final Buffer buf = pendingData.poll(); if (buf == null) { break; } vertx.runOnContext(new VoidHandler() { @Override protected void handle() { handleDataReceived(buf); } }); } } } else { pendingData.clear(); } } doResume(); return this; }

Target:
public NetSocket resume() { if (!paused) { return this; } paused = false; if (pendingData != null) { for (;;) { final Buffer buf = pendingData.poll(); if (buf == null) { break; } vertx.runOnContext(new VoidHandler() { @Override protected void handle() { handleDataReceived(buf); } }); } } doResume(); return this; }
Source:
protected void deactivate() { if (pollThreadTask != null && !pollThreadTask.isDone()) { logger.debug("Cancelling WatchdogServiceImpl task ..."); pollThreadTask.cancel(true); logger.info("WatchdogServiceImpl task cancelled? = {}", pollThreadTask.isDone()); pollThreadTask = null; } if (this.pollThreadExecutor != null) { logger.debug("Terminating WatchdogServiceImpl Thread ..."); this.pollThreadExecutor.shutdownNow(); try { this.pollThreadExecutor.awaitTermination(THREAD_TERMINATION_TOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { logger.warn("Interrupted", e); } logger.info("WatchdogServiceImpl Thread terminated? - {}", this.pollThreadExecutor.isTerminated()); this.pollThreadExecutor = null; } criticalServiceList = null; if (watchdogAction.equals(WATCHDOG_ACTION_KURA_RESTART)) { new Thread() { @Override public void run() { stopKura(); } }.start(); } }

Target:
protected void deactivate() { cancelPollTask(); shutdownPollExecutor(); refreshWatchdog(); }
Source:
public boolean supportsPath(final Path path) { boolean anyResourceTypeMatch = this.getResourceTypeDefinitionList() .stream() .anyMatch(resourceTypeDefinition -> resourceTypeDefinition.accept(convertPath(path))); return !(isFolder(path) || isHidden(path)) && anyResourceTypeMatch; }

Target:
public boolean supportsPath(final Path path) { return !(this.isFolder(path) || this.isHidden(path)) && this.isSupportedByAnyResourceType(path); }
Source:
public Action<?, ?> extendMetadataAction() { return new AbstractUpscaleAction<>(StackEvent.class) { private final Set<InstanceStatus> unusedInstanceStatuses = Set.of(InstanceStatus.CREATE_REQUESTED, InstanceStatus.CREATED); @Override protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.UPSCALE_IN_PROGRESS, "Extending metadata"); List<CloudInstance> allKnownInstances = cloudStackConverter.buildInstances(context.getStack()); List<Resource> resources = resourceService.findAllByStackId(context.getStack().getId()); List<CloudResource> cloudResources = resourceConverter.convert(resources); List<CloudInstance> newCloudInstances = allKnownInstances.stream() .filter(this::isNewInstances) .collect(Collectors.toList()); CollectMetadataRequest request = new CollectMetadataRequest(context.getCloudContext(), context.getCloudCredential(), cloudResources, newCloudInstances, allKnownInstances); sendEvent(context, request.selector(), request); } private boolean isNewInstances(CloudInstance cloudInstance) { return unusedInstanceStatuses.contains(cloudInstance.getTemplate().getStatus()); } }; }

Target:
public Action<?, ?> extendMetadataAction() { return new AbstractUpscaleAction<>(StackEvent.class) { private final Set<InstanceStatus> unusedInstanceStatuses = Set.of(InstanceStatus.CREATE_REQUESTED, InstanceStatus.CREATED); @Override protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Extending metadata"); List<CloudInstance> allKnownInstances = cloudStackConverter.buildInstances(stack); List<Resource> resources = resourceService.findAllByStackId(stack.getId()); List<CloudResource> cloudResources = resourceConverter.convert(resources); List<CloudInstance> newCloudInstances = allKnownInstances.stream() .filter(this::isNewInstances) .collect(Collectors.toList()); CollectMetadataRequest request = new CollectMetadataRequest(context.getCloudContext(), context.getCloudCredential(), cloudResources, newCloudInstances, allKnownInstances); sendEvent(context, request.selector(), request); } private boolean isNewInstances(CloudInstance cloudInstance) { return unusedInstanceStatuses.contains(cloudInstance.getTemplate().getStatus()); } }; }
Source:
static String getHighestMessageLevel(Collection<MessagesContainer.AcceptedMessage> messages) { return messages. stream(). map(MessagesContainer.AcceptedMessage::getMessageLevel). max(VALUE_COMPARATOR). map(Message.MessageLevel::toString). orElse(null); }

Target:
static String getHighestMessageLevel(Collection<MessagesContainer.AcceptedMessage> messages) { return messages. stream(). map(MessagesContainer.AcceptedMessage::getMessageLevel). max(Message.MessageLevel.VALUE_COMPARATOR). map(Message.MessageLevel::toString). orElse(null); }
Source:
public void addMessageHandler(final Class<? extends Message> messageType, final MessageHandler handler) { if (messageType == null) { throw new IllegalArgumentException("Cannot add handler for null message type"); } if (handler == null) { throw new IllegalArgumentException("Cannot add null handler"); } synchronized (messageHandlers) { messageHandlers.computeIfAbsent(messageType, key -> new LinkedList<>()).add(handler); } }

Target:
public void addMessageHandler(final Class<? extends Message> messageType, final MessageHandler handler) { if (messageType == null) { throw new IllegalArgumentException("Cannot add handler for null message type"); } if (handler == null) { throw new IllegalArgumentException("Cannot add null handler"); } LOGGER.log(Level.FINEST, "Adding message handler {0} for message type: {1}", new Object[] {handler, messageType}); synchronized (messageHandlers) { messageHandlers.computeIfAbsent(messageType, key -> new LinkedList<>()).add(handler); } }
Source:
public void setGeoJsonLayer(AirMapGeoJsonLayer layer) { if (!isInitialized()) { return; } mapInterface.setGeoJsonLayer(layer); }

Target:
public void setGeoJsonLayer(AirMapGeoJsonLayer layer) throws JSONException { if (!isInitialized()) { return; } mapInterface.setGeoJsonLayer(layer); }
Source:
public Builder sourceType(Class<? extends CommandSource> senderType, boolean deep) { this.sourceType = senderType; sourceTypeDeep = deep; return this; }

Target:
public Builder sourceType(Class<? extends CommandSource> senderType, boolean deep) { checkNotNull(senderType, "sender type"); this.sourceType = senderType; this.sourceTypeDeep = deep; return this; }
Source:
private Map.Entry<String, String> toEntry(Method m) { String name = m.getName() .substring(1); String help; try { Class<?> c = m.getDeclaringClass(); Field field = c.getField(m.getName() + "Help"); help = (String) field.get(null); } catch (Exception e) { help = ""; } String h = help; return new Map.Entry<String, String>() { @Override public String getKey() { return name; } @Override public String getValue() { return h; } @Override public String setValue(String value) { throw new UnsupportedOperationException(); } }; }

Target:
private Map.Entry<String, String> toEntry(Method m) { String name = m.getName() .substring(1); String help; try { Class<?> c = m.getDeclaringClass(); Field field = c.getField(m.getName() + "Help"); help = (String) field.get(null); } catch (Exception e) { help = ""; } String h = help; return new AbstractMap.SimpleImmutableEntry<String, String>(name, h); }
Source:
public DynamicPeriodicTrigger(long period, TimeUnit timeUnit) { Assert.isTrue(period >= 0, "period must not be negative"); this.timeUnit = (timeUnit != null) ? timeUnit : TimeUnit.MILLISECONDS; this.period = this.timeUnit.toMillis(period); }

Target:
public DynamicPeriodicTrigger(long period, TimeUnit timeUnit) { Assert.isTrue(period >= 0, "period must not be negative"); Assert.notNull(timeUnit, "timeUnit must not be null"); this.timeUnit = timeUnit; this.period = this.timeUnit.toMillis(period); }
Source:
private static int getCurrentMilestoneIndex(List<TurboMilestone> allMilestones) { int currentIndex = -1; for (TurboMilestone checker : allMilestones) { if (checker.isOpen()) { if (checker.getDueDate().isPresent() && checker.getDueDate().get().isBefore(LocalDate.now()) && checker.getOpenIssues() == 0) { continue; } currentIndex = allMilestones.indexOf(checker); break; } } if (currentIndex == -1 && allMilestones.size() > 0) { currentIndex = allMilestones.size() - 1; } return currentIndex; }

Target:
private static Optional<Integer> getCurrentMilestoneIndex(List<TurboMilestone> allMilestones) { if (allMilestones.isEmpty()) { return Optional.empty(); } int currentIndex = 0; for (TurboMilestone checker : allMilestones) { boolean overdue = checker.getDueDate().isPresent() && checker.getDueDate().get().isBefore(LocalDate.now()); boolean relevant = !(overdue && (checker.getOpenIssues() == 0)); if (checker.isOpen() && relevant) { return Optional.of(currentIndex); } currentIndex++; } return Optional.of(allMilestones.size() - 1); }
Source:
public Action[] getActions(boolean context) { List<Action> actionsList = new ArrayList<>(); actionsList.addAll(Arrays.asList(super.getActions(true))); actionsList.add(new FileSystemDetailsAction(content)); if (!this.getDirectoryBrowseMode()) { actionsList.add(new ViewContextAction(Bundle.FileNode_getActions_viewFileInDir_text(), this)); actionsList.add(null); } actionsList.add(new NewWindowViewAction(Bundle.FileNode_getActions_viewInNewWin_text(), this)); actionsList.add(new ExternalViewerAction(Bundle.FileNode_getActions_openInExtViewer_text(), this)); actionsList.add(ViewFileInTimelineAction.createViewFileAction(getContent())); actionsList.add(null); actionsList.add(ExtractAction.getInstance()); actionsList.add(new HashSearchAction(Bundle.FileNode_getActions_searchFilesSameMD5_text(), this)); actionsList.add(null); actionsList.add(AddContentTagAction.getInstance()); final Collection<AbstractFile> selectedFilesList = new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class)); if (1 == selectedFilesList.size()) { actionsList.add(DeleteFileContentTagAction.getInstance()); } actionsList.addAll(ContextMenuExtensionPoint.getActions()); return actionsList.toArray(new Action[actionsList.size()]); }

Target:
public Action[] getActions(boolean context) { List<Action> actionsList = new ArrayList<>(); actionsList.addAll(Arrays.asList(super.getActions(true))); if (!this.getDirectoryBrowseMode()) { actionsList.add(new ViewContextAction(Bundle.FileNode_getActions_viewFileInDir_text(), this)); actionsList.add(null); } actionsList.add(new NewWindowViewAction(Bundle.FileNode_getActions_viewInNewWin_text(), this)); actionsList.add(new ExternalViewerAction(Bundle.FileNode_getActions_openInExtViewer_text(), this)); actionsList.add(ViewFileInTimelineAction.createViewFileAction(getContent())); actionsList.add(null); actionsList.add(ExtractAction.getInstance()); actionsList.add(new HashSearchAction(Bundle.FileNode_getActions_searchFilesSameMD5_text(), this)); actionsList.add(null); actionsList.add(AddContentTagAction.getInstance()); final Collection<AbstractFile> selectedFilesList = new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class)); if (1 == selectedFilesList.size()) { actionsList.add(DeleteFileContentTagAction.getInstance()); } actionsList.addAll(ContextMenuExtensionPoint.getActions()); return actionsList.toArray(new Action[actionsList.size()]); }
Source:
public static String getRedirectUriServerName(String name) { try { if (InetAddress.getByName(name) instanceof Inet6Address) { name = String.format("[%s]", name); } } catch (UnknownHostException ex) { log.error("Error getting redirect uri server name, unknown hostname : %s" , name); log.debug("Exception", ex); } return name; }

Target:
public static String getRedirectUriServerName(String name) { return InetAddressUtils.isIPv6Address(name) ? String.format("[%s]", name) : name; }
Source:
public void tryOpenUri(URI uri) { if (hostServices != null) { hostServices.showDocument(uri.toString()); } else if (desktop != null) { try { desktop.browse(uri); } catch (IOException e) { logger.warn("Could not open URI with 'Browse' action", e); } } }

Target:
public void tryOpenUri(URI uri) { if (hostServices != null) { hostServices.showDocument(uri.toString()); } else if (desktop != null) { try { desktop.browse(uri); } catch (IOException e) { logger.warn("Unable to open URI with 'Browse' action", e); } } }
Source:
public void onOutgoingEmergencySms(EmergencyNumber emergencyNumber) { Log.i(TAG, "onOutgoingEmergencySms: emergencyNumber=" + emergencyNumber); mOnOutgoingSmsEmergencyNumberChanged = emergencyNumber; }

Target:
public void onOutgoingEmergencySms(EmergencyNumber emergencyNumber) { synchronized (mLock) { mOnOutgoingSmsEmergencyNumberChanged = emergencyNumber; mLock.notify(); } }
Source:
public void validate() { if (hasLegacyConfiguration()) { if (isSizeBounded() || isCountBounded()) { CONFIG.ignoredMemoryDeprecatedSettings("size", memoryStorageConfigurationBuilder.size()); } else { translate(); } } if (isSizeBounded() && isCountBounded()) { throw CONFIG.cannotProvideBothSizeAndCount(); } checkBinaryRequirement(); EvictionStrategy strategy = evictionStrategy(); if (!strategy.isEnabled()) { if (isSizeBounded() || isCountBounded()) { EvictionStrategy newStrategy = EvictionStrategy.REMOVE; evictionStrategy(newStrategy); if (isCountBounded()) { CONFIG.debugf("Max entries configured (%d) without eviction strategy. Eviction strategy overridden to %s", maxCount(), newStrategy); } else { CONFIG.debugf("Max size configured (%d) without eviction strategy. Eviction strategy overridden to %s", maxSize(), newStrategy); } } else if (getBuilder().persistence().passivation() && strategy != EvictionStrategy.MANUAL && !getBuilder().template()) { CONFIG.passivationWithoutEviction(); } } else { if (!isCountBounded() && !isSizeBounded()) { throw CONFIG.invalidEvictionSize(); } if (strategy.isExceptionBased()) { TransactionConfigurationBuilder transactionConfiguration = getBuilder().transaction(); org.infinispan.transaction.TransactionMode transactionMode = transactionConfiguration.transactionMode(); if (transactionMode == null || !transactionMode.isTransactional() || transactionConfiguration.useSynchronization() || transactionConfiguration.use1PcForAutoCommitTransactions()) { throw CONFIG.exceptionBasedEvictionOnlySupportedInTransactionalCaches(); } } } }

Target:
public void validate() { }
Source:
IonSqlQueryBuilder(TypeManager typeManager) { this.typeManager = requireNonNull(typeManager, "typeManager is null"); }

Target:
public IonSqlQueryBuilder(TypeManager typeManager) { this.typeManager = requireNonNull(typeManager, "typeManager is null"); }
Source:
private boolean verifyInstructorCanViewPhoto(InstructorAttributes instructor, String section) { if (!instructor.isAllowedForPrivilege(section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS)) { return false; } return true; }

Target:
private void verifyInstructorCanViewPhoto(InstructorAttributes instructor, String section) { if (!instructor.isAllowedForPrivilege(section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS)) { throw new UnauthorizedAccessException("Instructor does not have enough privileges to view the photo"); } }
Source:
protected void write(final IFile file, final InputStream contents, final boolean force, IProgressMonitor monitor) throws CoreException { assertNotNull("file cannot be null", file); class WriteFileContents implements IWorkspaceRunnable { @Override public void run(IProgressMonitor jobMonitor) throws CoreException { int flags = force ? IResource.FORCE : IResource.NONE; IFileStore store = ((Resource) file).getStore(); assertNotNull("file store cannot be null", store); IFileInfo info = store.fetchInfo(); assertNotNull("file info cannot be null for file " + file, info); FileSystemResourceManager localManager = getLocalManager(); assertNotNull("file system resource manager cannot be null", localManager); localManager.write(file, contents, info, flags, false, jobMonitor); } } getWorkspace().run(new WriteFileContents(), null); }

Target:
protected void write(final IFile file, final InputStream contents, final boolean force, IProgressMonitor monitor) throws CoreException { assertNotNull("file cannot be null", file); class WriteFileContents implements IWorkspaceRunnable { @Override public void run(IProgressMonitor jobMonitor) throws CoreException { int flags = force ? IResource.FORCE : IResource.NONE; IFileStore store = ((Resource) file).getStore(); assertNotNull("file store cannot be null", store); IFileInfo info = store.fetchInfo(); assertNotNull("file info cannot be null for file " + file, info); FileSystemResourceManager localManager = getLocalManager(); assertNotNull("file system resource manager cannot be null", localManager); localManager.write(file, contents, info, flags, false, jobMonitor); } } IWorkspace workspace = getWorkspace(); assertNotNull("workspace cannot be null", workspace); workspace.run(new WriteFileContents(), null); }
Source:
public void render(Response response) { CharSequence js = getJavaScript(); if (Strings.isEmpty(js) == false) { JavaScriptUtils.writeJavaScript(response, "var f = function() {" + js + ";};\nif ('loaded' === document.readyState) f(); else window.addEventListener('load', f);"); } }

Target:
public void render(Response response) { CharSequence js = getJavaScript(); if (Strings.isEmpty(js) == false) { JavaScriptUtils.writeJavaScript(response, "(function() {var f = function() {" + js + ";};\nif ('complete' === document.readyState) f(); else window.addEventListener('load', f);})();"); } }
Source:
private static ImmutableList<StructMember> convertDs3Elements(final ImmutableList<Ds3Element> elementsList, final ImmutableSet<String> enumNames) throws ParseException { final ImmutableList.Builder<StructMember> builder = ImmutableList.builder(); for (final Ds3Element currentElement : elementsList) { if (currentElement.getName().equals("StorageClass")) continue; builder.add(new StructMember(C_TypeHelper.convertDs3ElementType(currentElement, enumNames), StructHelper.getNameUnderscores(currentElement.getName()))); } return builder.build(); }

Target:
private static ImmutableList<StructMember> convertDs3Elements(final ImmutableList<Ds3Element> elementsList, final ImmutableSet<String> enumNames) throws ParseException { final ImmutableList.Builder<StructMember> builder = ImmutableList.builder(); for (final Ds3Element currentElement : elementsList) { builder.add(new StructMember( C_TypeHelper.convertDs3ElementType(currentElement, enumNames), StructHelper.getNameUnderscores(currentElement.getName()))); } return builder.build(); }
Source:
public CacheConfigurationBuilder<K, V> withService(ServiceConfiguration<?, ?> config) { @SuppressWarnings("unchecked") Collection<? extends ServiceConfiguration<?, ?>> others = getServices((Class<? extends ServiceConfiguration<?, ?>>) config.getClass()); CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this); for (ServiceConfiguration<?, ?> other : others) { if (!other.compatibleWith(config)) { otherBuilder.serviceConfigurations.remove(other); } } otherBuilder.serviceConfigurations.add(config); return otherBuilder; }

Target:
public CacheConfigurationBuilder<K, V> withService(ServiceConfiguration<?, ?> config) { CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this); otherBuilder.serviceConfigurations.removeIf(other -> !other.compatibleWith(config) || !config.compatibleWith(other)); otherBuilder.serviceConfigurations.add(config); return otherBuilder; }
Source:
public Response getAllServices(@HeaderParam(HttpHeaders.IF_NONE_MATCH) String ifNoneMatch, @HeaderParam(HttpHeaders.ACCEPT_ENCODING) String acceptEncoding) { CachedBaragonState state = stateCache.getState(); String verisonString = Integer.toString(state.getVersion()); System.out.println(ifNoneMatch); if (ifNoneMatch != null && ifNoneMatch.equals(verisonString.trim())) { return Response.notModified() .header(HttpHeaders.ETAG, state.getVersion()) .build(); } ResponseBuilder builder = Response.ok(); final byte[] entity; if (acceptEncoding != null && acceptEncoding.contains("gzip")) { builder.header(HttpHeaders.CONTENT_ENCODING, "gzip"); entity = state.getGzip(); } else { entity = state.getUncompressed(); } return builder .entity(entity) .header(HttpHeaders.ETAG, state.getVersion()) .build(); }

Target:
public Response getAllServices(@HeaderParam(HttpHeaders.IF_NONE_MATCH) String ifNoneMatch, @HeaderParam(HttpHeaders.ACCEPT_ENCODING) String acceptEncoding) { CachedBaragonState state = stateCache.getState(); String verisonString = Integer.toString(state.getVersion()); if (ifNoneMatch != null && ifNoneMatch.equals(verisonString.trim())) { return Response.notModified() .header(HttpHeaders.ETAG, state.getVersion()) .build(); } ResponseBuilder builder = Response.ok(); final byte[] entity; if (acceptEncoding != null && acceptEncoding.contains("gzip")) { builder.header(HttpHeaders.CONTENT_ENCODING, "gzip"); entity = state.getGzip(); } else { entity = state.getUncompressed(); } return builder .entity(entity) .header(HttpHeaders.ETAG, state.getVersion()) .build(); }
Source:
public static void startJetty(String rmUrl, String scheduleUrl) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, scheduleUrl)); if (applicationUrls != null) { for (String applicationUrl : applicationUrls) { if (applicationUrl.endsWith("/rest")) { if (!PASchedulerProperties.SCHEDULER_REST_URL.isSet()) { PASchedulerProperties.SCHEDULER_REST_URL.updateProperty(applicationUrl); } } if (applicationUrl.endsWith("/catalog")) { if (!PASchedulerProperties.CATALOG_REST_URL.isSet()) { PASchedulerProperties.CATALOG_REST_URL.updateProperty(applicationUrl); } } } } }

Target:
public static void startJetty(String rmUrl, String scheduleUrl) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, scheduleUrl)); if (applicationUrls != null) { for (String applicationUrl : applicationUrls) { if (applicationUrl.endsWith("/rest") && !PASchedulerProperties.SCHEDULER_REST_URL.isSet()) { PASchedulerProperties.SCHEDULER_REST_URL.updateProperty(applicationUrl); } if (applicationUrl.endsWith("/catalog") && !PASchedulerProperties.CATALOG_REST_URL.isSet()) { PASchedulerProperties.CATALOG_REST_URL.updateProperty(applicationUrl); } } } }
Source:
public static boolean isMixedCase(final CharSequence cs) { if (cs == null || isEmpty(cs)) { return false; } boolean containsUppercase = false; boolean containsLowercase = false; final int sz = cs.length(); for (int i = 0; i < sz; i++) { if (Character.isUpperCase(cs.charAt(i)) == true) { containsUppercase = true; } else if (Character.isLowerCase(cs.charAt(i)) == true) { containsLowercase = true; } else { return false; } } return containsUppercase && containsLowercase; }

Target:
public static boolean isMixedCase(final CharSequence cs) { if (cs == null || isEmpty(cs) || cs.length() <= 1) { return false; } boolean containsUppercase = false; boolean containsLowercase = false; final int sz = cs.length(); for (int i = 0; i < sz; i++) { if (containsUppercase && containsLowercase) { return true; } else if (Character.isUpperCase(cs.charAt(i))) { containsUppercase = true; } else if (Character.isLowerCase(cs.charAt(i))) { containsLowercase = true; } } return containsUppercase && containsLowercase; }
Source:
private Iterable<String> experimentsWithMetadataProvider() { return jdbcUtils.getPublicSingleCellExperimentAccessions() .stream() .filter(accession -> !accession.equalsIgnoreCase("E-GEOD-99058")) .collect(Collectors.toSet()); }

Target:
private Stream<String> experimentsWithMetadataProvider() { return jdbcUtils.getPublicSingleCellExperimentAccessions() .stream() .filter(accession -> !accession.equalsIgnoreCase("E-GEOD-99058")); }
Source:
public Image getImage(Object element) { if (element instanceof CanvasViewInfo) { element = ((CanvasViewInfo) element).getUiViewNode(); } if (element instanceof UiElementNode) { UiElementNode node = (UiElementNode) element; ElementDescriptor desc = node.getDescriptor(); if (desc != null) { Image img = null; if (desc.getUiName().equals(LINEAR_LAYOUT)) { Element e = (Element) node.getXmlNode(); if (VALUE_VERTICAL.equals(e.getAttributeNS(ANDROID_URI, ATTR_ORIENTATION))) { IconFactory factory = IconFactory.getInstance(); img = factory.getIcon("VerticalLinearLayout"); } } if (img == null) { img = desc.getFormIcon(); } if (img != null) { if (node.hasError()) { return new ErrorImageComposite(img).createImage(); } else { return img; } } } } return AdtPlugin.getAndroidLogo(); }

Target:
public Image getImage(Object element) { if (element instanceof CanvasViewInfo) { element = ((CanvasViewInfo) element).getUiViewNode(); } if (element instanceof UiElementNode) { UiElementNode node = (UiElementNode) element; ElementDescriptor desc = node.getDescriptor(); if (desc != null) { Image img = null; if (desc.getUiName().equals(LINEAR_LAYOUT)) { Element e = (Element) node.getXmlNode(); if (VALUE_VERTICAL.equals(e.getAttributeNS(ANDROID_URI, ATTR_ORIENTATION))) { IconFactory factory = IconFactory.getInstance(); img = factory.getIcon("VerticalLinearLayout"); } } if (img == null) { img = desc.getCustomizedIcon(); } if (img != null) { if (node.hasError()) { return new ErrorImageComposite(img).createImage(); } else { return img; } } } } return AdtPlugin.getAndroidLogo(); }
Source:
public String[] getLines() { return (String[]) lines.toArray(new String[lines.size()]); }

Target:
public synchronized List<String> getLines() { return new ArrayList<>(lines); }
Source:
public Runtime(ResourceLoader resourceLoader, ClassLoader classLoader, Collection<? extends Backend> backends, RuntimeOptions runtimeOptions) { this(resourceLoader, classLoader, backends, runtimeOptions, new UndefinedStepsTracker()); }

Target:
public Runtime(ResourceLoader resourceLoader, ClassLoader classLoader, Collection<? extends Backend> backends, RuntimeOptions runtimeOptions) { this(resourceLoader, classLoader, backends, runtimeOptions, null); }