auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public VideoDecoder( final EventPublisher eventPublisher, <START> final VideoDecoderConfig config, final String broadcast <END> ) { this.eventPublisher = eventPublisher; this.config = config; this.decoderA = new FFmpegFXImageDecoder( config.portA(), config.format(), config.frameRate(), config.socketBacklog(), config.bitrate(), config.preset(), config.numBuffers()); this.decoderB = new FFmpegFXImageDecoder( config.portB(), config.format(), config.frameRate(), config.socketBacklog(), config.bitrate(), config.preset(), config.numBuffers()); final int lastLocation = broadcast.lastIndexOf('.'); broadcastIP = broadcast.substring(0, lastLocation - 1); }</code><technical_language>stay consistent rest of params. java public VideoDecoder( final EventPublisher eventPublisher, final VideoDecoderConfig config, final String broadcast ) { ..</technical_language>

Target:
public VideoDecoder( final EventPublisher eventPublisher, final VideoDecoderConfig config, final String broadcast ) { this.eventPublisher = eventPublisher; this.config = config; this.decoderA = new FFmpegFXImageDecoder( config.portA(), config.format(), config.frameRate(), config.socketBacklog(), config.bitrate(), config.preset(), config.numBuffers(), config.introVideoLocation()); this.decoderB = new FFmpegFXImageDecoder( config.portB(), config.format(), config.frameRate(), config.socketBacklog(), config.bitrate(), config.preset(), config.numBuffers(), config.introVideoLocation()); final int lastLocation = broadcast.lastIndexOf('.'); broadcastIP = broadcast.substring(0, lastLocation - 1); }
Source:
<code>public Neo4jGraph(String path) { service = new GraphDatabaseFactory().newEmbeddedDatabase(path); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { service.shutdown(); } }); nodeLabel = DynamicLabel.label("Node"); try (Transaction tx = service.beginTx()) { service.schema().getConstraints().forEach(e -> e.drop()); service.schema().getIndexes().forEach(e -> e.drop()); service.schema().constraintFor(nodeLabel) .assertPropertyIsUnique("id") .create(); service.schema().indexFor(nodeLabel) <START> .on("rank") <END> .create(); tx.success(); } }</code><technical_language>This renamed occurence</technical_language>

Target:
public Neo4jGraph(String path) { service = new GraphDatabaseFactory().newEmbeddedDatabase(path); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { service.shutdown(); } }); nodeLabel = DynamicLabel.label(NODELABEL); try (Transaction tx = service.beginTx()) { service.schema().getConstraints().forEach(e -> e.drop()); service.schema().getIndexes().forEach(e -> e.drop()); service.schema().constraintFor(nodeLabel) .assertPropertyIsUnique(ID) .create(); service.schema().indexFor(nodeLabel) .on(RANK) .create(); tx.success(); } }
Source:
<code>private static void addDesktopSharingListener(final Call call, JFrame frame) { OperationSetVideoTelephony videoTelephony = call.getProtocolProvider().getOperationSet( <START> OperationSetDesktopSharingServer.class); <END> videoTelephony.addPropertyChangeListener( call, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent ev) { if (OperationSetVideoTelephony.LOCAL_VIDEO_STREAMING .equals(ev.getPropertyName()) && MediaDirection.RECVONLY.equals( ev.getNewValue())) { JFrame desktopFrame = callDesktopFrames.get(call); if (desktopFrame != null) { desktopFrame.dispose(); callDesktopFrames.remove(call); } } } }); }</code><technical_language>This change unneccessary</technical_language>

Target:
private static void addDesktopSharingListener(final Call call, JFrame frame) { OperationSetVideoTelephony videoTelephony = call.getProtocolProvider().getOperationSet( OperationSetVideoTelephony.class); videoTelephony.addPropertyChangeListener( call, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent ev) { if (OperationSetVideoTelephony.LOCAL_VIDEO_STREAMING .equals(ev.getPropertyName()) && MediaDirection.RECVONLY.equals( ev.getNewValue())) { JFrame desktopFrame = callDesktopFrames.get(call); if (desktopFrame != null) { desktopFrame.dispose(); callDesktopFrames.remove(call); } } } }); }
Source:
<code>private void processRemoteNotification(Bundle msg) { if (!isSwrveRemoteNotification(msg)) { SwrveLogger.i(TAG, "ADM notification: but not processing as it doesn't contain: " + SwrveAdmConstants.SWRVE_TRACKING_KEY); return; } <START> Context context = getApplicationContext(); <END> Object rawId = msg.get(SwrveAdmConstants.SWRVE_TRACKING_KEY); String msgId = (rawId != null) ? rawId.toString() : null; final String timestamp = msg.getString(SwrveAdmConstants.TIMESTAMP_KEY); if (SwrveHelper.isNullOrEmpty(timestamp)) { SwrveLogger.e(TAG, "ADM notification: but not processing as it's missing " + SwrveAdmConstants.TIMESTAMP_KEY); return; } String curId = msgId + ":" + timestamp; LinkedList<String> recentIds = getRecentNotificationIdCache(context); if (recentIds.contains(curId)) { SwrveLogger.i(TAG, "ADM notification: but not processing because duplicate Id: " + curId); return; } updateRecentNotificationIdCache(recentIds, curId, MAX_ID_CACHE_ITEMS, context); Iterator<SwrveQAUser> iter = SwrveQAUser.getBindedListeners().iterator(); while (iter.hasNext()) { SwrveQAUser sdkListener = iter.next(); sdkListener.pushNotification(msgId, msg); } processNotification(msg, context); }</code><technical_language>applicationcontext? "this" a context</technical_language>

Target:
private void processRemoteNotification(Bundle msg) { if (!isSwrveRemoteNotification(msg)) { SwrveLogger.i(TAG, "ADM notification: but not processing as it doesn't contain: " + SwrveAdmConstants.SWRVE_TRACKING_KEY); return; } Context context = getApplicationContext(); Object rawId = msg.get(SwrveAdmConstants.SWRVE_TRACKING_KEY); String msgId = (rawId != null) ? rawId.toString() : null; final String timestamp = msg.getString(SwrveAdmConstants.TIMESTAMP_KEY); if (SwrveHelper.isNullOrEmpty(timestamp)) { SwrveLogger.e(TAG, "ADM notification: but not processing as it's missing " + SwrveAdmConstants.TIMESTAMP_KEY); return; } String curId = msgId + ":" + timestamp; LinkedList<String> recentIds = getRecentNotificationIdCache(context); if (recentIds.contains(curId)) { SwrveLogger.i(TAG, "ADM notification: but not processing because duplicate Id: " + curId); return; } int pushIdCacheSize = msg.getInt(SwrveAdmConstants.PUSH_ID_CACHE_SIZE_KEY, DEFAULT_PUSH_ID_CACHE_SIZE); updateRecentNotificationIdCache(recentIds, curId, pushIdCacheSize, context); Iterator<SwrveQAUser> iter = SwrveQAUser.getBindedListeners().iterator(); while (iter.hasNext()) { SwrveQAUser sdkListener = iter.next(); sdkListener.pushNotification(msgId, msg); } processNotification(msg, context); }
Source:
<code>public void configure(ElasticsearchAnalysisDefinitionContainerContext context) { super.configure( context ); context.analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE.name ).custom() .withTokenizer( "whitespace" ); context.analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ).custom() .withTokenizer( "whitespace" ) .withTokenFilters( "lowercase" ); <START> String tokenizerName = AnalysisCustomIT.AnalysisDefinitions.ANALYZER_PATTERNS_STOPWORD.name + "_tokenizer"; <END> context.analyzer( OverrideAnalysisDefinitions.ANALYZER_NGRAM.name ).custom() .withTokenizer( tokenizerName ); context.tokenizer( tokenizerName ) .type( "ngram" ) .param( "min_gram", 5 ) .param( "max_gram", 6 ); }</code><technical_language>Please do that: AnalysisCustomIT.AnalysisDefinitions is completely unrelated. OverrideAnalysisDefinitions.ANALYZER_NGRAM.name + "_tokenizer</technical_language>

Target:
public void configure(ElasticsearchAnalysisDefinitionContainerContext context) { super.configure( context ); context.analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE.name ).custom() .withTokenizer( "whitespace" ); context.analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ).custom() .withTokenizer( "whitespace" ) .withTokenFilters( "lowercase" ); String tokenizerName = OverrideAnalysisDefinitions.ANALYZER_NGRAM.name + "_tokenizer"; context.analyzer( OverrideAnalysisDefinitions.ANALYZER_NGRAM.name ).custom() .withTokenizer( tokenizerName ); context.tokenizer( tokenizerName ) .type( "ngram" ) .param( "min_gram", 5 ) .param( "max_gram", 6 ); }
Source:
<code>public void createNewLauncherApplicationProjectWithDefaultSettings() { ArchetypeProject project = new org.jboss.tools.central.test.ui.reddeer.projects.LauncherApplication(); log.step("Import project start"); <START> JBossCentralProjectWizardLauncherApplication dialog = new JBossCentralProjectWizardLauncherApplication(project); <END> dialog.open(); dialog.setProjectName("project_1_default_settings"); dialog.clickTheFinishButton(); new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(2500)); log.step("Import project finished"); checkForErrors(); }</code><technical_language>project variable needed create JBossCentralProjectWizardLauncherApplication - delete Archetype project completely this class instead archetype project constant "Launcher Application" simplify code</technical_language>

Target:
public void createNewLauncherApplicationProjectWithDefaultSettings() { log.step("Import project start"); NewLauncherProjectWizard wizard = new NewLauncherProjectWizard(); NewLauncherProjectWizardPage wizardPage = new NewLauncherProjectWizardPage(wizard); wizard.openWizardFromShellMenu(); wizardPage.setProjectName("project_1_default_settings"); wizard.finish(TimePeriod.getCustom(2500)); log.step("Import project finished"); checkForErrors(); }
Source:
<code><START> public void testCryst1Parsing() throws Exception { <END> String cryst1Line = "CRYST1 11.111 11.111 111.111 70.00 80.00 60.00 P 1"; Structure s; PDBFileParser pdbPars = new PDBFileParser(); try(InputStream is = new ByteArrayInputStream(cryst1Line.getBytes()) ) { s = pdbPars.parsePDBFile(is); } assertEquals("P 1", s.getPDBHeader().getCrystallographicInfo().getSpaceGroup().getShortSymbol()); }</code><technical_language>This "throws IOException" only</technical_language>

Target:
public void testCryst1Parsing() throws IOException { String cryst1Line = "CRYST1 11.111 11.111 111.111 70.00 80.00 60.00 P 1"; Structure s; PDBFileParser pdbPars = new PDBFileParser(); try(InputStream is = new ByteArrayInputStream(cryst1Line.getBytes()) ) { s = pdbPars.parsePDBFile(is); } assertEquals("P 1", s.getPDBHeader().getCrystallographicInfo().getSpaceGroup().getShortSymbol()); }
Source:
<code>public static boolean shouldRetry(String response, String host) { String decodedResponse = Base64.decode(response); <START> Log.v(LOG_TAG, "Challenge response: "+ decodedResponse); <END> try { JSONObject json = new JSONObject(decodedResponse); if(!json.getString("status").equals(BAD_RESPONSE)) { return false; } } catch (JSONException jsonException) { Log.i(LOG_TAG, "Error decoding JSON response from:" + host + ". Response was:" + decodedResponse); } return true; }</code><technical_language>a candidate for if (K9.DEBUG)</technical_language>

Target:
public static boolean shouldRetry(String response, String host) { String decodedResponse = Base64.decode(response); if (K9MailLib.isDebug()) { Log.v(LOG_TAG, "Challenge response: " + decodedResponse); } try { JSONObject json = new JSONObject(decodedResponse); String status = json.getString("status"); if (!BAD_RESPONSE.equals(status)) { return false; } } catch (JSONException jsonException) { Log.e(LOG_TAG, "Error decoding JSON response from: " + host + ". Response was: " + decodedResponse); } return true; }
Source:
<code>private void testReadAheads(AbfsInputStream inputStream, int readRequestSize, int readAheadRequestSize) throws Exception { if (readRequestSize > readAheadRequestSize) { readAheadRequestSize = readRequestSize; } byte[] firstReadBuffer = new byte[readRequestSize]; byte[] secondReadBuffer = new byte[readAheadRequestSize]; byte[] expectedFirstReadAheadBufferContents = new byte[readRequestSize]; byte[] expectedSecondReadAheadBufferContents = new byte[readAheadRequestSize]; getExpectedBufferData(0, readRequestSize, expectedFirstReadAheadBufferContents); getExpectedBufferData(readRequestSize, readAheadRequestSize, expectedSecondReadAheadBufferContents); assertTrue("Read should be of exact requested size", inputStream.read(firstReadBuffer, 0, readRequestSize) == readRequestSize); assertTrue("Data mismatch found in RAH1", <START> Arrays.equals(firstReadBuffer, <END> expectedFirstReadAheadBufferContents)); assertTrue("Read should be of exact requested size", inputStream.read(secondReadBuffer, 0, readAheadRequestSize) == readAheadRequestSize); assertTrue("Data mismatch found in RAH2", Arrays.equals(secondReadBuffer, expectedSecondReadAheadBufferContents)); }</code><technical_language>AssertJ rich api's tackle kind of assertions. Try example : Assertions.assertThat(list) .hasSameElementsAs(list2)</technical_language>

Target:
private void testReadAheads(AbfsInputStream inputStream, int readRequestSize, int readAheadRequestSize) throws Exception { if (readRequestSize > readAheadRequestSize) { readAheadRequestSize = readRequestSize; } byte[] firstReadBuffer = new byte[readRequestSize]; byte[] secondReadBuffer = new byte[readAheadRequestSize]; byte[] expectedFirstReadAheadBufferContents = new byte[readRequestSize]; byte[] expectedSecondReadAheadBufferContents = new byte[readAheadRequestSize]; getExpectedBufferData(0, readRequestSize, expectedFirstReadAheadBufferContents); getExpectedBufferData(readRequestSize, readAheadRequestSize, expectedSecondReadAheadBufferContents); Assertions.assertThat(inputStream.read(firstReadBuffer, 0, readRequestSize)) .describedAs("Read should be of exact requested size") .isEqualTo(readRequestSize); assertTrue("Data mismatch found in RAH1", Arrays.equals(firstReadBuffer, expectedFirstReadAheadBufferContents)); Assertions.assertThat(inputStream.read(secondReadBuffer, 0, readAheadRequestSize)) .describedAs("Read should be of exact requested size") .isEqualTo(readAheadRequestSize); assertTrue("Data mismatch found in RAH2", Arrays.equals(secondReadBuffer, expectedSecondReadAheadBufferContents)); }
Source:
<code>private boolean canConnectToConsole() { final VM vm = getVm(); if (vm.getAllowConsoleReconnect()) { return true; } <START> userHasReconnectPermission = checkUserAuthorization(ActionGroup.RECONNECT_TO_VM, MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID, VdcObjectType.System); <END> if (userHasReconnectPermission) { return true; } final String currentName = getCurrentUser().getUserName(); final NGuid currentId = getCurrentUser().getUserId(); final String previousName = vm.getConsoleUserName(); final NGuid previousId = vm.getConsoleUserId(); if (previousId != null && !previousId.equals(currentId)) { log.warnFormat("User \"{0}\" is trying to set a ticket for virtual machine \"{1}\" but the machine is already in use by \"{2}\".", currentName, vm.getvm_name(), previousName); log.warnFormat("The id of user \"{0}\" is \"{1}\".", currentName, currentId); log.warnFormat("The id of user \"{0}\" is \"{1}\".", previousName, previousId); log.warnFormat("The id of virtual machine \"{0}\" is \"{1}\".", vm.getvm_name(), vm.getvm_guid()); log.warnFormat("The ticket will not be set."); addCanDoActionMessage(VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); return false; } return true; }</code><technical_language>do require permission system VM object</technical_language>

Target:
private boolean canConnectToConsole() { final VM vm = getVm(); if (vm.getAllowConsoleReconnect()) { return true; } userHasReconnectPermission = checkUserAuthorization(ActionGroup.RECONNECT_TO_VM, MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID, VdcObjectType.System); if (userHasReconnectPermission) { return true; } final NGuid currentId = getCurrentUser().getUserId(); final NGuid previousId = vm.getConsoleUserId(); if (previousId != null && !previousId.equals(currentId)) { log.warnFormat("User \"{0}\" is trying to set a ticket for virtual machine \"{1}\" but the machine is already in use by \"{2}\".", currentId, vm.getId(), previousId); addCanDoActionMessage(VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); return false; } return true; }
Source:
<code>private void checkFieldType(int field, Set<Type> expectedTypes) { Type actual = getType(field); checkArgument(expectedTypes.contains(actual), "Field %s expected type inconsistent with %s", field, actual); StringBuilder builder = new StringBuilder(); for (Type type : expectedTypes) { builder.append(", "); <START> builder.append(type.getDisplayName()); <END> } }</code><technical_language>result -> results</technical_language>

Target:
private void checkFieldType(int field, Set<Type> expectedTypes) { checkArgument(expectedTypes.contains(getType(field)), "Field %s expected type inconsistent with %s", field, getType(field)); }
Source:
<code>private void setClockProvider(String clockProviderFqcn, ClassLoader externalClassLoader) { if ( clockProviderFqcn != null ) { try { @SuppressWarnings("unchecked") Class<? extends ClockProvider> clazz = (Class<? extends ClockProvider>) run( LoadClass.action( clockProviderFqcn, externalClassLoader ) ); clockProvider = run( NewInstance.action( clazz, "clock provider class" ) ); log.usingClockProvider( clazz ); } catch (ValidationException e) { <START> throw log.getUnableToInstantiateParameterNameProviderClassException( clockProviderFqcn, e ); <END> } } }</code><technical_language>ParameterNameProvider=ClockProvider Or, yet, move getUnableToInstantiateException(), I in dedicated versions really</technical_language>

Target:
private void setClockProvider(String clockProviderFqcn, ClassLoader externalClassLoader) { if ( clockProviderFqcn != null ) { try { @SuppressWarnings("unchecked") Class<? extends ClockProvider> clazz = (Class<? extends ClockProvider>) run( LoadClass.action( clockProviderFqcn, externalClassLoader ) ); clockProvider = run( NewInstance.action( clazz, "clock provider class" ) ); log.usingClockProvider( clazz ); } catch (ValidationException e) { throw log.getUnableToInstantiateClockProviderClassException( clockProviderFqcn, e ); } } }
Source:
<code>private void checkPendingCheckpointCompletedFuturesSize() { <START> while (pendingCheckpointCompletedFutures.size() > MAX_TRACKED_CHECKPOINTS) { Long minCheckpointID = Collections.min(pendingCheckpointCompletedFutures.keySet()); <END> pendingCheckpointCompletedFutures.remove(minCheckpointID).completeExceptionally(new IllegalStateException("Too many pending checkpoints")); } }</code><technical_language>I end O(MAX_TRACKED_CHECKPOINTS ^ 2) here, right? happen (if map is cleared triggerOnBarrier/abort), I cap LinkedHashMap, TreeMap, reducing MAX_TRACKED_CHECKPOINTS small</technical_language>

Target:
private void checkPendingCheckpointCompletedFuturesSize() { if (pendingCheckpointCompletedFutures.size() > MAX_TRACKED_CHECKPOINTS) { ArrayList<Long> pendingCheckpointIds = new ArrayList<>(pendingCheckpointCompletedFutures.keySet()); pendingCheckpointIds.sort(Long::compareTo); for (Long checkpointId : pendingCheckpointIds.subList(0, pendingCheckpointIds.size() - MAX_TRACKED_CHECKPOINTS)) { pendingCheckpointCompletedFutures.remove(checkpointId).completeExceptionally(new IllegalStateException("Too many pending checkpoints")); } } }
Source:
<code>public void commitWithMessageShouldReturnTheTransaction() throws Exception { ByteArrayOutputStream bodyOutput = new ByteArrayOutputStream(); String responseString = "{ \"id\": \"foobar\" }"; MockRestAdapter<Transaction> adapter = new MockRestAdapter<>("foobar", responseString, null); adapter.request(new RepromiseFunction<UpholdRestAdapter, Transaction>() { @Override public Promise<Transaction> call(UpholdRestAdapter adapter) { Transaction transaction = Fixtures.loadTransaction(new HashMap<String, String>() {{ put("transactionStatus", "pending"); put("originCardId", "foo"); put("transactionId", "bar"); }}); transaction.setUpholdRestAdapter(adapter); return transaction.commit(new TransactionCommitRequest("foobar")); } }); Header otpHeader = null; Request request = adapter.getRequest(); Transaction transaction = adapter.getResult(); for (Header header : request.getHeaders()) { <START> if (header.getName().compareToIgnoreCase("OTP-Token") == 0) { <END> otpHeader = header; break; } } request.getBody().writeTo(bodyOutput); Assert.assertEquals(request.getUrl(), String.format("%s/v0/me/cards/foo/transactions/bar/commit", BuildConfig.API_SERVER_URL)); Assert.assertEquals(request.getMethod(), "POST"); Assert.assertNull(otpHeader); Assert.assertEquals(transaction.getId(), "foobar"); Assert.assertEquals(bodyOutput.toString(), "{\"message\":\"foobar\"}"); }</code><technical_language>WDYT of changing condition "OTP-Token".equalsIgnoreCase(header.getName())? safer</technical_language>

Target:
public void commitWithMessageShouldReturnTheTransaction() throws Exception { ByteArrayOutputStream bodyOutput = new ByteArrayOutputStream(); String responseString = "{ \"id\": \"foobar\" }"; MockRestAdapter<Transaction> adapter = new MockRestAdapter<>("foobar", responseString, null); adapter.request(new RepromiseFunction<UpholdRestAdapter, Transaction>() { @Override public Promise<Transaction> call(UpholdRestAdapter adapter) { Transaction transaction = Fixtures.loadTransaction(new HashMap<String, String>() {{ put("transactionStatus", "pending"); put("originCardId", "foo"); put("transactionId", "bar"); }}); transaction.setUpholdRestAdapter(adapter); return transaction.commit(new TransactionCommitRequest("foobar")); } }); Header otpHeader = null; Request request = adapter.getRequest(); Transaction transaction = adapter.getResult(); for (Header header : request.getHeaders()) { if ("OTP-Token".equalsIgnoreCase(header.getName())) { otpHeader = header; break; } } request.getBody().writeTo(bodyOutput); Assert.assertEquals(request.getUrl(), String.format("%s/v0/me/cards/foo/transactions/bar/commit", BuildConfig.API_SERVER_URL)); Assert.assertEquals(request.getMethod(), "POST"); Assert.assertNull(otpHeader); Assert.assertEquals(transaction.getId(), "foobar"); Assert.assertEquals(bodyOutput.toString(), "{\"message\":\"foobar\"}"); }
Source:
<code>public boolean performDexOpt(String packageName) { enforceSystemOrRoot("Only the system can request dexopt be performed"); PackageParser.Package p; synchronized (mPackages) { p = mPackages.get(packageName); if (p == null) { return false; } p.mLastPackageUsageTimeInMills = System.currentTimeMillis(); <START> mPackageUsage.write(); <END> if (p.mDexOptUnneeded) { return false; } } synchronized (mInstallLock) { return performDexOptLI(p, false , false , true ) == DEX_OPT_PERFORMED; } }</code><technical_language>Hmm, this write a lot. move this a level multiple calls performDexOpt</technical_language>

Target:
public boolean performDexOpt(String packageName) { enforceSystemOrRoot("Only the system can request dexopt be performed"); PackageParser.Package p; synchronized (mPackages) { p = mPackages.get(packageName); if (p == null) { return false; } p.mLastPackageUsageTimeInMills = System.currentTimeMillis(); mPackageUsage.write(); if (!p.mDexOptNeeded) { return false; } } synchronized (mInstallLock) { return performDexOptLI(p, false , false , true ) == DEX_OPT_PERFORMED; } }
Source:
<code>private static boolean getRebuildProjectAfterImportPreference() { IScopeContext[] <START> scopes = { ConfigurationScope.INSTANCE, DefaultScope.INSTANCE }; <END> IPreferencesService preferencesService = Platform.getPreferencesService(); String defaultValue = String.valueOf(Boolean.FALSE); String rebuildProjectsPreference = preferencesService.getString(IDEWorkbenchPlugin.IDE_WORKBENCH, PREF_REBUILD_PROJECTS_AFTER_IMPORT, defaultValue, scopes); boolean booleanValue = Boolean.valueOf(rebuildProjectsPreference).booleanValue(); return booleanValue; }</code><technical_language>I this is wrong. "null" default scope, is PreferencesService.DEFAULT_DEFAULT_LOOKUP_ORDER InstanceScope, ConfigurationScope, DefaultScope</technical_language>

Target:
private static boolean getRebuildProjectAfterImportPreference() { IScopeContext[] scopes = { null }; IPreferencesService preferencesService = Platform.getPreferencesService(); boolean defaultValue = false; boolean rebuildProjectsPreference = preferencesService.getBoolean(IDEWorkbenchPlugin.IDE_WORKBENCH, PREF_REBUILD_PROJECTS_AFTER_IMPORT, defaultValue, scopes); return rebuildProjectsPreference; }
Source:
<code>public boolean isPurchased(String sku) { <START> if (!Utility.isEmulator()) { <END> return true; } if (purchases != null) { switch (sku) { case ITEM_DONATION: return purchases.get(ITEM_DONATION); case ITEM_PRO: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO)); case ITEM_WEATHER_DATA: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_WEATHER_DATA)); case ITEM_WEB_RADIO: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_WEB_RADIO)); case ITEM_ACTIONS: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_ACTIONS)); } } return false; }</code><technical_language>dont commit this</technical_language>

Target:
public boolean isPurchased(String sku) { if (Utility.isEmulator()) { return true; } if (purchases != null) { switch (sku) { case ITEM_DONATION: return purchases.get(ITEM_DONATION); case ITEM_PRO: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO)); case ITEM_WEATHER_DATA: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_WEATHER_DATA)); case ITEM_WEB_RADIO: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_WEB_RADIO)); case ITEM_ACTIONS: return (purchases.get(ITEM_DONATION) || purchases.get(ITEM_PRO) || purchases.get(ITEM_ACTIONS)); } } return false; }
Source:
<code>public void testBase() { createDocuments(); assertTrue(trashService.folderAllowsDelete(fold)); assertTrue(trashService.checkDeletePermOnParents(Arrays.asList(doc1, doc2))); assertTrue(trashService.canDelete(Collections.singletonList(fold), principal, false)); assertTrue(trashService.canDelete(Collections.singletonList(doc1), principal, false)); assertTrue(trashService.canDelete(Collections.singletonList(doc2), principal, false)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(fold), principal)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(doc1), principal)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(doc2), principal)); <START> TrashInfo info = (TrashInfo) trashService.getTrashInfo(Arrays.asList(fold, doc1, doc3), principal, false, false); <END> assertEquals(3, info.docs.size()); assertEquals(2, info.rootRefs.size()); assertEquals(new HashSet<>(Arrays.asList(new Path("/fold"), new Path("/doc3"))), info.rootPaths); DocumentModel above = trashService.getAboveDocument(doc1, Collections.singleton(new Path("/fold/doc1"))); assertEquals(above.getPathAsString(), fold.getId(), above.getId()); above = trashService.getAboveDocument(doc1, Collections.singleton(new Path("/fold/doc1"))); assertEquals(above.getPathAsString(), fold.getId(), above.getId()); }</code><technical_language>Do need cast ? import of TrashInfo core api work, IDE propose this in package a class matching name</technical_language>

Target:
public void testBase() { createDocuments(); assertTrue(trashService.folderAllowsDelete(fold)); assertTrue(trashService.checkDeletePermOnParents(Arrays.asList(doc1, doc2))); assertTrue(trashService.canDelete(Collections.singletonList(fold), principal, false)); assertTrue(trashService.canDelete(Collections.singletonList(doc1), principal, false)); assertTrue(trashService.canDelete(Collections.singletonList(doc2), principal, false)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(fold), principal)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(doc1), principal)); assertFalse(trashService.canPurgeOrUntrash(Collections.singletonList(doc2), principal)); TrashInfo info = trashService.getTrashInfo(Arrays.asList(fold, doc1, doc3), principal, false, false); assertEquals(3, info.docs.size()); assertEquals(2, info.rootRefs.size()); assertEquals(new HashSet<>(Arrays.asList(new Path("/fold"), new Path("/doc3"))), info.rootPaths); DocumentModel above = trashService.getAboveDocument(doc1, Collections.singleton(new Path("/fold/doc1"))); assertEquals(above.getPathAsString(), fold.getId(), above.getId()); above = trashService.getAboveDocument(doc1, Collections.singleton(new Path("/fold/doc1"))); assertEquals(above.getPathAsString(), fold.getId(), above.getId()); }
Source:
<code>public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, final Template template) throws RunNodesException { Set<? extends NodeMetadata> nodes = super.createNodesInGroup(group, count, template); String region = AWSUtils.getRegionFromLocationOrNull(template.getLocation()); if (client.getTagApiForRegion(region).isPresent()) { Map<String, String> common = metadataAndTagsAsValuesOfEmptyString(template.getOptions()); if (common.size() > 0 || !template.getOptions().getNodeNames().isEmpty() <START> || generateInstanceNames) { <END> return addTagsAndNamesToInstancesInRegion(common, template.getOptions().getNodeNames(), nodes, region, group); } } return nodes; }</code><technical_language>!common.isEmpty()? generateInstanceNames I guess cheaper check..</technical_language>

Target:
public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, final Template template) throws RunNodesException { Set<? extends NodeMetadata> nodes = super.createNodesInGroup(group, count, template); String region = AWSUtils.getRegionFromLocationOrNull(template.getLocation()); if (client.getTagApiForRegion(region).isPresent()) { Map<String, String> common = metadataAndTagsAsValuesOfEmptyString(template.getOptions()); if (generateInstanceNames || !common.isEmpty() || !template.getOptions().getNodeNames().isEmpty()) { return addTagsAndNamesToInstancesInRegion(common, template.getOptions().getNodeNames(), nodes, region, group); } } return nodes; }
Source:
<code>private static IkeIdentification parseIkeIdentification(@NonNull String identityStr) { <START> if (identityStr.contains("@")) { if (identityStr.startsWith("@#")) { final String hexStr = identityStr.substring(2); return new IkeKeyIdIdentification(HexDump.hexStringToByteArray(hexStr)); } else if (identityStr.startsWith("@") && !identityStr.startsWith("@@")) { return new IkeFqdnIdentification(identityStr.substring(1)); } else if (identityStr.startsWith("@@")) { return new IkeRfc822AddrIdentification(identityStr.substring(2)); } else { return new IkeRfc822AddrIdentification(identityStr); } } else { if (InetAddresses.isNumericAddress(identityStr)) { final InetAddress addr = InetAddresses.parseNumericAddress(identityStr); if (addr instanceof Inet4Address) { return new IkeIpv4AddrIdentification((Inet4Address) addr); } else if (addr instanceof Inet6Address) { return new IkeIpv6AddrIdentification((Inet6Address) addr); } else { throw new IllegalArgumentException("IP version not supported"); } } else { if (identityStr.contains(":")) { return new IkeKeyIdIdentification(identityStr.getBytes()); } else { return new IkeFqdnIdentification(identityStr); } } } <END> }</code><technical_language>if-else style nit: reduce a bunch of nesting skipping some of 'else' blocks. For instance first[.p if block reduced to: if (identityStr.contains("@")) { if (identityStr.startsWith("@#")) { // KEY_ID final String hexStr = identityStr.substring(2); return new IkeKeyIdIdentification(HexDump.hexStringToByteArray(hexStr)); } if (identityStr.startsWith("@") && !identityStr.startsWith("@@")) { // FQDN return new IkeFqdnIdentification(identityStr.substring(1)); } if (identityStr.startsWith("@@")) { // RFC822 (USER_FQDN) return new IkeRfc822AddrIdentification(identityStr.substring(2)); } // RFC822 (USER_FQDN) return new IkeRfc822AddrIdentification(identityStr); } Similarly, subsequent 'else' this skipped (since inferred). more readable, error-prone cognitive load</technical_language>

Target:
private static IkeIdentification parseIkeIdentification(@NonNull String identityStr) { if (identityStr.contains("@")) { if (identityStr.startsWith("@#")) { final String hexStr = identityStr.substring(2); return new IkeKeyIdIdentification(HexDump.hexStringToByteArray(hexStr)); } else if (identityStr.startsWith("@@")) { return new IkeRfc822AddrIdentification(identityStr.substring(2)); } else if (identityStr.startsWith("@")) { return new IkeFqdnIdentification(identityStr.substring(1)); } else { return new IkeRfc822AddrIdentification(identityStr); } } else if (InetAddresses.isNumericAddress(identityStr)) { final InetAddress addr = InetAddresses.parseNumericAddress(identityStr); if (addr instanceof Inet4Address) { return new IkeIpv4AddrIdentification((Inet4Address) addr); } else if (addr instanceof Inet6Address) { return new IkeIpv6AddrIdentification((Inet6Address) addr); } else { throw new IllegalArgumentException("IP version not supported"); } } else { if (identityStr.contains(":")) { return new IkeKeyIdIdentification(identityStr.getBytes()); } else { return new IkeFqdnIdentification(identityStr); } } }
Source:
<code>private static void makeCorrAttrFromAcctArtifact(List<CorrelationAttributeInstance> corrAttrInstances, BlackboardArtifact acctArtifact) throws TskCoreException, CentralRepoException { BlackboardAttribute accountTypeAttribute = acctArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)); String accountTypeStr = accountTypeAttribute.getValueString(); if (Account.Type.DEVICE.getTypeName().equalsIgnoreCase(accountTypeStr) == false) { CentralRepoAccountType crAccountType; try { crAccountType = CentralRepository.getInstance().getAccountTypeByName(accountTypeStr); } catch (CentralRepoException ex) { <START> return; <END> } int corrTypeId = crAccountType.getCorrelationTypeId(); CorrelationAttributeInstance.Type corrType = CentralRepository.getInstance().getCorrelationTypeById(corrTypeId); BlackboardAttribute accountIdAttribute = acctArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ID)); String accountIdStr = accountIdAttribute.getValueString(); CentralRepoAccount crAccount = CentralRepository.getInstance().getOrCreateAccount(crAccountType, accountIdStr); CorrelationAttributeInstance corrAttr = makeCorrAttr(acctArtifact, corrType, accountIdStr); if (corrAttr != null) { corrAttr.setAccountId(crAccount.getAccountId()); corrAttrInstances.add(corrAttr); } } }</code><technical_language>reason exception is thrown is account type is in CR. I check account type for membership in set of standard account types. If is in set, i.e., is a custom account type, return making a trip CR all</technical_language>

Target:
private static void makeCorrAttrFromAcctArtifact(List<CorrelationAttributeInstance> corrAttrInstances, BlackboardArtifact acctArtifact) throws TskCoreException, CentralRepoException { BlackboardAttribute accountTypeAttribute = acctArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)); String accountTypeStr = accountTypeAttribute.getValueString(); Account.Type predefinedAccountType = Account.Type.PREDEFINED_ACCOUNT_TYPES.stream().filter(type -> type.getTypeName().equalsIgnoreCase(accountTypeStr)).findAny().orElse(null); if (Account.Type.DEVICE.getTypeName().equalsIgnoreCase(accountTypeStr) == false && predefinedAccountType != null) { CentralRepoAccountType crAccountType = CentralRepository.getInstance().getAccountTypeByName(accountTypeStr); int corrTypeId = crAccountType.getCorrelationTypeId(); CorrelationAttributeInstance.Type corrType = CentralRepository.getInstance().getCorrelationTypeById(corrTypeId); BlackboardAttribute accountIdAttribute = acctArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ID)); String accountIdStr = accountIdAttribute.getValueString(); CentralRepoAccount crAccount = CentralRepository.getInstance().getOrCreateAccount(crAccountType, accountIdStr); CorrelationAttributeInstance corrAttr = makeCorrAttr(acctArtifact, corrType, accountIdStr); if (corrAttr != null) { corrAttr.setAccountId(crAccount.getAccountId()); corrAttrInstances.add(corrAttr); } } }
Source:
<code>private String refererSubstring(String referer) { int method_location = referer.indexOf("://"); int path_location; if(method_location == -1){ <START> path_location = referer.indexOf("/"); <END> } else { path_location = referer.indexOf("/", method_location+3); } if(path_location > -1){ return referer.substring(0, path_location); } return referer; }</code><technical_language>"_" i camelCase</technical_language>

Target:
private String refererSubstring(String referer) { int methodLocation = referer.indexOf("://"); int pathLocation; if(methodLocation == -1){ pathLocation = referer.indexOf("/"); } else { pathLocation = referer.indexOf("/", methodLocation+3); } if(pathLocation > -1){ return referer.substring(0, pathLocation); } return referer; }
Source:
<code>public boolean containsAll(final Collection<?> c) { for (Object o : c) { <START> if(indexOf(o) < 0) { <END> return false; } } return true; }</code><technical_language>"if(" --> "if (" other instances of this,</technical_language>

Target:
public boolean containsAll(final Collection<?> c) { for (Object o : c) { if (!contains(o)) { return false; } } return true; }
Source:
<code>public File merge(final TaskToolbox toolbox, final Map<DataSegment, File> segments, final File outDir) throws Exception { IndexMerger indexMerger = customIndexMerger != null ? customIndexMerger : toolbox.getIndexMergerV9(); FunctionalIterable<QueryableIndex> indexes = FunctionalIterable .create(segments.entrySet()) .transform( new Function<Map.Entry<DataSegment, File>, QueryableIndex>() { @Override public QueryableIndex apply(Map.Entry<DataSegment, File> input) { try { <START> return toolbox.getIndexIO().loadSegment(input.getKey(), input.getValue()).asQueryableIndex(); <END> } catch (Exception e) { throw Throwables.propagate(e); } } } ); return indexMerger.mergeQueryableIndex( Lists.newArrayList(indexes), rollup, aggregators.toArray(new AggregatorFactory[aggregators.size()]), outDir, indexSpec ); }</code><technical_language>is differences loadSegment().asQueryableIndex() loadIndex()? I noticed exists plenty usage of loadIndex(), changed</technical_language>

Target:
public File merge(final TaskToolbox toolbox, final Map<DataSegment, File> segments, final File outDir) throws Exception { IndexMerger indexMerger = customIndexMerger != null ? customIndexMerger : toolbox.getIndexMergerV9(); return indexMerger.mergeQueryableIndex( Lists.transform( ImmutableList.copyOf(segments.values()), new Function<File, QueryableIndex>() { @Override public QueryableIndex apply(@Nullable File input) { try { return toolbox.getIndexIO().loadIndex(input); } catch (Exception e) { throw Throwables.propagate(e); } } } ), rollup, aggregators.toArray(new AggregatorFactory[aggregators.size()]), outDir, indexSpec ); }
Source:
<code>public void test() throws IOException { EntityType entityType1 = entityTestHarness.createDynamicRefEntityType("test1"); dataService.getMeta().addEntityType(entityType1); dataService.add( entityType1.getId(), entityTestHarness.createTestRefEntities(entityType1, 2).stream()); EntityType entityType2 = entityTestHarness.createDynamicRefEntityType("it_emx_test1"); Package it = packageFactory.create("it"); it.setLabel("it"); Package emx = packageFactory.create("it_emx"); emx.setLabel("it_emx"); emx.setParent(it); dataService.getMeta().addPackage(it); dataService.getMeta().addPackage(emx); entityType2.setPackage(emx); dataService.getMeta().addEntityType(entityType2); dataService.add( entityType2.getId(), entityTestHarness.createTestRefEntities(entityType2, 2).stream()); File actual = File.createTempFile("test", ".xlsx"); Package actualIt = dataService.getMeta().getPackage("it").get(); emxDownloadService.download(newArrayList(entityType1), newArrayList(actualIt), actual); <START> Workbook workbook = new XSSFWorkbook(new FileInputStream(actual)); <END> Workbook expected = new XSSFWorkbook( new FileInputStream( ResourceUtils.getFile( EmxExportServiceIT.class, "/xls/expectedDownloadResult.xlsx"))); assertThat(workbook, sameWorkbook(expected)); }</code><technical_language>workbooks closed</technical_language>

Target:
public void test() throws IOException { EntityType entityType1 = entityTestHarness.createDynamicRefEntityType("test1"); dataService.getMeta().addEntityType(entityType1); dataService.add( entityType1.getId(), entityTestHarness.createTestRefEntities(entityType1, 2).stream()); EntityType entityType2 = entityTestHarness.createDynamicRefEntityType("it_emx_test1"); Package it = packageFactory.create("it"); it.setLabel("it"); Package emx = packageFactory.create("it_emx"); emx.setLabel("it_emx"); emx.setParent(it); dataService.getMeta().addPackage(it); dataService.getMeta().addPackage(emx); entityType2.setPackage(emx); dataService.getMeta().addEntityType(entityType2); dataService.add( entityType2.getId(), entityTestHarness.createTestRefEntities(entityType2, 2).stream()); Path actual = Files.createTempFile("test", ".xlsx"); Package actualIt = dataService.getMeta().getPackage("it").get(); emxDownloadService.export(newArrayList(entityType1), newArrayList(actualIt), actual); try (XSSFWorkbook actualWorkbook = new XSSFWorkbook(Files.newInputStream(actual))) { try (Workbook expected = new XSSFWorkbook( new FileInputStream( ResourceUtils.getFile( EmxExportServiceIT.class, "/xls/expectedDownloadResult.xlsx")))) { assertThat(actualWorkbook, sameWorkbook(expected)); } } }
Source:
<code>public void setKeyIdentifierType(String type) { if (Arrays.stream(VALID_KEY_IDENTIFIER_TYPES.split("\\s*,\\s*")).noneMatch(type.toUpperCase()::equals)) { <START> throw new SlimFixtureException(false, "Invalid key identifier type: " + type.toUpperCase() + ". Valid options: " + Arrays.toString(VALID_KEY_IDENTIFIER_TYPES.split("\\s*,\\s*"))); <END> } signatureKeyIdentifierType = getIntValueFromField(WSConstants.class, type.toUpperCase()); }</code><technical_language>suggestion throw new SlimFixtureException(false, "Invalid key identifier type: " + type.toUpperCase() + ". Valid options: " + VALID_KEY_IDENTIFIER_TYPES);</technical_language>

Target:
public void setKeyIdentifierType(String type) { if (Arrays.stream(VALID_KEY_IDENTIFIER_TYPES.split("\\s*,\\s*")).noneMatch(type.toUpperCase()::equals)) { throw new SlimFixtureException(false, "Invalid key identifier type: " + type.toUpperCase() + ". Valid options: " +VALID_KEY_IDENTIFIER_TYPES); } signatureKeyIdentifierType = getIntValueFromField(WSConstants.class, type.toUpperCase()); }
Source:
<code>public IRepositoryServerProvider getRepositoryServerProvider() throws CoreException { if (repositoryServerProviderElement == null) return null; Object object = repositoryServerProviderElement .createExecutableExtension("class"); IRepositoryServerProvider provider = null; <START> if (object instanceof IRepositoryServerProvider) { <END> provider = (IRepositoryServerProvider) object; } return provider; }</code><technical_language>style nit: curly brackets single line blocks</technical_language>

Target:
public IRepositoryServerProvider getRepositoryServerProvider() throws CoreException { if (repositoryServerProviderElement == null) return null; Object object = repositoryServerProviderElement .createExecutableExtension("class"); IRepositoryServerProvider provider = null; if (object instanceof IRepositoryServerProvider) provider = (IRepositoryServerProvider) object; return provider; }
Source:
<code>public boolean removeSecurityGroup(String id) { checkNotNull(id, "id"); ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id); String zone = zoneAndId.getZone(); String groupId = zoneAndId.getId(); Optional<? extends SecurityGroupApi> sgApi = client.getSecurityGroupExtensionForZone(zone); if (!sgApi.isPresent()) { return false; } if (sgApi.get().get(groupId) != null) { sgApi.get().delete(groupId); groupCreator.invalidate(new ZoneSecurityGroupNameAndPorts(zone, groupId, ImmutableSet.<Integer> of())); return true; } <START> return false; <END> }</code><technical_language>pattern above? if (... == null) { // do null case } // do non-null case</technical_language>

Target:
public boolean removeSecurityGroup(String id) { checkNotNull(id, "id"); ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id); String zone = zoneAndId.getZone(); String groupId = zoneAndId.getId(); Optional<? extends SecurityGroupApi> sgApi = api.getSecurityGroupExtensionForZone(zone); if (!sgApi.isPresent()) { return false; } if (sgApi.get().get(groupId) == null) { return false; } sgApi.get().delete(groupId); groupCreator.invalidate(new ZoneSecurityGroupNameAndPorts(zone, groupId, ImmutableSet.<Integer> of())); return true; }
Source:
<code>public ClientJobState(JobState jobState) { List<TaskState> taskStates = jobState.getTasks(); this.tasks = new HashMap<>(taskStates.size()); jobInfo = (JobInfoImpl) jobState.getJobInfo(); owner = jobState.getOwner(); type = jobState.getType(); this.name = jobState.getName(); this.description = jobState.getDescription(); this.projectName = jobState.getProjectName(); this.priority = jobState.getPriority(); this.inputSpace = jobState.getInputSpace(); this.outputSpace = jobState.getOutputSpace(); this.maxNumberOfExecution = jobState.getMaxNumberOfExecution(); this.clientJobSerializationHelper = new ClientJobSerializationHelper(); this.setOnTaskError(jobState.getOnTaskErrorProperty().getValue()); <START> this.genericInformation = jobState.getGenericInformation(); <END> List<ClientTaskState> clientTaskStates = new ArrayList<>(taskStates.size()); for (TaskState ts : taskStates) { clientTaskStates.add(new ClientTaskState(ts)); } addTasks(clientTaskStates); }</code><technical_language>IMO, constructor instead of "="</technical_language>

Target:
public ClientJobState(JobState jobState) { List<TaskState> taskStates = jobState.getTasks(); this.tasks = new HashMap<>(taskStates.size()); jobInfo = (JobInfoImpl) jobState.getJobInfo(); owner = jobState.getOwner(); type = jobState.getType(); this.name = jobState.getName(); this.description = jobState.getDescription(); this.projectName = jobState.getProjectName(); this.priority = jobState.getPriority(); this.inputSpace = jobState.getInputSpace(); this.outputSpace = jobState.getOutputSpace(); this.maxNumberOfExecution = jobState.getMaxNumberOfExecution(); this.clientJobSerializationHelper = new ClientJobSerializationHelper(); this.setOnTaskError(jobState.getOnTaskErrorProperty().getValue()); this.genericInformation = new HashMap<>(jobState.getGenericInformation()); List<ClientTaskState> clientTaskStates = new ArrayList<>(taskStates.size()); for (TaskState ts : taskStates) { clientTaskStates.add(new ClientTaskState(ts)); } addTasks(clientTaskStates); }
Source:
<code><START> @Nullable public String getClientID() { <END> for (FormGroup formGroup : form) { for (FormField formField : formGroup.getFields()) { if (formField.getId().equals("clientID")) { return formField.getValue().toString(); } } } return null; }</code><technical_language>if a function getStringWithFormFieldId(String formFiledId). call function getStringWithFormFieldId("clientID"); getStringWithFormFieldId(clientSecret);, ...</technical_language>

Target:
@Nullable public String getClientID() { return getValueFromField(FormField.CLIENT_ID); }