auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setup() { fTrace = new TmfXmlTraceStubNs(); assertNotNull(fTrace); try { fTrace.initTrace(null, COUNTER_FILE, ITmfEvent.class); } catch (TmfTraceException e) { fail(e.getMessage()); } fTrace.addEventAspect(new TmfContentFieldAspect("aspect")); fTrace.addEventAspect(new CounterAspect("counter", "counter")); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class) { @Override public boolean isCumulative() { return true; } }); fStateProvider = CounterStateProvider.create(fTrace); IStateHistoryBackend backend = StateHistoryBackendFactory.createInMemoryBackend("", 0); fSsb = StateSystemFactory.newStateSystem(backend); fStateProvider.assignTargetStateSystem(fSsb); }

Target:
public void setup() throws TmfTraceException { fTrace = new TmfXmlTraceStubNs(); fTrace.initTrace(null, COUNTER_FILE, ITmfEvent.class); fTrace.addEventAspect(new TmfContentFieldAspect("aspect")); fTrace.addEventAspect(new CounterAspect("counter", "counter")); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class)); fTrace.addEventAspect(new CounterAspect("counter", "counter", TmfCpuAspect.class) { @Override public boolean isCumulative() { return true; } }); assertEquals(8, Iterables.size(fTrace.getEventAspects())); if (fTrace != null) { fStateProvider = CounterStateProvider.create(fTrace); } IStateHistoryBackend backend = StateHistoryBackendFactory.createInMemoryBackend("CounterStateSystem", 0); fSsb = StateSystemFactory.newStateSystem(backend); fStateProvider.assignTargetStateSystem(fSsb); }
Source:
public void run() { try (SingleLockService compactorLock = createSimpleLocks()) { log.info("Starting background compactor"); while (true) { if (Thread.currentThread().isInterrupted()) { log.warn("Shutting down background compactor because someone interrupted its thread"); Thread.currentThread().interrupt(); return; } compactorLock.lockOrRefresh(); if (compactorLock.haveLocks()) { Optional<String> tableToCompactOptional = transactionManager.runTaskReadOnly( this::selectTableToCompact); if (!tableToCompactOptional.isPresent()) { log.info("No table to compact"); Thread.sleep(SLEEP_TIME_WHEN_NO_TABLE_TO_COMPACT_MILLIS); continue; } String tableToCompact = tableToCompactOptional.get(); log.info("Compacting table {}", LoggingArgs.safeInternalTableName(tableToCompact)); compactTable(tableToCompact); log.info("Compacted table {}", LoggingArgs.safeInternalTableName(tableToCompact)); registerCompactedTable(tableToCompact); } } } catch (InterruptedException e) { log.warn("Shutting down background compactor due to InterruptedException", e); Thread.currentThread().interrupt(); } }

Target:
public void run() { try (SingleLockService compactorLock = createSimpleLocks()) { log.info("Starting background compactor"); while (true) { if (Thread.currentThread().isInterrupted()) { log.warn("Shutting down background compactor because someone interrupted its thread"); Thread.currentThread().interrupt(); return; } compactorLock.lockOrRefresh(); if (compactorLock.haveLocks()) { Optional<String> tableToCompactOptional = transactionManager.runTaskReadOnly( this::selectTableToCompact); if (!tableToCompactOptional.isPresent()) { log.info("No table to compact"); Thread.sleep(SLEEP_TIME_WHEN_NO_TABLE_TO_COMPACT_MILLIS); continue; } String tableToCompact = tableToCompactOptional.get(); log.info("Compacting table {}", LoggingArgs.safeInternalTableName(tableToCompact)); compactTable(tableToCompact); log.info("Compacted table {}", LoggingArgs.safeInternalTableName(tableToCompact)); registerCompactedTable(tableToCompact); } else { log.info("Failed to get the compaction lock. Probably, another host is running compaction."); Thread.sleep(SLEEP_TIME_WHEN_NO_LOCK_MILLIS); continue; } } } catch (InterruptedException e) { log.warn("Shutting down background compactor due to InterruptedException", e); Thread.currentThread().interrupt(); } }
Source:
protected RiakFuture<ResponseType, List<Location>> executeAsync(final RiakCluster cluster) { List<BaseCommand> operations = buildOperations(); MultiFuture future = new MultiFuture(locations); Submitter submitter = new Submitter(operations, maxInFlight, cluster, future); Thread t = new Thread(submitter); t.setDaemon(true); t.start(); return future; }

Target:
protected RiakFuture<ResponseType, List<Location>> executeAsync(final RiakCluster cluster) { List<BaseCommand> operations = buildOperations(); MultiFuture future = new MultiFuture(locations); Submitter submitter = new Submitter(operations, maxInFlight, cluster, future); Thread worker = new Thread(submitter); worker.setDaemon(true); worker.start(); return future; }
Source:
protected String getKuraServicePid() throws KuraException { String kuraServicePid = (String) this.properties.get(ConfigurationService.KURA_SERVICE_PID); if (kuraServicePid == null) { throw new KuraException(KuraErrorCode.CONFIGURATION_REQUIRED_ATTRIBUTE_MISSING); } return kuraServicePid; }

Target:
protected String getKuraServicePid() throws KuraException { if (kuraServicePid == null) { throw new KuraException(KuraErrorCode.CONFIGURATION_REQUIRED_ATTRIBUTE_MISSING); } return kuraServicePid; }
Source:
private void addTree(TreeWalk tw, ObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (id==null) tw.addTree(new CanonicalTreeParser()); else tw.addTree(id); }

Target:
private void addTree(TreeWalk tw, ObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (id == null) tw.addTree(new EmptyTreeIterator()); else tw.addTree(id); }
Source:
private synchronized void removeTimedOutStreams() { for (String streamId : multiTimeStreams.keySet()) { if (streamTimeouts.get(streamId) < System.currentTimeMillis()) { FixedLengthAudioStream stream = multiTimeStreams.remove(streamId); streamTimeouts.remove(streamId); IOUtils.closeQuietly(stream); stream = null; logger.debug("Removed timed out stream {}", streamId); } } }

Target:
private synchronized void removeTimedOutStreams() { for (String streamId : multiTimeStreams.keySet()) { if (streamTimeouts.get(streamId) < System.nanoTime()) { FixedLengthAudioStream stream = multiTimeStreams.remove(streamId); streamTimeouts.remove(streamId); IOUtils.closeQuietly(stream); stream = null; logger.debug("Removed timed out stream {}", streamId); } } }
Source:
public ManagementChannelHandler startReceiving(Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); UserInfo userInfo = channel.getConnection().getUserInfo(); final Subject subject; if (userInfo instanceof SubjectUserInfo) { subject = ((SubjectUserInfo) userInfo).getSubject(); } else { subject = new Subject(); } handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, subject)); channel.addCloseHandler(handler); channel.receiveMessage(handler.getReceiver()); return handler; }

Target:
public ManagementChannelHandler startReceiving(Channel channel) { final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel), getExecutor()); UserInfo userInfo = channel.getConnection().getUserInfo(); final Subject subject; if (userInfo instanceof SubjectUserInfo) { subject = ((SubjectUserInfo) userInfo).getSubject(); } else { subject = new Subject(); } handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler, subject)); channel.receiveMessage(handler.getReceiver()); return handler; }
Source:
public Object visit(ASTFunctionDeclaration node, Object data) { Context context = (Context) data; GoloFunction function = new GoloFunction( node.getName(), node.isLocal() ? LOCAL : PUBLIC, node.isAugmentation() ? AUGMENT : MODULE); if (node.isDecorator()) { function.setDecorator(true); } node.setIrElement(function); while (context.objectStack.peek() instanceof Decorator) { function.addDecorator((Decorator) context.objectStack.pop()); } context.objectStack.push(function); if (!function.getDecorators().isEmpty()) { function.setDecoratorRef("__$$_" + function.getName() + "_decorator_" + context.nextDecoratorId++); } node.childrenAccept(this, data); context.objectStack.pop(); if (!function.getDecorators().isEmpty()) { ASTFunctionDeclaration decorator = createDecorator(function.getDecoratorRef(), function.getDecorators(), node.isAugmentation()); decorator.jjtAccept(this, data); } return data; }

Target:
public Object visit(ASTFunctionDeclaration node, Object data) { Context context = (Context) data; GoloFunction function = new GoloFunction( node.getName(), node.isLocal() ? LOCAL : PUBLIC, node.isAugmentation() ? AUGMENT : MODULE); if (node.isDecorator()) { function.setDecorator(true); } node.setIrElement(function); while (context.objectStack.peek() instanceof Decorator) { function.addDecorator((Decorator) context.objectStack.pop()); } context.objectStack.push(function); if (!function.getDecorators().isEmpty()) { function.setDecoratorRef("__$$_" + function.getName() + "_decorator_" + context.nextDecoratorId++); } node.childrenAccept(this, data); context.objectStack.pop(); if (!function.getDecorators().isEmpty()) { ASTFunctionDeclaration decorator = createDecorator( function.getDecoratorRef(), function.getDecorators()); decorator.setAugmentation(node.isAugmentation()); decorator.jjtAccept(this, data); } return data; }
Source:
void deleteCollection() { try { for (CosmosAsyncClient cosmosAsyncClient : clientDocsMap.keySet()) { cosmosAsyncClient.getDatabase(configuration.getDatabaseId()).getContainer(configuration.getCollectionId()).delete().block(); } } catch (CosmosClientException e) { if (e.getStatusCode() == HttpConstants.StatusCodes.NOTFOUND) { } else { throw e; } } finally { System.out.println("Container on all client have been deleted successfully"); } }

Target:
void deleteCollection() { try { for (CosmosAsyncClient cosmosAsyncClient : clientDocsMap.keySet()) { cosmosAsyncClient.getDatabase(configuration.getDatabaseId()).getContainer(configuration.getCollectionId()).delete().block(); } } catch (CosmosClientException e) { if (e.getStatusCode() == HttpConstants.StatusCodes.NOTFOUND) { } else { throw e; } } finally { logger.info("Container on all client have been deleted successfully"); } }
Source:
private CompletionStage<RestResponse> stop(RestRequest restRequest) { List<String> servers = restRequest.parameters().get("server"); invocationHelper.getServer().serverStop(servers); return CompletableFuture.completedFuture(new NettyRestResponse.Builder().build()); }

Target:
private CompletionStage<RestResponse> stop(RestRequest restRequest) { invocationHelper.getServer().serverStop(Collections.emptyList()); return CompletableFuture.completedFuture(new NettyRestResponse.Builder().build()); }
Source:
private <T> void packHandler(OutputObjectState state, T handler) throws IOException { if (!isHandlerPersistable(handler)) { state.packBoolean(false); return; } try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ObjectOutputStream objectStream = new ObjectOutputStream(outputStream)) { objectStream.writeObject(handler); state.packBoolean(true); state.packString(handler.getClass().getName()); state.packBytes(outputStream.toByteArray()); } LOGGER.tracef("Persisted handler: '%s'", handler); }

Target:
private <T> void packHandler(OutputObjectState state, T handler) throws IOException { if (!isHandlerPersistable(handler)) { LOGGER.warnf("Ignoring a non-serializable handler %s", handler); state.packBoolean(false); return; } try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ObjectOutputStream objectStream = new ObjectOutputStream(outputStream)) { objectStream.writeObject(handler); state.packBoolean(true); state.packString(handler.getClass().getName()); state.packBytes(outputStream.toByteArray()); } LOGGER.tracef("Persisted handler: '%s'", handler); }
Source:
private Column<GwtChannelInfo, String> getInputCellColumn(final GwtConfigParameter param) { final String id = param.getId(); final GwtConfigParameterType type = param.getType(); final String max = param.getMax(); final String min = param.getMin(); final ValidationInputCell cell = new ValidationInputCell(); final Column<GwtChannelInfo, String> result = new Column<GwtChannelInfo, String>(cell) { @Override public String getValue(final GwtChannelInfo object) { return object.get(id).toString(); } }; result.setFieldUpdater(new FieldUpdater<GwtChannelInfo, String>() { @Override public void update(final int index, final GwtChannelInfo object, final String value) { ValidationData viewData; if (!PropertiesUi.this.validateType(type, value) || max != null && !PropertiesUi.this.validateMax(value, max) || min != null && !PropertiesUi.this.validateMin(value, min)) { viewData = cell.getViewData(object); viewData.setInvalid(true); PropertiesUi.this.nonValidatedCells.add(object.getId()); PropertiesUi.this.setNonValidated(true); PropertiesUi.this.channelTable.redraw(); return; } PropertiesUi.this.nonValidatedCells.remove(object.getId()); PropertiesUi.this.setNonValidated(false); PropertiesUi.this.setDirty(true); PropertiesUi.this.channelTable.redraw(); object.set(param.getId(), value); } }); return result; }

Target:
private Column<GwtChannelInfo, String> getInputCellColumn(final GwtConfigParameter param) { final String id = param.getId(); final GwtConfigParameterType type = param.getType(); final String max = param.getMax(); final String min = param.getMin(); final ValidationInputCell cell = new ValidationInputCell(); final Column<GwtChannelInfo, String> result = new Column<GwtChannelInfo, String>(cell) { @Override public String getValue(final GwtChannelInfo object) { Object result = object.get(id); if (result != null) { return result.toString(); } return null; } }; result.setFieldUpdater(new FieldUpdater<GwtChannelInfo, String>() { @Override public void update(final int index, final GwtChannelInfo object, final String value) { ValidationData viewData; if (!PropertiesUi.this.validateType(type, value) || max != null && !PropertiesUi.this.validateMax(value, max) || min != null && !PropertiesUi.this.validateMin(value, min)) { viewData = cell.getViewData(object); viewData.setInvalid(true); PropertiesUi.this.nonValidatedCells.add(object.getId()); PropertiesUi.this.setNonValidated(true); PropertiesUi.this.channelTable.redraw(); return; } PropertiesUi.this.nonValidatedCells.remove(object.getId()); PropertiesUi.this.setNonValidated(false); PropertiesUi.this.setDirty(true); PropertiesUi.this.channelTable.redraw(); object.set(param.getId(), value); } }); return result; }
Source:
public String extractTelecom(PRPAMT201306UV02PatientTelecom patientTelecom) { LOG.trace("Entering HL7Parser201305Utils.ExtractTelecom method..."); String telecom = null; if (CollectionUtils.isNotEmpty(patientTelecom.getValue()) && patientTelecom.getValue().get(0) != null) { TELExplicit telecomValue = patientTelecom.getValue().get(0); LOG.info("Found patientTelecom in query parameters = " + telecomValue.getValue()); telecom = telecomValue.getValue(); if (!StringUtils.startsWith(telecom, "tel:")) { telecom = null; LOG.info("Found patientTelecom in query parameters is not in the correct uri format"); } } else { LOG.info("message does not contain a patientTelecom"); } LOG.trace("Exiting HL7Parser201305Utils.ExtractTelecom method..."); return telecom; }

Target:
public String extractTelecom(PRPAMT201306UV02PatientTelecom patientTelecom) { LOG.trace("Entering HL7Parser201305Utils.ExtractTelecom method..."); String telecom = null; if (CollectionUtils.isNotEmpty(patientTelecom.getValue())) { TELExplicit telecomValue = patientTelecom.getValue().get(0); LOG.info("Found patientTelecom in query parameters = ", telecomValue.getValue()); telecom = telecomValue.getValue(); if (!StringUtils.startsWith(telecom, "tel:")) { telecom = null; LOG.info("Found patientTelecom in query parameters is not in the correct uri format"); } } else { LOG.info("message does not contain a patientTelecom"); } LOG.trace("Exiting HL7Parser201305Utils.ExtractTelecom method..."); return telecom; }
Source:
public void testInvalidDuration() { handle.createQuery("select foo from intervals where id=?") .bind(0, 5) .mapTo(Duration.class) .findOnly(); }

Target:
public void testInvalidDuration() { handle.createQuery("select foo from intervals where id=?") .bind(0, 3) .mapTo(Duration.class) .findOnly(); }
Source:
public Optional<List<InternalNode>> getBucketToNode() { if (bucketToNodeAndCache.size() == 0) { return Optional.empty(); } return Optional.of(bucketToNodeAndCache.values().stream().map(InternalNodeAndCache::getInternalNode).collect(Collectors.toList())); }

Target:
public Optional<List<InternalNode>> getBucketToNode() { if (bucketToNodeInfo.isEmpty()) { return Optional.empty(); } return Optional.of(bucketToNodeInfo.values().stream().map(InternalNodeInfo::getInternalNode).collect(Collectors.toList())); }
Source:
private static int count(String query) throws StorageException { PreparedStatement s = null; ResultSet result = null; try { Connection conn = connector.obtainSession(); s = conn.prepareStatement(query); result = s.executeQuery(); if (result.next()) { return result.getInt(1); } else { throw new StorageException( String.format("Count result set is empty. Query: %s", query)); } } catch (SQLException ex) { throw new StorageException(ex); } finally { if (s != null) { try { s.close(); } catch (SQLException ex) { } } if (result != null) { try { result.close(); } catch (SQLException ex) { } } connector.closeSession(); } }

Target:
private static int count(String query) throws StorageException { PreparedStatement s = null; ResultSet result = null; try { Connection conn = connector.obtainSession(); s = conn.prepareStatement(query); result = s.executeQuery(); if (result.next()) { return result.getInt(1); } else { throw new StorageException( String.format("Count result set is empty. Query: %s", query)); } } catch (SQLException ex) { throw new StorageException(ex); } finally { if (s != null) { try { s.close(); } catch (SQLException ex) { LOG.warn("Exception when closing the PrepareStatement", ex); } } if (result != null) { try { result.close(); } catch (SQLException ex) { LOG.warn("Exception when closing the ResultSet", ex); } } connector.closeSession(); } }
Source:
public void pull(Context ctx) { Log.d(TAG, "Starting PULL process..."); context = ctx; try { register(); enableMetaDataFlags(); TrackerController.setMaxEvents(getMaxEvents()); TrackerController.setStartDate(EventExtended.format(getStartDate().getTime(), EventExtended.AMERICAN_DATE_FORMAT)); TrackerController.setEndDate(EventExtended.format(Calendar.getInstance().getTime(), EventExtended.AMERICAN_DATE_FORMAT)); MetaDataController.setFullOrganisationUnitHierarchy(AppSettingsBuilder.isFullHierarchy()); MetaDataController.clearMetaDataLoadedFlags(); MetaDataController.wipe(); PopulateDB.wipeSDKData(); PopulateDB.wipeDatabase(); postProgress(context.getString(R.string.progress_pull_downloading)); try { job = DhisService.loadData(context); } catch (Exception ex) { Log.e(TAG, "pullS: " + ex.getLocalizedMessage()); ex.printStackTrace(); } } catch (Exception ex) { Log.e(TAG, "pull: " + ex.getLocalizedMessage()); unregister(); postException(ex); } }

Target:
public void pull(Context ctx) { Log.d(TAG, "Starting PULL process..."); context = ctx; try { register(); enableMetaDataFlags(); TrackerController.setMaxEvents(getMaxEvents()); TrackerController.setStartDate(EventExtended.format(getStartDate().getTime(), EventExtended.AMERICAN_DATE_FORMAT)); TrackerController.setEndDate(EventExtended.format(Calendar.getInstance().getTime(), EventExtended.AMERICAN_DATE_FORMAT)); TrackerController.setDownloadData(!isNoData()); MetaDataController.setFullOrganisationUnitHierarchy(AppSettingsBuilder.isFullHierarchy()); MetaDataController.clearMetaDataLoadedFlags(); MetaDataController.wipe(); PopulateDB.wipeSDKData(); PopulateDB.wipeDatabase(); postProgress(context.getString(R.string.progress_pull_downloading)); try { if (AppSettingsBuilder.isDownloadOnlyLastEvents()) { job = DhisService.loadLastData(context); } else { job = DhisService.loadData(context); } } catch (Exception ex) { Log.e(TAG, "pullS: " + ex.getLocalizedMessage()); ex.printStackTrace(); } } catch (Exception ex) { Log.e(TAG, "pull: " + ex.getLocalizedMessage()); unregister(); postException(ex); } }
Source:
public CompletableFuture<Boolean> sendFollowRequest(String targetUsername, SymmetricKey requestedKey) { return getSharingFolder().thenCompose(sharing -> { return sharing.getChildren(network).thenCompose(children -> { CompletableFuture<Boolean> res = new CompletableFuture<>(); boolean alreadySentRequest = children.stream() .filter(f -> f.getFileProperties().name.equals(targetUsername)) .findAny() .isPresent(); if (alreadySentRequest) { res.completeExceptionally(new Exception("Follow Request already sent!")); return res; } return getFollowing().thenCompose(following -> { boolean alreadyFollowing = following.stream().filter(x -> x.equals(targetUsername)).findAny().isPresent(); if (alreadyFollowing) { res.completeExceptionally(new Exception("User already a follower!")); return res; } return getPublicKeys(targetUsername).thenCompose(targetUserOpt -> { if (!targetUserOpt.isPresent()) { res.completeExceptionally(new Exception("User does not exist!")); return res; } PublicBoxingKey targetUser = targetUserOpt.get().right; return sharing.mkdir(targetUsername, network, null, true, crypto).thenCompose(friendRoot -> { EntryPoint entry = new EntryPoint(friendRoot.getPointer().capability.readOnly(), username); FollowRequest followReq = new FollowRequest(Optional.of(entry), Optional.ofNullable(requestedKey)); PublicKeyHash targetSigner = targetUserOpt.get().left; return blindAndSendFollowRequest(targetSigner, targetUser, followReq); }); }); }); }); }); }

Target:
public CompletableFuture<Boolean> sendFollowRequest(String targetUsername, SymmetricKey requestedKey) { return getSharingFolder().thenCompose(sharing -> { return sharing.getChildren(network).thenCompose(children -> { boolean alreadySentRequest = children.stream() .filter(f -> f.getFileProperties().name.equals(targetUsername)) .findAny() .isPresent(); if (alreadySentRequest) { return Futures.errored(new Exception("Follow Request already sent!")); } return getFollowing().thenCompose(following -> { boolean alreadyFollowing = following.stream().filter(x -> x.equals(targetUsername)).findAny().isPresent(); if (alreadyFollowing) { return Futures.errored(new Exception("User already a follower!")); } return getPublicKeys(targetUsername).thenCompose(targetUserOpt -> { if (!targetUserOpt.isPresent()) { return Futures.errored(new Exception("User does not exist!")); } PublicBoxingKey targetUser = targetUserOpt.get().right; return sharing.mkdir(targetUsername, network, null, true, crypto).thenCompose(friendRoot -> { EntryPoint entry = new EntryPoint(friendRoot.getPointer().capability.readOnly(), username); FollowRequest followReq = new FollowRequest(Optional.of(entry), Optional.ofNullable(requestedKey)); PublicKeyHash targetSigner = targetUserOpt.get().left; return blindAndSendFollowRequest(targetSigner, targetUser, followReq); }); }); }); }); }); }
Source:
private void createTrustManagersFromConfiguration(SSLFactory.Mode mode, String truststoreType, String truststoreLocation, long storesReloadInterval) throws IOException, GeneralSecurityException { String passwordProperty = resolvePropertyName(mode, SSL_TRUSTSTORE_PASSWORD_TPL_KEY); String truststorePassword = getPassword(conf, passwordProperty, ""); if (truststorePassword.isEmpty()) { truststorePassword = null; } long truststoreReloadInterval = conf.getLong( resolvePropertyName(mode, SSL_TRUSTSTORE_RELOAD_INTERVAL_TPL_KEY), storesReloadInterval); if (LOG.isDebugEnabled()) { LOG.debug(mode.toString() + " TrustStore: " + truststoreLocation); } trustManager = new ReloadingX509TrustManager( truststoreType, truststoreLocation, truststorePassword); if (truststoreReloadInterval > 0) { fileMonitoringTimer.schedule( new FileMonitoringTimerTask( Paths.get(truststoreLocation), path -> trustManager.loadFrom(path), exception -> LOG.error(ReloadingX509TrustManager.RELOAD_ERROR_MESSAGE, exception)), truststoreReloadInterval, truststoreReloadInterval); } if (LOG.isDebugEnabled()) { LOG.debug(mode.toString() + " Loaded TrustStore: " + truststoreLocation); } trustManagers = new TrustManager[]{trustManager}; }

Target:
private void createTrustManagersFromConfiguration(SSLFactory.Mode mode, String truststoreType, String truststoreLocation, long storesReloadInterval) throws IOException, GeneralSecurityException { String passwordProperty = resolvePropertyName(mode, SSL_TRUSTSTORE_PASSWORD_TPL_KEY); String truststorePassword = getPassword(conf, passwordProperty, ""); if (truststorePassword.isEmpty()) { truststorePassword = null; } long truststoreReloadInterval = conf.getLong( resolvePropertyName(mode, SSL_TRUSTSTORE_RELOAD_INTERVAL_TPL_KEY), storesReloadInterval); if (LOG.isDebugEnabled()) { LOG.debug(mode.toString() + " TrustStore: " + truststoreLocation + ", reloading at " + truststoreReloadInterval + " millis."); } trustManager = new ReloadingX509TrustManager( truststoreType, truststoreLocation, truststorePassword); if (truststoreReloadInterval > 0) { fileMonitoringTimer.schedule( new FileMonitoringTimerTask( Paths.get(truststoreLocation), path -> trustManager.loadFrom(path), exception -> LOG.error(ReloadingX509TrustManager.RELOAD_ERROR_MESSAGE, exception)), truststoreReloadInterval, truststoreReloadInterval); } if (LOG.isDebugEnabled()) { LOG.debug(mode.toString() + " Loaded TrustStore: " + truststoreLocation); } trustManagers = new TrustManager[]{trustManager}; }
Source:
public boolean isConnectionValid( Connection connection, int timeout ) throws SQLException { try { return provider.isConnectionValid(connection, timeout); } catch (SQLException sqle) { log.error("Error trying to check if the underlying connection is valid", sqle); return false; } }

Target:
public boolean isConnectionValid( Connection connection, int timeout ) throws SQLException { try { return provider.isConnectionValid(connection, timeout); } catch (SQLException sqle) { log.debug("Unable to check if the underlying connection is valid", sqle); return false; } }
Source:
public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, HttpClient.Factory httpClientFactory) { super(additionalCommands, addressOfRemoteServer, httpClientFactory); service = null; }

Target:
public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, HttpClient.Factory httpClientFactory) { this(additionalCommands, null, checkNotNull(addressOfRemoteServer), httpClientFactory); }
Source:
public void testInt2777UnboundResourceAfterTransactionComplete() { MessageSource<?> source = () -> null; SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); adapter.setSource(source); adapter.setOutputChannelName("bar"); adapter.setBeanFactory(new TestUtils.TestApplicationContext()); adapter.onInit(); TransactionSynchronizationManager.initSynchronization(); TransactionSynchronizationManager.setActualTransactionActive(true); doPoll(adapter); TransactionSynchronizationManager.setActualTransactionActive(false); TransactionSynchronizationManager.unbindResource(source); TransactionSynchronizationManager.setActualTransactionActive(true); doPoll(adapter); TransactionSynchronizationManager.setActualTransactionActive(false); TransactionSynchronizationManager.clearSynchronization(); TransactionSynchronizationManager.unbindResource(source); }

Target:
public void testInt2777UnboundResourceAfterTransactionComplete() { SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); adapter.setSource(() -> null); TransactionSynchronizationManager.setActualTransactionActive(true); doPoll(adapter); TransactionSynchronizationManager.setActualTransactionActive(false); TransactionSynchronizationManager.setActualTransactionActive(true); doPoll(adapter); TransactionSynchronizationManager.setActualTransactionActive(false); }
Source:
public void rejectsOldRelease() throws IOException { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Agent agent = new CommentsTag(repo.github()); repo.releases().create("1.0"); repo.releases().create("2.0"); repo.releases().create("3.0-b"); final Talk talk = CommentsTagTest.talk(issue, "1.5"); agent.execute(talk); final Comment.Smart response = new Comment.Smart( repo.issues().get(1).comments().get(1) ); MatcherAssert.assertThat( response.body(), Matchers.containsString("version tag is too low") ); }

Target:
public void rejectsOldRelease() throws IOException { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Agent agent = new CommentsTag(repo.github()); repo.releases().create("1.0"); repo.releases().create("2.0"); repo.releases().create("3.0-b"); agent.execute(CommentsTagTest.talk(issue, "1.5")); final Comment.Smart response = new Comment.Smart( repo.issues().get(1).comments().get(1) ); MatcherAssert.assertThat( response.body(), Matchers.containsString("version tag is too low") ); }
Source:
private boolean sessionHasStarted(InputStream responseStream) { Gson gson = new Gson(); JsonObject jsonResponse = gson.fromJson(new InputStreamReader(responseStream), JsonObject .class); return jsonResponse != null && jsonResponse.has("ok") && !jsonResponse.get("ok").isJsonNull(); }

Target:
private boolean sessionHasStarted(InputStream responseStream) { Gson gson = new Gson(); JsonObject jsonResponse = gson.fromJson(new InputStreamReader(responseStream), JsonObject .class); return jsonResponse != null && jsonResponse.has("ok") && jsonResponse.get("ok").isJsonPrimitive() && jsonResponse.getAsJsonPrimitive("ok").isBoolean() && jsonResponse.getAsJsonPrimitive("ok").getAsBoolean(); }
Source:
public void getAndRemoveElementsRemovesOldestElements() { eventStore.putAll(ImmutableList.of(EVENT_1, EVENT_2, EVENT_3)); eventStore.putAll(ImmutableList.of(EVENT_4)); LockWatchEvents events = eventStore.retentionEvents(); assertThat(events.events().stream().map(LockWatchEvent::sequence)).containsExactly(1L, 2L); assertThat(events.versionRange().map(Range::upperEndpoint)).hasValue(2L); assertThat(eventStore.getStateForTesting().eventMap().firstKey()).isEqualTo(3L); }

Target:
public void getAndRemoveElementsRemovesOldestElements() { eventStore.putAll(makeEvents(EVENT_1, EVENT_2, EVENT_3)); eventStore.putAll(makeEvents(EVENT_4)); LockWatchEvents events = eventStore.retentionEvents(); assertThat(events.events().stream().map(LockWatchEvent::sequence)).containsExactly(1L, 2L); assertThat(eventStore.getStateForTesting().eventMap().firstKey()).isEqualTo(3L); }
Source:
public static DefaultCalculationRunner ofMultiThreaded() { return new DefaultCalculationRunner(CalculationTaskRunner.ofMultiThreaded()); }

Target:
static DefaultCalculationRunner ofMultiThreaded() { return new DefaultCalculationRunner(CalculationTaskRunner.ofMultiThreaded()); }
Source:
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { logger.debug("RRD4J Received incoming chart request: ", req); int width = 1024; try { width = Integer.parseInt(req.getParameter("w")); } catch (Exception e) { } int height = 512; try { height = Integer.parseInt(req.getParameter("h")); } catch (Exception e) { } Long period = PERIODS.get(req.getParameter("period")); if (period == null) { period = PERIODS.get("D"); } Date timeEnd = new Date(); Date timeBegin = new Date(timeEnd.getTime() - period); res.setContentType("image/"+getChartType()); try { BufferedImage chart = createChart(null, null, timeBegin, timeEnd, height, width, req.getParameter("items"), req.getParameter("groups")); ImageIO.write(chart, getChartType(), res.getOutputStream()); } catch (ItemNotFoundException e) { logger.debug("Item not found error while generating chart."); } catch (IllegalArgumentException e) { logger.debug("Illegal argument in chart: {}", e); } }

Target:
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { logger.debug("RRD4J Received incoming chart request: ", req); int width = 480; try { width = Integer.parseInt(req.getParameter("w")); } catch (Exception e) { } int height = 240; try { height = Integer.parseInt(req.getParameter("h")); } catch (Exception e) { } Long period = PERIODS.get(req.getParameter("period")); if (period == null) { period = PERIODS.get("D"); } Date timeEnd = new Date(); Date timeBegin = new Date(timeEnd.getTime() - period); res.setContentType("image/"+getChartType()); try { BufferedImage chart = createChart(null, null, timeBegin, timeEnd, height, width, req.getParameter("items"), req.getParameter("groups")); ImageIO.write(chart, getChartType().toString(), res.getOutputStream()); } catch (ItemNotFoundException e) { logger.debug("Item not found error while generating chart."); } catch (IllegalArgumentException e) { logger.debug("Illegal argument in chart: {}", e); } }
Source:
public void addLife() { lives.set(Math.min(lives.get() + 1, (int) settings.getInteger("MAX_LIVES"))); }

Target:
public void addLife() { lives.set(Math.min(lives.get() + 1, settings.getInteger("MAX_LIVES"))); }
Source:
public void one() { int count = execute(); if (count != 1) { throw new IllegalStateException("Expected one modified row, got: " + count); } }

Target:
public void one() { int count = execute(); if (count != 1) { throw new IllegalStateException("Expected 1 modified row, got " + count); } }
Source:
protected List<String> generateSurveillanceRowValues(final CertifiedProductSearchDetails listing, final Surveillance surv) { List<String> result = new ArrayList<String>(); result.add(listing.getChplProductNumber()); result.add(env.getProperty("chplUrlBegin") + "#/listing/" + listing.getId()); result.add(listing.getCertifyingBody().get(CertifiedProductSearchDetails.ACB_NAME_KEY).toString()); result.add(listing.getCurrentStatus().getStatus().getName()); result.add(listing.getDeveloper().getName()); result.add(listing.getProduct().getName()); result.add(listing.getVersion().getVersion()); result.add(surv.getFriendlyId()); if (surv.getStartDate() != null) { LocalDateTime survStartDate = LocalDateTime.ofInstant(Instant.ofEpochMilli(surv.getStartDate().getTime()), ZoneId.systemDefault()); result.add(dateFormatter.format(survStartDate)); } else { result.add(""); } if (surv.getEndDate() != null) { LocalDateTime survEndDate = LocalDateTime.ofInstant(Instant.ofEpochMilli(surv.getEndDate().getTime()), ZoneId.systemDefault()); result.add(dateFormatter.format(survEndDate)); } else { result.add(""); } result.add(surv.getType().getName()); if (surv.getRandomizedSitesUsed() != null) { result.add(surv.getRandomizedSitesUsed().toString()); } else { result.add(""); } result.add(surv.getLastModifiedDate().toInstant().atOffset(ZoneOffset.UTC).format(dateTimeFormatter)); return result; }

Target:
protected List<String> generateSurveillanceRowValues(final CertifiedProductSearchDetails listing, final Surveillance surv) { List<String> result = new ArrayList<String>(); result.add(listing.getChplProductNumber()); result.add(env.getProperty("chplUrlBegin") + env.getProperty("listingDetailsUrl") + listing.getId()); result.add(listing.getCertifyingBody().get(CertifiedProductSearchDetails.ACB_NAME_KEY).toString()); result.add(listing.getCurrentStatus().getStatus().getName()); result.add(listing.getDeveloper().getName()); result.add(listing.getProduct().getName()); result.add(listing.getVersion().getVersion()); result.add(surv.getFriendlyId()); if (surv.getStartDate() != null) { LocalDateTime survStartDate = LocalDateTime.ofInstant(Instant.ofEpochMilli(surv.getStartDate().getTime()), ZoneId.systemDefault()); result.add(dateFormatter.format(survStartDate)); } else { result.add(""); } if (surv.getEndDate() != null) { LocalDateTime survEndDate = LocalDateTime.ofInstant(Instant.ofEpochMilli(surv.getEndDate().getTime()), ZoneId.systemDefault()); result.add(dateFormatter.format(survEndDate)); } else { result.add(""); } result.add(surv.getType().getName()); if (surv.getRandomizedSitesUsed() != null) { result.add(surv.getRandomizedSitesUsed().toString()); } else { result.add(""); } result.add(surv.getLastModifiedDate().toInstant().atOffset(ZoneOffset.UTC).format(dateTimeFormatter)); return result; }
Source:
public void drawParticles(Material material, ParticleRenderingData<ParticleDataSpriteComponent> particleSystem, Vector3f camera) { ParticlePool particlePool = particleSystem.particlePool; material.setBoolean("useTexture", particleSystem.particleData.texture != null); if (particleSystem.particleData.texture != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); glBindTexture(GL11.GL_TEXTURE_2D, particleSystem.particleData.texture.getId()); material.setFloat2("texSize", particleSystem.particleData.textureSize.x(), particleSystem.particleData.textureSize.y()); } glPushMatrix(); glTranslatef(-camera.x(), -camera.y(), -camera.z()); for (int i = 0; i < particlePool.livingParticles(); i++) { final int i2 = i * 2; final int i3 = i * 3; final int i4 = i * 4; material.setFloat3("position", particlePool.position[i3], particlePool.position[i3 + 1], particlePool.position[i3 + 2] ); material.setFloat3("scale", particlePool.scale[i3], particlePool.scale[i3 + 1], particlePool.scale[i3 + 2] ); material.setFloat4("color", particlePool.color[i4], particlePool.color[i4 + 1], particlePool.color[i4 + 2], particlePool.color[i4 + 3] ); material.setFloat2("texOffset", particlePool.textureOffset[i2], particlePool.textureOffset[i2 + 1] ); drawUnitQuad.call(); } glPopMatrix(); }

Target:
public void drawParticles(Material material, ParticleRenderingData<ParticleDataSpriteComponent> particleSystem, Vector3f camera) { ParticlePool particlePool = particleSystem.particlePool; material.setBoolean("useTexture", particleSystem.particleData.texture != null); if (particleSystem.particleData.texture != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); glBindTexture(GL11.GL_TEXTURE_2D, particleSystem.particleData.texture.getId()); material.setFloat2("texSize", particleSystem.particleData.textureSize); } glPushMatrix(); glTranslatef(-camera.x(), -camera.y(), -camera.z()); for (int i = 0; i < particlePool.livingParticles(); i++) { final int i2 = i * 2; final int i3 = i * 3; final int i4 = i * 4; material.setFloat3("position", particlePool.position[i3], particlePool.position[i3 + 1], particlePool.position[i3 + 2] ); material.setFloat3("scale", particlePool.scale[i3], particlePool.scale[i3 + 1], particlePool.scale[i3 + 2] ); material.setFloat4("color", particlePool.color[i4], particlePool.color[i4 + 1], particlePool.color[i4 + 2], particlePool.color[i4 + 3] ); material.setFloat2("texOffset", particlePool.textureOffset[i2], particlePool.textureOffset[i2 + 1] ); drawUnitQuad.call(); } glPopMatrix(); }
Source:
private ChannelBuffer encodeContent(String content) { ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); byte[] contentBytes = content.getBytes(); buf.writeByte(0x00); buf.writeByte(contentBytes.length + 6); buf.writeByte(0x00); buf.writeByte(0x00); buf.writeByte(0x04); buf.writeByte(0x00); buf.writeBytes(content.getBytes(StandardCharsets.UTF_8)); return buf; }

Target:
private ChannelBuffer encodeContent(String content) { ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); byte[] contentBytes = content.getBytes(); buf.writeShort(contentBytes.length + 6); buf.writeByte(0x00); buf.writeByte(0x00); buf.writeByte(0x04); buf.writeByte(0x00); buf.writeBytes(content.getBytes(StandardCharsets.UTF_8)); return buf; }
Source:
public void setLocation(Vector3d position, UUID world) { Optional<WorldProperties> prop = Sponge.getServer().getWorldProperties(world); if (!prop.isPresent()) { throw new IllegalArgumentException("Invalid World: No world found for UUID"); } Optional<World> loaded = Sponge.getServer().loadWorld(prop.get()); if (!loaded.isPresent()) { throw new IllegalArgumentException("Invalid World: Could not load world for UUID"); } this.setLocation(new Location<>(loaded.get(), position)); }

Target:
public boolean setLocation(Vector3d position, UUID world) { WorldProperties prop = Sponge.getServer().getWorldProperties(world).orElseThrow(() -> new IllegalArgumentException("Invalid World: No world found for UUID")); World loaded = Sponge.getServer().loadWorld(prop).orElseThrow(() -> new IllegalArgumentException("Invalid World: Could not load world for UUID")); return this.setLocation(new Location<>(loaded, position)); }
Source:
public TmfPieChartStatisticsModel getPieChartModel(){ return fPieChartModel; }

Target:
public TmfPieChartStatisticsModel getPieChartModel(){ if (fPieChartModel == null) { fPieChartModel = new TmfPieChartStatisticsModel(); } return fPieChartModel; }
Source:
public ArticlePageObject showMeMyWiki() { changeImplicitWait(250, TimeUnit.MILLISECONDS); try { new WebDriverWait(driver, 180).until(CommonExpectedConditions.elementNotPresent( LOADING_INDICATOR_BY)); } finally { restoreDefaultImplicitWait(); } scrollAndClick(submitButton); Log.log("submit", "Submit button clicked", true, driver); return new ArticlePageObject(); }

Target:
public ArticlePageObject showMeMyWiki() { changeImplicitWait(IMPLICIT_SHORT, TimeUnit.MILLISECONDS); try { new WebDriverWait(driver, CREATE_WIKI_TIMEOUT).until(CommonExpectedConditions.elementNotPresent( LOADING_INDICATOR_BY)); } finally { restoreDefaultImplicitWait(); } scrollAndClick(submitButton); Log.log("submit", "Submit button clicked", true, driver); return new ArticlePageObject(); }
Source:
public static void main(String[] args) throws Exception { String repoPath = System.getProperty("git_repo"); if (repoPath == null) { repoPath = "."; System.out.println( "System property '-Dgit_repo' not specified, using current directory: " + new File(repoPath).getAbsolutePath()); } try (Repository db = new FileRepository(repoPath + "/.git")) { for (String cmd : args) { List<String> result = execute(cmd, db); for (String line : result) { System.out.println(line); } } } }

Target:
public static void main(String[] args) throws Exception { String repoPath = System.getProperty("git_repo"); if (repoPath == null) { repoPath = "."; System.out.println( "System property 'git_repo' not specified, using current directory: " + new File(repoPath).getAbsolutePath()); } try (Repository db = new FileRepository(repoPath + "/.git")) { for (String cmd : args) { List<String> result = execute(cmd, db); for (String line : result) { System.out.println(line); } } } }
Source:
private static Object[] createInMemory() throws URISyntaxException, MalformedURLException, SSLException, CertificateException { Tracer tracer = NoopTracerFactory.create(); EventBus bus = ZeroMqEventBus.create( new ZContext(), "inproc://end-to-end-pub", "inproc://end-to-end-sub", true); URI nodeUri = new URI("http://localhost:4444"); CombinedHandler handler = new CombinedHandler(); HttpClient.Factory clientFactory = new RoutableHttpClientFactory( nodeUri.toURL(), handler, HttpClient.Factory.createDefault()); SessionMap sessions = new LocalSessionMap(tracer, bus); handler.addHandler(sessions); Distributor distributor = new LocalDistributor(tracer, bus, clientFactory, sessions); handler.addHandler(distributor); LocalNode node = LocalNode.builder(tracer, bus, clientFactory, nodeUri) .add(CAPS, createFactory(nodeUri)) .build(); handler.addHandler(node); distributor.add(node); Router router = new Router(tracer, clientFactory, sessions, distributor); Server<?> server = createServer(router); server.start(); return new Object[] { server, clientFactory }; }

Target:
private static Object[] createInMemory() throws CertificateException, MalformedURLException, SSLException, URISyntaxException { Tracer tracer = NoopTracerFactory.create(); EventBus bus = ZeroMqEventBus.create( new ZContext(), "inproc://end-to-end-pub", "inproc://end-to-end-sub", true); URI nodeUri = new URI("http://localhost:4444"); CombinedHandler handler = new CombinedHandler(); HttpClient.Factory clientFactory = new RoutableHttpClientFactory( nodeUri.toURL(), handler, HttpClient.Factory.createDefault()); SessionMap sessions = new LocalSessionMap(tracer, bus); handler.addHandler(sessions); Distributor distributor = new LocalDistributor(tracer, bus, clientFactory, sessions); handler.addHandler(distributor); LocalNode node = LocalNode.builder(tracer, bus, clientFactory, nodeUri) .add(CAPS, createFactory(nodeUri)) .build(); handler.addHandler(node); distributor.add(node); Router router = new Router(tracer, clientFactory, sessions, distributor); Server<?> server = createServer(router); server.start(); return new Object[] { server, clientFactory }; }
Source:
public void run() { try { PluginWrapper installed = plugin.getInstalled(); synchronized(installed) { if (!installed.isEnabled()) { try { installed.enable(); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to enable " + plugin.getDisplayName(), e); error = e; status = new Failure(e); } if (dynamicLoad) { try { pm.dynamicLoad(getDestination(), true); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to dynamically load " + plugin.getDisplayName(), e); error = e; requiresRestart = true; status = new Failure(e); } } else { requiresRestart = true; } } } status = new Success(); } catch(Throwable e) { LOGGER.log(Level.SEVERE, "An unexpected error occurred while attempting to enable " + plugin.getDisplayName(), e); error = e; requiresRestart = true; status = new Failure(e); } }

Target:
public void run() { try { PluginWrapper installed = plugin.getInstalled(); synchronized(installed) { if (!installed.isEnabled()) { try { installed.enable(); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to enable " + plugin.getDisplayName(), e); error = e; status = new Failure(e); } if (dynamicLoad) { try { pm.dynamicLoad(getDestination(), true); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to dynamically load " + plugin.getDisplayName(), e); error = e; requiresRestart = true; status = new Failure(e); } } else { requiresRestart = true; } } } } catch(Throwable e) { LOGGER.log(Level.SEVERE, "An unexpected error occurred while attempting to enable " + plugin.getDisplayName(), e); error = e; requiresRestart = true; status = new Failure(e); } if(status instanceof Pending) { status = new Success(); } }
Source:
public static BlobAll deserializeBlobAll(InputStream stream, StoreKeyFactory storeKeyFactory) throws IOException, MessageFormatException { skipHeaders(stream); StoreKey storeKey = storeKeyFactory.getStoreKey(new DataInputStream(stream)); BlobProperties blobProperties = deserializeBlobProperties(stream); byte[] userMetadata = deserializeUserMetadata(stream).array(); BlobData blobData = deserializeBlob(stream); return new BlobAll(storeKey, new BlobInfo(blobProperties, userMetadata), blobData); }

Target:
public static BlobAll deserializeBlobAll(InputStream stream, StoreKeyFactory storeKeyFactory) throws IOException, MessageFormatException { validateHeader(stream); StoreKey storeKey = storeKeyFactory.getStoreKey(new DataInputStream(stream)); BlobProperties blobProperties = deserializeBlobProperties(stream); byte[] userMetadata = deserializeUserMetadata(stream).array(); BlobData blobData = deserializeBlob(stream); return new BlobAll(storeKey, new BlobInfo(blobProperties, userMetadata), blobData); }
Source:
private void updateExpTime() { if (_ignoreChanges) return; final TextBoxWidget expTimeTextBox = getExposureTimeTextBox(); if (expTimeTextBox != null && getDataObject() != null) { final String newExpTime = getDataObject().getExposureTimeAsString(); if (!newExpTime.equals(expTimeTextBox.getText())) { expTimeTextBox.setText(newExpTime); } } }

Target:
private void updateExpTime() { if (!_ignoreChanges) { final TextBoxWidget expTimeTextBox = getExposureTimeTextBox(); if (expTimeTextBox != null && getDataObject() != null) { final String newExpTime = getDataObject().getExposureTimeAsString(); if (!newExpTime.equals(expTimeTextBox.getText())) { expTimeTextBox.setText(newExpTime); } } } }
Source:
public ProjectFeatureFlag(String name, boolean enabled) { this(name, enabled, null); }

Target:
public ProjectFeatureFlag(String name, boolean enabled) { this(notEmpty(name, "name"), enabled, null); }