before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
protected void assertClientStreamingCallSuccess(final TestServiceStub serviceStub) {
final StreamRecorder<Empty> responseRecorder = StreamRecorder.create();
final StreamObserver<SomeType> requestObserver = serviceStub.secureDrain(responseRecorder);
requestObserver.onNext(SomeType.newBuilder().setVersion("1.2.3").build(... | protected void assertClientStreamingCallSuccess(final TestServiceStub serviceStub) {
final StreamRecorder<Empty> responseRecorder = StreamRecorder.create();
final StreamObserver<SomeType> requestObserver = serviceStub.secureDrain(responseRecorder);
<DeepExtract>
requestObserver.onNext(SomeType.newBuilder().setVersion("... | grpc-spring-boot-starter | positive | 436,670 |
private void resetKeepView() {
if (mTotalOffsetY != 0) {
endAllRunningAnimator();
int startY = mTotalOffsetY;
mResetAnimator = ValueAnimator.ofInt(startY, 0);
long duration = (long) (mCloseAnimDuration * ((float) Math.abs(mTotalOffsetY) / mHeadHeight));
mResetAnimator.setDuration(duration);
mResetAnimator.setInterpolat... | private void resetKeepView() {
<DeepExtract>
if (mTotalOffsetY != 0) {
endAllRunningAnimator();
int startY = mTotalOffsetY;
mResetAnimator = ValueAnimator.ofInt(startY, 0);
long duration = (long) (mCloseAnimDuration * ((float) Math.abs(mTotalOffsetY) / mHeadHeight));
mResetAnimator.setDuration(duration);
mResetAnimator... | TLRLoadRefresh | positive | 436,672 |
@Override
public void changed(ChangeEvent event, Actor actor) {
NetworkManager.getInstance().disconnectClientThread();
menuScreen.hideWindow(getWindowName());
menuScreen.showWindow(WindowName.MAIN_MENU);
} | @Override
public void changed(ChangeEvent event, Actor actor) {
<DeepExtract>
NetworkManager.getInstance().disconnectClientThread();
menuScreen.hideWindow(getWindowName());
menuScreen.showWindow(WindowName.MAIN_MENU);
</DeepExtract>
} | MyRTS | positive | 436,673 |
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
supportInvalidateOptionsMenu();
if (position != fragIndex) {
swapFragment(fragIndex, position);
}
fragIndex = position;
closeDrawer();
} | @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
supportInvalidateOptionsMenu();
<DeepExtract>
if (position != fragIndex) {
swapFragment(fragIndex, position);
}
fragIndex = position;
closeDrawer();
</DeepExtract>
} | pocket-note-android | positive | 436,674 |
public ArrayList<Cluster> executeKMedoidsClusterOverTrajectories(int k) {
ArrayList<Trajectory> workingTrajectories = trajectories;
long startTime = System.nanoTime();
ArrayList<Cluster> kmedoidsClusters = new ArrayList<Cluster>();
kmedoidsClusters = Kmedoids.execute(workingTrajectories, k, TrajectoryDistance.DTW);
ret... | public ArrayList<Cluster> executeKMedoidsClusterOverTrajectories(int k) {
ArrayList<Trajectory> workingTrajectories = trajectories;
long startTime = System.nanoTime();
<DeepExtract>
ArrayList<Cluster> kmedoidsClusters = new ArrayList<Cluster>();
kmedoidsClusters = Kmedoids.execute(workingTrajectories, k, TrajectoryDist... | TrajectoryClustering | positive | 436,675 |
private void update() {
IViewSite site = super.getViewSite();
if (site == null)
return;
IToolBarManager manager = site.getActionBars().getToolBarManager();
ActionContributionItem showOnlyFailuresItem = (ActionContributionItem) manager.find(ToggleShowOnlyFailuresAction.ACTION_ID);
if (showOnlyFailuresItem != null) {
sho... | private void update() {
IViewSite site = super.getViewSite();
if (site == null)
return;
<DeepExtract>
IToolBarManager manager = site.getActionBars().getToolBarManager();
ActionContributionItem showOnlyFailuresItem = (ActionContributionItem) manager.find(ToggleShowOnlyFailuresAction.ACTION_ID);
if (showOnlyFailuresItem ... | makegood | positive | 436,676 |
@Override
public void delete(final ManifestReport backupToDelete, final RemoveBackupRequest request) throws Exception {
logger.info("Deleting backup {}", backupToDelete.name);
if (backupToDelete.reclaimableSpace > 0 && !backupToDelete.getRemovableEntries().isEmpty()) {
for (final String removableEntry : backupToDelete.... | @Override
public void delete(final ManifestReport backupToDelete, final RemoveBackupRequest request) throws Exception {
logger.info("Deleting backup {}", backupToDelete.name);
if (backupToDelete.reclaimableSpace > 0 && !backupToDelete.getRemovableEntries().isEmpty()) {
for (final String removableEntry : backupToDelete.... | esop | positive | 436,677 |
public Object invoke(Object o) {
ByteBuffer bb = ByteBuffer.wrap((byte[]) o);
int numeratorLength = Bytes.readFixedInt(bb);
byte[] numeratorBytes = new byte[numeratorLength];
byte[] denominatorBytes = new byte[(byte[]) o.length - (numeratorLength + 4)];
bb.get(numeratorBytes);
bb.get(denominatorBytes);
return new Ratio... | public Object invoke(Object o) {
<DeepExtract>
ByteBuffer bb = ByteBuffer.wrap((byte[]) o);
int numeratorLength = Bytes.readFixedInt(bb);
byte[] numeratorBytes = new byte[numeratorLength];
byte[] denominatorBytes = new byte[(byte[]) o.length - (numeratorLength + 4)];
bb.get(numeratorBytes);
bb.get(denominatorBytes);
re... | dendrite | positive | 436,679 |
public PostAgentWithHttpInfoRequest withJcrContentSSL(String jcrContentSSL) {
this.jcrContentSSL = jcrContentSSL;
return this;
} | public PostAgentWithHttpInfoRequest withJcrContentSSL(String jcrContentSSL) {
<DeepExtract>
this.jcrContentSSL = jcrContentSSL;
</DeepExtract>
return this;
} | aem-orchestrator | positive | 436,680 |
@Test
public void readHumidity_throwsIfClosed() throws IOException {
Bmx280 bmx280 = new Bmx280(mI2c);
bmx280.setHasHumiditySensor(true);
bmx280.setTemperatureOversampling(Bmx280.OVERSAMPLING_1X);
bmx280.setHumidityOversampling(Bmx280.OVERSAMPLING_1X);
Bmx280 bmx280 = new Bmx280(mI2c);
bmx280.close();
Mockito.verify(mI... | @Test
public void readHumidity_throwsIfClosed() throws IOException {
Bmx280 bmx280 = new Bmx280(mI2c);
bmx280.setHasHumiditySensor(true);
bmx280.setTemperatureOversampling(Bmx280.OVERSAMPLING_1X);
bmx280.setHumidityOversampling(Bmx280.OVERSAMPLING_1X);
Bmx280 bmx280 = new Bmx280(mI2c);
bmx280.close();
Mockito.verify(mI... | contrib-drivers | positive | 436,681 |
public QueryBuilder SELECT_MIN(final String columnName) {
assertSQLIsEmpty();
if (columnName.trim().isEmpty()) {
switch(SelectType.MIN) {
case AVG:
getSql().append("SELECT AVG(");
break;
case COUNT:
getSql().append("SELECT COUNT(");
break;
case SUM:
getSql().append("SELECT SUM(");
break;
case MAX:
getSql().append("SELE... | public QueryBuilder SELECT_MIN(final String columnName) {
<DeepExtract>
assertSQLIsEmpty();
if (columnName.trim().isEmpty()) {
switch(SelectType.MIN) {
case AVG:
getSql().append("SELECT AVG(");
break;
case COUNT:
getSql().append("SELECT COUNT(");
break;
case SUM:
getSql().append("SELECT SUM(");
break;
case MAX:
getSql(... | JavaUltimateTools | positive | 436,682 |
@Test
public void when_deleting_service_from_existing_service_instance_which_not_exist_it_should_alway_return_service_instance() throws ServiceBrokerException {
when(repository.findOne(anyString())).thenReturn(null);
ServiceInstance serviceInstance = instanceService.deleteServiceInstance(deleteRequest);
assertThat(serv... | @Test
public void when_deleting_service_from_existing_service_instance_which_not_exist_it_should_alway_return_service_instance() throws ServiceBrokerException {
when(repository.findOne(anyString())).thenReturn(null);
ServiceInstance serviceInstance = instanceService.deleteServiceInstance(deleteRequest);
<DeepExtract>
a... | db-dumper-service | positive | 436,683 |
public void delete(ManagedObject object) {
changedObjects.objectDeleted(object, false);
if (object.isInserted()) {
unregisterObject(object);
} else {
registerObject(object);
}
objectsChangedSinceLastNotification.objectDeleted(object, true);
if (ObjectContextNotifier.hasListeners(this) && !messageHandler.hasMessages(NOT... | public void delete(ManagedObject object) {
changedObjects.objectDeleted(object, false);
if (object.isInserted()) {
unregisterObject(object);
} else {
registerObject(object);
}
objectsChangedSinceLastNotification.objectDeleted(object, true);
<DeepExtract>
if (ObjectContextNotifier.hasListeners(this) && !messageHandler.h... | NexusData | positive | 436,684 |
@Test
public void testArgumentDateEpochMinPlus2() throws Exception {
reparseSingleArgument(OSCTimeTag64.valueOf(new Date(OSCTimeTag64.EPOCH_START_JAVA_TIME_0 + 2)), EQUALS_COMPARATOR);
} | @Test
public void testArgumentDateEpochMinPlus2() throws Exception {
<DeepExtract>
reparseSingleArgument(OSCTimeTag64.valueOf(new Date(OSCTimeTag64.EPOCH_START_JAVA_TIME_0 + 2)), EQUALS_COMPARATOR);
</DeepExtract>
} | JavaOSC | positive | 436,685 |
@Override
public void process(final World world, final EntityPlayer player) {
EnvironState.player = player;
EnvironState.conditions = DimensionRegistry.getConditions(world) + getPlayerConditions(player);
EnvironState.playerBiome = PlayerUtils.getPlayerBiome(player, false);
EnvironState.biomeName = BiomeRegistry.resolve... | @Override
public void process(final World world, final EntityPlayer player) {
<DeepExtract>
EnvironState.player = player;
EnvironState.conditions = DimensionRegistry.getConditions(world) + getPlayerConditions(player);
EnvironState.playerBiome = PlayerUtils.getPlayerBiome(player, false);
EnvironState.biomeName = BiomeRe... | BetterRain | positive | 436,686 |
@Override
public void partVisible(IWorkbenchPartReference partRef) {
if (!VIEW_ID.equals(partRef.getId()))
return;
IViewSite site = super.getViewSite();
if (site == null)
return;
initializeActions(site);
if (testLifecycle != null) {
updateResult();
updateElapsedTime();
updateEndTime();
updateTestCount();
}
} | @Override
public void partVisible(IWorkbenchPartReference partRef) {
if (!VIEW_ID.equals(partRef.getId()))
return;
<DeepExtract>
IViewSite site = super.getViewSite();
if (site == null)
return;
initializeActions(site);
if (testLifecycle != null) {
updateResult();
updateElapsedTime();
updateEndTime();
updateTestCount();
... | makegood | positive | 436,689 |
public Criteria andBorrowerNumberIn(List<Long> values) {
if (values == null) {
throw new RuntimeException("Value for " + "borrowerNumber" + " cannot be null");
}
criteria.add(new Criterion("borrower_number in", values));
return (Criteria) this;
} | public Criteria andBorrowerNumberIn(List<Long> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "borrowerNumber" + " cannot be null");
}
criteria.add(new Criterion("borrower_number in", values));
</DeepExtract>
return (Criteria) this;
} | BookLibrarySystem | positive | 436,690 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_navigation);
unbinder = ButterKnife.bind(this);
setSupportActionBar(toolbar);
final ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
Actio... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_navigation);
unbinder = ButterKnife.bind(this);
setSupportActionBar(toolbar);
final ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
Actio... | beaconloc | positive | 436,691 |
public Criteria andIdmenzhenBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "idmenzhen" + " cannot be null");
}
criteria.add(new Criterion("idmenzhen between", value1, value2));
return (Criteria) this;
} | public Criteria andIdmenzhenBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "idmenzhen" + " cannot be null");
}
criteria.add(new Criterion("idmenzhen between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | ehealth_start | positive | 436,692 |
public static RunResult interleaveAtBreakpoint(final Runnable mainRunnable, final Runnable secondaryRunnable, ReusableBreakpoint breakpoint) {
MainRunnableImpl<Object> main = new MainRunnableImpl<Object>() {
@Override
public void run() {
mainRunnable.run();
}
};
SecondaryRunnableImpl<Object, MainRunnableImpl<Object>> s... | public static RunResult interleaveAtBreakpoint(final Runnable mainRunnable, final Runnable secondaryRunnable, ReusableBreakpoint breakpoint) {
MainRunnableImpl<Object> main = new MainRunnableImpl<Object>() {
@Override
public void run() {
mainRunnable.run();
}
};
SecondaryRunnableImpl<Object, MainRunnableImpl<Object>> s... | thread-weaver | positive | 436,693 |
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ArrayList<File> files = new ArrayList<File>();
files.add(file);
UploadTask uploadTask = new UploadTask(files, content);
uploadTask.execute();
dialogInterface.dismiss();
} | @Override
public void onClick(DialogInterface dialogInterface, int i) {
<DeepExtract>
ArrayList<File> files = new ArrayList<File>();
files.add(file);
UploadTask uploadTask = new UploadTask(files, content);
uploadTask.execute();
</DeepExtract>
dialogInterface.dismiss();
} | android | positive | 436,697 |
public Integer getMaxPendingPods() {
Integer maximumPendingPodsInt = !isBlank(this.maxPendingPods) ? Integer.valueOf(this.maxPendingPods) : null;
if (maximumPendingPodsInt instanceof String && isBlank(String.valueOf(maximumPendingPodsInt))) {
return 10;
}
if (maximumPendingPodsInt == null) {
return 10;
}
return maximum... | public Integer getMaxPendingPods() {
Integer maximumPendingPodsInt = !isBlank(this.maxPendingPods) ? Integer.valueOf(this.maxPendingPods) : null;
<DeepExtract>
if (maximumPendingPodsInt instanceof String && isBlank(String.valueOf(maximumPendingPodsInt))) {
return 10;
}
if (maximumPendingPodsInt == null) {
return 10;
}
... | kubernetes-elastic-agents | positive | 436,698 |
protected void setUpExtras() {
return mExtras;
if (mExtras == null) {
mExtras = new Bundle();
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (!mExtras.containsKey(RecognizerIntent.EXTRA_MAX_RESULTS)) {
mExtras.putInt(RecognizerIntent.EXTRA_MAX_RESULTS, prefs.getInt(getResources().ge... | protected void setUpExtras() {
return mExtras;
if (mExtras == null) {
mExtras = new Bundle();
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (!mExtras.containsKey(RecognizerIntent.EXTRA_MAX_RESULTS)) {
mExtras.putInt(RecognizerIntent.EXTRA_MAX_RESULTS, prefs.getInt(getResources().ge... | K6nele | positive | 436,700 |
@Test
public void testDelete() {
addSomeRecordsWithIssuer();
addSomeRecordsWithNullIssuer();
accountDb.delete(index("johndoe@gmail.com", null));
assertThat(accountDb.getAccounts()).hasSize(TEST_ACCOUNTS.length - 1);
assertThat(accountDb.indexExists(index("johndoe@gmail.com", null))).isFalse();
accountDb.add("johndoe@gm... | @Test
public void testDelete() {
<DeepExtract>
addSomeRecordsWithIssuer();
addSomeRecordsWithNullIssuer();
</DeepExtract>
accountDb.delete(index("johndoe@gmail.com", null));
assertThat(accountDb.getAccounts()).hasSize(TEST_ACCOUNTS.length - 1);
assertThat(accountDb.indexExists(index("johndoe@gmail.com", null))).isFalse... | google-authenticator-android | positive | 436,701 |
public static void main(String[] args) {
List<Double> list = Stream.generate(Math::random).limit(10).collect(Collectors.toList());
ImmutableList<Double> unmodifiableList = ImmutableList.copyOf(list);
unmodifiableList.add(1D);
System.out.println(list);
} | public static void main(String[] args) {
List<Double> list = Stream.generate(Math::random).limit(10).collect(Collectors.toList());
ImmutableList<Double> unmodifiableList = ImmutableList.copyOf(list);
<DeepExtract>
unmodifiableList.add(1D);
</DeepExtract>
System.out.println(list);
} | SimpleCase | positive | 436,702 |
public void run() {
final MirrorClient mirrorClient = new MirrorClient(this.mirrorAddress + ":" + this.mirrorPort);
try {
MirrorConsensusTopicQuery mirrorConsensusTopicQuery = new MirrorConsensusTopicQuery().setTopicId(topicId);
log.debug("App Subscribing to topic number " + this.topicId.toString() + " on mirror node: ... | public void run() {
<DeepExtract>
final MirrorClient mirrorClient = new MirrorClient(this.mirrorAddress + ":" + this.mirrorPort);
try {
MirrorConsensusTopicQuery mirrorConsensusTopicQuery = new MirrorConsensusTopicQuery().setTopicId(topicId);
log.debug("App Subscribing to topic number " + this.topicId.toString() + " on... | hedera-hcs-sxc-java | positive | 436,704 |
public static AjaxJson getByLine(int line) {
if (line > 0) {
return getSuccess("ok", line);
}
this.put("data", line);
return this;
} | public static AjaxJson getByLine(int line) {
if (line > 0) {
return getSuccess("ok", line);
}
<DeepExtract>
this.put("data", line);
return this;
</DeepExtract>
} | sa-plus | positive | 436,705 |
@Test
public void startWithComparisonValueIsLonger() {
BinaryContentAssertion assertion = new BinaryContentAssertion();
assertion.setComparisonType(BinaryContentAssertion.ComparisonType.StartsWith);
assertion.setComparisonValue("cafebabe00");
SampleResult sampleResult = mock(SampleResult.class);
when(sampleResult.getRe... | @Test
public void startWithComparisonValueIsLonger() {
BinaryContentAssertion assertion = new BinaryContentAssertion();
assertion.setComparisonType(BinaryContentAssertion.ComparisonType.StartsWith);
assertion.setComparisonValue("cafebabe00");
SampleResult sampleResult = mock(SampleResult.class);
when(sampleResult.getRe... | jmeter-websocket-samplers | positive | 436,706 |
private void typeBoldActionPerformed(java.awt.event.ActionEvent evt) {
String fType = (String) fontTypes.getSelectedItem();
int fSize = (Integer) fontSize.getValue();
Font font = new Font(fType, Font.PLAIN, fSize);
if (typeBold.isSelected() && !typeItalic.isSelected()) {
font = font.deriveFont(Font.BOLD);
} else if (!t... | private void typeBoldActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
String fType = (String) fontTypes.getSelectedItem();
int fSize = (Integer) fontSize.getValue();
Font font = new Font(fType, Font.PLAIN, fSize);
if (typeBold.isSelected() && !typeItalic.isSelected()) {
font = font.deriveFont(Font.BOLD);... | portugol | positive | 436,707 |
public void actionPerformed(ActionEvent ev) {
if (!maybeSaveCity()) {
return;
}
boolean timerEnabled = isTimerActive();
if (timerEnabled) {
stopTimer();
}
try {
JFileChooser fc = new JFileChooser();
FileNameExtensionFilter filter1 = new FileNameExtensionFilter(strings.getString("cty_file"), EXTENSION);
fc.setFileFilter... | public void actionPerformed(ActionEvent ev) {
<DeepExtract>
if (!maybeSaveCity()) {
return;
}
boolean timerEnabled = isTimerActive();
if (timerEnabled) {
stopTimer();
}
try {
JFileChooser fc = new JFileChooser();
FileNameExtensionFilter filter1 = new FileNameExtensionFilter(strings.getString("cty_file"), EXTENSION);
fc... | micropolis-java | positive | 436,709 |
@Override
public Long keyOf(V value) {
return keyOf(value);
} | @Override
public Long keyOf(V value) {
<DeepExtract>
return keyOf(value);
</DeepExtract>
} | velvetdb | positive | 436,711 |
@ExceptionHandler(OneRosterNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public MessageResponse oneRosterExceptionHandler(HttpServletRequest request, Exception e) {
MessageResponse response = new MessageResponse(HttpStatus.NOT_FOUND, buildDate(), request, e.getLocalizedMessage());
logException(e);
logE... | @ExceptionHandler(OneRosterNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public MessageResponse oneRosterExceptionHandler(HttpServletRequest request, Exception e) {
MessageResponse response = new MessageResponse(HttpStatus.NOT_FOUND, buildDate(), request, e.getLocalizedMessage());
<DeepExtract>
logExce... | OpenLRW | positive | 436,713 |
@Override
public void loadFile(File file, ImageView target, Options options) {
if (options == null)
options = Options.defaultOptions();
if (options.loadingResId != Options.RES_NONE) {
getRequestManager(target.getContext()).load(file).placeholder(options.loadingResId);
}
if (options.loadErrorResId != Options.RES_NONE) {... | @Override
public void loadFile(File file, ImageView target, Options options) {
<DeepExtract>
if (options == null)
options = Options.defaultOptions();
if (options.loadingResId != Options.RES_NONE) {
getRequestManager(target.getContext()).load(file).placeholder(options.loadingResId);
}
if (options.loadErrorResId != Optio... | QuickMvp | positive | 436,715 |
@Test
public void test10k() {
List<Profiler> profilerList = Lists.newArrayList();
profilerList.add(testSpringBeanUtils(2, "Spring BeanUtils"));
System.out.println("-------------------------------------");
System.out.println(String.format("| Create object number:%8d |", 2));
System.out.println("--------------------... | @Test
public void test10k() {
<DeepExtract>
List<Profiler> profilerList = Lists.newArrayList();
profilerList.add(testSpringBeanUtils(2, "Spring BeanUtils"));
System.out.println("-------------------------------------");
System.out.println(String.format("| Create object number:%8d |", 2));
System.out.println("------... | easy-mapper | positive | 436,717 |
@Test
public void termLevelTest() throws Exception {
Main.run("-c metadata-test-cases/metadata-term-level/config_example.properties".split(" "));
compareFiles("metadata-test-cases/metadata-term-level/target_metadata.nq", "./generated_metadata.nq", true);
cleanup("nquads");
} | @Test
public void termLevelTest() throws Exception {
Main.run("-c metadata-test-cases/metadata-term-level/config_example.properties".split(" "));
compareFiles("metadata-test-cases/metadata-term-level/target_metadata.nq", "./generated_metadata.nq", true);
<DeepExtract>
cleanup("nquads");
</DeepExtract>
} | rmlmapper-java | positive | 436,718 |
public void get(String url) {
Request request = new Request.Builder().method(GET, getRequestBody(true, null)).headers(Headers.of()).url(getBuilder(url, Parameters.of()).build()).build();
try (Response response = call(request, url)) {
try (ResponseBody responseBody = response.body()) {
if (null == responseBody) {
return... | public void get(String url) {
<DeepExtract>
Request request = new Request.Builder().method(GET, getRequestBody(true, null)).headers(Headers.of()).url(getBuilder(url, Parameters.of()).build()).build();
try (Response response = call(request, url)) {
try (ResponseBody responseBody = response.body()) {
if (null == response... | Doramon | positive | 436,722 |
public TreeNode buildTree2(int[] preorder, int[] inorder) {
if (0 > inorder.length - 1) {
return null;
}
int currentVal = preorder[0];
TreeNode current = new TreeNode(currentVal);
int inIndex = 0;
for (int i = 0; i <= inorder.length - 1; i++) {
if (inorder[i] == currentVal) {
inIndex = i;
}
}
TreeNode left = helper2(in... | public TreeNode buildTree2(int[] preorder, int[] inorder) {
<DeepExtract>
if (0 > inorder.length - 1) {
return null;
}
int currentVal = preorder[0];
TreeNode current = new TreeNode(currentVal);
int inIndex = 0;
for (int i = 0; i <= inorder.length - 1; i++) {
if (inorder[i] == currentVal) {
inIndex = i;
}
}
TreeNode lef... | DailySummary | positive | 436,723 |
private void loadJavaCode() {
BpmModel bpmModel = null;
try {
if (psiFile.getText().length() == 0) {
javaCode = "// Please draw bpm flow first, thanks!!!";
} else {
bpmModel = ModelConvertFactory.getModelXmlConvertExt(psiFile.getVirtualFile().getExtension()).toModel(psiFile.getText());
javaCode = ModelConvertFactory.ge... | private void loadJavaCode() {
BpmModel bpmModel = null;
try {
if (psiFile.getText().length() == 0) {
javaCode = "// Please draw bpm flow first, thanks!!!";
} else {
bpmModel = ModelConvertFactory.getModelXmlConvertExt(psiFile.getVirtualFile().getExtension()).toModel(psiFile.getText());
javaCode = ModelConvertFactory.ge... | compileflow-idea-designer | positive | 436,724 |
@Nonnull
@Override
public Iterator<Long2ObjectEntry<S>> iterator() {
if (0 <= 0) {
return new ZSetItr(zsl.header.directForward());
}
if (0 >= zsl.length()) {
return new ZSetItr(null);
}
return new ZSetItr(zsl.zslGetElementByRank(0 + 1));
} | @Nonnull
@Override
public Iterator<Long2ObjectEntry<S>> iterator() {
<DeepExtract>
if (0 <= 0) {
return new ZSetItr(zsl.header.directForward());
}
if (0 >= zsl.length()) {
return new ZSetItr(null);
}
return new ZSetItr(zsl.zslGetElementByRank(0 + 1));
</DeepExtract>
} | gamioo | positive | 436,725 |
public static <T> T entityMerge(T baseEntity, T complementEntity) {
final T copyEntity = ObjectUtils.deepCopy(baseEntity);
try {
List<Field> fields = getDeclaredFieldsContainParentWithoutStatic(complementEntity.getClass());
for (Field field : fields) {
field.setAccessible(true);
final Object val = field.get(complementE... | public static <T> T entityMerge(T baseEntity, T complementEntity) {
final T copyEntity = ObjectUtils.deepCopy(baseEntity);
<DeepExtract>
try {
List<Field> fields = getDeclaredFieldsContainParentWithoutStatic(complementEntity.getClass());
for (Field field : fields) {
field.setAccessible(true);
final Object val = field.g... | database-all | positive | 436,726 |
public static void compressImage(String savePath, String filepath, int quality, Display display) {
int scale = 1;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filepath, options);
if (options.outWidth > IMAGE_MAX_WIDTH || options.outHeight > IMA... | public static void compressImage(String savePath, String filepath, int quality, Display display) {
int scale = 1;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filepath, options);
if (options.outWidth > IMAGE_MAX_WIDTH || options.outHeight > IMA... | Pluto-Android | positive | 436,727 |
private void skipTestIfPluginDisabled(OptionalPluginTestDependency optionalPluginTestDependency) {
return Boolean.valueOf(System.getProperty(optionalPluginTestDependency.getBuildProperty(), "true"));
Assert.assertEquals(testEnabled, isPluginEnabled(optionalPluginTestDependency));
} | private void skipTestIfPluginDisabled(OptionalPluginTestDependency optionalPluginTestDependency) {
<DeepExtract>
return Boolean.valueOf(System.getProperty(optionalPluginTestDependency.getBuildProperty(), "true"));
</DeepExtract>
Assert.assertEquals(testEnabled, isPluginEnabled(optionalPluginTestDependency));
} | testme-idea | positive | 436,730 |
private void pauseDiscAnimatior(int index) {
ObjectAnimator objectAnimator = mDiscAnimators.get(index);
musicStatus = MusicStatus.PAUSE;
pauseAnimator();
mNeedleAnimator.reverse();
} | private void pauseDiscAnimatior(int index) {
ObjectAnimator objectAnimator = mDiscAnimators.get(index);
<DeepExtract>
musicStatus = MusicStatus.PAUSE;
pauseAnimator();
</DeepExtract>
mNeedleAnimator.reverse();
} | MusicPlayerdemo | positive | 436,731 |
@Override
public void tickleMemPool(Transaction tx, Collection<AddressSpecHash> involved) {
ChainHash utxo_root = new ChainHash(node.getBlockIngestor(0).getHead().getHeader().getUtxoRootHash());
synchronized (address_watchers) {
for (AddressSpecHash hash : involved) {
if (address_watchers.containsKey(hash)) {
LinkedLis... | @Override
public void tickleMemPool(Transaction tx, Collection<AddressSpecHash> involved) {
ChainHash utxo_root = new ChainHash(node.getBlockIngestor(0).getHead().getHeader().getUtxoRootHash());
<DeepExtract>
synchronized (address_watchers) {
for (AddressSpecHash hash : involved) {
if (address_watchers.containsKey(hash... | snowblossom | positive | 436,735 |
@Override
public final boolean beforeInputEvent(View rootView, InputEvent event) {
return false;
} | @Override
public final boolean beforeInputEvent(View rootView, InputEvent event) {
<DeepExtract>
return false;
</DeepExtract>
} | SwissArmyKnife | positive | 436,736 |
@Override
public void apply(ModelPropertyContext context) {
AnnotatedElement annotated = context.getAnnotatedElement().orNull();
if (annotated == null) {
return;
}
if (AnnotationUtils.findAnnotation(annotated, NotNull.class) != null) {
context.getBuilder().required(true);
} else if (AnnotationUtils.findAnnotation(annot... | @Override
public void apply(ModelPropertyContext context) {
AnnotatedElement annotated = context.getAnnotatedElement().orNull();
if (annotated == null) {
return;
}
if (AnnotationUtils.findAnnotation(annotated, NotNull.class) != null) {
context.getBuilder().required(true);
} else if (AnnotationUtils.findAnnotation(annot... | BlogManagePlatform | positive | 436,737 |
@Override
public String toLongString() {
return "where";
} | @Override
public String toLongString() {
<DeepExtract>
return "where";
</DeepExtract>
} | MathEngine | positive | 436,742 |
public Ssml breakWithMilliseconds(@NonNull Integer milliseconds) {
StringBuffer sb = new StringBuffer();
sb.append(openTag(TAG_BREAK, Collections.singletonMap("time", milliseconds + "ms"), true));
result.append(sb);
return this;
} | public Ssml breakWithMilliseconds(@NonNull Integer milliseconds) {
<DeepExtract>
StringBuffer sb = new StringBuffer();
sb.append(openTag(TAG_BREAK, Collections.singletonMap("time", milliseconds + "ms"), true));
result.append(sb);
return this;
</DeepExtract>
} | micronaut-aws | positive | 436,743 |
@Override
public void handleGunpowderAction(Snipe snipe) {
ToolkitProperties toolkitProperties = snipe.getToolkitProperties();
int size = toolkitProperties.getBrushSize();
for (int x = -size; x <= size; x++) {
for (int y = -size; y <= size; y++) {
for (int z = -size; z <= size; z++) {
Block block = getBlockAtRelativeTo... | @Override
public void handleGunpowderAction(Snipe snipe) {
<DeepExtract>
ToolkitProperties toolkitProperties = snipe.getToolkitProperties();
int size = toolkitProperties.getBrushSize();
for (int x = -size; x <= size; x++) {
for (int y = -size; y <= size; y++) {
for (int z = -size; z <= size; z++) {
Block block = getBlo... | FastAsyncVoxelSniper | positive | 436,744 |
public void onClick(DialogInterface dialog, int which) {
Log.d(LOGTAG, "Dialog finished, closing application");
removeDialog(DIALOG_CONNECTING);
Log.d(LOGTAG, "Cancelling connection thread");
if (_connectionThread != null) {
_connectionThread.interrupt();
_connectionThread = null;
}
getSqueezeDroidApplication().resetSe... | public void onClick(DialogInterface dialog, int which) {
Log.d(LOGTAG, "Dialog finished, closing application");
<DeepExtract>
removeDialog(DIALOG_CONNECTING);
Log.d(LOGTAG, "Cancelling connection thread");
if (_connectionThread != null) {
_connectionThread.interrupt();
_connectionThread = null;
}
</DeepExtract>
getSque... | squeezedroid | positive | 436,745 |
@Override
public void keyTyped(KeyEvent e) {
if (!isEditable() || !isEnabled()) {
return;
}
Integer factor = null;
boolean isDivision = false;
switch(e.getKeyChar()) {
case 'k':
factor = 1000;
break;
case 'K':
factor = 1000;
isDivision = true;
break;
case 'm':
factor = 1000000;
break;
case 'M':
factor = 1000000;
isDivi... | @Override
public void keyTyped(KeyEvent e) {
<DeepExtract>
if (!isEditable() || !isEnabled()) {
return;
}
Integer factor = null;
boolean isDivision = false;
switch(e.getKeyChar()) {
case 'k':
factor = 1000;
break;
case 'K':
factor = 1000;
isDivision = true;
break;
case 'm':
factor = 1000000;
break;
case 'M':
factor = 1... | DJ-Swing-Suite | positive | 436,747 |
public void onClick(View v) {
pop.dismiss();
ll_popup.clearAnimation();
} | public void onClick(View v) {
<DeepExtract>
</DeepExtract>
pop.dismiss();
<DeepExtract>
</DeepExtract>
ll_popup.clearAnimation();
<DeepExtract>
</DeepExtract>
} | ChouMediaPlayer | positive | 436,748 |
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
ModelPost instance = new ModelPost(repository, services);
instance.setServices(getServices());
String user = AuthenticationUtil.getFullyAuthenticatedUser();
printHeader(user, logger, req, true);
Timer timer = new Tim... | @Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
ModelPost instance = new ModelPost(repository, services);
instance.setServices(getServices());
<DeepExtract>
String user = AuthenticationUtil.getFullyAuthenticatedUser();
printHeader(user, logger, req, true);
Timer t... | mms-alfresco | positive | 436,750 |
@Before
public void setUp() {
ConfigurationManager configurationManager = newConfigurationManager();
KafkaMetaManager kafkaMetaManager = new DefaultKafkaMetaManager(configurationManager);
return new DefaultKafkaClientFactory(configurationManager, kafkaMetaManager);
} | @Before
public void setUp() {
<DeepExtract>
ConfigurationManager configurationManager = newConfigurationManager();
KafkaMetaManager kafkaMetaManager = new DefaultKafkaMetaManager(configurationManager);
return new DefaultKafkaClientFactory(configurationManager, kafkaMetaManager);
</DeepExtract>
} | kbear | positive | 436,751 |
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
if (matrix != null && viewHeight != 0 && viewWidth != 0) {
matrix.getValues(m);
prevMatrix.setValues(m);
prevMatchViewHeight = matchViewHeight;
prevMatchViewWidth = matchViewWidth;
prevViewHeight = viewHeight;
prevViewWidth = viewWidth;
}
Drawa... | @Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
if (matrix != null && viewHeight != 0 && viewWidth != 0) {
matrix.getValues(m);
prevMatrix.setValues(m);
prevMatchViewHeight = matchViewHeight;
prevMatchViewWidth = matchViewWidth;
prevViewHeight = viewHeight;
prevViewWidth = viewWidth;
}
<Deep... | Chimee | positive | 436,752 |
public boolean atEnd() {
if (context == null || context.getMatcher() == null)
throw new InvalidGrammarException("rule has an unwrapped action" + " expression");
return context.atEnd();
} | public boolean atEnd() {
<DeepExtract>
if (context == null || context.getMatcher() == null)
throw new InvalidGrammarException("rule has an unwrapped action" + " expression");
</DeepExtract>
return context.atEnd();
} | grappa | positive | 436,753 |
public void reclaimViews(List<View> views) {
int childCount = getChildCount();
RecyclerListener listener = mRecycler.mRecyclerListener;
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
PinterestAbsListView.LayoutParams lp = (PinterestAbsListView.LayoutParams) child.getLayoutParams();
if (lp != null &&... | public void reclaimViews(List<View> views) {
int childCount = getChildCount();
RecyclerListener listener = mRecycler.mRecyclerListener;
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
PinterestAbsListView.LayoutParams lp = (PinterestAbsListView.LayoutParams) child.getLayoutParams();
if (lp != null &&... | mshopping-android | positive | 436,755 |
public boolean scan(Position p) throws RegExpException {
V = new Vector();
boolean exclude = false;
K++;
while (!p.end() && p.get() != ']') {
if (p.get() == '^') {
exclude = true;
p.advance();
}
if (!exclude)
Any = false;
char a = getNext(p);
if (a == '[')
scanNamedRange(p, exclude);
else {
char b = a;
if (p.get() == '... | public boolean scan(Position p) throws RegExpException {
V = new Vector();
boolean exclude = false;
K++;
while (!p.end() && p.get() != ']') {
if (p.get() == '^') {
exclude = true;
p.advance();
}
if (!exclude)
Any = false;
char a = getNext(p);
if (a == '[')
scanNamedRange(p, exclude);
else {
char b = a;
if (p.get() == '... | DragonGoApp | positive | 436,756 |
@Test
public void testGatheringWritesPartialDirectPooledSliced() throws Exception {
CompositeByteBuf buf = releaseLater(compositeBuffer());
PooledByteBufAllocator.DEFAULT.directBuffer().order(order).writeBytes(new byte[] { 1, 2, 3, 4 });
PooledByteBufAllocator.DEFAULT.directBuffer().order(order).writeBytes(new byte[] {... | @Test
public void testGatheringWritesPartialDirectPooledSliced() throws Exception {
<DeepExtract>
CompositeByteBuf buf = releaseLater(compositeBuffer());
PooledByteBufAllocator.DEFAULT.directBuffer().order(order).writeBytes(new byte[] { 1, 2, 3, 4 });
PooledByteBufAllocator.DEFAULT.directBuffer().order(order).writeByte... | netty.book.kor | positive | 436,757 |
@Test
public void testTryWithBothExceptions() {
try {
StageSupport.tryWith(new ErrorCloseable(), errorAction).toCompletableFuture().join();
Assert.assertTrue("expected exception ", ActionException.class == null && CloseException.class == null);
} catch (final CompletionException e) {
Assert.assertNotNull("unexpected ex... | @Test
public void testTryWithBothExceptions() {
<DeepExtract>
try {
StageSupport.tryWith(new ErrorCloseable(), errorAction).toCompletableFuture().join();
Assert.assertTrue("expected exception ", ActionException.class == null && CloseException.class == null);
} catch (final CompletionException e) {
Assert.assertNotNull(... | java-async-util | positive | 436,758 |
public void SetDebugTextlog(Boolean to_txtFile) {
editor.putBoolean("TEXTLOG", to_txtFile);
editor.commit();
} | public void SetDebugTextlog(Boolean to_txtFile) {
editor.putBoolean("TEXTLOG", to_txtFile);
<DeepExtract>
editor.commit();
</DeepExtract>
} | domodroid | positive | 436,760 |
@Override
@Transactional(readOnly = true)
public List<ViewTransactionDTO> findOpenCustomerTransactions() throws DatabaseException {
CriteriaBuilder builder = em.getCriteriaBuilder();
try {
return em.createQuery(getTransactionQuery(builder, FindType.OPEN, CustomerType.CUSTOMER, null, null)).getResultList();
} catch (Exc... | @Override
@Transactional(readOnly = true)
public List<ViewTransactionDTO> findOpenCustomerTransactions() throws DatabaseException {
<DeepExtract>
CriteriaBuilder builder = em.getCriteriaBuilder();
try {
return em.createQuery(getTransactionQuery(builder, FindType.OPEN, CustomerType.CUSTOMER, null, null)).getResultList()... | BikeMan | positive | 436,761 |
void newPage() {
LineNum = 1;
if (LineNum == MSX.PageSize)
newPage();
System.out.println(String.format("\nPage %-3d EPANET-MSX 1.0", PageNum));
LineNum++;
if (LineNum == MSX.PageSize)
newPage();
System.out.println("");
LineNum++;
if (PageNum > 1)
writeTableHdr();
PageNum++;
} | void newPage() {
LineNum = 1;
if (LineNum == MSX.PageSize)
newPage();
System.out.println(String.format("\nPage %-3d EPANET-MSX 1.0", PageNum));
LineNum++;
<DeepExtract>
if (LineNum == MSX.PageSize)
newPage();
System.out.println("");
LineNum++;
</DeepExtract>
if (PageNum > 1)
... | Baseform-Epanet-Java-Library | positive | 436,762 |
public static void processDtmfRecognition(DtmfRecognition dtmfRecognition, Element formItemElement) throws VoiceXmlDocumentRenderingException {
if (dtmfRecognition == null)
return;
for (GrammarItem grammarItem : dtmfRecognition.getGrammarItems()) {
Element grammarElement;
if (grammarItem instanceof GrammarReference) {
... | public static void processDtmfRecognition(DtmfRecognition dtmfRecognition, Element formItemElement) throws VoiceXmlDocumentRenderingException {
if (dtmfRecognition == null)
return;
for (GrammarItem grammarItem : dtmfRecognition.getGrammarItems()) {
Element grammarElement;
if (grammarItem instanceof GrammarReference) {
... | rivr | positive | 436,763 |
public WriteCalibrationProtocol writeCalibration(byte[] coeff) {
WriteCalibrationProtocol writeCalibration = new WriteCalibrationProtocol(context, bluetoothDevice, dataManager);
writeCalibration.setCoeffToWrite(coeff);
oneOffProtocol = writeCalibration;
requestInterrupt();
return writeCalibration;
} | public WriteCalibrationProtocol writeCalibration(byte[] coeff) {
WriteCalibrationProtocol writeCalibration = new WriteCalibrationProtocol(context, bluetoothDevice, dataManager);
writeCalibration.setCoeffToWrite(coeff);
<DeepExtract>
oneOffProtocol = writeCalibration;
requestInterrupt();
</DeepExtract>
return writeCalib... | sexytopo | positive | 436,764 |
public final static byte[] encrypt(String key, String str) {
Blowfish bf1 = new Blowfish();
this.encrypting = true;
this.workingKey = key.getBytes();
setKey(this.workingKey);
return bf1.encrypt(str);
} | public final static byte[] encrypt(String key, String str) {
Blowfish bf1 = new Blowfish();
<DeepExtract>
this.encrypting = true;
this.workingKey = key.getBytes();
setKey(this.workingKey);
</DeepExtract>
return bf1.encrypt(str);
} | opslabJutil | positive | 436,765 |
public Optional<AmforeasResponse> query(String resource, String query, String... args) {
final NameValuePair[] nvps = Arrays.asList(args).stream().map(obj -> new BasicNameValuePair("args", obj)).collect(Collectors.toList()).toArray(new NameValuePair[] {});
final URI url = this.build(String.format(query_path, root, alia... | public Optional<AmforeasResponse> query(String resource, String query, String... args) {
final NameValuePair[] nvps = Arrays.asList(args).stream().map(obj -> new BasicNameValuePair("args", obj)).collect(Collectors.toList()).toArray(new NameValuePair[] {});
final URI url = this.build(String.format(query_path, root, alia... | amforeas | positive | 436,766 |
@Test
public void simpleTest() throws InitializationException {
Map<String, PropertyValue> dynamicProps = new ConcurrentHashMap<>();
dynamicProps.put("field", new MockPropertyValue("1.1"));
PutInfluxDB putInfluxDB = new PutInfluxDB();
putInfluxDB.dynamicFieldValues = dynamicProps;
TestRunner runner = TestRunners.newTes... | @Test
public void simpleTest() throws InitializationException {
Map<String, PropertyValue> dynamicProps = new ConcurrentHashMap<>();
dynamicProps.put("field", new MockPropertyValue("1.1"));
PutInfluxDB putInfluxDB = new PutInfluxDB();
putInfluxDB.dynamicFieldValues = dynamicProps;
TestRunner runner = TestRunners.newTes... | nifi-nar-bundles | positive | 436,767 |
protected String audio() {
String ac3 = "target/silence" + PATTERN_SECONDS + "s.ac3";
String log = "target/silence" + PATTERN_SECONDS + "s.log";
if (new File(ac3).exists())
return ac3;
var builder = new ProcessBuilder("ffmpeg", "-f", "s16le", "-ar", "48000", "-ac", "2", "-i", "pipe:0", ac3).redirectOutput(INHERIT).redi... | protected String audio() {
<DeepExtract>
String ac3 = "target/silence" + PATTERN_SECONDS + "s.ac3";
String log = "target/silence" + PATTERN_SECONDS + "s.log";
if (new File(ac3).exists())
return ac3;
var builder = new ProcessBuilder("ffmpeg", "-f", "s16le", "-ar", "48000", "-ac", "2", "-i", "pipe:0", ac3).redirectOutput... | testing-video | positive | 436,768 |
synchronized void txnComplete(boolean committed, long version) {
if (logger.isDebugEnabled())
logger.debug("Transaction " + version + " completed " + (committed ? "(committed)" : "(rolled back)"));
boolean wasActive = activeTxns.remove(version);
assert wasActive : "completed unknown transaction " + version + (committed... | synchronized void txnComplete(boolean committed, long version) {
if (logger.isDebugEnabled())
logger.debug("Transaction " + version + " completed " + (committed ? "(committed)" : "(rolled back)"));
boolean wasActive = activeTxns.remove(version);
assert wasActive : "completed unknown transaction " + version + (committed... | akubra | positive | 436,769 |
@Test
public void test4_13_4() throws Exception {
List<String> crls = new ArrayList<String>();
for (int i = 1; i < new String[] { "nameConstraintsDN1CACert", "nameConstraintsDN1CACRL" }.length; i++) crls.add(new String[] { "nameConstraintsDN1CACert", "nameConstraintsDN1CACRL" }[i]);
crls.add(TRUST_ANCHOR_ROOT_CRL);
nis... | @Test
public void test4_13_4() throws Exception {
<DeepExtract>
List<String> crls = new ArrayList<String>();
for (int i = 1; i < new String[] { "nameConstraintsDN1CACert", "nameConstraintsDN1CACRL" }.length; i++) crls.add(new String[] { "nameConstraintsDN1CACert", "nameConstraintsDN1CACRL" }[i]);
crls.add(TRUST_ANCHOR_... | canl-java | positive | 436,770 |
public void setHomepageElement(WebElement element) {
homepageElement = element;
checkHomepageLoaded = true;
} | public void setHomepageElement(WebElement element) {
homepageElement = element;
<DeepExtract>
checkHomepageLoaded = true;
</DeepExtract>
} | Ebselen | positive | 436,771 |
@Override
public KeyPair generateKeyPair(SecureRandom random) throws SchnorrkelException {
byte[] seed = new byte[32];
random.nextBytes(seed);
byte[] key = keypairFromSeed(seed);
if (key.length != KEYPAIR_LENGTH) {
throw new SchnorrkelException("Invalid key generated");
}
byte[] secretKey = new byte[SECRET_KEY_LENGTH];... | @Override
public KeyPair generateKeyPair(SecureRandom random) throws SchnorrkelException {
byte[] seed = new byte[32];
random.nextBytes(seed);
byte[] key = keypairFromSeed(seed);
<DeepExtract>
if (key.length != KEYPAIR_LENGTH) {
throw new SchnorrkelException("Invalid key generated");
}
byte[] secretKey = new byte[SECRE... | polkaj | positive | 436,772 |
public void guiTextBoxAction(String textBoxString) {
if (textBoxString == null || textBoxString.equals("")) {
return;
}
try {
FileConnection fileConnection = (FileConnection) Connector.open(selectedWorld.getWorldPath(), Connector.READ_WRITE);
fileConnection.rename(textBoxString);
fileConnection.close();
} catch (IOExce... | public void guiTextBoxAction(String textBoxString) {
<DeepExtract>
if (textBoxString == null || textBoxString.equals("")) {
return;
}
try {
FileConnection fileConnection = (FileConnection) Connector.open(selectedWorld.getWorldPath(), Connector.READ_WRITE);
fileConnection.rename(textBoxString);
fileConnection.close();
}... | Comcraft | positive | 436,773 |
public Criteria andBz271Between(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bz271" + " cannot be null");
}
criteria.add(new Criterion("`bz271` between", value1, value2));
return (Criteria) this;
} | public Criteria andBz271Between(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bz271" + " cannot be null");
}
criteria.add(new Criterion("`bz271` between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | blockhealth | positive | 436,774 |
private void updateLayout() {
final LayoutInflater inflater = LayoutInflater.from(this);
setContentView(inflater.inflate(R.layout.alarm_alert, null));
final Button snooze = (Button) findViewById(R.id.snooze);
snooze.requestFocus();
snooze.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(f... | private void updateLayout() {
final LayoutInflater inflater = LayoutInflater.from(this);
setContentView(inflater.inflate(R.layout.alarm_alert, null));
final Button snooze = (Button) findViewById(R.id.snooze);
snooze.requestFocus();
snooze.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(f... | ElectricSleep | positive | 436,777 |
private void successful() {
if (_acceptableTransitions.get(_currentState).contains(State.EXIT)) {
Leader._logger.debug(Leader.this.toString() + " " + _currentState + " -> " + State.EXIT);
_currentState = State.EXIT;
} else {
throw new Error("Illegal state transition " + _currentState + ", " + State.EXIT + " -> " + _acc... | private void successful() {
if (_acceptableTransitions.get(_currentState).contains(State.EXIT)) {
Leader._logger.debug(Leader.this.toString() + " " + _currentState + " -> " + State.EXIT);
_currentState = State.EXIT;
} else {
throw new Error("Illegal state transition " + _currentState + ", " + State.EXIT + " -> " + _acc... | paxos | positive | 436,778 |
@Test
public void removeMenuItem() throws Exception {
final int testId = 1;
Collection<MenuItem> menuItems;
assertNotNull(menuService.getMenuItems());
final int initialSize = menuItems.size();
assertTrue(initialSize >= 1);
final MenuItem origMenuItem = menuService.getMenuItem(testId);
assertNotNull(origMenuItem);
menuS... | @Test
public void removeMenuItem() throws Exception {
final int testId = 1;
Collection<MenuItem> menuItems;
assertNotNull(menuService.getMenuItems());
final int initialSize = menuItems.size();
assertTrue(initialSize >= 1);
final MenuItem origMenuItem = menuService.getMenuItem(testId);
assertNotNull(origMenuItem);
menuS... | camel-cookbook-examples | positive | 436,781 |
public void setFButtonPadding(int left, int top, int right, int bottom) {
mPaddingLeft = left;
mPaddingRight = right;
mPaddingTop = top;
mPaddingBottom = bottom;
int alpha = Color.alpha(mButtonColor);
float[] hsv = new float[3];
Color.colorToHSV(mButtonColor, hsv);
hsv[2] *= 0.8f;
if (!isShadowColorDefined) {
mShadowCo... | public void setFButtonPadding(int left, int top, int right, int bottom) {
mPaddingLeft = left;
mPaddingRight = right;
mPaddingTop = top;
mPaddingBottom = bottom;
<DeepExtract>
int alpha = Color.alpha(mButtonColor);
float[] hsv = new float[3];
Color.colorToHSV(mButtonColor, hsv);
hsv[2] *= 0.8f;
if (!isShadowColorDefine... | Trivia-Knowledge | positive | 436,782 |
public void clearCountersAndDiagnosticRegister() {
this.busMessageCount = 0;
this.eventCount = 0;
this.characterOverrunCount = 0;
this.communicationErrorCount = 0;
this.exceptionErrorCount = 0;
this.slaveNoResponseCount = 0;
this.slaveBusyCount = 0;
this.slaveMessageCount = 0;
this.slaveNAKCount = 0;
} | public void clearCountersAndDiagnosticRegister() {
this.busMessageCount = 0;
this.eventCount = 0;
this.characterOverrunCount = 0;
this.communicationErrorCount = 0;
this.exceptionErrorCount = 0;
this.slaveNoResponseCount = 0;
this.slaveBusyCount = 0;
this.slaveMessageCount = 0;
<DeepExtract>
this.slaveNAKCount = 0;
</De... | Androidmodbusrtu | positive | 436,783 |
private void writeAttribute(Map.Entry<String, String> attribute) throws XMLStreamException {
XmlName name;
String[] parts = attribute.getKey().split(":", 2);
if (parts.length == 1) {
name = new XmlName(namespaces.defaultNamespace().get(), parts[0]);
} else {
String prefix = parts[0];
String localName = parts[1];
Namesp... | private void writeAttribute(Map.Entry<String, String> attribute) throws XMLStreamException {
<DeepExtract>
XmlName name;
String[] parts = attribute.getKey().split(":", 2);
if (parts.length == 1) {
name = new XmlName(namespaces.defaultNamespace().get(), parts[0]);
} else {
String prefix = parts[0];
String localName = pa... | java-mammoth | positive | 436,784 |
@Override
public void doStop() {
this.threadPoolExecutor.shutdown();
} | @Override
public void doStop() {
<DeepExtract>
this.threadPoolExecutor.shutdown();
</DeepExtract>
} | httpproxy | positive | 436,786 |
public String getSelectStatement(Class<?> persistentObjectClass) {
String statement = selectStatements.get(persistentObjectClass);
if (statement != null) {
return statement;
}
statement = "select" + persistentObjectClass.getSimpleName();
;
statement = statement.substring(0, statement.length() - 6);
selectStatements.put... | public String getSelectStatement(Class<?> persistentObjectClass) {
<DeepExtract>
String statement = selectStatements.get(persistentObjectClass);
if (statement != null) {
return statement;
}
statement = "select" + persistentObjectClass.getSimpleName();
;
statement = statement.substring(0, statement.length() - 6);
select... | activiti-crystalball | positive | 436,787 |
public boolean save(String username, String password, boolean isEnabled, String addr, int[] roleIds) {
User user = new User();
user.setCreateDate(Times.now());
user.setDescription("--");
user.setLocked(!isEnabled);
user.setName(username);
user.setRegisterIp(addr);
user.setSex("man");
user.setRoles(dao().query(Role.clas... | public boolean save(String username, String password, boolean isEnabled, String addr, int[] roleIds) {
User user = new User();
user.setCreateDate(Times.now());
user.setDescription("--");
user.setLocked(!isEnabled);
user.setName(username);
user.setRegisterIp(addr);
user.setSex("man");
user.setRoles(dao().query(Role.clas... | Rk_Cms | positive | 436,789 |
public void write(org.apache.thrift.protocol.TProtocol oprot, get_result struct) throws org.apache.thrift.TException {
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeSt... | public void write(org.apache.thrift.protocol.TProtocol oprot, get_result struct) throws org.apache.thrift.TException {
<DeepExtract>
</DeepExtract>
oprot.writeStructBegin(STRUCT_DESC);
<DeepExtract>
</DeepExtract>
if (struct.success != null) {
<DeepExtract>
</DeepExtract>
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
<Dee... | thrift-rpc | positive | 436,790 |
@Nonnull
@Override
public synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects) throws ApiException {
logger.entry(sObjects);
Create createParam = new Create();
List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = createParam.getSObjects();
for (SObject sObj : sObjects) {
try {
st... | @Nonnull
@Override
public synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects) throws ApiException {
logger.entry(sObjects);
Create createParam = new Create();
List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = createParam.getSObjects();
<DeepExtract>
for (SObject sObj : sObjec... | sf-api-connector | positive | 436,791 |
public void actionPerformed(ActionEvent actionevent) {
textArea.setText(Toolkit.formatAIML("<think>" + templatePane.getText() + "</think>"));
textArea.setCaretPosition(0);
} | public void actionPerformed(ActionEvent actionevent) {
<DeepExtract>
textArea.setText(Toolkit.formatAIML("<think>" + templatePane.getText() + "</think>"));
textArea.setCaretPosition(0);
</DeepExtract>
} | charliebot | positive | 436,794 |
public synchronized void encrypt(byte[] src, int srcOff, byte[] dest, int destOff, int len) {
des1.encrypt(src, srcOff, dest, destOff, len);
des3.decrypt(dest, destOff, dest, destOff, len);
des2.encrypt(dest, destOff, dest, destOff, len);
des1.decrypt(dest, destOff, dest, destOff, len);
des3.encrypt(dest, destOff, dest... | public synchronized void encrypt(byte[] src, int srcOff, byte[] dest, int destOff, int len) {
des1.encrypt(src, srcOff, dest, destOff, len);
<DeepExtract>
des3.decrypt(dest, destOff, dest, destOff, len);
des2.encrypt(dest, destOff, dest, destOff, len);
des1.decrypt(dest, destOff, dest, destOff, len);
</DeepExtract>
des... | jta | positive | 436,795 |
public void reloadCountries() {
countryMap = new HashMap<String, GenericObject>(100);
for (GenericObject obj : root.children) {
if (tagPattern.matcher(obj.name).matches()) {
countryMap.put(obj.name, obj);
}
}
} | public void reloadCountries() {
<DeepExtract>
countryMap = new HashMap<String, GenericObject>(100);
for (GenericObject obj : root.children) {
if (tagPattern.matcher(obj.name).matches()) {
countryMap.put(obj.name, obj);
}
}
</DeepExtract>
} | vic2_economy_analyzer | positive | 436,796 |
private float g(int xp, int yp, int zp, int n) {
float z = zp + df.u(xp, yp, zp, 0);
float y = yp + df.u(xp, yp, zp, 1);
float x = xp + df.u(xp, yp, zp, 2);
int xl = (int) x;
int yl = (int) y;
int zl = (int) z;
float dx = x - ((int) x) / level;
float dy = y - ((int) y) / level;
float dz = z - ((int) z) / level;
float i... | private float g(int xp, int yp, int zp, int n) {
float z = zp + df.u(xp, yp, zp, 0);
float y = yp + df.u(xp, yp, zp, 1);
float x = xp + df.u(xp, yp, zp, 2);
int xl = (int) x;
int yl = (int) y;
int zl = (int) z;
<DeepExtract>
float dx = x - ((int) x) / level;
float dy = y - ((int) y) / level;
float dz = z - ((int) z) / ... | VIB | positive | 436,797 |
public Token nextToken() {
if (this.tokens == null) {
fillTokens();
this.currentTokenIndex = 0;
}
if (currentTokenIndex < tokens.size()) {
currentToken = tokens.get(currentTokenIndex++);
} else {
currentToken = null;
}
return currentToken;
} | public Token nextToken() {
<DeepExtract>
if (this.tokens == null) {
fillTokens();
this.currentTokenIndex = 0;
}
</DeepExtract>
if (currentTokenIndex < tokens.size()) {
currentToken = tokens.get(currentTokenIndex++);
} else {
currentToken = null;
}
return currentToken;
} | jmte | positive | 436,798 |
public String getMessage() {
StringBuffer buf = new StringBuffer(allErrors.size() + " error(s): ");
Iterator i = getErrors().iterator();
while (i.hasNext()) {
SyntaxError temp = (SyntaxError) i.next();
buf.append(temp.getDescription());
buf.append(" at " + temp.getLineNumber());
if (i.hasNext())
buf.append("; ");
}
ret... | public String getMessage() {
StringBuffer buf = new StringBuffer(allErrors.size() + " error(s): ");
Iterator i = getErrors().iterator();
while (i.hasNext()) {
SyntaxError temp = (SyntaxError) i.next();
buf.append(temp.getDescription());
buf.append(" at " + temp.getLineNumber());
if (i.hasNext())
buf.append("; ");
}
<De... | sleep | positive | 436,799 |
@Override
public void init() {
super.init();
} | @Override
<DeepExtract>
</DeepExtract>
public void init() {
<DeepExtract>
</DeepExtract>
super.init();
<DeepExtract>
</DeepExtract>
} | FactionsPlus | positive | 436,800 |
public void initialize() throws Exception {
if (languagePair == null)
throw new Exception("Langauage pair must be set before calling initialize");
if (properties == null) {
properties = Properties.loadFromClassName(this.getClass().getName());
properties = properties.mapProperties().get(languagePair.getFirst() + "_" + l... | public void initialize() throws Exception {
if (languagePair == null)
throw new Exception("Langauage pair must be set before calling initialize");
if (properties == null) {
properties = Properties.loadFromClassName(this.getClass().getName());
properties = properties.mapProperties().get(languagePair.getFirst() + "_" + l... | OpenEphyra | positive | 436,802 |
public void setValue1(String value1) {
this.value1 = value1;
if (DATA_FILE.exists()) {
if (!DATA_FILE.delete()) {
throw new RuntimeException("Cannot delete datafile " + DATA_FILE.getAbsolutePath());
}
}
try {
if (!DATA_FILE.createNewFile()) {
throw new RuntimeException("Cannot create datafile " + DATA_FILE.getAbsoluteP... | public void setValue1(String value1) {
this.value1 = value1;
<DeepExtract>
if (DATA_FILE.exists()) {
if (!DATA_FILE.delete()) {
throw new RuntimeException("Cannot delete datafile " + DATA_FILE.getAbsolutePath());
}
}
try {
if (!DATA_FILE.createNewFile()) {
throw new RuntimeException("Cannot create datafile " + DATA_FIL... | s4 | positive | 436,804 |
public void setTextColorResource(int resId) {
this.tabTextColor = getResources().getColor(resId);
for (int i = 0; i < tabCount; i++) {
FrameLayout frameLayout = (FrameLayout) tabsContainer.getChildAt(i);
frameLayout.setBackgroundResource(tabBackgroundResId);
for (int j = 0; j < frameLayout.getChildCount(); j++) {
View ... | public void setTextColorResource(int resId) {
this.tabTextColor = getResources().getColor(resId);
<DeepExtract>
for (int i = 0; i < tabCount; i++) {
FrameLayout frameLayout = (FrameLayout) tabsContainer.getChildAt(i);
frameLayout.setBackgroundResource(tabBackgroundResId);
for (int j = 0; j < frameLayout.getChildCount()... | EduBao | positive | 436,806 |
public static void notEnoughArguments() {
if (canSend(MsgPriority.SYNTAXERRORS))
msg("" + ChatColor.RED + ChatColor.RED + "Not enough arguments!");
} | public static void notEnoughArguments() {
<DeepExtract>
if (canSend(MsgPriority.SYNTAXERRORS))
msg("" + ChatColor.RED + ChatColor.RED + "Not enough arguments!");
</DeepExtract>
} | java-csgo-externals | positive | 436,807 |
private void addOpcode(int opcode) {
if (codeLength >= code.length) {
int[] tmp = new int[code.length << 1];
System.arraycopy(code, 0, tmp, 0, code.length);
code = tmp;
}
code[codeLength++] = opcode;
} | private void addOpcode(int opcode) {
<DeepExtract>
if (codeLength >= code.length) {
int[] tmp = new int[code.length << 1];
System.arraycopy(code, 0, tmp, 0, code.length);
code = tmp;
}
code[codeLength++] = opcode;
</DeepExtract>
} | joni | positive | 436,808 |
public static String encodeHost(String host) {
if (host == null) {
return null;
}
byte[] bytes;
try {
bytes = encodeBytes(host.getBytes(Opslab.UTF_8), URIPart.HOST);
} catch (UnsupportedEncodingException ignore) {
return null;
}
char[] chars = new char[bytes.length];
for (int i = 0; i < bytes.length; i++) {
chars[i] = ... | public static String encodeHost(String host) {
<DeepExtract>
if (host == null) {
return null;
}
byte[] bytes;
try {
bytes = encodeBytes(host.getBytes(Opslab.UTF_8), URIPart.HOST);
} catch (UnsupportedEncodingException ignore) {
return null;
}
char[] chars = new char[bytes.length];
for (int i = 0; i < bytes.length; i++)... | opslabJutil | positive | 436,810 |
RestApiRequest<List<SymbolPrice>> getSymbolPriceTicker(String symbol) {
RestApiRequest<List<SymbolPrice>> request = new RestApiRequest<>();
UrlParamsBuilder builder = UrlParamsBuilder.build().putToUrl("symbol", symbol);
System.out.println(serverUrl);
return createRequestByGet(serverUrl, "/fapi/v1/ticker/price", builder... | RestApiRequest<List<SymbolPrice>> getSymbolPriceTicker(String symbol) {
RestApiRequest<List<SymbolPrice>> request = new RestApiRequest<>();
UrlParamsBuilder builder = UrlParamsBuilder.build().putToUrl("symbol", symbol);
<DeepExtract>
System.out.println(serverUrl);
return createRequestByGet(serverUrl, "/fapi/v1/ticker/p... | Binance_Futures_Java | positive | 436,812 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.