auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Module module() { return new CacheModule() { @Override protected void configure() { final TypeLiteral<Cache<StarredChange.Key, StarredChange>> byKeyType = new TypeLiteral<Cache<StarredChange.Key, StarredChange>>() {}; <START> core(byKeyType, BY_KEY).populateWith(ByKeyLoader.class); <END> final TypeLiteral<Cache<Account.Id, StarredChangeList>> byAccountIdType = new TypeLiteral<Cache<Account.Id, StarredChangeList>>() {}; core(byAccountIdType, BY_ACCOUNT_ID).populateWith( ByAccountIdLoader.class); final TypeLiteral<Cache<Change.Id, StarredChangeList>> byChangeIdType = new TypeLiteral<Cache<Change.Id, StarredChangeList>>() {}; core(byChangeIdType, BY_CHANGE_ID).populateWith(ByChangeIdLoader.class); bind(StarredChangesCacheImpl.class); bind(StarredChangesCache.class).to(StarredChangesCacheImpl.class); } }; }</code><technical_language>This cache is pointless</technical_language>

Target:
public static Module module() { return new CacheModule() { @Override protected void configure() { final TypeLiteral<Cache<Account.Id, StarredChangeList>> byAccountIdType = new TypeLiteral<Cache<Account.Id, StarredChangeList>>() {}; core(byAccountIdType, BY_ACCOUNT_ID).populateWith( ByAccountIdLoader.class); final TypeLiteral<Cache<Change.Id, StarredChangeList>> byChangeIdType = new TypeLiteral<Cache<Change.Id, StarredChangeList>>() {}; core(byChangeIdType, BY_CHANGE_ID).populateWith(ByChangeIdLoader.class); bind(StarredChangesCacheImpl.class); bind(StarredChangesCache.class).to(StarredChangesCacheImpl.class); } }; }
Source:
<code>public void execute() { dataObject.removeNestedClass( nestedClass ); DataObjectChangeEvent event = new DataObjectChangeEvent( ChangeType.NESTED_CLASS_REMOVE_CHANGE, <START> getContext().getContextId(), getSource(), getDataObject(), null, nestedClass, null ); <END> notifyChange( event ); }</code><technical_language>null nestedClass changed places. This DataObjectEvent a clean DataObjectRemove/AddNestedClasCommands split remove need for nulls. a a codes I "todos", is planning do this. Right I suggest touch it. .withParemeterName() checkNotNull for values care about</technical_language>

Target:
public void execute() { dataObject.removeNestedClass( nestedClass ); DataModelerEvent event = new DataObjectChangeEvent() .withChangeType( ChangeType.NESTED_CLASS_REMOVE_CHANGE ) .withOldValue( nestedClass ) .withNewValue( null ) .withContextId( getContext().getContextId() ) .withSource( getSource() ) .withCurrentDataObject( getDataObject() ); notifyChange( event ); }
Source:
<code>public Object buildValue(Value value, GraphQLType requiredType) { Object result = null; if (requiredType instanceof GraphQLNonNull) { requiredType = ((GraphQLNonNull) requiredType).getWrappedType(); <START> assertNotNull(value, "A AST value is required to be present for non null type ;" + requiredType.getName() + "'"); <END> } if (value == null) { return null; } if (requiredType instanceof GraphQLScalarType) { result = parseLiteral(value, (GraphQLScalarType) requiredType); } else if (value instanceof EnumValue && requiredType instanceof GraphQLEnumType) { result = ((EnumValue) value).getName(); } else if (value instanceof ArrayValue && requiredType instanceof GraphQLList) { ArrayValue arrayValue = (ArrayValue) value; GraphQLType wrappedType = ((GraphQLList) requiredType).getWrappedType(); result = arrayValue.getValues().stream() .map(item -> this.buildValue(item, wrappedType)).collect(Collectors.toList()); } else if (value instanceof ObjectValue && requiredType instanceof GraphQLInputObjectType) { result = buildObjectValue((ObjectValue) value, (GraphQLInputObjectType) requiredType); } else if (value != null && !(value instanceof NullValue)) { assertShouldNeverHappen( "cannot build value of %s from %s", requiredType.getName(), String.valueOf(value)); } return result; }</code><technical_language>@bbakerman</technical_language>

Target:
public Object buildValue(Value value, GraphQLType requiredType) { Object result = null; if (requiredType instanceof GraphQLNonNull) { requiredType = ((GraphQLNonNull) requiredType).getWrappedType(); } if (value == null) { return null; } if (requiredType instanceof GraphQLScalarType) { result = parseLiteral(value, (GraphQLScalarType) requiredType); } else if (value instanceof EnumValue && requiredType instanceof GraphQLEnumType) { result = ((EnumValue) value).getName(); } else if (value instanceof ArrayValue && requiredType instanceof GraphQLList) { ArrayValue arrayValue = (ArrayValue) value; GraphQLType wrappedType = ((GraphQLList) requiredType).getWrappedType(); result = arrayValue.getValues().stream() .map(item -> this.buildValue(item, wrappedType)).collect(Collectors.toList()); } else if (value instanceof ObjectValue && requiredType instanceof GraphQLInputObjectType) { result = buildObjectValue((ObjectValue) value, (GraphQLInputObjectType) requiredType); } else if (value != null && !(value instanceof NullValue)) { assertShouldNeverHappen( "cannot build value of %s from %s", requiredType.getName(), String.valueOf(value)); } return result; }
Source:
<code>private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptStreamActivationOperation( Flux<ByteBuffer> buffer, long length, FormContentType formContentType, boolean includeTextDetails) { return (pollingContext) -> { try { return service.analyzeReceiptAsyncWithResponseAsync(includeTextDetails, ContentType.fromString(formContentType.toString()), buffer, length) .map(response -> { <START> final AnalyzeReceiptAsyncHeaders headers = response.getDeserializedHeaders(); <END> return new OperationResult(parseModelId(headers.getOperationLocation())); }); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }</code><technical_language>receiptAnalyzeActivationOperation receiptStreamActivationOperation identical. Consider reducing a single method</technical_language>

Target:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptStreamActivationOperation( Flux<ByteBuffer> buffer, long length, FormContentType formContentType, boolean includeTextDetails) { return (pollingContext) -> { try { return service.analyzeReceiptAsyncWithResponseAsync(includeTextDetails, ContentType.fromString(formContentType.toString()), buffer, length) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
<code>public int getIndex(Tree<T> node) { <START> if (node == null) { <END> throw new IllegalArgumentException(NULL_NODE_ARGUMENT); } return this.children.indexOf(node); }</code><technical_language>Preconditions.checkArgument() here, if like</technical_language>

Target:
public int getIndex(Tree<T> node) { Preconditions.checkNotNull(node, NULL_NODE_ARGUMENT); return this.children.indexOf(node); }
Source:
<code>protected List<Path> getDefaultKnownHostsFiles(@NonNull File sshDir) { <START> return Arrays.asList(sshDir.toPath().resolve("known_hosts"), sshDir.toPath().resolve("known_hosts2"), sshDir.toPath().resolve(this.knownHostsFile)); <END> }</code><technical_language>known_hosts2 is obsolete now, I check known_hosts default</technical_language>

Target:
protected List<Path> getDefaultKnownHostsFiles(@NonNull File sshDir) { return Collections.singletonList(sshDir.toPath().resolve(this.knownHostsFile)); }
Source:
<code>public void enable() { CommandBook.inst().createDefaultConfiguration("kits.txt"); kits = new FlatFileKitsManager(new File(CommandBook.inst().getDataFolder(), "kits.txt")); kits.load(); CommandBook.server().getScheduler().scheduleAsyncRepeatingTask( CommandBook.inst(), new GarbageCollector(this), GarbageCollector.CHECK_FREQUENCY, GarbageCollector.CHECK_FREQUENCY); registerCommands(Commands.class); config = configure(new LocalConfiguration()); if (config.joinKit) { <START> CommandBook.registerEvents(this); <END> } }</code><technical_language>spacing is</technical_language>

Target:
public void enable() { CommandBook.inst().createDefaultConfiguration("kits.txt"); kits = new FlatFileKitsManager(new File(CommandBook.inst().getDataFolder(), "kits.txt")); kits.load(); CommandBook.server().getScheduler().scheduleAsyncRepeatingTask( CommandBook.inst(), new GarbageCollector(this), GarbageCollector.CHECK_FREQUENCY, GarbageCollector.CHECK_FREQUENCY); registerCommands(Commands.class); CommandBook.registerEvents(this); }
Source:
<code>public SimpleSubprocedurePool(String name, Configuration conf) { this.name = name; <START> executor = new ThreadPoolExecutor(1, 1, 500, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), <END> new ThreadFactoryBuilder().setNameFormat("rs(" + name + ")-procedure-pool-%d").build()); taskPool = new ExecutorCompletionService<>(executor); }</code><technical_language>This is a bizarre instantiation, think? keep-alive of 500 seconds? in a test? this Executors.newSingleThreadExecutor()</technical_language>

Target:
public SimpleSubprocedurePool(String name, Configuration conf) { this.name = name; executor = Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setNameFormat("rs(" + name + ")-procedure-pool-%d").build()); taskPool = new ExecutorCompletionService<>(executor); }
Source:
<code>public String locate(Class<?> sqlObjectType, Method method, ConfigRegistry config) { Function<String, String> valueOrMethodNameToSql = key -> { String filename = key.isEmpty() ? method.getName() : key; <START> return org.jdbi.v3.core.locator.ClasspathSqlLocator.findSqlOnClasspath(sqlObjectType, filename); <END> }; return SqlAnnotations.getAnnotationValue(method, valueOrMethodNameToSql) .orElseThrow(() -> new IllegalStateException(String.format("method %s has no query annotations", method))); }</code><technical_language>this import short reference now</technical_language>

Target:
public String locate(Class<?> sqlObjectType, Method method, ConfigRegistry config) { Function<String, String> valueOrMethodNameToSql = key -> { String filename = key.isEmpty() ? method.getName() : key; return ClasspathSqlLocator.findSqlOnClasspath(sqlObjectType, filename); }; return SqlAnnotations.getAnnotationValue(method, valueOrMethodNameToSql) .orElseThrow(() -> new IllegalStateException(String.format("method %s has no query annotations", method))); }
Source:
<code><START> private static Dsn resolveDsn(Lookup lookup, @Nullable String dsn) { <END> try { if (Util.isNullOrEmpty(dsn)) { dsn = Dsn.dsnFrom(lookup); } return new Dsn(dsn); } catch (Exception e) { logger.error("Error creating valid DSN from: '{}'.", dsn, e); throw e; } }</code><technical_language>this belong in SentryOptions? In other SDKs more a POJO type of class. methods pulled out internal helper class</technical_language>

Target:
private static String resolveDsn(Lookup lookup, @Nullable String dsn) { try { if (Util.isNullOrEmpty(dsn)) { dsn = Dsn.dsnFrom(lookup); } return dsn; } catch (Exception e) { logger.error("Error creating valid DSN from: '{}'.", dsn, e); throw e; } }
Source:
<code>public void run(TableLoadOption... tableLoadOptions) { final ActionableItemListDialog ld = new ActionableItemListDialog( Active.Active, "Select Actionable Items to Review\n\nNOTE: To create a review against " + "an Action and Team Workflow\nopen the object in ATS and select the " + "review to create from the editor."); int result = ld.open(); <START> if (result == 0) { <END> final EntryDialog ed = new EntryDialog("Peer Review Title", "Enter Peer Review Title"); if (ed.open() == 0) { try { SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Stand-alone Peer To Peer Review"); PeerToPeerReviewArtifact peerArt = PeerToPeerReviewManager.createNewPeerToPeerReview(ld.getSelected().iterator().next(), ed.getEntry(), null, new Date(), AtsUsersClient.getUser(), transaction); peerArt.persist(transaction); AtsUtil.openATSAction(peerArt, AtsOpenOption.OpenAll); transaction.execute(); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } }</code><technical_language>Window.OK instead of 0</technical_language>

Target:
public void run(TableLoadOption... tableLoadOptions) { final ActionableItemListDialog ld = new ActionableItemListDialog( Active.Active, "Select Actionable Items to Review\n\nNOTE: To create a review against " + "an Action and Team Workflow\nopen the object in ATS and select the " + "review to create from the editor."); int result = ld.open(); if (result == Window.OK) { final EntryDialog ed = new EntryDialog("Peer Review Title", "Enter Peer Review Title"); if (ed.open() == Window.OK) { try { if (ld.getSelected().isEmpty()) { AWorkbench.popup("Must select at least one Actionable Item"); return; } SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Stand-alone Peer To Peer Review"); PeerToPeerReviewArtifact peerArt = PeerToPeerReviewManager.createNewPeerToPeerReview(ld.getSelected().iterator().next(), ed.getEntry(), null, new Date(), AtsUsersClient.getUser(), transaction); peerArt.persist(transaction); transaction.execute(); AtsUtil.openATSAction(peerArt, AtsOpenOption.OpenAll); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } }
Source:
<code><START> public ArrayAccessTree DIMENSIONAL_OFFSET() { <END> return b.<ArrayAccessTree>nonterminal() .is(f.dimensionalOffset( b.token(LBRACKET), b.optional(EXPRESSION()), b.token(RBRACKET) )); }</code><technical_language>![MAJOR](<LINK_1> Rename this method name match regular expression '^[a-z][a-zA-Z0-9]*$'. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public ArrayAccessTree DIMENSIONAL_OFFSET() { return b.<ArrayAccessTree>nonterminal(PHPLexicalGrammar.DIMENSIONAL_OFFSET) .is(f.dimensionalOffset( b.token(LBRACKET), b.optional(EXPRESSION()), b.token(RBRACKET) )); }
Source:
<code>public PutStatus put(final K key, final V value) throws StoreAccessException { putObserver.begin(); PutStatus status = silentPut(key, value); switch (status) { case PUT: putObserver.end(StoreOperationOutcomes.PutOutcome.PUT); break; case UPDATE: putObserver.end(StoreOperationOutcomes.PutOutcome.REPLACED); break; case NOOP: putObserver.end(StoreOperationOutcomes.PutOutcome.NOOP); break; default: <START> throw new IllegalArgumentException("Invalid put status: " + status); <END> } return status; }</code><technical_language>picky here, this throw AssertionError instead of IllegalArgumentException this exception caused user code, internal bug</technical_language>

Target:
public PutStatus put(final K key, final V value) throws StoreAccessException { putObserver.begin(); PutStatus status = silentPut(key, value); switch (status) { case PUT: putObserver.end(StoreOperationOutcomes.PutOutcome.PUT); break; case UPDATE: putObserver.end(StoreOperationOutcomes.PutOutcome.REPLACED); break; case NOOP: putObserver.end(StoreOperationOutcomes.PutOutcome.NOOP); break; default: throw new AssertionError("Invalid put status: " + status); } return status; }
Source:
<code>private boolean hasSpace(Resource resource) { Resource usedResources = this.getTotalUsedResources(); long newRam = usedResources.getRam() + resource.getRam(); double newCpu = usedResources.getCpu() + resource.getCpu(); long newDisk = usedResources.getDisk() + resource.getDisk(); <START> return newRam + (paddingPercentage * newRam) / 100 <= this.capacity.getRam() <END> && Math.round(newCpu + (paddingPercentage * newCpu) / 100) <= this.capacity.getCpu() && newDisk + (paddingPercentage * newDisk) / 100 <= this.capacity.getDisk(); }</code><technical_language>This calc redone in places. create utility methods for padding in PackingUtils? this maybe? public static long increaseBy(long value, long percent);</technical_language>

Target:
private boolean hasSpace(Resource resource) { Resource usedResources = this.getTotalUsedResources(); long newRam = usedResources.getRam() + resource.getRam(); double newCpu = usedResources.getCpu() + resource.getCpu(); long newDisk = usedResources.getDisk() + resource.getDisk(); return PackingUtils.increaseBy(newRam, paddingPercentage) <= this.capacity.getRam() && Math.round(PackingUtils.increaseBy(newCpu, paddingPercentage)) <= this.capacity.getCpu() && PackingUtils.increaseBy(newDisk, paddingPercentage) <= this.capacity.getDisk(); }
Source:
<code>public synchronized Map<String, Object> currentState() { Map<String, Object> state = new HashMap<>(); state.put("sessionMap", sessionMap); <START> state.put("sessionGap", sessionGap); <END> state.put("allowedLatency", allowedLatency); state.put("sessionContainer", sessionContainer); state.put("expiredEventChunk", expiredEventChunk); return state; }</code><technical_language>dont need persist sessionGap allowedLatency input parameters</technical_language>

Target:
public synchronized Map<String, Object> currentState() { Map<String, Object> state = new HashMap<>(); state.put("sessionMap", sessionMap); state.put("sessionContainer", sessionContainer); state.put("expiredEventChunk", expiredEventChunk); return state; }
Source:
<code>public AuditLogType getAuditLogTypeValue() { <START> addCustomValue("Details", String.format("Rebooted by user: %s", getUserName())); <END> return getSucceeded() ? AuditLogType.VM_REBOOT : AuditLogType.USER_FAILED_REBOOT_VM; }</code><technical_language>wy "%s", getUserName change VM_REBOOT audit log string "rebooted by: <>" fill in user name "the guest" this translated</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { addCustomValue("UserName", String.format("%s", getUserName())); return getSucceeded() ? AuditLogType.USER_REBOOT_VM : AuditLogType.USER_FAILED_REBOOT_VM; }
Source:
<code><START> public ApplyResult call() { <END> ApplyResult r = new ApplyResult(); try { final Patch p = new Patch(); try { p.parse(in); } finally { in.close(); } if (!p.getErrors().isEmpty()) return r.setFormatErrors(p.getErrors()); for (FileHeader fh : p.getFiles()) { ChangeType type = fh.getChangeType(); File f = null; switch (type) { case ADD: f = getFile(fh.getNewPath(), true); apply(f, fh, r); break; case MODIFY: f = getFile(fh.getOldPath(), false); apply(f, fh, r); break; case DELETE: f = getFile(fh.getOldPath(), false); if (!f.delete()) r.addApplyError(new ApplyError(fh, ChangeType.DELETE)); break; case RENAME: f = getFile(fh.getOldPath(), false); File dest = getFile(fh.getNewPath(), false); if (!f.renameTo(dest)) r.addApplyError(new ApplyError(fh, ChangeType.RENAME)); break; case COPY: f = getFile(fh.getOldPath(), false); byte[] bs = IO.readFully(f); FileWriter fw = new FileWriter(getFile(fh.getNewPath(), true)); fw.write(new String(bs)); fw.close(); } } } catch (IOException e) { r.addApplyError(new ApplyError(e)); } return r; }</code><technical_language>Commands declare throw GitAPIException for exceptions supposed handled clients, specific exceptions subclasses of GitAPIException. JGitInternalException wrap internal exception clients handle in a reasonable way</technical_language>

Target:
public ApplyResult call() throws GitAPIException { checkCallable(); ApplyResult r = new ApplyResult(); try { final Patch p = new Patch(); try { p.parse(in); } finally { in.close(); } if (!p.getErrors().isEmpty()) throw new PatchFormatException(p.getErrors()); for (FileHeader fh : p.getFiles()) { ChangeType type = fh.getChangeType(); File f = null; switch (type) { case ADD: f = getFile(fh.getNewPath(), true); apply(f, fh); break; case MODIFY: f = getFile(fh.getOldPath(), false); apply(f, fh); break; case DELETE: f = getFile(fh.getOldPath(), false); if (!f.delete()) throw new PatchApplyException(MessageFormat.format( JGitText.get().cannotDeleteFile, f)); break; case RENAME: f = getFile(fh.getOldPath(), false); File dest = getFile(fh.getNewPath(), false); if (!f.renameTo(dest)) throw new PatchApplyException(MessageFormat.format( JGitText.get().renameFileFailed, f, dest)); break; case COPY: f = getFile(fh.getOldPath(), false); byte[] bs = IO.readFully(f); FileWriter fw = new FileWriter(getFile(fh.getNewPath(), true)); fw.write(new String(bs)); fw.close(); } r.addUpdatedFile(f); } } catch (IOException e) { throw new PatchApplyException(MessageFormat.format( JGitText.get().patchApplyException, e.getMessage()), e); } setCallable(false); return r; }
Source:
<code>private List<BaseReport<V>> constructReport(int iTypeOfReport) { logger.entering(iTypeOfReport); List<BaseReport<V>> lb = new ArrayList<BaseReport<V>>(); final int ONE = 1; @SuppressWarnings("rawtypes") BaseReport b; for (String indReport : this.reportData.keySet()) { if (iTypeOfReport == 0) { b = new SummaryReport(indReport); <START> } else if (ONE == iTypeOfReport) { <END> b = new DetailsReport(indReport); } else { b = new TestOutputReport(indReport); } b.setLstEntities(this.reportData.get(indReport)); lb.add(b); } logger.exiting(lb); return lb; }</code><technical_language>again, this change is silly.. revert/allow this</technical_language>

Target:
private List<BaseReport<V>> constructReport(int iTypeOfReport) { logger.entering(iTypeOfReport); List<BaseReport<V>> lb = new ArrayList<BaseReport<V>>(); @SuppressWarnings("rawtypes") BaseReport b; for (String indReport : this.reportData.keySet()) { if (iTypeOfReport == 0) { b = new SummaryReport(indReport); } else if (1 == iTypeOfReport) { b = new DetailsReport(indReport); } else { b = new TestOutputReport(indReport); } b.setLstEntities(this.reportData.get(indReport)); lb.add(b); } logger.exiting(lb); return lb; }
Source:
<code>private Object optimize(Object ctx, Object thisValue, VariableResolverFactory factory) { if ((fields & DEOP) != 0) { fields ^= DEOP; } AccessorOptimizer optimizer; Object retVal = null; <START> if ((fields & NOJIT) != 0 || factory != null && nameCache !=null && factory.isResolveable(nameCache)) { <END> optimizer = getAccessorCompiler(SAFE_REFLECTIVE); } else { optimizer = getDefaultAccessorCompiler(); } ParserContext pCtx; if ((fields & PCTX_STORED) != 0) { pCtx = (ParserContext) literal; } else { pCtx = new ParserContext(new ParserConfiguration(getInjectedImports(factory), null)); } try { pCtx.optimizationNotify(); setAccessor(optimizer.optimizeAccessor(pCtx, expr, start, offset, ctx, thisValue, factory, true, egressType)); } catch (OptimizationNotSupported ne) { setAccessor((optimizer = getAccessorCompiler(SAFE_REFLECTIVE)) .optimizeAccessor(pCtx, expr, start, offset, ctx, thisValue, factory, true, null)); } if (accessor == null) { return get(expr, start, offset, ctx, factory, thisValue, pCtx); } if (retVal == null) { retVal = optimizer.getResultOptPass(); } if (egressType == null) { egressType = optimizer.getEgressType(); } return retVal; }</code><technical_language>I this fix is correct. In opinion do a null check, accessing property name getName() method if ((fields & NOJIT) != 0 || factory != null && factory.isResolveable(getName())) { @gmunozfe Please if want update PR want push fix suggesting master</technical_language>

Target:
private Object optimize(Object ctx, Object thisValue, VariableResolverFactory factory) { if ((fields & DEOP) != 0) { fields ^= DEOP; } AccessorOptimizer optimizer; Object retVal = null; if ((fields & NOJIT) != 0 || factory != null && factory.isResolveable(getName())) { optimizer = getAccessorCompiler(SAFE_REFLECTIVE); } else { optimizer = getDefaultAccessorCompiler(); } ParserContext pCtx; if ((fields & PCTX_STORED) != 0) { pCtx = (ParserContext) literal; } else { pCtx = new ParserContext(new ParserConfiguration(getInjectedImports(factory), null)); } try { pCtx.optimizationNotify(); setAccessor(optimizer.optimizeAccessor(pCtx, expr, start, offset, ctx, thisValue, factory, true, egressType)); } catch (OptimizationNotSupported ne) { setAccessor((optimizer = getAccessorCompiler(SAFE_REFLECTIVE)) .optimizeAccessor(pCtx, expr, start, offset, ctx, thisValue, factory, true, null)); } if (accessor == null) { return get(expr, start, offset, ctx, factory, thisValue, pCtx); } if (retVal == null) { retVal = optimizer.getResultOptPass(); } if (egressType == null) { egressType = optimizer.getEgressType(); } return retVal; }
Source:
<code>private boolean isValidRepositoryName(String repositoryName, CommandInterpreter interpreter) { <START> if (repositoryName == null) { <END> interpreter.println( "Repository name should be specified. Execute 'listrepositories' to see the available repositories."); return false; } ICDORepositoryManager repositoryManager = ApplicationContext.getServiceForClass(ICDORepositoryManager.class); Set<String> uuidKeySet = repositoryManager.uuidKeySet(); if (!uuidKeySet.contains(repositoryName)) { interpreter.println("Could not find repository called: " + repositoryName); interpreter.println("Available repository names are: " + uuidKeySet); return false; } return true; }</code><technical_language>Remove this if statement code handle null case. nicely print out existing repository names in case of nullOrEmpty</technical_language>

Target:
private boolean isValidRepositoryName(String repositoryName, CommandInterpreter interpreter) { Set<String> uuidKeySet = getRepositoryManager().uuidKeySet(); if (!uuidKeySet.contains(repositoryName)) { interpreter.println("Could not find repository called: " + repositoryName); interpreter.println("Available repository names are: " + uuidKeySet); return false; } return true; }
Source:
<code>public void create_multiple_domain_objects_success() { databaseHelper.addObject("" + "inet6num: 2a01:500::/22\n" + "mnt-by: TEST-MNT\n" + "mnt-domains: TEST-MNT\n" + "mnt-domains: XS4ALL-MNT\n" + "source: TEST"); final List<RpslObject> domains = Lists.newArrayList(); for (int i = 4; i < 8; i++) { final RpslObject domain = RpslObject.parse(String.format("" + "domain: %d.0.1.0.a.2.ip6.arpa\n" + "descr: Reverse delegation for 2a01:500::/22\n" + "admin-c: JAAP-TEST\n" + "tech-c: JAAP-TEST\n" + "zone-c: JAAP-TEST\n" + "nserver: ns1.example.com\n" + "nserver: ns2.example.com\n" + "mnt-by: TEST-MNT\n" + "source: TEST", i)); domains.add(domain); } final WhoisResources response = RestTest.target(getPort(), "whois/domain-objects/TEST") .request() .cookie("crowd.token_key", "valid-token") .post(Entity.entity(mapRpslObjects(domains.toArray(new RpslObject[0])), MediaType.APPLICATION_JSON_TYPE), WhoisResources.class); RestTest.assertErrorCount(response, 0); <START> assertThat(response.getWhoisObjects(), hasSize(4)); <END> }</code><technical_language>check database for domain objects? databaseHelper.lookupObject()</technical_language>

Target:
public void create_multiple_domain_objects_success() { databaseHelper.addObject("" + "inet6num: 2a01:500::/22\n" + "mnt-by: TEST-MNT\n" + "mnt-domains: TEST-MNT\n" + "mnt-domains: TEST2-MNT\n" + "source: TEST"); final List<RpslObject> domains = Lists.newArrayList(); for (int i = 4; i < 8; i++) { final RpslObject domain = RpslObject.parse(String.format("" + "domain: %d.0.1.0.a.2.ip6.arpa\n" + "descr: Reverse delegation for 2a01:500::/22\n" + "admin-c: JAAP-TEST\n" + "tech-c: JAAP-TEST\n" + "zone-c: JAAP-TEST\n" + "nserver: ns1.example.com\n" + "nserver: ns2.example.com\n" + "mnt-by: TEST-MNT\n" + "source: TEST", i)); domains.add(domain); } final WhoisResources response = RestTest.target(getPort(), "whois/domain-objects/TEST") .request() .cookie("crowd.token_key", "valid-token") .post(Entity.entity(mapRpslObjects(domains.toArray(new RpslObject[0])), MediaType.APPLICATION_JSON_TYPE), WhoisResources.class); RestTest.assertErrorCount(response, 0); assertThat(response.getWhoisObjects(), hasSize(4)); }
Source:
<code>public void testObjSortedCollector() { Cache<Integer, String> cache = getCache(0); int range = 10; IntStream.range(0, range).boxed().forEach(i -> cache.put(i, i + "-value")); assertEquals(range, cache.size()); CacheSet<Map.Entry<Integer, String>> entrySet = cache.entrySet(); List<Map.Entry<Integer, String>> list = createStream(entrySet).sorted( (e1, e2) -> Integer.compare(e1.getKey(), e2.getKey())).collect( <START> () -> Collectors.toList()); <END> assertEquals(cache.size(), list.size()); AtomicInteger i = new AtomicInteger(); list.forEach(e -> { assertEquals(i.getAndIncrement(), e.getKey().intValue()); assertEquals(cache.get(e.getKey()), e.getValue()); }); }</code><technical_language>Man I wish nested generics work a bit better. Sad serializableCollector works new :(</technical_language>

Target:
public void testObjSortedCollector() { Cache<Integer, String> cache = getCache(0); int range = 10; IntStream.range(0, range).boxed().forEach(i -> cache.put(i, i + "-value")); assertEquals(range, cache.size()); CacheSet<Map.Entry<Integer, String>> entrySet = cache.entrySet(); List<Map.Entry<Integer, String>> list = createStream(entrySet).sorted( (e1, e2) -> Integer.compare(e1.getKey(), e2.getKey())).collect( Collectors::<Map.Entry<Integer, String>>toList); assertEquals(cache.size(), list.size()); AtomicInteger i = new AtomicInteger(); list.forEach(e -> { assertEquals(i.getAndIncrement(), e.getKey().intValue()); assertEquals(cache.get(e.getKey()), e.getValue()); }); }
Source:
<code>private void startListFragment(byte[] bytes, Uri dataUri, String serverQuery, Preferences.CloudSearchPrefs cloudSearchPrefs) { Fragment listFragment = ImportKeysListFragment.newInstance(bytes, dataUri, serverQuery, false, cloudSearchPrefs); getSupportFragmentManager().beginTransaction() .replace(R.id.import_keys_list_container, listFragment, TAG_FRAG_LIST) <START> .commitAllowingStateLoss(); <END> }</code><technical_language>a fan of commitAllowingStateLoss, general android advice is a resort only. handling onNewIntent</technical_language>

Target:
private void startListFragment(byte[] bytes, Uri dataUri, String serverQuery, Preferences.CloudSearchPrefs cloudSearchPrefs) { Fragment listFragment = ImportKeysListFragment.newInstance(bytes, dataUri, serverQuery, false, cloudSearchPrefs); getSupportFragmentManager().beginTransaction() .replace(R.id.import_keys_list_container, listFragment, TAG_FRAG_LIST) .commit(); }
Source:
<code>private static Pair<Integer, Integer> stepFromString(String step){ if(step.endsWith("J")){ <START> return new Pair<>(Integer.parseInt("" + step.substring(0, step.length()-1)), -10); <END> } String[] split = step.split("[._:]"); int i = Integer.parseInt(split[0].trim()); int mult = -1; try{ mult = Integer.parseInt(split[1].trim()); } catch(IndexOutOfBoundsException | NullPointerException e){ } return new Pair<>(i, mult); }</code><technical_language>Guessing -10 TreeReference.INDEX_REPEAT_JUNCTURE</technical_language>

Target:
private static Pair<Integer, Integer> stepFromString(String step) { if (step.endsWith("J")) { return new Pair<>(Integer.parseInt("" + step.substring(0, step.length() - 1)), TreeReference.INDEX_REPEAT_JUNCTURE); } String[] split = step.split("[._:]"); int i = Integer.parseInt(split[0].trim()); int mult = -1; if (split.length > 1 && split[1] != null) { mult = Integer.parseInt(split[1].trim()); } return new Pair<>(i, mult); }
Source:
<code>public void consumeGrist(PlayerIdentifier identifier, boolean sound) { if(this.world.isRemote) throw new IllegalStateException("Grist entities shouldn't be consumed client-side."); if(sound) this.playSound(SoundEvents.ENTITY_ITEM_PICKUP, 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); <START> GristHelper.notify(world.getServer(), identifier, new GristSet(gristType, gristValue), true); <END> GristHelper.increase(world, identifier, new GristSet(gristType, gristValue)); this.remove(); }</code><technical_language>increase notify</technical_language>

Target:
public void consumeGrist(PlayerIdentifier identifier, boolean sound) { if(this.world.isRemote) throw new IllegalStateException("Grist entities shouldn't be consumed client-side."); if(sound) this.playSound(SoundEvents.ENTITY_ITEM_PICKUP, 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); GristHelper.increase(world, identifier, new GristSet(gristType, gristValue)); GristHelper.notify(world.getServer(), identifier, new GristSet(gristType, gristValue)); this.remove(); }
Source:
<code>public void test_getRemoteSocketAddress() throws Exception { try (DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK)) { try (DatagramSocket s = new DatagramSocket(0)) { s.connect(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort())); assertEquals(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort()), s.getRemoteSocketAddress()); } try (DatagramSocket theSocket = new DatagramSocket(null)) { theSocket.bind(new <START> InetSocketAddress(InetAddress.getLocalHost(), 0)); <END> assertNull(theSocket.getRemoteSocketAddress()); theSocket.connect(new InetSocketAddress(Inet4Address.LOOPBACK, server.getPort())); assertEquals(new InetSocketAddress(Inet4Address.LOOPBACK, server.getPort()), theSocket.getRemoteSocketAddress()); } } }</code><technical_language>Lorenzo, is correct undefined InetAddress.getLocalHost() is IPv4 mapped IPv6 address? If so, discussed, consider IPv6 localhost/loopback here</technical_language>

Target:
public void test_getRemoteSocketAddress() throws Exception { try (DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK)) { try (DatagramSocket s = new DatagramSocket(0)) { s.connect(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort())); assertEquals(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort()), s.getRemoteSocketAddress()); } try (DatagramSocket theSocket = new DatagramSocket(null)) { theSocket.bind(new InetSocketAddress(Inet6Address.LOOPBACK, 0)); assertNull(theSocket.getRemoteSocketAddress()); theSocket.connect(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort())); assertEquals(new InetSocketAddress(Inet6Address.LOOPBACK, server.getPort()), theSocket.getRemoteSocketAddress()); } } }
Source:
<code>public static LocalQueryRunner queryRunnerWithInitialTransaction(Session defaultSession) { return queryRunnerWithInitialTransaction(defaultSession, new FeaturesConfig()); <START> } <END></code><technical_language>I need change this file if default multimapAggGroupImplementation NEW</technical_language>

Target:
public static LocalQueryRunner queryRunnerWithInitialTransaction(Session defaultSession) { checkArgument(!defaultSession.getTransactionId().isPresent(), "Already in transaction!"); return new LocalQueryRunner(defaultSession, new FeaturesConfig(), new NodeSpillConfig(), true, false); }
Source:
<code>public static void checkNotNullOrEmpty(String param, String errorMessagePrefix) throws IllegalArgumentException { checkArgument(!isStringNullOrEmpty(param), (errorMessagePrefix != null ? errorMessagePrefix : "Parameter") + " must not be " + param == null ? "null." : "empty."); <START> checkArgument(!isStringNullOrEmpty(param), errorMessagePrefix + " must not be empty."); <END> }</code><technical_language>re-added line, left new code in place, check twice</technical_language>

Target:
public static void checkNotNullOrEmpty(String param, String errorMessagePrefix) throws IllegalArgumentException { checkArgument(!isStringNullOrEmpty(param), (errorMessagePrefix != null ? errorMessagePrefix : "Parameter") + " must not be " + param == null ? "null." : "empty."); }
Source:
<code>protected void updateUsbNativeMessageVisibility(final UnitVmModel object) { nativeUsbWarningMessage.setVisible(object.getUsbPolicy().getSelectedItem() == UsbPolicy.ENABLED_NATIVE <START> && Version.v3_2.compareTo(((VDSGroup) object.getCluster().getSelectedItem()).getcompatibility_version()) > 0); <END> }</code><technical_language>mmm, configuration</technical_language>

Target:
protected void updateUsbNativeMessageVisibility(final UnitVmModel object) { nativeUsbWarningMessage.setVisible(object.getUsbPolicy().getSelectedItem() == UsbPolicy.ENABLED_NATIVE && Config.<Boolean> GetValue(ConfigValues.MigrationSupportForNativeUsb, ((VDSGroup) object.getCluster() .getSelectedItem()).getcompatibility_version().toString())); }
Source:
<code>public void newFolderWithPathsContainingFileSeparatorCreatesFullPath() throws IOException { tempFolder.create(); tempFolder.newFolder("temp1", "temp2", "temp3" + File.separator + "temp4"); File directory = new File(tempFolder.getRoot(), "temp1"); assertFileIsDirectory(directory); directory = new File(directory, "temp2"); assertFileIsDirectory(directory); directory = new File(directory, "temp3"); assertFileIsDirectory(directory); directory = new File(directory, "temp4"); <START> assertFileIsDirectory(directory); <END> }</code><technical_language>sufficient a single assertion: assertFileIsDirectory(new File(tempFolder.getRoot(), "temp1/temp2/temp3/temp4")</technical_language>

Target:
public void newFolderWithPathsContainingFileSeparatorCreatesFullPath() throws IOException { tempFolder.create(); tempFolder.newFolder("temp1", "temp2", "temp3" + File.separator + "temp4"); File directory = new File(tempFolder.getRoot(), "temp1"); assertFileIsDirectory(directory); directory = new File(directory, "temp2/temp3/temp4"); assertFileIsDirectory(directory); }
Source:
<code>public final Mono<Key> prepend(WritePolicy policy, Key key, Bin... bins) throws AerospikeException { <START> return Mono.create(sink -> aerospikeClient.prepend(eventLoops.next(), new WriteListener() { <END> @Override public void onSuccess(Key key) { sink.success(key); } @Override public void onFailure(AerospikeException exception) { sink.error(exception); } }, policy, key, bins)); }</code><technical_language>AsyncClient is deprecated retrieving event loop some additional checks. please check AsyncClient.findEventLoop</technical_language>

Target:
public final Mono<Key> prepend(WritePolicy policy, Key key, Bin... bins) throws AerospikeException { return Mono.create(sink -> aerospikeClient.prepend( eventLoops.next(), new ReactorWriteListener(sink), policy, key, bins)); }
Source:
<code><START> public ByteArrayOutputStream encode(Object object) throws SerializationException { <END> Schema schema = AvroSchemaUtils.getSchema(object); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); if (object instanceof byte[]) { out.write((byte[]) object); } else { BinaryEncoder encoder = encoderFactory.directBinaryEncoder(out, null); DatumWriter<Object> writer; if (object instanceof SpecificRecord) { writer = new SpecificDatumWriter<>(schema); } else { writer = new GenericDatumWriter<>(schema); } writer.write(object, encoder); encoder.flush(); } out.close(); return out; } catch (IOException | RuntimeException e) { throw logger.logExceptionAsError( new SerializationException("Error serializing Avro message", e)); } }</code><technical_language>throws SerializationException is required</technical_language>

Target:
public ByteArrayOutputStream encode(Object object) { Schema schema = AvroSchemaUtils.getSchema(object); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); if (object instanceof byte[]) { out.write((byte[]) object); } else { BinaryEncoder encoder = ENCODER_FACTORY.directBinaryEncoder(out, null); DatumWriter<Object> writer; if (object instanceof SpecificRecord) { writer = new SpecificDatumWriter<>(schema); } else { writer = new GenericDatumWriter<>(schema); } writer.write(object, encoder); encoder.flush(); } return out; } catch (IOException | RuntimeException e) { throw logger.logExceptionAsError( new SerializationException("Error serializing Avro message", e)); } }
Source:
<code>void configureMirror(MirrorRepository mirrorRepository, TypeUrl stateType) { checkState(mirrorRepository.isMirroring(stateType), <START> "An aggregate type %s is not mirrored by a `MirrorRepository`.", stateType); <END> aggregateMirror = new Mirror<>(mirrorRepository, stateType, isMultitenant()); }</code><technical_language>aggregate of type %s is mirrored a MirrorRepository</technical_language>

Target:
void configureMirror(MirrorRepository mirrorRepository, TypeUrl stateType) { checkState(mirrorRepository.isMirroring(stateType), "An aggregate of type `%s` is not mirrored by a `MirrorRepository`.", stateType); aggregateMirror = new Mirror<>(mirrorRepository, stateType, isMultitenant()); }
Source:
<code>public Task call() throws TaskExecutionException { getTask().setGenStartTime(new Date(System.currentTimeMillis())); Service service = getTask().getService(); <START> log.debug("[{}] Executing GEN worker for Task with Service ID: and Facility ID: {}.", <END> getTask().getId(), getTask().getServiceId(), getTask().getFacilityId()); ProcessBuilder pb = new ProcessBuilder(service.getScript(), "-f", String.valueOf(getTask().getFacilityId())); try { super.execute(pb); getTask().setGenEndTime(new Date(System.currentTimeMillis())); if (getReturnCode() != 0) { log.error("[{}] GEN worker failed for Task. Ret code {}, STDOUT: {}, STDERR: {}", getTask().getId(), getReturnCode(), getStdout(), getStderr()); throw new TaskExecutionException(task, getReturnCode(), getStdout(), getStderr()); } else { log.info("[{}] GEN worker finished for Task. Ret code {}, STDOUT: {}, STDERR: {}", getTask().getId(), getReturnCode(), getStdout(), getStderr()); return getTask(); } } catch (IOException e) { log.error("[{}] GEN worker failed for Task. IOException: {}.", task.getId(), e); throw new TaskExecutionException(task, e); } catch (InterruptedException e) { log.warn("[{}] GEN worker failed for Task. Execution was interrupted {}.", task.getId(), e); throw new TaskExecutionException(task, e); } }</code><technical_language>Please this in info level. Right engine consistently logs processing of task, grep logs "[taskId]" happened it. state change is in info level, enable debug failed</technical_language>

Target:
public Task call() throws TaskExecutionException { getTask().setGenStartTime(new Date(System.currentTimeMillis())); Service service = getTask().getService(); log.info("[{}] Executing GEN worker for Task with Service ID: and Facility ID: {}.", getTask().getId(), getTask().getServiceId(), getTask().getFacilityId()); ProcessBuilder pb = new ProcessBuilder(service.getScript(), "-f", String.valueOf(getTask().getFacilityId())); try { super.execute(pb); getTask().setGenEndTime(new Date(System.currentTimeMillis())); if (getReturnCode() != 0) { log.error("[{}] GEN worker failed for Task. Ret code {}, STDOUT: {}, STDERR: {}", getTask().getId(), getReturnCode(), getStdout(), getStderr()); throw new TaskExecutionException(task, getReturnCode(), getStdout(), getStderr()); } else { log.info("[{}] GEN worker finished for Task. Ret code {}, STDOUT: {}, STDERR: {}", getTask().getId(), getReturnCode(), getStdout(), getStderr()); return getTask(); } } catch (IOException e) { log.error("[{}] GEN worker failed for Task. IOException: {}.", task.getId(), e); throw new TaskExecutionException(task, e); } catch (InterruptedException e) { log.warn("[{}] GEN worker failed for Task. Execution was interrupted {}.", task.getId(), e); throw new TaskExecutionException(task, e); } }
Source:
<code>private <T> QueryRunner<T> makeRunner(final Query<T> query) { final QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); final QueryRunner<T> baseRunner = CPUTimeMetricQueryRunner.safeBuild( new FinalizeResultsQueryRunner<T>( toolChest.postMergeQueryDecoration( toolChest.mergeResults( toolChest.preMergeQueryDecoration( new RetryQueryRunner<T>( baseClient, toolChest, retryConfig, objectMapper ) ) ) ), toolChest ), new Function<Query<T>, ServiceMetricEvent.Builder>() { @Nullable @Override public ServiceMetricEvent.Builder apply(Query<T> tQuery) { return toolChest.makeMetricBuilder(tQuery); } }, emitter, <START> new AtomicLong(0L), <END> true ); final Map<String, Object> context = query.getContext(); PostProcessingOperator<T> postProcessing = null; if (context != null) { postProcessing = objectMapper.convertValue( context.get("postProcessing"), new TypeReference<PostProcessingOperator<T>>() { } ); } return postProcessing != null ? postProcessing.postProcess(baseRunner) : baseRunner; }</code><technical_language>is a purpose passing this value</technical_language>

Target:
private <T> QueryRunner<T> makeRunner(final Query<T> query) { final QueryToolChest<T, Query<T>> toolChest = warehouse.getToolChest(query); final QueryRunner<T> baseRunner = CPUTimeMetricQueryRunner.safeBuild( new FinalizeResultsQueryRunner<T>( toolChest.postMergeQueryDecoration( toolChest.mergeResults( new UnionQueryRunner<T>( toolChest.preMergeQueryDecoration( new RetryQueryRunner<T>( baseClient, toolChest, retryConfig, objectMapper ) ), toolChest ) ) ), toolChest ), new Function<Query<T>, ServiceMetricEvent.Builder>() { @Nullable @Override public ServiceMetricEvent.Builder apply(Query<T> tQuery) { return toolChest.makeMetricBuilder(tQuery); } }, emitter, new AtomicLong(0L), true ); final Map<String, Object> context = query.getContext(); PostProcessingOperator<T> postProcessing = null; if (context != null) { postProcessing = objectMapper.convertValue( context.get("postProcessing"), new TypeReference<PostProcessingOperator<T>>() { } ); } return postProcessing != null ? postProcessing.postProcess(baseRunner) : baseRunner; }
Source:
<code>public void run() { directoryProviderLock.lock(); try { long start = System.nanoTime(); int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); try { log.tracef( "Copying %s into %s", source, destinationFile ); FileHelper.synchronize( source, destinationFile, true, copyChunkSize ); current = index; } catch (IOException e) { log.unableToSynchronizeSource( indexName, e ); return; } try { Files.delete( destination.resolve( CURRENT_DIR_NAME[oldIndex] ) ); Files.createFile( destination.resolve( CURRENT_DIR_NAME[index] ) ); <START> } <END> catch (IOException e) { log.unableToCreateCurrentMarker( indexName, e ); } log.tracef( "Copy for %s took %d ms", indexName, TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - start ) ); } finally { directoryProviderLock.unlock(); inProgress.set( false ); } }</code><technical_language>want log.unableToRemovePreviousMarket anymore... ? (By way, method renamed unableToRemovePreviousMarke*r*)</technical_language>

Target:
public void run() { directoryProviderLock.lock(); final boolean traceEnabled = log.isTraceEnabled(); try { long startTime = 0; if ( traceEnabled ) { startTime = System.nanoTime(); } int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); try { log.tracef( "Copying %s into %s", source, destinationFile ); FileHelper.synchronize( source, destinationFile, true ); current = index; } catch (IOException e) { log.unableToSynchronizeSource( indexDir.toString(), e ); return; } try { Files.delete( destination.resolve( CURRENT_DIR_NAME[oldIndex] ) ); } catch (IOException e) { log.unableToRemovePreviousMarker( indexDir.toString(), e ); } try { Files.createFile( destination.resolve( CURRENT_DIR_NAME[index] ) ); } catch (IOException e) { log.unableToCreateCurrentMarker( indexDir.toString(), e ); } if ( traceEnabled ) { log.tracef( "Copy for %s took %d ms", indexDir.toString(), TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - startTime ) ); } } finally { directoryProviderLock.unlock(); inProgress.set( false ); } }
Source:
<code>public boolean determineDoubleRelationshipRecordUnits( Estimates inputEstimates ) { doubleRelationshipRecordUnits = <START> recordFormats.relationship().getMaxId() > 2L << 36 && <END> inputEstimates.numberOfRelationships() > DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD; return doubleRelationshipRecordUnits; }</code><technical_language>2L << 36 extracted constant</technical_language>

Target:
public boolean determineDoubleRelationshipRecordUnits( Estimates inputEstimates ) { doubleRelationshipRecordUnits = recordFormats.hasCapability( Capability.SECONDARY_RECORD_UNITS ) && inputEstimates.numberOfRelationships() > DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD; return doubleRelationshipRecordUnits; }