auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String get() { WebElement e = resolve(); return ((JavascriptExecutor)driver).executeScript("return arguments[0].value;", e).toString(); }

Target:
public String get() { return resolve().getAttribute("value"); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mListView.setSelector(new StateListDrawable()); mListView.setOnTouchListener(this); String theme = Utils.getTheme(getActivity()); if (!mIsMiniMonth) { if (theme.equals("dark")) { mListView.setBackgroundColor(getResources().getColor(R.color.month_bgcolor_dark)); } else { mListView.setBackgroundColor(getResources().getColor(R.color.month_bgcolor)); } } if (mShowCalendarControls) { mListView.postDelayed(mLoadingRunnable, mEventsLoadingDelay); } else { mLoader = (CursorLoader) getLoaderManager().initLoader(0, null, this); } mAdapter.setListView(mListView); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mListView.setSelector(new StateListDrawable()); mListView.setOnTouchListener(this); String theme = Utils.getTheme(getActivity()); if (!mIsMiniMonth) { mListView.setBackgroundColor(theme.equals("dark") ? (getResources().getColor(R.color.month_bgcolor_dark)) : (getResources().getColor(R.color.month_bgcolor))); } if (mShowCalendarControls) { mListView.postDelayed(mLoadingRunnable, mEventsLoadingDelay); } else { mLoader = (CursorLoader) getLoaderManager().initLoader(0, null, this); } mAdapter.setListView(mListView); }
Source:
public Object apply(RevisionResource rsrc) throws AuthException, BadRequestException, ResourceConflictException, Exception { return Response.withMustRevalidate(delegate.format(rsrc)); }

Target:
public Object apply(RevisionResource rsrc) throws AuthException, BadRequestException, ResourceConflictException, Exception { return Response.withMustRevalidate(delegate.get().format(rsrc)); }
Source:
protected void changeState(TraceChannelComponent channel, List<String> eventNames, TraceLogLevel logLevel, LogLevelType logLevelType, TraceEventType eventType, String probe, IProgressMonitor monitor) throws ExecutionException{ if (logLevelType.equals(LogLevelType.LOGLEVEL_NONE) || logLevelType.equals(LogLevelType.LOGLEVEL_ALL)) { switch (eventType) { case FUNCTION: channel.enableProbe(String.join(",", eventNames), true, probe, monitor); break; case PROBE: channel.enableProbe(String.join(",", eventNames), false, probe, monitor); break; case SYSCALL: channel.enableSyscalls(eventNames, monitor); break; case TRACEPOINT: channel.enableEvents(eventNames, monitor); break; case UNKNOWN: break; default: break; } } else { channel.enableLogLevel(eventNames, logLevelType, logLevel, null, TraceDomainType.UNKNOWN, monitor); } }

Target:
protected void changeState(TraceChannelComponent channel, List<String> eventNames, TraceLogLevel logLevel, LogLevelType logLevelType, TraceEventType eventType, String probe, IProgressMonitor monitor) throws ExecutionException{ if (logLevelType.equals(LogLevelType.LOGLEVEL_NONE) || logLevelType.equals(LogLevelType.LOGLEVEL_ALL)) { switch (eventType) { case FUNCTION: channel.enableProbe(String.join(",", eventNames), true, probe, monitor); break; case PROBE: channel.enableProbe(String.join(",", eventNames), false, probe, monitor); break; case SYSCALL: channel.enableSyscalls(eventNames, monitor); break; case TRACEPOINT: channel.enableEvents(eventNames, monitor); break; case UNKNOWN: break; default: break; } } else { channel.enableLogLevel(eventNames, logLevelType, logLevel, null, channel.getDomain(), monitor); } }
Source:
public void testValidateOkStatus() throws OseeCoreException { Artifact newTemplate = ArtifactTypeManager.addArtifact(CoreArtifactTypes.RendererTemplate, testBranch); newTemplate.persist(testInfo.getQualifiedTestName()); TemplateArtifactValidator validator = new TemplateArtifactValidator(); IStatus status = validator.validate(newTemplate, CoreAttributeTypes.TemplateMatchCriteria, GUID.create()); Assert.assertTrue(status.isOK()); }

Target:
public void testValidateOkStatus() throws OseeCoreException { Artifact newTemplate = ArtifactTypeManager.addArtifact(CoreArtifactTypes.RendererTemplate, testBranch); newTemplate.persist(testInfo.getQualifiedTestName()); TemplateArtifactValidator validator = new TemplateArtifactValidator(); String templateId = GUID.create(); IStatus status = validator.validate(newTemplate, CoreAttributeTypes.TemplateMatchCriteria, templateId); Assert.assertTrue(status.isOK()); newTemplate.addAttributeFromString(CoreAttributeTypes.TemplateMatchCriteria, templateId); newTemplate.persist(testInfo.getQualifiedTestName()); newTemplate = ArtifactTypeManager.addArtifact(CoreArtifactTypes.RendererTemplate, testBranch); newTemplate.persist(testInfo.getQualifiedTestName()); templateId = GUID.create(); status = validator.validate(newTemplate, CoreAttributeTypes.TemplateMatchCriteria, templateId); Assert.assertTrue(status.isOK()); newTemplate.persist(testInfo.getQualifiedTestName()); }
Source:
protected void initTooltip() { tooltip = new WidgetTooltip(getContents()); tooltip.setPlacement(Placement.BOTTOM); String tooltipContent = infoPopup.getTooltipContent(item, this); if (tooltipContent != null) { tooltip.setHtml(SafeHtmlUtils.fromTrustedString(tooltipContent)); } }

Target:
protected void initTooltip() { tooltip = new WidgetTooltip(getContents()); tooltip.setPlacement(Placement.BOTTOM); String tooltipContent = infoPopup.getTooltipContent(item); if (tooltipContent != null) { tooltip.setHtml(SafeHtmlUtils.fromTrustedString(tooltipContent)); } }
Source:
protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); if (this.mongoTemplate == null) { this.mongoTemplate = new ReactiveMongoTemplate(this.mongoDbFactory, this.mongoConverter); } this.initialized = true; }

Target:
protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); if (this.mongoTemplate == null) { this.mongoTemplate = new ReactiveMongoTemplate(this.mongoDbFactory, this.mongoConverter); } this.initialized = true; }
Source:
public void buttonHelpWithConnectionCallsOpenHelpSite() { onView(withId(R.id.main_menu_button_help)) .perform(click()); assertTrue(UiTestUtils.getCurrentActivity() instanceof WebViewActivity); pressBack(); }

Target:
public void buttonHelpWithConnectionCallsOpenHelpSite() { onView(withId(R.id.main_menu_button_help)) .perform(click()); Activity activity = UiTestUtils.getCurrentActivity(); assertTrue(isWebViewActivity(activity)); String url = ((WebViewActivity)activity).getUrl(); assertTrue(url.contains(Constants.CATROBAT_HELP_URL)); pressBack(); }
Source:
public void process(WatchedEvent event) { ReplyHeader h = new ReplyHeader(-1, -1L, 0); if (LOG.isTraceEnabled()) { ZooTrace.logTraceMessage( LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK, "Deliver event " + event + " to 0x" + Long.toHexString(this.sessionId) + " through " + this); } WatcherEvent e = event.getWrapper(); sendResponse(h, e, "notification", null, null, -1); }

Target:
public void process(WatchedEvent event) { ReplyHeader h = new ReplyHeader(-1, -1L, 0); if (LOG.isTraceEnabled()) { ZooTrace.logTraceMessage( LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK, "Deliver event " + event + " to 0x" + Long.toHexString(this.sessionId) + " through " + this); } WatcherEvent e = event.getWrapper(); sendResponse(h, e, "notification", null, null, ZooDefs.OpCode.error); }
Source:
public ClusterSetup(String zkServerAddress) { _zkServerAddress = zkServerAddress; RealmAwareZkClient zkClient; try { zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), new RealmAwareZkClient.RealmAwareZkClientConfig()); } catch (InvalidRoutingDataException | IOException | IllegalStateException e) { if (zkServerAddress == null || zkServerAddress.isEmpty()) { throw new IllegalArgumentException("ZK server address is null or empty!"); } zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(_zkServerAddress)); zkClient.setZkSerializer(new ZNRecordSerializer()); } _zkClient = zkClient; _admin = new ZKHelixAdmin(_zkClient); _usesExternalZkClient = false; }

Target:
public ClusterSetup(String zkServerAddress) { if (Boolean.parseBoolean(System.getProperty(SystemPropertyKeys.MULTI_ZK_ENABLED))) { try { _zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), new RealmAwareZkClient.RealmAwareZkClientConfig() .setZkSerializer(new ZNRecordSerializer())); } catch (IOException | InvalidRoutingDataException | IllegalStateException e) { throw new HelixException("Failed to create ConfigAccessor!", e); } } else { _zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkServerAddress)); _zkClient.setZkSerializer(new ZNRecordSerializer()); } _admin = new ZKHelixAdmin(_zkClient); _usesExternalZkClient = false; }
Source:
public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); if (egitChangeListener == null) { egitChangeListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource project = event.getResource(); if (project instanceof IProject) GitProjectData.reconfigureWindowCache(); } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(egitChangeListener, IResourceChangeEvent.PRE_DELETE); } }

Target:
public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); if (preDeleteProjectListener == null) { preDeleteProjectListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource project = event.getResource(); if (project instanceof IProject) GitProjectData.reconfigureWindowCache(); } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(preDeleteProjectListener, IResourceChangeEvent.PRE_DELETE); } }
Source:
protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else { this.enabled = true; } } if (enabled) { boolean initialDelay = properties == null || !"false".equalsIgnoreCase((String) properties.get("initialDelay")); if (initialDelay) { executor = Executors.newSingleThreadScheduledExecutor(); linkRegistry.addRegistryChangeListener(linkRegistryLastUpdateListener); itemRegistry.addRegistryHook(itemRegistryLastUpdateListener); delayedInitialize(); } else { initialize(); } } else { if (executor != null) { executor.shutdownNow(); executor = null; } removeLastUpdateListeners(); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }

Target:
protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else { this.enabled = true; } } if (enabled) { addRegistryChangeListeners(); boolean initialDelay = properties == null || !"false".equalsIgnoreCase((String) properties.get("initialDelay")); if (initialDelay) { executor = Executors.newSingleThreadScheduledExecutor(); delayedInitialize(); } else { initialize(); } } else { logger.debug("Disabling channel item provider."); if (executor != null) { executor.shutdownNow(); executor = null; } for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }
Source:
public Bundle createNewAccount(String accountName, String username, String refreshToken, String authToken, String instanceUrl, String loginUrl, String clientId, String orgId, String userId, String passcodeHash, String clientSecret) { Bundle extras = new Bundle(); extras.putString(AccountManager.KEY_ACCOUNT_NAME, accountName); extras.putString(AccountManager.KEY_ACCOUNT_TYPE, getAccountType()); extras.putString(AuthenticatorService.KEY_USERNAME, username); extras.putString(AuthenticatorService.KEY_LOGIN_URL, loginUrl); extras.putString(AuthenticatorService.KEY_INSTANCE_URL, instanceUrl); extras.putString(AuthenticatorService.KEY_CLIENT_ID, clientId); extras.putString(AuthenticatorService.KEY_ORG_ID, orgId); extras.putString(AuthenticatorService.KEY_USER_ID, userId); extras.putString(AuthenticatorService.KEY_CLIENT_SECRET, clientSecret); extras.putString(AccountManager.KEY_AUTHTOKEN, Encryptor.encrypt(authToken, passcodeHash)); Account acc = new Account(accountName, getAccountType()); accountManager.addAccountExplicitly(acc, Encryptor.encrypt(refreshToken, passcodeHash), extras); accountManager.setAuthToken(acc, AccountManager.KEY_AUTHTOKEN, authToken); return extras; }

Target:
public Bundle createNewAccount(String accountName, String username, String refreshToken, String authToken, String instanceUrl, String loginUrl, String clientId, String orgId, String userId, String passcodeHash, String clientSecret) { Bundle extras = new Bundle(); extras.putString(AccountManager.KEY_ACCOUNT_NAME, accountName); extras.putString(AccountManager.KEY_ACCOUNT_TYPE, getAccountType()); extras.putString(AuthenticatorService.KEY_USERNAME, username); extras.putString(AuthenticatorService.KEY_LOGIN_URL, loginUrl); extras.putString(AuthenticatorService.KEY_INSTANCE_URL, instanceUrl); extras.putString(AuthenticatorService.KEY_CLIENT_ID, clientId); extras.putString(AuthenticatorService.KEY_ORG_ID, orgId); extras.putString(AuthenticatorService.KEY_USER_ID, userId); if (clientSecret != null) { extras.putString(AuthenticatorService.KEY_CLIENT_SECRET, clientSecret); } extras.putString(AccountManager.KEY_AUTHTOKEN, Encryptor.encrypt(authToken, passcodeHash)); Account acc = new Account(accountName, getAccountType()); accountManager.addAccountExplicitly(acc, Encryptor.encrypt(refreshToken, passcodeHash), extras); accountManager.setAuthToken(acc, AccountManager.KEY_AUTHTOKEN, authToken); return extras; }
Source:
public void propertyChange(PropertyChangeEvent event) { if (getBackgroundColorKey().equals(event.getProperty()) || ((getForegroundColorKey() != null) && getForegroundColorKey().equals(event.getProperty()))) { inititalizeColors(); } }

Target:
public void propertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (property.equals(getBackgroundColorKey()) || property.equals(getForegroundColorKey())) { inititalizeColors(); } }
Source:
public static boolean readBooleanFromByte(byte containerByte, int bitOffset) { if (isBitEnabled(containerByte, bitOffset)) return true; return false; }

Target:
public static boolean readBooleanFromByte(byte containerByte, int bitOffset) { return isBitEnabled(containerByte, bitOffset); }
Source:
private void findTargetLineBreakpoint( final IBreakpointsTargetDMContext bpTargetDMC, final List<MIBreakpoint> candidates, final String fileName, final Integer lineNumber, final String function, final String address, final Boolean isHardware, final Boolean isTemporary, final DataRequestMonitor<MIBreakpoint> drm) { class FindBreakpointRM extends ImmediateDataRequestMonitor<MIBreakpoint> { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { final List<MIBreakpoint> bpts = new ArrayList<MIBreakpoint>(candidates); if (bpts.isEmpty()) { drm.done(); return; } final MIBreakpoint bpt = bpts.remove(0); final String debuggerPath = getFileName(bpt); getSource( bpTargetDMC, debuggerPath, new DataRequestMonitor<String>(getExecutor(), drm) { @Override @ConfinedToDsfExecutor( "fExecutor" ) protected void handleCompleted() { if (!isSuccess()) { GdbPlugin.log(getStatus()); } if (compareBreakpointAttributes( bpt, isSuccess() ? getData() : debuggerPath, fileName, lineNumber, function, address, isHardware, isTemporary)) { drm.setData(bpt); drm.done(); } else { new FindBreakpointRM().done(); } } }); } }; new FindBreakpointRM().done(); }

Target:
private void findTargetLineBreakpoint( final IBreakpointsTargetDMContext bpTargetDMC, final List<MIBreakpoint> candidates, final String fileName, final Integer lineNumber, final String function, final String address, final Boolean isHardware, final Boolean isTemporary, final DataRequestMonitor<MIBreakpoint> drm) { final List<MIBreakpoint> bpts = new ArrayList<MIBreakpoint>(candidates); class FindBreakpointRM extends ImmediateDataRequestMonitor<MIBreakpoint> { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { if (bpts.isEmpty()) { drm.done(); return; } final MIBreakpoint bpt = bpts.remove(0); final String debuggerPath = getFileName(bpt); getSource( bpTargetDMC, debuggerPath, new DataRequestMonitor<String>(getExecutor(), drm) { @Override @ConfinedToDsfExecutor( "fExecutor" ) protected void handleCompleted() { if (!isSuccess()) { GdbPlugin.log(getStatus()); } if (compareBreakpointAttributes( bpt, isSuccess() ? getData() : debuggerPath, fileName, lineNumber, function, address, isHardware, isTemporary)) { drm.setData(bpt); drm.done(); } else { new FindBreakpointRM().done(); } } }); } }; new FindBreakpointRM().done(); }
Source:
public void execute(CommandContext commandContext) { RuntimeService runtimeService = commandContext.getProcessEngineConfiguration() .getRuntimeService(); new Thread(() -> { try { ThrowMessage message = messageQueue.take(); Map<String, Object> payload = message.getPayload() .orElse(null); runtimeService.messageEventReceived(message.getName(), executionId, payload); waitingCountDownLatchRef.get() .countDown(); } catch (InterruptedException e) { e.printStackTrace(); } finally { removeSubscription(key); } }).start(); }

Target:
public void execute(CommandContext commandContext) { RuntimeService runtimeService = commandContext.getProcessEngineConfiguration() .getRuntimeService(); new Thread(() -> { try { ThrowMessage message = messageQueue.take(); Map<String, Object> payload = message.getPayload() .orElse(null); runtimeService.messageEventReceived(message.getName(), executionId, payload); waitingCountDownLatchRef.get() .countDown(); } catch (InterruptedException e) { log.error(e.getMessage(), e); } finally { removeSubscription(key); } }).start(); }
Source:
public void minutesOutOfRange() { Assert.assertEquals(0, new GmtTimeZone(false, 60, 0)); }

Target:
public void minutesOutOfRange() { new GmtTimeZone(false, 0, 60); }
Source:
public List<WorkflowActionletParameter> getParameters() { final List<WorkflowActionletParameter> params = new ArrayList<>(); params.add(new WorkflowActionletParameter(PARAM_ENVIRONMENT, "Name of the Environment", "", true)); params.add(new WorkflowActionletParameter(PARAM_FORCE_PUSH, "Force the Push? true or false", "false", true)); params.add(new WorkflowActionletParameter(PARAM_FILTER_KEY, "Filter", "", true)); return params; }

Target:
public List<WorkflowActionletParameter> getParameters() { final List<WorkflowActionletParameter> params = new ArrayList<>(); params.add(new WorkflowActionletParameter(PARAM_ENVIRONMENT, Try.of(()->LanguageUtil.get("pushNowActionlet.environments.name")).getOrElse("Name of the Environments"), "", true)); final Collection<FilterDescriptor> filterDescriptorMap = Try.of(()->APILocator.getPublisherAPI().getFiltersDescriptorsByRole(APILocator.systemUser())).get(); final FilterDescriptor defaultFilter = filterDescriptorMap.stream().filter(filterDescriptor -> filterDescriptor.isDefaultFilter()).findFirst().get(); final List<MultiKeyValue> multiKeyValueFilterList = new ArrayList<>(); filterDescriptorMap.stream().forEach(filterDescriptor -> multiKeyValueFilterList.add(new MultiKeyValue(filterDescriptor.getKey(),filterDescriptor.getTitle()))); params.add(new MultiSelectionWorkflowActionletParameter(PARAM_FILTER_KEY, Try.of(()->LanguageUtil.get("pushNowActionlet.filter")).getOrElse("Name of the Environments"), defaultFilter.getKey(), true,()->multiKeyValueFilterList)); return params; }
Source:
public void onRequestPermissionsResult(final int requestCode, @NonNull String permissions[], @NonNull final int[] grantResults) { answered = true; waiting = false; if (requestCode == REQUEST_LOCATION) { new Handler().postDelayed(new Runnable() { @Override public void run() { boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED; LocationGMS.sendAndClearPromptHandlers(true, granted); if (granted) { LocationGMS.startGetLocation(); } else { if (fallbackToSettings && neverAskAgainClicked && !ActivityCompat.shouldShowRequestPermissionRationale(PermissionsActivity.this, LocationGMS.requestPermission)) { showLocationPermissionSettings(); } LocationGMS.fireFailedComplete(); } } }, DELAY_TIME_CALLBACK_CALL); } ActivityLifecycleHandler.removeActivityAvailableListener(TAG); finish(); overridePendingTransition(R.anim.onesignal_fade_in, R.anim.onesignal_fade_out); }

Target:
public void onRequestPermissionsResult(final int requestCode, @NonNull String permissions[], @NonNull final int[] grantResults) { answered = true; waiting = false; if (requestCode == REQUEST_LOCATION) { new Handler().postDelayed(new Runnable() { @Override public void run() { boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED; OneSignal.PromptActionResult result = granted ? OneSignal.PromptActionResult.PERMISSION_GRANTED : OneSignal.PromptActionResult.PERMISSION_DENIED; LocationGMS.sendAndClearPromptHandlers(true, result); if (granted) { LocationGMS.startGetLocation(); } else { attemptToShowLocationPermissionSettings(); LocationGMS.fireFailedComplete(); } } }, DELAY_TIME_CALLBACK_CALL); } ActivityLifecycleHandler.removeActivityAvailableListener(TAG); finish(); overridePendingTransition(R.anim.onesignal_fade_in, R.anim.onesignal_fade_out); }
Source:
List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .peek(drgElementWithNamespace(anImport)) .collect(Collectors.toList()); }

Target:
List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collectors.toList()); }
Source:
public List<String> getSecurityOpts() { return this.securityOpts; }

Target:
public List<String> getSecurityOpts() { return securityOpts; }
Source:
protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> voidHandback) throws OperationFailedException { boolean reloadRequired = super.applyUpdateToRuntime(context, operation, attributeName, resolvedValue, currentValue, voidHandback); if (reloadRequired) { final ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ModelNode relativeTo = DeploymentScannerDefinition.RELATIVE_TO.resolveModelAttribute(context, model); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { File fullPath; if (relativeTo.isDefined()) { final String fullPathName = pathManager.resolveRelativePathEntry(resolvedValue.asString(), relativeTo.asString()); fullPath = new File(fullPathName); } else { fullPath = new File(resolvedValue.asString()); } if (!fullPath.exists()) { ROOT_LOGGER.directoryIsNonexistent(fullPath.getAbsolutePath()); } else if (!fullPath.isDirectory()) { ROOT_LOGGER.isNotADirectory(fullPath.getAbsolutePath()); } else if (!fullPath.canWrite()) { ROOT_LOGGER.directoryIsNotWritable(fullPath.getAbsolutePath()); } } }, Stage.RUNTIME); } return reloadRequired; }

Target:
protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> voidHandback) throws OperationFailedException { boolean reloadRequired = super.applyUpdateToRuntime(context, operation, attributeName, resolvedValue, currentValue, voidHandback); if (reloadRequired) { context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ModelNode relativeTo = DeploymentScannerDefinition.RELATIVE_TO.resolveModelAttribute(context, model); Path fullPath; if (relativeTo.isDefined()) { final String fullPathName = pathManager.resolveRelativePathEntry(resolvedValue.asString(), relativeTo.asString()); fullPath = Paths.get(fullPathName); } else { fullPath = Paths.get(resolvedValue.asString()); } if (!Files.exists(fullPath)) { ROOT_LOGGER.directoryIsNonexistent(fullPath.toString()); } else if (!Files.isDirectory(fullPath)) { ROOT_LOGGER.isNotADirectory(fullPath.toString()); } else if (!Files.isReadable(fullPath)) { ROOT_LOGGER.directoryIsNotWritable(fullPath.toString()); } } }, Stage.RUNTIME); } return reloadRequired; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } return this.repository.equals(((RepositoryKey) obj).getRepository()); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } return this.repository.equals(((RepositoryKey) obj).getRepository()); }
Source:
private boolean isPrimitiveType(TextElement textElement) { if (textElement instanceof TokenTextElement) { TokenTextElement tokenTextElement = (TokenTextElement)textElement; if (tokenTextElement.getTokenKind() == ASTParserConstants.BYTE) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.CHAR) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.SHORT) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.INT) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.LONG) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.FLOAT) { return true; } if (tokenTextElement.getTokenKind() == ASTParserConstants.DOUBLE) { return true; } return false; } else { return false; } }

Target:
private boolean isPrimitiveType(TextElement textElement) { if (textElement instanceof TokenTextElement) { TokenTextElement tokenTextElement = (TokenTextElement)textElement; int tokenKind = tokenTextElement.getTokenKind(); return tokenKind == ASTParserConstants.BYTE || tokenKind == ASTParserConstants.CHAR || tokenKind == ASTParserConstants.SHORT || tokenKind == ASTParserConstants.INT || tokenKind == ASTParserConstants.LONG || tokenKind == ASTParserConstants.FLOAT || tokenKind == ASTParserConstants.DOUBLE; } else { return false; } }
Source:
public void onDropItemRequest(DropItemRequest event, EntityRef character) { if (!event.getItem().exists() || !networkSystem.getOwnerEntity(event.getItem()).equals(networkSystem.getOwnerEntity(character))) { return; } EntityRef pickupItem = event.getItem(); EntityRef owner = pickupItem.getOwner(); if (owner.hasComponent(InventoryComponent.class)) { final EntityRef removedItem = inventoryManager.removeItem(owner, EntityRef.NULL, pickupItem, false, 1); if (removedItem != null) { pickupItem = removedItem; } } pickupItem.getComponent(ItemComponent.class).pickUpTime = 2000; pickupItem.send(new DropItemEvent(event.getNewPosition())); pickupItem.send(new ImpulseEvent(event.getImpulse())); }

Target:
public void onDropItemRequest(DropItemRequest event, EntityRef character) { if (!event.getItem().exists() || !networkSystem.getOwnerEntity(event.getItem()).equals(networkSystem.getOwnerEntity(character))) { return; } EntityRef pickupItem = event.getItem(); EntityRef owner = pickupItem.getOwner(); if (owner.hasComponent(InventoryComponent.class)) { final EntityRef removedItem = inventoryManager.removeItem(owner, EntityRef.NULL, pickupItem, false, 1); if (removedItem != null) { pickupItem = removedItem; } } ItemComponent itemComponent = pickupItem.getComponent(ItemComponent.class); itemComponent.timeToPickUp = 2000; itemComponent.pickUpTime = time.getGameTimeInMs(); pickupItem.saveComponent(itemComponent); pickupItem.send(new DropItemEvent(event.getNewPosition())); pickupItem.send(new ImpulseEvent(event.getImpulse())); }
Source:
public void resumeTransaction() { SuspendedTransactionImpl suspendedTransaction = transaction.cast(SuspendedTransactionImpl.class); suspendedTransaction.resume(); transaction.set(suspendedTransaction.getTransaction()); }

Target:
public void resumeTransaction() { SuspendedTransactionImpl suspendedTransaction = transaction.getTransactionOfRequiredType(SuspendedTransactionImpl.class); suspendedTransaction.resume(); transaction.set(suspendedTransaction.getTransaction()); }
Source:
public void movePanelRight(int panelIndex) { if (this.getNumberOfPanels() >= 2) { int other = -1; if (panelIndex == (this.getNumberOfPanels() - 1)) { other = 0; } else { other = panelIndex + 1; } if (panelIndex >= 0) { swapPanels(panelIndex, other); this.setCurrentlySelectedPanel(Optional.of(other)); } } }

Target:
public void movePanelRight(int panelIndex) { if (getPanelCount() < 2 || panelIndex == (getPanelCount() - 1)) return; int other = (panelIndex + 1) % getPanelCount(); swapPanels(panelIndex, other); selectPanel(other); }
Source:
public String hasError(final String stringToValidate) { final StringBuffer errorMsg = new StringBuffer(); if (UtilMethods.isSet(stringToValidate)) { final StringTokenizer tokenizer = new StringTokenizer(stringToValidate, ","); while (tokenizer.hasMoreTokens()) { final String token = tokenizer.nextToken().trim(); if (Validator.isEmailAddress(token)) { try { APILocator.getUserAPI() .loadByUserByEmail(token, APILocator.getUserAPI().getSystemUser(), false); } catch (Exception e) { Logger.error(this.getClass(), "Unable to find user with email: " + token); errorMsg.append("Unable to find user with email: " + token + "</br>"); } } else { String error = null; if (isUserId(token)) { continue; } else { error = "Unable to find user with ID: " + token + "</br>"; if (isRoleKey(token)) { continue; } else { error = (UtilMethods.isSet(error)) ? error : "Unable to find users assigned to role key: " + token; } errorMsg.append(error); } } } } return (UtilMethods.isSet(errorMsg.toString())) ? errorMsg.toString() : null; }

Target:
public String hasError(final String stringToValidate) { final StringBuilder errorMsg = new StringBuilder(); if (UtilMethods.isSet(stringToValidate)) { final StringTokenizer tokenizer = new StringTokenizer(stringToValidate, ","); while (tokenizer.hasMoreTokens()) { final String token = tokenizer.nextToken().trim(); if (Validator.isEmailAddress(token)) { try { APILocator.getUserAPI() .loadByUserByEmail(token, APILocator.getUserAPI().getSystemUser(), false); } catch (Exception e) { Logger.error(this.getClass(), "Unable to find user with email: " + token); errorMsg.append("Unable to find user with email: " + token + "</br>"); } } else { String error = null; if (isUserId(token)) { continue; } else { error = "Unable to find user with ID: " + token + "</br>"; if (isRoleKey(token)) { continue; } else { error = (UtilMethods.isSet(error)) ? error : "Unable to find users assigned to role key: " + token; } errorMsg.append(error); } } } } return (UtilMethods.isSet(errorMsg.toString())) ? errorMsg.toString() : null; }
Source:
public void onRoleChanged(long personID, int localTableBlogId, String newRole) { if(!NetworkUtils.isNetworkAvailable(this)) { ToastUtils.showToast(this, R.string.error_update_role, ToastUtils.Duration.LONG); return; } final Person person = PeopleTable.getPerson(personID, localTableBlogId); if (person == null || newRole == null || newRole.equalsIgnoreCase(person.getRole())) { return; } FragmentManager fragmentManager = getFragmentManager(); final PersonDetailFragment personDetailFragment = (PersonDetailFragment) fragmentManager .findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (personDetailFragment != null) { personDetailFragment.changeRole(newRole); } PeopleUtils.updateRole(person.getBlogId(), person.getPersonID(), newRole, localTableBlogId, new PeopleUtils.UpdateUserCallback() { @Override public void onSuccess(Person person) { PeopleTable.save(person); refreshOnScreenFragmentDetails(); } @Override public void onError() { if (personDetailFragment != null) { personDetailFragment.refreshPersonDetails(); } ToastUtils.showToast(PeopleManagementActivity.this, R.string.error_update_role, ToastUtils.Duration.LONG); } }); }

Target:
public void onRoleChanged(long personID, int localTableBlogId, String newRole) { if(!NetworkUtils.checkConnection(this)) { return; } final Person person = PeopleTable.getPerson(personID, localTableBlogId); if (person == null || newRole == null || newRole.equalsIgnoreCase(person.getRole())) { return; } FragmentManager fragmentManager = getFragmentManager(); final PersonDetailFragment personDetailFragment = (PersonDetailFragment) fragmentManager .findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (personDetailFragment != null) { personDetailFragment.changeRole(newRole); } PeopleUtils.updateRole(person.getBlogId(), person.getPersonID(), newRole, localTableBlogId, new PeopleUtils.UpdateUserCallback() { @Override public void onSuccess(Person person) { AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_UPDATED); PeopleTable.save(person); refreshOnScreenFragmentDetails(); } @Override public void onError() { if (personDetailFragment != null) { personDetailFragment.refreshPersonDetails(); } ToastUtils.showToast(PeopleManagementActivity.this, R.string.error_update_role, ToastUtils.Duration.LONG); } }); }
Source:
public void testGetAllUsersId() { Session session = sessionFactory.getCurrentSession(); User expectedOne = new User("TestUser1", "Test"); User expectedTwo = new User("TestUser2", "Test"); User expectedThree = new User("TestUser3", "Test"); session.save(expectedOne); session.save(expectedTwo); session.save(expectedThree); List<String> allUsersId = userDAO.getAllUsersId(); for (String s : allUsersId) { System.err.println(s); } int actual = allUsersId.size(); assertEquals(3, actual); }

Target:
public void testGetAllUsersId() { Session session = sessionFactory.getCurrentSession(); User expectedOne = new User("TestUser1", "Test"); User expectedTwo = new User("TestUser2", "Test"); User expectedThree = new User("TestUser3", "Test"); session.save(expectedOne); session.save(expectedTwo); session.save(expectedThree); List<String> allUsersId = userDAO.getAllUsersId(); int actual = allUsersId.size(); assertEquals(3, actual); }
Source:
private void checkDiff() { try { console.writeFormat("%-40s | %-40s | %-40s | %s\n", "Option name", "Default value", "User value", "Version"); console.writeLine(String.format("%s", StringUtils.repeat("-", 136))); getConfigDao().getConfigDiff() .stream() .filter(configKey -> configKey.getKey() != null) .forEach(configDiff -> console.writeFormat("%-40s | %-40s | %-40s | %s\n", configDiff.getKey(), StringUtils.abbreviate(configDiff.getValue(), 40), StringUtils.abbreviate(configDiff.getDefaultValue(), 40), configDiff.getVersion())); } catch (Exception e) { log.error("Error details: ", e); } }

Target:
private void checkDiff() { try { getConfigDao().getConfigDiff() .stream() .filter(configKey -> configKey.getKey() != null) .forEach(configDiff -> console.writeFormat("Name: %s\n" + "Version: %s\n" + "Current: %s\n" + "Default: %s\n\n", configDiff.getKey(), configDiff.getVersion(), configDiff.getValue(), configDiff.getDefaultValue())); } catch (Exception e) { log.error("Error details: ", e); } }
Source:
public void setUp() throws Exception { ca = OpenSSLX509Certificate.fromX509PemInputStream(openTestFile("ca-cert.pem")); cert = OpenSSLX509Certificate.fromX509PemInputStream(openTestFile("cert.pem")); certEmbedded = OpenSSLX509Certificate.fromX509PemInputStream( openTestFile("cert-ct-embedded.pem")); PublicKey key = OpenSSLKey.fromPublicKeyPemInputStream( openTestFile("ct-server-key-public.pem")).getPublicKey(); final CTLogInfo log = new CTLogInfo(key, "Test Log", "foo"); CTLogStore store = new CTLogStore() { public CTLogInfo getKnownLog(byte[] logId) { if (Arrays.equals(logId, log.getID())) { return log; } else { return null; } } }; ctVerifier = new CTVerifier(store); }

Target:
public void setUp() throws Exception { ca = OpenSSLX509Certificate.fromX509PemInputStream(openTestFile("ca-cert.pem")); cert = OpenSSLX509Certificate.fromX509PemInputStream(openTestFile("cert.pem")); certEmbedded = OpenSSLX509Certificate.fromX509PemInputStream( openTestFile("cert-ct-embedded.pem")); PublicKey key = OpenSSLKey.fromPublicKeyPemInputStream( openTestFile("ct-server-key-public.pem")).getPublicKey(); CTLogStore store = new CTLogStoreImpl(new CTLogInfo[] { new CTLogInfo(key, "Test Log", "foo") }); ctVerifier = new CTVerifier(store); }
Source:
protected ImportOp getImportOp(DataStore dataStore) { final ImportOp importOp = context.command(ImportOp.class); return importOp.setDataStore(dataStore).setTable(table).setAll(all).setOverwrite(!add) .setAdaptToDefaultFeatureType(!forceFeatureType).setAlter(alter) .setDestinationPath(dest).setFidAttribute(fidAttribute); }

Target:
private ImportOp getImportOp(DataStore dataStore) { final ImportOp importOp = context.command(ImportOp.class); return importOp.setDataStore(dataStore).setTable(table).setAll(all).setOverwrite(!add) .setAdaptToDefaultFeatureType(!forceFeatureType).setAlter(alter) .setDestinationPath(dest).setFidAttribute(fidAttribute); }
Source:
public String rewrite(Configuration conf, String query) throws GrillException { this.query = query; this.conf = conf; try { if (query.toLowerCase().matches("(.*)union all(.*)")) { String[] queries = query.toLowerCase().split("union all"); for (int i = 0; i < queries.length; i++) { ast = HQLParser.parseHQL(queries[i]); buildQuery(); mergedQuery = rewrittenQuery.append(" union all "); finalRewrittenQuery = mergedQuery.toString().substring(0, mergedQuery.lastIndexOf("union all")); LOG.info("Input Query : " + query); LOG.info("Rewritten Query : " + finalRewrittenQuery); reset(); } } else { ast = HQLParser.parseHQL(query); buildQuery(); finalRewrittenQuery = rewrittenQuery.toString(); } } catch (ParseException e) { e.printStackTrace(); } return finalRewrittenQuery; }

Target:
public synchronized String rewrite(Configuration conf, String query) throws GrillException { this.query = query; this.conf = conf; try { if (query.toLowerCase().matches("(.*)union all(.*)")) { String[] queries = query.toLowerCase().split("union all"); for (int i = 0; i < queries.length; i++) { ast = HQLParser.parseHQL(queries[i]); buildQuery(); mergedQuery = rewrittenQuery.append(" union all "); finalRewrittenQuery = mergedQuery.toString().substring(0, mergedQuery.lastIndexOf("union all")); LOG.info("Input Query : " + query); LOG.info("Rewritten Query : " + finalRewrittenQuery); reset(); } } else { ast = HQLParser.parseHQL(query); buildQuery(); finalRewrittenQuery = rewrittenQuery.toString(); LOG.info("Input Query : " + query); LOG.info("Rewritten Query : " + finalRewrittenQuery); } } catch (ParseException e) { e.printStackTrace(); } return finalRewrittenQuery; }
Source:
private CswRecordCollection queryProductById(String id, String rangeValue) throws CswException, UnsupportedQueryException { final ResourceRequestById resourceRequest = new ResourceRequestById(id); long bytesToSkip = getRange(rangeValue); if (bytesToSkip > 0) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Bytes to skip: {}", String.valueOf(bytesToSkip)); } resourceRequest.getProperties().put(CswConstants.BYTES_TO_SKIP, bytesToSkip); } ResourceResponse resourceResponse; try { resourceResponse = framework.getLocalResource(resourceRequest); } catch (IOException | ResourceNotFoundException | ResourceNotSupportedException e) { throw new CswException(String.format(ERROR_ID_PRODUCT_RETRIEVAL, id), e); } Resource resource = resourceResponse.getResource(); MimeType mimeType = resource.getMimeType(); if (mimeType == null) { try { mimeType = new MimeType(MediaType.APPLICATION_OCTET_STREAM); resource = new ResourceImpl(resource.getInputStream(), mimeType, resource.getName()); } catch (MimeTypeParseException e) { throw new CswException( String.format( "Could not create mime type upon null mimeType, for mime %s.", MediaType.APPLICATION_OCTET_STREAM), e); } } CswRecordCollection cswRecordCollection = new CswRecordCollection(); cswRecordCollection.setResource(resource); cswRecordCollection.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA); LOGGER.debug("{} successfully retrieved product for ID: {}", id); return cswRecordCollection; }

Target:
private CswRecordCollection queryProductById(String id, String rangeValue) throws CswException, UnsupportedQueryException { final ResourceRequestById resourceRequest = new ResourceRequestById(id); long bytesToSkip = getRange(rangeValue); if (bytesToSkip > 0) { LOGGER.debug("Bytes to skip: {}", bytesToSkip); resourceRequest.getProperties().put(CswConstants.BYTES_TO_SKIP, bytesToSkip); } ResourceResponse resourceResponse; try { resourceResponse = framework.getLocalResource(resourceRequest); } catch (IOException | ResourceNotFoundException | ResourceNotSupportedException e) { throw new CswException(String.format(ERROR_ID_PRODUCT_RETRIEVAL, id), e); } Resource resource = resourceResponse.getResource(); MimeType mimeType = resource.getMimeType(); if (mimeType == null) { try { mimeType = new MimeType(MediaType.APPLICATION_OCTET_STREAM); resource = new ResourceImpl(resource.getInputStream(), mimeType, resource.getName()); } catch (MimeTypeParseException e) { throw new CswException( String.format( "Could not create mime type upon null mimeType, for mime %s.", MediaType.APPLICATION_OCTET_STREAM), e); } } CswRecordCollection cswRecordCollection = new CswRecordCollection(); cswRecordCollection.setResource(resource); cswRecordCollection.setOutputSchema(OCTET_STREAM_OUTPUT_SCHEMA); LOGGER.debug("{} successfully retrieved product for ID: {}", id); return cswRecordCollection; }
Source:
private void tryRemoveOnlineUseCases(@NonNull Collection<UseCase> toRemove) { List<UseCase> useCasesChangedToOffline = new ArrayList<>(); for (UseCase useCase : toRemove) { if (mUseCaseAttachState.isUseCaseOnline(useCase)) { mUseCaseAttachState.setUseCaseOffline(useCase); useCasesChangedToOffline.add(useCase); } } if (useCasesChangedToOffline.isEmpty()) { return; } Log.d(TAG, "Use cases [" + TextUtils.join(", ", useCasesChangedToOffline) + "] now OFFLINE for camera " + mCameraInfoInternal.getCameraId()); clearCameraControlPreviewAspectRatio(useCasesChangedToOffline); notifyStateOfflineToUseCases(useCasesChangedToOffline); boolean allUseCasesOffline = mUseCaseAttachState.getOnlineUseCases().isEmpty(); if (allUseCasesOffline) { mCameraControlInternal.setActive(false); resetCaptureSession( false); mCaptureSession.setSessionConfig(null); closeInternal(); } else { updateCaptureSessionConfig(); resetCaptureSession( false); if (mState == InternalState.OPENED) { openCaptureSession(); } } }

Target:
private void tryRemoveOnlineUseCases(@NonNull Collection<UseCase> toRemove) { List<UseCase> useCasesChangedToOffline = new ArrayList<>(); for (UseCase useCase : toRemove) { if (mUseCaseAttachState.isUseCaseOnline(useCase)) { mUseCaseAttachState.setUseCaseOffline(useCase); useCasesChangedToOffline.add(useCase); } } if (useCasesChangedToOffline.isEmpty()) { return; } Log.d(TAG, "Use cases [" + TextUtils.join(", ", useCasesChangedToOffline) + "] now OFFLINE for camera " + mCameraInfoInternal.getCameraId()); clearCameraControlPreviewAspectRatio(useCasesChangedToOffline); notifyStateOfflineToUseCases(useCasesChangedToOffline); boolean allUseCasesOffline = mUseCaseAttachState.getOnlineUseCases().isEmpty(); if (allUseCasesOffline) { mCameraControlInternal.setActive(false); resetCaptureSession( false); mCaptureSession = mCaptureSessionBuilder.build(); closeInternal(); } else { updateCaptureSessionConfig(); resetCaptureSession( false); if (mState == InternalState.OPENED) { openCaptureSession(); } } }
Source:
public final void convertToHeapBuffer() { if (m_buffer.isDirect()) { ByteBuffer heapBuffer = ByteBuffer.allocate(m_buffer.limit()); m_buffer.position(0); heapBuffer.put(m_buffer); heapBuffer.position(heapBuffer.limit()); } }

Target:
public final void convertToHeapBuffer() { if (m_buffer.isDirect()) { ByteBuffer heapBuffer = ByteBuffer.allocate(m_buffer.limit()); m_buffer.position(0); heapBuffer.put(m_buffer); m_buffer = heapBuffer; } }
Source:
protected void convertEAttribute(SIRIUS siriusEObject, EObject eefEObject, EAttribute eAttribute, Map<String, Object> parameters) { EStructuralFeature eefEStructuralFeature = eefEObject.eClass().getEStructuralFeature(eAttribute.getName()); if (eefEStructuralFeature instanceof EAttribute) { if (eefEStructuralFeature.getEType().getInstanceClass().equals(eAttribute.getEType().getInstanceClass())) { eefEObject.eSet(eefEStructuralFeature, siriusEObject.eGet(eAttribute)); } else if (eefEStructuralFeature.getEType().equals(EcorePackage.Literals.EINT) && eAttribute.getEType().equals(EcorePackage.Literals.ESTRING)) { Object value = siriusEObject.eGet(eAttribute); eefEObject.eSet(eefEStructuralFeature, Integer.toString(Integer.valueOf(value.toString()))); } } else { eefEStructuralFeature = eefEObject.eClass().getEStructuralFeature("identifier"); if (eAttribute.equals(DescriptionPackage.Literals.IDENTIFIED_ELEMENT__NAME) && eefEStructuralFeature instanceof EAttribute) { eefEObject.eSet(eefEStructuralFeature, siriusEObject.eGet(EefPackage.Literals.EEF_CONTROL_DESCRIPTION__IDENTIFIER)); } } }

Target:
protected void convertEAttribute(SIRIUS siriusEObject, EObject eefEObject, EAttribute eAttribute, Map<String, Object> parameters) { EStructuralFeature eefEStructuralFeature = eefEObject.eClass().getEStructuralFeature(eAttribute.getName()); if (eefEStructuralFeature instanceof EAttribute) { if (eefEStructuralFeature.getEType().getInstanceClass().equals(eAttribute.getEType().getInstanceClass())) { eefEObject.eSet(eefEStructuralFeature, siriusEObject.eGet(eAttribute)); } else if (eefEStructuralFeature.getEType().equals(EcorePackage.Literals.EINT) && eAttribute.getEType().equals(EcorePackage.Literals.ESTRING)) { Object value = siriusEObject.eGet(eAttribute); eefEObject.eSet(eefEStructuralFeature, Integer.toString(Integer.valueOf(value.toString()))); } } else { eefEStructuralFeature = eefEObject.eClass().getEStructuralFeature("identifier"); if (eAttribute.equals(DescriptionPackage.Literals.IDENTIFIED_ELEMENT__NAME) && eefEStructuralFeature instanceof EAttribute) { eefEObject.eSet(eefEStructuralFeature, siriusEObject.eGet(DescriptionPackage.Literals.IDENTIFIED_ELEMENT__NAME)); } } }