auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setUp() { super.setUp(); secondsToWaitTillFail = Math.max(15, debug_show_browser_timeout_seconds); if (SwtTestUtil.isRunningOnEclipseOrgHudsonGTK || debug_print_test_names) { System.out.println("Running Test_org_eclipse_swt_browser_Browser#" + name.getMethodName()); } shell.setLayout(new FillLayout()); browser = new Browser(shell, SWT.NONE); String shellTitle = name.getMethodName(); if (SwtTestUtil.isGTK && browser.getBrowserType().equals("webkit")) { String webkitGtkVersionStr = System.getProperty("org.eclipse.swt.internal.webkitgtk.version"); shellTitle = shellTitle + " Webkit version: " + webkitGtkVersionStr; String[] webkitGtkVersionStrParts = webkitGtkVersionStr.split("\\."); <START> int[] webkitGtkVersionInts = new int[3]; <END> for (int i = 0; i < 3; i++) { webkitGtkVersionInts[i] = Integer.parseInt(webkitGtkVersionStrParts[i]); } if (webkitGtkVersionInts[0] == 1 || (webkitGtkVersionInts[0] == 2 && webkitGtkVersionInts[1] <= 4)) { isWebkit1 = true; } else if (webkitGtkVersionInts[0] == 2 && webkitGtkVersionInts[1] > 4) { isWebkit2 = true; } } shell.setText(shellTitle); setWidget(browser); testLog = new StringBuffer("\nTest log:\n"); }</code><technical_language>kinda work here. Suggestion: - webkitGtkVersionsInts a gloabl variable demand in tests. like: if (Webkit2) { assume (WebkitVers[0] == 2 && WebkitVers[1] >= 16))</technical_language>

Target:
public void setUp() { super.setUp(); secondsToWaitTillFail = Math.max(15, debug_show_browser_timeout_seconds); if (SwtTestUtil.isRunningOnEclipseOrgHudsonGTK || debug_print_test_names) { System.out.println("Running Test_org_eclipse_swt_browser_Browser#" + name.getMethodName()); } shell.setLayout(new FillLayout()); browser = new Browser(shell, SWT.NONE); String shellTitle = name.getMethodName(); if (SwtTestUtil.isGTK && browser.getBrowserType().equals("webkit")) { String webkitGtkVersionStr = System.getProperty("org.eclipse.swt.internal.webkitgtk.version"); shellTitle = shellTitle + " Webkit version: " + webkitGtkVersionStr; String[] webkitGtkVersionStrParts = webkitGtkVersionStr.split("\\."); for (int i = 0; i < 3; i++) { webkitGtkVersionInts[i] = Integer.parseInt(webkitGtkVersionStrParts[i]); } if (webkitGtkVersionInts[0] == 1 || (webkitGtkVersionInts[0] == 2 && webkitGtkVersionInts[1] <= 4)) { isWebkit1 = true; } else if (webkitGtkVersionInts[0] == 2 && webkitGtkVersionInts[1] > 4) { isWebkit2 = true; } } shell.setText(shellTitle); setWidget(browser); testLog = new StringBuffer("\nTest log:\n"); }
Source:
<code>private CreateSchema parseCreateSchema() { CreateSchema command = new CreateSchema(session); command.setIfNotExists(readIfNotExists()); command.setSchemaName(readUniqueIdentifier()); if (readIf("AUTHORIZATION")) { command.setAuthorization(readUniqueIdentifier()); } else { command.setAuthorization(session.getUser().getName()); } if (readIf("WITH")) { <START> ArrayList<String> tableEngineParams = New.arrayList(); <END> do { tableEngineParams.add(readUniqueIdentifier()); } while (readIf(",")); command.setTableEngineParams(tableEngineParams); } return command; }</code><technical_language>a code duplication parseCreateTable. Lets move this common part separate method</technical_language>

Target:
private CreateSchema parseCreateSchema() { CreateSchema command = new CreateSchema(session); command.setIfNotExists(readIfNotExists()); command.setSchemaName(readUniqueIdentifier()); if (readIf("AUTHORIZATION")) { command.setAuthorization(readUniqueIdentifier()); } else { command.setAuthorization(session.getUser().getName()); } if (readIf("WITH")) { command.setTableEngineParams(readTableEngineParams()); } return command; }
Source:
<code>public void testJMX() throws Exception { MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); Properties props = new Properties(); JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); JettyLoggerFactory loggerFactory = new JettyLoggerFactory(config); ObjectName objectName = ObjectName.getInstance("org.eclipse.jetty.logging", "type", JettyLoggerFactory.class.getSimpleName().toLowerCase(Locale.ENGLISH)); mbeanServer.registerMBean(loggerFactory, objectName); JettyLoggerFactoryMBean mbean = JMX.newMBeanProxy(mbeanServer, objectName, JettyLoggerFactoryMBean.class); assertEquals(1, mbean.getLoggerCount()); JettyLogger child = loggerFactory.getJettyLogger("org.eclipse.jetty.logging"); JettyLogger parent = loggerFactory.getJettyLogger("org.eclipse.jetty"); assertEquals(3, mbean.getLoggerCount()); List<String> expected = new ArrayList<>(Arrays.asList(JettyLogger.ROOT_LOGGER_NAME, parent.getName(), child.getName())); expected.sort(String::compareTo); String[] loggerNames = mbean.getLoggerNames(); assertEquals(expected, Arrays.asList(loggerNames)); <START> parent.setLevel(Level.DEBUG); <END> assertEquals(Level.intToLevel(parent.getLevel()).toString(), mbean.getLoggerLevel(child.getName())); assertTrue(mbean.setLoggerLevel(child.getName(), "INFO")); assertEquals(Level.INFO.toInt(), child.getLevel()); }</code><technical_language>JMX version here? setLoggerLevel(String loggerName, String levelName)</technical_language>

Target:
public void testJMX() throws Exception { MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); Properties props = new Properties(); JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); JettyLoggerFactory loggerFactory = new JettyLoggerFactory(config); ObjectName objectName = ObjectName.getInstance("org.eclipse.jetty.logging", "type", JettyLoggerFactory.class.getSimpleName().toLowerCase(Locale.ENGLISH)); mbeanServer.registerMBean(loggerFactory, objectName); JettyLoggerFactoryMBean mbean = JMX.newMBeanProxy(mbeanServer, objectName, JettyLoggerFactoryMBean.class); assertEquals(1, mbean.getLoggerCount()); JettyLogger child = loggerFactory.getJettyLogger("org.eclipse.jetty.logging"); JettyLogger parent = loggerFactory.getJettyLogger("org.eclipse.jetty"); assertEquals(3, mbean.getLoggerCount()); List<String> expected = new ArrayList<>(Arrays.asList(JettyLogger.ROOT_LOGGER_NAME, parent.getName(), child.getName())); expected.sort(String::compareTo); String[] loggerNames = mbean.getLoggerNames(); assertEquals(expected, Arrays.asList(loggerNames)); parent.setLevel(JettyLevel.DEBUG); assertEquals(parent.getLevel().toString(), mbean.getLoggerLevel(child.getName())); assertTrue(mbean.setLoggerLevel(child.getName(), "INFO")); assertEquals(JettyLevel.INFO, child.getLevel()); }
Source:
<code>public static Type getIterableElementType(Type context, Class<?> contextRawType) { <START> Type collectionType = getSupertype(context, contextRawType, Iterable.class); <END> if (collectionType instanceof WildcardType) { collectionType = ((WildcardType)collectionType).getUpperBounds()[0]; } if (collectionType instanceof ParameterizedType) { return ((ParameterizedType) collectionType).getActualTypeArguments()[0]; } return Object.class; }</code><technical_language>Change collectionType iterableType</technical_language>

Target:
public static Type getIterableElementType(Type context, Class<?> contextRawType) { Type iterableType = getSupertype(context, contextRawType, Iterable.class); if (iterableType instanceof WildcardType) { iterableType = ((WildcardType)iterableType).getUpperBounds()[0]; } if (iterableType instanceof ParameterizedType) { return ((ParameterizedType) iterableType).getActualTypeArguments()[0]; } return Object.class; }
Source:
<code>private GetMapRequest parseAssociatedGetMap(LegendRequest legend, Rule[] rules) throws Exception { Map<String, Object> kvp = new CaseInsensitiveMap(request.getKvp()); Map<String, String> rawKvp = new CaseInsensitiveMap(request.getRawKvp()); String layerName = getLayerName(legend); kvp.put("LAYERS", layerName); rawKvp.put("LAYERS", layerName); kvp.put("STYLES", ""); rawKvp.put("STYLES", ""); rawKvp.put("WIDTH", rawKvp.get("SRCWIDTH")); rawKvp.put("HEIGHT", rawKvp.get("SRCHEIGHT")); rawKvp.putIfAbsent("HEIGHT", String.valueOf(GetLegendGraphicRequest.DEFAULT_HEIGHT)); rawKvp.putIfAbsent("WIDTH", String.valueOf(GetLegendGraphicRequest.DEFAULT_WIDTH)); kvp.putIfAbsent("HEIGHT", String.valueOf(GetLegendGraphicRequest.DEFAULT_HEIGHT)); kvp.putIfAbsent("WIDTH", String.valueOf(GetLegendGraphicRequest.DEFAULT_WIDTH)); <START> rawKvp.putIfAbsent("BBOX", legend.getLayerInfo().getResource().boundingBox().toString()); <END> kvp.putIfAbsent("BBOX", legend.getLayerInfo().getResource().boundingBox()); final Map formatOptions = (Map) kvp.get("FORMAT_OPTIONS"); if(formatOptions != null) { formatOptions.remove("layout"); } GetMapRequest getMap = getMapReader.read(getMapReader.createRequest(), kvp, rawKvp); Style style = buildStyleFromRules(rules); getMap.setStyles(Arrays.asList(style)); return getMap; }</code><technical_language>This adds a "random" string do a valid WMS bbox expression</technical_language>

Target:
private GetMapRequest parseAssociatedGetMap(LegendRequest legend, Rule[] rules) throws Exception { Map<String, Object> kvp = new CaseInsensitiveMap(request.getKvp()); Map<String, String> rawKvp = new CaseInsensitiveMap(request.getRawKvp()); String layerName = getLayerName(legend); kvp.put("LAYERS", layerName); rawKvp.put("LAYERS", layerName); kvp.put("STYLES", ""); rawKvp.put("STYLES", ""); rawKvp.put("WIDTH", rawKvp.get("SRCWIDTH")); rawKvp.put("HEIGHT", rawKvp.get("SRCHEIGHT")); rawKvp.putIfAbsent("HEIGHT", String.valueOf(GetLegendGraphicRequest.DEFAULT_HEIGHT)); rawKvp.putIfAbsent("WIDTH", String.valueOf(GetLegendGraphicRequest.DEFAULT_WIDTH)); kvp.putIfAbsent("HEIGHT", String.valueOf(GetLegendGraphicRequest.DEFAULT_HEIGHT)); kvp.putIfAbsent("WIDTH", String.valueOf(GetLegendGraphicRequest.DEFAULT_WIDTH)); rawKvp.putIfAbsent("BBOX", legend.getLayerInfo().getResource().boundingBox().toString()); kvp.putIfAbsent("BBOX", legend.getLayerInfo().getResource().boundingBox()); rawKvp.putIfAbsent("SRS", legend.getLayerInfo().getResource().getSRS()); kvp.putIfAbsent("SRS", legend.getLayerInfo().getResource().getSRS()); final Map formatOptions = (Map) kvp.get("FORMAT_OPTIONS"); if(formatOptions != null) { formatOptions.remove("layout"); } GetMapRequest getMap = getMapReader.read(getMapReader.createRequest(), kvp, rawKvp); Style style = buildStyleFromRules(rules); getMap.setStyles(Arrays.asList(style)); return getMap; }
Source:
<code>public boolean isValid(ILaunchConfiguration launchConfig) { setErrorMessage(null); if (!this.graphingEnabled){ return true; } for (int r = 0, n = getNumberOfRegexs(); r < n; r++) { String regexErrorMessage = regexErrorMessages.get(r); if (regexErrorMessage != null){ <START> setErrorMessage(String.format("Expression \"%s\": %s", regularExpressionCombo.getItems()[r], regexErrorMessage)); END> return false; } } return true; }</code><technical_language>This a message substitution parameters (e.g. "Experions {0}: {1} needs translated other messages</technical_language>

Target:
public boolean isValid(ILaunchConfiguration launchConfig) { setErrorMessage(null); if (!this.graphingEnabled){ return true; } for (int r = 0, n = getNumberOfRegexs(); r < n; r++) { String regexErrorMessage = regexErrorMessages.get(r); if (regexErrorMessage != null){ setErrorMessage(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_regexErrorMsgFormat, regularExpressionCombo.getItems()[r], regexErrorMessage)); return false; } } return true; }
Source:
<code>public Patient readTransaction(long patientId, boolean allRecords) { LOG.trace("PatientDAO.readTransaction() -- begin"); Session session = null; List<Patient> queryList; Patient foundRecord = null; try { session = hibernateUtil.getSessionFactory().openSession(); LOG.info("Reading Record..."); Criteria aCriteria = session.createCriteria(Patient.class); aCriteria.add(Expression.eq("id", patientId)); queryList = aCriteria.list(); if (CollectionUtils.isNotEmpty(queryList)) { foundRecord = queryList.get(0); LOG.info("Lazy-initialize-Personnames: {}", foundRecord.getPersonnames().size()); if (allRecords) { LOG.info("Lazy-initialize-Addresses: {}", foundRecord.getAddresses().size()); LOG.info("Lazy-initialize-Identifiers: {}", foundRecord.getIdentifiers().size()); LOG.info("Lazy-initialize-Phonenumbers: {}", foundRecord.getPhonenumbers().size()); } } } catch (HibernateException | NullPointerException e) { LOG.error("Exception during read occured due to : {}", e.getMessage(), e); } finally { <START> if (session != null) { <END> try { session.flush(); session.close(); } catch (HibernateException e) { LOG.error("Exception while closing the session after a read: {}", e.getMessage(), e); } } } LOG.trace("PatientDAO.readTransaction() -- end"); return foundRecord; }</code><technical_language>HibernatUtil.close method</technical_language>

Target:
public Patient readTransaction(long patientId, boolean allRecords) { LOG.trace("PatientDAO.readTransaction() -- begin"); Session session = null; List<Patient> queryList; Patient foundRecord = null; try { session = getSessionFactory().openSession(); LOG.info("Reading Record..."); Criteria aCriteria = session.createCriteria(Patient.class); aCriteria.add(Expression.eq("id", patientId)); queryList = aCriteria.list(); if (CollectionUtils.isNotEmpty(queryList)) { foundRecord = queryList.get(0); foundRecord.getPersonnames(); if (allRecords) { foundRecord.getAddresses(); foundRecord.getIdentifiers(); foundRecord.getPhonenumbers(); } } } catch (HibernateException | NullPointerException e) { LOG.error("Exception during read occured due to : {}", e.getMessage(), e); } finally { HibernateUtil.closeSession(session, true); } LOG.trace("PatientDAO.readTransaction() -- end"); return foundRecord; }
Source:
<code>public void setChoices(Object choices) { if (choices instanceof String) { setChoicesText((String) choices); return; } if (choices instanceof Collection) { this.choices = new ArrayList<>(); for (Object o : (Collection) choices) { if (o != null) { <START> this.choices.add(o.toString()); <END> } } return; } throw new IllegalArgumentException("expected String or Collection, but got " + choices); }</code><technical_language>cast String people do mistakenly pass a list of else</technical_language>

Target:
public void setChoices(Object choices) { if (choices instanceof String) { setChoicesText((String) choices); return; } if (choices instanceof List) { ArrayList<String> newChoices = new ArrayList<>(); for (Object o : (List) choices) { if (o != null) { newChoices.add(o.toString()); } } this.choices = newChoices; return; } throw new IllegalArgumentException("expected String or List, but got " + choices.getClass().getName()); }
Source:
<code>public void run() { mImportController.importDB(uri, new IImportController.IImportControllerCallback() { @Override public void onComplete() { <START> mMainExecutor.run(new Runnable() { <END> @Override public void run() { mCallback.onComplete(); } }); } @Override public void onError(Throwable throwable) { throwable.printStackTrace(); mMainExecutor.run(new Runnable() { @Override public void run() { mCallback.onImportError(); } }); } }); }</code><technical_language>Extract notification method notify..</technical_language>

Target:
public void run() { mImportController.importDB(uri, new IImportController.IImportControllerCallback() { @Override public void onComplete() { notifyOnComplete(); } @Override public void onError(Throwable throwable) { throwable.printStackTrace(); notifyOnError(); } }); }
Source:
<code>private void initAttestation() { List<Cluster> clusters = dbFacade.getClusterDao().getTrustedClusters(); List<VDS> trustedVdsList = new ArrayList<>(); List<String> trustedVdsNames = new ArrayList<>(); if (clusters == null || clusters.size() == 0) { return; } for (Cluster cluster : clusters) { <START> List<VDS> vdssInGroup = dbFacade.getVdsDao(). <END> getAllForClusterWithStatus(cluster.getId(), VDSStatus.Up); if (vdssInGroup != null) { trustedVdsList.addAll(vdssInGroup); } } for (VDS vds : trustedVdsList) { trustedVdsNames.add(vds.getHostName()); setNonOperational(NonOperationalReason.UNINITIALIZED, vds); } try { AttestThread attestThread = new AttestThread(trustedVdsNames); attestThread.start(); } catch (Exception e) { log.error("Failed to initialize attestation cache", e); } }</code><technical_language>vdssInCluster</technical_language>

Target:
private void initAttestation() { List<Cluster> clusters = dbFacade.getClusterDao().getTrustedClusters(); List<VDS> trustedVdsList = new ArrayList<>(); List<String> trustedVdsNames = new ArrayList<>(); if (clusters == null || clusters.size() == 0) { return; } for (Cluster cluster : clusters) { List<VDS> hostsInCluster = dbFacade.getVdsDao(). getAllForClusterWithStatus(cluster.getId(), VDSStatus.Up); if (hostsInCluster != null) { trustedVdsList.addAll(hostsInCluster); } } for (VDS vds : trustedVdsList) { trustedVdsNames.add(vds.getHostName()); setNonOperational(NonOperationalReason.UNINITIALIZED, vds); } try { AttestThread attestThread = new AttestThread(trustedVdsNames); attestThread.start(); } catch (Exception e) { log.error("Failed to initialize attestation cache", e); } }
Source:
<code>public static @Nullable Set<Integer> getThreadsOfCpus(KernelAnalysisModule module, List<Long> cpus, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Set<Integer> set = new HashSet<>(); for (Long cpu : cpus) { List<ITmfStateInterval> intervals = null; try { int threadQuark = ss.getQuarkAbsolute(Attributes.CPUS, cpu.toString(), Attributes.CURRENT_THREAD); intervals = StateSystemUtils.queryHistoryRange(ss, threadQuark, rangeStart, rangeEnd); <START> } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { <END> continue; } intervals.stream() .map(interval -> interval.getStateValue()) .filter(e -> !e.isNull()) .mapToInt(ITmfStateValue::unboxInt) .distinct() .filter(tid -> tid != 0) .forEach(e -> set.add(e)); } return set; }</code><technical_language>log exception, hiding a bug. attribute? query in future</technical_language>

Target:
public static @Nullable Set<Integer> getThreadsOfCpus(KernelAnalysisModule module, List<Long> cpus, long rangeStart, long rangeEnd) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Set<Integer> set = new HashSet<>(); for (Long cpu : cpus) { List<ITmfStateInterval> intervals = null; try { int threadQuark = ss.getQuarkAbsolute(Attributes.CPUS, cpu.toString(), Attributes.CURRENT_THREAD); intervals = StateSystemUtils.queryHistoryRange(ss, threadQuark, rangeStart, rangeEnd); } catch (AttributeNotFoundException e) { continue; } catch (StateSystemDisposedException e) { return null; } intervals.stream() .map(interval -> interval.getStateValue()) .filter(sv -> sv.getType() == Type.INTEGER) .mapToInt(ITmfStateValue::unboxInt) .filter(tid -> tid != 0) .forEach(e -> set.add(e)); } return set; }
Source:
<code>public IStatus discardComment(IReviewItem item, IComment comment, IProgressMonitor monitor) { <START> short side = 1; <END> String id = item.getId(); if (id.startsWith("base-")) { id = id.substring(5); side = 0; } Patch.Key key = Patch.Key.parse(id); for (ILocation location : comment.getLocations()) { if (location instanceof ILineLocation) { ILineLocation lineLocation = (ILineLocation) location; DiscardDraftRequest request = new DiscardDraftRequest(key, lineLocation.getRangeMin(), side); request.setMessage(comment.getDescription()); request.setUuid(comment.getId()); GerritOperation<VoidResult> operation = getOperationFactory().createDiscardDraftOperation(getTask(), request); return operation.run(monitor); } } throw new RuntimeException(Messages.GerritReviewBehavior_Internal_Exception + comment.getId()); }</code><technical_language>RIGHT_SIDE</technical_language>

Target:
public IStatus discardComment(IReviewItem item, IComment comment, IProgressMonitor monitor) { short side = RIGHT_SIDE; String id = item.getId(); if (id.startsWith(BASE)) { id = id.substring(BASE.length()); side = LEFT_SIDE; } Patch.Key key = Patch.Key.parse(id); for (ILocation location : comment.getLocations()) { if (location instanceof ILineLocation) { ILineLocation lineLocation = (ILineLocation) location; DiscardDraftRequest request = new DiscardDraftRequest(key, lineLocation.getRangeMin(), side, comment.getId()); request.setMessage(comment.getDescription()); GerritOperation<VoidResult> operation = getOperationFactory().createDiscardDraftOperation(getTask(), request); return operation.run(monitor); } } throw new RuntimeException(Messages.GerritReviewBehavior_Internal_Exception + comment.getId()); }
Source:
<code>public static BookieSocketAddress getBookieAddress(ServerConfiguration conf) throws UnknownHostException { String iface = conf.getListeningInterface(); if (iface == null) { iface = "default"; } InetSocketAddress inetAddr = new InetSocketAddress(DNS.getDefaultHost(iface), conf.getBookiePort()); <START> String hostAddress = "127.0.0.1"; <END> if (!inetAddr.isUnresolved()) { hostAddress = inetAddr.getAddress().getHostAddress(); if (conf.getUseHostNameAsBookieID()) { hostAddress = inetAddr.getAddress().getCanonicalHostName(); } } BookieSocketAddress addr = new BookieSocketAddress(hostAddress, conf.getBookiePort()); if (addr.getSocketAddress().getAddress().isLoopbackAddress() && !conf.getAllowLoopback()) { throw new UnknownHostException("Trying to listen on loopback address, " + addr + " but this is forbidden by default " + "(see ServerConfiguration#getAllowLoopback())"); } return addr; }</code><technical_language>insights of this change? If inetAddr isUnresolved, fail bookie, because: - if is a fresh bookie, address '127.0.0.1' announces is wrong. - if is a bookie registered, address ip in cookie. I do need this change here</technical_language>

Target:
public static BookieSocketAddress getBookieAddress(ServerConfiguration conf) throws UnknownHostException { String iface = conf.getListeningInterface(); if (iface == null) { iface = "default"; } String hostName = DNS.getDefaultHost(iface); InetSocketAddress inetAddr = new InetSocketAddress(hostName, conf.getBookiePort()); if (inetAddr.isUnresolved()) { throw new UnknownHostException("Unable to resolve default hostname: " + hostName + " for interface: " + iface); } String hostAddress = inetAddr.getAddress().getHostAddress(); if (conf.getUseHostNameAsBookieID()) { hostAddress = inetAddr.getAddress().getCanonicalHostName(); } BookieSocketAddress addr = new BookieSocketAddress(hostAddress, conf.getBookiePort()); if (addr.getSocketAddress().getAddress().isLoopbackAddress() && !conf.getAllowLoopback()) { throw new UnknownHostException("Trying to listen on loopback address, " + addr + " but this is forbidden by default " + "(see ServerConfiguration#getAllowLoopback())"); } return addr; }
Source:
<code>public String match(AbstractPlanNode node) { PlanNodeType mainNodeType = node.getPlanNodeType(); if (m_type != mainNodeType) { <START> return String.format("PlanWithInlineNode: #xpected main plan node type %s, got %s", <END> m_type, mainNodeType); } for (PlanNodeType nodeType : m_branches) { AbstractPlanNode inlineNode = node.getInlinePlanNode(nodeType); if (inlineNode == null) { return String.format("Expected inline node type %s but didn't find it.", nodeType.name()); } } if (m_branches.size() != node.getInlinePlanNodes().size()) { return String.format("Expected %d inline nodes, found %d", m_branches.size(), node.getInlinePlanNodes().size()); } return null; }</code><technical_language>Typo #xpected</technical_language>

Target:
public String match(AbstractPlanNode node) { PlanNodeType mainNodeType = node.getPlanNodeType(); if (m_type != mainNodeType) { return String.format("PlanWithInlineNode: expected main plan node type %s, got %s", m_type, mainNodeType); } for (PlanNodeType nodeType : m_branches) { AbstractPlanNode inlineNode = node.getInlinePlanNode(nodeType); if (inlineNode == null) { return String.format("Expected inline node type %s but didn't find it.", nodeType.name()); } } if (m_branches.size() != node.getInlinePlanNodes().size()) { return String.format("Expected %d inline nodes, found %d", m_branches.size(), node.getInlinePlanNodes().size()); } return null; }
Source:
<code>public EhcacheClientEntity(EntityClientEndpoint<EhcacheEntityMessage, EhcacheEntityResponse> endpoint) { this.endpoint = endpoint; endpoint.setDelegate(new EndpointDelegate() { @Override public void handleMessage(EntityResponse messageFromServer) { <START> fireResponseEvent((EhcacheEntityResponse) messageFromServer); <END> } @Override public byte[] createExtendedReconnectData() { return new byte[0]; } @Override public void didDisconnectUnexpectedly() { } }); }</code><technical_language>I a bit more error handling - happen. a class cast exception context a bit bland</technical_language>

Target:
public EhcacheClientEntity(EntityClientEndpoint<EhcacheEntityMessage, EhcacheEntityResponse> endpoint) { this.endpoint = endpoint; this.messageFactory = new LifeCycleMessageFactory(); endpoint.setDelegate(new EndpointDelegate() { @Override public void handleMessage(EntityResponse messageFromServer) { if (messageFromServer instanceof EhcacheEntityResponse) { fireResponseEvent((EhcacheEntityResponse) messageFromServer); } } @Override public byte[] createExtendedReconnectData() { return new byte[0]; } @Override public void didDisconnectUnexpectedly() { connected = false; fireDisconnectionEvent(); } }); }
Source:
<code>public void testGetData() { if (particle.getType() != Effect.Type.PARTICLE) return; switch (particle) { case ITEM_BREAK: assertEquals("Wrong getData for " + particle, true, particle.getData() != null); assertArrayEquals("Wrong data for " + particle, new int[]{Material.STONE.getId(), 1}, GlowParticle.getData(particle, STONE)); break; case TILE_BREAK: <START> assertEquals("Wrong getData for " + particle, true, particle.getData() != null); <END> assertArrayEquals("Wrong data for " + particle, new int[]{4097}, GlowParticle.getData(particle, STONE)); break; case TILE_DUST: assertEquals("Wrong getData for " + particle, true, particle.getData() != null); assertArrayEquals("Wrong data for " + particle, new int[]{Material.STONE.getId()}, GlowParticle.getData(particle, STONE)); break; default: assertEquals("Wrong getData for " + particle, false, particle.getData() != null); assertArrayEquals("Wrong data for " + particle, new int[0], GlowParticle.getData(particle, null)); } }</code><technical_language>switched. I warning for data Wrong data for, Wrong getData for</technical_language>

Target:
public void testGetData() { if (particle.getType() != Effect.Type.PARTICLE) return; switch (particle) { case ITEM_BREAK: assertEquals("Wrong data for " + particle, true, particle.getData() != null); assertArrayEquals("Wrong extra data for " + particle, new int[]{Material.STONE.getId(), 1}, GlowParticle.getExtData(particle, STONE)); break; case TILE_BREAK: assertEquals("Wrong data for " + particle, true, particle.getData() != null); assertArrayEquals("Wrong extra data for " + particle, new int[]{4097}, GlowParticle.getExtData(particle, STONE)); break; case TILE_DUST: assertEquals("Wrong data for " + particle, true, particle.getData() != null); assertArrayEquals("Wrong extra data for " + particle, new int[]{Material.STONE.getId()}, GlowParticle.getExtData(particle, STONE)); break; default: assertEquals("Wrong data for " + particle, false, particle.getData() != null); assertArrayEquals("Wrong extra data for " + particle, new int[0], GlowParticle.getExtData(particle, null)); } }
Source:
<code>public SignatureKeyManager( @Named("che.auth.signature_key_size") int keySize, @Named("che.auth.signature_key_algorithm") String algorithm, EventService eventService, SignatureKeyDao signatureKeyDao) { this.keySize = keySize; this.algorithm = algorithm; this.eventService = eventService; this.signatureKeyDao = signatureKeyDao; this.workspaceEventsSubscriber = <START> (org.eclipse.che.api.core.notification.EventSubscriber< <END> org.eclipse.che.api.workspace.shared.dto.event.WorkspaceStatusEvent>) event -> { if (event.getStatus() == STOPPED) { removeKeyPair(event.getWorkspaceId()); } else if (event.getStatus() == STARTING) { generateKeyPair(event.getWorkspaceId()); } }; }</code><technical_language>org.eclipse.che.api.core.notification.EventSubscriber EventSubscriber is import? questions WorkspaceStatusEvent</technical_language>

Target:
public SignatureKeyManager( @Named("che.auth.signature_key_size") int keySize, @Named("che.auth.signature_key_algorithm") String algorithm, EventService eventService, SignatureKeyDao signatureKeyDao) { this.keySize = keySize; this.algorithm = algorithm; this.eventService = eventService; this.signatureKeyDao = signatureKeyDao; this.workspaceEventsSubscriber = new EventSubscriber<WorkspaceStatusEvent>() { @Override public void onEvent(WorkspaceStatusEvent event) { if (event.getStatus() == STOPPED) { removeKeyPair(event.getWorkspaceId()); } } }; }
Source:
<code>public SqlBitOpAggFunction(SqlKind kind) { super(kind.name(), null, kind, ReturnTypes.ARG0_NULLABLE_IF_EMPTY, null, OperandTypes.INTEGER, <START> SqlFunctionCategory.SYSTEM, <END> false, false, Optionality.FORBIDDEN); Preconditions.checkArgument(kind == SqlKind.BIT_AND || kind == SqlKind.BIT_OR); }</code><technical_language>this more appropriately in NUMERIC category</technical_language>

Target:
public SqlBitOpAggFunction(SqlKind kind) { super(kind.name(), null, kind, ReturnTypes.ARG0_NULLABLE_IF_EMPTY, null, OperandTypes.INTEGER, SqlFunctionCategory.NUMERIC, false, false, Optionality.FORBIDDEN); Preconditions.checkArgument(kind == SqlKind.BIT_AND || kind == SqlKind.BIT_OR); }
Source:
<code>public void testGetNetworkSelectionMode() { if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { return; } int networkMode = <START> ShellIdentityUtils.invokeMethodWithShellPermissions(mTelephonyManager, <END> (tm) -> tm.getNetworkSelectionMode()); assertEquals(2, networkMode); }</code><technical_language>need this in order getNetworkSelectionMode(). I check I safely give READ_PRECISE_PHONE_STATE this package</technical_language>

Target:
public void testGetNetworkSelectionMode() { if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { return; } int networkMode = mTelephonyManager.getNetworkSelectionMode(); assertEquals(0, networkMode); }
Source:
<code>private void updateDefaultSelectedConsoleProtocol(final VM vm) { if (vm.getId() == null) { return; } final ArrayList<ConsoleModel> cachedModels = cachedConsoleModels.get(vm.getId()); if (cachedModels == null) { return; } deselectUserSelectedProtocol(vm.getId()); final boolean isWindowsExplorer = parentModel.getConfigurator().isClientWindowsExplorer(); Boolean hasSpiceSupport = AsyncDataProvider.hasSpiceSupport(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); <START> if (isWindowsExplorer && hasSpiceSupport != null && hasSpiceSupport.booleanValue()) { <END> cachedModels.get(RDP_INDEX).setUserSelected(true); } else { determineConsoleModelFromVm(vm, cachedModels).setUserSelected(true); } setupSelectionContext(vm); }</code><technical_language>need call booleanValue()</technical_language>

Target:
private void updateDefaultSelectedConsoleProtocol(final VM vm) { if (vm.getId() == null) { return; } final ArrayList<ConsoleModel> cachedModels = cachedConsoleModels.get(vm.getId()); if (cachedModels == null) { return; } deselectUserSelectedProtocol(vm.getId()); final boolean isWindowsExplorer = parentModel.getConfigurator().isClientWindowsExplorer(); Boolean hasSpiceSupport = AsyncDataProvider.hasSpiceSupport(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); if (isWindowsExplorer && hasSpiceSupport != null && hasSpiceSupport) { cachedModels.get(RDP_INDEX).setUserSelected(true); } else { determineConsoleModelFromVm(vm, cachedModels).setUserSelected(true); } setupSelectionContext(vm); }
Source:
<code>private void ensureProjectExplorerPart() { PartStack navigationPartStack = workspaceAgent.getPartStack(NAVIGATION); PartPresenter activePart = navigationPartStack.getActivePart(); if (!(activePart instanceof ProjectExplorerPresenter)) { ProjectExplorerPresenter projectExplorerPresenter = projectExplorerPresenterProvider.get(); if (activePart == null) { workspaceAgent.openPart(projectExplorerPresenter, NAVIGATION); <START> } <END> workspaceAgent.setActivePart(projectExplorerPresenter); } }</code><technical_language>simplify this nested structure? do check for null open project explorer in this case. Next do check 'instanceof' if active part is null WDYT</technical_language>

Target:
private void ensureProjectExplorerPart() { PartStack navigationPartStack = workspaceAgent.getPartStack(NAVIGATION); PartPresenter activePart = navigationPartStack.getActivePart(); ProjectExplorerPresenter projectExplorerPresenter = projectExplorerPresenterProvider.get(); if (activePart == null) { workspaceAgent.openPart(projectExplorerPresenter, NAVIGATION); } if (!(activePart instanceof ProjectExplorerPresenter)) { workspaceAgent.setActivePart(projectExplorerPresenter); } }
Source:
<code>public ConceptName getFullySpecifiedName(Locale locale) { <START> if (locale != null && !getNames(locale).isEmpty()) { <END> for (ConceptName conceptName : getNames(locale)) { if (ObjectUtils.nullSafeEquals(conceptName.isFullySpecifiedName(), true)) { return conceptName; } } ConceptName bestMatch = null; for (ConceptName conceptName : getPartiallyCompatibleNames(locale)) { if (ObjectUtils.nullSafeEquals(conceptName.isFullySpecifiedName(), true)) { Locale nameLocale = conceptName.getLocale(); if (locale.getLanguage().equals(nameLocale.getLanguage())) { return conceptName; } bestMatch = conceptName; } } return bestMatch; } return null; }</code><technical_language>CollectionUtils.isNotEmpty()</technical_language>

Target:
public ConceptName getFullySpecifiedName(Locale locale) { if (locale != null && CollectionUtils.isNotEmpty(getNames(locale))) { for (ConceptName conceptName : getNames(locale)) { if (ObjectUtils.nullSafeEquals(conceptName.isFullySpecifiedName(), true)) { return conceptName; } } ConceptName bestMatch = null; for (ConceptName conceptName : getPartiallyCompatibleNames(locale)) { if (ObjectUtils.nullSafeEquals(conceptName.isFullySpecifiedName(), true)) { Locale nameLocale = conceptName.getLocale(); if (locale.getLanguage().equals(nameLocale.getLanguage())) { return conceptName; } bestMatch = conceptName; } } return bestMatch; } return null; }
Source:
<code>String getBuilderClassName(@NotNull PsiClass psiClass, String returnTypeName) { final ConfigDiscovery configDiscovery = ConfigDiscovery.getInstance(); final String builderClassNamePattern = configDiscovery.getStringLombokConfigProperty(BUILDER_CLASS_NAME, psiClass); <START> return StringUtil.replace(builderClassNamePattern, "*", returnTypeName); <END> }</code><technical_language>returnTypeName capitalized: StringUtil.capitalize(returnTypeName )</technical_language>

Target:
String getBuilderClassName(@NotNull PsiClass psiClass, String returnTypeName) { final ConfigDiscovery configDiscovery = ConfigDiscovery.getInstance(); final String builderClassNamePattern = configDiscovery.getStringLombokConfigProperty(BUILDER_CLASS_NAME, psiClass); return replace(builderClassNamePattern, "*", capitalize(returnTypeName)); }
Source:
<code>public T build() { T result = createMessage(messageClass); <START> ((Message) result).tags.addAll(tags); <END> if (((Message) result).tags.isEmpty()) { Set<String> defaultTags = result.getDefaultTags(); if (defaultTags != null) { ((Message) result).tags.addAll(defaultTags); } } if (text != null) { ((Message) result).text = text; } if (cssClass != null) { ((Message) result).cssClass = cssClass; } else { ((Message) result).cssClass = result.getDefaultCssClass(); } if (duration != null) { ((Message) result).duration = duration; } return result; }</code><technical_language>avoid casting times</technical_language>

Target:
public T build() { T result = createMessage(messageClass); fillData(result); return result; }
Source:
<code>public static BriefcaseAnalytics getInstance() { <START> return instance == null ? new BriefcaseAnalytics() : instance; <END> }</code><technical_language>instance remains null. I suggest if (instance == null) { instance = new BriefcaseAnalytics(); } return instance;</technical_language>

Target:
public static BriefcaseAnalytics getInstance() { return instance == null ? (instance = new BriefcaseAnalytics()) : instance; }
Source:
<code>public Comment createComment(CoreSession session, Comment comment) throws IllegalArgumentException { if (!session.exists(new IdRef(comment.getDocumentId()))) { throw new IllegalArgumentException("The document " + comment.getDocumentId() + " does not exist."); } return CoreInstance.doPrivileged(session, s -> { DocumentModel commentModel = s.createDocumentModel(COMMENT_DOC_TYPE); commentModel.setPropertyValue(COMMENT_AUTHOR, comment.getAuthor()); commentModel.setPropertyValue(COMMENT_TEXT, comment.getText()); commentModel.setPropertyValue(COMMENT_DOCUMENT_ID, comment.getDocumentId()); commentModel.setPropertyValue(COMMENT_CREATION_DATE, comment.getCreationDate()); commentModel.setPropertyValue(COMMENT_MODIFICATION_DATE, comment.getModificationDate()); <START> commentModel = s.createDocument(commentModel); <END> Comment createdComment = new CommentImpl(); Comments.documentModelToComment().accept(commentModel, createdComment); return createdComment; }); }</code><technical_language>External entity is handled</technical_language>

Target:
public Comment createComment(CoreSession session, Comment comment) throws IllegalArgumentException { if (!session.exists(new IdRef(comment.getDocumentId()))) { throw new IllegalArgumentException("The document " + comment.getDocumentId() + " does not exist."); } return CoreInstance.doPrivileged(session, s -> { DocumentModel commentModel = s.createDocumentModel(COMMENT_DOC_TYPE); commentModel.setPropertyValue(COMMENT_AUTHOR, comment.getAuthor()); commentModel.setPropertyValue(COMMENT_TEXT, comment.getText()); commentModel.setPropertyValue(COMMENT_DOCUMENT_ID, comment.getDocumentId()); commentModel.setPropertyValue(COMMENT_CREATION_DATE, comment.getCreationDate()); commentModel.setPropertyValue(COMMENT_MODIFICATION_DATE, comment.getModificationDate()); if (comment instanceof ExternalEntity) { commentModel.setPropertyValue(EXTERNAL_ENTITY_ID_PROPERTY, ((ExternalEntity) comment).getEntityId()); commentModel.setPropertyValue(EXTERNAL_ENTITY_ORIGIN_PROPERTY, ((ExternalEntity) comment).getOrigin()); commentModel.setPropertyValue(EXTERNAL_ENTITY_PROPERTY, ((ExternalEntity) comment).getEntity()); commentModel = s.createDocument(commentModel); Comment createdComment = new CommentImpl(); Comments.documentModelToExternalComment().accept(commentModel, createdComment); return createdComment; } commentModel = s.createDocument(commentModel); Comment createdComment = new CommentImpl(); Comments.documentModelToComment().accept(commentModel, createdComment); return createdComment; }); }
Source:
<code>protected void onUnload() { if (regNavigation != null) { regNavigation.removeHandler(); regNavigation = null; } if (regAction != null) { regAction.removeHandler(); regAction = null; } <START> detailCache.removeValueChangeHandler(this); <END> super.onUnload(); }</code><technical_language>supposed retain RegistrationHandle call removeHandler detach</technical_language>

Target:
protected void onUnload() { if (regNavigation != null) { regNavigation.removeHandler(); regNavigation = null; } if (regAction != null) { regAction.removeHandler(); regAction = null; } if (regDetailCache != null) { regDetailCache.removeHandler(); regDetailCache = null; } super.onUnload(); }
Source:
<code>public static Kind fromBinaryType(int binaryType) { <START> Kind kind = BINARYTYPE_KINDS.get(new Integer(binaryType)); <END> Preconditions.checkArgument(kind != null); return kind; }</code><technical_language>need new Integer, Java autobox</technical_language>

Target:
public static Kind fromBinaryType(int binaryType) { Kind kind = BINARYTYPE_KINDS.get(binaryType); Preconditions.checkArgument(kind != null); return kind; }
Source:
<code>private boolean canExecute(final String runScriptFile) { try { return retryTemplate.execute(c -> { FileUtils.touch(new File(runScriptFile)); return true; }); } catch (Exception e) { <START> log.warn("Failed touching the run script file", e); <END> } return false; }</code><technical_language>add a metric get a sense this happens</technical_language>

Target:
private boolean canExecute(final String runScriptFile) { try { return retryTemplate.execute(c -> { FileUtils.touch(new File(runScriptFile)); return true; }); } catch (Exception e) { registry.counter("genie.jobs.tasks.jobKickoffTask.run.failure").increment(); log.warn("Failed touching the run script file", e); } return false; }
Source:
<code>public Map<String, List<Integer>> readLineCoverage() { JacocoBuildAction jacocoAction = getJacocoBuildAction(); JacocoPublisher jacocoPublisher = getJacocoPublisher(); if (jacocoAction == null || jacocoPublisher == null) { return null; } HashMap<String, List<Integer>> lineCoverage = new HashMap<String, List<Integer>>(); String[] includes = null; if (jacocoPublisher.getInclusionPattern() != null) { includes = new String[] {jacocoPublisher.getInclusionPattern()}; } String[] excludes = null; if (jacocoPublisher.getExclusionPattern() != null) { excludes = new String[] {jacocoPublisher.getExclusionPattern()}; } try { ExecutionFileLoader executionFileLoader = jacocoAction.getJacocoReport().parse(includes, excludes); for (IPackageCoverage packageCoverage : executionFileLoader.getBundleCoverage().getPackages()) { for (IClassCoverage classCoverage : packageCoverage.getClasses()) { <START> String relativePathFromProjectRoot = getRelativePathFromProjectRoot( <END> classCoverage.getSourceFileName()); if (relativePathFromProjectRoot != null) { lineCoverage.put(relativePathFromProjectRoot, getPerLineCoverage(classCoverage)); } } } } catch (IOException e) { e.printStackTrace(); return null; } return lineCoverage; }</code><technical_language>Jacoco provider ensure classes name packages coverage information posted Phabricator. stripping path file name, broken</technical_language>

Target:
public Map<String, List<Integer>> readLineCoverage() { JacocoBuildAction jacocoAction = getJacocoBuildAction(); JacocoPublisher jacocoPublisher = getJacocoPublisher(); if (jacocoAction == null || jacocoPublisher == null) { return null; } HashMap<String, List<Integer>> lineCoverage = new HashMap<String, List<Integer>>(); String[] includes = null; if (jacocoPublisher.getInclusionPattern() != null) { includes = new String[] {jacocoPublisher.getInclusionPattern()}; } String[] excludes = null; if (jacocoPublisher.getExclusionPattern() != null) { excludes = new String[] {jacocoPublisher.getExclusionPattern()}; } try { ExecutionFileLoader executionFileLoader = jacocoAction.getJacocoReport().parse(includes, excludes); for (IPackageCoverage packageCoverage : executionFileLoader.getBundleCoverage().getPackages()) { for (ISourceFileCoverage fileCoverage : packageCoverage.getSourceFiles()) { String relativePathFromProjectRoot = getRelativePathFromProjectRoot(fileCoverage.getPackageName() + "/" + fileCoverage.getName()); if (relativePathFromProjectRoot != null) { lineCoverage.put(relativePathFromProjectRoot, getPerLineCoverage(fileCoverage)); } } } } catch (IOException e) { e.printStackTrace(); return null; } return lineCoverage; }
Source:
<code>public void create_instance_by_hours_offset() { <START> final int secondsInTwoHours = SECONDS_PER_MINUTE * MINUTES_PER_HOUR * 2; <END> assertEquals(secondsInTwoHours, ZoneOffsets.ofHours(2) .getAmountSeconds()); }</code><technical_language>some classes utility methods</technical_language>

Target:
public void create_instance_by_hours_offset() { final int secondsInTwoHours = secondsInHours(2); assertEquals(secondsInTwoHours, ZoneOffsets.ofHours(2) .getAmountSeconds()); }
Source:
<code>public final Long countRoles(String filter) throws UserStoreException { if (!isSecureCall.get()) { Class[] argTypes = new Class[]{String.class}; Object object = callSecure("countRoles", new Object[]{filter}, argTypes); return (Long) object; } int index; Long countRoles; String domain = null; index = filter.indexOf(CarbonConstants.DOMAIN_SEPARATOR); if (index > 0) { domain = filter.substring(0, index); filter = filter.substring(index + 1); UserStoreManager SecondaryUserStoreManager = getSecondaryUserStoreManager(domain); if (SecondaryUserStoreManager != null) { if (SecondaryUserStoreManager instanceof AbstractUserStoreManager) { return ((AbstractUserStoreManager) SecondaryUserStoreManager).doCountRoles(filter); } else { return null; } } } else if (index == 0) { <START> countRoles = doCountRoles(filter.substring(1)); <END> return countRoles; } try { if (domain != null) { if (domain.equals("Internal") || domain.equals("Application")) { filter = domain + "%" + filter; } } countRoles = doCountRoles(filter); } catch (UserStoreException ex) { handleGetUserCountFailure(ErrorMessages.ERROR_CODE_ERROR_WHILE_GETTING_ROLES_COUNT.getCode(), String.format(ErrorMessages.ERROR_CODE_ERROR_WHILE_GETTING_ROLES_COUNT.getMessage(), ex.getMessage()), null, null); throw ex; } return countRoles; }</code><technical_language>return. need assign</technical_language>

Target:
public long countRoles(String filter) throws UserStoreException { if (!isSecureCall.get()) { Class[] argTypes = new Class[]{String.class}; Object object = callSecure("countRoles", new Object[]{filter}, argTypes); return (long) object; } int index; index = filter.indexOf(CarbonConstants.DOMAIN_SEPARATOR); if (index > 0) { String domain = filter.substring(0, index); if (isInternalRole(domain)) { return doCountRoles(filter); } filter = filter.substring(index + 1); UserStoreManager secondaryUserStoreManager = getSecondaryUserStoreManager(domain); if (secondaryUserStoreManager != null) { if (secondaryUserStoreManager instanceof AbstractUserStoreManager) { return ((AbstractUserStoreManager) secondaryUserStoreManager).doCountRoles(filter); } else { throw new UserStoreException("User store not supported"); } } } else if (index == 0) { return doCountRoles(filter.substring(1)); } return doCountRoles(filter); }
Source:
<code>public void onRestoreInstanceState(Bundle bundle) { super.onRestoreInstanceState(bundle); BaseShape baseShape = (BaseShape) bundle.getSerializable(BUNDLE_BASE_SHAPE); ShapeDrawType shapeDrawType = (ShapeDrawType) bundle.getSerializable(BUNDLE_SHAPE_DRAW_TYPE); <START> int shapeOutlineWidth = (int) bundle.getSerializable(BUNDLE_OUTLINE_WIDTH); <END> if (baseShape != null && shapeDrawType != null && (this.baseShape != baseShape || this.shapeDrawType != shapeDrawType)) { this.baseShape = baseShape; this.shapeDrawType = shapeDrawType; this.shapeOutlineWidth = shapeOutlineWidth; shapeToolOptionsListener.setShapeActivated(baseShape); shapeToolOptionsListener.setDrawTypeActivated(shapeDrawType); shapeToolOptionsListener.setShapeOutlineWidth(shapeOutlineWidth); createAndSetBitmap(); } }</code><technical_language>[Bundle.getInt(String)](<LINK_0> instead</technical_language>

Target:
public void onRestoreInstanceState(Bundle bundle) { super.onRestoreInstanceState(bundle); BaseShape baseShape = (BaseShape) bundle.getSerializable(BUNDLE_BASE_SHAPE); ShapeDrawType shapeDrawType = (ShapeDrawType) bundle.getSerializable(BUNDLE_SHAPE_DRAW_TYPE); int shapeOutlineWidth = bundle.getInt(BUNDLE_OUTLINE_WIDTH); if (baseShape != null && shapeDrawType != null && (this.baseShape != baseShape || this.shapeDrawType != shapeDrawType)) { this.baseShape = baseShape; this.shapeDrawType = shapeDrawType; this.shapeOutlineWidth = shapeOutlineWidth; shapeToolOptionsListener.setShapeActivated(baseShape); shapeToolOptionsListener.setDrawTypeActivated(shapeDrawType); shapeToolOptionsListener.setShapeOutlineWidth(shapeOutlineWidth); createAndSetBitmap(); } }
Source:
<code>public SupremeCourtChamber getOrCreateScChamber(String chamberName) { <START> Preconditions.checkArgument(!StringUtils.isBlank(chamberName)); <END> SupremeCourtChamber scChamber = scChamberRepository.findOneByName(chamberName); if (scChamber == null) { scChamber = new SupremeCourtChamber(); scChamber.setName(chamberName); scChamberRepository.saveAndFlush(scChamber); } return scChamber; }</code><technical_language>J) consider slightly more readable version Preconditions.checkArgument(StringUtils.isNotBlank(chamberName));</technical_language>

Target:
public SupremeCourtChamber getOrCreateScChamber(String chamberName) { Preconditions.checkArgument(StringUtils.isNotBlank(chamberName)); SupremeCourtChamber scChamber = scChamberRepository.findOneByName(chamberName); if (scChamber == null) { scChamber = new SupremeCourtChamber(); scChamber.setName(chamberName); scChamberRepository.saveAndFlush(scChamber); } return scChamber; }