auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<ScheduledSystemJob> getScheduledSystemJobsForUser() throws SchedulerException { List<ScheduledSystemJob> ssJobs = new ArrayList<ScheduledSystemJob>(); Scheduler scheduler = getScheduler(); <START> for (String group : scheduler.getTriggerGroupNames()) { for (TriggerKey triggerKey : scheduler.getTriggerKeys(groupEquals(group))) { if (scheduler.getTrigger(triggerKey).getJobKey().getGroup().equalsIgnoreCase(SYSTEM_JOBS_KEY)) { if (doesUserHavePermissionToTrigger(scheduler.getTrigger(triggerKey))) { Trigger curTrigger = getScheduler().getTrigger(triggerKey); String jobName = curTrigger.getKey().getName(); JobDetail jobDetail = getScheduler().getJobDetail(getScheduler().getTrigger(triggerKey).getJobKey()); String jobDescription = jobDetail.getDescription(); Date nextRunDate = curTrigger.getNextFireTime(); if (curTrigger instanceof CronTrigger) { ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.REPEATABLE)); } else if (curTrigger instanceof SimpleTrigger) { jobName = curTrigger.getJobKey().getName(); ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.ONE_TIME)); } } } } } <END> return ssJobs; }</code><technical_language>hold this up, organize this a more functionally streams</technical_language>

Target:
public List<ScheduledSystemJob> getScheduledSystemJobsForUser() throws SchedulerException { List<ScheduledSystemJob> ssJobs = new ArrayList<ScheduledSystemJob>(); Scheduler scheduler = getScheduler(); for (String group : scheduler.getTriggerGroupNames()) { for (TriggerKey triggerKey : scheduler.getTriggerKeys(groupEquals(group))) { if (scheduler.getTrigger(triggerKey).getJobKey().getGroup().equalsIgnoreCase(SYSTEM_JOBS_KEY)) { Trigger curTrigger = getScheduler().getTrigger(triggerKey); String jobName = curTrigger.getKey().getName(); JobDetail jobDetail = getScheduler().getJobDetail(getScheduler().getTrigger(triggerKey).getJobKey()); String jobDescription = jobDetail.getDescription(); Date nextRunDate = curTrigger.getNextFireTime(); if (curTrigger instanceof CronTrigger) { ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.REPEATABLE)); } else if (curTrigger instanceof SimpleTrigger) { jobName = curTrigger.getJobKey().getName(); ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.ONE_TIME)); } } } } return ssJobs; }
Source:
<code>public static int getBookmark(final String fullPathToFile) { boolean trace = LOGGER.isTraceEnabled(); int result = 0; try (Connection connection = database.getConnection()) { String query = "SELECT BOOKMARK FROM " + TABLE_NAME + " WHERE FILENAME = " + sqlQuote(fullPathToFile); if (trace) { LOGGER.trace("Searching " + TABLE_NAME + " with \"{}\"", query); } TABLE_LOCK.readLock().lock(); try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery(query)) { if (resultSet.next()) { result = resultSet.getInt("BOOKMARK"); } } } finally { TABLE_LOCK.readLock().unlock(); } } catch (SQLException e) { <START> LOGGER.error("Database error while looking up file status in " + TABLE_NAME + " for \"{}\": {}", fullPathToFile, e.getMessage()); <END> LOGGER.trace("", e); } return result; }</code><technical_language>suggestion LOGGER.error("Database error while file bookmark in " + TABLE_NAME + " for \"{}\": {}", fullPathToFile, e.getMessage());</technical_language>

Target:
public static int getBookmark(final String fullPathToFile) { boolean trace = LOGGER.isTraceEnabled(); int result = 0; try (Connection connection = database.getConnection()) { String query = "SELECT BOOKMARK FROM " + TABLE_NAME + " WHERE FILENAME = " + sqlQuote(fullPathToFile); if (trace) { LOGGER.trace("Searching " + TABLE_NAME + " with \"{}\"", query); } TABLE_LOCK.readLock().lock(); try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery(query)) { if (resultSet.next()) { result = resultSet.getInt("BOOKMARK"); } } } finally { TABLE_LOCK.readLock().unlock(); } } catch (SQLException e) { LOGGER.error("Database error while looking up file bookmark in " + TABLE_NAME + " for \"{}\": {}", fullPathToFile, e.getMessage()); LOGGER.trace("", e); } return result; }
Source:
<code>public void serialize( final Duration duration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (duration != null) { <START> jsonGenerator.writeString(Util.encode(duration.toString())); <END> } else { jsonGenerator.writeNull(); } }</code><technical_language>is necessary encode duration iso standard</technical_language>

Target:
public void serialize( final Duration duration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (duration != null) { jsonGenerator.writeString(duration.toString()); } else { jsonGenerator.writeNull(); } }
Source:
<code>protected void doStart() throws Exception { FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(firebaseConfig.getRootReference()) <START> .addChildEventListener(new ChildEventListener() { <END> @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_ADD, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onChildChanged(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_CHANGED, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onChildRemoved(DataSnapshot dataSnapshot) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_REMOVED, dataSnapshot).build()); } @Override public void onChildMoved(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_MOVED, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onCancelled(DatabaseError databaseError) { forwardMessage(new FirebaseMessage.Builder(Operation.CANCELLED).setDatabaseError(databaseError) .build()); } }); }</code><technical_language>nicer move this a separate class a big inlined listener in doStart method</technical_language>

Target:
protected void doStart() throws Exception { FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(firebaseConfig.getRootReference()) .addChildEventListener(new FirebaseConsumerEventListener()); }
Source:
<code>public Repository open(final HttpServletRequest req, final String repositoryName) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(repositoryName)) throw new RepositoryNotFoundException(repositoryName); final Repository db; try { final File gitdir = new File(basePath, repositoryName); db = RepositoryCache.open(FileKey.lenient(gitdir), true); } catch (IOException e) { final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); <START> notFound.initCause(e); <END> throw notFound; } try { if (isExportOk(req, repositoryName, db)) return db; else throw new ServiceNotEnabledException(); } catch (RuntimeException e) { db.close(); final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); notFound.initCause(e); throw notFound; } catch (IOException e) { db.close(); final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); notFound.initCause(e); throw notFound; } catch (ServiceNotEnabledException e) { db.close(); throw e; } }</code><technical_language>Add a constructor support parameter instead</technical_language>

Target:
public Repository open(final HttpServletRequest req, final String repositoryName) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(repositoryName)) throw new RepositoryNotFoundException(repositoryName); final Repository db; try { final File gitdir = new File(basePath, repositoryName); db = RepositoryCache.open(FileKey.lenient(gitdir), true); } catch (IOException e) { throw new RepositoryNotFoundException(repositoryName, e); } try { if (isExportOk(req, repositoryName, db)) { return db; } else throw new ServiceNotEnabledException(); } catch (RuntimeException e) { db.close(); throw new RepositoryNotFoundException(repositoryName, e); } catch (IOException e) { db.close(); throw new RepositoryNotFoundException(repositoryName, e); } catch (ServiceNotEnabledException e) { db.close(); throw e; } }
Source:
<code>public Response getDatabaseSegments(@Context final HttpServletRequest req) { final Collection<ImmutableDruidDataSource> druidDataSources = metadataSegmentManager.getInventory(); final Stream<DataSegment> metadataSegments = druidDataSources .stream() .flatMap(t -> t.getSegments().stream()); Function<DataSegment, Iterable<ResourceAction>> raGenerator = segment -> Collections.singletonList( AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource())); final Iterable<DataSegment> authorizedSegments = AuthorizationUtils.filterAuthorizedResources( <START> req, () -> metadataSegments.iterator(), raGenerator, authorizerMapper); <END> final StreamingOutput stream = outputStream -> { final JsonFactory jsonFactory = jsonMapper.getFactory(); try (final JsonGenerator jsonGenerator = jsonFactory.createGenerator(outputStream)) { jsonGenerator.writeStartArray(); for (DataSegment ds : authorizedSegments) { jsonGenerator.writeObject(ds); jsonGenerator.flush(); } jsonGenerator.writeEndArray(); } }; Response.ResponseBuilder builder = Response.status(Response.Status.OK); return builder.entity(stream).build(); }</code><technical_language>minor: () -> metadataSegments.iterator() written metadataSegments::iterator</technical_language>

Target:
public Response getDatabaseSegments(@Context final HttpServletRequest req) { final Collection<ImmutableDruidDataSource> druidDataSources = metadataSegmentManager.getInventory(); final Stream<DataSegment> metadataSegments = druidDataSources .stream() .flatMap(t -> t.getSegments().stream()); Function<DataSegment, Iterable<ResourceAction>> raGenerator = segment -> Collections.singletonList( AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource())); final Iterable<DataSegment> authorizedSegments = AuthorizationUtils.filterAuthorizedResources( req, metadataSegments::iterator, raGenerator, authorizerMapper); final StreamingOutput stream = outputStream -> { final JsonFactory jsonFactory = jsonMapper.getFactory(); try (final JsonGenerator jsonGenerator = jsonFactory.createGenerator(outputStream)) { jsonGenerator.writeStartArray(); for (DataSegment ds : authorizedSegments) { jsonGenerator.writeObject(ds); jsonGenerator.flush(); } jsonGenerator.writeEndArray(); } }; Response.ResponseBuilder builder = Response.status(Response.Status.OK); return builder.entity(stream).build(); }
Source:
<code><START> public static String getHostIP() { <END> try { final Enumeration<NetworkInterface> b = NetworkInterface.getNetworkInterfaces(); while (b.hasMoreElements()) { for (final InterfaceAddress f : b.nextElement().getInterfaceAddresses()) { if (f.getAddress().isSiteLocalAddress()) { return f.getAddress().toString().replace("/", ""); } } } } catch (SocketException e) { e.printStackTrace(); } return null; }</code><technical_language>this this class? if not, private</technical_language>

Target:
public static String getHostIP() throws SocketException { String hostIP = null; final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); outer_cycle: while (networkInterfaces.hasMoreElements()) { for (final InterfaceAddress interfaceAddress : networkInterfaces.nextElement().getInterfaceAddresses()) { if (interfaceAddress.getAddress().isSiteLocalAddress()) { hostIP = interfaceAddress.getAddress().toString().replace("/", ""); break outer_cycle; } } } if (hostIP == null) { throw new IllegalStateException("No local network address is found."); } return hostIP; }
Source:
<code>public void addTxContext(ClientTxContext txCtx) { if (txsCnt.incrementAndGet() > ACTIVE_TX_LIMIT) { txsCnt.decrementAndGet(); throw new IgniteClientException(ClientStatus.TX_LIMIT_EXCEEDED, "Active transactions per connection limit " + "(" + ACTIVE_TX_LIMIT + ") exceeded. To start a new transaction you need to wait for some of currently " + <START> "active transactions complete. To change the limit set up " + IGNITE_THIN_MAX_ACTIVE_TX_PER_CONNECTION + <END> " servers system property."); } txs.put(txCtx.txId(), txCtx); }</code><technical_language>above, system properties for this</technical_language>

Target:
public void addTxContext(ClientTxContext txCtx) { if (txsCnt.incrementAndGet() > maxActiveTxCnt) { txsCnt.decrementAndGet(); throw new IgniteClientException(ClientStatus.TX_LIMIT_EXCEEDED, "Active transactions per connection limit " + "(" + maxActiveTxCnt + ") exceeded. To start a new transaction you need to wait for some of currently " + "active transactions complete. To change the limit set up " + "ThinClientConfiguration.MaxActiveTxPerConnection property."); } txs.put(txCtx.txId(), txCtx); }
Source:
<code><START> public synchronized int join() throws IOException, InterruptedException { <END> try { procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); final int returnCode = procHolderForJoin.join(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[] {procHolderForJoin, returnCode}); } return returnCode; } finally { procHolderForJoin = null; } }</code><technical_language>I want do is: Proc proc = start(); try { return proc.join(); } finally { if (proc.isAlive()) { // happen this forces Proc removed early GC escape analysis LOGGER.log(Level.WARNING, "Process finished call join() completed"); } } advantage of reducing memory footprint localizing hack a single method</technical_language>

Target:
public int join() throws IOException, InterruptedException { final Proc procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); try { final int returnCode = procHolderForJoin.join(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); } return returnCode; } finally { if (procHolderForJoin.isAlive()) { LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); } } }
Source:
<code>public User toNewUser() { User user = new User(username, password, uniqueId, getUserType()); user.setRecordId(recordId); user.setWrappedKey(getWrappedKey()); user.properties = getProperties(); user.setLastSyncToken(syncToken); <START> user.setRememberMe(this.rememberMe == true); END> return user; }</code><technical_language>Lol! remove that, right :)</technical_language>

Target:
public User toNewUser() { User user = new User(username, password, uniqueId, getUserType()); user.setRecordId(recordId); user.setWrappedKey(getWrappedKey()); user.properties = getProperties(); user.setLastSyncToken(syncToken); user.setRememberMe(this.rememberMe); return user; }
Source:
<code>public void testBuildTableBad_02() { try { SSE.parseOp("(table (vars ?x) (row (?x _:anon)))"); <START> Assert.fail("Parsing should fail"); <END> } catch (ExprBuildException e) { } }</code><technical_language>this parse OK? SPARQL syntax allow blank nodes in VALUES, harm (table) parsing more general. Table class is a list of Bindings Binding blank nodes. Table for intermediate results in ref engine</technical_language>

Target:
public void testBuildTableBad_02() { SSE.parseOp("(table (vars ?x) (row (?x _)))"); }
Source:
<code>public boolean hasFinishedBuild(String id) throws RestServiceException { ClientResponse response = null; try { LOGGER.info("Calling getById VCPENetworkManager service"); String url = getURL("vcpenetwork/hasFinishedBuild/" + id); Client client = Client.create(); WebResource webResource = client.resource(url); response = webResource.accept(MediaType.APPLICATION_XML).get(ClientResponse.class); LOGGER.info("VCPENetwork recovered"); } catch (ClientHandlerException e) { LOGGER.error(e.getMessage()); throw e; } <START> String result; <END> result = (checkResponse(response) ? response.getEntity(String.class) : null); return Boolean.parseBoolean(result); }</code><technical_language>beginning of method</technical_language>

Target:
public boolean hasFinishedBuild(String id) throws RestServiceException { String result; ClientResponse response = null; try { LOGGER.info("Calling getById VCPENetworkManager service"); String url = getURL("vcpenetwork/hasFinishedBuild/" + id); Client client = Client.create(); WebResource webResource = client.resource(url); response = webResource.accept(MediaType.APPLICATION_XML).get(ClientResponse.class); LOGGER.info("VCPENetwork recovered"); } catch (ClientHandlerException e) { LOGGER.error(e.getMessage()); throw e; } result = (checkResponse(response) ? response.getEntity(String.class) : null); return Boolean.parseBoolean(result); }
Source:
<code>Telemetry(final String tags, final StatsDProcessor processor) { <START> this.tags = tags; <END> this.tags = tags; this.processor = processor; this.timer = null; }</code><technical_language>This line is duplicated</technical_language>

Target:
Telemetry(final String tags, final StatsDProcessor processor) { this.tags = tags; this.processor = processor; this.timer = null; }
Source:
<code>public static Collection<Object[]> data() { Object[][] data = new Object[][] { { "endpoint-7.2.xml", 16, "schema/jboss-infinispan-endpoint_7_2.xsd" }, { "endpoint-8.0.xml", 16, "schema/jboss-infinispan-endpoint_8_0.xsd" }, <START> { "endpoint-9.0.xml", 38, null }, <END> }; return Arrays.asList(data); }</code><technical_language>ignoring template tests</technical_language>

Target:
public static Collection<Object[]> data() { Object[][] data = new Object[][] { { "endpoint-7.2.xml", 16, "schema/jboss-infinispan-endpoint_7_2.xsd" }, { "endpoint-8.0.xml", 16, "schema/jboss-infinispan-endpoint_8_0.xsd" }, { "endpoint-9.0.xml", 38, "schema/jboss-infinispan-endpoint_9_0.xsd" }, }; return Arrays.asList(data); }
Source:
<code>public boolean labels( String[] labels ) { checkClear(); <START> for ( String label : labels ) <END> { this.labels.add( label ); } return delegate.labels( labels ); }</code><technical_language>Collections.addAll</technical_language>

Target:
public boolean labels( String[] labels ) { checkClear(); Collections.addAll( this.labels, labels ); return delegate.labels( labels ); }
Source:
<code>public OptimizerAssert on(Function<PlanBuilder, PlanNode> planProvider) { <START> checkArgument(plan == null, "plan has already been set"); <END> PlanBuilder builder = new PlanBuilder(idAllocator, metadata); plan = planProvider.apply(builder); types = builder.getTypes(); return this; }</code><technical_language>checkState</technical_language>

Target:
public OptimizerAssert on(Function<PlanBuilder, PlanNode> planProvider) { checkState(plan == null, "plan has already been set"); PlanBuilder builder = new PlanBuilder(idAllocator, metadata); plan = planProvider.apply(builder); types = builder.getTypes(); return this; }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { M_log.debug("doFilter: Called"); HttpServletRequest useRequest = (HttpServletRequest) request; HttpServletResponse useResponse=(HttpServletResponse)response; if ( BASIC_LTI_LAUNCH_REQUEST.equals(request.getParameter(LTI_MESSAGE_TYPE))) { M_log.debug("new launch so invalidate any existing session"); if (useRequest.getSession() != null) { M_log.debug("session id to invalidate: " + useRequest.getSession().getId()); useRequest.getSession().invalidate(); } } HttpSession session= useRequest.getSession(true); M_log.debug("session id: "+session.getId()); <START> if(!checkForAuthorization(useRequest)) { <END> useResponse.sendError(403); return; } chain.doFilter(useRequest, response); }</code><technical_language>I understood Filter is called for service desk LTI launch... checkForAuthorization() is called for LTI launch</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { M_log.debug("doFilter: Called"); HttpServletRequest useRequest = (HttpServletRequest) request; HttpServletResponse useResponse=(HttpServletResponse)response; if ( BASIC_LTI_LAUNCH_REQUEST.equals(request.getParameter(LTI_MESSAGE_TYPE))) { M_log.debug("new launch so invalidate any existing session"); if (useRequest.getSession() != null) { M_log.info("session id to invalidate: " + useRequest.getSession().getId()); useRequest.getSession().invalidate(); } } HttpSession session= useRequest.getSession(true); M_log.debug("session id: "+session.getId()); if(!checkForAuthorization(useRequest)) { useResponse.sendError(403); return; } chain.doFilter(useRequest, response); }
Source:
<code>public Mono<MsalToken> authenticateWithBrowserInteraction(TokenRequestContext request, int port) { URI redirectUri; try { <START> redirectUri = new URI(String.format("http://localhost:%s", port)); <END> } catch (URISyntaxException e) { return Mono.error(logger.logExceptionAsError(new RuntimeException(e))); } InteractiveRequestParameters parameters = InteractiveRequestParameters.builder(redirectUri) .scopes(new HashSet<>(request.getScopes())) .build(); Mono<IAuthenticationResult> acquireToken = publicClientApplicationAccessor.getValue() .flatMap(pc -> Mono.fromFuture(() -> pc.acquireToken(parameters))); return acquireToken.onErrorMap(t -> new ClientAuthenticationException( "Failed to acquire token with Interactive Browser Authentication.", null, t)).map(MsalToken::new); }</code><technical_language>string constants</technical_language>

Target:
public Mono<MsalToken> authenticateWithBrowserInteraction(TokenRequestContext request, int port) { URI redirectUri; try { redirectUri = new URI(HTTP_LOCALHOST + ":" + port); } catch (URISyntaxException e) { return Mono.error(logger.logExceptionAsError(new RuntimeException(e))); } InteractiveRequestParameters parameters = InteractiveRequestParameters.builder(redirectUri) .scopes(new HashSet<>(request.getScopes())) .build(); Mono<IAuthenticationResult> acquireToken = publicClientApplicationAccessor.getValue() .flatMap(pc -> Mono.fromFuture(() -> pc.acquireToken(parameters))); return acquireToken.onErrorMap(t -> new ClientAuthenticationException( "Failed to acquire token with Interactive Browser Authentication.", null, t)).map(MsalToken::new); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.content_tours, null); ButterKnife.inject(this, view); mitapiClient = new MITAPIClient(getActivity().getApplicationContext()); mitapiClient.get(Constants.TOURS, Constants.Tours.TOUR_PATH, null, null, new Callback<List<MITTourWrapper>>() { @Override public void success(List<MITTourWrapper> mitTourWrappers, Response response) { MITTourWrapper mitTourWrapper = mitTourWrappers.get(0); setTourInfoView(mitTourWrapper); } @Override public void failure(RetrofitError error) { } }); selfGuidedTourView.setBackground(getResources().getDrawable(R.drawable.tours_cover_image)); <START> moreGuidedToursTextView.setOnClickListener(new View.OnClickListener() { <END> @Override public void onClick(View v) { openWebsiteDialog(); } }); sendFeedbackView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendFeedback(); } }); mitInfoCenterView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openOutsideWebsite(getResources().getString(R.string.mit_about_guided_tour_url)); } }); mitAdmissionsView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openOutsideWebsite(getResources().getString(R.string.mit_admissions_url)); } }); return view; }</code><technical_language>If Butterknife inject views, for click handling, for sake of consistency</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.content_tours, null); ButterKnife.inject(this, view); mitApiClient = new MITAPIClient(getActivity().getApplicationContext()); mitApiClient.get(Constants.TOURS, Constants.Tours.TOUR_PATH, null, null, new Callback<List<MITTourWrapper>>() { @Override public void success(List<MITTourWrapper> mitTourWrappers, Response response) { MITTourWrapper mitTourWrapper = mitTourWrappers.get(0); setTourInfoView(mitTourWrapper); } @Override public void failure(RetrofitError error) { } }); selfGuidedTourView.setBackground(getResources().getDrawable(R.drawable.tours_cover_image)); return view; }
Source:
<code>protected void decorateRequired() { if (decoration == null) { decoration = new ControlDecoration(getLabelControl(), SWT.TOP | SWT.RIGHT); decoration.setDescriptionText(Messages.AbstractAttributeEditor_AttributeIsRequired); decoration.setMarginWidth(0); Image image = FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR) .getImage(); decoration.setImage(image); <START> getLabelControl().addDisposeListener(new DisposeListener() { <END> public void widgetDisposed(DisposeEvent e) { if (decoration != null) { decoration.dispose(); decoration = null; } } }); } }</code><technical_language>I if instead of creating decoration time disposing it, create life cycle editor, show hide needed. though; I a performance problem if decorators, this is better</technical_language>

Target:
protected void decorateRequired() { if (decoration == null) { decoration = new ControlDecoration(getLabelControl(), SWT.TOP | SWT.RIGHT); decoration.setDescriptionText(Messages.AbstractAttributeEditor_AttributeIsRequired); decoration.setMarginWidth(0); Image image = FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR) .getImage(); decoration.setImage(image); getLabelControl().addDisposeListener(disposeDecorationListener); } }
Source:
<code>public SelectIterator(final Iterator<E> itr, final Condition<E> cond) { this.condition = cond; this.iterator = itr; <START> if (this.iterator.hasNext()) { <END> this.current.add(this.iterator.next()); } }</code><technical_language>again, do this in ctor. if user calls next()? touching iterable. wrong</technical_language>

Target:
public SelectIterator(final Iterator<E> itr, final Condition<E> cond) { this.condition = cond; this.iterator = itr; }
Source:
<code>public GrammarAST(int type, Token t, String text) { <START> this(new CommonToken(type, text)); <END> if ( t instanceof CommonToken ) { ((CommonToken) token).setStartIndex(((CommonToken) t).getStartIndex()); ((CommonToken) token).setStopIndex(((CommonToken) t).getStopIndex()); } token.setInputStream(t.getInputStream()); token.setLine(t.getLine()); token.setCharPositionInLine(t.getCharPositionInLine()); token.setTokenIndex(t.getTokenIndex()); }</code><technical_language>This block as: java this(new CommonToken(t)); token.setType(type); token.setText(text);</technical_language>

Target:
public GrammarAST(int type, Token t, String text) { this(new CommonToken(t)); token.setType(type); token.setText(text); }
Source:
<code>public int filter(Page page, int[] positions, int positionCount, RuntimeException[] errors) { checkArgument(positionCount <= positions.length); checkArgument(positionCount <= errors.length); <START> if (inputChannels.length == 1 && page.getBlock(0) instanceof DictionaryBlock && deterministic) { <END> return filterWithDictionary(page, positions, positionCount, errors); } int outputCount = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; try { if (predicate.evaluate(session, page, position)) { positions[outputCount] = position; errors[outputCount] = errors[i]; outputCount++; } } catch (RuntimeException e) { positions[outputCount] = position; errors[outputCount] = e; outputCount++; } } return outputCount; }</code><technical_language>nit: put cheapest check first, e.g. if (deterministic && ...)</technical_language>

Target:
public int filter(Page page, int[] positions, int positionCount, RuntimeException[] errors) { checkArgument(positionCount <= positions.length); checkArgument(positionCount <= errors.length); if (deterministic && inputChannels.length == 1 && page.getBlock(0) instanceof DictionaryBlock) { return filterWithDictionary(page, positions, positionCount, errors); } int outputCount = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; try { if (predicate.evaluate(session, page, position)) { positions[outputCount] = position; errors[outputCount] = errors[i]; outputCount++; } } catch (RuntimeException e) { positions[outputCount] = position; errors[outputCount] = e; outputCount++; } } return outputCount; }
Source:
<code>public void testCreateViewFromNonExistentTable() throws Exception { try (Connection conn = DriverManager.getConnection(getUrl())) { conn.createStatement().execute( "CREATE TABLE IF NOT EXISTS S.T1 (A INTEGER PRIMARY KEY, B INTEGER)"); try { conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V1(C INTEGER) AS SELECT * FROM T2"); } catch (TableNotFoundException e) { <START> assertEquals("T2", e.getTableName()); <END> assertEquals("", e.getSchemaName()); assertEquals("ERROR 1012 (42M03): Table undefined. tableName=T2", e.getMessage()); } conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V1(C INTEGER) AS SELECT * FROM S.T1"); try { conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V2(C INTEGER) AS SELECT * FROM S.T2"); } catch (TableNotFoundException e) { assertEquals("T2", e.getTableName()); assertEquals("S", e.getSchemaName()); assertEquals("ERROR 1012 (42M03): Table undefined. tableName=S.T2", e.getMessage()); } } }</code><technical_language>add a flag code catch block? likes: flag = false; try { } catch { flag = true; } assertTrue(flag)</technical_language>

Target:
public void testCreateViewFromNonExistentTable() throws Exception { try (Connection conn = DriverManager.getConnection(getUrl())) { conn.createStatement().execute( "CREATE TABLE IF NOT EXISTS S.T1 (A INTEGER PRIMARY KEY, B INTEGER)"); try { conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V1(C INTEGER) AS SELECT * FROM T2"); fail("Creating view on non-existent table should have failed"); } catch (TableNotFoundException e) { assertEquals("T2", e.getTableName()); assertEquals("", e.getSchemaName()); assertEquals("ERROR 1012 (42M03): Table undefined. tableName=T2", e.getMessage()); } conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V1(C INTEGER) AS SELECT * FROM S.T1"); try { conn.createStatement().execute( "CREATE VIEW IF NOT EXISTS V2(C INTEGER) AS SELECT * FROM S.T2"); fail("Creating view on non-existent table should have failed"); } catch (TableNotFoundException e) { assertEquals("T2", e.getTableName()); assertEquals("S", e.getSchemaName()); assertEquals("ERROR 1012 (42M03): Table undefined. tableName=S.T2", e.getMessage()); } } }
Source:
<code>public void testFillArrayANDNOT() { LongBuffer data1 = LongBuffer.wrap(new long[]{1, 2, 4, 8, 16}); LongBuffer data2 = LongBuffer.wrap(new long[]{2, 1, 3, 7, 15}); LongBuffer data3 = LongBuffer.wrap(new long[]{2, 1, 3, 7}); short[] content = new short[5]; short[] content2 = new short[5]; short[] result = {0, 65, 130, 195, 260}; BufferUtil.fillArrayANDNOT(content, data1, data2); Assert.assertTrue(Arrays.equals(content, result)); <START> BufferUtil.fillArrayANDNOT(content2, data1, data3); <END> }</code><technical_language>I move BufferUtil.fillArrayANDNOT in another test expected exception annotation, test more robust. Indeed, if BufferUtil.fillArrayANDNOTis throwing IllegalArgumentException of a new regression, test pass regression unnoticed</technical_language>

Target:
public void testFillArrayANDNOT() { LongBuffer data1 = LongBuffer.wrap(new long[]{1, 2, 4, 8, 16}); LongBuffer data2 = LongBuffer.wrap(new long[]{2, 1, 3, 7, 15}); short[] content = new short[5]; short[] result = {0, 65, 130, 195, 260}; BufferUtil.fillArrayANDNOT(content, data1, data2); Assert.assertTrue(Arrays.equals(content, result)); }
Source:
<code>public static BlockVector2 at(int x, int z) { <START> return new BlockVector2(x, z); <END> }</code><technical_language>This & other switch removals reverted, performance tests show this more efficient. change increases memory usage, making this a net negative change</technical_language>

Target:
public static BlockVector2 at(int x, int z) { switch (x) { case 0: if (z == 0) { return ZERO; } break; case 1: if (z == 1) { return ONE; } break; } return new BlockVector2(x, z); }
Source:
<code>public static DnDTransferItem getTransferItem(@NonNull Transferable transferable, boolean allowPlaceholder) { DnDTransferItem item = null; try { if (transferable.isDataFlavorSupported(ItemTransferable.DESIGNER_FLAVOR)) { item = <START> (DnDTransferItem)transferable.getTransferData(ItemTransferable.DESIGNER_FLAVOR); <END> } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) { String xml = (String)transferable.getTransferData(DataFlavor.stringFlavor); if (!StringUtil.isEmpty(xml)) { item = new DnDTransferItem(new DnDTransferComponent("", xml, 200, 100)); } } } catch (InvalidDnDOperationException ex) { if (!allowPlaceholder) { return null; } String defaultXml = "<placeholder xmlns:android=\"<LINK_1>\"/>"; item = new DnDTransferItem(new DnDTransferComponent("", defaultXml, 200, 100)); } catch (IOException ex) { } catch (UnsupportedFlavorException ex) { } return item; }</code><technical_language>Space cast please. <LINK_0></technical_language>

Target:
public static DnDTransferItem getTransferItem(@NonNull Transferable transferable, boolean allowPlaceholder) { DnDTransferItem item = null; try { if (transferable.isDataFlavorSupported(ItemTransferable.DESIGNER_FLAVOR)) { item = (DnDTransferItem)transferable.getTransferData(ItemTransferable.DESIGNER_FLAVOR); } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) { String xml = (String)transferable.getTransferData(DataFlavor.stringFlavor); if (!StringUtil.isEmpty(xml)) { item = new DnDTransferItem(new DnDTransferComponent("", xml, 200, 100)); } } } catch (InvalidDnDOperationException ex) { if (!allowPlaceholder) { return null; } String defaultXml = "<placeholder xmlns:android=\"<LINK_1>\"/>"; item = new DnDTransferItem(new DnDTransferComponent("", defaultXml, 200, 100)); } catch (IOException ex) { LOG.warn(ex); } catch (UnsupportedFlavorException ex) { LOG.warn(ex); } return item; }
Source:
<code>public Parser getParser() { return inputStream -> { String response = new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining(OS.NEWLINE)); List<BibEntry> entries = new ArrayList<>(); Document doc = Jsoup.parse(response); List<Element> elements = doc.body().getElementsByClass("cite-this-item"); for (Element element : elements) { BibtexParser parser = new BibtexParser(importFormatPreferences, new DummyFileUpdateMonitor()); String id = element.attr("href").replace("citation/info/", ""); try { <START> String data = IOUtils.toString(new URL(CITE_HOST + id), Charsets.UTF_8); <END> entries.addAll(parser.parseEntries(data)); } catch (IOException e) { throw new ParseException("could not download data from jstor.org", e); } } return entries; }; }</code><technical_language>UrlDownload class: URLDownload download = new URLDownload(url); String data = download.asString()</technical_language>

Target:
public Parser getParser() { return inputStream -> { List<BibEntry> entries; try { Document doc = Jsoup.parse(inputStream, null, HOST); List<Element> elements = doc.body().getElementsByClass("cite-this-item"); StringBuilder stringBuilder = new StringBuilder(); for (Element element : elements) { String id = element.attr("href").replace("citation/info/", ""); String data = new URLDownload(CITE_HOST + id).asString(); stringBuilder.append(data); } BibtexParser parser = new BibtexParser(importFormatPreferences, new DummyFileUpdateMonitor()); entries = new ArrayList<>(parser.parseEntries(stringBuilder.toString())); } catch (IOException e) { throw new ParseException("Could not download data from jstor.org", e); } return entries; }; }
Source:
<code><START> public WorkspaceCompilationInfo(Path prjPath, Properties bannedEnvVars) { <END> this.prjPath = prjPath; }</code><technical_language>bannedEnvVars, left</technical_language>

Target:
public WorkspaceCompilationInfo(Path prjPath, Properties bannedEnvVars) { this.prjPath = prjPath; this.bannedEnvVars = bannedEnvVars; }
Source:
<code>public void initialize(BatchRuntimeContext context) throws Exception { super.initialize(context); if (!Strings.isNullOrEmpty(config.drop)) { <START> for (String dropField : Splitter.on(CopybookSourceConfig.fieldDelimiter).split(config.drop)) { <END> fieldsToDrop.add(dropField); } } if (config.maxSplitSize == null) { config.maxSplitSize = DEFAULT_MAX_SPLIT_SIZE_IN_MB * CONVERT_TO_BYTES; } else { config.maxSplitSize = config.maxSplitSize * CONVERT_TO_BYTES; } outputSchema = getOutputSchema(); }</code><technical_language>instead of pattern, do .on(',').trimValues().split(</technical_language>

Target:
public void initialize(BatchRuntimeContext context) throws Exception { super.initialize(context); if (!Strings.isNullOrEmpty(config.drop)) { for (String dropField : Splitter.on(",").trimResults().split(config.drop)) { fieldsToDrop.add(dropField); } } if (config.maxSplitSize == null) { config.maxSplitSize = DEFAULT_MAX_SPLIT_SIZE_IN_MB * CONVERT_TO_BYTES; } else { config.maxSplitSize = config.maxSplitSize * CONVERT_TO_BYTES; } outputSchema = getOutputSchema(); }
Source:
<code>private void scheduleRepairLogTruncateMsg() { SiteTaskerRunnable r = new SiteTaskerRunnable() { @Override void run() { synchronized (m_lock) { if (m_lastSentTruncationHandle < m_repairLogTruncationHandle) { m_lastSentTruncationHandle = m_repairLogTruncationHandle; m_repairLog.notifyTxnCommitInterests(m_lastSentTruncationHandle); <START> if (m_sendToHSIds.length == 0) { <END> return; } final RepairLogTruncationMessage truncMsg = new RepairLogTruncationMessage(m_repairLogTruncationHandle); m_mailbox.deliver(truncMsg); m_mailbox.send(m_sendToHSIds, truncMsg); } } } }; if (hostLog.isDebugEnabled()) { r.taskInfo = "Repair Log Truncate Message Handle:" + m_repairLogTruncationHandle; } m_tasks.offer(r); }</code><technical_language>check if txncommit interests registered here. need schedule task unnecessarily, if DR is enabled</technical_language>

Target:
private void scheduleRepairLogTruncateMsg() { if (m_sendToHSIds.length == 0 && m_repairLog.hasNoTxnCommitInterests()) { return; } SiteTaskerRunnable r = new SiteTaskerRunnable() { @Override void run() { synchronized (m_lock) { if (m_lastSentTruncationHandle < m_repairLogTruncationHandle) { m_lastSentTruncationHandle = m_repairLogTruncationHandle; m_repairLog.notifyTxnCommitInterests(m_lastSentTruncationHandle); if (m_sendToHSIds.length == 0) { return; } final RepairLogTruncationMessage truncMsg = new RepairLogTruncationMessage(m_repairLogTruncationHandle); m_mailbox.deliver(truncMsg); m_mailbox.send(m_sendToHSIds, truncMsg); } } } }; if (hostLog.isDebugEnabled()) { r.taskInfo = "Repair Log Truncate Message Handle:" + m_repairLogTruncationHandle; } m_tasks.offer(r); }
Source:
<code>public static TaskletType fromClassName(String className) { <START> TaskletType type = UNKNOWN; <END> if(className != null) { String name = className.trim(); for (TaskletType curType : values()) { if(curType.className.equals(name)) { type = curType; break; } } } return type; }</code><technical_language>possibly do assertion StringUtils.hasText()</technical_language>

Target:
public static TaskletType fromClassName(String className) { TaskletType type = UNKNOWN; if(StringUtils.hasText(className)) { String name = className.trim(); for (TaskletType curType : values()) { if(curType.className.equals(name)) { type = curType; break; } } } return type; }
Source:
<code>protected boolean isProcessed(ChronicleLogOffsetTracker tracker, long offset) { long last = tracker.readLastCommittedOffset(); <START> return (last > 0) && (last >= offset); <END> }</code><technical_language>need for parentheses</technical_language>

Target:
protected boolean isProcessed(ChronicleLogOffsetTracker tracker, long offset) { long last = tracker.readLastCommittedOffset(); return last > 0 && last >= offset; }
Source:
<code>private boolean isFinalizeDeclaration(MethodTree tree) { <START> return hasSemantic() && isMethodNamedFinalize(tree) && isOverriding(tree) && hasNoParameters(tree); <END> }</code><technical_language>Check for overriding is uncessary</technical_language>

Target:
private boolean isFinalizeDeclaration(MethodTree tree) { return hasSemantic() && isMethodNamedFinalize(tree) && hasNoParameters(tree); }
Source:
<code>void initializeIndexGauges(String storeId, final PersistentIndex index, final long capacityInBytes) { <START> String prefix = storeId + "."; <END> Gauge<Long> currentCapacityUsed = index::getLogUsedCapacity; registry.register(MetricRegistry.name(Log.class, prefix + "CurrentCapacityUsed"), currentCapacityUsed); Gauge<Double> percentageUsedCapacity = () -> ((double) index.getLogUsedCapacity() / capacityInBytes) * 100; registry.register(MetricRegistry.name(Log.class, prefix + "PercentageUsedCapacity"), percentageUsedCapacity); Gauge<Long> currentSegmentCount = index::getLogSegmentCount; registry.register(MetricRegistry.name(Log.class, prefix + "CurrentSegmentCount"), currentSegmentCount); }</code><technical_language>define a constant for "."</technical_language>

Target:
void initializeIndexGauges(String storeId, final PersistentIndex index, final long capacityInBytes) { String prefix = storeId + SEPERATOR; Gauge<Long> currentCapacityUsed = index::getLogUsedCapacity; registry.register(MetricRegistry.name(Log.class, prefix + "CurrentCapacityUsed"), currentCapacityUsed); Gauge<Double> percentageUsedCapacity = () -> ((double) index.getLogUsedCapacity() / capacityInBytes) * 100; registry.register(MetricRegistry.name(Log.class, prefix + "PercentageUsedCapacity"), percentageUsedCapacity); Gauge<Long> currentSegmentCount = index::getLogSegmentCount; registry.register(MetricRegistry.name(Log.class, prefix + "CurrentSegmentCount"), currentSegmentCount); }
Source:
<code>private void addPutEntries(List<Long> offsets, long lastEntrySize, IndexSegment segment, NavigableMap<MockId, IndexValue> referenceIndex) throws StoreException { for (int i = 0; i < offsets.size(); i++) { MockId id; do { id = new MockId(UtilsTest.getRandomString(CUSTOM_ID_SIZE)); } while (referenceIndex.containsKey(id)); long offset = offsets.get(i); long size = i == offsets.size() - 1 ? lastEntrySize : offsets.get(i + 1) - offset; IndexValue value = IndexValueUtils.getIndexValue(size, new Offset(segment.getLogSegmentName(), offset), time.seconds(), version); segment.addEntry(new IndexEntry(id, value), new Offset(segment.getLogSegmentName(), offset + size)); <START> if (resetKey == null) { <END> resetKey = new Pair<StoreKey, PersistentIndex.IndexEntryType>(id, (value.isFlagSet(IndexValue.Flags.Delete_Index)) ? PersistentIndex.IndexEntryType.DELETE : PersistentIndex.IndexEntryType.PUT); } referenceIndex.put(id, value); } }</code><technical_language>I addPutEntries return list of entries added caller generate reset key if required. I prefer if resetKey a class variable</technical_language>

Target:
private List<IndexEntry> addPutEntries(List<Long> offsets, long lastEntrySize, IndexSegment segment, NavigableMap<MockId, IndexValue> referenceIndex) throws StoreException { List<IndexEntry> addedEntries = new ArrayList<>(); for (int i = 0; i < offsets.size(); i++) { MockId id; do { id = new MockId(UtilsTest.getRandomString(CUSTOM_ID_SIZE)); } while (referenceIndex.containsKey(id)); long offset = offsets.get(i); long size = i == offsets.size() - 1 ? lastEntrySize : offsets.get(i + 1) - offset; IndexValue value = IndexValueTest.getIndexValue(size, new Offset(segment.getLogSegmentName(), offset), time.milliseconds(), version); IndexEntry entry = new IndexEntry(id, value); segment.addEntry(entry, new Offset(segment.getLogSegmentName(), offset + size)); addedEntries.add(entry); referenceIndex.put(id, value); } return addedEntries; }
Source:
<code><START> public synchronized boolean stopAndRemoveSupervisor(String id) <END> { Preconditions.checkNotNull(id, "id"); return possiblyStopAndRemoveSupervisorInternal(id, true); }</code><technical_language>do need synchronize 'this' a lock</technical_language>

Target:
public boolean stopAndRemoveSupervisor(String id) { Preconditions.checkState(started, "SupervisorManager not started"); Preconditions.checkNotNull(id, "id"); synchronized (lock) { Preconditions.checkState(started, "SupervisorManager not started"); return possiblyStopAndRemoveSupervisorInternal(id, true); } }
Source:
<code><START> private GraphicsDevice getGraphicsDevOfType(GraphicsType type) { <END> for (GraphicsDevice dev : getGraphicsDevices()) { if (dev.getGraphicsType() == type) { return dev; } } return null; }</code><technical_language>If want, is implement this streams: getGraphicsDevices().stream().filter(dev -> dev.getGraphicsType() == type).findFirst().orElse(null);</technical_language>

Target:
private GraphicsDevice getGraphicsDevOfType(GraphicsType type) { return getGraphicsDevices().stream().filter(dev -> dev.getGraphicsType() == type).findFirst().orElse(null); }
Source:
<code>public MethodOutcome createFHIRPatient(@ResourceParam Patient patient) { patient = patientResource.createFHIRPatient(patient); MethodOutcome retVal = new MethodOutcome(); retVal.setId(new IdDt(FHIRConstants.PATIENT, patient.getId().getIdPart())); OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setDetails("Patient is successfully created with " + patient.getId().getIdPart()); retVal.setOperationOutcome(outcome); <START> return retVal; <END> }</code><technical_language>return error responses for patient creation, added for patient updating tasks</technical_language>

Target:
public MethodOutcome createFHIRPatient(@ResourceParam Patient patient) { patient = patientResource.createFHIRPatient(patient); MethodOutcome retVal = new MethodOutcome(); retVal.setId(new IdDt(FHIRConstants.PATIENT, patient.getId().getIdPart())); OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setDetails("Patient is successfully created with"); retVal.setOperationOutcome(outcome); return retVal; }
Source:
<code>public int getSize() { int size = 0; DexReader reader = dexFile.readerAt(startOffset); reader.readLargeUleb128(); reader.readSmallUleb128(); size += reader.getOffset() - startOffset; Set<? extends DexBackedAnnotation> annotations = getAnnotations(); if (!annotations.isEmpty()){ size += 2 * 4; size += 4; <START> for (DexBackedAnnotation dexBackedAnnotation : annotations) { <END> size += 4; } } if (initialValueOffset > 0){ reader.setOffset(initialValueOffset); if (initialValue != null) { DexBackedEncodedValue.skipFrom(reader); size += reader.getOffset() - initialValueOffset; } } DexBackedFieldReference fieldRef = new DexBackedFieldReference(dexFile, fieldIndex); size += fieldRef.getSize(); return size; }</code><technical_language>I annotation_set_item items shared, if want include not</technical_language>

Target:
public int getSize() { int size = 0; DexReader reader = dexFile.readerAt(startOffset); reader.readLargeUleb128(); reader.readSmallUleb128(); size += reader.getOffset() - startOffset; Set<? extends DexBackedAnnotation> annotations = getAnnotations(); if (!annotations.isEmpty()) { size += 2 * 4; } if (initialValueOffset > 0) { reader.setOffset(initialValueOffset); if (initialValue != null) { DexBackedEncodedValue.skipFrom(reader); size += reader.getOffset() - initialValueOffset; } } DexBackedFieldReference fieldRef = new DexBackedFieldReference(dexFile, fieldIndex); size += fieldRef.getSize(); return size; }