auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Map<String,Object> getProperties( String... keys ) { Objects.requireNonNull( keys, "Properties keys should be not null array." ); if ( keys.length == 0 ) { return Collections.emptyMap(); } KernelTransaction transaction = actions.kernelTransaction(); CursorFactory cursors = transaction.cursors(); int itemsToReturn = keys.length; Map<String,Object> properties = new HashMap<>( itemsToReturn ); Token token = transaction.token(); try ( Statement statement = actions.statement() ) { try ( Cursor<NodeItem> node = statement.readOperations().nodeCursorById( nodeId ) ) { try ( Cursor<PropertyItem> propertyCursor = statement.readOperations().nodeGetProperties( node.get() ) ) { return PropertyContainerProxyHelper.getProperties( statement, propertyCursor, keys ); } } catch ( EntityNotFoundException e ) { throw new NotFoundException( "Node not found", e ); } } }

Target:
public Map<String,Object> getProperties( String... keys ) { Objects.requireNonNull( keys, "Properties keys should be not null array." ); if ( keys.length == 0 ) { return Collections.emptyMap(); } try ( Statement ignore = actions.statement() ) { KernelTransaction transaction = actions.kernelTransaction(); CursorFactory cursors = transaction.cursors(); int itemsToReturn = keys.length; Map<String,Object> properties = new HashMap<>( itemsToReturn ); Token token = transaction.token(); int[] propertyIds = new int[itemsToReturn]; for ( int i = 0; i < itemsToReturn; i++ ) { String key = keys[i]; if ( key == null ) { throw new NullPointerException( String.format( "Key %d was null", i ) ); } propertyIds[i] = token.propertyKey( key ); } try ( NodeCursor nodes = cursors.allocateNodeCursor(); PropertyCursor propertyCursor = cursors.allocatePropertyCursor() ) { transaction.dataRead().singleNode( nodeId, nodes ); if ( !nodes.next() ) { throw new NotFoundException( new EntityNotFoundException( EntityType.NODE, nodeId ) ); } nodes.properties( propertyCursor ); while ( propertyCursor.next() ) { for ( int propertyId : propertyIds ) { int currentKey = propertyCursor.propertyKey(); if ( propertyId == currentKey ) { properties.put( token.propertyKeyGetName( currentKey ), propertyCursor.propertyValue().asObjectCopy() ); } } } } catch ( PropertyKeyIdNotFoundKernelException e ) { throw new IllegalStateException( "Property key retrieved through kernel API should exist.", e ); } return properties; } }
Source:
protected void releaseTransport(Transport transport) { if (dedicatedTransport == null) { super.releaseTransport(transport); } }

Target:
protected void releaseTransport(Transport transport) { if (dedicatedTransport != transport) { super.releaseTransport(transport); } }
Source:
public void testSaveAsync() throws Exception { String sessionToken = "sessionToken"; Task<Void> toAwait = Task.forResult(null); ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); ParseInstallation currentInstallation = new ParseInstallation(); when(controller.getAsync()) .thenReturn(Task.forResult(currentInstallation)); ParseCorePlugins.getInstance() .registerCurrentInstallationController(controller); ParseObject.State state = new ParseObject.State.Builder("_Installation") .put("deviceToken", "deviceToken") .build(); ParseInstallation installation = ParseInstallation.getCurrentInstallation(); assertNotNull(installation); installation.setState(state); ParseObjectController objController = mock(ParseObjectController.class); Task<ParseObject.State> taskError = Task.forError(new ParseException(ParseException.OBJECT_NOT_FOUND, "")); Task<ParseObject.State> task = Task.forResult(null); when(objController.saveAsync( any(ParseObject.State.class), any(ParseOperationSet.class), eq(sessionToken), any(ParseDecoder.class))) .thenReturn(taskError) .thenReturn(task); ParseCorePlugins.getInstance() .registerObjectController(objController); installation.saveAsync(sessionToken, toAwait); verify(controller, times(1)).getAsync(); verify(objController, times(2)).saveAsync( any(ParseObject.State.class), any(ParseOperationSet.class), eq(sessionToken), any(ParseDecoder.class)); }

Target:
public void testSaveAsync() throws Exception { String sessionToken = "sessionToken"; Task<Void> toAwait = Task.forResult(null); ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); ParseInstallation currentInstallation = new ParseInstallation(); when(controller.getAsync()) .thenReturn(Task.forResult(currentInstallation)); ParseCorePlugins.getInstance() .registerCurrentInstallationController(controller); ParseObject.State state = new ParseObject.State.Builder("_Installation") .put("deviceToken", "deviceToken") .build(); ParseInstallation installation = ParseInstallation.getCurrentInstallation(); assertNotNull(installation); installation.setState(state); ParseObjectController objController = mock(ParseObjectController.class); Task<ParseObject.State> taskError = Task.forError(new ParseException(ParseException.OBJECT_NOT_FOUND, "")); Task<ParseObject.State> task = Task.forResult(null); when(objController.saveAsync( any(ParseObject.State.class), any(ParseOperationSet.class), eq(sessionToken), any(ParseDecoder.class))) .thenReturn(taskError) .thenReturn(task); ParseCorePlugins.getInstance() .registerObjectController(objController); installation.saveAsync(sessionToken, toAwait); verify(controller).getAsync(); verify(objController, times(2)).saveAsync( any(ParseObject.State.class), any(ParseOperationSet.class), eq(sessionToken), any(ParseDecoder.class)); }
Source:
void commitTransaction(boolean notifyLocalThread, Runnable runAfterCommit) { checkIfValid(); sharedGroupManager.commitAndContinueAsRead(); if (runAfterCommit != null) { runAfterCommit.run(); } for (Map.Entry<Handler, String> handlerIntegerEntry : handlers.entrySet()) { Handler handler = handlerIntegerEntry.getKey(); String realmPath = handlerIntegerEntry.getValue(); if (!notifyLocalThread && handler.equals(this.handler)) { continue; } Looper looper = handler.getLooper(); if (realmPath.equals(configuration.getPath()) && looper.getThread().isAlive()) { boolean messageHandled = true; if (looper == Looper.myLooper()) { Message msg = Message.obtain(); msg.what = HandlerController.LOCAL_COMMIT; if (!handler.hasMessages(HandlerController.LOCAL_COMMIT)) { messageHandled = handler.sendMessageAtFrontOfQueue(msg); } } else { if (!handler.hasMessages(HandlerController.REALM_CHANGED)) { messageHandled = handler.sendEmptyMessage(HandlerController.REALM_CHANGED); } } if (!messageHandled) { RealmLog.w("Cannot update Looper threads when the Looper has quit. Use realm.setAutoRefresh(false) " + "to prevent this."); } } } }

Target:
void commitTransaction(boolean notifyLocalThread, Runnable runAfterCommit) { checkIfValid(); sharedGroupManager.commitAndContinueAsRead(); if (runAfterCommit != null) { runAfterCommit.run(); } for (Map.Entry<Handler, String> handlerIntegerEntry : handlers.entrySet()) { Handler handler = handlerIntegerEntry.getKey(); String realmPath = handlerIntegerEntry.getValue(); if (!notifyLocalThread && handler.equals(this.handler)) { continue; } Looper looper = handler.getLooper(); if (realmPath.equals(configuration.getPath()) && looper.getThread().isAlive()) { boolean messageHandled = true; if (looper == Looper.myLooper()) { Message msg = Message.obtain(); msg.what = HandlerController.LOCAL_COMMIT; if (!handler.hasMessages(HandlerController.LOCAL_COMMIT)) { handler.removeMessages(HandlerController.REALM_CHANGED); messageHandled = handler.sendMessageAtFrontOfQueue(msg); } } else { if (!handler.hasMessages(HandlerController.REALM_CHANGED)) { messageHandled = handler.sendEmptyMessage(HandlerController.REALM_CHANGED); } } if (!messageHandled) { RealmLog.w("Cannot update Looper threads when the Looper has quit. Use realm.setAutoRefresh(false) " + "to prevent this."); } } } }
Source:
public static <SRC> KryoCloneUtils<SRC> createCloneUtils(Kryo kryo, SRC template) { return new KryoCloneUtils<SRC>(new Kryo(), template); }

Target:
public static <SRC> KryoCloneUtils<SRC> createCloneUtils(Kryo kryo, SRC template) { return new KryoCloneUtils<>(kryo, template); }
Source:
public HighFrequencyDetectorStatistics newHighFrequency() { final MetricId m = metric.tagged("component", "high-freq"); final Map<MetricId, Long> highFreqMetricsMap = new ConcurrentHashMap<>(); return new HighFrequencyDetectorStatistics() { private final Counter dropped = registry.counter( m.tagged("what", "dropped-metrics", "unit", "metric")); @Override public void reportHighFrequencyMetricsDropped(int dropped) { this.dropped.inc(dropped); } @Override public void reportHighFrequencyMetrics(int marked, String... tags) { MetricId gaugeMetric = m.tagged("what", "high-freq-metrics").tagged(tags); registerGauge(gaugeMetric); highFreqMetricsMap.put(gaugeMetric, (long) marked); } private synchronized void registerGauge(MetricId gauge) { if (highFreqMetricsMap.containsKey(gauge)) { return; } registry.register(gauge, new Gauge<Long>() { @Override public Long getValue() { return highFreqMetricsMap.get(gauge); } }); } }; }

Target:
public HighFrequencyDetectorStatistics newHighFrequency() { final MetricId m = metric.tagged("component", "high-freq"); final Map<MetricId, Long> highFreqMetricsMap = new ConcurrentHashMap<>(); return new HighFrequencyDetectorStatistics() { private final Counter dropped = registry.counter( m.tagged("what", "dropped-metrics", "unit", "metric")); @Override public void reportHighFrequencyMetricsDropped(int dropped) { this.dropped.inc(dropped); } @Override public void reportHighFrequencyMetrics(int marked, String... tags) { MetricId gaugeMetric = m.tagged("what", "high-freq-metrics").tagged(tags); registerGauge(gaugeMetric); highFreqMetricsMap.put(gaugeMetric, (long) marked); } private void registerGauge(MetricId gauge) { if (highFreqMetricsMap.containsKey(gauge)) { return; } try { registry.register(gauge, new Gauge<Long>() { @Override public Long getValue() { return highFreqMetricsMap.get(gauge); } }); } catch (IllegalArgumentException e) { } } }; }
Source:
public void setOnValueChangedListener(NumberPicker.OnValueChangeListener listener) { this.onValueChangeListener = listener; }

Target:
public void setOnValueChangedListener(NumberPicker.OnValueChangeListener listener) { directlyOn(realObject, NumberPicker.class).setOnValueChangedListener(listener); this.onValueChangeListener = listener; }
Source:
public MimeMessage generateNewInstructorAccountJoinEmail(InstructorAttributes instructor, String shortName, String institute) throws AddressException, MessagingException, UnsupportedEncodingException { MimeMessage messageToUser = getEmptyEmailAddressedToEmail(instructor.email); messageToUser = addBccRecipientToEmail(messageToUser, Config.SUPPORT_EMAIL); messageToUser.setSubject(String.format(SUBJECT_PREFIX_NEW_INSTRUCTOR_ACCOUNT + " " + shortName)); String joinUrl = generateNewInstructorAccountJoinLink(instructor, institute); String emailBody = Templates.populateTemplate(EmailTemplates.NEW_INSTRCUTOR_ACCOUNT_WELCOME, "${userName}", shortName, "${joinUrl}", joinUrl); messageToUser.setContent(emailBody, "text/html"); return messageToUser; }

Target:
public MimeMessage generateNewInstructorAccountJoinEmail(InstructorAttributes instructor, String shortName, String institute) throws AddressException, MessagingException, UnsupportedEncodingException { MimeMessage messageToUser = getEmptyEmailAddressedToEmail(instructor.email); messageToUser = addBccRecipientToEmail(messageToUser, Config.SUPPORT_EMAIL); messageToUser.setSubject(String.format(SUBJECT_PREFIX_NEW_INSTRUCTOR_ACCOUNT + " " + shortName)); String joinUrl = generateNewInstructorAccountJoinLink(instructor, institute); String emailBody = Templates.populateTemplate(EmailTemplates.NEW_INSTRUCTOR_ACCOUNT_WELCOME, "${userName}", shortName, "${joinUrl}", joinUrl); messageToUser.setContent(emailBody, "text/html"); return messageToUser; }
Source:
private boolean isSerializable(Type type) { if (type.isPrimitive()) { return true; } if (isSerializableArray(type)) { return true; } if (isParametrized(type)) { return isSerializableParametrized((ParametrizedTypeJavaType) type); } return type.isSubtypeOf("java.io.Serializable"); }

Target:
private static boolean isSerializable(Type type) { if (type.isPrimitive()) { return true; } if (isSerializableArray(type)) { return true; } if (isParametrized(type)) { return isSerializableParametrized((ParametrizedTypeJavaType) type); } return type.isSubtypeOf("java.io.Serializable"); }
Source:
protected String addEdge(Object sId, Object eId, String flowRule) { return " " + sId + " -> " + eId + " [label=\"" + flowRule + "\"];" + lineSeparator; }

Target:
protected String addEdge(Object sId, Object eId, String flowRule) { return " " + format(sId) + " -> " + format(eId) + " [label=\"" + flowRule + "\"];" + lineSeparator; }
Source:
private void rename(MetaDataUpdate md) throws IOException, ConfigInvalidException { boolean success = false; for (int attempts = 0; !success && attempts < MAX_TRIES; attempts++) { ProjectConfig config = ProjectConfig.read(md); GroupReference ref = config.getGroup(uuid); if (ref == null || newName.equals(ref.getName())) { projectCache.evict(config.getProject()); return; } ref.setName(newName); md.getCommitBuilder().setAuthor(author); md.setMessage("Rename group " + oldName + " to " + newName + "\n"); if (config.commit(md)) { projectCache.evict(config.getProject()); success = true; } else { try { Thread.sleep(25 ); } catch (InterruptedException wakeUp) { continue; } } } if (!success && !tryingAgain) { start(5, TimeUnit.MINUTES); tryingAgain = true; } }

Target:
private void rename(MetaDataUpdate md) throws IOException, ConfigInvalidException { boolean success = false; for (int attempts = 0; !success && attempts < MAX_TRIES; attempts++) { ProjectConfig config = ProjectConfig.read(md); GroupReference ref = config.getGroup(uuid); if (ref == null || newName.equals(ref.getName())) { projectCache.evict(config.getProject()); return; } ref.setName(newName); md.getCommitBuilder().setAuthor(author); md.setMessage("Rename group " + oldName + " to " + newName + "\n"); if (config.commit(md)) { projectCache.evict(config.getProject()); success = true; } else { try { Thread.sleep(25 ); } catch (InterruptedException wakeUp) { continue; } } } if (!success) { if (tryingAgain) { log.warn("Could not rename group " + oldName + " to " + newName + " in " + md.getProjectName().get()); } else { retryOn.add(md.getProjectName()); } } }
Source:
private String computeCurrentEtag(final Set<ServerToSegment> segments, @Nullable byte[] queryCacheKey) { Hasher hasher = Hashing.sha1().newHasher(); boolean hasOnlyHistoricalSegments = true; for (ServerToSegment p : segments) { log.info(p.getServer().pick().getServer().getType().toString()); if (!p.getServer().pick().getServer().segmentReplicatable()) { hasOnlyHistoricalSegments = false; break; } hasher.putString(p.getServer().getSegment().getIdentifier(), Charsets.UTF_8); } if (hasOnlyHistoricalSegments) { hasher.putBytes(queryCacheKey == null ? strategy.computeCacheKey(query) : queryCacheKey); String currEtag = Base64.encodeBase64String(hasher.hash().asBytes()); responseContext.put(QueryResource.HEADER_ETAG, currEtag); return currEtag; } else { return null; } }

Target:
private String computeCurrentEtag(final Set<ServerToSegment> segments, @Nullable byte[] queryCacheKey) { Hasher hasher = Hashing.sha1().newHasher(); boolean hasOnlyHistoricalSegments = true; for (ServerToSegment p : segments) { if (!p.getServer().pick().getServer().segmentReplicatable()) { hasOnlyHistoricalSegments = false; break; } hasher.putString(p.getServer().getSegment().getIdentifier(), Charsets.UTF_8); } if (hasOnlyHistoricalSegments) { hasher.putBytes(queryCacheKey == null ? strategy.computeCacheKey(query) : queryCacheKey); String currEtag = Base64.encodeBase64String(hasher.hash().asBytes()); responseContext.put(QueryResource.HEADER_ETAG, currEtag); return currEtag; } else { return null; } }
Source:
boolean remove(String path) throws IOException; F[] list(String path) throws IOException; void read(String source, OutputStream outputStream) throws IOException; void write(InputStream inputStream, String destination) throws IOException; void append(InputStream inputStream, String destination) throws IOException; boolean mkdir(String directory) throws IOException; boolean rmdir(String directory) throws IOException; void rename(String pathFrom, String pathTo) throws IOException; @Override void close(); boolean isOpen(); boolean exists(String path) throws IOException; String[] listNames(String path) throws IOException; InputStream readRaw(String source) throws IOException; boolean finalizeRaw() throws IOException; Object getClientInstance(); String getHost(); default boolean test() { return this.isOpen(); }

Target:
boolean remove(String path) throws IOException; F[] list(String path) throws IOException; void read(String source, OutputStream outputStream) throws IOException; void write(InputStream inputStream, String destination) throws IOException; void append(InputStream inputStream, String destination) throws IOException; boolean mkdir(String directory) throws IOException; boolean rmdir(String directory) throws IOException; void rename(String pathFrom, String pathTo) throws IOException; @Override void close(); boolean isOpen(); boolean exists(String path) throws IOException; String[] listNames(String path) throws IOException; InputStream readRaw(String source) throws IOException; boolean finalizeRaw() throws IOException; Object getClientInstance(); String getHostPort(); default boolean test() { return this.isOpen(); }
Source:
public void testPublicIpV4Address() { String ten_dot = "^10\\."; String one_two_seven = "^127\\."; String one_six_nine = "^169\\.254"; String one_nine_two = "^192\\.168\\."; String one_seven_two = "^172\\.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\\."; for (int i = 0; i < 1000; i++) { String addr = faker.internet().publicIpV4Address(); assertThat(addr.matches(ten_dot),is(false)); assertThat(addr.matches(one_two_seven),is(false)); assertThat(addr.matches(one_six_nine),is(false)); assertThat(addr.matches(one_nine_two),is(false)); assertThat(addr.matches(one_seven_two),is(false)); } }

Target:
public void testPublicIpV4Address() { String tenDot = "^10\\."; String oneTwoSeven = "^127\\."; String oneSixNine = "^169\\.254"; String oneNineTwo = "^192\\.168\\."; String oneSevenTwo = "^172\\.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\\."; for (int i = 0; i < 1000; i++) { String addr = faker.internet().publicIpV4Address(); assertThat(addr.matches(tenDot),is(false)); assertThat(addr.matches(oneTwoSeven),is(false)); assertThat(addr.matches(oneSixNine),is(false)); assertThat(addr.matches(oneNineTwo),is(false)); assertThat(addr.matches(oneSevenTwo),is(false)); } }
Source:
default List<AnalyzedCheckConstraint> checkConstraints() { return ImmutableList.of(); }

Target:
default List<CheckConstraint<Symbol>> checkConstraints() { return List.of(); }
Source:
SQLiteConnection openConnection(boolean readonly) { SQLiteConnection conn = context.getSQLiteAPI().getOrCreateDatabase(DB_NAME, readonly); if (conn == null) { return null; } if (conn.getVersion() < DB_VERSION) { if (readonly) { conn.close(); conn = context.getSQLiteAPI().getOrCreateDatabase(DB_NAME, false); } int version = conn.getVersion(); conn.setVersion(DB_VERSION); if (version == 0) { onCreate(conn); } else { onUpgrade(conn, version, DB_VERSION); } } cleanUpDatabase(conn); return conn; }

Target:
SQLiteConnection openConnection(boolean readonly) { SQLiteConnection conn = context.getSQLiteAPI().getOrCreateDatabase(DB_NAME, readonly); if (conn == null) { return null; } if (conn.getVersion() < DB_VERSION) { if (readonly) { conn.close(); conn = context.getSQLiteAPI().getOrCreateDatabase(DB_NAME, false); } int version = conn.getVersion(); conn.setVersion(DB_VERSION); if (version == 0) { onCreate(conn); } else { onUpgrade(conn, version, DB_VERSION); } } return conn; }
Source:
public void downloadFile(String url, String mimeType, FileDownloaderCallback callback) { final Request request = new Request.Builder().url(url) .addHeader("Content-Type", mimeType) .build(); mCallFactory.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { callback.onFailure(e); } @Override public void onResponse(Call call, Response response) { try { final File outputFile = new File(mCacheDir, new File(url).getName()); BufferedSink sink = Okio.buffer(Okio.sink(outputFile)); sink.writeAll(response.body().source()); sink.close(); new Handler(Looper.getMainLooper()).post(() -> callback.onSuccess(outputFile.getPath())); } catch (IOException e) { callback.onFailure(e); } } }); }

Target:
public void downloadFile(String url, String mimeType, FileDownloaderCallback callback) { final Request request = new Request.Builder().url(url) .addHeader("Content-Type", mimeType) .build(); mCallFactory.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { new Handler(Looper.getMainLooper()).post(() -> callback.onFailure(call, e)); } @Override public void onResponse(Call call, Response response) { try { final File outputFile = new File(mCacheDir, new File(url).getName()); BufferedSink sink = Okio.buffer(Okio.sink(outputFile)); sink.writeAll(response.body().source()); sink.close(); new Handler(Looper.getMainLooper()).post(() -> callback.onSuccess(outputFile.getPath())); } catch (IOException e) { this.onFailure(call, e); } } }); }
Source:
public OutputStream call() throws GitAPIException { final Format<?> fmt = formats.get(format); return writeArchive(fmt); }

Target:
public OutputStream call() throws GitAPIException { final Format<?> fmt = lookupFormat(format); return writeArchive(fmt); }
Source:
public void unregisterHandlers() { for (HandlerRegistration reg: handlerRegistrations) { reg.removeHandler(); } handlerRegistrations.clear(); }

Target:
public final void unregisterHandlers() { for (HandlerRegistration reg: handlerRegistrations) { reg.removeHandler(); } handlerRegistrations.clear(); }
Source:
public void testRefSetup() throws Exception { SubscribedRepository r = new SubscribedRepository(publisherConfig .getSubscriber("origin", db.getDirectory().getAbsolutePath())); r.setUpRefs(); assertTrue(null != db.getRef("refs/pubsub/origin/heads/master")); assertTrue(null != db.getRef("refs/pubsub/origin/tags/A")); assertTrue(null != db.getRef("refs/pubsub/origin/tags/B")); }

Target:
public void testRefSetup() throws Exception { SubscribedRepository r = new SubscribedRepository(publisherConfig .getSubscriber("origin", db.getDirectory().getAbsolutePath())); r.setUpRefs(); Set<String> keys = db.getRefDatabase() .getRefs("refs/pubsub/origin/").keySet(); assertEquals(13, keys.size()); assertNotNull(db.getRef("refs/pubsub/origin/heads/master")); assertNotNull(db.getRef("refs/pubsub/origin/tags/A")); assertNotNull(db.getRef("refs/pubsub/origin/tags/B")); }
Source:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { IJavaElement elem = (IJavaElement) receiver; IJavaProject javaProject = elem.getJavaProject(); if (javaProject == null) { return false; } if (PROP_IS_IN_BND_MAVEN_PROJECT.equals(property)) { try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_IN_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } } else if (PROP_IS_RESOLVABLE_BND_MAVEN_PROJECT.equals(property)) { try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndResolverMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_RESOLVABLE_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } } else if (PROP_IS_TESTABLE_BND_MAVEN_PROJECT.equals(property)) { try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndTestingMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_TESTABLE_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } } return false; }

Target:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { IJavaElement elem = (IJavaElement) receiver; IJavaProject javaProject = elem.getJavaProject(); if (javaProject == null) { return false; } switch (property) { case PROP_IS_IN_BND_MAVEN_PROJECT : try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_IN_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } case PROP_IS_RESOLVABLE_BND_MAVEN_PROJECT : try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndResolverMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_RESOLVABLE_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } case PROP_IS_TESTABLE_BND_MAVEN_PROJECT : try { IMavenProjectFacade projectFacade = getMavenProjectFacade(javaProject.getResource()); return javaProject.exists() && (projectFacade != null) && hasBndTestingMavenPlugin(projectFacade); } catch (CoreException e) { logger.logError("Error testing '" + PROP_IS_TESTABLE_BND_MAVEN_PROJECT + "' property on java element.", e); return false; } default : return false; } }
Source:
private static Properties calcEnvironment(IConfiguration cfg){ Properties envProps = new Properties(); ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg); IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true); for(int i = 0; i < vars.length; i++){ String key = vars[i].getName(); String value = vars[i].getValue(); if (key != null) envProps.setProperty(key, value == null ? "" : value); } return envProps; }

Target:
private static Properties calcEnvironment(IConfiguration cfg){ Properties envProps = new Properties(); ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg); IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true); for(int i = 0; i < vars.length; i++) { if (vars[i] != null && vars[i].getName() != null) { String value = vars[i].getValue(); envProps.setProperty(vars[i].getName(), value == null ? "" : value); } } return envProps; }
Source:
public RedisResponse executeCommand(Command command, ExecutionHandlerContext context) { List<byte[]> commandElems = command.getProcessedCommand(); byte[] result = PING_RESPONSE.getBytes(); byte[] subscribeResult = "".getBytes(); if (commandElems.size() > 1) { result = commandElems.get(1); subscribeResult = result; } if (!context.getPubSub().findSubscribedChannels(context.getClient()).isEmpty()) { return RedisResponse .array(Arrays.asList(PING_RESPONSE.toLowerCase().getBytes(), subscribeResult)); } return RedisResponse.string(result); }

Target:
public RedisResponse executeCommand(Command command, ExecutionHandlerContext context) { List<byte[]> commandElems = command.getProcessedCommand(); RedisResponse redisResponse; if (context.getPubSub().findSubscribedChannels(context.getClient()).isEmpty()) { byte[] result; if (commandElems.size() > 1) { result = commandElems.get(1); } else { result = PING_RESPONSE.getBytes(); } redisResponse = RedisResponse.string(result); } else { byte[] result; if (commandElems.size() > 1) { result = commandElems.get(1); } else { result = "".getBytes(); } redisResponse = RedisResponse.array(Arrays.asList(PING_RESPONSE.toLowerCase().getBytes(), result)); } return redisResponse; }
Source:
public void testAvailableTargetTypes() throws IOException { doImport("examples/src/scala/org/pantsbuild/example/hello/"); VirtualFile vfile = myProjectRoot.findFileByRelativePath("BUILD"); assertNotNull(vfile); PsiFile build = PsiManager.getInstance(myProject).findFile(vfile); String input = new String(myProjectRoot.findFileByRelativePath("BUILD").contentsToByteArray()); final PsiReference reference = build.findReferenceAt(input.indexOf("files(") + 1); assertNotNull("no reference", reference); final Collection<PsiElement> elements = TargetElementUtil.getInstance().getTargetCandidates(reference); assertNotNull(elements); assertEquals(1, elements.size()); }

Target:
public void testAvailableTargetTypes() throws IOException { String helloProjectPath = "examples/src/scala/org/pantsbuild/example/hello/"; doImport(helloProjectPath); if (PantsUtil.isCompatiblePantsVersion(myProjectRoot.getPath(), "1.24.0")) { VirtualFile vfile = myProjectRoot.findFileByRelativePath(helloProjectPath + "BUILD"); assertNotNull(vfile); String input = new String(vfile.contentsToByteArray()); PsiFile build = PsiManager.getInstance(myProject).findFile(vfile); final PsiReference reference = build.findReferenceAt(input.indexOf("target(") + 1); assertNotNull("no reference", reference); final Collection<PsiElement> elements = TargetElementUtil.getInstance().getTargetCandidates(reference); assertNotNull(elements); assertEquals(1, elements.size()); } }
Source:
public void setLanguage(String language) { this.language = language; }

Target:
public TextDocumentInput setLanguage(String language) { this.language = language; return this; }
Source:
public MultimapAggregationStateSerializer(Type keyType, Type valueType) { this.keyType = keyType; this.valueType = valueType; this.arrayType = new ArrayType(RowType.anonymous(ImmutableList.of(valueType, keyType))); }

Target:
public MultimapAggregationStateSerializer(Type keyType, Type valueType) { this.keyType = requireNonNull(keyType); this.valueType = requireNonNull(valueType); this.arrayType = new ArrayType(RowType.anonymous(ImmutableList.of(valueType, keyType))); }
Source:
public static Future<List> allOf(Collection<Future> futures) { if (futures.isEmpty()) return CompletableFuture.completedFuture(null); return new Future<List>() { @Override @SuppressWarnings("unchecked") public List get() throws InterruptedException, ExecutionException { List result = new LinkedList<>(); for (Future current : futures) { result.add(current.get()); } return result; } @Override @SuppressWarnings("unchecked") public List get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { List result = new LinkedList<>(); long deadline = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeout, unit); for (Future current : futures) { long remaining = deadline - System.nanoTime(); if (remaining <= 0) throw new TimeoutException(); result.add(current.get(remaining, TimeUnit.NANOSECONDS)); } return result; } @Override public boolean cancel(boolean mayInterruptIfRunning) { for (Future current : futures) { if (!current.cancel(mayInterruptIfRunning)) return false; } return true; } @Override public boolean isCancelled() { for (Future current : futures) { if (!current.isCancelled()) return false; } return true; } @Override public boolean isDone() { for (Future current : futures) { if (!current.isDone()) return false; } return true; } }; }

Target:
public static Future<List> allOf(Collection<Future> futures) { if (futures.isEmpty()) return CompletableFuture.completedFuture(null); return new Future<List>() { @Override @SuppressWarnings("unchecked") public List get() throws InterruptedException, ExecutionException { List result = new ArrayList<>(futures.size()); for (Future current : futures) { result.add(current.get()); } return result; } @Override @SuppressWarnings("unchecked") public List get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { List result = new ArrayList<>(futures.size()); long deadline = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeout, unit); for (Future current : futures) { long remaining = deadline - System.nanoTime(); if (remaining <= 0) throw new TimeoutException(); result.add(current.get(remaining, TimeUnit.NANOSECONDS)); } return result; } @Override public boolean cancel(boolean mayInterruptIfRunning) { for (Future current : futures) { if (!current.cancel(mayInterruptIfRunning)) return false; } return true; } @Override public boolean isCancelled() { for (Future current : futures) { if (!current.isCancelled()) return false; } return true; } @Override public boolean isDone() { for (Future current : futures) { if (!current.isDone()) return false; } return true; } }; }
Source:
public void sanityCheckMultiClientGetCommitTimestampsAgainstConjureTimelockService() { TestableTimelockServer leader = cluster.currentLeaderFor(client.namespace()); MultiClientConjureTimelockService service = leader.multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedGetCommitTimestampsResponse> commitTimestamps = service.getCommitTimestamps( AUTH_HEADER, defaultNamespacedGetCommitTimestampsRequests(expectedNamespaces)); Set<String> namespaces = commitTimestamps.stream() .map(NamespacedGetCommitTimestampsResponse::getNamespace) .collect(Collectors.toSet()); assertThat(namespaces).hasSameElementsAs(expectedNamespaces); commitTimestamps.forEach(namespacedGetCommitTimestampsResponse -> { GetCommitTimestampsResponse conjureTimelockServiceGetCommitTimestampResponse = leader.client( namespacedGetCommitTimestampsResponse.getNamespace()) .namespacedConjureTimelockService() .getCommitTimestamps(defaultCommitTimestampRequest()); assertThat(namespacedGetCommitTimestampsResponse .getLockWatchUpdate() .logId()) .isEqualTo(conjureTimelockServiceGetCommitTimestampResponse .getLockWatchUpdate() .logId()); assertThat(namespacedGetCommitTimestampsResponse.getInclusiveUpper()) .isEqualTo(conjureTimelockServiceGetCommitTimestampResponse.getInclusiveLower() - 1); }); }

Target:
public void sanityCheckMultiClientGetCommitTimestampsAgainstConjureTimelockService() { TestableTimelockServer leader = cluster.currentLeaderFor(client.namespace()); MultiClientConjureTimelockService service = leader.multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedGetCommitTimestampsResponse> commitTimestamps = service.getCommitTimestamps( AUTH_HEADER, defaultNamespacedGetCommitTimestampsRequests(expectedNamespaces)); Set<String> namespaces = commitTimestamps.stream() .map(NamespacedGetCommitTimestampsResponse::getNamespace) .collect(Collectors.toSet()); assertThat(namespaces).hasSameElementsAs(expectedNamespaces); commitTimestamps.forEach(namespacedGetCommitTimestampsResponse -> { GetCommitTimestampsResponse conjureTimelockServiceGetCommitTimestampResponse = leader.client( namespacedGetCommitTimestampsResponse.getNamespace()) .namespacedConjureTimelockService() .getCommitTimestamps(defaultCommitTimestampRequest()); assertThat(conjureTimelockServiceGetCommitTimestampResponse .getLockWatchUpdate() .logId()) .isEqualTo(namespacedGetCommitTimestampsResponse .getLockWatchUpdate() .logId()); assertThat(conjureTimelockServiceGetCommitTimestampResponse.getInclusiveLower()) .as("timestamps should contiguously increase per namespace if there are no elections.") .isEqualTo(namespacedGetCommitTimestampsResponse.getInclusiveUpper() + 1); }); }
Source:
public static void setFilterPredicate(Configuration configuration, FilterPredicate filterPredicate) { Preconditions.checkArgument(getUnboundRecordFilter(configuration) == null, "You cannot provide a FilterPredicate after providing an UnboundRecordFilter"); try { SerializationUtil.writeObjectToConfAsBase64(FILTER_PREDICATE, filterPredicate, configuration); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public static void setFilterPredicate(Configuration configuration, FilterPredicate filterPredicate) { checkArgument(getUnboundRecordFilter(configuration) == null, "You cannot provide a FilterPredicate after providing an UnboundRecordFilter"); configuration.set(FILTER_PREDICATE + ".human.readable", filterPredicate.toString()); try { SerializationUtil.writeObjectToConfAsBase64(FILTER_PREDICATE, filterPredicate, configuration); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
protected void generateReport(ISuite suite) { XMLStringBuffer document = new XMLStringBuffer(); document.addComment("Generated by " + getClass().getName()); long elapsedTime = 0; long testCount = 0; for (List<ITestResult> testResults : m_allTests.values()) { for (ITestResult tr : testResults) { elapsedTime += (tr.getEndMillis() - tr.getStartMillis()); testCount++; } } Properties attrs = new Properties(); attrs.setProperty(XMLConstants.ATTR_TESTS, "" + testCount); attrs.setProperty(XMLConstants.ATTR_TIME, "" + elapsedTime / 1000.0); attrs.setProperty(XMLConstants.ATTR_NAME, getModuleSuffix()); attrs.setProperty("skipped", "" + m_numSkipped); attrs.setProperty(XMLConstants.ATTR_ERRORS, "0"); attrs.setProperty(XMLConstants.ATTR_FAILURES, "" + (m_numFailed.get())); document.push(XMLConstants.TESTSUITE, attrs); showProperties(document); document.addComment("Tests results"); createElementFromTestResults(document, m_allTests.values()); document.pop(); Utils.writeUtf8File( suite.getOutputDirectory().replaceAll(String.format("%sSurefire suite", File.pathSeparator), ""), generateFileName(suite) + ".xml", document.toXML()); }

Target:
protected void generateReport(ISuite suite) { XMLStringBuffer document = new XMLStringBuffer(); document.addComment("Generated by " + getClass().getName()); long elapsedTime = 0; long testCount = 0; for (List<ITestResult> testResults : m_allTests.values()) { for (ITestResult tr : testResults) { elapsedTime += (tr.getEndMillis() - tr.getStartMillis()); testCount++; } } Properties attrs = new Properties(); attrs.setProperty(XMLConstants.ATTR_TESTS, "" + testCount); attrs.setProperty(XMLConstants.ATTR_TIME, "" + elapsedTime / 1000.0); attrs.setProperty(XMLConstants.ATTR_NAME, getModuleSuffix()); attrs.setProperty("skipped", "" + m_numSkipped); attrs.setProperty(XMLConstants.ATTR_ERRORS, "0"); attrs.setProperty(XMLConstants.ATTR_FAILURES, "" + (m_numFailed.get())); document.push(XMLConstants.TESTSUITE, attrs); showProperties(document); document.addComment("Tests results"); createElementFromTestResults(document, m_allTests.values()); document.pop(); Utils.writeUtf8File(suite.getOutputDirectory().replaceAll(".Surefire suite", ""), generateFileName(suite) + ".xml", document.toXML()); }
Source:
public void result(byte[] resultRowKey, WriteResult result) { boolean added = false; for (KVPair kvPair : resultsMap.keySet()) { byte[] currentRowKey = kvPair.getRowKey(); if (Arrays.equals(currentRowKey, resultRowKey)) { resultsMap.put(kvPair, result); added = true; break; } } if (!added) { for (KVPair kvPair : resultsMap.keySet()) { byte[] currentRowKey = kvPair.getRowKey(); resultsMap.put(kvPair, result); } } }

Target:
public void result(byte[] resultRowKey, WriteResult result) { for (KVPair kvPair : resultsMap.keySet()) { byte[] currentRowKey = kvPair.getRowKey(); if (Arrays.equals(currentRowKey, resultRowKey)) { resultsMap.put(kvPair, result); return; } } throw new IllegalArgumentException("expected existing value in resultsMap"); }
Source:
protected List<String> getInstallPlugins() { File root; try { root = distroLocator.locate(); } catch (FileNotFoundException e) { log.warn("Couldn't open folder containing plugins." + " No plugin will be installed"); return null; } ArrayList<String> result = Lists.newArrayList(); File plugins = new File(root, InitPlugins.PLUGIN_DIR); for (File p : plugins.listFiles()) { String pluginJarName = p.getName(); String pluginName = pluginJarName.substring(0, pluginJarName.length() - InitPlugins.JAR.length()); result.add(pluginName); } return result; }

Target:
protected List<String> getInstallPlugins() { File root; try { root = distroLocator.locate(); } catch (FileNotFoundException e) { log.warn("Couldn't find distribution archive location." + " No plugin will be installed"); return null; } ArrayList<String> result = Lists.newArrayList(); File plugins = new File(root, InitPlugins.PLUGIN_DIR); for (File p : plugins.listFiles()) { String pluginJarName = p.getName(); String pluginName = pluginJarName.substring(0, pluginJarName.length() - InitPlugins.JAR.length()); result.add(pluginName); } return result; }
Source:
private Object[] getArgs(Method method) { int methodArity = method.getParameterTypes().length; if (args.size() == methodArity) return args.toArray(); if (args.size() > methodArity) throw new IllegalArgumentException(String.format("linkTo param args must have the same or lower length as method param args. linkTo args: %d | method args: %d", args.size(), methodArity)); Object[] noMissingParamsArgs = new Object[methodArity]; System.arraycopy(args.toArray(), 0, noMissingParamsArgs, 0, args.size()); return noMissingParamsArgs; }

Target:
private Object[] getArgs(Method method) { int methodArity = method.getParameterTypes().length; if (args.size() == methodArity) { return args.toArray(); } if (args.size() > methodArity) { throw new IllegalArgumentException(String.format("linkTo param args must have the same or lower length as method param args. linkTo args: %d | method args: %d", args.size(), methodArity)); } Object[] noMissingParamsArgs = new Object[methodArity]; System.arraycopy(args.toArray(), 0, noMissingParamsArgs, 0, args.size()); return noMissingParamsArgs; }
Source:
public Member suspendMember(PerunSession sess, Member member, String message) throws InternalErrorException, MemberNotValidYetException { if(this.haveStatus(sess, member, Status.SUSPENDED)) { log.warn("Trying to suspend member who is already suspended. Suspend operation will be procesed anyway (to be shure)." + member); } if(this.haveStatus(sess, member, Status.INVALID)) throw new MemberNotValidYetException(member); getMembersManagerImpl().setStatus(sess, member, Status.SUSPENDED); member.setStatus(Status.SUSPENDED); try { Attribute attribute = perunBl.getAttributesManagerBl().getAttribute(sess, member, "urn:perun:member:attribute-def:def:suspensionInfo"); HashMap<String, String> map = new LinkedHashMap<>(); if (message != null) { map.put("reason", message); } int id = -1; User user = sess.getPerunPrincipal().getUser(); if (user != null){ id = user.getId(); } map.put("userId", String.valueOf(id)); Timestamp timestamp = new Timestamp(System.currentTimeMillis()); map.put("timestamp", String.valueOf(timestamp)); attribute.setValue(map); perunBl.getAttributesManagerBl().setAttribute(sess, member, attribute); } catch (WrongAttributeAssignmentException | AttributeNotExistsException | WrongAttributeValueException | WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } getPerunBl().getAuditer().log(sess, new MemberSuspended(member, Auditer.engineForceKeyword)); return member; }

Target:
public Member suspendMember(PerunSession sess, Member member, String message) throws InternalErrorException, MemberNotValidYetException { if(this.haveStatus(sess, member, Status.SUSPENDED)) { log.warn("Trying to suspend member who is already suspended. Suspend operation will be procesed anyway (to be shure)." + member); } if(this.haveStatus(sess, member, Status.INVALID)) throw new MemberNotValidYetException(member); getMembersManagerImpl().setStatus(sess, member, Status.SUSPENDED); member.setStatus(Status.SUSPENDED); try { Attribute attribute = perunBl.getAttributesManagerBl().getAttribute(sess, member, "urn:perun:member:attribute-def:def:suspensionInfo"); HashMap<String, String> map = new LinkedHashMap<>(); if (message != null) { map.put("reason", message); } int id = sess.getPerunPrincipal().getUserId(); map.put("userId", String.valueOf(id)); Timestamp timestamp = new Timestamp(System.currentTimeMillis()); map.put("timestamp", String.valueOf(timestamp)); attribute.setValue(map); perunBl.getAttributesManagerBl().setAttribute(sess, member, attribute); } catch (WrongAttributeAssignmentException | AttributeNotExistsException | WrongAttributeValueException | WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } getPerunBl().getAuditer().log(sess, new MemberSuspended(member, Auditer.engineForceKeyword)); return member; }
Source:
public void register(ManagementResourceRegistration parentRegistration) { ManagementResourceRegistration registration = parentRegistration.registerSubModel(this); ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()) .addAttributes(Attribute.class) .addCapabilities(Capability.class) .addRequiredSingletonChildren(ConnectionPoolResourceDefinition.PATH) .addRequiredSingletonChildren(NoNearCacheResourceDefinition.PATH) .addRequiredSingletonChildren(ClientThreadPoolResourceDefinition.class) ; ResourceServiceHandler handler = new RemoteCacheContainerServiceHandler(); new AddStepHandler(descriptor, handler).register(registration); new RemoveStepHandler(descriptor, handler).register(registration); new ConnectionPoolResourceDefinition().register(registration); new InvalidationNearCacheResourceDefinition().register(registration); new NoNearCacheResourceDefinition().register(registration); EnumSet.allOf(ClientThreadPoolResourceDefinition.class).forEach(p -> p.register(registration)); }

Target:
public ManagementResourceRegistration register(ManagementResourceRegistration parentRegistration) { ManagementResourceRegistration registration = parentRegistration.registerSubModel(this); ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()) .addAttributes(Attribute.class) .addCapabilities(Capability.class) .addRequiredChildren(ConnectionPoolResourceDefinition.PATH) .addRequiredChildren(ThreadPoolResourceDefinition.CLIENT.getPathElement()) .addRequiredSingletonChildren(NoNearCacheResourceDefinition.PATH) ; ResourceServiceHandler handler = new RemoteCacheContainerServiceHandler(builderFactory); new RestartParentResourceRegistration<>(builderFactory, descriptor, handler).register(registration); new ConnectionPoolResourceDefinition().register(registration); new RemoteClusterResourceDefinition(builderFactory).register(registration); new InvalidationNearCacheResourceDefinition().register(registration); new NoNearCacheResourceDefinition().register(registration); ThreadPoolResourceDefinition.CLIENT.register(registration); return registration; }
Source:
private void inlineSignatureValueIncludes(Element element, Collection<Attachment> attachments) throws IOException { NodeList signatureNodes = element.getElementsByTagNameNS(SamlConstants.XML_SIGNATURE_NS, SamlConstants.SIGNATURE_VALUE_TAG); inlineIncludes(signatureNodes, attachments); }

Target:
private static void inlineSignatureValueIncludes(Element element, Collection<Attachment> attachments) throws IOException { NodeList signatureNodes = element.getElementsByTagNameNS(SamlConstants.XML_SIGNATURE_NS, SamlConstants.SIGNATURE_VALUE_TAG); inlineIncludes(signatureNodes, attachments); }
Source:
public int[] getAdnRecordsSize(int efid) { if (DBG) logd("getAdnRecordsSize: efid=" + efid); synchronized(mLock) { checkThread(); recordSize = new int[3]; Message response = mBaseHandler.obtainMessage(EVENT_GET_SIZE_DONE); ((SIMFileHandler)phone.getIccFileHandler()).getEFLinearRecordSize(efid, response); try { mLock.wait(); } catch (InterruptedException e) { logd("interrupted while trying to load from the SIM"); } } return recordSize; }

Target:
public int[] getAdnRecordsSize(int efid) { if (DBG) logd("getAdnRecordsSize: efid=" + efid); synchronized(mLock) { checkThread(); recordSize = new int[3]; Message response = mBaseHandler.obtainMessage(EVENT_GET_SIZE_DONE); phone.getIccFileHandler().getEFLinearRecordSize(efid, response); try { mLock.wait(); } catch (InterruptedException e) { logd("interrupted while trying to load from the SIM"); } } return recordSize; }