Skip to content

Commit

Permalink
Merge pull request #5320 from tbw777/new2
Browse files Browse the repository at this point in the history
Removed creating of unused objects
  • Loading branch information
mbien authored Feb 11, 2023
2 parents 5197f07 + c00f228 commit 410710e
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void generate(MethodModel methodModel, boolean generateLocal, boolean gen

// remote interface
if (generateRemote && remoteHome != null) {
List<String> exceptions = exceptions = new ArrayList<String>(methodModel.getExceptions());
List<String> exceptions = new ArrayList<>(methodModel.getExceptions());
if (!methodModel.getExceptions().contains("java.rmi.RemoteException")) {
exceptions.add("java.rmi.RemoteException");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ protected int initSyntaxButton(int gridy ,final TargetChooserPanel<FileType> pan
{
myFaceletsSyntaxButton = new JRadioButton();

GridBagConstraints gridBagConstraints = new GridBagConstraints();
myFaceletsSyntaxButton.setSelected(true);
getSegmentBox().setEnabled(false);
myFaceletsSyntaxButton.setMnemonic(NbBundle.getMessage(
Expand All @@ -285,7 +284,7 @@ public void itemStateChanged(ItemEvent evt) {
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = gridy++;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ protected int doInitComponents( JPanel mainPanel ,
"A11Y_AddToTLD_mnem").charAt(0));
myTldCheckBox.setText(NbBundle.getMessage(TagTargetPanelProvider.class,
"OPT_addTagFileToTLD"));

GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
});

GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = gridy++;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ public static SoapClientJ2eeOperationInfo[] toJaxwsOperationInfos(WsdlSaasMethod

public static void addServletAnnotation(JavaSource javaSource, final String servletName, final String urlPattern)
throws IOException {
final String[] seiClass = new String[1];
final CancellableTask<WorkingCopy> modificationTask = new CancellableTask<WorkingCopy>() {

public void cancel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class ColorProcessor extends PropertyProcessor {


void processPropertyImpl(String propertyName, Object value) {
StringBuffer sb = new StringBuffer();
if ("connectionBorderColor".equals(propertyName)||
"dragBorderColor".equals(propertyName)||
"formDesignerBackgroundColor".equals(propertyName)||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class FileProcessor extends PropertyProcessor {
}

void processPropertyImpl(String propertyName, Object value) {
StringBuffer sb = new StringBuffer();
if ("antHome".equals(propertyName) || "projectsFolder".equals(propertyName)) {//NOI18N
List l = ((SerParser.ObjectWrapper)value).data;
for (Iterator it = l.iterator(); it.hasNext();) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class HostPropertyProcessor extends PropertyProcessor {
}

void processPropertyImpl(String propertyName, Object value) {
StringBuffer sb = new StringBuffer();
if ("hostProperty".equals(propertyName)) {//NOI18N
List l = ((SerParser.ObjectWrapper)value).data;
for (Iterator it = l.iterator(); it.hasNext();) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class NbClassPathProcessor extends PropertyProcessor {
}

void processPropertyImpl(String propertyName, Object value) {
StringBuffer sb = new StringBuffer();
List l = ((SerParser.ObjectWrapper)value).data;
for (Iterator it = l.iterator(); it.hasNext();) {
Object elem = (Object) it.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class URLProcessor extends PropertyProcessor {
}

void processPropertyImpl(String propertyName, Object value) {
StringBuffer sb = new StringBuffer();
if ("mainProjectURL".equals(propertyName)) {//NOI18N
List l = ((SerParser.ObjectWrapper)value).data;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public RSSFeed( boolean showProxyButton ) {

public void setContent( Component content ) {
removeAll();
Dimension d = new Dimension();
add( content, BorderLayout.CENTER );
firePropertyChange( FEED_CONTENT_PROPERTY, null, content );
revalidate();
Expand Down
2 changes: 1 addition & 1 deletion nbbuild/antsrc/org/netbeans/nbbuild/LocMakeNBM.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected void addLocalePatterns( FileSet fs,
protected void addLocalePatterns( LinkedList<String> list,
String loc) {
// String dir = new String() ;
String re = new String() ;
String re;


// dir = mainDir ; // modified for clusterization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,19 @@ public DefaultAnchorShapeResolver(ConnectionWidget connection,
this.attachedEnd = attachedTo;
this.attachedWidget = attachedWidget;
}

public int getEndLocation()
{
int retVal = 0;
int retVal;

if(attachedWidget != null)
{
Rectangle bounds = attachedWidget.getBounds();
retVal = getLocation(bounds);
}
else
{
// Rectangle bounds = attachedWidget.getBounds();
Rectangle bounds = new Rectangle();
Rectangle bounds;
if(attachedEnd == ConnectionEnd.SOURCE)
{
Widget sourceWidget = getConnection().getSourceAnchor().getRelatedWidget();
Expand All @@ -75,7 +74,7 @@ public int getEndLocation()
}
retVal = getLocation(bounds);
}

return retVal;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ public float[] computeLowerBarycenters(int upperLayerIndex) {
int upperLayerSize = upperLayer.size();
int lowerLayerSize = lowerLayer.size();
float lowerBarycenters[] = new float[lowerLayerSize];

float[] barycenters = new float[lowerLayerSize];

for (int k = 0; k < lowerLayerSize; k++) {
float sum = 0;
float count = 0;
Expand All @@ -182,7 +181,6 @@ public float[] computeLowerBarycenters(int upperLayerIndex) {
}
Vertex<N> kv = lowerLayer.get(k);
lowerBarycenters[k] = sum/count;
//System.out.println("kv = " + kv + " barycenter = " + lowerBarycenters[k]);
}

return lowerBarycenters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public ProvidedExtensions.DeleteHandler getDeleteHandler(final File f) {
}

public ProvidedExtensions.IOHandler getRenameHandler(final File from, final String newName) {
final File to = new File(from.getParentFile(), newName);
IOHandler retValue = null;
for (Iterator<BaseAnnotationProvider> it = annotationProviders.iterator(); it.hasNext() && retValue == null;) {
BaseAnnotationProvider provider = it.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public void actionPerformed(ActionEvent ae) {

jb9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
int[] idxs = new int [] { 1, 3, 6, 8};
TabData[] td = new TabData[] {
new TabData(new JButton("inserted c 1"), myIcon, "Ic-1", "tip"),
new TabData(new JButton("inserted c 2"), myIcon, "Ic-2", "tip"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ public void setTabs(TabData[] data) {
return;
}

List newContents = Arrays.asList(data);

list.clear();
list.addAll(Arrays.asList(data));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ protected final void refreshFolder(
fire && (added == null) && (removed == null) && !getFileSystem().isReadOnly() &&
!(this instanceof MultiFileObject)
) {
Set<String> nameFilter = nameFilter = new HashSet<String>();
Set<String> nameFilter = new HashSet<>();

if (addedNames != null) {
nameFilter.addAll(addedNames);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,10 @@ private void toggle() {
}

private JComponent createNavigatePanel() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();

// first
panel = new JPanel(new GridBagLayout());
JPanel panel = new JPanel(new GridBagLayout());
c.insets = new Insets(TINY_SIZE, TINY_SIZE, TINY_SIZE, TINY_SIZE);
myFirst = createButton(
new ButtonAction(icon(Config.class, "first"), i18n("TLT_First")) { // NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public ImageView(Instance instance, Heap heap) {

@Override
protected void computeView(Instance instance, Heap heap) {
FieldAccessor fa = new FieldAccessor(heap, BUILDERS);
Image image = null;
JLabel label = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@ public void run() {
});
// ---
} else {
Object[] shortPath = new Object[length];
System.arraycopy(path, 0, shortPath, 0, length);
final TreePath p = new TreePath(shortPath);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
selectPath(path, length + MAX_STEP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ private Collection<HtmlTagAttribute> getHtmlAttributes(final String tagName, fin
}

private Collection<HtmlTag> getHtmlTags(String prefix) {
Collection<HtmlTag> result = Collections.emptyList();
Collection<HtmlTag> result;
HtmlModel htmlModel = HtmlModelFactory.getModel(HtmlVersion.HTML5);
Collection<HtmlTag> allTags = htmlModel.getAllTags();
if (prefix.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public List<CompletionProposal> complete(CodeCompletionContext ccContext, Comple
}

if (relativeTo.isEmpty()) {
Collection<String> basePaths = new ArrayList<String>();
Collection<String> basePaths;
if (rIndex != null) {
basePaths = rIndex.getBasePaths();
relativeTo.add(fo.getParent());
Expand Down

0 comments on commit 410710e

Please sign in to comment.