auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void releaseCursor( Cursor cursor ) { if ( cursorsInUse > 0 ) { if ( TRACK_CURSORS ) { cursorsOpenCloseCalls.remove( cursor ); } <START> cursorsInUse--; <END> } }</code><technical_language>setting RECORD_CURSOR_TRACES false increase overhead of recording cursor traces, traces captured regardless, stored in a cache shared threads, cache evict put</technical_language>

Target:
public void releaseCursor( Cursor cursor ) { cursorsOpenCloseCalls.remove( cursor ); }
Source:
<code>public void partOpened(IWorkbenchPart part) { if (part instanceof ITextEditor) { ITextEditor editor = (ITextEditor) part; new EditorListener(editor); <START> this.workbenchListener.editorCreated(editor); <END> } }</code><technical_language>new out-factored structure, get rid of "backreference" workbench here</technical_language>

Target:
public void partOpened(IWorkbenchPart part) { if (part instanceof ITextEditor) { ITextEditor editor = (ITextEditor) part; new EditorListener(editor); try { ResourceAndResourceDeltaVisitor visitor = new ResourceAndResourceDeltaVisitor(trackingEventManager, new HashMap<>(), true); WatchDogUtils.getFile(editor).accept(visitor); } catch (IllegalArgumentException | CoreException ignored) { } } }
Source:
<code>public static LocalQueryRunner createLocalQueryRunner(File tempDir) { Session session = testSessionBuilder() .setCatalog("hive") .setSchema("tpch") .build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(session); localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); File hiveDir = new File(tempDir, "hive_data"); ExtendedHiveMetastore metastore = createTestingFileHiveMetastore(hiveDir); metastore.createDatabase(Database.builder() .setDatabaseName("tpch") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); HiveConnectorFactory hiveConnectorFactory = new HiveConnectorFactory( "hive", HiveBenchmarkQueryRunner.class.getClassLoader(), <START> Optional.of(metastore), new DefaultPathFilterProviderModule()); <END> Map<String, String> hiveCatalogConfig = ImmutableMap.<String, String>builder() .put("hive.max-split-size", "10GB") .build(); localQueryRunner.createCatalog("hive", hiveConnectorFactory, hiveCatalogConfig); localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders"); localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem"); return localQueryRunner; }</code><technical_language>nit: line break arguments</technical_language>

Target:
public static LocalQueryRunner createLocalQueryRunner(File tempDir) { Session session = testSessionBuilder() .setCatalog("hive") .setSchema("tpch") .build(); LocalQueryRunner localQueryRunner = new LocalQueryRunner(session); localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of()); File hiveDir = new File(tempDir, "hive_data"); ExtendedHiveMetastore metastore = createTestingFileHiveMetastore(hiveDir); metastore.createDatabase(Database.builder() .setDatabaseName("tpch") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); HiveConnectorFactory hiveConnectorFactory = new HiveConnectorFactory( "hive", HiveBenchmarkQueryRunner.class.getClassLoader(), Optional.of(metastore)); Map<String, String> hiveCatalogConfig = ImmutableMap.<String, String>builder() .put("hive.max-split-size", "10GB") .build(); localQueryRunner.createCatalog("hive", hiveConnectorFactory, hiveCatalogConfig); localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders"); localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem"); return localQueryRunner; }
Source:
<code>private static void knownHosts(final JSch sch, FS fs) throws JSchException { final File home = fs.userHome(); if (home == null) return; final File known_hosts = new File(new File(home, ".ssh"), "known_hosts"); try { final FileInputStream in = new FileInputStream(known_hosts); try { sch.setKnownHosts(in); } finally { in.close(); } <START> } catch (final FileNotFoundException none) { <END> } catch (final IOException err) { } }</code><technical_language>Style-nit: reason add final</technical_language>

Target:
private static void knownHosts(final JSch sch, FS fs) throws JSchException { final File home = fs.userHome(); if (home == null) return; final File known_hosts = new File(new File(home, ".ssh"), "known_hosts"); try { final FileInputStream in = new FileInputStream(known_hosts); try { sch.setKnownHosts(in); } finally { in.close(); } } catch (FileNotFoundException none) { } catch (IOException err) { } }
Source:
<code>private void raiseIssue(Tree operand, Tree... secondaryLocations) { Tree expression = ((JavaScriptTree) operand).getParent(); Symbol operandSymbol = null; if (operand.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) operand; operandSymbol = identifier.symbol(); } <START> if (!expressionsWithIssues.contains(expression) && !symbolsWithIssues.contains(operandSymbol)) { <END> PreciseIssue issue = addIssue(operand, MESSAGE); Arrays.asList(secondaryLocations).forEach(issue::secondary); expressionsWithIssues.add(expression); if (operandSymbol != null) { symbolsWithIssues.add(operandSymbol); } } }</code><technical_language>@pynicolas need for !expressionsWithIssues.contains(expression) raise 2 issues for expression (at in test)</technical_language>

Target:
private void raiseIssue(Tree operand, Tree... secondaryLocations) { Symbol operandSymbol = null; if (operand.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) operand; operandSymbol = identifier.symbol(); } if (!symbolsWithIssues.contains(operandSymbol)) { PreciseIssue issue = addIssue(operand, MESSAGE); Arrays.asList(secondaryLocations).forEach(issue::secondary); if (operandSymbol != null) { symbolsWithIssues.add(operandSymbol); } } }
Source:
<code>public static void stopPolling(Context context) { if (localNoticicationInvoked) { localNoticicationInvoked = false; Intent alarm = new Intent(context, AlarmReceiver.class); <START> PendingIntent sender = PendingIntent.getBroadcast(context, REQUEST_CODE, alarm, 0); <END> AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.cancel(sender); } }</code><technical_language>"0" refer to? If this is some default kinda thing, define a constant able improve maintainability of code</technical_language>

Target:
public static void stopPolling(Context context) { if (localNoticicationInvoked) { localNoticicationInvoked = false; Intent alarm = new Intent(context, AlarmReceiver.class); PendingIntent sender = PendingIntent.getBroadcast(context, REQUEST_CODE, alarm, DEFAULT_INDEX); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.cancel(sender); } }
Source:
<code>private void updateBatchStats(Map<String,TabletServerMutations<Mutation>> binnedMutations) { tabletServersBatchSum.addAndGet(binnedMutations.size()); minTabletServersBatch.set(Math.min(minTabletServersBatch.get(), binnedMutations.size())); <START> maxTabletServersBatch.set(Math.max(maxTabletServersBatch.get(), binnedMutations.size())); <END> int numTablets = 0; for (Entry<String,TabletServerMutations<Mutation>> entry : binnedMutations.entrySet()) { TabletServerMutations<Mutation> tsm = entry.getValue(); numTablets += tsm.getMutations().size(); } tabletBatchSum.addAndGet(numTablets); minTabletBatch.set(Math.min(minTabletBatch.get(), numTablets)); maxTabletBatch.set(Math.max(maxTabletBatch.get(), numTablets)); numBatches.incrementAndGet(); }</code><technical_language>This method of updating a race condition. Multiple threads call get() calling set(). of atomic vars require trips main memory (not this matters). I of solutions. involve creating a BatchWriterStats class code more managable. 1. add a syncrhonized updateBatchStats method BatchWriterStats. longer syncing main lock making lots of trips main mem. 2. AtomicRef<BatchWriterStats>. update batch writer stats read ref, clone it, updates clone, update ref CAS ensure ref changed. If ref changed, start over. This avoids lock, race conditions, lots of trips main memory</technical_language>

Target:
private void updateBatchStats(Map<String,TabletServerMutations<Mutation>> binnedMutations) { tabletServersBatchSum.addAndGet(binnedMutations.size()); computeMin(minTabletServersBatch, binnedMutations.size()); computeMax(maxTabletServersBatch, binnedMutations.size()); int numTablets = 0; for (Entry<String,TabletServerMutations<Mutation>> entry : binnedMutations.entrySet()) { TabletServerMutations<Mutation> tsm = entry.getValue(); numTablets += tsm.getMutations().size(); } tabletBatchSum.addAndGet(numTablets); computeMin(minTabletBatch, numTablets); computeMax(maxTabletBatch, numTablets); numBatches.incrementAndGet(); }
Source:
<code>public void sourceSubstituteAdded() throws Throwable { <START> sourceMappingAddedHelper(false); <END> }</code><technical_language>Parameter true here, no</technical_language>

Target:
public void sourceSubstituteAdded() throws Throwable { sourceMappingAddedHelper(true); }
Source:
<code>public MappedServlet getMappedServlet(String target) { if (target.startsWith("/")) { if (_servletPathMap == null) return null; MappedResource<MappedServlet> match = _servletPathMap.getMatch(target); if (match == null) return null; return match.getResource(); } ServletHolder holder = _servletNameMap.get(target); if (holder == null) return null; <START> return new MappedServlet(null, holder); <END> }</code><technical_language>return a shared instance for this well</technical_language>

Target:
public MappedServlet getMappedServlet(String target) { if (target.startsWith("/")) { if (_servletPathMap == null) return null; MappedResource<MappedServlet> match = _servletPathMap.getMatch(target); if (match == null) return null; return match.getResource(); } return _servletNameMap.get(target); }
Source:
<code>public MongoPageHelper<E> addBooleanAggregation(Mapping field) { Objects.requireNonNull(ctx); Facet facet = new Facet(baseQuery.getDescriptor().findProperty(field.toString()).getLabel(), field.toString(), <START> ctx.get(field.toString()).asString(), <END> null); facet.addItem("true", NLS.get("NLS.yes"), -1); facet.addItem("false", NLS.get("NLS.no"), -1); baseQuery.addFacet(new MongoBooleanFacet(field).onComplete(mongoFacet -> { Iterator<FacetItem> iter = facet.getAllItems().iterator(); while (iter.hasNext()) { FacetItem item = iter.next(); int numberOfHits = Strings.areEqual(item.getKey(), "true") ? mongoFacet.getNumTrue() : mongoFacet.getNumFalse(); if (numberOfHits > 0 || item.isActive()) { item.setCount(numberOfHits); } else { iter.remove(); } } })); return addFacet(facet, (f, q) -> { Value filterValue = Value.of(f.getValue()); if (filterValue.isFilled()) { q.eq(Mapping.named(f.getName()), filterValue.asBoolean()); } }); }</code><technical_language>this needed BasePageHelper#addFacet do this for (L118)</technical_language>

Target:
public MongoPageHelper<E> addBooleanAggregation(Mapping field) { Facet facet = new Facet(baseQuery.getDescriptor().findProperty(field.toString()).getLabel(), field.toString(), null, null); return addFacet(facet, (f, q) -> { f.addItem("true", NLS.get("NLS.yes"), -1); f.addItem("false", NLS.get("NLS.no"), -1); Value filterValue = Value.of(f.getValue()); if (filterValue.isFilled()) { q.eq(Mapping.named(f.getName()), filterValue.asBoolean()); } q.addFacet(new MongoBooleanFacet(field).onComplete(mongoFacet -> { Iterator<FacetItem> iter = facet.getAllItems().iterator(); while (iter.hasNext()) { FacetItem item = iter.next(); int numberOfHits = Strings.areEqual(item.getKey(), "true") ? mongoFacet.getNumTrue() : mongoFacet.getNumFalse(); if (numberOfHits > 0 || item.isActive()) { item.setCount(numberOfHits); } else { iter.remove(); } } })); }); }
Source:
<code>private TransactionManager getTransactionManager() { try { return com.arjuna.ats.jta.TransactionManager.transactionManager(new InitialContext()); } catch (NamingException ne) { <START> throw new IllegalStateException("Not possible to find transaction manager, " <END> + "failed to initialize intial context. Cause: " + ne.getMessage(), ne); } }</code><technical_language>this is a test I throw NamingException out of test</technical_language>

Target:
private TransactionManager getTransactionManager() throws NamingException { return com.arjuna.ats.jta.TransactionManager.transactionManager(new InitialContext()); }
Source:
<code>public static String calculateChecksum(Path path, String type) <START> throws Exception <END> { byte[] buffer = new byte[4096]; MessageDigest md = MessageDigest.getInstance(type); try (DigestInputStream dis = new DigestInputStream(Files.newInputStream(path), md)) { while (dis.read(buffer) != -1) ; } return convertToHexadecimalString(md); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Define throw a dedicated exception instead of a generic one. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public static String calculateChecksum(Path path, String type) throws IOException, NoSuchAlgorithmException { byte[] buffer = new byte[4096]; MessageDigest md = MessageDigest.getInstance(type); try (DigestInputStream dis = new DigestInputStream(Files.newInputStream(path), md)) { while (dis.read(buffer) != -1) ; } return convertToHexadecimalString(md); }
Source:
<code>public Long getTimestamp(MessageAndOffset messageAndOffset) { <START> return 0l; <END> }</code><technical_language>k8 k10 return a valid long, method return a small long instead of big Long</technical_language>

Target:
public long getTimestamp(MessageAndOffset messageAndOffset) { return 0l; }
Source:
<code>public ConnectionNotFoundException(List<Path> paths, PointList waypoints) { <START> super(unconnectedListString(paths), unconnectedInfo(paths, waypoints)); <END> }</code><technical_language>call this(unconnectedListString(paths), unconnectedInfo(paths, waypoints)); in this case</technical_language>

Target:
public ConnectionNotFoundException(List<Path> paths, PointList waypoints) { this(unconnectedListString(paths), unconnectedInfo(paths, waypoints)); }
Source:
<code>public Subscriber<? super T> call(Subscriber<? super List<T>> child) { if (after) { final BoundedAfterSubscriber<T> parent = new BoundedAfterSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; } final BoundedBeforeSubscriber<T> parent = new BoundedBeforeSubscriber<T>(child, capacityHint, predicate, prefetch); <START> child.add(parent); <END> child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; }</code><technical_language>please merge duplicating code here? like: java final Subscriber<T> parent = ? new BoundedAfterSubscriber<T>(child, capacityHint, predicate, prefetch) : new BoundedBeforeSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() ); return parent;</technical_language>

Target:
public Subscriber<? super T> call(Subscriber<? super List<T>> child) { final BoundedSubscriber<T> parent = after ? new BoundedAfterSubscriber<T>(child, capacityHint, predicate, prefetch) : new BoundedBeforeSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; }
Source:
<code>public CharSequence apply(String relativePath, Options options) throws IOException { if (relativePath == null) { throw new IllegalArgumentException("Relative path of a CSS file cannot be null."); } RequestLookup requestLookup = options.data(HbsRenderable.DATA_KEY_REQUEST_LOOKUP); StringBuilder buffer = new StringBuilder("<link href=\"") .append(requestLookup.getPublicUri()) .append('/') .append(relativePath); for (Object param : options.params) { buffer.append(param); } buffer.append("\" rel=\"stylesheet\" type=\"text/css\" />\n"); String content = buffer.toString(); if (isPlacedholderResolved(content, options)) { return ""; } addToPlaceholder(content, options); ((HashSet<String>) options.data(RESOLVED_PLACEHOLDERS)).add(content); <START> return ""; <END> }</code><technical_language>this method is returning a blank string. If is reason return type string/char sequence</technical_language>

Target:
public CharSequence apply(String relativePath, Options options) throws IOException { if (relativePath == null) { throw new IllegalArgumentException("Relative path of a CSS file cannot be null."); } StringBuilder completeRelativePath = new StringBuilder(relativePath); for (Object param : options.params) { completeRelativePath.append(param); } RequestLookup requestLookup = options.data(HbsRenderable.DATA_KEY_REQUEST_LOOKUP); String resourceIdentifier = getResourceIdentifier(requestLookup, completeRelativePath.toString()); if (isResourceAlreadyResolved(resourceIdentifier, options)) { return ""; } StringBuilder buffer = new StringBuilder("<link href=\"") .append(requestLookup.getPublicUri()) .append('/') .append(completeRelativePath); buffer.append("\" rel=\"stylesheet\" type=\"text/css\" />\n"); addToPlaceholder(buffer.toString(), options); ((Set) options.data(HbsRenderable.DATA_KEY_RESOLVED_RESOURCES)).add(resourceIdentifier); return ""; }
Source:
<code>private List<KeyValue> getNextBatch() { List<KeyValue> nextBatch; try { if (readAheadOperation == null) { nextBatch = readBatch(); } else { nextBatch = readAheadOperation.get(); readAheadOperation = null; } } catch (ExecutionException ee) { if (ee.getCause() instanceof IsolationException) throw new IsolationException(ee); if (ee.getCause() instanceof TableDeletedException) { TableDeletedException cause = (TableDeletedException) ee.getCause(); <START> throw new TableDeletedException(cause.getTableId(), cause); <END> } if (ee.getCause() instanceof TableOfflineException) throw new TableOfflineException(ee); if (ee.getCause() instanceof SampleNotPresentException) throw new SampleNotPresentException(ee.getCause().getMessage(), ee); throw new RuntimeException(ee); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (!nextBatch.isEmpty()) { batchCount++; if (batchCount > readaheadThreshold) { initiateReadAhead(); } } return nextBatch; }</code><technical_language>throw ee.getCause() instead of constructing a new one</technical_language>

Target:
private List<KeyValue> getNextBatch() { List<KeyValue> nextBatch; try { if (readAheadOperation == null) { nextBatch = readBatch(); } else { nextBatch = readAheadOperation.get(); readAheadOperation = null; } } catch (ExecutionException ee) { wrapExecutionException(ee); throw new RuntimeException(ee); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (!nextBatch.isEmpty()) { batchCount++; if (batchCount > readaheadThreshold) { initiateReadAhead(); } } return nextBatch; }
Source:
<code>public PlanNode visitSort(SortNode node, RewriteContext<Set<VariableReferenceExpression>> context) { Set<VariableReferenceExpression> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderByVariables())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); <START> return new SortNode(node.getId(), source, node.getOrderingScheme(), false); <END> }</code><technical_language>change this node.isPartial()</technical_language>

Target:
public PlanNode visitSort(SortNode node, RewriteContext<Set<VariableReferenceExpression>> context) { Set<VariableReferenceExpression> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderByVariables())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new SortNode(node.getId(), source, node.getOrderingScheme(), node.isPartial()); }
Source:
<code>public void scanFile(JavaFileScannerContext context) { JavaFilesCache javaFilesCache = new JavaFilesCache(); javaFilesCache.scanFile(context); org.sonar.api.resources.File currentResource = org.sonar.api.resources.File.fromIOFile(context.getFile(), project); if (currentResource == null) { throw new IllegalStateException("resource not found : " + context.getFileKey()); } resourceMapping.addResource(currentResource, context.getFileKey()); for (Map.Entry<String, File> classIOFileEntry : javaFilesCache.getResourcesCache().entrySet()) { resourcesByClass.put(classIOFileEntry.getKey(), currentResource); if (context.getFileKey() != null) { sourceFileByClass.put(classIOFileEntry.getKey(), context.getFileKey()); } } methodStartLines.putAll(javaFilesCache.getMethodStartLines()); <START> if (!javaFilesCache.getSuppressWarningLines().isEmpty()) { <END> String componentKey = project.name() + ":" + currentResource.getKey(); suppressWarningsFilter.addComponent(componentKey, javaFilesCache.getSuppressWarningLines()); } }</code><technical_language>A dedicated method check this nicer</technical_language>

Target:
public void scanFile(JavaFileScannerContext context) { Preconditions.checkNotNull(sensorContext); JavaFilesCache javaFilesCache = new JavaFilesCache(); javaFilesCache.scanFile(context); org.sonar.api.resources.File currentResource = org.sonar.api.resources.File.fromIOFile(context.getFile(), project); if (currentResource == null) { throw new IllegalStateException("resource not found : " + context.getFileKey()); } resourceMapping.addResource(currentResource, context.getFileKey()); for (Map.Entry<String, File> classIOFileEntry : javaFilesCache.getResourcesCache().entrySet()) { resourcesByClass.put(classIOFileEntry.getKey(), currentResource); if (context.getFileKey() != null) { sourceFileByClass.put(classIOFileEntry.getKey(), context.getFileKey()); } } methodStartLines.putAll(javaFilesCache.getMethodStartLines()); if (javaFilesCache.hasSuppressWarningLines()) { suppressWarningsFilter.addComponent(sensorContext.getResource(currentResource).getEffectiveKey(), javaFilesCache.getSuppressWarningLines()); } }
Source:
<code>public boolean isDuplicate(@NonNull AvoidRoadInfo item) { for (AvoidRoadInfo existingItem : existingItems) { <START> if (item.latitude == existingItem.latitude <END> && item.longitude == existingItem.longitude && item.name.equals(existingItem.name)) { return true; } } return false; }</code><technical_language>Implement equals in AvoidRoadInfo</technical_language>

Target:
public boolean isDuplicate(@NonNull AvoidRoadInfo item) { return existingItems.contains(item); }
Source:
<code>public HashSet<String> getUniqueUsersWithTokenCache() { Iterable<TokenCacheItem> results = this.getAll(); HashSet<String> users = new HashSet<String>(); <START> if (results != null) { <END> for (final TokenCacheItem tokenCacheItem: results) { if (tokenCacheItem.getUserInfo() != null && !users.contains(tokenCacheItem.getUserInfo().getUserId())) { users.add(tokenCacheItem.getUserInfo().getUserId()); } } } return users; }</code><technical_language>do check for null, implementation of getAll() return null, if null is unexpected check for null</technical_language>

Target:
public Set<String> getUniqueUsersWithTokenCache() { Iterator<TokenCacheItem> results = this.getAll(); Set<String> users = new HashSet<String>(); while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && !users.contains(tokenCacheItem.getUserInfo().getUserId())) { users.add(tokenCacheItem.getUserInfo().getUserId()); } } return users; }
Source:
<code>public void removingPrimaryKeyThrows() { RealmConfiguration originalConfig = configFactory.createConfigurationBuilder() <START> .schema(AllTypes.class) <END> .build(); Realm.getInstance(originalConfig).close(); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmSchema schema = realm.getSchema(); schema.create("StringOnly") .addField("chars", String.class, FieldAttribute.PRIMARY_KEY); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(StringOnly.class) .migration(migration) .build(); try { realm = Realm.getInstance(realmConfig); fail(); } catch (RealmMigrationNeededException e) { if (!e.getMessage().equals("Primary Key @PrimaryKey was removed.")) { fail(e.toString()); } } finally { if (realm != null) { realm.close(); } } }</code><technical_language>This tests fail <LINK_0> fixed. simplely DynamicRealm create StringOnly</technical_language>

Target:
public void removingPrimaryKeyThrows() { RealmConfiguration originalConfig = configFactory.createConfigurationBuilder() .schema(Thread.class) .build(); Realm.getInstance(originalConfig).close(); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmSchema schema = realm.getSchema(); schema.create("StringOnly") .addField("chars", String.class, FieldAttribute.PRIMARY_KEY); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(Thread.class, StringOnly.class) .migration(migration) .build(); try { realm = Realm.getInstance(realmConfig); fail(); } catch (RealmMigrationNeededException e) { if (!e.getMessage().equals("Primary Key defined for field chars was removed.")) { fail(e.toString()); } } finally { if (realm != null) { realm.close(); } } }
Source:
<code>public void shouldReturnEmptyList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(new ArrayList<Music>()); controller.search(music); List<Music> musics = (List<Music>) result.included().get("musics"); Assert.assertTrue(musics.isEmpty()); <START> } <END></code><technical_language>assertThat(musics, empty())</technical_language>

Target:
public void shouldReturnEmptyList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(new ArrayList<Music>()); controller.search(music); List<Music> musics = (List<Music>) result.included().get("musics"); assertThat(musics, empty()); }
Source:
<code>public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromKeyType = boundVariables.getTypeVariable("FK"); Type fromValueType = boundVariables.getTypeVariable("FV"); Type toKeyType = boundVariables.getTypeVariable("TK"); Type toValueType = boundVariables.getTypeVariable("TV"); <START> Type toMapType = MAP.createType(typeManager, ImmutableList.of(TypeParameter.of(toKeyType), TypeParameter.of(toValueType))); <END> MethodHandle keyProcessor = getProcessMethodHandle(functionRegistry, fromKeyType, toKeyType, true); MethodHandle valueProcessor = getProcessMethodHandle(functionRegistry, fromValueType, toValueType, false); MethodHandle target = MethodHandles.insertArguments(METHOD_HANDLE, 0, keyProcessor, valueProcessor, toMapType); return new ScalarFunctionImplementation(true, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), target, true); }</code><technical_language>Do MAP. Please do typeManager</technical_language>

Target:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromKeyType = boundVariables.getTypeVariable("FK"); Type fromValueType = boundVariables.getTypeVariable("FV"); Type toKeyType = boundVariables.getTypeVariable("TK"); Type toValueType = boundVariables.getTypeVariable("TV"); Type toMapType = typeManager.getParameterizedType( "map", ImmutableList.of( TypeSignatureParameter.of(toKeyType.getTypeSignature()), TypeSignatureParameter.of(toValueType.getTypeSignature()))); MethodHandle keyProcessor = buildProcessor(functionRegistry, fromKeyType, toKeyType, true); MethodHandle valueProcessor = buildProcessor(functionRegistry, fromValueType, toValueType, false); MethodHandle target = MethodHandles.insertArguments(METHOD_HANDLE, 0, keyProcessor, valueProcessor, toMapType); return new ScalarFunctionImplementation(true, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), target, true); }
Source:
<code>public JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor) { super(viewer, offset); Assert.isNotNull(editor); fEditor= editor; <START> if (viewer != null) { <END> ISelectionProvider selectionProvider = viewer.getSelectionProvider(); if (!equippedSelectionProviders.contains(selectionProvider)) { boolean toEquip = false; synchronized (equippedSelectionProviders) { toEquip = !equippedSelectionProviders.contains(selectionProvider); if (toEquip) { equippedSelectionProviders.add(selectionProvider); } } if (toEquip) { Display.getDefault().asyncExec(() -> { ISelection selection = selectionProvider.getSelection(); if (selection instanceof ITextSelection) { lastKnownTextSelections.put(selectionProvider, (ITextSelection)selection); } }); ISelectionChangedListener selectionChangedListener = event -> { ISelection selection = event.getSelection(); if (selection instanceof ITextSelection) { lastKnownTextSelections.put(event.getSelectionProvider(), (ITextSelection)selection); } }; DisposeListener listener= new DisposeListener() { @Override public void widgetDisposed(DisposeEvent event) { selectionProvider.removeSelectionChangedListener(selectionChangedListener); event.widget.removeDisposeListener(this); equippedSelectionProviders.remove(selectionProvider); lastKnownTextSelections.remove(selectionProvider); } }; viewer.getTextWidget().addDisposeListener(listener); } } } }</code><technical_language>invert logic exit early avoid deeply nested code block below, is hard read</technical_language>

Target:
public JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor) { super(viewer, offset); Assert.isNotNull(editor); fEditor= editor; }
Source:
<code>private void createOAuth2Client() { Client client = Clients.builder() .setOrgUrl("https://{yourOktaDomain}") .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY) <START> .setClientId("yourClientID") <END> .setScopes(new HashSet<>(Arrays.asList("okta.users.read", "okta.apps.read"))) .setPrivateKey("/path/to/yourPrivateKey.pem") .build(); }</code><technical_language>{clientId}</technical_language>

Target:
private void createOAuth2Client() { Client client = Clients.builder() .setOrgUrl("https://{yourOktaDomain}") .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY) .setClientId("{clientId}") .setScopes(new HashSet<>(Arrays.asList("okta.users.read", "okta.apps.read"))) .setPrivateKey("/path/to/yourPrivateKey.pem") .build(); }
Source:
<code>public void applySearchString(String searchString) { if (modelProvider.getModel() instanceof SearchableListModel) { @SuppressWarnings("unchecked") SearchableListModel<?, ? extends EntityModel<?>> listModel = modelProvider.getModel(); if (StringHelper.isNotNullOrEmpty(searchString) && searchString.startsWith(listModel.getDefaultSearchString())) { <START> placeManager.setFragmentParameters(getFragmentParams(searchString), <END> false); listModel.setSearchString(searchString); listModel.getSearchCommand().execute(); } } }</code><technical_language>nitpick: naming consistent, Parameters Params</technical_language>

Target:
public void applySearchString(String searchString) { if (modelProvider.getModel() instanceof SearchableListModel) { @SuppressWarnings("unchecked") SearchableListModel<?, ? extends EntityModel<?>> listModel = modelProvider.getModel(); if (StringHelper.isNotNullOrEmpty(searchString) && searchString.startsWith(listModel.getDefaultSearchString())) { placeManager.setFragmentParameters(getFragmentParameters(searchString), false); listModel.setSearchString(searchString); listModel.getSearchCommand().execute(); } } }
Source:
<code>public static String getExecutableAsString(String name, Class<?>... parameterTypes) { StringBuilder sb = new StringBuilder( name ); sb.append( "(" ); boolean isFirst = true; for ( Class<?> parameterType : parameterTypes ) { if ( !isFirst ) { sb.append( ", " ); } else { isFirst = false; } <START> sb.append( parameterType.getSimpleName() ); <END> } sb.append( ")" ); return sb.toString(); }</code><technical_language>Surprised some Java 8 magic</technical_language>

Target:
public static String getExecutableAsString(String name, Class<?>... parameterTypes) { return Stream.of( parameterTypes ) .map( t -> t.getSimpleName() ) .collect( Collectors.joining( ", ", name + "(", ")" ) ); }
Source:
<code>public EEFViewDescription convert() { EEFViewDescription view = EefFactory.eINSTANCE.createEEFViewDescription(); <START> view.setImageExpression("aql:self.image()"); <END> Set<EPackage> ePackages = new LinkedHashSet<>(); for (PageDescription pageDescription : pageDescriptions) { EObject eContainer = pageDescription.eContainer(); if (eContainer instanceof ViewExtensionDescription) { ViewExtensionDescription viewExtensionDescription = (ViewExtensionDescription) eContainer; ePackages.addAll(viewExtensionDescription.getMetamodels()); } } view.getEPackages().addAll(ePackages); view.setLabelExpression("feature:name"); for (PageDescription pageDescription : pageDescriptions) { createPage(pageDescription, view); } Set<Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule>> entries = this.eefPropertyValidationRule2propertyValidationRule.entrySet(); for (Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule> entry : entries) { List<WidgetDescription> widgets = entry.getValue().getTargets(); for (WidgetDescription widgetDescription : widgets) { EEFWidgetDescription eefWidgetDescription = this.widget2eefWidget.get(widgetDescription); if (eefWidgetDescription != null) { EEFPropertyValidationRuleDescription eefPropertyValidationRule = entry.getKey(); eefPropertyValidationRule.getTargets().add(eefWidgetDescription); } } } this.widget2eefWidget.clear(); this.eefPropertyValidationRule2propertyValidationRule.clear(); return view; }</code><technical_language>service:image</technical_language>

Target:
public EEFViewDescription convert() { EEFViewDescription view = EefFactory.eINSTANCE.createEEFViewDescription(); view.setImageExpression("service:image"); Set<EPackage> ePackages = new LinkedHashSet<>(); for (PageDescription pageDescription : pageDescriptions) { EObject eContainer = pageDescription.eContainer(); if (eContainer instanceof ViewExtensionDescription) { ViewExtensionDescription viewExtensionDescription = (ViewExtensionDescription) eContainer; ePackages.addAll(viewExtensionDescription.getMetamodels()); } } view.getEPackages().addAll(ePackages); view.setLabelExpression("feature:name"); for (PageDescription pageDescription : pageDescriptions) { createPage(pageDescription, view); } Set<Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule>> entries = this.eefPropertyValidationRule2propertyValidationRule.entrySet(); for (Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule> entry : entries) { List<WidgetDescription> widgets = entry.getValue().getTargets(); for (WidgetDescription widgetDescription : widgets) { EEFWidgetDescription eefWidgetDescription = this.widget2eefWidget.get(widgetDescription); if (eefWidgetDescription != null) { EEFPropertyValidationRuleDescription eefPropertyValidationRule = entry.getKey(); eefPropertyValidationRule.getTargets().add(eefWidgetDescription); } } } this.widget2eefWidget.clear(); this.eefPropertyValidationRule2propertyValidationRule.clear(); return view; }
Source:
<code>private void startCropActivity(Uri uri) { final Context context = getActivity(); if (context == null) { return; } UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextCompat.getColor(context, R.color.status_bar_tint)); options.setToolbarColor(ContextCompat.getColor(context, R.color.color_primary)); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); <START> UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped_for_gravatar.jpg"))) <END> .withAspectRatio(1, 1) .withOptions(options) .start(getActivity(), this); }</code><technical_language>Instead of cropped_for_gravatar.jpg here, cropped_for_site_icon.jpg similar</technical_language>

Target:
private void startCropActivity(Uri uri) { final Context context = getActivity(); if (context == null) { return; } UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextCompat.getColor(context, R.color.status_bar_tint)); options.setToolbarColor(ContextCompat.getColor(context, R.color.color_primary)); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped_for_site_icon.jpg"))) .withAspectRatio(1, 1) .withOptions(options) .start(getActivity(), this); }
Source:
<code>public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamilyDesc) throws IOException { <START> ModifyColumnFamiliesRequest request = <END> ModifyColumnFamiliesRequest.of(tableName.getNameAsString()); request.addFamily(columnFamilyDesc.getNameAsString(), buildGarbageCollectionRule(TableAdapter2x.toHColumnDescriptor(columnFamilyDesc))); modifyColumns(request); }</code><technical_language>This sequence is verbose. discuss HBase wrapper of ModifyColumnFamiliesRequest</technical_language>

Target:
public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamilyDesc) throws IOException { modifyColumns(tableName, columnFamilyDesc.getNameAsString(), "add", ModifyTableBuilder.newBuilder(tableName).add(TableAdapter2x.toHColumnDescriptor(columnFamilyDesc))); }
Source:
<code>public ApexStream<T> union(ApexStream<T>... others) { <START> return null; <END> }</code><technical_language>throw a NotSupportedException instead of returning null</technical_language>

Target:
public <STREAM extends ApexStream<T>> STREAM union(ApexStream<T>... others) { throw new UnsupportedOperationException(); }
Source:
<code>public static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent){ if ( block.isContainer() ){ CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if ( BlockType.VIDEO == block.type && block.data != null && (block.data instanceof VideoData) ){ <START> VideoBlockModel child = new VideoBlockModel(block, parent); <END> } else { HtmlBlockModel child = new HtmlBlockModel(block, parent); } } }</code><technical_language>this do? declares a new model object, do it</technical_language>

Target:
public static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent){ if ( block.isContainer() ){ CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if ( BlockType.VIDEO == block.type && block.data != null && (block.data instanceof VideoData) ){ new VideoBlockModel(block, parent); } else { new HtmlBlockModel(block, parent); } } }
Source:
<code>private IndexValue getPutRecordForDeletedKey(StoreKey key, IndexValue deleteIndexValue) throws StoreException { <START> BlobReadOptions originalPut = index.getBlobReadInfo(key, EnumSet.of(StoreGetOptions.Store_Include_Deleted)); <END> Offset originalPutOffset = new Offset(originalPut.getLogSegmentName(), originalPut.getOffset()); return new IndexValue(originalPut.getSize(), originalPutOffset, originalPut.getExpiresAtMs(), Utils.Infinite_Time, deleteIndexValue.getServiceId(), deleteIndexValue.getContainerId()); }</code><technical_language>please EnumSet.allOf(StoreGetOptions.class)</technical_language>

Target:
private IndexValue getPutRecordForDeletedKey(StoreKey key, IndexValue deleteIndexValue) throws StoreException { BlobReadOptions originalPut = index.getBlobReadInfo(key, EnumSet.allOf(StoreGetOptions.class)); Offset originalPutOffset = new Offset(originalPut.getLogSegmentName(), originalPut.getOffset()); return new IndexValue(originalPut.getSize(), originalPutOffset, originalPut.getExpiresAtMs(), deleteIndexValue.getOperationTimeInMs(), deleteIndexValue.getServiceId(), deleteIndexValue.getContainerId()); }
Source:
<code>synchronized Client getJerseyClient() { <START> if ( jerseyClient == null ) { <END> int poolSize = 100; final String poolSizeStr = properties.getProperty( CENTRAL_CONNECTION_POOL_SIZE ); if ( poolSizeStr != null ) { poolSize = Integer.parseInt( poolSizeStr ); } MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams cmParams = cm.getParams(); cmParams.setMaxTotalConnections( poolSize ); HttpClient httpClient = new HttpClient( cm ); int timeout = 20000; final String timeoutStr = properties.getProperty( CENTRAL_CONNECTION_TIMEOUT ); if ( timeoutStr != null ) { timeout = Integer.parseInt( timeoutStr ); } int readTimeout = 20000; final String readTimeoutStr = properties.getProperty( CENTRAL_READ_TIMEOUT ); if ( readTimeoutStr != null ) { readTimeout = Integer.parseInt( readTimeoutStr ); } ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE ); clientConfig.getProperties().put( ClientConfig.PROPERTY_CONNECT_TIMEOUT, timeout ); clientConfig.getProperties().put( ClientConfig.PROPERTY_READ_TIMEOUT, readTimeout ); ApacheHttpClientHandler handler = new ApacheHttpClientHandler( httpClient, clientConfig ); jerseyClient = new ApacheHttpClient( handler ); } return jerseyClient; }</code><technical_language>put synchronized in null block method? This queue get client instantiated</technical_language>

Target:
private Client getJerseyClient() { if ( jerseyClient == null ) { synchronized ( this ) { int poolSize = 100; final String poolSizeStr = properties.getProperty( CENTRAL_CONNECTION_POOL_SIZE ); if ( poolSizeStr != null ) { poolSize = Integer.parseInt( poolSizeStr ); } MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams cmParams = cm.getParams(); cmParams.setMaxTotalConnections( poolSize ); HttpClient httpClient = new HttpClient( cm ); int timeout = 20000; final String timeoutStr = properties.getProperty( CENTRAL_CONNECTION_TIMEOUT ); if ( timeoutStr != null ) { timeout = Integer.parseInt( timeoutStr ); } int readTimeout = 20000; final String readTimeoutStr = properties.getProperty( CENTRAL_READ_TIMEOUT ); if ( readTimeoutStr != null ) { readTimeout = Integer.parseInt( readTimeoutStr ); } ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE ); clientConfig.getProperties().put( ClientConfig.PROPERTY_CONNECT_TIMEOUT, timeout ); clientConfig.getProperties().put( ClientConfig.PROPERTY_READ_TIMEOUT, readTimeout ); ApacheHttpClientHandler handler = new ApacheHttpClientHandler( httpClient, clientConfig ); jerseyClient = new ApacheHttpClient( handler ); } } return jerseyClient; }
Source:
<code>TryCatchFinallyControlFlow(CommandContext ctx) { <START> tryList = new ArrayList<>(); <END> ctx.set(Scope.CONTEXT, CTX_KEY, this); }</code><technical_language>tryList final inline initialisation in declaration</technical_language>

Target:
TryCatchFinallyControlFlow(CommandContext ctx) { ctx.set(Scope.CONTEXT, CTX_KEY, this); }
Source:
<code>private static File[] init() { <START> final String currentVersion = Version.getVersionString(); <END> Set<File> libraryFiles = new HashSet<>(); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-orm:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-engine:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-backend-jms:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-serialization-avro:" + currentVersion, true ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-core:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-analyzers-common:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.hibernate.common:hibernate-commons-annotations:" + VersionTestHelper.getDependencyVersionHibernateCommonsAnnotations(), false ) ); return libraryFiles.toArray( new File[libraryFiles.size()] ); }</code><technical_language>I VersionTestHelper instead of Version</technical_language>

Target:
private static File[] init() { final String currentVersion = VersionTestHelper.getDependencyVersionHibernateSearch(); Set<File> libraryFiles = new HashSet<>(); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-orm:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-engine:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-backend-jms:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-serialization-avro:" + currentVersion, true ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-core:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-analyzers-common:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.hibernate.common:hibernate-commons-annotations:" + VersionTestHelper.getDependencyVersionHibernateCommonsAnnotations(), false ) ); return libraryFiles.toArray( new File[libraryFiles.size()] ); }
Source:
<code>public ServiceInstance createServiceInstance(CreateServiceInstanceRequest request) throws ServiceInstanceExistsException, ServiceBrokerException { String serviceId = request.getServiceInstanceId(); log.debug("createServiceInstance - {}", serviceId); AutosleepServiceInstance serviceInstance = serviceRepository.findOne(serviceId); if (serviceInstance != null) { throw new ServiceInstanceExistsException(serviceInstance); } else { request.setParameters(processParameters(null, request.getParameters())); serviceInstance = new AutosleepServiceInstance(request); <START> String baseDashUrl = deployment == null ? "localhost:8080" : deployment.getFirstUri(); <END> serviceInstance.withDashboardUrl(baseDashUrl + Config.Path.dashboardPrefix + serviceId); serviceRepository.save(serviceInstance); watcher.watchServiceBindings(serviceId, Config.delayBeforeFirstServiceCheck); } return serviceInstance; }</code><technical_language>java if(deployment != null){ serviceInstance.withDashboardUrl(deployment.getFirstUri()+ Config.Path.dashboardPrefix + serviceId); }</technical_language>

Target:
public ServiceInstance createServiceInstance(CreateServiceInstanceRequest request) throws ServiceInstanceExistsException, ServiceBrokerException { String serviceId = request.getServiceInstanceId(); log.debug("createServiceInstance - {}", serviceId); AutosleepServiceInstance serviceInstance = serviceRepository.findOne(serviceId); if (serviceInstance != null) { throw new ServiceInstanceExistsException(serviceInstance); } else { request.setParameters(processParameters(null, request.getParameters())); serviceInstance = new AutosleepServiceInstance(request); if (deployment != null) { serviceInstance.withDashboardUrl(deployment.getFirstUri()+ Config.Path.dashboardPrefix + serviceId); } serviceRepository.save(serviceInstance); watcher.watchServiceBindings(serviceId, Config.delayBeforeFirstServiceCheck); } return serviceInstance; }