auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) { boolean isTimeToCommit = System.currentTimeMillis() - _lastCommittedTime > _offsetCommitInterval; if (hardCommit || isTimeToCommit) { if (hardCommit) { LOG.info("Calling flush on the producer."); _task.getEventProducer().flush(); consumer.commitSync(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()).ifPresent(ackCheckpoint -> { long committedCheckpoint = Optional.ofNullable(consumer.committed(tp)).map(OffsetAndMetadata::offset).orElse(0L); if (!Objects.equals(ackCheckpoint, committedCheckpoint)) { LOG.error( "Ack checkpoint should match committed checkpoint after flushing and checkpointing. Ack checkpoint: " + "{}, consumer position: {}", ackCheckpoint, committedCheckpoint); } }); } _flushlessProducer.clear(); } else { LOG.info("Trying to commit offsets."); Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()) .ifPresent(o -> offsets.put(tp, new OffsetAndMetadata(o + 1))); } consumer.commitSync(offsets); } _lastCommittedTime = System.currentTimeMillis(); } }

Target:
protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) { boolean isTimeToCommit = System.currentTimeMillis() - _lastCommittedTime > _offsetCommitInterval; if (hardCommit) { LOG.info("Calling flush on the producer."); _task.getEventProducer().flush(); consumer.commitSync(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()).ifPresent(ackCheckpoint -> { long committedCheckpoint = Optional.ofNullable(consumer.committed(tp)).map(OffsetAndMetadata::offset).orElse(0L); if (!Objects.equals(ackCheckpoint, committedCheckpoint)) { LOG.error( "Ack checkpoint should match committed checkpoint after flushing and checkpointing. Ack checkpoint: " + "{}, consumer position: {}", ackCheckpoint, committedCheckpoint); } }); long inFlightCount = _flushlessProducer.getInFlightCount(tp.topic(), tp.partition()); if (inFlightCount > 0) { LOG.error("Flushless producer inflight count for topic partition should be 0 after flush, but was {}", tp.topic(), tp.partition(), inFlightCount); } } _flushlessProducer.clear(); _lastCommittedTime = System.currentTimeMillis(); } else if (isTimeToCommit) { LOG.info("Trying to commit offsets."); Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>(); for (TopicPartition tp : consumer.assignment()) { _flushlessProducer.getAckCheckpoint(tp.topic(), tp.partition()) .ifPresent(o -> offsets.put(tp, new OffsetAndMetadata(o + 1))); } consumer.commitSync(offsets); _lastCommittedTime = System.currentTimeMillis(); } }
Source:
public Observable<GitHubRepository> getSelectRepository() { return selectRepository; }

Target:
public Observable<GitHubRepository> getSelectRepository() { return selectRepository.hide(); }
Source:
public void testSingletonFlatbush() { List<Rectangle> items = new ArrayList(); items.add(new Rectangle(0, 0, 1, 1)); Flatbush rtree = new Flatbush<Rectangle>(items.toArray(new Rectangle[] {})); assertEquals(rtree.findIntersections(everything), items); Rectangle hit = new Rectangle(1, 1, 2, 2); assertEquals(rtree.findIntersections(hit), items); Rectangle miss = new Rectangle(-1, -1, -0.1, -0.1); assertEquals(rtree.findIntersections(miss).size(), 0); }

Target:
public void testSingletonFlatbush() { List<Rectangle> items = ImmutableList.of(new Rectangle(0, 0, 1, 1)); Flatbush<Rectangle> rtree = new Flatbush<>(items.toArray(new Rectangle[] {})); assertEquals(findIntersections(rtree, EVERYTHING), items); assertEquals(findIntersections(rtree, new Rectangle(1, 1, 2, 2)), items); assertEquals(findIntersections(rtree, new Rectangle(-1, -1, -0.1, -0.1)), ImmutableList.of()); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!isCameraPermissionGranted(this)) { finish(); return; } requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager .LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_capture_selfie_new_api); if (null == savedInstanceState) { getFragmentManager().beginTransaction() .replace(R.id.container, Camera2Fragment.newInstance()) .commit(); } ToastUtils.showLongToast(R.string.take_picture_instruction); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!isCameraPermissionGranted(this)) { finish(); return; } requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager .LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_capture_selfie); if (null == savedInstanceState) { getFragmentManager().beginTransaction() .replace(R.id.container, Camera2Fragment.newInstance()) .commit(); } ToastUtils.showLongToast(R.string.take_picture_instruction); }
Source:
public View key(Object... key) { this.key = getKeyAsJsonElement(key); uriBuilder.query("key", this.key); return this; }

Target:
public View key(Object... key) { this.key = getKeyAsJsonElement(key); uriBuilder.query("key", gson.toJson(this.key)); return this; }
Source:
private OkHttpClient getOkHttpClient(File baseDir) { OkHttpClient.Builder okClientBuilder = new OkHttpClient.Builder(); okClientBuilder.addInterceptor(headerAuthorizationInterceptor); httpLoggingInterceptor = new HttpLoggingInterceptor(); httpLoggingInterceptor.setLevel(Logger.isVerboseLoggingEnabled() ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); okClientBuilder.addInterceptor(httpLoggingInterceptor); okClientBuilder.addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response response = chain.proceed(chain.request()); return response.newBuilder() .addHeader("is304", String.valueOf(response.code() == HttpURLConnection.HTTP_NOT_MODIFIED)) .build(); } }); okClientBuilder.retryOnConnectionFailure(true); if (baseDir != null) { final File cacheDir = new File(baseDir, "HttpResponseCache"); okClientBuilder.cache(new Cache(cacheDir, HTTP_RESPONSE_DISK_CACHE_MAX_SIZE)); } okClientBuilder.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.readTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.writeTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); mClient = okClientBuilder.build(); return mClient; }

Target:
private OkHttpClient getOkHttpClient(File baseDir) { OkHttpClient.Builder okClientBuilder = new OkHttpClient.Builder(); okClientBuilder.addInterceptor(headerAuthorizationInterceptor); httpLoggingInterceptor = new HttpLoggingInterceptor(); httpLoggingInterceptor.setLevel(Logger.isVerboseLoggingEnabled() ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); okClientBuilder.addInterceptor(httpLoggingInterceptor); okClientBuilder.addNetworkInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response response = chain.proceed(chain.request()); return response.newBuilder() .addHeader(OKHTTP_HEADER, String.valueOf(response.code())) .build(); } }); okClientBuilder.retryOnConnectionFailure(true); if (baseDir != null) { final File cacheDir = new File(baseDir, "HttpResponseCache"); okClientBuilder.cache(new Cache(cacheDir, HTTP_RESPONSE_DISK_CACHE_MAX_SIZE)); } okClientBuilder.connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.readTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); okClientBuilder.writeTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS); mClient = okClientBuilder.build(); return mClient; }
Source:
private Summary makeSummary(Layer layer, String attr) throws JsonSyntaxException { OGCService cswService = Service.ogcHelper(Service.ServiceType.csw, layer.getServices()); log.debug("cswService", cswService); String cswEndpoint = cswService.getEndpoint(); log.debug("cswEndpoint", cswEndpoint); String summaryJson = null; log.debug("summaryJson", summaryJson); try { summaryJson = MetadataUtil.getSummaryFromWPS(cswEndpoint, attr); log.debug("summaryJsonMetadataUtil", summaryJson); } catch (IOException | ParserConfigurationException | SAXException | URISyntaxException ex) { log.error("Problem getting summary from item", ex); } Gson gson = GsonUtil.getDefault(); log.debug("gson", gson); Summary summary = gson.fromJson(summaryJson, Summary.class); log.debug("summary", summary); return summary; }

Target:
private Summary makeSummary(Layer layer, String attr) throws JsonSyntaxException { OGCService cswService = Service.ogcHelper(Service.ServiceType.csw, layer.getServices()); log.debug("cswService {}", cswService); String cswEndpoint = cswService.getEndpoint(); log.debug("cswEndpoint {}", cswEndpoint); String summaryJson = null; try { summaryJson = MetadataUtil.getSummaryFromWPS(cswEndpoint, attr); log.debug("summaryJsonMetadataUtil {}", summaryJson); } catch (IOException | ParserConfigurationException | SAXException | URISyntaxException ex) { log.error("Problem getting summary from item", ex); } Gson gson = GsonUtil.getDefault(); log.debug(String.valueOf(gson)); Summary summary = gson.fromJson(summaryJson, Summary.class); log.debug(String.valueOf(summary)); return summary; }
Source:
public String getVersion() { String buildLabel = buildData.get(BUILD_LABEL); return nullToEmpty(buildLabel); }

Target:
public String getVersion() { String buildLabel = buildData.get(BUILD_LABEL); return buildLabel != null ? buildLabel : ""; }
Source:
void init() { ngrinderContext = System.getProperty("ngrinder.context", "agent"); workDirectory = System.getProperty("ngrinder.base.path", System.getProperty("user.dir")); if (isControllerContext()) { controllerHomeDir = resolveControllerHomeDir(); controllerHomeTmpDir = (controllerHomeDir + File.separator + NGRINDER_CONTROLLER_TEMP_FOLDER); } this.initAccessOfDirectories(); this.initAccessOfHosts(); }

Target:
void init() { ngrinderContext = System.getProperty("ngrinder.context", "agent"); if (isControllerContext()) { controllerHomeDir = resolveControllerHomeDir(); controllerHomeTmpDir = (controllerHomeDir + File.separator + NGRINDER_CONTROLLER_TEMP_FOLDER); } this.initAccessOfDirectories(); this.initAccessOfHosts(); }
Source:
public List<Member> findMembers(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) throws InternalErrorException { return getMembersManagerImpl().findMembers(sess, vo, searchString, onlySponsored); }

Target:
public List<Member> findMembers(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) { return getMembersManagerImpl().findMembers(sess, vo, searchString, onlySponsored); }
Source:
public Response delete(@PathParam("id") final String id) { final OnmsMinion minion = getDao().get(id); final String location = minion.getLocation(); Response response = super.delete(id); final EventBuilder eventBuilder = new EventBuilder(EventConstants.MONITORING_SYSTEM_DELETED_UEI, "Monitoring_System_Updates"); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_TYPE, OnmsMonitoringSystem.TYPE_MINION); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_ID, id); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_LOCATION, location); try { m_eventProxy.send(eventBuilder.getEvent()); } catch (final EventProxyException e) { LOG.warn(" Failed to send Event on Minion deletion " + e.getMessage(), e); } return response; }

Target:
public Response delete(@PathParam("id") final String id) { final OnmsMinion minion = getDao().get(id); final String location = minion.getLocation(); Response response = super.delete(id); final EventBuilder eventBuilder = new EventBuilder(EventConstants.MONITORING_SYSTEM_DELETED_UEI, "OpenNMS.WebUI"); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_TYPE, OnmsMonitoringSystem.TYPE_MINION); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_ID, id); eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_LOCATION, location); try { m_eventProxy.send(eventBuilder.getEvent()); } catch (final EventProxyException e) { LOG.warn(" Failed to send Event on Minion deletion " + e.getMessage(), e); } return response; }
Source:
private void editAnalysis() { for (TableItem item : fAnalysesTable.getSelection()) { String selection = XmlUtils.createXmlFileString(item.getText()); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IEditorPart editorPart = IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); editorPart.addPropertyListener(new IPropertyListener() { @Override public void propertyChanged(Object source, int propId) { if (ISaveablePart.PROP_DIRTY == propId) { if (!editorPart.isDirty()) { loadXmlFile(file, false); } } } }); performOk(); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } } }

Target:
private void editAnalysis() { for (TableItem item : fAnalysesTable.getSelection()) { String selection = XmlUtils.createXmlFileString(item.getText()); @Nullable File file = XmlUtils.listFiles().get(selection); if (file == null) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); return; } try { IEditorPart editorPart = IDE.openEditorOnFileStore(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), EFS.getStore(file.toURI())); editorPart.addPropertyListener(new IPropertyListener() { @Override public void propertyChanged(Object source, int propId) { if (ISaveablePart.PROP_DIRTY == propId && !editorPart.isDirty()) { loadXmlFile(file, false); } } }); performOk(); } catch (CoreException e) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection)); TraceUtils.displayErrorMsg(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToEdit, selection), e.getMessage()); } } }
Source:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; for (String response : responses) { ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path("compute"); if (!computeNode.isMissingNode()) { String vmName = computeNode.path("vmId").getTextValue(); String platformFaultDomain = computeNode.path("platformFaultDomain").getTextValue(); String vmssName = computeNode.path("vmScaleSetName").getValueAsText(); AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(platformFaultDomain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { LOG.error("Error in parsing cloud instance information: {}", response, e); } } return azureCloudInstanceInformation; }

Target:
public AzureCloudInstanceInformation parseCloudInstanceInformation(List<String> responses) { AzureCloudInstanceInformation azureCloudInstanceInformation = null; if (responses.size() > 1) { throw new HelixException("Multiple responses are not supported for Azure now"); } String response = responses.get(0); ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonNode = mapper.readTree(response); JsonNode computeNode = jsonNode.path(COMPUTE); if (!computeNode.isMissingNode()) { String vmName = computeNode.path(INSTANCE_NAME).getTextValue(); String platformFaultDomain = computeNode.path(DOMAIN).getTextValue(); String vmssName = computeNode.path(INSTANCE_SET_NAME).getValueAsText(); AzureCloudInstanceInformation.Builder builder = new AzureCloudInstanceInformation.Builder(); builder.setInstanceName(vmName).setFaultDomain(platformFaultDomain) .setInstanceSetName(vmssName); azureCloudInstanceInformation = builder.build(); } } catch (IOException e) { throw new HelixException(String.format("Error in parsing cloud instance information: {}", response, e)); } return azureCloudInstanceInformation; }
Source:
public Map<String, Object> getPreferences() { Map<String, Object> preferences = new HashMap<String, Object>(); if (showMarks) { addMarkFields(suffix, preferences); } if (showErrorBars) { addErrorFields(suffix + ERROR_SUFFIX, preferences); } if (showLine) { addLineFields(suffix, preferences); } if (preferences.isEmpty()) addCommonFields(suffix, preferences); return preferences; }

Target:
public Map<String, Object> getPreferences() { Map<String, Object> preferences = new HashMap<String, Object>(); if (showMarks) { addMarkFields(suffix, preferences); } if (showErrorBars) { addErrorFields(suffix + ERROR_SUFFIX, preferences); } if (showLine) { addLineFields(suffix, preferences); } if (preferences.isEmpty()) { addCommonFields(suffix, preferences); } return preferences; }
Source:
public void assertQuery(@Language("SQL") String actual, @Language("SQL") String expected, boolean ensureOrdering) { MaterializedResult actualResults = null; try { actualResults = runner.execute(runner.getDefaultSession(), actual).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'actual' query failed: " + actual, ex); } MaterializedResult expectedResults = null; try { expectedResults = runner.execute(runner.getDefaultSession(), expected).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'expected' query failed: " + expected, ex); } assertEquals(actualResults.getTypes(), expectedResults.getTypes(), "For query: \n " + actual + "\n:"); List<MaterializedRow> actualRows = actualResults.getMaterializedRows(); List<MaterializedRow> expectedRows = expectedResults.getMaterializedRows(); if (ensureOrdering) { if (!actualRows.equals(expectedRows)) { assertEquals(actualRows, expectedRows, "For query: \n " + actual + "\n:"); } } else { assertEqualsIgnoreOrder(actualRows, expectedRows, "For query: \n " + actual); } }

Target:
public void assertQuery(@Language("SQL") String actual, @Language("SQL") String expected, boolean ensureOrdering) { MaterializedResult actualResults = null; try { actualResults = runner.execute(runner.getDefaultSession(), actual).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'actual' query failed: " + actual, ex); } MaterializedResult expectedResults = null; try { expectedResults = runner.execute(runner.getDefaultSession(), expected).toTestTypes(); } catch (RuntimeException ex) { fail("Execution of 'expected' query failed: " + expected, ex); } assertEquals(actualResults.getTypes(), expectedResults.getTypes(), "Types mismatch for query: \n " + actual + "\n:"); List<MaterializedRow> actualRows = actualResults.getMaterializedRows(); List<MaterializedRow> expectedRows = expectedResults.getMaterializedRows(); if (ensureOrdering) { if (!actualRows.equals(expectedRows)) { assertEquals(actualRows, expectedRows, "For query: \n " + actual + "\n:"); } } else { assertEqualsIgnoreOrder(actualRows, expectedRows, "For query: \n " + actual); } }
Source:
public List<PartitionDescProto> getAllPartitions(final String tableName) { final BlockingInterface stub = conn.getTMStub(); GetPartitionsResponse response; try { response = stub.getPartitionsByTableName(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } ensureOk(response.getState()); return response.getPartitionList(); }

Target:
public List<PartitionDescProto> getAllPartitions(final String tableName) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException { final BlockingInterface stub = conn.getTMStub(); PartitionListResponse response; try { response = stub.getPartitionsByTableName(null, conn.getSessionedString(tableName)); } catch (ServiceException e) { throw new RuntimeException(e); } throwsIfThisError(response.getState(), UndefinedDatabaseException.class); throwsIfThisError(response.getState(), UndefinedTableException.class); throwsIfThisError(response.getState(), UndefinedPartitionMethodException.class); ensureOk(response.getState()); return response.getPartitionList(); }
Source:
public void get() { ToSolverConfig toSolverConfigModel = new ToSolverConfig( getSolverConfigModel() ); SolverConfig solverConfig = toSolverConfigModel.get(); assertEquals( Long.valueOf( 1 ), solverConfig.getTerminationConfig().getMillisecondsSpentLimit() ); assertEquals( 1, solverConfig.getTerminationConfig().getTerminationConfigList().size() ); assertEquals( Boolean.TRUE, solverConfig.getTerminationConfig().getTerminationConfigList().get( 0 ).getBestScoreFeasible() ); assertEquals( "testKsession", solverConfig.getScoreDirectorFactoryConfig().getKsessionName() ); assertEquals( ScoreDefinitionType.HARD_SOFT, solverConfig.getScoreDirectorFactoryConfig().getScoreDefinitionType() ); assertEquals( 1, solverConfig.getPhaseConfigList().size() ); ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = (ConstructionHeuristicPhaseConfig) solverConfig.getPhaseConfigList().get( 0 ); assertEquals( ConstructionHeuristicType.FIRST_FIT, constructionHeuristicPhaseConfig.getConstructionHeuristicType() ); }

Target:
public void get() { ToSolverConfig toSolverConfigModel = new ToSolverConfig( getSolverConfigModel() ); SolverConfig solverConfig = toSolverConfigModel.get(); TerminationConfig terminationConfig = solverConfig.getTerminationConfig(); assertEquals( Long.valueOf( 1 ), terminationConfig.getMillisecondsSpentLimit() ); assertEquals( 1, terminationConfig.getTerminationConfigList().size() ); assertEquals( Boolean.TRUE, terminationConfig.getTerminationConfigList().get( 0 ).getBestScoreFeasible() ); assertEquals( "testKsession", solverConfig.getScoreDirectorFactoryConfig().getKsessionName() ); assertEquals( ScoreDefinitionType.HARD_SOFT, solverConfig.getScoreDirectorFactoryConfig().getScoreDefinitionType() ); assertEquals( 1, solverConfig.getPhaseConfigList().size() ); ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = (ConstructionHeuristicPhaseConfig) solverConfig.getPhaseConfigList().get( 0 ); assertEquals( ConstructionHeuristicType.FIRST_FIT, constructionHeuristicPhaseConfig.getConstructionHeuristicType() ); }
Source:
public static void showNoGpsDialog(Activity activity, DialogInterface.OnClickListener onChange, DialogInterface.OnCancelListener onCancel) { AlertDialogFactory factory = new AlertDialogFactory(activity, activity.getString(R.string.no_gps_title), activity.getString(R.string.no_gps_message)); factory.setPositiveButton(activity.getString(R.string.change_settings), onChange); factory.setNegativeButton(activity.getString(R.string.cancel), onChange); if (onCancel != null) { factory.makeCancelable(); factory.setOnCancelListener(onCancel); } if (activity instanceof CommCareActivity) { ((CommCareActivity)activity).showAlertDialog(factory); } else { factory.showDialog(); } }

Target:
public static void showNoGpsDialog(Activity activity, DialogInterface.OnClickListener onChange, DialogInterface.OnCancelListener onCancel) { AlertDialogFactory factory = setupAlertFactory(activity, onChange, onCancel); factory.showDialog(); }
Source:
public static Scheduler currentThread() { Scheduler scheduler = RxAndroidPlugins.getInstance().getSchedulersHook().getCurrentThreadScheduler(); return scheduler != null ? scheduler : new HandlerScheduler(new Handler(Looper.myLooper())); }

Target:
public static Scheduler currentThread() { Scheduler scheduler = RxAndroidPlugins.getInstance().getSchedulersHook().getCurrentThreadScheduler(); return scheduler != null ? scheduler : getCurrentThreadScheduler(); }
Source:
private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { checkState(lifespanCompletionCallback != null); lifespanCompletionCallback.accept(lifespan); } memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }

Target:
private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback is not null"); lifespanCompletionCallback.accept(lifespan); } memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }
Source:
public final void createsFakeWithParams() throws IOException { final String key = "key"; final String akey = "anotherkey"; final String value = "value"; final String avalue = "anothervalue"; final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }

Target:
public final void createsFakeWithParams() throws IOException { final String key = "key"; final String akey = "anotherkey"; final String value = "value"; final String avalue = "a&b"; final String aavalue = "againanothervalue"; final RqForm req = new RqForm.Fake( new RqFake(), key, value, key, avalue, akey, aavalue ); MatcherAssert.assertThat( req.param(key), Matchers.hasItems(value, avalue) ); MatcherAssert.assertThat( req.param(akey), Matchers.hasItems(aavalue) ); MatcherAssert.assertThat( req.names(), Matchers.hasItems(key, akey) ); }
Source:
private void addChatMessage(final String originalMessage, final String from) { final String message = Ascii.truncate(originalMessage, 200, "..."); final String fullMessage = from + ": " + " " + message + "\n"; final String currentAllText = allText.toString(); if (currentAllText.length() > MAX_LENGTH) { allText = new StringBuilder(currentAllText.substring(MAX_LENGTH / 2)); } allText.append(fullMessage); }

Target:
private void addChatMessage(final String originalMessage, final String from) { final String currentAllText = allText.toString(); if (currentAllText.length() > MAX_LENGTH) { allText = new StringBuilder(currentAllText.substring(MAX_LENGTH / 2)); } final String message = Ascii.truncate(originalMessage, 200, "..."); final String fullMessage = String.format("(%s) %s: %s\n", TimeManager.getLocalizedTime(), from, message); allText.append(fullMessage); }
Source:
protected void processTrap() { validate(); m_trapProcessor.setVersion(getVersion()); m_trapProcessor.setCommunity(getCommunity()); m_trapProcessor.setAgentAddress(getAgentAddress()); m_trapProcessor.setTrapAddress(getTrapAddress()); LOG.debug("{} trap - trapInterface: ()", getVersion(), getTrapAddress()); m_trapProcessor.setTimeStamp(getTimeStamp()); m_trapProcessor.setTrapIdentity(getTrapIdentity()); int i = 0; try { for (i = 0; i < getPduLength(); i++) { processVarBindAt(i); } } catch (RuntimeException rte) { LOG.error("Caught while processing varbind of trap; rethrowing. Trap info: {}", rte.getClass(), i+1, toString()); throw rte; } }

Target:
protected void processTrap() { validate(); m_trapProcessor.setVersion(getVersion()); m_trapProcessor.setCommunity(getCommunity()); m_trapProcessor.setAgentAddress(getAgentAddress()); m_trapProcessor.setTrapAddress(getTrapAddress()); LOG.debug("{} trap - trapInterface: ()", getVersion(), getTrapAddress()); m_trapProcessor.setTimeStamp(getTimeStamp()); m_trapProcessor.setTrapIdentity(getTrapIdentity()); int i = 0; try { for (i = 0; i < getPduLength(); i++) { processVarBindAt(i); } } catch (Throwable t) { LOG.error("Caught while processing varbind of trap; rethrowing. Trap info: {}. Stack trace: {}", t.getClass(), i+1, toString(), t.getStackTrace()); throw t; } }
Source:
public M2ServletContextListener() { Path tempDir = null; try { tempDir = Files.createTempDirectory("pom-extract"); } catch (IOException e) { } this.tempDir = tempDir; }

Target:
public M2ServletContextListener() { Path tempDir = null; try { tempDir = Files.createTempDirectory("pom-extract"); } catch (IOException e) { logger.error(e.getMessage(), e); } this.tempDir = tempDir; }
Source:
protected void invoke(Object session, InvocationContext ctx, RemoveCommand command) { CompletableFuture<Object> future = invoker.invokeAsync(ctx, command); if (!command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK)) { Sync sync = (Sync)((SharedSessionContractImplementor) session).getCacheTransactionSynchronization(); sync.registerBeforeCommit(future); } else { log.trace("Removal was not applied immediatelly, waiting."); future.join(); } }

Target:
protected void invoke(Object session, InvocationContext ctx, RemoveCommand command) { CompletableFuture<Object> future = invoker.invokeAsync(ctx, command); if (!command.hasAnyFlag(FlagBitSets.FORCE_WRITE_LOCK)) { Sync sync = (Sync)((SharedSessionContractImplementor) session).getCacheTransactionSynchronization(); sync.registerBeforeCommit(future); } else { log.trace("Removal was not applied immediately, waiting."); future.join(); } }
Source:
public void deleteRecord(DataIdentifier identifier) throws DataStoreException { if (null == identifier) throw new NullPointerException("identifier"); String key = getKeyName(identifier); long start = System.currentTimeMillis(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); boolean result = getAzureContainer().getBlockBlobReference(key).deleteIfExists(); LOG.debug("Blob deleted. existed={} identifier={} duration={}", result, key, (System.currentTimeMillis() - start)); } catch (StorageException e) { LOG.info("Error deleting blob. identifier={}", key, e); throw new DataStoreException(e); } catch (URISyntaxException e) { throw new DataStoreException(e); } finally { if (contextClassLoader != null) { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }

Target:
public void deleteRecord(DataIdentifier identifier) throws DataStoreException { if (null == identifier) throw new NullPointerException("identifier"); String key = getKeyName(identifier); long start = System.currentTimeMillis(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); boolean result = getAzureContainer().getBlockBlobReference(key).deleteIfExists(); LOG.debug("Blob {}. identifier={} duration={}", result ? "deleted" : "delete requested, but it does not exist (perhaps already deleted)", key, (System.currentTimeMillis() - start)); } catch (StorageException e) { LOG.info("Error deleting blob. identifier={}", key, e); throw new DataStoreException(e); } catch (URISyntaxException e) { throw new DataStoreException(e); } finally { if (contextClassLoader != null) { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }
Source:
public static String getSimpleClassName(String qualifiedName) { int i = qualifiedName.lastIndexOf('.'); return i < 0 ? qualifiedName : qualifiedName.substring(i + 1); }

Target:
public static String getSimpleClassName(String qualifiedName) { if (null == qualifiedName) { return null; } int i = qualifiedName.lastIndexOf('.'); return i < 0 ? qualifiedName : qualifiedName.substring(i + 1); }
Source:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = validateAndGetPartitionCapacity(partitionName, resourceConfig, capacityMap, clusterConfig); partitionCapacity.keySet().retainAll(clusterConfig.getInstanceCapacityKeys()); return partitionCapacity; }

Target:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = WagedValidationUtil .validateAndGetPartitionCapacity(partitionName, resourceConfig, capacityMap, clusterConfig); partitionCapacity.keySet().retainAll(clusterConfig.getInstanceCapacityKeys()); return partitionCapacity; }
Source:
public void getBlob() throws Exception { final String sha = "6dcb09b5b57875f334f61aebed695e2e4193db5e"; final Blobs blobs = repo().git().blobs(); MatcherAssert.assertThat(blobs.get(sha), Matchers.notNullValue()); }

Target:
public void getBlob() throws Exception { final Blobs blobs = repo().git().blobs(); final Blob created = blobs.create("content", "base64"); MatcherAssert.assertThat( blobs.get(created.sha()), Matchers.notNullValue() ); }
Source:
public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(getInitialDirectory()) .build(); Optional<Path> studyDefinitionFile = dialogService.showFileOpenDialog(fileDialogConfiguration); if (studyDefinitionFile.isEmpty()) { return; } final Crawler crawler; try { crawler = new Crawler(studyDefinitionFile.get(), Globals.getFileUpdateMonitor(), JabRefPreferences.getInstance().getSavePreferences(), Globals.entryTypesManager); } catch (IOException | ParseException | GitAPIException e) { LOGGER.info("Error during reading of study definition file.", e); dialogService.showErrorDialogAndWait(Localization.lang("Error during reading of study definition file.")); return; } BackgroundTask.wrap(() -> { crawler.performCrawl(); return 0; }) .onFailure(e -> { LOGGER.info("Error during persistence of crawling results."); dialogService.showErrorDialogAndWait(Localization.lang("Error during persistence of crawling results."), e); }) .onSuccess(unused -> new OpenDatabaseAction(frame).openFile(Path.of(studyDefinitionFile.get().getParent().toString(), "studyResult.bib"), true)) .executeWith(Globals.TASK_EXECUTOR); }

Target:
public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(workingDirectory) .build(); Optional<Path> studyDefinitionFile = dialogService.showFileOpenDialog(fileDialogConfiguration); if (studyDefinitionFile.isEmpty()) { return; } final Crawler crawler; try { crawler = new Crawler(studyDefinitionFile.get(), fileUpdateMonitor, JabRefPreferences.getInstance().getImportFormatPreferences(), JabRefPreferences.getInstance().getSavePreferences(), new BibEntryTypesManager()); } catch (IOException | ParseException | GitAPIException e) { LOGGER.error("Error during reading of study definition file.", e); dialogService.showErrorDialogAndWait(Localization.lang("Error during reading of study definition file."), e); return; } BackgroundTask.wrap(() -> { crawler.performCrawl(); return 0; }) .onFailure(e -> { LOGGER.error("Error during persistence of crawling results."); dialogService.showErrorDialogAndWait(Localization.lang("Error during persistence of crawling results."), e); }) .onSuccess(unused -> new OpenDatabaseAction(frame).openFile(Path.of(studyDefinitionFile.get().getParent().toString(), "studyResult.bib"), true)) .executeWith(taskExecutor); }
Source:
public ResponseEntity<?> listStorages(final NativeWebRequest request) throws InternalNakadiException { if (!adminService.isAdmin(AuthorizationService.Operation.READ)) { return status(FORBIDDEN).build(); } final List<Storage> storages = storageService.listStorages(); return status(OK).body(storages); }

Target:
public ResponseEntity<?> listStorages(final NativeWebRequest request) throws InternalNakadiException, PluginException { if (!adminService.isAdmin(AuthorizationService.Operation.READ)) { return status(FORBIDDEN).build(); } final List<Storage> storages = storageService.listStorages(); return status(OK).body(storages); }
Source:
public void consumeItems(CraftingGrid craftingGrid) { ShapedMapping mapping = findIngredientMapping(craftingGrid); if (mapping == null) { return; } for (int i = 0; i < ingredients.length; i++) { Item original = mapping.Items[i]; Item consumed = ingredients[i].consumeOnCrafting(original, craftingGrid); if (consumed != null && consumed.count() == 0) { consumed = null; } mapping.setStack(craftingGrid, i, Optional.ofNullable(consumed)); } }

Target:
public void consumeItems(CraftingGrid craftingGrid) { ShapedMapping mapping = findIngredientMapping(craftingGrid); if (mapping == null) { return; } for (int i = 0; i < ingredients.length; i++) { Item original = mapping.Items[i]; Item consumed = ingredients[i].consumeOnCrafting(original, craftingGrid); Objects.requireNonNull(consumed, "The result of 'ItemIngredient.consumeOnCrafting' can't be null"); if (consumed.count() == 0) { consumed = null; } mapping.setStack(craftingGrid, i, Optional.ofNullable(consumed)); } }
Source:
private NameEnvironmentAnswer findType(String className) { if (className.equals(this.className)) { return new NameEnvironmentAnswer(this, null); } String resourceName = className.replace('.', '/') + ".class"; try { try (InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName)) { if (is != null) { byte[] classBytes = ByteStreams.toByteArray(is); char[] fileName = className.toCharArray(); ClassFileReader classFileReader = new ClassFileReader(classBytes, fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } } } catch (IOException | ClassFormatException exc) { throw new RuntimeException(exc); } return null; }

Target:
private NameEnvironmentAnswer findType(String className) { if (className.equals(this.className)) { return new NameEnvironmentAnswer(this, null); } String resourceName = className.replace('.', '/') + ".class"; try (InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName)) { if (is != null) { byte[] classBytes = ByteStreams.toByteArray(is); char[] fileName = className.toCharArray(); ClassFileReader classFileReader = new ClassFileReader(classBytes, fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } } catch (IOException | ClassFormatException exc) { throw new RuntimeException(exc); } return null; }
Source:
List<String> translate (String rnaSequence) { List proteinList = new ArrayList(); for (int i = 0; i < rnaSequence.length(); i += 3) { String codon = rnaSequence.substring(i, i+3); if (Arrays.asList(METHIONINE).contains(codon)) { proteinList.add("Methionine"); } else if (Arrays.asList(PHENYLALANINE).contains(codon)) { proteinList.add("Phenylalanine"); } else if (Arrays.asList(LEUCINE).contains(codon)) { proteinList.add("Leucine"); } else if (Arrays.asList(SERINE).contains(codon)) { proteinList.add("Serine"); } else if (Arrays.asList(TYROSINE).contains(codon)) { proteinList.add("Tyrosine"); } else if (Arrays.asList(CYSTEINE).contains(codon)) { proteinList.add("Cysteine"); } else if (Arrays.asList(TRYPTOPHAN).contains(codon)) { proteinList.add("Tryptophan"); } else if (Arrays.asList(STOP).contains(codon)) { break; } else { throw new IllegalArgumentException("Invalid input"); } } return proteinList; }

Target:
List<String> translate(String rnaSequence) { List<String> proteinList = new ArrayList<String>(); for (int i = 0; i < rnaSequence.length(); i += 3) { String codon = rnaSequence.substring(i, i+3); if (Arrays.asList(METHIONINE).contains(codon)) { proteinList.add("Methionine"); } else if (Arrays.asList(PHENYLALANINE).contains(codon)) { proteinList.add("Phenylalanine"); } else if (Arrays.asList(LEUCINE).contains(codon)) { proteinList.add("Leucine"); } else if (Arrays.asList(SERINE).contains(codon)) { proteinList.add("Serine"); } else if (Arrays.asList(TYROSINE).contains(codon)) { proteinList.add("Tyrosine"); } else if (Arrays.asList(CYSTEINE).contains(codon)) { proteinList.add("Cysteine"); } else if (Arrays.asList(TRYPTOPHAN).contains(codon)) { proteinList.add("Tryptophan"); } else if (Arrays.asList(STOP).contains(codon)) { break; } else { throw new IllegalArgumentException("Invalid input"); } } return proteinList; }
Source:
private boolean networksOnNicMatchMtu(List<Network> networksOnNic) { for (int i = 0; i < networksOnNic.size() - 1; i++) { for (int j = i + 1; j < networksOnNic.size(); j++) { final Network network = networksOnNic.get(i); final Network otherNetwork = networksOnNic.get(j); if (network.getMtu() != otherNetwork.getMtu() && !(NetworkUtils.isVlan(otherNetwork) && NetworkUtils.isVlan(otherNetwork))) { return false; } } } return true; }

Target:
private boolean networksOnNicMatchMtu(List<Network> networksOnNic) { final Network nonVlanNetwork = LinqUtils.firstOrNull(networksOnNic, new Predicate<Network>() { @Override public boolean eval(Network network) { return !NetworkUtils.isVlan(network); } }); if (nonVlanNetwork == null) { return true; } final Network mismatchMtuNetwork = LinqUtils.firstOrNull(networksOnNic, new Predicate<Network>() { @Override public boolean eval(Network network) { return network.getMtu() != nonVlanNetwork.getMtu(); } }); return mismatchMtuNetwork == null; }
Source:
public void isEnumCanonicalName() { assertTrue(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getCanonicalName())); }

Target:
public void isEnumCanonicalName() { assertTrue(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getCanonicalName())); assertFalse(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getSimpleName())); }
Source:
public boolean removeCnxn(NIOServerCnxn cnxn) { if (!cnxns.remove(cnxn)) { return false; } cnxnExpiryQueue.remove(cnxn); long sessionId = cnxn.getSessionId(); if (sessionId != 0) { sessionMap.remove(sessionId); } InetAddress addr = cnxn.getSocketAddress(); if (addr != null) { IpCnxns ipCnxns = ipMap.get(addr); if (ipCnxns != null) { Set<NIOServerCnxn> set = ipCnxns.cnxnSet; set.remove(cnxn); } } unregisterConnection(cnxn); return true; }

Target:
public boolean removeCnxn(NIOServerCnxn cnxn) { if (!cnxns.remove(cnxn)) { return false; } cnxnExpiryQueue.remove(cnxn); long sessionId = cnxn.getSessionId(); if (sessionId != 0) { sessionMap.remove(sessionId); } InetAddress addr = cnxn.getSocketAddress(); if (addr != null) { IpCnxns ipCnxns = ipMap.get(addr); if (ipCnxns != null) { Set<NIOServerCnxn> set = ipCnxns.getCnxnSet(); set.remove(cnxn); } } unregisterConnection(cnxn); return true; }
Source:
public void setAccountResolver(AccountResolver accountResolver) { this.accountResolver = accountResolver; }

Target:
public void setAccountResolver(AccountResolver accountResolver) { Assert.notNull(accountResolver, "AccountResolver cannot be null."); this.accountResolver = accountResolver; }
Source:
public static Optional<Symbol> rewriteExpression(Map<Symbol, Expression> assignments, Expression expression) { checkArgument(expression instanceof CoalesceExpression, "The rewrite can only handle CoalesceExpression"); List<Expression> expressionOperands = ((CoalesceExpression) expression).getOperands(); checkArgument(expressionOperands.stream().allMatch(SymbolReference.class::isInstance), "Expect operands of CoalesceExpression to be SymbolReference"); Set<Symbol> symboslInExpression = expressionOperands.stream() .filter(SymbolReference.class::isInstance) .map(Symbol::from) .collect(toImmutableSet()); for (Map.Entry<Symbol, Expression> entry : assignments.entrySet()) { if (entry.getValue() instanceof CoalesceExpression) { List<Expression> assignmentOperands = ((CoalesceExpression) entry.getValue()).getOperands(); if (!assignmentOperands.stream().allMatch(SymbolReference.class::isInstance)) { return Optional.empty(); } Set<Symbol> symbolsInAssignment = assignmentOperands.stream() .filter(SymbolReference.class::isInstance) .map(Symbol::from) .collect(toImmutableSet()); if (symbolsInAssignment.equals(symboslInExpression)) { return Optional.of(entry.getKey()); } } } return Optional.empty(); }

Target:
private static Optional<Symbol> rewriteExpression(Map<Symbol, Expression> assignments, Expression expression) { checkArgument(expression instanceof CoalesceExpression, "The rewrite can only handle CoalesceExpression"); Set<Expression> expressionOperands = ImmutableSet.copyOf(((CoalesceExpression) expression).getOperands()); checkArgument(expressionOperands.stream().allMatch(SymbolReference.class::isInstance), "Expect operands of CoalesceExpression to be SymbolReference"); for (Map.Entry<Symbol, Expression> entry : assignments.entrySet()) { if (entry.getValue() instanceof CoalesceExpression) { Set<Expression> assignmentOperands = ImmutableSet.copyOf(((CoalesceExpression) entry.getValue()).getOperands()); if (!assignmentOperands.stream().allMatch(SymbolReference.class::isInstance)) { return Optional.empty(); } if (assignmentOperands.equals(expressionOperands)) { return Optional.of(entry.getKey()); } } } return Optional.empty(); }
Source:
public EntityAsyncTask(AsyncTaskParameters parameters, boolean duringInit) { super(parameters); boolean isNewCommanAdded = false; synchronized (_lockObject) { if (!_multiTasksByEntities.containsKey(getContainerId())) { log.infoFormat("EntityAsyncTask::Adding EntityMultiAsyncTasks object for entity '{0}'", getContainerId()); _multiTasksByEntities.put(getContainerId(), new EntityMultiAsyncTasks(getContainerId())); isNewCommanAdded = true; } } if (duringInit && isNewCommanAdded) { CommandBase<?> command = CommandsFactory.CreateCommand(parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); if (!command.acquireLockAsyncTask()) { log.warnFormat("Failed to acquire locks for command {0} with parameters {1}", parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); } } EntityMultiAsyncTasks entityInfo = GetEntityMultiAsyncTasks(); entityInfo.AttachTask(this); }

Target:
public EntityAsyncTask(AsyncTaskParameters parameters, boolean duringInit) { super(parameters); boolean isNewCommandAdded = false; synchronized (_lockObject) { if (!_multiTasksByEntities.containsKey(getContainerId())) { log.infoFormat("EntityAsyncTask::Adding EntityMultiAsyncTasks object for entity '{0}'", getContainerId()); _multiTasksByEntities.put(getContainerId(), new EntityMultiAsyncTasks(getContainerId())); isNewCommandAdded = true; } } if (duringInit && isNewCommandAdded) { CommandBase<?> command = CommandsFactory.CreateCommand(parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); if (!command.acquireLockAsyncTask()) { log.warnFormat("Failed to acquire locks for command {0} with parameters {1}", parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); } } EntityMultiAsyncTasks entityInfo = GetEntityMultiAsyncTasks(); entityInfo.AttachTask(this); }
Source:
public static StorageAuthenticationSettings fromConnectionSettings(final ConnectionSettings settings) { final String accountName = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_NAME_NAME); final String accountKey = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_KEY_NAME); final String sasSignature = settings.getSettingValue(Constants.ConnectionStringConstants.SHARED_ACCESS_SIGNATURE_NAME); if (accountName != null && accountKey != null && sasSignature == null) { return new StorageAuthenticationSettings(new Account(accountName, accountKey)); } if (accountKey == null && sasSignature != null) { return new StorageAuthenticationSettings(sasSignature); } return new StorageAuthenticationSettings(); }

Target:
public static StorageAuthenticationSettings fromConnectionSettings(final ConnectionSettings settings) { final String accountName = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_NAME); final String accountKey = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_KEY_NAME); final String sasSignature = settings.getSettingValue(Constants.ConnectionStringConstants.SHARED_ACCESS_SIGNATURE_NAME); if (accountName != null && accountKey != null && sasSignature == null) { return new StorageAuthenticationSettings(new Account(accountName, accountKey)); } if (accountKey == null && sasSignature != null) { return new StorageAuthenticationSettings(sasSignature); } return new StorageAuthenticationSettings(); }