auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AbstractDiskModel() { setSizeExtend(new EntityModel()); <START> getSizeExtend().setEntity(String.valueOf(0)); <END> setIsAttachDisk(new EntityModel()); getIsAttachDisk().setEntity(false); getIsAttachDisk().getEntityChangedEvent().addListener(this); setIsInternal(new EntityModel()); getIsInternal().setEntity(true); getIsInternal().getEntityChangedEvent().addListener(this); setIsWipeAfterDelete(new EntityModel()); getIsWipeAfterDelete().setEntity(false); getIsWipeAfterDelete().getEntityChangedEvent().addListener(this); setIsBootable(new EntityModel()); getIsBootable().setEntity(false); setIsShareable(new EntityModel()); getIsShareable().setEntity(false); setIsPlugged(new EntityModel()); getIsPlugged().setEntity(true); setIsDirectLunDiskAvaialable(new EntityModel()); getIsDirectLunDiskAvaialable().setEntity(true); setDataCenter(new ListModel()); getDataCenter().setIsAvailable(false); getDataCenter().getSelectedItemChangedEvent().addListener(this); setStorageType(new ListModel()); getStorageType().setIsAvailable(false); getStorageType().setItems(AsyncDataProvider.getStorageTypeList()); getStorageType().getSelectedItemChangedEvent().addListener(this); setHost(new ListModel()); getHost().setIsAvailable(false); getVolumeType().getSelectedItemChangedEvent().addListener(this); setInternalAttachableDisks(new ListModel()); setExternalAttachableDisks(new ListModel()); }</code><technical_language>"0"</technical_language>

Target:
public AbstractDiskModel() { setSizeExtend(new EntityModel()); getSizeExtend().setEntity(0); setIsAttachDisk(new EntityModel()); getIsAttachDisk().setEntity(false); getIsAttachDisk().getEntityChangedEvent().addListener(this); setIsInternal(new EntityModel()); getIsInternal().setEntity(true); getIsInternal().getEntityChangedEvent().addListener(this); setIsWipeAfterDelete(new EntityModel()); getIsWipeAfterDelete().setEntity(false); getIsWipeAfterDelete().getEntityChangedEvent().addListener(this); setIsBootable(new EntityModel()); getIsBootable().setEntity(false); setIsShareable(new EntityModel()); getIsShareable().setEntity(false); setIsPlugged(new EntityModel()); getIsPlugged().setEntity(true); setIsDirectLunDiskAvaialable(new EntityModel()); getIsDirectLunDiskAvaialable().setEntity(true); setDataCenter(new ListModel()); getDataCenter().setIsAvailable(false); getDataCenter().getSelectedItemChangedEvent().addListener(this); setStorageType(new ListModel()); getStorageType().setIsAvailable(false); getStorageType().setItems(AsyncDataProvider.getStorageTypeList()); getStorageType().getSelectedItemChangedEvent().addListener(this); setHost(new ListModel()); getHost().setIsAvailable(false); getVolumeType().getSelectedItemChangedEvent().addListener(this); setInternalAttachableDisks(new ListModel()); setExternalAttachableDisks(new ListModel()); }
Source:
<code><START> public HashSet<String> getAssumeUnchanged() { <END> return assumeUnchanged; }</code><technical_language>of methods export HashSet. exporting Set<String> instead in case change internal representation else, e.g a TreeSet, a custom Set implementation a smaller storage is easier construct fact iterate names in path-order. add HashSet<String> if immediately follow a change fixes of methods return Set<String>. (Or please do reverse, insert a new commit fixes existing methods return Set<String> change this commit return Set<String>.)</technical_language>

Target:
public Set<String> getAssumeUnchanged() { return assumeUnchanged; }
Source:
<code>public static String <START> forChipset(String <END> emulatedMachine, ChipsetType chipsetType) { return ClusterEmulatedMachines.parse(emulatedMachine).getForChipset(chipsetType); }</code><technical_language>I method name is a riddle for does</technical_language>

Target:
public static String forChipset(String emulatedMachine, ChipsetType chipsetType) { return ClusterEmulatedMachines.parse(emulatedMachine).getTypeByChipset(chipsetType); }
Source:
<code>public Collection<TTSService> getTTSs() { <START> return Collections.unmodifiableCollection(ttsServices.values()); <END> }</code><technical_language>HashMap.values() returns a view of values. Collections.unmodifiableCollection(...) returns unmodifiable view. So, if construct change e.g. ttsServices (an add remove of a service) mirrored caller is returned view (only view is unmodifiable collection view resides on). If caller iterates returned collection ttsServices is changed, this lead a CME. for other functions, too. normal case is create a temp. collection create unmodifiable view (so holds reference is unmodifiable view all). need copy values avoid a CME, is need unmodifiable leave ownership of collection caller</technical_language>

Target:
public Collection<TTSService> getTTSs() { return new HashSet<>(ttsServices.values()); }
Source:
<code>static OldDataMonitor get(Jenkins j) throws IllegalStateException { AdministrativeMonitor monitor = j.getAdministrativeMonitor("OldData"); if (monitor == null) { throw new IllegalStateException("Cannot find OldData administrative monitor"); } else if (!(monitor instanceof OldDataMonitor)) { throw new IllegalStateException("Wrong type of the OldData administrative monitor. Got: " + monitor.getClass()); } <START> return (OldDataMonitor)monitor; <END> }</code><technical_language>This replaced java return ExtensionList.lookupSingleton(OldDataMonitor.class);</technical_language>

Target:
static OldDataMonitor get(Jenkins j) throws IllegalStateException { return ExtensionList.lookupSingleton(OldDataMonitor.class); }
Source:
<code>public void shouldLoginWhenUserExists() { when(dao.find(user.getLogin(), user.getPassword())).thenReturn(user); controller.login(user.getLogin(), user.getPassword()); <START> assertFalse(validator.hasErrors()); <END> }</code><technical_language>change assertThat(validation.getErrors(), empty())? more readeable, sounds "assert validation.getErrors is empty". empty() is a static import org.hamcrest.Matchers. If assert fails, hamcrest matchers a more pretty message assertTrue JUnit, show message</technical_language>

Target:
public void shouldLoginWhenUserExists() { when(dao.find(user.getLogin(), user.getPassword())).thenReturn(user); controller.login(user.getLogin(), user.getPassword()); assertThat(validator.getErrors(), empty()); }
Source:
<code><START> public void testGetFolderContentWithInvalidIdentifier() throws Exception { END> final String NOT_EXISTING_ID = "01234567-1234-1234-1234-123456789012"; try { browserAPI.getFolderContent( APILocator.systemUser(), NOT_EXISTING_ID, 0, -1, "", null, null, true, false, false, false, "", false, false, 1 ); } catch ( Exception e ){ Assert.assertTrue( e instanceof NotFoundInDbException ); } }</code><technical_language>" throws Exception " removed</technical_language>

Target:
public void testGetFolderContentWithInvalidIdentifier() { final String NOT_EXISTING_ID = "01234567-1234-1234-1234-123456789012"; try { browserAPI.getFolderContent( APILocator.systemUser(), NOT_EXISTING_ID, 0, -1, "", null, null, true, false, false, false, "", false, false, 1 ); } catch ( Exception e ){ Assert.assertTrue( e instanceof NotFoundInDbException ); } }
Source:
<code>protected Void createVolumeFromSnapshotCallback(AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> callback, CreateVolumeFromBaseImageContext<VolumeApiResult> context) { CopyCommandResult result = callback.getResult(); VolumeInfo volume = (VolumeInfo)context.templateOnStore; SnapshotInfo snapshot = context.snapshot; VolumeApiResult apiResult = new VolumeApiResult(volume); Event event = null; if (result.isFailed()) { apiResult.setResult(result.getResult()); event = Event.OperationFailed; } else { event = Event.OperationSuccessed; } try { if (result.isSuccess()) { volume.processEvent(event, result.getAnswer()); } else { volume.processEvent(event); } <START> VolumeDetailVO volumeDetailVO = _volumeDetailsDao.findDetail(volume.getId(),"SNAPSHOT_ID"); <END> _volumeDetailsDao.remove(volumeDetailVO.getId()); } catch (Exception e) { s_logger.debug("create volume from snapshot failed", e); apiResult.setResult(e.toString()); } AsyncCallFuture<VolumeApiResult> future = context.future; future.complete(apiResult); return null; }</code><technical_language>Try existing removeDetail() method do this</technical_language>

Target:
protected Void createVolumeFromSnapshotCallback(AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> callback, CreateVolumeFromBaseImageContext<VolumeApiResult> context) { CopyCommandResult result = callback.getResult(); VolumeInfo volume = (VolumeInfo)context.templateOnStore; SnapshotInfo snapshot = context.snapshot; VolumeApiResult apiResult = new VolumeApiResult(volume); Event event = null; if (result.isFailed()) { apiResult.setResult(result.getResult()); event = Event.OperationFailed; } else { event = Event.OperationSuccessed; } try { if (result.isSuccess()) { volume.processEvent(event, result.getAnswer()); } else { volume.processEvent(event); } _volumeDetailsDao.removeDetail(volume.getId(), SNAPSHOT_ID); } catch (Exception e) { s_logger.debug("create volume from snapshot failed", e); apiResult.setResult(e.toString()); } AsyncCallFuture<VolumeApiResult> future = context.future; future.complete(apiResult); return null; }
Source:
<code>protected Control createDialogArea(Composite parent) { getShell().setText(fShellTitle); Composite composite = (Composite)super.createDialogArea(parent); Composite innerComposite = new Composite(composite, SWT.NONE); innerComposite.setLayoutData(new GridData()); GridLayout gl= new GridLayout(); gl.numColumns= 2; innerComposite.setLayout(gl); Label label= new Label(innerComposite, SWT.NONE); label.setText(fLabelText); label.setLayoutData(new GridData()); final Combo combo= new Combo(innerComposite, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(combo); for (String <START> fAllowedString : <END> fAllowedStrings) { combo.add(fAllowedString); } combo.select(fInitialSelectionIndex); fSelection= combo.getItem(combo.getSelectionIndex()); GridData gd= new GridData(); gd.widthHint= convertWidthInCharsToPixels(getMaxStringLength()); combo.setLayoutData(gd); combo.addSelectionListener(new SelectionAdapter(){ @Override public void widgetSelected(SelectionEvent e) { fSelection= combo.getItem(combo.getSelectionIndex()); } }); applyDialogFont(composite); return composite; }</code><technical_language>rename allowedString</technical_language>

Target:
protected Control createDialogArea(Composite parent) { getShell().setText(fShellTitle); Composite composite = (Composite)super.createDialogArea(parent); Composite innerComposite = new Composite(composite, SWT.NONE); innerComposite.setLayoutData(new GridData()); GridLayout gl= new GridLayout(); gl.numColumns= 2; innerComposite.setLayout(gl); Label label= new Label(innerComposite, SWT.NONE); label.setText(fLabelText); label.setLayoutData(new GridData()); final Combo combo= new Combo(innerComposite, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(combo); for (String allowedString : fAllowedStrings) { combo.add(allowedString); } combo.select(fInitialSelectionIndex); fSelection= combo.getItem(combo.getSelectionIndex()); GridData gd= new GridData(); gd.widthHint= convertWidthInCharsToPixels(getMaxStringLength()); combo.setLayoutData(gd); combo.addSelectionListener(new SelectionAdapter(){ @Override public void widgetSelected(SelectionEvent e) { fSelection= combo.getItem(combo.getSelectionIndex()); } }); applyDialogFont(composite); return composite; }
Source:
<code>protected void onInitUI() { super.onInitUI(); table = new ChangeTable(true); byOwner = new ChangeTable.Section("", <START> ChangeTable.ApprovalViewType.STRONGEST); <END> forReview = new ChangeTable.Section("", ChangeTable.ApprovalViewType.MINE); closed = new ChangeTable.Section("", ChangeTable.ApprovalViewType.STRONGEST); table.addSection(byOwner); table.addSection(forReview); table.addSection(closed); add(table); table.setSavePointerId(Link.toAccountDashboard(ownerId)); }</code><technical_language>Style nit: importing ApprovalViewType avoid needing line-wrap this line, line 44 below</technical_language>

Target:
protected void onInitUI() { super.onInitUI(); table = new ChangeTable(true); byOwner = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null); forReview = new ChangeTable.Section("", ApprovalViewType.USER, ownerId); closed = new ChangeTable.Section("", ApprovalViewType.STRONGEST, null); table.addSection(byOwner); table.addSection(forReview); table.addSection(closed); add(table); table.setSavePointerId(Link.toAccountDashboard(ownerId)); }
Source:
<code>void scrollToSection(@NonNull String sectionAnchor) { bridge.execute(JavaScriptActionHandler.prepareToScrollTo(sectionAnchor, "{ highlight: false }")); for (Section section : adapter.sections) { if (section.getAnchor().equals(sectionAnchor)) { <START> scrollToSection(section); <END> break; } } }</code><technical_language>Do need this other scrollToSection() call, then? sounds making scroll twice</technical_language>

Target:
void scrollToSection(@NonNull String sectionAnchor) { bridge.execute(JavaScriptActionHandler.prepareToScrollTo(sectionAnchor, "{ highlight: false }")); }
Source:
<code>private void createTable(TableName tableName) throws Exception { <START> HTableDescriptor desc = new HTableDescriptor(tableName); <END> HColumnDescriptor familyDesc = new HColumnDescriptor(FAMILY); familyDesc.setScope(HConstants.REPLICATION_SCOPE_GLOBAL); desc.addFamily(familyDesc); admin1.createTable(desc); admin2.createTable(desc); utility1.waitUntilAllRegionsAssigned(tableName); utility2.waitUntilAllRegionsAssigned(tableName); }</code><technical_language>is deprecated, please TableDescriptorBuilder instead</technical_language>

Target:
private void createTable(TableName tableName) throws Exception { TableDescriptor desc = TableDescriptorBuilder.newBuilder(tableName).setColumnFamily( ColumnFamilyDescriptorBuilder.newBuilder(FAMILY) .setScope(HConstants.REPLICATION_SCOPE_GLOBAL).build() ).build(); admin1.createTable(desc); admin2.createTable(desc); utility1.waitUntilAllRegionsAssigned(tableName); utility2.waitUntilAllRegionsAssigned(tableName); }
Source:
<code>public ArrayList<EventDefinitionCRFBean> validateSubmissionUrl(ArrayList<EventDefinitionCRFBean> edcsInSession, ArrayList<EventDefinitionCRFBean> eventDefCrfList, Validator v, StudyEventDefinitionBean sed) { for (int i = 0; i < edcsInSession.size(); i++) { String order = i + "-" + edcsInSession.get(i).getId(); v.addValidation("submissionUrl" + order, Validator.NO_SPACES_ALLOWED); EventDefinitionCRFBean sessionBean = null; boolean isExist = false; for (EventDefinitionCRFBean eventDef : eventDefCrfList) { sessionBean = edcsInSession.get(i); logger.info("iter: --db: {}", eventDef.getId(), eventDef.getSubmissionUrl()); <START> logger.info("edcsInSession: --session: ", sessionBean.getId(), sessionBean.getSubmissionUrl()); <END> if (sessionBean.getSubmissionUrl().trim().equals("") || sessionBean.getSubmissionUrl().trim() == null) { break; } else { if (eventDef.getSubmissionUrl().trim().equalsIgnoreCase(sessionBean.getSubmissionUrl().trim()) && (eventDef.getId() != sessionBean.getId())) { v.addValidation("submissionUrl" + order, Validator.SUBMISSION_URL_NOT_UNIQUE); sed.setPopulated(true); logger.debug("Duplicate ***************************"); isExist = true; break; } else if (eventDef.getSubmissionUrl().trim().equalsIgnoreCase(sessionBean.getSubmissionUrl().trim()) && (eventDef.getId() == sessionBean.getId())) { logger.debug("Not Duplicate ***********"); isExist = true; break; } } } if (!isExist) { eventDefCrfList.add(sessionBean); } } return eventDefCrfList; }</code><technical_language>change debug</technical_language>

Target:
public ArrayList<EventDefinitionCRFBean> validateSubmissionUrl(ArrayList<EventDefinitionCRFBean> edcsInSession, ArrayList<EventDefinitionCRFBean> eventDefCrfList, Validator v, StudyEventDefinitionBean sed) { for (int i = 0; i < edcsInSession.size(); i++) { String order = i + "-" + edcsInSession.get(i).getId(); v.addValidation("submissionUrl" + order, Validator.NO_SPACES_ALLOWED); EventDefinitionCRFBean sessionBean = null; boolean isExist = false; for (EventDefinitionCRFBean eventDef : eventDefCrfList) { sessionBean = edcsInSession.get(i); logger.debug("iter: --db: {}", eventDef.getId(), eventDef.getSubmissionUrl()); logger.debug("edcsInSession: --session: ", sessionBean.getId(), sessionBean.getSubmissionUrl()); if (sessionBean.getSubmissionUrl().trim().equals("") || sessionBean.getSubmissionUrl().trim() == null) { break; } else { if (eventDef.getSubmissionUrl().trim().equalsIgnoreCase(sessionBean.getSubmissionUrl().trim()) && (eventDef.getId() != sessionBean.getId())) { v.addValidation("submissionUrl" + order, Validator.SUBMISSION_URL_NOT_UNIQUE); sed.setPopulated(true); logger.debug("Duplicate ***************************"); isExist = true; break; } else if (eventDef.getSubmissionUrl().trim().equalsIgnoreCase(sessionBean.getSubmissionUrl().trim()) && (eventDef.getId() == sessionBean.getId())) { logger.debug("Not Duplicate ***********"); isExist = true; break; } } } if (!isExist) { eventDefCrfList.add(sessionBean); } } return eventDefCrfList; }
Source:
<code>public Authentication authenticate(Authentication authentication) <START> throws AuthenticationException <END> { JWTAuthentication jwtAuthentication = (JWTAuthentication) authentication; String token = jwtAuthentication.getToken(); String userName = securityTokenProvider.getSubject(token); UserDetails user = userDetailsService.loadUserByUsername(userName); Map<String, String> claimMap = new HashMap<>(); claimMap.put("credentials", user.getPassword()); try { securityTokenProvider.verifyToken(token, userName, claimMap); } catch (SecurityTokenException e) { Throwable cause = e.getCause(); if (cause != null && cause instanceof SecurityTokenException) { throw new JwtAuthenticationException(String.format("Invalid JWT: value-[%s]", token), e); } else { throw new BadCredentialsException( String.format(String.format("Credentials don't match: user-[%s] ", userName)), e); } } return authentication; }</code><technical_language>![MINOR](<LINK_0> Remove declaration of thrown exception 'org.springframework.security.core.AuthenticationException' is a runtime exception. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public Authentication authenticate(Authentication authentication) throws AuthenticationException { JWTAuthentication jwtAuthentication = (JWTAuthentication) authentication; String token = jwtAuthentication.getToken(); String userName = securityTokenProvider.getSubject(token); UserDetails user = userDetailsService.loadUserByUsername(userName); Map<String, String> claimMap = new HashMap<>(); claimMap.put("credentials", user.getPassword()); try { securityTokenProvider.verifyToken(token, userName, claimMap); } catch (SecurityTokenException e) { Throwable cause = e.getCause(); if (cause instanceof SecurityTokenException) { throw new JwtAuthenticationException(String.format("Invalid JWT: value-[%s]", token), e); } else { throw new BadCredentialsException( String.format(String.format("Credentials don't match: user-[%s] ", userName)), e); } } return authentication; }
Source:
<code>public void updateVisibility() { messageLabel.setVisible(false); <START> if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly) { <END> externalProviderEditor.setVisible(false); neutronPhysicalNetwork.setVisible(false); createSubnetEditor.setVisible(false); vlanTagging.setVisible(false); vlanTag.setVisible(false); exportLabel.setVisible(false); exportEditor.setVisible(false); profilesTab.setVisible(false); } }</code><technical_language>equivalent Kanagaraj generally prefers of !ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly) :)</technical_language>

Target:
public void updateVisibility() { messageLabel.setVisible(false); if (!ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)) { externalProviderEditor.setVisible(false); neutronPhysicalNetwork.setVisible(false); createSubnetEditor.setVisible(false); vlanTagging.setVisible(false); vlanTag.setVisible(false); exportLabel.setVisible(false); exportEditor.setVisible(false); profilesTab.setVisible(false); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> final Bundle bundle = getArguments(); <END> courseData = (EnrolledCoursesResponse) bundle .getSerializable(CourseData); }</code><technical_language>[mentioned](<LINK_0> in #408, this variable renamed "args" more descriptive</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Bundle args = getArguments(); courseData = (EnrolledCoursesResponse) args.getSerializable(CourseData); if (courseData != null) { isCoursewareAccessible = courseData.getCourse().getCoursewareAccess().hasAccess(); } }
Source:
<code>public int compare(Location o1, Location o2) { <START> return o1.name.compareTo(o2.name); <END> }</code><technical_language>I suggest "ComparisonChain.start().compare(o1.name, o2.name).result()" - Location.name null</technical_language>

Target:
public int compare(Location o1, Location o2) { return ComparisonChain.start().compare(o1.name, o2.name).result(); }
Source:
<code>public void testLimitWithPageAlignment() { List<Page> input = rowPagesBuilder(BIGINT) .addSequencePage(3, 1) .addSequencePage(2, 4) .addSequencePage(2, 6) .build(); OperatorFactory operatorFactory = new LimitOperatorFactory(0, new PlanNodeId("test"), 5); MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT) .page(SequencePageBuilder.createSequencePage(ImmutableList.of(BIGINT), 3, 1)) <START> .page(SequencePageBuilder.createSequencePage(ImmutableList.of(BIGINT), 2, 4)) <END> .build(); OperatorAssertion.assertOperatorEquals(operatorFactory, driverContext, input, expected); }</code><technical_language>nit: static import createSequencePage</technical_language>

Target:
public void testLimitWithPageAlignment() { List<Page> input = rowPagesBuilder(BIGINT) .addSequencePage(3, 1) .addSequencePage(2, 4) .addSequencePage(2, 6) .build(); OperatorFactory operatorFactory = new LimitOperatorFactory(0, new PlanNodeId("test"), 5); MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT) .page(createSequencePage(ImmutableList.of(BIGINT), 3, 1)) .page(createSequencePage(ImmutableList.of(BIGINT), 2, 4)) .build(); OperatorAssertion.assertOperatorEquals(operatorFactory, driverContext, input, expected); }
Source:
<code>public String toString() { <START> return "(FOLLOW(" + path + ")" + " AND " + ANY_DIFF + ")"; <END> }</code><technical_language>This need wrapped more. Also, unwrapped nls suppression inlined</technical_language>

Target:
public String toString() { return "(FOLLOW(" + path + ") AND " + ANY_DIFF + ")"; }
Source:
<code>public Weighting createWeighting( WeightingMap weightingMap, FlagEncoder encoder ) { String weighting = weightingMap.getWeighting().toLowerCase(); if ("shortest".equalsIgnoreCase(weighting)) { return new ShortestWeighting(encoder); } else if ("fastest".equalsIgnoreCase(weighting) || weighting.isEmpty()) { if (encoder.supports(PriorityWeighting.class)) return new PriorityWeighting(encoder, weightingMap); else return new FastestWeighting(encoder, weightingMap); <START> } else if ("curvature".equalsIgnoreCase(weighting) || weighting.isEmpty()) <END> { if (encoder.supports(CurvatureWeighting.class)) return new CurvatureWeighting(encoder, weightingMap, ghStorage); else return new FastestWeighting(encoder, weightingMap); } throw new UnsupportedOperationException("weighting " + weighting + " not supported"); }</code><technical_language>weighting.isEmpty removed (and is handled if before) ... I this in squashed commit ..</technical_language>

Target:
public Weighting createWeighting( WeightingMap weightingMap, FlagEncoder encoder ) { String weighting = weightingMap.getWeighting().toLowerCase(); if ("shortest".equalsIgnoreCase(weighting)) { return new ShortestWeighting(encoder); } else if ("fastest".equalsIgnoreCase(weighting) || weighting.isEmpty()) { if (encoder.supports(PriorityWeighting.class)) return new PriorityWeighting(encoder, weightingMap); else return new FastestWeighting(encoder, weightingMap); } else if ("curvature".equalsIgnoreCase(weighting)) { if (encoder.supports(CurvatureWeighting.class)) return new CurvatureWeighting(encoder, weightingMap, ghStorage); else return new FastestWeighting(encoder, weightingMap); } throw new UnsupportedOperationException("weighting " + weighting + " not supported"); }
Source:
<code>protected void Perform() { if (StringHelper.isNullOrEmpty(mTicket)) { mTicket = Ticketing.GenerateOTP(); } final VM vm = getVm(); final IVdcUser user = getCurrentUser(); vm.setConsoleUserId(user.getUserId()); vm.setguest_cur_user_name(user.getUserName().contains("@") ? user.getUserName() : user.getUserName() + "@" <START> + user.getDomainControler()); <END> final VmDynamicDAO dao = DbFacade.getInstance().getVmDynamicDAO(); if (vm.getAllowConsoleReconnect() || neededPermissions) { dao.update(vm.getDynamicData()); sendTicket(); } else { final boolean saved = dao.updateConsoleUserWithOptimisticLocking(vm.getDynamicData()); if (saved) { sendTicket(); } else { dontSendTicket(); } } }</code><technical_language>this logic build user name else? If do reuse here</technical_language>

Target:
protected void Perform() { if (StringHelper.isNullOrEmpty(mTicket)) { mTicket = Ticketing.GenerateOTP(); } final VM vm = getVm(); final IVdcUser user = getCurrentUser(); vm.setConsoleUserId(user.getUserId()); vm.setguest_cur_user_name(user.getFQN()); final VmDynamicDAO dao = DbFacade.getInstance().getVmDynamicDAO(); if (vm.getAllowConsoleReconnect() || neededPermissions) { dao.update(vm.getDynamicData()); sendTicket(); } else { final boolean saved = dao.updateConsoleUserWithOptimisticLocking(vm.getDynamicData()); if (saved) { sendTicket(); } else { dontSendTicket(); } } }
Source:
<code>public void testSimple() { PersistenceTestObject.testMigrate = false; PersistenceTestObject pt = new PersistenceTestObject(); pt.setup(); String ser = SerializerDeserializer.toSerialized(pt, SerializerDeserializer.PERSISTENT); <START> System.out.println(ser); <END> SerializerDeserializer.Deserialized<PersistenceTestObject> deser; deser = SerializerDeserializer.fromSerialized(ser, PersistenceTestObject.class, SerializerDeserializer.PERSISTENT); pt.checkEqual(deser.object); assertFalse(deser.migration.isMigrated()); }</code><technical_language>I slf4j _Logger.debug()_ instead of system.out.println, for test case. Thanks</technical_language>

Target:
public void testSimple() { PersistenceTestObject.testMigrate = false; PersistenceTestObject pt = new PersistenceTestObject(); pt.setup(); String ser = SerializerDeserializer.toSerialized(pt, SerializerDeserializer.PERSISTENT); LOGGER.info(ser); SerializerDeserializer.Deserialized<PersistenceTestObject> deser; deser = SerializerDeserializer.fromSerializedPersistent(ser, PersistenceTestObject.class); pt.checkEqual(deser.object); assertFalse(deser.migrated); }
Source:
<code><START> private void doFilterInternal(ServletRequest request, ServletResponse response, <END> FilterChain chain) throws IOException, ServletException { try { FirewalledRequest fwRequest = firewall .getFirewalledRequest((HttpServletRequest) request); HttpServletResponse fwResponse = firewall .getFirewalledResponse((HttpServletResponse) response); List<Filter> filters = getFilters(fwRequest); if (filters == null || filters.size() == 0) { if (logger.isDebugEnabled()) { logger.debug(UrlUtils.buildRequestUrl(fwRequest) + (filters == null ? " has no matching filters" : " has an empty filter list")); } fwRequest.reset(); chain.doFilter(fwRequest, fwResponse); return; } VirtualFilterChain vfc = new VirtualFilterChain(fwRequest, chain, filters); vfc.doFilter(fwRequest, fwResponse); } catch (RequestRejectedException e) { requestRejectedHandler.handle((HttpServletRequest) request, (HttpServletResponse) response, e); } }</code><technical_language>this entire method a try/catch, please move try/catch existing try block in doFilter</technical_language>

Target:
private void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { FirewalledRequest fwRequest = firewall .getFirewalledRequest((HttpServletRequest) request); HttpServletResponse fwResponse = firewall .getFirewalledResponse((HttpServletResponse) response); List<Filter> filters = getFilters(fwRequest); if (filters == null || filters.size() == 0) { if (logger.isDebugEnabled()) { logger.debug(UrlUtils.buildRequestUrl(fwRequest) + (filters == null ? " has no matching filters" : " has an empty filter list")); } fwRequest.reset(); chain.doFilter(fwRequest, fwResponse); return; } VirtualFilterChain vfc = new VirtualFilterChain(fwRequest, chain, filters); vfc.doFilter(fwRequest, fwResponse); }
Source:
<code>public VDS activate() { VDS vds = null; try { log.debugFormat( "Trying to activate host {0} , meanwhile setting status to Unassigned.", getVdsId()); vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); <START> VDSStatus newStatus = refreshCapabilities(new AtomicBoolean(), vds, true); <END> if (log.isDebugEnabled()) { log.debugFormat( "Succeeded to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } } catch (java.lang.Exception e) { log.infoFormat("Failed to activate VDS = {0} with error: {1}.", getVdsId(), e.getMessage()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); monitoringStrategy.processHardwareCapabilities(vds); ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } return vds; }</code><technical_language>this false, in this patch context</technical_language>

Target:
public VDS activate() { VDS vds = null; try { log.debugFormat( "Trying to activate host {0} , meanwhile setting status to Unassigned.", getVdsId()); vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); VDSStatus newStatus = refreshCapabilities(new AtomicBoolean(), vds, false); if (log.isDebugEnabled()) { log.debugFormat( "Succeeded to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } } catch (java.lang.Exception e) { log.infoFormat("Failed to activate VDS = {0} with error: {1}.", getVdsId(), e.getMessage()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); monitoringStrategy.processHardwareCapabilities(vds); ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } return vds; }
Source:
<code>private void toolsIdTool() throws Exception { Response response = checkedResponse(basePath + "tools/quay.io%2Ftest_org%2Ftest6"); Tool responseObject = response.readEntity(Tool.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseObject), true); Assert.assertTrue("registry_url should never be null", responseObject.getVersions().size() > 0 && responseObject.getVersions().stream().allMatch(version -> version.getRegistryUrl() != null)); Assert.assertTrue("imageName should never be null", responseObject.getVersions().size() > 0 && responseObject.getVersions().stream().allMatch(version -> version.getImageName() != null)); response = checkedResponse(basePath + "tools?id=quay.io%2Ftest_org%2Ftest6"); List<Tool> responseList = response.readEntity(List.class); <START> assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseList), false); <END> }</code><technical_language>i supposed , true);</technical_language>

Target:
private void toolsIdTool() throws Exception { Response response = checkedResponse(basePath + "tools/quay.io%2Ftest_org%2Ftest6"); Tool responseObject = response.readEntity(Tool.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseObject), true); Assert.assertTrue("registry_url should never be null", responseObject.getVersions().size() > 0 && responseObject.getVersions().stream().allMatch(version -> version.getRegistryUrl() != null)); Assert.assertTrue("imageName should never be null", responseObject.getVersions().size() > 0 && responseObject.getVersions().stream().allMatch(version -> version.getImageName() != null)); response = checkedResponse(basePath + "tools?id=quay.io%2Ftest_org%2Ftest6"); List<Tool> responseList = response.readEntity(List.class); assertTool(SUPPORT.getObjectMapper().writeValueAsString(responseList), true); }
Source:
<code>public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String numOfRubricChoicesString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_NUM_COLS); String numOfRubricSubQuestionsString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_NUM_ROWS); if (numOfRubricChoicesString == null || numOfRubricSubQuestionsString == null) { return false; } int numOfRubricChoices = Integer.parseInt(numOfRubricChoicesString); int numOfRubricSubQuestions = Integer.parseInt(numOfRubricSubQuestionsString); List<String> rubricChoices = new ArrayList<String>(); List<String> rubricSubQuestions = new ArrayList<String>(); <START> List<List<String>> rubricDescriptions = new ArrayList<List<String>>(); <END> rubricChoices = getRubricChoices(requestParameters, numOfRubricChoices); int numActualChoices = rubricChoices.size(); rubricSubQuestions = getSubQuestions(requestParameters, numOfRubricSubQuestions); int numActualSubQuestions = rubricSubQuestions.size(); rubricDescriptions = getRubricQuestionDescriptions(requestParameters, numOfRubricChoices, numOfRubricSubQuestions); setRubricQuestionDetails(numActualChoices, rubricChoices, numActualSubQuestions, rubricSubQuestions, rubricDescriptions); if (!this.isValidDescriptionSize()) { this.initializeRubricDescriptions(); } return true; }</code><technical_language>need initialized first. do this: java List<String> rubricChoices = getRubricChoices(...); on</technical_language>

Target:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String numOfRubricChoicesString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_NUM_COLS); String numOfRubricSubQuestionsString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_NUM_ROWS); if (numOfRubricChoicesString == null || numOfRubricSubQuestionsString == null) { return false; } int numOfRubricChoices = Integer.parseInt(numOfRubricChoicesString); int numOfRubricSubQuestions = Integer.parseInt(numOfRubricSubQuestionsString); List<String> rubricChoices = getRubricChoices(requestParameters, numOfRubricChoices); List<String> rubricSubQuestions = getSubQuestions(requestParameters, numOfRubricSubQuestions); List<List<String>> rubricDescriptions = getRubricQuestionDescriptions(requestParameters, numOfRubricChoices, numOfRubricSubQuestions); setRubricQuestionDetails(rubricChoices, rubricSubQuestions, rubricDescriptions); if (!this.isValidDescriptionSize()) { this.initializeRubricDescriptions(); } return true; }
Source:
<code>public void rowHistoryIsReadyCorrectly() throws Exception { new TableCreator(conn) .withCreate("create table P(col1 int, col2 varchar(2), col3 int, col4 int, primary key (col2, col4))") .withInsert("insert into P values(?,?,?,?)") .withRows(rows(row(1, "a", 1, 1))) .create(); new TableCreator(conn) .withCreate("create table C (col1 int primary key, col2 varchar(2), col3 int, col4 int, constraint CHILD_FKEY foreign key(col2, col3) references P(col2, col4) )") .create(); conn.commit(); try(Connection c = newNoAutoCommitConnection()) { c.setAutoCommit(false); try (Statement statement = c.createStatement()) { statement.executeUpdate("update P set col1 = 42"); } <START> Thread.sleep(30 * 1000); <END> c.rollback(); } try(Connection conn = newNoAutoCommitConnection()) { try(Statement s = conn.createStatement()) { s.executeUpdate("insert into C values (400, 'a', 1, 42)"); } conn.commit(); } }</code><technical_language>I this long pause here. pause I of times next insert happen a chance remove rollback (specially if set up, connection, prepared statement, etc), do introduce 30 more seconds of runtime</technical_language>

Target:
public void rowHistoryIsReadyCorrectly() throws Exception { new TableCreator(conn) .withCreate("create table P(col1 int, col2 varchar(2), col3 int, col4 int, primary key (col2, col4))") .withInsert("insert into P values(?,?,?,?)") .withRows(rows(row(1, "a", 1, 1))) .create(); new TableCreator(conn) .withCreate("create table C (col1 int primary key, col2 varchar(2), col3 int, col4 int, constraint CHILD_FKEY foreign key(col2, col3) references P(col2, col4) )") .create(); conn.commit(); try(Connection c = newNoAutoCommitConnection()) { c.setAutoCommit(false); try (Statement statement = c.createStatement()) { statement.executeUpdate("update P set col1 = 42"); } c.rollback(); } try(Connection conn = newNoAutoCommitConnection()) { try(Statement s = conn.createStatement()) { s.executeUpdate("insert into C values (400, 'a', 1, 42)"); } conn.commit(); } }
Source:
<code>private static Level toLevel(EventPriority eventPriority) { switch (eventPriority) { case ALERT: case EMERGENCY: case CRITICAL: case ERROR: return Level.SEVERE; case WARNING: return Level.WARNING; case INFORMATIONAL: <START> return Level.INFO; <END> default: return Level.FINEST; } }</code><technical_language>eventPriority is missing. case OFF: return Level.OFF;</technical_language>

Target:
private static Level toLevel(EventPriority eventPriority) { switch (eventPriority) { case ALERT: case EMERGENCY: case CRITICAL: case ERROR: return Level.SEVERE; case WARNING: return Level.WARNING; case INFORMATIONAL: return Level.INFO; case OFF: throw audit.invalidEventPriority(eventPriority); default: return Level.FINEST; } }
Source:
<code>private void verifyEditResultCode(EditingResult result) { <START> assertThat(result.getResult(), equalTo(SUCCESS)); <END> }</code><technical_language>Minor: consider replacing equalTo is Hamcrest below</technical_language>

Target:
private void verifyEditResultCode(EditingResult result) { assertThat(result.getResult(), is(SUCCESS)); }
Source:
<code>private void configureBackground(IFigure fig) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) <START> this.resolveDDiagram().get(); if (dSemanticDiagram != null && <END> fig != null) { ColorDescription backgroundColor = dSemanticDiagram.getDescription().getBackgroundColor(); if (backgroundColor != null) { RGBValues rgbBackgroundValues = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), backgroundColor); Color colorUpdate = new Color(null, rgbBackgroundValues.getRed(), rgbBackgroundValues.getGreen(), rgbBackgroundValues.getBlue()); if (isWhiteColor(rgbBackgroundValues)) { fig.setBackgroundColor(null); fig.setOpaque(false); } else { fig.setBackgroundColor(colorUpdate); fig.setOpaque(true); } } } }</code><technical_language>Test of .some() instead of unguarded .get() != null</technical_language>

Target:
private void configureBackground(IFigure fig) { if (resolveDDiagram().some() && fig != null) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) this.resolveDDiagram().get(); ColorDescription backgroundColor = dSemanticDiagram.getDescription().getBackgroundColor(); if (backgroundColor != null) { RGBValues rgbBackgroundValues = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), backgroundColor); Color colorUpdate = new Color(null, rgbBackgroundValues.getRed(), rgbBackgroundValues.getGreen(), rgbBackgroundValues.getBlue()); if (isWhiteColor(rgbBackgroundValues)) { fig.setBackgroundColor(null); fig.setOpaque(false); } else { fig.setBackgroundColor(colorUpdate); fig.setOpaque(true); } } } }
Source:
<code>public String[] getPreferredKeyAlgorithms(SlaveComputer computer) throws IOException { if (!KNOWN_HOSTS_FILE.exists()) { return super.getPreferredKeyAlgorithms(computer); } KnownHosts knownHosts = new KnownHosts(KNOWN_HOSTS_FILE); <START> return knownHosts.getPreferredServerHostkeyAlgorithmOrder(((SSHLauncher) computer.getLauncher()).getHost()); <END> }</code><technical_language>Unchecked cast. Please avoid it, is a risk API wrong. FindBugs start grumbling enabled</technical_language>

Target:
public String[] getPreferredKeyAlgorithms(SlaveComputer computer) throws IOException { ComputerLauncher launcher = computer.getLauncher(); if (!(launcher instanceof SSHLauncher) || !KNOWN_HOSTS_FILE.exists()) { return super.getPreferredKeyAlgorithms(computer); } KnownHosts knownHosts = new KnownHosts(KNOWN_HOSTS_FILE); return knownHosts.getPreferredServerHostkeyAlgorithmOrder(((SSHLauncher) launcher).getHost()); }
Source:
<code>protected void sendReport(RassBatchJobReport report) { <START> LOG.debug("sendReport, The report-sending functionality has not been implemented yet."); <END> rassReportService.sendReportEmail(); }</code><technical_language>implemented reporting functionality, this log statement removed</technical_language>

Target:
protected void sendReport(RassBatchJobReport report) { rassReportService.sendReportEmail(); }
Source:
<code>public Optional<ServiceBindingType> convert(Map<String, Object> map) { Optional<ServiceBindingType> optionalBinding = Optional.empty(); if (MapUtils.isEmpty(map)) { return optionalBinding; } optionalBinding = super.convert(map); optionalBinding = mapToSchemaElement.populateStringElement( map, ACCESS_URI, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setAccessURI(valueToPopulate)); optionalBinding = mapToSchemaElement.populateStringElement( map, SERVICE, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setService(valueToPopulate)); if (map.containsKey(SPECIFICATION_LINK_KEY)) { SpecificationLinkTypeConverter slConverter = new SpecificationLinkTypeConverter(); Optional<SpecificationLinkType> optionalSpec; for (Map<String, Object> specMap : (List<Map<String, Object>>) map.get(SPECIFICATION_LINK_KEY)) { optionalSpec = slConverter.convert(specMap); if (optionalSpec.isPresent()) { if (!optionalBinding.isPresent()) { optionalBinding = Optional.of(mapToSchemaElement.getObjectFactory().get()); } <START> optionalBinding.get().getSpecificationLink().add(optionalSpec.orElse(null)); <END> } } } optionalBinding = mapToSchemaElement.populateStringElement( map, TARGET_BINDING, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setTargetBinding(valueToPopulate)); return optionalBinding; }</code><technical_language>need orElse</technical_language>

Target:
public Optional<ServiceBindingType> convert(Map<String, Object> map) { Optional<ServiceBindingType> optionalBinding = Optional.empty(); if (MapUtils.isEmpty(map)) { return optionalBinding; } optionalBinding = super.convert(map); optionalBinding = mapToSchemaElement.populateStringElement( map, ACCESS_URI, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setAccessURI(valueToPopulate)); optionalBinding = mapToSchemaElement.populateStringElement( map, SERVICE, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setService(valueToPopulate)); if (map.containsKey(SPECIFICATION_LINK_KEY)) { SpecificationLinkTypeConverter slConverter = new SpecificationLinkTypeConverter(); Optional<SpecificationLinkType> optionalSpec; for (Map<String, Object> specMap : (List<Map<String, Object>>) map.get(SPECIFICATION_LINK_KEY)) { optionalSpec = slConverter.convert(specMap); if (optionalSpec.isPresent()) { if (!optionalBinding.isPresent()) { optionalBinding = Optional.of(mapToSchemaElement.getObjectFactory().get()); } optionalBinding.get().getSpecificationLink().add(optionalSpec.get()); } } } optionalBinding = mapToSchemaElement.populateStringElement( map, TARGET_BINDING, optionalBinding, (valueToPopulate, serviceBinding) -> serviceBinding.setTargetBinding(valueToPopulate)); return optionalBinding; }
Source:
<code>public void run() { final long oldTimeStamp = lastMeasuredTimestamp; lastMeasuredTimestamp = System.currentTimeMillis(); final boolean clusterOverloaded = isClusterOverloaded(); final boolean clusterIdle = isClusterIdle(); LOG.log(Level.INFO, "Task Num = {0}. Overloaded = {1}, Idle = {2}", new Object[]{taskStatsMap.entrySet().size(), clusterOverloaded, clusterIdle}); if (clusterOverloaded) { overloadedTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (overloadedTimeElapsed > scaleOutGracePeriod && taskStatsMap.getTaskList().size() < maxTaskNum && recoveryScheduler.tryAcquireRecoveryLock()) { <START> try { <END> overloadedTimeElapsed = 0; } catch (final Exception e) { e.printStackTrace(); } finally { recoveryScheduler.releaseRecoveryLock(); } return; } } else { overloadedTimeElapsed = 0; } if (clusterIdle) { idleTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (idleTimeElapsed > scaleInGracePeriod && taskStatsMap.getTaskList().size() > minTaskNum && recoveryScheduler.tryAcquireRecoveryLock()) { LOG.log(Level.INFO, "Start scaling-in..."); try { scaleInManager.scaleIn(); idleTimeElapsed = 0; } catch (final Exception e) { e.printStackTrace(); } finally { recoveryScheduler.releaseRecoveryLock(); } } } else { idleTimeElapsed = 0; } }</code><technical_language>try include holding lock</technical_language>

Target:
public void run() { final long oldTimeStamp = lastMeasuredTimestamp; lastMeasuredTimestamp = System.currentTimeMillis(); final boolean clusterOverloaded = isClusterOverloaded(); final boolean clusterIdle = isClusterIdle(); LOG.log(Level.INFO, "Task Num = {0}. Overloaded = {1}, Idle = {2}", new Object[]{taskStatsMap.entrySet().size(), clusterOverloaded, clusterIdle}); if (clusterOverloaded) { overloadedTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (overloadedTimeElapsed > scaleOutGracePeriod && taskStatsMap.getTaskList().size() < maxTaskNum && recoveryLock.tryLock()) { try { overloadedTimeElapsed = 0; } catch (final Exception e) { e.printStackTrace(); } finally { recoveryLock.unlock(); } return; } } else { overloadedTimeElapsed = 0; } if (clusterIdle) { idleTimeElapsed += lastMeasuredTimestamp - oldTimeStamp; if (idleTimeElapsed > scaleInGracePeriod && taskStatsMap.getTaskList().size() > minTaskNum && recoveryLock.tryLock()) { LOG.log(Level.INFO, "Start scaling-in..."); try { scaleInManager.scaleIn(); idleTimeElapsed = 0; } catch (final Exception e) { e.printStackTrace(); } finally { recoveryLock.unlock(); } } } else { idleTimeElapsed = 0; } }
Source:
<code>public static RelDataType toSql(final RelDataTypeFactory typeFactory, RelDataType type) { if (type instanceof RelRecordType) { <START> return typeFactory.createTypeWithNullability( <END> typeFactory.createStructType( Lists.transform(type.getFieldList(), field -> toSql(typeFactory, field.getType())), type.getFieldNames()), type.isNullable()); } if (type instanceof JavaType) { return typeFactory.createTypeWithNullability( typeFactory.createSqlType(type.getSqlTypeName()), type.isNullable()); } return type; }</code><technical_language>times visit field? I impression this recursion visit attributes multiple times for reason I wrong</technical_language>

Target:
public static RelDataType toSql(final RelDataTypeFactory typeFactory, RelDataType type) { return toSql(typeFactory, type, true); }
Source:
<code>static int getFileExifRotation(Uri uri) throws IOException { ExifInterface exifInterface = new ExifInterface(uri.getPath()); int orientation = exifInterface.getAttributeInt(TAG_ORIENTATION, ORIENTATION_NORMAL); <START> return orientation; <END> }</code><technical_language>nit: inline return line above</technical_language>

Target:
static int getFileExifRotation(Uri uri) throws IOException { ExifInterface exifInterface = new ExifInterface(uri.getPath()); return exifInterface.getAttributeInt(TAG_ORIENTATION, ORIENTATION_NORMAL); }