id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
4,701
package wew.water.gpf; public class NeuralNetworkComputer { <BUG>public static void compute(float[] in, float[] out, int mask, int errMask, float a, </BUG> double[][] input_scale_limits, double[] input_scale_offset_factors, int[] input_scale_flag,
public static int compute(float[] in, float[] out, int[] rangeCheckErrorMasks,
4,702
package wew.water.gpf; <BUG>public class AtmosphericCorrectionNetworkOperation implements NeuralNetworkOperation { @Override public void compute(float[] in, float[] out, int mask, int errMask, float a) { if(in.length != getNumberOfInputNodes()) { </BUG> throw new IllegalArgumentException("Wrong input array size");
import java.util.Arrays; public class AtmosphericCorrectionNetworkOperation { public static int compute(float[] in, float[] out) { if (in.length != getNumberOfInputNodes()) {
4,703
private static String txnIdToString(long txnId) { if (txnId == Long.MIN_VALUE) { return "UNUSED"; } <BUG>else { return "(" + (TxnEgo.getSequence(txnId) - TxnEgo.SEQUENCE_ZERO) + ":" + TxnEgo.getPartitionId(txnId) + ")";</BUG> } }
return TxnEgo.txnIdToString(txnId);
4,704
for (Iv2RepairLogResponseMessage li : m_repairLogUnion) { List<Long> needsRepair = new ArrayList<Long>(5); for (Entry<Long, ReplicaRepairStruct> entry : m_replicaRepairStructs.entrySet()) { if (entry.getValue().needs(li.getTxnId())) { ++queued; <BUG>tmLog.debug(m_whoami + "repairing " + entry.getKey() + ". Max seen " + entry.getValue().m_maxHandleCompleted + ". Repairing with " + li.getTxnId()); needsRepair.add(entry.getKey());</BUG> }
tmLog.debug(m_whoami + "repairing " + CoreUtils.hsIdToString(entry.getKey()) + TxnEgo.txnIdToString(entry.getValue().m_maxHandleCompleted) + TxnEgo.txnIdToString(li.getTxnId())); needsRepair.add(entry.getKey());
4,705
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
4,706
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
4,707
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
4,708
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
4,709
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
4,710
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
4,711
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
4,712
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
4,713
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
4,714
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
4,715
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
4,716
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
4,717
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
4,718
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
4,719
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
4,720
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
4,721
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
4,722
String command = null; String result = null; Socket socket; while (continueListenning() && (socket = getSocket()) != null) { try { <BUG>time = System.currentTimeMillis(); try {</BUG> InputStream inputStream = socket.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
InetAddress ipAddress = socket.getInetAddress();
4,723
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); command = bufferedReader.readLine(); if (command == null) { command = "DISCONNECTED"; <BUG>} else { result = AdministrationTCP.this.processCommand(command); </BUG> OutputStream outputStream = socket.getOutputStream(); outputStream.write(result.getBytes("ISO-8859-1"));
Client client = Client.get(ipAddress); User user = client == null ? null : client.getUser(); result = AdministrationTCP.this.processCommand(user, command);
4,724
} catch (SocketException ex) { Server.logDebug("interrupted " + getName() + " connection."); result = "INTERRUPTED\n"; } finally { socket.close(); <BUG>InetAddress address = socket.getInetAddress(); </BUG> clearSocket(); Server.logAdministration( time,
InetAddress address = ipAddress;
4,725
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.util.DataStoreUtils; import de.vanita5.twittnuker.util.ImagePreloader;</BUG> import de.vanita5.twittnuker.util.InternalTwitterContentUtils; import de.vanita5.twittnuker.util.JsonSerializer; import de.vanita5.twittnuker.util.NotificationManagerWrapper;
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
4,726
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
4,727
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
4,728
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
4,729
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
4,730
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
4,731
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
4,732
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
4,733
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
4,734
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWrapper mPreferences;
public class TwidereDns implements Dns, Constants {
4,735
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
4,736
import org.jetbrains.mps.openapi.language.SAbstractConcept; import org.jetbrains.mps.openapi.language.SConcept; import org.jetbrains.mps.openapi.language.SContainmentLink; import org.jetbrains.mps.openapi.language.SLanguage; import org.jetbrains.mps.openapi.language.SProperty; <BUG>import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.model.SNode;</BUG> import org.jetbrains.mps.openapi.model.SNodeAccessUtil; public class MetaAdapterByDeclaration { private static final Logger LOG = Logger.wrap(LogManager.getLogger(MetaAdapterByDeclaration.class));
import org.jetbrains.mps.openapi.model.SModel; import org.jetbrains.mps.openapi.model.SNode;
4,737
} public static SAbstractConcept getConcept(SNode node) { SConcept concept = node.getConcept(); boolean cd = concept.equals(SNodeUtil.concept_ConceptDeclaration); boolean icd = concept.equals(SNodeUtil.concept_InterfaceConceptDeclaration); <BUG>if (cd || icd) { String name = NameUtil.getModelLongName(node.getModel()) + "." + getNormalizedName(node); </BUG> if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name);
if (!cd && !icd) return null; SModel model = node.getModel(); if (model == null) return null; if (!(model.getModule() instanceof Language)) return null; String name = NameUtil.getModelLongName(model) + "." + getNormalizedName(node);
4,738
if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name); } else { return MetaAdapterFactory.getInterfaceConcept(MetaIdByDeclaration.getConceptId(node), name); } <BUG>} return null;</BUG> } public static SConcept getInstanceConcept(SNode c) { return asInstanceConcept(getConcept(c));
[DELETED]
4,739
if(log.isDebugEnabled()) log.debug("getPrice called"); String uri = "beta/prices"; if (request.getMasterTariffId() != null) { uri += "/" + request.getMasterTariffId(); } <BUG>@SuppressWarnings("unchecked") Response<Price> response = (Response<Price>) this.callGet( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Price>>() { });
Response<Price> response = this.callGet( uri,
4,740
if(log.isDebugEnabled()) log.debug("getLse called"); String uri = "public/lses"; if (request.getLseId() != null) { uri += "/" + request.getLseId(); } <BUG>@SuppressWarnings("unchecked") Response<Lse> response = (Response<Lse>) this.callGet( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Lse>>() { });
Response<Lse> response = this.callGet( uri,
4,741
if(log.isDebugEnabled()) log.debug("getLse completed"); return response; } public Response<Lse> getLses(GetLsesRequest request) { if(log.isDebugEnabled()) log.debug("getLses called"); <BUG>@SuppressWarnings("unchecked") Response<Lse> response = (Response<Lse>) this.callGet( "public/lses",</BUG> request.getQueryParams(), new TypeReference<Response<Lse>>() { });
Response<Lse> response = this.callGet( "public/lses",
4,742
this.appKey = appKey; } public void setMapper(ObjectMapper mapper) { this.mapper = mapper; } <BUG>protected Response<?> callGet(String endpointPath, List<NameValuePair> queryParams, TypeReference<?> resultTypeReference) { Response<?> restResponse = null; </BUG> try {
protected <T extends Response<R>, R> T callGet(String endpointPath, List<NameValuePair> queryParams, TypeReference<T> resultTypeReference) { T restResponse = null;
4,743
} catch (IOException e) { log.error("IOException",e); } return restResponse; } // end of callGet <BUG>protected Response<?> callPost(String endpointPath, final Object requestPayload, TypeReference<?> resultTypeReference) { Response<?> restResponse = null; </BUG> try {
protected <T extends Response<R>, R> T callPost(String endpointPath, final Object requestPayload, TypeReference<T> resultTypeReference) { T restResponse = null;
4,744
} catch (IOException e) { log.error("IOException",e); } return restResponse; } // end of callPost <BUG>public Response<?> callFileUpload(String endpointPath, BulkUploadRequest request, TypeReference<?> resultTypeReference) { Response<?> restResponse = null; </BUG> String url = restApiServer + endpointPath; // + "?" + this.getQueryStringCredentials(); // if you prefer to pass creds on query string
} // end of callGet protected <T extends Response<R>, R> T callPost(String endpointPath, final Object requestPayload, TypeReference<T> resultTypeReference) { T restResponse = null; try { DefaultHttpClient httpClient = new DefaultHttpClient();
4,745
} finally { httpclient.getConnectionManager().shutdown(); } return restResponse; } <BUG>protected Response<?> callDelete(String endpointPath, List<NameValuePair> queryParams, TypeReference<?> resultTypeReference) { Response<?> restResponse = null; </BUG> try {
protected <T extends Response<R>, R> T callDelete(String endpointPath, List<NameValuePair> queryParams, TypeReference<T> resultTypeReference) { T restResponse = null;
4,746
import com.genability.client.types.Response; public class BulkUploadService extends BaseService { public Response<String> uploadFile(BulkUploadRequest request) { if(log.isDebugEnabled()) log.debug("uploadFile called"); String uri = "beta/loader/bulk/up"; <BUG>@SuppressWarnings("unchecked") Response<String> response = (Response<String>) this.callFileUpload(uri, request, new TypeReference<Response<String>>() { }); if(log.isDebugEnabled()) log.debug("uploadFile completed");</BUG> return response; }
Response<String> response = this.callFileUpload(uri, request, new TypeReference<Response<String>>() { }); if(log.isDebugEnabled()) log.debug("uploadFile completed");
4,747
import com.genability.client.types.Response; import com.genability.client.types.Tariff; public class TariffService extends BaseService { public Response<Tariff> getTariffs(GetTariffsRequest request) { if(log.isDebugEnabled()) log.debug("getTariffs called"); <BUG>@SuppressWarnings("unchecked") Response<Tariff> response = (Response<Tariff>) this.callGet( "public/tariffs",</BUG> request.getQueryParams(), new TypeReference<Response<Tariff>>() { });
Response<Tariff> response = this.callGet( "public/tariffs",
4,748
if(log.isDebugEnabled()) log.debug("getTariffs completed"); return response; } public Response<Tariff> getTariff(GetTariffRequest request) { if(log.isDebugEnabled()) log.debug("getTariff called"); <BUG>@SuppressWarnings("unchecked") Response<Tariff> response = (Response<Tariff>) this.callGet( "public/tariffs",</BUG> request.getQueryParams(), new TypeReference<Response<Tariff>>() { });
Response<Tariff> response = this.callGet( "public/tariffs",
4,749
} else if (request.getMasterTariffId() != null) { uri += "/" + request.getMasterTariffId(); request.setMasterTariffId(null); } else { } <BUG>@SuppressWarnings("unchecked") Response<CalculatedCost> response = (Response<CalculatedCost>) this.callPost( uri,</BUG> request, new TypeReference<Response<CalculatedCost>>() { });
Response<CalculatedCost> response = this.callPost( uri,
4,750
if(log.isDebugEnabled()) log.debug("getProfile called"); String uri = "beta/usage/profiles"; if (request.getUsageProfileId() != null && request.getUsageProfileId().length() !=0) { uri += "/" + request.getUsageProfileId(); } <BUG>@SuppressWarnings("unchecked") Response<Profile> response = (Response<Profile>) this.callGet( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Profile>>() { });
Response<Profile> response = this.callGet( uri,
4,751
return response; } public Response<Profile> getProfiles(GetProfilesRequest request) { if(log.isDebugEnabled()) log.debug("getProfiles called"); String uri = "beta/usage/profiles"; <BUG>@SuppressWarnings("unchecked") Response<Profile> response = (Response<Profile>) this.callGet( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Profile>>() { });
Response<Profile> response = this.callGet( uri,
4,752
if(log.isDebugEnabled()) log.debug("getProfiles completed"); return response; } public Response<Profile> addProfile(Profile profile) { if(log.isDebugEnabled()) log.debug("addProfile called"); <BUG>@SuppressWarnings("unchecked") Response<Profile> response = (Response<Profile>) this.callPost( "beta/usage/profiles",</BUG> profile, new TypeReference<Response<Profile>>() { });
Response<Profile> response = this.callPost( "beta/usage/profiles",
4,753
import com.genability.client.api.request.GetAccountRequest; public class AccountService extends BaseService { public Response<Account> getAccounts(GetAccountsRequest request) { if(log.isDebugEnabled()) log.debug("getAccounts called"); <BUG>@SuppressWarnings("unchecked") Response<Account> response = (Response<Account>) this.callGet( "beta/accounts",</BUG> request.getQueryParams(), new TypeReference<Response<Account>>() { });
Response<Account> response = this.callGet( "beta/accounts",
4,754
if(log.isDebugEnabled()) log.debug("getAccount called"); String uri = "beta/accounts"; if (request.getAccountId() != null && request.getAccountId().length() !=0) { uri += "/" + request.getAccountId(); } <BUG>@SuppressWarnings("unchecked") Response<Account> response = (Response<Account>) this.callGet( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Account>>() { });
Response<Account> response = this.callGet( uri,
4,755
if(log.isDebugEnabled()) log.debug("getAccount completed"); return response; } public Response<Account> addAccount(Account account) { if(log.isDebugEnabled()) log.debug("addAccount called"); <BUG>@SuppressWarnings("unchecked") Response<Account> response = (Response<Account>) this.callPost( "beta/accounts",</BUG> account, new TypeReference<Response<Account>>() { });
Response<Account> response = this.callPost( "beta/accounts",
4,756
if(log.isDebugEnabled()) log.debug("deleteAccount called"); String uri = "beta/accounts"; if (request.getAccountId() != null && request.getAccountId().length() !=0) { uri += "/" + request.getAccountId(); } <BUG>@SuppressWarnings("unchecked") Response<Account> response = (Response<Account>) this.callDelete( uri,</BUG> request.getQueryParams(), new TypeReference<Response<Account>>() { });
Response<Account> response = this.callDelete( uri,
4,757
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column;</BUG> import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column;
4,758
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) public class Location{ public static final String DATA_TYPE = "AddressDt"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="location_id") private Long id;</BUG> @Column(name="address_1") private String address1; @Column(name="address_2")
@Access(AccessType.PROPERTY) private Long id;
4,759
package edu.gatech.i3l.fhir.dstu2.entities; import static ca.uhn.fhir.model.dstu2.resource.Medication.SP_CODE; import static ca.uhn.fhir.model.dstu2.resource.Medication.SP_NAME; <BUG>import java.util.Date; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,760
@Audited(targetAuditMode=RelationTargetAuditMode.NOT_AUDITED) public final class MedicationConcept extends BaseResourceEntity{ private static final String RES_TYPE = "Medication"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="concept_id", updatable=false) private Long id;</BUG> @Column(name="concept_name", updatable=false) private String name; @Column(name="concept_level", updatable=false)
@Access(AccessType.PROPERTY) private Long id;
4,761
c.add(Calendar.DAY_OF_MONTH, this.daysSupply); period.setEnd(new DateTimeDt(c.getTime())); } dispense.setValidityPeriod(period); resource.setDispense(dispense); <BUG>resource.setEncounter(new ResourceReferenceDt(this.visitOccurrence.getIdDt())); resource.setPatient(new ResourceReferenceDt(this.person.getIdDt())); </BUG> if(this.relevantCondition != null)
resource.setEncounter(new ResourceReferenceDt(new IdDt(VisitOccurrence.RESOURCE_TYPE, this.visitOccurrence.getId()))); resource.setPatient(new ResourceReferenceDt(new IdDt(Person.RESOURCE_TYPE, this.person.getId())));
4,762
resource.setPatient(new ResourceReferenceDt(this.person.getIdDt())); </BUG> if(this.relevantCondition != null) resource.setReason(new ResourceReferenceDt(new IdDt("Condition", this.relevantCondition.getId()))); if(this.prescribingProvider != null) <BUG>resource.setPrescriber(new ResourceReferenceDt(this.prescribingProvider.getIdDt())); </BUG> DosageInstruction dosage = new DosageInstruction(); QuantityDt dose = new QuantityDt(); dose.setValue(this.quantity);
c.add(Calendar.DAY_OF_MONTH, this.daysSupply); period.setEnd(new DateTimeDt(c.getTime())); } dispense.setValidityPeriod(period); resource.setDispense(dispense); resource.setEncounter(new ResourceReferenceDt(new IdDt(VisitOccurrence.RESOURCE_TYPE, this.visitOccurrence.getId()))); resource.setPatient(new ResourceReferenceDt(new IdDt(Person.RESOURCE_TYPE, this.person.getId()))); resource.setPrescriber(new ResourceReferenceDt(new IdDt(Provider.RESOURCE_TYPE, this.prescribingProvider.getId())));
4,763
package edu.gatech.i3l.fhir.dstu2.entities; <BUG>import java.util.Date; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,764
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) public class ConditionOccurrence extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Condition"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="condition_occurrence_id") private Long id;</BUG> @ManyToOne(cascade={CascadeType.MERGE}) @JoinColumn(name="person_id", nullable=false) @NotNull
@Access(AccessType.PROPERTY) private Long id;
4,765
public class Observation extends BaseResourceEntity{ private static final String RES_TYPE = "Observation"; private static final ObservationStatusEnum STATUS = ObservationStatusEnum.FINAL; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="observation_id") private Long id; @ManyToOne(cascade={CascadeType.MERGE}) </BUG> @JoinColumn(name="person_id", nullable=false)
@Access(AccessType.PROPERTY) @ManyToOne(cascade={CascadeType.MERGE}, fetch=FetchType.LAZY)
4,766
package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Calendar; <BUG>import java.util.Set; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,767
@Inheritance(strategy=InheritanceType.JOINED) public class Person extends BaseResourceEntity{ public static final String RESOURCE_TYPE = "Patient"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="person_id") private Long id;</BUG> @Column(name="year_of_birth", nullable=false) @NotNull private Integer yearOfBirth;
@Access(AccessType.PROPERTY) private Long id;
4,768
package edu.gatech.i3l.fhir.dstu2.entities; import static ca.uhn.fhir.model.dstu2.resource.Encounter.SP_DATE; import static ca.uhn.fhir.model.dstu2.resource.Encounter.SP_PATIENT; <BUG>import java.util.Date; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,769
import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu2.composite.PeriodDt; import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu2.resource.Encounter; <BUG>import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum; import ca.uhn.fhir.model.primitive.InstantDt;</BUG> import edu.gatech.i3l.fhir.jpa.entity.BaseResourceEntity; import edu.gatech.i3l.fhir.jpa.entity.IResourceEntity; import edu.gatech.i3l.omop.mapping.OmopConceptMapping;
import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt;
4,770
@Audited public class VisitOccurrence extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Encounter"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="visit_occurrence_id") private Long id;</BUG> @ManyToOne(cascade=CascadeType.MERGE) @JoinColumn(name="person_id", nullable=false) @NotNull
@Access(AccessType.PROPERTY) private Long id;
4,771
} else if (place_of_service.toLowerCase().contains("virtual")) { encounter.setClassElement(EncounterClassEnum.VIRTUAL); } else { encounter.setClassElement(EncounterClassEnum.OTHER); } <BUG>ResourceReferenceDt patientReference = new ResourceReferenceDt(person.getIdDt()); </BUG> encounter.setPatient(patientReference); PeriodDt visitPeriod = new PeriodDt(); visitPeriod.setStartWithSecondsPrecision(startDate);
ResourceReferenceDt patientReference = new ResourceReferenceDt(new IdDt(Person.RESOURCE_TYPE, person.getId()));
4,772
package edu.gatech.i3l.fhir.dstu2.entities; <BUG>import java.util.Date; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,773
@Audited @NamedQueries(value = { @NamedQuery( name = "findConceptByCode", query = "select id from Concept c where c.conceptCode like :code")}) public class Concept{ @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="concept_id", updatable=false) private Long id;</BUG> @Column(name="concept_name", updatable=false) private String name; @Column(name="concept_level", updatable=false)
@Access(AccessType.PROPERTY) private Long id;
4,774
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column;</BUG> import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column;
4,775
@Table(name = "f_drug_exposure") @Audited public final class DrugExposurePrescriptionComplement { @Id @Column(name = "drug_exposure_id") <BUG>@GeneratedValue(strategy=GenerationType.IDENTITY) private Long id;</BUG> @OneToOne(fetch=FetchType.LAZY) @JoinColumn(name="drug_exposure_id") private DrugExposurePrescription prescription;
@Access(AccessType.PROPERTY) private Long id;
4,776
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,777
@Audited public class CareSite extends BaseResourceEntity{ public static final String RES_TYPE = "Location"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="care_site_id") private Long id;</BUG> @ManyToOne(cascade={CascadeType.MERGE}) @JoinColumn(name="location_id") private Location location;
@Access(AccessType.PROPERTY) private Long id;
4,778
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,779
@Audited public class Provider extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Practitioner"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="provider_id") private Long id;</BUG> @Column(name="npi") private String npi; @Column(name="dea")
@Access(AccessType.PROPERTY) private Long id;
4,780
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,781
@Override public ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare getRelatedResource() { ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare episodeOfCare = new ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare(); return episodeOfCare; } <BUG>public Class<? extends IResource> getRelatedResourceType() { return ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare.class; }</BUG> @Override public Long getId() {
[DELETED]
4,782
public void setId(Long id) { this.id = id; } @Override public String getResourceType() { <BUG>return "EpisodeOfCare"; }</BUG> @Override public IResourceEntity constructEntityFromResource(IResource arg0) { return null;
return RES_TYPE;
4,783
public IResourceEntity constructEntityFromResource(IResource arg0) { return null; } @Override public FhirVersionEnum getFhirVersion() { <BUG>return null; }</BUG> @Override public InstantDt getUpdated() { return null;
return FhirVersionEnum.DSTU2;
4,784
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,785
@DiscriminatorFormula("CASE WHEN drug_type_concept_id = (SELECT concept.concept_id FROM concept WHERE concept.concept_name LIKE 'Prescription written') THEN 'PrescriptionWritten' "+ "WHEN drug_type_concept_id = ANY (SELECT concept.concept_id FROM concept WHERE concept.concept_name LIKE 'Prescription dispensed in pharmacy' OR concept.concept_name LIKE 'Prescription dispensed through mail order') THEN 'PrescriptionDispensed' END") public abstract class DrugExposurePrescription extends BaseResourceEntity { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="drug_exposure_id", updatable= false) private Long id;</BUG> @OneToOne(mappedBy="prescription", cascade=CascadeType.ALL, fetch=FetchType.LAZY) private DrugExposurePrescriptionComplement complement;
@Access(AccessType.PROPERTY) private Long id;
4,786
<BUG>package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.CascadeType;</BUG> import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue;
import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType;
4,787
@Audited public class Organization extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Organization"; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) <BUG>@Column(name="organization_id") private Long id;</BUG> @ManyToOne(cascade={CascadeType.MERGE}) @JoinColumn(name="place_of_service_concept_id") private Concept placeOfServiceConcept;
@Access(AccessType.PROPERTY) private Long id;
4,788
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
4,789
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
4,790
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
4,791
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
4,792
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
4,793
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
4,794
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
4,795
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
4,796
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
4,797
import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.common.collect.Ordering; import java.util.List; <BUG>import eu.davidea.flexibleadapter.FlexibleAdapter; import java8.util.stream.StreamSupport;</BUG> import pl.librus.client.R; import pl.librus.client.api.Reader; import pl.librus.client.datamodel.Announcement;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; import java8.util.stream.StreamSupport;
4,798
import pl.librus.client.datamodel.Announcement; import pl.librus.client.ui.MainActivity; import pl.librus.client.ui.MainApplication; import pl.librus.client.ui.MainFragment; import static java8.util.stream.Collectors.toList; <BUG>public class AnnouncementsFragment extends MainFragment { public AnnouncementsFragment() {</BUG> } public static AnnouncementsFragment newInstance() { Bundle args = new Bundle();
private View root; public AnnouncementsFragment() {
4,799
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { announcement = (Announcement) getArguments().getSerializable(ARG_ANNOUNCEMENT); author = MainApplication.getData() <BUG>.findByKey(Teacher.class, announcement.addedBy()); }</BUG> } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
.findByKey(Teacher.class, announcement.addedBy()) .blockingGet();
4,800
import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; import com.google.android.gms.gcm.GcmListenerService; import com.google.firebase.analytics.FirebaseAnalytics; <BUG>import java.util.List; import io.requery.Persistable; import java8.util.concurrent.CompletableFuture;</BUG> import java8.util.function.Consumer; import java8.util.stream.Collectors;
import io.reactivex.Flowable; import io.reactivex.Single;