auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() != Sensor.TYPE_PROXIMITY) { return; } if (AudioPlayer.player == null || !AudioPlayer.player.isPlaying()) { return; } int streamType; if (event.values[0] < 5f && event.values[0] != proximitySensor.getMaximumRange()) { streamType = AudioManager.STREAM_VOICE_CALL; } else { streamType = AudioManager.STREAM_MUSIC; } double position = AudioPlayer.player.getCurrentPosition(); double duration = AudioPlayer.player.getDuration(); double progress = position / duration; <START> if (streamType == AudioManager.STREAM_VOICE_CALL && <END> AudioPlayer.player.getAudioStreamType() != streamType) { synchronized (AudioPlayer.LOCK) { stopCurrent(); try { ViewHolder currentViewHolder = getCurrentViewHolder(); if (currentViewHolder != null) { play(currentViewHolder, currentlyPlayingMessage, true, progress); } } catch (Exception e) { Log.w(Config.LOGTAG, e); } } } else if (streamType == AudioManager.STREAM_MUSIC && AudioPlayer.player.getAudioStreamType() != streamType) { synchronized (AudioPlayer.LOCK) { stopCurrent(); try { ViewHolder currentViewHolder = getCurrentViewHolder(); if (currentViewHolder != null) { play(currentViewHolder, currentlyPlayingMessage, false, progress); } } catch (Exception e) { Log.w(Config.LOGTAG, e); } } } }</code><technical_language>code blocks simplified passing streamType == AudioManager.STREAM_VOICE_CALL instead of true false play(...)</technical_language>

Target:
public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() != Sensor.TYPE_PROXIMITY) { return; } if (AudioPlayer.player == null || !AudioPlayer.player.isPlaying()) { return; } int streamType; if (event.values[0] < 5f && event.values[0] != proximitySensor.getMaximumRange()) { streamType = AudioManager.STREAM_VOICE_CALL; } else { streamType = AudioManager.STREAM_MUSIC; } double position = AudioPlayer.player.getCurrentPosition(); double duration = AudioPlayer.player.getDuration(); double progress = position / duration; if (AudioPlayer.player.getAudioStreamType() != streamType) { synchronized (AudioPlayer.LOCK) { AudioPlayer.player.stop(); AudioPlayer.player.release(); AudioPlayer.player = null; try { ViewHolder currentViewHolder = getCurrentViewHolder(); if (currentViewHolder != null) { play(currentViewHolder, currentlyPlayingMessage, streamType == AudioManager.STREAM_VOICE_CALL, progress); } } catch (Exception e) { Log.w(Config.LOGTAG, e); } } } }
Source:
<code>public void disableUser(ByteBuffer username) { <START> if(credentials.containsValue(ByteBuffers.encodeAsHex(username))) { <END> disabledUsers.add(username); } }</code><technical_language>call isExistingUsername0</technical_language>

Target:
public void disableUser(ByteBuffer username) { long stamp = lock.writeLock(); try { short uid = getUidByUsername0(username); String hex = ByteBuffers.encodeAsHex(username); credentials.put(uid, ENABLED, false); tokenManager.deleteAllUserTokens(hex); } finally { lock.unlockWrite(stamp); } }
Source:
<code>public TasksModel(Context context) { this.mContext = context; File path = this.mContext.getApplicationContext().getDir( DATASTORE_MANGER_DIR, Context.MODE_PRIVATE ); DatastoreManager manager = DatastoreManager.getInstance(path.getAbsolutePath()); try { <START> this.mCloudantSync = manager.openDatastore(TASKS_DATASTORE_NAME); <END> } catch (DatastoreNotCreatedException dnce) { Log.e(LOG_TAG, "Unable to open Datastore", dnce); } Log.d(LOG_TAG, "Set up database at " + path.getAbsolutePath()); try { this.reloadReplicationSettings(); } catch (URISyntaxException e) { Log.e(LOG_TAG, "Unable to construct remote URI from configuration", e); } this.mHandler = new Handler(Looper.getMainLooper()); Log.d(LOG_TAG, "TasksModel set up " + path.getAbsolutePath()); }</code><technical_language>I openDatastore is a great naming called CloudantSync. worry for this PR though</technical_language>

Target:
public TasksModel(Context context) { this.mContext = context; File path = this.mContext.getApplicationContext().getDir( DATASTORE_MANGER_DIR, Context.MODE_PRIVATE ); DatastoreManager manager = DatastoreManager.getInstance(path.getAbsolutePath()); try { this.mDatastore = manager.openDatastore(TASKS_DATASTORE_NAME); } catch (DatastoreNotCreatedException dnce) { Log.e(LOG_TAG, "Unable to open Datastore", dnce); } Log.d(LOG_TAG, "Set up database at " + path.getAbsolutePath()); try { this.reloadReplicationSettings(); } catch (URISyntaxException e) { Log.e(LOG_TAG, "Unable to construct remote URI from configuration", e); } this.mHandler = new Handler(Looper.getMainLooper()); Log.d(LOG_TAG, "TasksModel set up " + path.getAbsolutePath()); }
Source:
<code>public void testWaitUntilJobInitializationFinished_throwsInitializationException() throws Exception { final JobVertex testVertex = new DispatcherTest.FailingInitializationJobVertex("testVertex"); testVertex.setInvokableClass(NoOpInvokable.class); JobGraph jobGraph = new JobGraph(TEST_JOB_ID, "testJob", testVertex); Dispatcher dispatcher = createAndStartDispatcher(); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); CommonTestUtils.assertThrows("Could not instantiate JobManager", JobInitializationException.class, () -> { ClientUtils.waitUntilJobInitializationFinished(jobGraph.getJobID(), () -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get(), () -> dispatcherGateway.requestJobResult(jobGraph.getJobID(), TIMEOUT).get(), ClassLoader.getSystemClassLoader()); return null; }); <START> CommonTestUtils.assertThrows("Could not instantiate JobManager", ExecutionException.class, () -> { <END> dispatcher.closeAsync().get(); return null; }); }</code><technical_language>shut of Dispatcher fail if job submission failed? A submission failure is affect Flink happen is normal</technical_language>

Target:
public void testWaitUntilJobInitializationFinished_throwsInitializationException() { Iterator<JobStatus> statusSequenceIterator = Arrays.asList( JobStatus.INITIALIZING, JobStatus.INITIALIZING, JobStatus.FAILED).iterator(); CommonTestUtils.assertThrows("Something is wrong", JobInitializationException.class, () -> { ClientUtils.waitUntilJobInitializationFinished( statusSequenceIterator::next, () -> { Throwable throwable = new JobInitializationException( TESTING_JOB_ID, "Something is wrong", new RuntimeException("Err")); return buildJobResult(throwable); }, ClassLoader.getSystemClassLoader()); return null; }); }
Source:
<code>public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; LocalDate expiry = LocalDate.parse(args[1]); Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); context.renewUsernameClaim(expiry).get(); <START> LOG.info("Logged in " + username + " successfully!"); <END> }</code><technical_language>This is designed a cmd line class, this System.out</technical_language>

Target:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; LocalDate expiry = LocalDate.parse(args[1]); Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); context.renewUsernameClaim(expiry).get(); System.out.println("Logged in " + username + " successfully!"); }
Source:
<code>public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) throws IOException { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); boolean useFixedReferences = has( headerByte, HEADER_BIT_FIXED_REFERENCE ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); if ( useFixedReferences ) { readFixedReferencesRecord( record, cursor ); } else { record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); } record.setUseFixedReferences( useFixedReferences ); <START> if ( (blockCount > record.getBlockCapacity()) || (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) <END> { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }</code><technical_language>please touch formats, do do</technical_language>

Target:
public void read( PropertyRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); boolean useFixedReferences = has( headerByte, HEADER_BIT_FIXED_REFERENCE ); if ( mode.shouldLoad( inUse ) ) { int blockCount = headerByte >>> 4; long recordId = record.getId(); if ( useFixedReferences ) { readFixedReferencesRecord( record, cursor ); } else { record.initialize( inUse, toAbsolute( Reference.decode( cursor ), recordId ), toAbsolute( Reference.decode( cursor ), recordId ) ); } record.setUseFixedReferences( useFixedReferences ); if ( (blockCount > record.getBlockCapacity()) | (RECORD_SIZE - (cursor.getOffset() - offset) < blockCount * Long.BYTES) ) { cursor.setCursorException( "PropertyRecord claims to contain more blocks than can fit in a record" ); return; } while ( blockCount-- > 0 ) { record.addLoadedBlock( cursor.getLong() ); } } }
Source:
<code>public Table<String, String, Set<String>> getPageMultiTrees(final IHTMLPage page, final boolean liveMode) throws DotDataException, DotSecurityException { Table<String, String, Set<String>> pageContents = HashBasedTable.create(); <START> List<MultiTree> multis = MultiTreeFactory.getMultiTrees(page.getIdentifier()); <END> for (MultiTree t : multis) { Container container = (liveMode) ? (Container) vers.findLiveVersion(t.getContainer(), sys, false) : (Container) vers.findWorkingVersion(t.getContainer(), sys, false); if(container==null && ! liveMode) { continue; } Contentlet contentlet = null; try { contentlet = conAPI.findContentletByIdentifier(t.getContentlet(), liveMode, -1, sys, false); }catch(Exception e){ Logger.warn(this.getClass(), "invalid contentlet on multitree:" + t); } if(contentlet==null ) { continue; }; Set<String> myContents = pageContents.contains(t.getContainer(), t.getRelationType()) ? pageContents.get(t.getContainer(), t.getRelationType()) : new LinkedHashSet<>(); if(myContents.size()< container.getMaxContentlets()) { myContents.add(t.getContentlet()); } else { } pageContents.put(t.getContainer(), t.getRelationType(), myContents); } return pageContents; }</code><technical_language>Rename multiTreeList</technical_language>

Target:
public Table<String, String, Set<String>> getPageMultiTrees(final IHTMLPage page, final boolean liveMode) throws DotDataException, DotSecurityException { final Table<String, String, Set<String>> pageContents = HashBasedTable.create(); final List<MultiTree> multiTres = MultiTreeFactory.getMultiTrees(page.getIdentifier()); for (final MultiTree multiTree : multiTres) { final Container container = (liveMode) ? (Container) versionableAPI.findLiveVersion(multiTree.getContainer(), systemUser, false) : (Container) versionableAPI.findWorkingVersion(multiTree.getContainer(), systemUser, false); if(container==null && ! liveMode) { continue; } Contentlet contentlet = null; try { contentlet = contentletAPI.findContentletByIdentifier(multiTree.getContentlet(), liveMode, -1, systemUser, false); }catch(DotDataException | DotSecurityException | DotContentletStateException e){ Logger.warn(this.getClass(), "invalid contentlet on multitree:" + multiTree); } if(contentlet!=null ) { final Set<String> myContents = pageContents.contains(multiTree.getContainer(), multiTree.getRelationType()) ? pageContents.get(multiTree.getContainer(), multiTree.getRelationType()) : new LinkedHashSet<>(); if(container != null && myContents.size() < container.getMaxContentlets()) { myContents.add(multiTree.getContentlet()); } pageContents.put(multiTree.getContainer(), multiTree.getRelationType(), myContents); }; } return pageContents; }
Source:
<code>public void testGetOpenEngSBModelEntries_shouldWork() { TestModel model = service.createEmptyModelObject(TestModel.class); String id = "testId"; Date date = new Date(); model.setDate(date); model.setId(id); List<OpenEngSBModelEntry> entries = model.getOpenEngSBModelEntries(); boolean idExisting = false; boolean dateExisting = false; boolean nameExisting = false; String tempId = null; Date tempDate = null; String tempName = null; <START> for (OpenEngSBModelEntry entry : entries) { <END> if (entry.getKey().equals("id")) { idExisting = true; tempId = (String) entry.getValue(); } else if (entry.getKey().equals("date")) { dateExisting = true; tempDate = (Date) entry.getValue(); } else if (entry.getKey().equals("name")) { nameExisting = true; tempName = (String) entry.getValue(); } } assertThat(idExisting, is(true)); assertThat(dateExisting, is(true)); assertThat(nameExisting, is(true)); assertThat(tempId, is(id)); assertThat(tempDate, is(date)); assertThat(tempName, nullValue()); }</code><technical_language>This test is confusing</technical_language>

Target:
public void testGetOpenEngSBModelEntries_shouldWork() { TestModel model = service.createEmptyModelObject(TestModel.class); String id = "testId"; model.setId(id); List<OpenEngSBModelEntry> entries = model.getOpenEngSBModelEntries(); boolean idExisting = false; String tempId = null; for (OpenEngSBModelEntry entry : entries) { if (entry.getKey().equals("id")) { idExisting = true; tempId = (String) entry.getValue(); } } assertThat(idExisting, is(true)); assertThat(tempId, is(id)); }
Source:
<code>private void testEditSessionAction() throws Exception { ______TS("typical success case"); feedbackEditPage.clickManualPublishTimeButton(); feedbackEditPage.clickDefaultVisibleTimeButton(); feedbackEditPage.editFeedbackSession(editedSession.startTime, editedSession.endTime, editedSession.instructions, editedSession.gracePeriod); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_EDITED); FeedbackSessionAttributes savedSession = BackDoor.getFeedbackSession( editedSession.courseId, editedSession.feedbackSessionName); assertEquals(editedSession.toString(), savedSession.toString()); feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditSuccess.html"); ______TS("test edit page session visibility period settings after manual publish"); editedSession.resultsVisibleFromTime = Const.TIME_REPRESENTS_NOW; String status = BackDoor.editFeedbackSession(editedSession); assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, status); feedbackEditPage = getFeedbackEditPage(); assertFalse(feedbackEditPage.isElementSelected(Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_atvisible")); <START> <END> feedbackEditPage.clickEditSessionButton(); feedbackEditPage.clickEditUncommonSettingsButton(); feedbackEditPage.clickDefaultPublishTimeButton(); feedbackEditPage.clickSaveSessionButton(); }</code><technical_language>a question, do test publish immediately button selected? 'original values' refer to</technical_language>

Target:
private void testEditSessionAction() throws Exception { ______TS("typical success case"); feedbackEditPage.clickManualPublishTimeButton(); feedbackEditPage.clickDefaultVisibleTimeButton(); feedbackEditPage.editFeedbackSession(editedSession.startTime, editedSession.endTime, editedSession.instructions, editedSession.gracePeriod); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_EDITED); FeedbackSessionAttributes savedSession = BackDoor.getFeedbackSession( editedSession.courseId, editedSession.feedbackSessionName); assertEquals(editedSession.toString(), savedSession.toString()); feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditSuccess.html"); ______TS("test edit page not changed after manual publish"); editedSession.resultsVisibleFromTime = Const.TIME_REPRESENTS_NOW; String status = BackDoor.editFeedbackSession(editedSession); assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, status); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.verifyHtml("/instructorFeedbackEditManuallyPublished.html"); feedbackEditPage.clickEditSessionButton(); feedbackEditPage.clickEditUncommonSettingsButton(); feedbackEditPage.clickDefaultPublishTimeButton(); feedbackEditPage.clickSaveSessionButton(); }
Source:
<code>StatsDProcessor(final int queueSize, final StatsDClientErrorHandler handler, final int maxPacketSizeBytes, final int poolSize, final int workers) throws Exception { this.handler = handler; this.workers = workers; this.executor = Executors.newFixedThreadPool(workers); this.bufferPool = new BufferPool(poolSize, maxPacketSizeBytes, true); this.outboundQueue = new ArrayBlockingQueue<ByteBuffer>(poolSize); this.endSignal = new CountDownLatch(workers); this.builders = new ArrayList<>(workers); this.charBuffers = new ArrayList<>(workers); for (int i = 0 ; i < workers ; i++) { StringBuilder builder = new StringBuilder(); CharBuffer buffer = CharBuffer.wrap(builder); builders.add(builder); charBuffers.add(buffer); <START> } <END> }</code><technical_language>obsolete</technical_language>

Target:
StatsDProcessor(final int queueSize, final StatsDClientErrorHandler handler, final int maxPacketSizeBytes, final int poolSize, final int workers) throws Exception { this.handler = handler; this.workers = workers; this.executor = Executors.newFixedThreadPool(workers); this.bufferPool = new BufferPool(poolSize, maxPacketSizeBytes, true); this.outboundQueue = new ArrayBlockingQueue<ByteBuffer>(poolSize); this.endSignal = new CountDownLatch(workers); }
Source:
<code>public void add(String item, long count) { item = item.trim(); String sql = "insert into counts (item, value) values(?,?)"; try { Connection c = getConnection(dbFile); PreparedStatement stmt = c.prepareStatement(sql); stmt.setString(1, item); stmt.setLong(2, count); stmt.executeUpdate(); } catch (Exception ex) { <START> logger.info("Cannot add (" + item + ", " + count + ")"); <END> throw new RuntimeException(ex); } }</code><technical_language>exception, output STDERR</technical_language>

Target:
public void add(String item, long count) { item = item.trim(); String sql = "insert into counts (item, value) values(?,?)"; try { Connection c = getConnection(dbFile); PreparedStatement stmt = c.prepareStatement(sql); stmt.setString(1, item); stmt.setLong(2, count); stmt.executeUpdate(); } catch (Exception ex) { System.err.println("Cannot add (" + item + ", " + count + ")"); throw new RuntimeException(ex); } }
Source:
<code>public void testRecordsWithMoreThanTwoChildren() throws InvalidRecordsException { ArrayList<Record> records = new ArrayList<>(); records.add(new Record(0, 0)); records.add(new Record(1, 0)); records.add(new Record(2, 0)); records.add(new Record(3, 0)); TreeNode root = new BuildTree().buildTree(records); assertNodeIsBranch(root, 0, 3); assertNodeIsLeaf(root.children.get(0), 1); assertNodeIsLeaf(root.children.get(1), 2); assertNodeIsLeaf(root.children.get(2), 3); <START> <END> }</code><technical_language>need this extra empty line</technical_language>

Target:
public void testRecordsWithMoreThanTwoChildren() throws InvalidRecordsException { ArrayList<Record> records = new ArrayList<>(); records.add(new Record(0, 0)); records.add(new Record(1, 0)); records.add(new Record(2, 0)); records.add(new Record(3, 0)); TreeNode root = new BuildTree().buildTree(records); assertNodeIsBranchWithNNumberOfChildren(root, 3); assertNodeIsLeaf(root.getChildren().get(0)); assertNodeIsLeaf(root.getChildren().get(1)); assertNodeIsLeaf(root.getChildren().get(2)); assertEquals(root.getNodeId(), 0); assertEquals(root.getChildren().get(0).getNodeId(), 1); assertEquals(root.getChildren().get(1).getNodeId(), 2); assertEquals(root.getChildren().get(2).getNodeId(), 3); }
Source:
<code>public void testRegexpFunctionExtension3() throws InterruptedException { log.info("RegexpFunctionExtension TestCase with invalid datatype"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol int, price long, regex string);"; <START> String query = ("@info(name = 'query1') from inputStream select symbol , str:regexp(symbol, regex) as beginsWithWSO2 " + <END> "insert into outputStream;"); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }</code><technical_language>Please line length 120 chars (in other files too)</technical_language>

Target:
public void testRegexpFunctionExtension3() throws InterruptedException { log.info("RegexpFunctionExtension TestCase"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol string, price long, regex string);"; String query = ("@info(name = 'query1') from inputStream select symbol , " + "str:regexp(symbol) as beginsWithWSO2 " + "insert into outputStream;"); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime (inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }
Source:
<code>private static <S extends OafEntity, T extends SpecificRecord>JavaRDD<T> parseToAvro(JavaRDD<S> source, OafEntityToAvroConverter<S, T> entityConverter) { <START> return source.map(x -> entityConverter.convert(x)).filter(x -> x != null); <END> }</code><technical_language>IDE hints replace source.map(x -> entityConverter.convert(x)).filter(x -> x != null) source.map(entityConverter::convert).filter(Objects::nonNull)</technical_language>

Target:
private static <S extends OafEntity, T extends SpecificRecord>JavaRDD<T> parseToAvro(JavaRDD<S> source, OafEntityToAvroConverter<S, T> entityConverter) { return source.map(entityConverter::convert).filter(Objects::nonNull); }
Source:
<code>public void startExport(Process process) throws IOException, DAOException { User user = ServiceManager.getUserService().getAuthenticatedUser(); URI userHome = ServiceManager.getUserService().getHomeDirectory(user); boolean exported = process.isExported(); process.setExported(true); boolean exportSucessfull = startExport(process, userHome); if (exportSucessfull) { if (Objects.nonNull(process.getParent())) { startExport(process.getParent()); } } else { <START> process.setExported(exported); <END> } }</code><technical_language>A save DB is missing (and in ExportDms). Please adjust ExportMetsIT test reload DB</technical_language>

Target:
public void startExport(Process process) throws DAOException, DataException, IOException { User user = ServiceManager.getUserService().getAuthenticatedUser(); URI userHome = ServiceManager.getUserService().getHomeDirectory(user); boolean exportSucessfull = startExport(process, userHome); if (exportSucessfull) { if (Objects.nonNull(process.getParent())) { startExport(process.getParent()); } } }
Source:
<code>protected boolean canDoAction() { if (getParameters().getDiskImage().getDiskStorageType() != DiskStorageType.IMAGE && getParameters().getDiskImage().getDiskStorageType() != DiskStorageType.CINDER) { addCanDoActionMessageVariable("diskId", getParameters().getDiskImage().getId()); addCanDoActionMessageVariable("storageType", getParameters().getDiskImage().getDiskStorageType()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_DISK_STORAGE_TYPE); return false; } if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExist())) { addCanDoActionMessageVariable("diskId", getParameters().getDiskImage().getId()); addCanDoActionMessageVariable("domainId", getStorageDomainId()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_UNAVAILABLE); return false; } if (!getStorageDomain().getStorageDomainType().isDataDomain() && <START> !(getStorageDomain().getStorageDomainType() == StorageDomainType.Volume)) { <END> addCanDoActionMessageVariable("domainId", getParameters().getStorageDomainId()); addCanDoActionMessageVariable("domainType", getStorageDomain().getStorageDomainType()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED); return false; } if (getParameters().getDiskImage().getDiskStorageType() == DiskStorageType.IMAGE && !setAndValidateDiskProfiles()) { return false; } return true; }</code><technical_language>means storage domain is Cinder register disks, I wrong</technical_language>

Target:
protected boolean canDoAction() { if (getParameters().getDiskImage().getDiskStorageType() != DiskStorageType.IMAGE) { addCanDoActionMessageVariable("diskId", getParameters().getDiskImage().getId()); addCanDoActionMessageVariable("storageType", getParameters().getDiskImage().getDiskStorageType()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_UNSUPPORTED_DISK_STORAGE_TYPE); return false; } if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExist())) { addCanDoActionMessageVariable("diskId", getParameters().getDiskImage().getId()); addCanDoActionMessageVariable("domainId", getStorageDomainId()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_UNAVAILABLE); return false; } if (!getStorageDomain().getStorageDomainType().isDataDomain()) { addCanDoActionMessageVariable("domainId", getParameters().getStorageDomainId()); addCanDoActionMessageVariable("domainType", getStorageDomain().getStorageDomainType()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED); return false; } if (!setAndValidateDiskProfiles()) { return false; } return true; }
Source:
<code>public void testWithValidTestNamesFromMultiChildSuites() throws MalformedURLException { JarFileUtils utils = newJarFileUtils(Arrays.asList("testng-tests-child2", "testng-tests-child4", "testng-tests-child5")); String[] expectedTestNames = new String[]{"testng-tests-child2", "testng-tests-child4", "testng-tests-child5"}; <START> String[] expectedClassNames = new String[]{"" + <END> "org.testng.jarfileutils.org.testng.SampleTest2", "org.testng.jarfileutils.org.testng.SampleTest4", "org.testng.jarfileutils.org.testng.SampleTest5"}; List<XmlSuite> suites = utils.extractSuitesFrom(jar); assertThat(suites).hasSize(3); XmlSuite suite = suites.get(0); assertThat(suite.getName()).isEqualTo("testng-tests-suite"); List<String> testNames = new LinkedList<>(); List<String> classNames = new LinkedList<>(); for(XmlSuite xmlSuite : suites){ extractClassNames(xmlSuite, testNames, classNames); } assertThat(testNames).containsExactly(expectedTestNames); assertThat(classNames).contains(expectedClassNames); }</code><technical_language>remove "" +</technical_language>

Target:
public void testWithValidTestNamesFromMultiChildSuites() throws MalformedURLException { JarFileUtils utils = newJarFileUtils(Arrays.asList("testng-tests-child2", "testng-tests-child4", "testng-tests-child5")); String[] expectedTestNames = new String[]{"testng-tests-child2", "testng-tests-child4", "testng-tests-child5"}; String[] expectedClassNames = new String[]{ "org.testng.jarfileutils.org.testng.SampleTest2", "org.testng.jarfileutils.org.testng.SampleTest4", "org.testng.jarfileutils.org.testng.SampleTest5"}; List<XmlSuite> suites = utils.extractSuitesFrom(jar); assertThat(suites).hasSize(3); XmlSuite suite = suites.get(0); assertThat(suite.getName()).isEqualTo("testng-tests-suite"); List<String> testNames = new LinkedList<>(); List<String> classNames = new LinkedList<>(); for(XmlSuite xmlSuite : suites){ extractClassNames(xmlSuite, testNames, classNames); } assertThat(testNames).containsExactly(expectedTestNames); assertThat(classNames).contains(expectedClassNames); }
Source:
<code>protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp = args[0]; abvs.reset(); sb.reset(abvs); try { if (tvp.getTag() == ValueTag.SEQUENCE_TAG) { tvp.getValue(sp); int size1 = sp.getEntryCount(); for (int i = 0; i < size1; i++) { sp.getEntry(i, tempTvp); if (tempTvp.getTag() == ValueTag.ARRAY_TAG) { tempTvp.getValue(ap); ap.appendSequence(sb); } else { <START> XDMConstants.setEmptySequence(result); <END> } } } else if (tvp.getTag() == ValueTag.ARRAY_TAG) { tvp.getValue(ap); ap.appendSequence(sb); } else { XDMConstants.setEmptySequence(result); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }</code><technical_language>I this is correct. Setting empty sequence is useless. sequence is saved result this is overwritten. I else removed</technical_language>

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp = args[0]; try { abvs.reset(); sb.reset(abvs); if (tvp.getTag() == ValueTag.SEQUENCE_TAG) { tvp.getValue(sp); int size1 = sp.getEntryCount(); for (int i = 0; i < size1; i++) { sp.getEntry(i, tempTvp); if (tempTvp.getTag() == ValueTag.ARRAY_TAG) { tempTvp.getValue(ap); ap.appendItems(sb); } } } else if (tvp.getTag() == ValueTag.ARRAY_TAG) { tvp.getValue(ap); ap.appendItems(sb); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }
Source:
<code>public void tenantUpdate(WebContext ctx, JSONStructuredOutput out, String tenantId) { T tenant = find(getTenantClass(), tenantId); assertNotNew(tenant); load(ctx, tenant); if (ctx.hasParameter(Tenant.TENANT_DATA.inner(TenantData.CONFIG_STRING).getName())) { tenant.getTenantData().getConfig(); } <START> tenant.getTenantData().getPackageData().getAdditionalPermissions().clear(); <END> for (String permission : ctx.getParameters("permissions")) { if (getPermissions().contains(permission)) { tenant.getTenantData().getPackageData().getAdditionalPermissions().add(permission); } } tenant.getMapper().update(tenant); }</code><technical_language>this sense? remove this block alltogether</technical_language>

Target:
public void tenantUpdate(WebContext ctx, JSONStructuredOutput out, String tenantId) { T tenant = find(getTenantClass(), tenantId); assertNotNew(tenant); load(ctx, tenant); if (ctx.hasParameter(Tenant.TENANT_DATA.inner(TenantData.CONFIG_STRING).getName())) { tenant.getTenantData().getConfig(); } tenant.getMapper().update(tenant); }
Source:
<code>private String getDefaultFilename() throws UnknownHostException { String hostName = InetAddress.getLocalHost().getHostName(); <START> String safeFilename = hostName.replaceAll( "[^a-zA-Z0-9._]+", "_" ); <END> SimpleDateFormat dumpFormat = new SimpleDateFormat( "yyyy-MM-dd_HHmmss" ); return safeFilename + "-" + dumpFormat.format( new Date() ) + ".zip"; }</code><technical_language>Minot thing: i good compile this pattern independently matcher. do important leave you</technical_language>

Target:
private String getDefaultFilename() throws UnknownHostException { String hostName = InetAddress.getLocalHost().getHostName(); String safeFilename = hostName.replaceAll( "[^a-zA-Z0-9._]+", "_" ); return safeFilename + "-" + LocalDateTime.now().format( filenameDateTimeFormatter ) + ".zip"; }
Source:
<code>private List<String> parseJournals(Site site, List<String> journalParams, String unformattedQuery) { if (!Strings.isNullOrEmpty(unformattedQuery) && (journalParams == null || journalParams.isEmpty())) { return new ArrayList(siteSet.getJournalKeys()); } else { if (journalParams == null || journalParams.isEmpty()) { return Collections.singletonList(site.getJournalKey()); } else { <START> if (journalParams.get(0).toLowerCase().equals("all")) { <END> return new ArrayList(siteSet.getJournalKeys()); } return journalParams; } } }</code><technical_language>equalsIgnoreCase() for this comparison</technical_language>

Target:
private List<String> parseJournals(Site site, List<String> journalParams, String unformattedQuery) { boolean journalParamsEmpty = journalParams == null || journalParams.isEmpty(); if ((!Strings.isNullOrEmpty(unformattedQuery) && journalParamsEmpty) || (journalParams != null && journalParams.get(0).equalsIgnoreCase("all"))) { return new ArrayList(siteSet.getJournalKeys()); } else { if (journalParamsEmpty) { return Collections.singletonList(site.getJournalKey()); } else { return journalParams; } } }
Source:
<code>public FileformatInterface readMetadataFile(Process process) throws ReadException, IOException, PreferencesException { URI metadataFileUri = serviceManager.getFileService().getMetadataFilePath(process); if (!checkForMetadataFile(process)) { throw new IOException(Helper.getTranslation("metadataFileNotFound") + " " + metadataFileUri); } String type = MetadatenHelper.getMetaFileType(metadataFileUri); logger.debug("current meta.xml file type for id {}: {}", process.getId(), type); FileformatInterface ff = determineFileFormat(type, process); try { ff.read(serviceManager.getFileService().getFile(metadataFileUri).toString()); } catch (ReadException e) { if (e.getMessage().startsWith("Parse error at line -1")) { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung("metadataCorrupt"); } else { throw e; } } return ff; }</code><technical_language>Please replace this log call Helper.setFehlermeldung Helper.setErrorMessage bundles calls</technical_language>

Target:
public FileformatInterface readMetadataFile(Process process) throws ReadException, IOException, PreferencesException { URI metadataFileUri = serviceManager.getFileService().getMetadataFilePath(process); if (!checkForMetadataFile(process)) { throw new IOException(Helper.getTranslation("metadataFileNotFound") + " " + metadataFileUri); } String type = MetadatenHelper.getMetaFileType(metadataFileUri); logger.debug("current meta.xml file type for id {}: {}", process.getId(), type); FileformatInterface ff = determineFileFormat(type, process); try { ff.read(serviceManager.getFileService().getFile(metadataFileUri).toString()); } catch (ReadException e) { if (e.getMessage().startsWith("Parse error at line -1")) { Helper.setErrorMessage("metadataCorrupt", logger, e); } else { throw e; } } return ff; }
Source:
<code>public static void bootstrap() throws IOException { String profile = System.getProperty(PROPERTY_PROFILE, PROFILE_MEMORY); <START> LOGGER.info(String.format("Bootstrap OrientDB connection properties with profile [%s].", <END> profile)); try (InputStream is = ConnectionConfigOrientDB.class.getResourceAsStream(String.format("/%s.properties", profile))) { Properties properties = new Properties(); properties.load(is); properties.keySet() .stream() .forEach(p -> { if (System.getProperty((String) p) != null) { return; } LOGGER.info(String.format("Use default value for OrientDB connection property [%s].", p)); System.setProperty((String) p, properties.getProperty((String) p)); }); } }</code><technical_language>Also, names of loggers lowercase in project (logger) codebase</technical_language>

Target:
public static void bootstrap() throws IOException { String profile = System.getProperty(PROPERTY_PROFILE, PROFILE_MEMORY); logger.info(String.format("Bootstrap OrientDB connection properties with profile [%s].", profile)); try (InputStream is = ConnectionConfigOrientDB.class.getResourceAsStream(String.format("/%s.properties", profile))) { Properties properties = new Properties(); properties.load(is); properties.keySet() .stream() .forEach(p -> { if (System.getProperty((String) p) != null) { return; } logger.info(String.format("Use default value for OrientDB connection property [%s].", p)); System.setProperty((String) p, properties.getProperty((String) p)); }); } }
Source:
<code>public ResponseEntity removeRepository(@ApiParam(value = "The storageId", required = true) @PathVariable final String storageId, @ApiParam(value = "The repositoryId", required = true) @PathVariable final String repositoryId, @ApiParam(value = "Whether to force delete the repository from the file system") @RequestParam(name = "force", defaultValue = "false") final boolean force) { final Repository repository = configurationManagementService.getStorage(storageId) .getRepository(repositoryId); if (repository != null) { try { <START> logger.debug(storageId); <END> logger.debug(repositoryId); repositoryIndexManager.closeIndexer(storageId + ":" + repositoryId); final File repositoryBaseDir = new File(repository.getBasedir()); if (!repositoryBaseDir.exists() && force) { repositoryManagementService.removeRepository(storageId, repository.getId()); } Configuration configuration = getConfiguration(); Storage storage = configuration.getStorage(storageId); storage.removeRepository(repositoryId); configurationManagementService.saveStorage(storage); logger.debug("Removed repository " + storageId + ":" + repositoryId + "."); return ResponseEntity.ok().build(); } catch (IOException | ConfigurationException e) { logger.error(e.getMessage(), e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body("Failed to remove repository " + repositoryId + "!"); } } else { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body("Repository " + storageId + ":" + repositoryId + " was not found."); } }</code><technical_language>please remove debug statements? useless are</technical_language>

Target:
public ResponseEntity removeRepository(@ApiParam(value = "The storageId", required = true) @PathVariable final String storageId, @ApiParam(value = "The repositoryId", required = true) @PathVariable final String repositoryId, @ApiParam(value = "Whether to force delete the repository from the file system") @RequestParam(name = "force", defaultValue = "false") final boolean force) { final Repository repository = configurationManagementService.getStorage(storageId) .getRepository(repositoryId); if (repository != null) { try { repositoryIndexManager.closeIndexer(storageId + ":" + repositoryId); final File repositoryBaseDir = new File(repository.getBasedir()); if (!repositoryBaseDir.exists() && force) { repositoryManagementService.removeRepository(storageId, repository.getId()); } Configuration configuration = getConfiguration(); Storage storage = configuration.getStorage(storageId); storage.removeRepository(repositoryId); configurationManagementService.saveStorage(storage); logger.debug("Removed repository " + storageId + ":" + repositoryId + "."); return ResponseEntity.ok().build(); } catch (IOException | ConfigurationException e) { logger.error(e.getMessage(), e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body("Failed to remove repository " + repositoryId + "!"); } } else { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body("Repository " + storageId + ":" + repositoryId + " was not found."); } }
Source:
<code>public String toString() { <START> return String.format("JobId : %s, StepId : %s, Execution Method : %s", <END> jobId, stepId, executionMethod); }</code><technical_language>pls ToStringBuilder</technical_language>

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("JobId", jobId) .append("StepId", stepId) .append("Execution Method", executionMethod).build(); }
Source:
<code>public File zipDirectory(File workingDir, File directoryToZip) { String zipFilePath = workingDir.getAbsolutePath() + "/directory.zip"; try { FileOutputStream fos = new FileOutputStream(zipFilePath); ZipOutputStream zos = new ZipOutputStream(fos); zipFile(directoryToZip, "/", zos); <START> zos.close(); <END> fos.close(); } catch (IOException ex) { exceptionMessage(ex, "There was a problem zipping the directory '" + directoryToZip.getPath() + "'", IO_ERROR); } catch (Exception ex) { exceptionMessage(ex, "There was a problem zipping the directory '" + directoryToZip.getPath() + "'", GENERIC_ERROR); } return new File(zipFilePath); }</code><technical_language>I need do this next line in a finally</technical_language>

Target:
public File zipDirectory(File workingDir, File directoryToZip) { String zipFilePath = workingDir.getAbsolutePath() + "/directory.zip"; try (FileOutputStream fos = new FileOutputStream(zipFilePath); ZipOutputStream zos = new ZipOutputStream(fos)) { zipFile(directoryToZip, "/", zos); } catch (IOException ex) { exceptionMessage(ex, "There was a problem zipping the directory '" + directoryToZip.getPath() + "'", IO_ERROR); } catch (Exception ex) { exceptionMessage(ex, "There was a problem zipping the directory '" + directoryToZip.getPath() + "'", GENERIC_ERROR); } return new File(zipFilePath); }
Source:
<code>public void testRemoteInterpreterWithMultipleInterpreterInGroup() throws TException, InterruptedException { RemoteInterpreterServer server = new RemoteInterpreterServer(3679); server.start(); <START> boolean running = false; <END> long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < 10 * 1000) { if (server.isRunning()) { running = true; break; } else { Thread.sleep(200); } } Properties properties = new Properties(); properties.setProperty(Constants.ZEPPELIN_INTERPRETER_PORT, "3679"); properties.setProperty(Constants.ZEPPELIN_INTERPRETER_HOST, "localhost"); InterpreterGroup intpGroup = mock(InterpreterGroup.class); when(intpGroup.getProperty()).thenReturn(properties); when(intpGroup.containsKey(Constants.EXISTING_PROCESS)).thenReturn(true); RemoteInterpreterProcess rip = new RemoteInterpreterProcess(INTERPRETER_SCRIPT, "nonexists", "fakeRepo", new HashMap<String, String>(), 10 * 1000, null); assertFalse(rip.isRunning()); assertEquals(0, rip.referenceCount()); assertEquals(1, rip.reference(intpGroup)); assertEquals(2, rip.reference(intpGroup)); assertEquals(true, rip.isRunning()); }</code><technical_language>this variable all. please remove it</technical_language>

Target:
public void testRemoteInterpreterWithMultipleInterpreterInGroup() throws TException, InterruptedException { RemoteInterpreterServer server = new RemoteInterpreterServer(3679); server.start(); long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < 30 * 1000) { if (server.isRunning()) { break; } else { Thread.sleep(200); } } Properties properties = new Properties(); properties.setProperty(Constants.ZEPPELIN_INTERPRETER_PORT, "3679"); properties.setProperty(Constants.ZEPPELIN_INTERPRETER_HOST, "localhost"); InterpreterGroup intpGroup = mock(InterpreterGroup.class); when(intpGroup.getProperty()).thenReturn(properties); when(intpGroup.containsKey(Constants.EXISTING_PROCESS)).thenReturn(true); RemoteInterpreterProcess rip = new RemoteInterpreterProcess(INTERPRETER_SCRIPT, "nonexists", "fakeRepo", new HashMap<String, String>(), 30 * 1000, null); assertFalse(rip.isRunning()); assertEquals(0, rip.referenceCount()); assertEquals(1, rip.reference(intpGroup)); assertEquals(2, rip.reference(intpGroup)); assertEquals(true, rip.isRunning()); }
Source:
<code>private void initializeEvents() { ChangeHandler encodingChangeHandler = new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { if (encoding_.getSelectedItemText() == "Other") { globalDisplay_.promptForText( "Encoding Identifier", "Please enter an encoding identifier. For a list of valid encodings run iconvlist().", encoding_.getSelectedValue(), new OperationWithInput<String>() { @Override public void execute(final String otherEncoding) { <START> int selectedIndex = encoding_.getSelectedIndex(); <END> replaceOtherEncodingItem(selectedIndex, otherEncoding); } } ); } } }; encoding_.addChangeHandler(encodingChangeHandler); }</code><technical_language>treat empty string a cancel here</technical_language>

Target:
private void initializeEvents() { ChangeHandler encodingChangeHandler = new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { if (encoding_.getSelectedItemText() == otherLabel) { globalDisplay_.promptForText( "Encoding Identifier", "Please enter an encoding identifier. For a list of valid encodings run iconvlist().", encoding_.getSelectedValue(), new OperationWithInput<String>() { @Override public void execute(final String otherEncoding) { for (int idxEncoding = 0; idxEncoding < encoding_.getItemCount(); idxEncoding++) { if (encoding_.getValue(idxEncoding) == otherEncoding) { encoding_.setSelectedIndex(idxEncoding); return; } } int selectedIndex = encoding_.getSelectedIndex(); addOtherEncodingItem(selectedIndex - 1, otherEncoding); } } ); } } }; encoding_.addChangeHandler(encodingChangeHandler); }
Source:
<code>public BVDesignException(final String bvErrorCode) { <START> super(); <END> this.bvErrorCode = bvErrorCode; }</code><technical_language>needed</technical_language>

Target:
public BVDesignException(final String bvErrorCode) { this.bvErrorCode = bvErrorCode; }
Source:
<code>public MainDrawerHandler(WikiDrawerLayout slidingPane, Activity parentActivity) { this.slidingPane = slidingPane; this.parentActivity = parentActivity; <START> ButterKnife.bind(this.slidingPane); <END> setUpViews(); }</code><technical_language>this call do</technical_language>

Target:
MainDrawerHandler(WikiDrawerLayout slidingPane, Activity parentActivity) { this.slidingPane = slidingPane; this.parentActivity = parentActivity; setUpViews(); }
Source:
<code>protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); Log.d(LOG_TAG, "mButtonClicked=" + mButtonClicked + ", positiveResult=" + positiveResult); if (this.mButtonClicked != DialogInterface.BUTTON_NEGATIVE) { int action = (isToggled() || (mButtonClicked == DialogInterface.BUTTON_POSITIVE)) ? CommandsInterface.CF_ACTION_REGISTRATION : CommandsInterface.CF_ACTION_DISABLE; int time = 0; if (reason == CommandsInterface.CF_REASON_NO_REPLY) { PersistableBundle carrierConfig = PhoneGlobals.getInstance() .getCarrierConfigForSubId(mPhone.getSubId()); if (carrierConfig.getBoolean( <START> CarrierConfigManager.KEY_SUPPORT_NO_REPLY_TIMER_FOR_CFNRY_BOOL)) { <END> time = 20; } } final String number = getPhoneNumber(); Log.d(LOG_TAG, "callForwardInfo=" + callForwardInfo); if (action == CommandsInterface.CF_ACTION_REGISTRATION && callForwardInfo != null && callForwardInfo.status == 1 && number.equals(callForwardInfo.number)) { Log.d(LOG_TAG, "no change, do nothing"); } else { Log.d(LOG_TAG, "reason=" + reason + ", action=" + action + ", number=" + number); setSummaryOn(""); mPhone.setCallForwardingOption(action, reason, number, time, mHandler.obtainMessage(MyHandler.MESSAGE_SET_CF, action, MyHandler.MESSAGE_SET_CF)); if (mTcpListener != null) { mTcpListener.onStarted(this, false); } } } }</code><technical_language>this default true in case for some reason</technical_language>

Target:
protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); Log.d(LOG_TAG, "mButtonClicked=" + mButtonClicked + ", positiveResult=" + positiveResult); if (this.mButtonClicked != DialogInterface.BUTTON_NEGATIVE) { int action = (isToggled() || (mButtonClicked == DialogInterface.BUTTON_POSITIVE)) ? CommandsInterface.CF_ACTION_REGISTRATION : CommandsInterface.CF_ACTION_DISABLE; int time = 0; if (reason == CommandsInterface.CF_REASON_NO_REPLY) { PersistableBundle carrierConfig = PhoneGlobals.getInstance() .getCarrierConfigForSubId(mPhone.getSubId()); if (carrierConfig.getBoolean( CarrierConfigManager.KEY_SUPPORT_NO_REPLY_TIMER_FOR_CFNRY_BOOL, true)) { time = 20; } } final String number = getPhoneNumber(); Log.d(LOG_TAG, "callForwardInfo=" + callForwardInfo); if (action == CommandsInterface.CF_ACTION_REGISTRATION && callForwardInfo != null && callForwardInfo.status == 1 && number.equals(callForwardInfo.number)) { Log.d(LOG_TAG, "no change, do nothing"); } else { Log.d(LOG_TAG, "reason=" + reason + ", action=" + action + ", number=" + number); setSummaryOn(""); mPhone.setCallForwardingOption(action, reason, number, time, mHandler.obtainMessage(MyHandler.MESSAGE_SET_CF, action, MyHandler.MESSAGE_SET_CF)); if (mTcpListener != null) { mTcpListener.onStarted(this, false); } } } }